@pretextbook/web-editor 0.0.17 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- (function(kt,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],I):(kt=typeof globalThis<"u"?globalThis:kt||self,I(kt.PretextWebEditor={},kt.React,kt.ReactDOM))})(this,(function(kt,I,ji){"use strict";function S1(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const k1=S1(I);var Ui={exports:{}},ei={};var N0;function M1(){if(N0)return ei;N0=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:r,type:n,key:o,ref:i!==void 0?i:null,props:s}}return ei.Fragment=e,ei.jsx=t,ei.jsxs=t,ei}var ti={};var D0;function T1(){return D0||(D0=1,process.env.NODE_ENV!=="production"&&(function(){function r(w){if(w==null)return null;if(typeof w=="function")return w.$$typeof===te?null:w.displayName||w.name||null;if(typeof w=="string")return w;switch(w){case v:return"Fragment";case T:return"Profiler";case x:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case q:return"Activity"}if(typeof w=="object")switch(typeof w.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),w.$$typeof){case y:return"Portal";case P:return w.displayName||"Context";case D:return(w._context.displayName||"Context")+".Consumer";case N:var z=w.render;return w=w.displayName,w||(w=z.displayName||z.name||"",w=w!==""?"ForwardRef("+w+")":"ForwardRef"),w;case $:return z=w.displayName||null,z!==null?z:r(w.type)||"Memo";case F:z=w._payload,w=w._init;try{return r(w(z))}catch{}}return null}function e(w){return""+w}function t(w){try{e(w);var z=!1}catch{z=!0}if(z){z=console;var L=z.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&w[Symbol.toStringTag]||w.constructor.name||"Object";return L.call(z,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),e(w)}}function n(w){if(w===v)return"<>";if(typeof w=="object"&&w!==null&&w.$$typeof===F)return"<...>";try{var z=r(w);return z?"<"+z+">":"<...>"}catch{return"<...>"}}function i(){var w=Y.A;return w===null?null:w.getOwner()}function s(){return Error("react-stack-top-frame")}function o(w){if(he.call(w,"key")){var z=Object.getOwnPropertyDescriptor(w,"key").get;if(z&&z.isReactWarning)return!1}return w.key!==void 0}function a(w,z){function L(){ne||(ne=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",z))}L.isReactWarning=!0,Object.defineProperty(w,"key",{get:L,configurable:!0})}function l(){var w=r(this.type);return ve[w]||(ve[w]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),w=this.props.ref,w!==void 0?w:null}function c(w,z,L,B,K,re){var j=L.ref;return w={$$typeof:m,type:w,key:z,props:L,_owner:B},(j!==void 0?j:null)!==null?Object.defineProperty(w,"ref",{enumerable:!1,get:l}):Object.defineProperty(w,"ref",{enumerable:!1,value:null}),w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(w,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(w,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(w,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w}function u(w,z,L,B,K,re){var j=z.children;if(j!==void 0)if(B)if(Q(j)){for(B=0;B<j.length;B++)d(j[B]);Object.freeze&&Object.freeze(j)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(j);if(he.call(z,"key")){j=r(w);var ie=Object.keys(z).filter(function(Ce){return Ce!=="key"});B=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",C[j+B]||(ie=0<ie.length?"{"+ie.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(kt,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],z):(kt=typeof globalThis<"u"?globalThis:kt||self,z(kt.PretextWebEditor={},kt.React,kt.ReactDOM))})(this,(function(kt,z,ji){"use strict";function S1(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const k1=S1(z);var Ui={exports:{}},ei={};var N0;function M1(){if(N0)return ei;N0=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:r,type:n,key:o,ref:i!==void 0?i:null,props:s}}return ei.Fragment=e,ei.jsx=t,ei.jsxs=t,ei}var ti={};var D0;function T1(){return D0||(D0=1,process.env.NODE_ENV!=="production"&&(function(){function r(w){if(w==null)return null;if(typeof w=="function")return w.$$typeof===te?null:w.displayName||w.name||null;if(typeof w=="string")return w;switch(w){case v:return"Fragment";case T:return"Profiler";case x:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case q:return"Activity"}if(typeof w=="object")switch(typeof w.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),w.$$typeof){case y:return"Portal";case P:return w.displayName||"Context";case D:return(w._context.displayName||"Context")+".Consumer";case N:var I=w.render;return w=w.displayName,w||(w=I.displayName||I.name||"",w=w!==""?"ForwardRef("+w+")":"ForwardRef"),w;case $:return I=w.displayName||null,I!==null?I:r(w.type)||"Memo";case F:I=w._payload,w=w._init;try{return r(w(I))}catch{}}return null}function e(w){return""+w}function t(w){try{e(w);var I=!1}catch{I=!0}if(I){I=console;var L=I.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&w[Symbol.toStringTag]||w.constructor.name||"Object";return L.call(I,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),e(w)}}function n(w){if(w===v)return"<>";if(typeof w=="object"&&w!==null&&w.$$typeof===F)return"<...>";try{var I=r(w);return I?"<"+I+">":"<...>"}catch{return"<...>"}}function i(){var w=Y.A;return w===null?null:w.getOwner()}function s(){return Error("react-stack-top-frame")}function o(w){if(he.call(w,"key")){var I=Object.getOwnPropertyDescriptor(w,"key").get;if(I&&I.isReactWarning)return!1}return w.key!==void 0}function a(w,I){function L(){ne||(ne=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",I))}L.isReactWarning=!0,Object.defineProperty(w,"key",{get:L,configurable:!0})}function l(){var w=r(this.type);return ve[w]||(ve[w]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),w=this.props.ref,w!==void 0?w:null}function c(w,I,L,B,K,re){var j=L.ref;return w={$$typeof:m,type:w,key:I,props:L,_owner:B},(j!==void 0?j:null)!==null?Object.defineProperty(w,"ref",{enumerable:!1,get:l}):Object.defineProperty(w,"ref",{enumerable:!1,value:null}),w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(w,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(w,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(w,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w}function u(w,I,L,B,K,re){var j=I.children;if(j!==void 0)if(B)if(Q(j)){for(B=0;B<j.length;B++)d(j[B]);Object.freeze&&Object.freeze(j)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(j);if(he.call(I,"key")){j=r(w);var ie=Object.keys(I).filter(function(Ce){return Ce!=="key"});B=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",C[j+B]||(ie=0<ie.length?"{"+ie.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,B,j,ie,j),C[j+B]=!0)}if(j=null,L!==void 0&&(t(L),j=""+L),o(z)&&(t(z.key),j=""+z.key),"key"in z){L={};for(var me in z)me!=="key"&&(L[me]=z[me])}else L=z;return j&&a(L,typeof w=="function"?w.displayName||w.name||"Unknown":w),c(w,j,L,i(),K,re)}function d(w){h(w)?w._store&&(w._store.validated=1):typeof w=="object"&&w!==null&&w.$$typeof===F&&(w._payload.status==="fulfilled"?h(w._payload.value)&&w._payload.value._store&&(w._payload.value._store.validated=1):w._store&&(w._store.validated=1))}function h(w){return typeof w=="object"&&w!==null&&w.$$typeof===m}var f=I,m=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),P=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),te=Symbol.for("react.client.reference"),Y=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=Object.prototype.hasOwnProperty,Q=Array.isArray,W=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(w){return w()}};var ne,ve={},ge=f.react_stack_bottom_frame.bind(f,s)(),Ae=W(n(s)),C={};ti.Fragment=v,ti.jsx=function(w,z,L){var B=1e4>Y.recentlyCreatedOwnerStacks++;return u(w,z,L,!1,B?Error("react-stack-top-frame"):ge,B?W(n(w)):Ae)},ti.jsxs=function(w,z,L){var B=1e4>Y.recentlyCreatedOwnerStacks++;return u(w,z,L,!0,B?Error("react-stack-top-frame"):ge,B?W(n(w)):Ae)}})()),ti}var z0;function C1(){return z0||(z0=1,process.env.NODE_ENV==="production"?Ui.exports=M1():Ui.exports=T1()),Ui.exports}var J=C1();const Wi=I.createContext(null);Wi.displayName="PanelGroupContext";const Re={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Io=10,Yr=I.useLayoutEffect,I0=k1.useId,E1=typeof I0=="function"?I0:()=>null;let A1=0;function Ro(r=null){const e=E1(),t=I.useRef(r||e||null);return t.current===null&&(t.current=""+A1++),r??t.current}function R0({children:r,className:e="",collapsedSize:t,collapsible:n,defaultSize:i,forwardedRef:s,id:o,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:h,style:f,tagName:m="div",...y}){const v=I.useContext(Wi);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:T,getPanelSize:D,getPanelStyle:P,groupId:N,isPanelCollapsed:O,reevaluatePanelConstraints:A,registerPanel:$,resizePanel:F,unregisterPanel:q}=v,te=Ro(o),Y=I.useRef({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:t,collapsible:n,defaultSize:i,maxSize:a,minSize:l},id:te,idIsFromProps:o!==void 0,order:h});I.useRef({didLogMissingDefaultSizeWarning:!1}),Yr(()=>{const{callbacks:Q,constraints:W}=Y.current,ne={...W};Y.current.id=te,Y.current.idIsFromProps=o!==void 0,Y.current.order=h,Q.onCollapse=c,Q.onExpand=u,Q.onResize=d,W.collapsedSize=t,W.collapsible=n,W.defaultSize=i,W.maxSize=a,W.minSize=l,(ne.collapsedSize!==W.collapsedSize||ne.collapsible!==W.collapsible||ne.maxSize!==W.maxSize||ne.minSize!==W.minSize)&&A(Y.current,ne)}),Yr(()=>{const Q=Y.current;return $(Q),()=>{q(Q)}},[h,te,$,q]),I.useImperativeHandle(s,()=>({collapse:()=>{x(Y.current)},expand:Q=>{T(Y.current,Q)},getId(){return te},getSize(){return D(Y.current)},isCollapsed(){return O(Y.current)},isExpanded(){return!O(Y.current)},resize:Q=>{F(Y.current,Q)}}),[x,T,D,O,te,F]);const he=P(Y.current,i);return I.createElement(m,{...y,children:r,className:e,id:te,style:{...he,...f},[Re.groupId]:N,[Re.panel]:"",[Re.panelCollapsible]:n||void 0,[Re.panelId]:te,[Re.panelSize]:parseFloat(""+he.flexGrow).toFixed(1)})}const Po=I.forwardRef((r,e)=>I.createElement(R0,{...r,forwardedRef:e}));R0.displayName="Panel",Po.displayName="forwardRef(Panel)";let Lo=null,Gi=-1,Sr=null;function O1(r,e){if(e){const t=(e&q0)!==0,n=(e&_0)!==0,i=(e&j0)!==0,s=(e&U0)!==0;if(t)return i?"se-resize":s?"ne-resize":"e-resize";if(n)return i?"sw-resize":s?"nw-resize":"w-resize";if(i)return"s-resize";if(s)return"n-resize"}switch(r){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function N1(){Sr!==null&&(document.head.removeChild(Sr),Lo=null,Sr=null,Gi=-1)}function Bo(r,e){var t,n;const i=O1(r,e);if(Lo!==i){if(Lo=i,Sr===null&&(Sr=document.createElement("style"),document.head.appendChild(Sr)),Gi>=0){var s;(s=Sr.sheet)===null||s===void 0||s.removeRule(Gi)}Gi=(t=(n=Sr.sheet)===null||n===void 0?void 0:n.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function P0(r){return r.type==="keydown"}function L0(r){return r.type.startsWith("pointer")}function B0(r){return r.type.startsWith("mouse")}function Ki(r){if(L0(r)){if(r.isPrimary)return{x:r.clientX,y:r.clientY}}else if(B0(r))return{x:r.clientX,y:r.clientY};return{x:1/0,y:1/0}}function D1(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function z1(r,e,t){return r.x<e.x+e.width&&r.x+r.width>e.x&&r.y<e.y+e.height&&r.y+r.height>e.y}function I1(r,e){if(r===e)throw new Error("Cannot compare node with itself");const t={a:H0(r),b:H0(e)};let n;for(;t.a.at(-1)===t.b.at(-1);)r=t.a.pop(),e=t.b.pop(),n=r;pe(n,"Stacking order can only be calculated for elements with a common ancestor");const i={a:$0(F0(t.a)),b:$0(F0(t.b))};if(i.a===i.b){const s=n.childNodes,o={a:t.a.at(-1),b:t.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===o.a)return 1;if(l===o.b)return-1}}return Math.sign(i.a-i.b)}const R1=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function P1(r){var e;const t=getComputedStyle((e=V0(r))!==null&&e!==void 0?e:r).display;return t==="flex"||t==="inline-flex"}function L1(r){const e=getComputedStyle(r);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||P1(r))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||R1.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function F0(r){let e=r.length;for(;e--;){const t=r[e];if(pe(t,"Missing node"),L1(t))return t}return null}function $0(r){return r&&Number(getComputedStyle(r).zIndex)||0}function H0(r){const e=[];for(;r;)e.push(r),r=V0(r);return e}function V0(r){const{parentNode:e}=r;return e&&e instanceof ShadowRoot?e.host:e}const q0=1,_0=2,j0=4,U0=8,B1=D1()==="coarse";let Rt=[],kn=!1,Zr=new Map,Ji=new Map;const ri=new Set;function F1(r,e,t,n,i){var s;const{ownerDocument:o}=e,a={direction:t,element:e,hitAreaMargins:n,setResizeHandlerState:i},l=(s=Zr.get(o))!==null&&s!==void 0?s:0;return Zr.set(o,l+1),ri.add(a),Xi(),function(){var u;Ji.delete(r),ri.delete(a);const d=(u=Zr.get(o))!==null&&u!==void 0?u:1;if(Zr.set(o,d-1),Xi(),d===1&&Zr.delete(o),Rt.includes(a)){const h=Rt.indexOf(a);h>=0&&Rt.splice(h,1),qo(),i("up",!0,null)}}}function $1(r){const{target:e}=r,{x:t,y:n}=Ki(r);kn=!0,Ho({target:e,x:t,y:n}),Xi(),Rt.length>0&&(Yi("down",r),r.preventDefault(),W0(e)||r.stopImmediatePropagation())}function Fo(r){const{x:e,y:t}=Ki(r);if(kn&&r.buttons===0&&(kn=!1,Yi("up",r)),!kn){const{target:n}=r;Ho({target:n,x:e,y:t})}Yi("move",r),qo(),Rt.length>0&&r.preventDefault()}function $o(r){const{target:e}=r,{x:t,y:n}=Ki(r);Ji.clear(),kn=!1,Rt.length>0&&(r.preventDefault(),W0(e)||r.stopImmediatePropagation()),Yi("up",r),Ho({target:e,x:t,y:n}),qo(),Xi()}function W0(r){let e=r;for(;e;){if(e.hasAttribute(Re.resizeHandle))return!0;e=e.parentElement}return!1}function Ho({target:r,x:e,y:t}){Rt.splice(0);let n=null;(r instanceof HTMLElement||r instanceof SVGElement)&&(n=r),ri.forEach(i=>{const{element:s,hitAreaMargins:o}=i,a=s.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,h=B1?o.coarse:o.fine;if(e>=c-h&&e<=u+h&&t>=d-h&&t<=l+h){if(n!==null&&document.contains(n)&&s!==n&&!s.contains(n)&&!n.contains(s)&&I1(n,s)>0){let m=n,y=!1;for(;m&&!m.contains(s);){if(z1(m.getBoundingClientRect(),a)){y=!0;break}m=m.parentElement}if(y)return}Rt.push(i)}})}function Vo(r,e){Ji.set(r,e)}function qo(){let r=!1,e=!1;Rt.forEach(n=>{const{direction:i}=n;i==="horizontal"?r=!0:e=!0});let t=0;Ji.forEach(n=>{t|=n}),r&&e?Bo("intersection",t):r?Bo("horizontal",t):e?Bo("vertical",t):N1()}let _o=new AbortController;function Xi(){_o.abort(),_o=new AbortController;const r={capture:!0,signal:_o.signal};ri.size&&(kn?(Rt.length>0&&Zr.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",$o,r),n.addEventListener("pointerleave",Fo,r),n.addEventListener("pointermove",Fo,r))}),window.addEventListener("pointerup",$o,r),window.addEventListener("pointercancel",$o,r)):Zr.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",$1,r),n.addEventListener("pointermove",Fo,r))}))}function Yi(r,e){ri.forEach(t=>{const{setResizeHandlerState:n}=t,i=Rt.includes(t);n(r,i,e)})}function H1(){const[r,e]=I.useState(0);return I.useCallback(()=>e(t=>t+1),[])}function pe(r,e){if(!r)throw console.error(e),Error(e)}function Qr(r,e,t=Io){return r.toFixed(t)===e.toFixed(t)?0:r>e?1:-1}function tr(r,e,t=Io){return Qr(r,e,t)===0}function mt(r,e,t){return Qr(r,e,t)===0}function V1(r,e,t){if(r.length!==e.length)return!1;for(let n=0;n<r.length;n++){const i=r[n],s=e[n];if(!mt(i,s,t))return!1}return!0}function Mn({panelConstraints:r,panelIndex:e,size:t}){const n=r[e];pe(n!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:s,maxSize:o=100,minSize:a=0}=n;if(Qr(t,a)<0)if(s){const l=(i+a)/2;Qr(t,l)<0?t=i:t=a}else t=a;return t=Math.min(o,t),t=parseFloat(t.toFixed(Io)),t}function ni({delta:r,initialLayout:e,panelConstraints:t,pivotIndices:n,prevLayout:i,trigger:s}){if(mt(r,0))return e;const o=[...e],[a,l]=n;pe(a!=null,"Invalid first pivot index"),pe(l!=null,"Invalid second pivot index");let c=0;if(s==="keyboard"){{const d=r<0?l:a,h=t[d];pe(h,`Panel constraints not found for index ${d}`);const{collapsedSize:f=0,collapsible:m,minSize:y=0}=h;if(m){const v=e[d];if(pe(v!=null,`Previous layout not found for panel index ${d}`),mt(v,f)){const x=y-v;Qr(x,Math.abs(r))>0&&(r=r<0?0-x:x)}}}{const d=r<0?a:l,h=t[d];pe(h,`No panel constraints found for index ${d}`);const{collapsedSize:f=0,collapsible:m,minSize:y=0}=h;if(m){const v=e[d];if(pe(v!=null,`Previous layout not found for panel index ${d}`),mt(v,y)){const x=v-f;Qr(x,Math.abs(r))>0&&(r=r<0?0-x:x)}}}}{const d=r<0?1:-1;let h=r<0?l:a,f=0;for(;;){const y=e[h];pe(y!=null,`Previous layout not found for panel index ${h}`);const x=Mn({panelConstraints:t,panelIndex:h,size:100})-y;if(f+=x,h+=d,h<0||h>=t.length)break}const m=Math.min(Math.abs(r),Math.abs(f));r=r<0?0-m:m}{let h=r<0?a:l;for(;h>=0&&h<t.length;){const f=Math.abs(r)-Math.abs(c),m=e[h];pe(m!=null,`Previous layout not found for panel index ${h}`);const y=m-f,v=Mn({panelConstraints:t,panelIndex:h,size:y});if(!mt(m,v)&&(c+=m-v,o[h]=v,c.toPrecision(3).localeCompare(Math.abs(r).toPrecision(3),void 0,{numeric:!0})>=0))break;r<0?h--:h++}}if(V1(i,o))return i;{const d=r<0?l:a,h=e[d];pe(h!=null,`Previous layout not found for panel index ${d}`);const f=h+c,m=Mn({panelConstraints:t,panelIndex:d,size:f});if(o[d]=m,!mt(m,f)){let y=f-m,x=r<0?l:a;for(;x>=0&&x<t.length;){const T=o[x];pe(T!=null,`Previous layout not found for panel index ${x}`);const D=T+y,P=Mn({panelConstraints:t,panelIndex:x,size:D});if(mt(T,P)||(y-=P-T,o[x]=P),mt(y,0))break;r>0?x--:x++}}}const u=o.reduce((d,h)=>h+d,0);return mt(u,100)?o:i}function q1({layout:r,panelsArray:e,pivotIndices:t}){let n=0,i=100,s=0,o=0;const a=t[0];pe(a!=null,"No pivot index found"),e.forEach((d,h)=>{const{constraints:f}=d,{maxSize:m=100,minSize:y=0}=f;h===a?(n=y,i=m):(s+=y,o+=m)});const l=Math.min(i,100-s),c=Math.max(n,100-o),u=r[a];return{valueMax:l,valueMin:c,valueNow:u}}function ii(r,e=document){return Array.from(e.querySelectorAll(`[${Re.resizeHandleId}][data-panel-group-id="${r}"]`))}function G0(r,e,t=document){const i=ii(r,t).findIndex(s=>s.getAttribute(Re.resizeHandleId)===e);return i??null}function K0(r,e,t){const n=G0(r,e,t);return n!=null?[n,n+1]:[-1,-1]}function J0(r,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==r)return e;const n=e.querySelector(`[data-panel-group][data-panel-group-id="${r}"]`);return n||null}function Zi(r,e=document){const t=e.querySelector(`[${Re.resizeHandleId}="${r}"]`);return t||null}function _1(r,e,t,n=document){var i,s,o,a;const l=Zi(e,n),c=ii(r,n),u=l?c.indexOf(l):-1,d=(i=(s=t[u])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null,h=(o=(a=t[u+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[d,h]}function j1({committedValuesRef:r,eagerValuesRef:e,groupId:t,layout:n,panelDataArray:i,panelGroupElement:s,setLayout:o}){I.useRef({didWarnAboutMissingResizeHandle:!1}),Yr(()=>{if(!s)return;const a=ii(t,s);for(let l=0;l<i.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=q1({layout:n,panelsArray:i,pivotIndices:[l,l+1]}),h=a[l];if(h!=null){const f=i[l];pe(f,`No panel data found for index "${l}"`),h.setAttribute("aria-controls",f.id),h.setAttribute("aria-valuemax",""+Math.round(c)),h.setAttribute("aria-valuemin",""+Math.round(u)),h.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[t,n,i,s]),I.useEffect(()=>{if(!s)return;const a=e.current;pe(a,"Eager values not found");const{panelDataArray:l}=a,c=J0(t,s);pe(c!=null,`No group found for id "${t}"`);const u=ii(t,s);pe(u,`No resize handles found for group id "${t}"`);const d=u.map(h=>{const f=h.getAttribute(Re.resizeHandleId);pe(f,"Resize handle element has no handle id attribute");const[m,y]=_1(t,f,l,s);if(m==null||y==null)return()=>{};const v=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const T=l.findIndex(D=>D.id===m);if(T>=0){const D=l[T];pe(D,`No panel data found for index ${T}`);const P=n[T],{collapsedSize:N=0,collapsible:O,minSize:A=0}=D.constraints;if(P!=null&&O){const $=ni({delta:mt(P,N)?A-N:N-P,initialLayout:n,panelConstraints:l.map(F=>F.constraints),pivotIndices:K0(t,f,s),prevLayout:n,trigger:"keyboard"});n!==$&&o($)}}break}}};return h.addEventListener("keydown",v),()=>{h.removeEventListener("keydown",v)}});return()=>{d.forEach(h=>h())}},[s,r,e,t,n,i,o])}function X0(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function Y0(r,e){const t=r==="horizontal",{x:n,y:i}=Ki(e);return t?n:i}function U1(r,e,t,n,i){const s=t==="horizontal",o=Zi(e,i);pe(o,`No resize handle element found for id "${e}"`);const a=o.getAttribute(Re.groupId);pe(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=n;const c=Y0(t,r),u=J0(a,i);pe(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),h=s?d.width:d.height;return(c-l)/h*100}function W1(r,e,t,n,i,s){if(P0(r)){const o=t==="horizontal";let a=0;r.shiftKey?a=100:i!=null?a=i:a=10;let l=0;switch(r.key){case"ArrowDown":l=o?0:a;break;case"ArrowLeft":l=o?-a:0;break;case"ArrowRight":l=o?a:0;break;case"ArrowUp":l=o?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return n==null?0:U1(r,e,t,n,s)}function G1({panelDataArray:r}){const e=Array(r.length),t=r.map(s=>s.constraints);let n=0,i=100;for(let s=0;s<r.length;s++){const o=t[s];pe(o,`Panel constraints not found for index ${s}`);const{defaultSize:a}=o;a!=null&&(n++,e[s]=a,i-=a)}for(let s=0;s<r.length;s++){const o=t[s];pe(o,`Panel constraints not found for index ${s}`);const{defaultSize:a}=o;if(a!=null)continue;const l=r.length-n,c=i/l;n++,e[s]=c,i-=c}return e}function Tn(r,e,t){e.forEach((n,i)=>{const s=r[i];pe(s,`Panel data not found for index ${i}`);const{callbacks:o,constraints:a,id:l}=s,{collapsedSize:c=0,collapsible:u}=a,d=t[l];if(d==null||n!==d){t[l]=n;const{onCollapse:h,onExpand:f,onResize:m}=o;m&&m(n,d),u&&(h||f)&&(f&&(d==null||tr(d,c))&&!tr(n,c)&&f(),h&&(d==null||!tr(d,c))&&tr(n,c)&&h())}})}function Qi(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!=e[t])return!1;return!0}function K1({defaultSize:r,dragState:e,layout:t,panelData:n,panelIndex:i,precision:s=3}){const o=t[i];let a;return o==null?a=r!=null?r.toPrecision(s):"1":n.length===1?a="1":a=o.toPrecision(s),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function J1(r,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{r(...i)},e)}}function Z0(r){try{if(typeof localStorage<"u")r.getItem=e=>localStorage.getItem(e),r.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),r.getItem=()=>null,r.setItem=()=>{}}}function Q0(r){return`react-resizable-panels:${r}`}function ec(r){return r.map(e=>{const{constraints:t,id:n,idIsFromProps:i,order:s}=e;return i?n:s?`${s}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function tc(r,e){try{const t=Q0(r),n=e.getItem(t);if(n){const i=JSON.parse(n);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function X1(r,e,t){var n,i;const s=(n=tc(r,t))!==null&&n!==void 0?n:{},o=ec(e);return(i=s[o])!==null&&i!==void 0?i:null}function Y1(r,e,t,n,i){var s;const o=Q0(r),a=ec(e),l=(s=tc(r,i))!==null&&s!==void 0?s:{};l[a]={expandToSizes:Object.fromEntries(t.entries()),layout:n};try{i.setItem(o,JSON.stringify(l))}catch(c){console.error(c)}}function rc({layout:r,panelConstraints:e}){const t=[...r],n=t.reduce((s,o)=>s+o,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(s=>`${s}%`).join(", ")}`);if(!mt(n,100)&&t.length>0)for(let s=0;s<e.length;s++){const o=t[s];pe(o!=null,`No layout data found for index ${s}`);const a=100/n*o;t[s]=a}let i=0;for(let s=0;s<e.length;s++){const o=t[s];pe(o!=null,`No layout data found for index ${s}`);const a=Mn({panelConstraints:e,panelIndex:s,size:o});o!=a&&(i+=o-a,t[s]=a)}if(!mt(i,0))for(let s=0;s<e.length;s++){const o=t[s];pe(o!=null,`No layout data found for index ${s}`);const a=o+i,l=Mn({panelConstraints:e,panelIndex:s,size:a});if(o!==l&&(i-=l-o,t[s]=l,mt(i,0)))break}return t}const Z1=100,si={getItem:r=>(Z0(si),si.getItem(r)),setItem:(r,e)=>{Z0(si),si.setItem(r,e)}},nc={};function ic({autoSaveId:r=null,children:e,className:t="",direction:n,forwardedRef:i,id:s=null,onLayout:o=null,keyboardResizeBy:a=null,storage:l=si,style:c,tagName:u="div",...d}){const h=Ro(s),f=I.useRef(null),[m,y]=I.useState(null),[v,x]=I.useState([]),T=H1(),D=I.useRef({}),P=I.useRef(new Map),N=I.useRef(0),O=I.useRef({autoSaveId:r,direction:n,dragState:m,id:h,keyboardResizeBy:a,onLayout:o,storage:l}),A=I.useRef({layout:v,panelDataArray:[],panelDataArrayChanged:!1});I.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),I.useImperativeHandle(i,()=>({getId:()=>O.current.id,getLayout:()=>{const{layout:L}=A.current;return L},setLayout:L=>{const{onLayout:B}=O.current,{layout:K,panelDataArray:re}=A.current,j=rc({layout:L,panelConstraints:re.map(ie=>ie.constraints)});X0(K,j)||(x(j),A.current.layout=j,B&&B(j),Tn(re,j,D.current))}}),[]),Yr(()=>{O.current.autoSaveId=r,O.current.direction=n,O.current.dragState=m,O.current.id=h,O.current.onLayout=o,O.current.storage=l}),j1({committedValuesRef:O,eagerValuesRef:A,groupId:h,layout:v,panelDataArray:A.current.panelDataArray,setLayout:x,panelGroupElement:f.current}),I.useEffect(()=>{const{panelDataArray:L}=A.current;if(r){if(v.length===0||v.length!==L.length)return;let B=nc[r];B==null&&(B=J1(Y1,Z1),nc[r]=B);const K=[...L],re=new Map(P.current);B(r,K,re,v,l)}},[r,v,l]),I.useEffect(()=>{});const $=I.useCallback(L=>{const{onLayout:B}=O.current,{layout:K,panelDataArray:re}=A.current;if(L.constraints.collapsible){const j=re.map(zt=>zt.constraints),{collapsedSize:ie=0,panelSize:me,pivotIndices:Ce}=en(re,L,K);if(pe(me!=null,`Panel size not found for panel "${L.id}"`),!tr(me,ie)){P.current.set(L.id,me);const It=Cn(re,L)===re.length-1?me-ie:ie-me,Ne=ni({delta:It,initialLayout:K,panelConstraints:j,pivotIndices:Ce,prevLayout:K,trigger:"imperative-api"});Qi(K,Ne)||(x(Ne),A.current.layout=Ne,B&&B(Ne),Tn(re,Ne,D.current))}}},[]),F=I.useCallback((L,B)=>{const{onLayout:K}=O.current,{layout:re,panelDataArray:j}=A.current;if(L.constraints.collapsible){const ie=j.map(ct=>ct.constraints),{collapsedSize:me=0,panelSize:Ce=0,minSize:zt=0,pivotIndices:It}=en(j,L,re),Ne=B??zt;if(tr(Ce,me)){const ct=P.current.get(L.id),Xr=ct!=null&&ct>=Ne?ct:Ne,wn=Cn(j,L)===j.length-1?Ce-Xr:Xr-Ce,je=ni({delta:wn,initialLayout:re,panelConstraints:ie,pivotIndices:It,prevLayout:re,trigger:"imperative-api"});Qi(re,je)||(x(je),A.current.layout=je,K&&K(je),Tn(j,je,D.current))}}},[]),q=I.useCallback(L=>{const{layout:B,panelDataArray:K}=A.current,{panelSize:re}=en(K,L,B);return pe(re!=null,`Panel size not found for panel "${L.id}"`),re},[]),te=I.useCallback((L,B)=>{const{panelDataArray:K}=A.current,re=Cn(K,L);return K1({defaultSize:B,dragState:m,layout:v,panelData:K,panelIndex:re})},[m,v]),Y=I.useCallback(L=>{const{layout:B,panelDataArray:K}=A.current,{collapsedSize:re=0,collapsible:j,panelSize:ie}=en(K,L,B);return pe(ie!=null,`Panel size not found for panel "${L.id}"`),j===!0&&tr(ie,re)},[]),he=I.useCallback(L=>{const{layout:B,panelDataArray:K}=A.current,{collapsedSize:re=0,collapsible:j,panelSize:ie}=en(K,L,B);return pe(ie!=null,`Panel size not found for panel "${L.id}"`),!j||Qr(ie,re)>0},[]),Q=I.useCallback(L=>{const{panelDataArray:B}=A.current;B.push(L),B.sort((K,re)=>{const j=K.order,ie=re.order;return j==null&&ie==null?0:j==null?-1:ie==null?1:j-ie}),A.current.panelDataArrayChanged=!0,T()},[T]);Yr(()=>{if(A.current.panelDataArrayChanged){A.current.panelDataArrayChanged=!1;const{autoSaveId:L,onLayout:B,storage:K}=O.current,{layout:re,panelDataArray:j}=A.current;let ie=null;if(L){const Ce=X1(L,j,K);Ce&&(P.current=new Map(Object.entries(Ce.expandToSizes)),ie=Ce.layout)}ie==null&&(ie=G1({panelDataArray:j}));const me=rc({layout:ie,panelConstraints:j.map(Ce=>Ce.constraints)});X0(re,me)||(x(me),A.current.layout=me,B&&B(me),Tn(j,me,D.current))}}),Yr(()=>{const L=A.current;return()=>{L.layout=[]}},[]);const W=I.useCallback(L=>{let B=!1;const K=f.current;return K&&window.getComputedStyle(K,null).getPropertyValue("direction")==="rtl"&&(B=!0),function(j){j.preventDefault();const ie=f.current;if(!ie)return()=>null;const{direction:me,dragState:Ce,id:zt,keyboardResizeBy:It,onLayout:Ne}=O.current,{layout:ct,panelDataArray:Xr}=A.current,{initialLayout:xn}=Ce??{},wn=K0(zt,L,ie);let je=W1(j,L,me,Ce,It,ie);const Sn=me==="horizontal";Sn&&B&&(je=-je);const nw=Xr.map(iw=>iw.constraints),_i=ni({delta:je,initialLayout:xn??ct,panelConstraints:nw,pivotIndices:wn,prevLayout:ct,trigger:P0(j)?"keyboard":"mouse-or-touch"}),h1=!Qi(ct,_i);(L0(j)||B0(j))&&N.current!=je&&(N.current=je,!h1&&je!==0?Sn?Vo(L,je<0?q0:_0):Vo(L,je<0?j0:U0):Vo(L,0)),h1&&(x(_i),A.current.layout=_i,Ne&&Ne(_i),Tn(Xr,_i,D.current))}},[]),ne=I.useCallback((L,B)=>{const{onLayout:K}=O.current,{layout:re,panelDataArray:j}=A.current,ie=j.map(ct=>ct.constraints),{panelSize:me,pivotIndices:Ce}=en(j,L,re);pe(me!=null,`Panel size not found for panel "${L.id}"`);const It=Cn(j,L)===j.length-1?me-B:B-me,Ne=ni({delta:It,initialLayout:re,panelConstraints:ie,pivotIndices:Ce,prevLayout:re,trigger:"imperative-api"});Qi(re,Ne)||(x(Ne),A.current.layout=Ne,K&&K(Ne),Tn(j,Ne,D.current))},[]),ve=I.useCallback((L,B)=>{const{layout:K,panelDataArray:re}=A.current,{collapsedSize:j=0,collapsible:ie}=B,{collapsedSize:me=0,collapsible:Ce,maxSize:zt=100,minSize:It=0}=L.constraints,{panelSize:Ne}=en(re,L,K);Ne!=null&&(ie&&Ce&&tr(Ne,j)?tr(j,me)||ne(L,me):Ne<It?ne(L,It):Ne>zt&&ne(L,zt))},[ne]),ge=I.useCallback((L,B)=>{const{direction:K}=O.current,{layout:re}=A.current;if(!f.current)return;const j=Zi(L,f.current);pe(j,`Drag handle element not found for id "${L}"`);const ie=Y0(K,B);y({dragHandleId:L,dragHandleRect:j.getBoundingClientRect(),initialCursorPosition:ie,initialLayout:re})},[]),Ae=I.useCallback(()=>{y(null)},[]),C=I.useCallback(L=>{const{panelDataArray:B}=A.current,K=Cn(B,L);K>=0&&(B.splice(K,1),delete D.current[L.id],A.current.panelDataArrayChanged=!0,T())},[T]),w=I.useMemo(()=>({collapsePanel:$,direction:n,dragState:m,expandPanel:F,getPanelSize:q,getPanelStyle:te,groupId:h,isPanelCollapsed:Y,isPanelExpanded:he,reevaluatePanelConstraints:ve,registerPanel:Q,registerResizeHandle:W,resizePanel:ne,startDragging:ge,stopDragging:Ae,unregisterPanel:C,panelGroupElement:f.current}),[$,m,n,F,q,te,h,Y,he,ve,Q,W,ne,ge,Ae,C]),z={display:"flex",flexDirection:n==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return I.createElement(Wi.Provider,{value:w},I.createElement(u,{...d,children:e,className:t,id:s,ref:f,style:{...z,...c},[Re.group]:"",[Re.groupDirection]:n,[Re.groupId]:h}))}const sc=I.forwardRef((r,e)=>I.createElement(ic,{...r,forwardedRef:e}));ic.displayName="PanelGroup",sc.displayName="forwardRef(PanelGroup)";function Cn(r,e){return r.findIndex(t=>t===e||t.id===e.id)}function en(r,e,t){const n=Cn(r,e),s=n===r.length-1?[n-1,n]:[n,n+1],o=t[n];return{...e.constraints,panelSize:o,pivotIndices:s}}function Q1({disabled:r,handleId:e,resizeHandler:t,panelGroupElement:n}){I.useEffect(()=>{if(r||t==null||n==null)return;const i=Zi(e,n);if(i==null)return;const s=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),t(o);break}case"F6":{o.preventDefault();const a=i.getAttribute(Re.groupId);pe(a,`No group element found for id "${a}"`);const l=ii(a,n),c=G0(a,e,n);pe(c!==null,`No resize element found for id "${e}"`);const u=o.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}},[n,r,e,t])}function oc({children:r=null,className:e="",disabled:t=!1,hitAreaMargins:n,id:i,onBlur:s,onClick:o,onDragging:a,onFocus:l,onPointerDown:c,onPointerUp:u,style:d={},tabIndex:h=0,tagName:f="div",...m}){var y,v;const x=I.useRef(null),T=I.useRef({onClick:o,onDragging:a,onPointerDown:c,onPointerUp:u});I.useEffect(()=>{T.current.onClick=o,T.current.onDragging=a,T.current.onPointerDown=c,T.current.onPointerUp=u});const D=I.useContext(Wi);if(D===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:P,groupId:N,registerResizeHandle:O,startDragging:A,stopDragging:$,panelGroupElement:F}=D,q=Ro(i),[te,Y]=I.useState("inactive"),[he,Q]=I.useState(!1),[W,ne]=I.useState(null),ve=I.useRef({state:te});Yr(()=>{ve.current.state=te}),I.useEffect(()=>{if(t)ne(null);else{const w=O(q);ne(()=>w)}},[t,q,O]);const ge=(y=n?.coarse)!==null&&y!==void 0?y:15,Ae=(v=n?.fine)!==null&&v!==void 0?v:5;I.useEffect(()=>{if(t||W==null)return;const w=x.current;pe(w,"Element ref not attached");let z=!1;return F1(q,w,P,{coarse:ge,fine:Ae},(B,K,re)=>{if(!K){Y("inactive");return}switch(B){case"down":{Y("drag"),z=!1,pe(re,'Expected event to be defined for "down" action'),A(q,re);const{onDragging:j,onPointerDown:ie}=T.current;j?.(!0),ie?.();break}case"move":{const{state:j}=ve.current;z=!0,j!=="drag"&&Y("hover"),pe(re,'Expected event to be defined for "move" action'),W(re);break}case"up":{Y("hover"),$();const{onClick:j,onDragging:ie,onPointerUp:me}=T.current;ie?.(!1),me?.(),z||j?.();break}}})},[ge,P,t,Ae,O,q,W,A,$]),Q1({disabled:t,handleId:q,resizeHandler:W,panelGroupElement:F});const C={touchAction:"none",userSelect:"none"};return I.createElement(f,{...m,children:r,className:e,id:i,onBlur:()=>{Q(!1),s?.()},onFocus:()=>{Q(!0),l?.()},ref:x,role:"separator",style:{...C,...d},tabIndex:h,[Re.groupDirection]:P,[Re.groupId]:N,[Re.resizeHandle]:"",[Re.resizeHandleActive]:te==="drag"?"pointer":he?"keyboard":void 0,[Re.resizeHandleEnabled]:!t,[Re.resizeHandleId]:q,[Re.resizeHandleState]:te})}oc.displayName="PanelResizeHandle";function ac(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function e4(r){if(Array.isArray(r))return r}function t4(r,e,t){return(e=l4(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function r4(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function n4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
6
+ <%s key={someKey} {...props} />`,B,j,ie,j),C[j+B]=!0)}if(j=null,L!==void 0&&(t(L),j=""+L),o(I)&&(t(I.key),j=""+I.key),"key"in I){L={};for(var me in I)me!=="key"&&(L[me]=I[me])}else L=I;return j&&a(L,typeof w=="function"?w.displayName||w.name||"Unknown":w),c(w,j,L,i(),K,re)}function d(w){h(w)?w._store&&(w._store.validated=1):typeof w=="object"&&w!==null&&w.$$typeof===F&&(w._payload.status==="fulfilled"?h(w._payload.value)&&w._payload.value._store&&(w._payload.value._store.validated=1):w._store&&(w._store.validated=1))}function h(w){return typeof w=="object"&&w!==null&&w.$$typeof===m}var f=z,m=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),P=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),te=Symbol.for("react.client.reference"),Y=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=Object.prototype.hasOwnProperty,Q=Array.isArray,W=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(w){return w()}};var ne,ve={},ge=f.react_stack_bottom_frame.bind(f,s)(),Ae=W(n(s)),C={};ti.Fragment=v,ti.jsx=function(w,I,L){var B=1e4>Y.recentlyCreatedOwnerStacks++;return u(w,I,L,!1,B?Error("react-stack-top-frame"):ge,B?W(n(w)):Ae)},ti.jsxs=function(w,I,L){var B=1e4>Y.recentlyCreatedOwnerStacks++;return u(w,I,L,!0,B?Error("react-stack-top-frame"):ge,B?W(n(w)):Ae)}})()),ti}var z0;function C1(){return z0||(z0=1,process.env.NODE_ENV==="production"?Ui.exports=M1():Ui.exports=T1()),Ui.exports}var J=C1();const Wi=z.createContext(null);Wi.displayName="PanelGroupContext";const Re={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Io=10,Yr=z.useLayoutEffect,I0=k1.useId,E1=typeof I0=="function"?I0:()=>null;let A1=0;function Ro(r=null){const e=E1(),t=z.useRef(r||e||null);return t.current===null&&(t.current=""+A1++),r??t.current}function R0({children:r,className:e="",collapsedSize:t,collapsible:n,defaultSize:i,forwardedRef:s,id:o,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:h,style:f,tagName:m="div",...y}){const v=z.useContext(Wi);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:T,getPanelSize:D,getPanelStyle:P,groupId:N,isPanelCollapsed:O,reevaluatePanelConstraints:A,registerPanel:$,resizePanel:F,unregisterPanel:q}=v,te=Ro(o),Y=z.useRef({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:t,collapsible:n,defaultSize:i,maxSize:a,minSize:l},id:te,idIsFromProps:o!==void 0,order:h});z.useRef({didLogMissingDefaultSizeWarning:!1}),Yr(()=>{const{callbacks:Q,constraints:W}=Y.current,ne={...W};Y.current.id=te,Y.current.idIsFromProps=o!==void 0,Y.current.order=h,Q.onCollapse=c,Q.onExpand=u,Q.onResize=d,W.collapsedSize=t,W.collapsible=n,W.defaultSize=i,W.maxSize=a,W.minSize=l,(ne.collapsedSize!==W.collapsedSize||ne.collapsible!==W.collapsible||ne.maxSize!==W.maxSize||ne.minSize!==W.minSize)&&A(Y.current,ne)}),Yr(()=>{const Q=Y.current;return $(Q),()=>{q(Q)}},[h,te,$,q]),z.useImperativeHandle(s,()=>({collapse:()=>{x(Y.current)},expand:Q=>{T(Y.current,Q)},getId(){return te},getSize(){return D(Y.current)},isCollapsed(){return O(Y.current)},isExpanded(){return!O(Y.current)},resize:Q=>{F(Y.current,Q)}}),[x,T,D,O,te,F]);const he=P(Y.current,i);return z.createElement(m,{...y,children:r,className:e,id:te,style:{...he,...f},[Re.groupId]:N,[Re.panel]:"",[Re.panelCollapsible]:n||void 0,[Re.panelId]:te,[Re.panelSize]:parseFloat(""+he.flexGrow).toFixed(1)})}const Po=z.forwardRef((r,e)=>z.createElement(R0,{...r,forwardedRef:e}));R0.displayName="Panel",Po.displayName="forwardRef(Panel)";let Lo=null,Gi=-1,Sr=null;function O1(r,e){if(e){const t=(e&q0)!==0,n=(e&_0)!==0,i=(e&j0)!==0,s=(e&U0)!==0;if(t)return i?"se-resize":s?"ne-resize":"e-resize";if(n)return i?"sw-resize":s?"nw-resize":"w-resize";if(i)return"s-resize";if(s)return"n-resize"}switch(r){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function N1(){Sr!==null&&(document.head.removeChild(Sr),Lo=null,Sr=null,Gi=-1)}function Bo(r,e){var t,n;const i=O1(r,e);if(Lo!==i){if(Lo=i,Sr===null&&(Sr=document.createElement("style"),document.head.appendChild(Sr)),Gi>=0){var s;(s=Sr.sheet)===null||s===void 0||s.removeRule(Gi)}Gi=(t=(n=Sr.sheet)===null||n===void 0?void 0:n.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function P0(r){return r.type==="keydown"}function L0(r){return r.type.startsWith("pointer")}function B0(r){return r.type.startsWith("mouse")}function Ki(r){if(L0(r)){if(r.isPrimary)return{x:r.clientX,y:r.clientY}}else if(B0(r))return{x:r.clientX,y:r.clientY};return{x:1/0,y:1/0}}function D1(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function z1(r,e,t){return r.x<e.x+e.width&&r.x+r.width>e.x&&r.y<e.y+e.height&&r.y+r.height>e.y}function I1(r,e){if(r===e)throw new Error("Cannot compare node with itself");const t={a:H0(r),b:H0(e)};let n;for(;t.a.at(-1)===t.b.at(-1);)r=t.a.pop(),e=t.b.pop(),n=r;pe(n,"Stacking order can only be calculated for elements with a common ancestor");const i={a:$0(F0(t.a)),b:$0(F0(t.b))};if(i.a===i.b){const s=n.childNodes,o={a:t.a.at(-1),b:t.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===o.a)return 1;if(l===o.b)return-1}}return Math.sign(i.a-i.b)}const R1=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function P1(r){var e;const t=getComputedStyle((e=V0(r))!==null&&e!==void 0?e:r).display;return t==="flex"||t==="inline-flex"}function L1(r){const e=getComputedStyle(r);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||P1(r))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||R1.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function F0(r){let e=r.length;for(;e--;){const t=r[e];if(pe(t,"Missing node"),L1(t))return t}return null}function $0(r){return r&&Number(getComputedStyle(r).zIndex)||0}function H0(r){const e=[];for(;r;)e.push(r),r=V0(r);return e}function V0(r){const{parentNode:e}=r;return e&&e instanceof ShadowRoot?e.host:e}const q0=1,_0=2,j0=4,U0=8,B1=D1()==="coarse";let Rt=[],kn=!1,Zr=new Map,Ji=new Map;const ri=new Set;function F1(r,e,t,n,i){var s;const{ownerDocument:o}=e,a={direction:t,element:e,hitAreaMargins:n,setResizeHandlerState:i},l=(s=Zr.get(o))!==null&&s!==void 0?s:0;return Zr.set(o,l+1),ri.add(a),Xi(),function(){var u;Ji.delete(r),ri.delete(a);const d=(u=Zr.get(o))!==null&&u!==void 0?u:1;if(Zr.set(o,d-1),Xi(),d===1&&Zr.delete(o),Rt.includes(a)){const h=Rt.indexOf(a);h>=0&&Rt.splice(h,1),qo(),i("up",!0,null)}}}function $1(r){const{target:e}=r,{x:t,y:n}=Ki(r);kn=!0,Ho({target:e,x:t,y:n}),Xi(),Rt.length>0&&(Yi("down",r),r.preventDefault(),W0(e)||r.stopImmediatePropagation())}function Fo(r){const{x:e,y:t}=Ki(r);if(kn&&r.buttons===0&&(kn=!1,Yi("up",r)),!kn){const{target:n}=r;Ho({target:n,x:e,y:t})}Yi("move",r),qo(),Rt.length>0&&r.preventDefault()}function $o(r){const{target:e}=r,{x:t,y:n}=Ki(r);Ji.clear(),kn=!1,Rt.length>0&&(r.preventDefault(),W0(e)||r.stopImmediatePropagation()),Yi("up",r),Ho({target:e,x:t,y:n}),qo(),Xi()}function W0(r){let e=r;for(;e;){if(e.hasAttribute(Re.resizeHandle))return!0;e=e.parentElement}return!1}function Ho({target:r,x:e,y:t}){Rt.splice(0);let n=null;(r instanceof HTMLElement||r instanceof SVGElement)&&(n=r),ri.forEach(i=>{const{element:s,hitAreaMargins:o}=i,a=s.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,h=B1?o.coarse:o.fine;if(e>=c-h&&e<=u+h&&t>=d-h&&t<=l+h){if(n!==null&&document.contains(n)&&s!==n&&!s.contains(n)&&!n.contains(s)&&I1(n,s)>0){let m=n,y=!1;for(;m&&!m.contains(s);){if(z1(m.getBoundingClientRect(),a)){y=!0;break}m=m.parentElement}if(y)return}Rt.push(i)}})}function Vo(r,e){Ji.set(r,e)}function qo(){let r=!1,e=!1;Rt.forEach(n=>{const{direction:i}=n;i==="horizontal"?r=!0:e=!0});let t=0;Ji.forEach(n=>{t|=n}),r&&e?Bo("intersection",t):r?Bo("horizontal",t):e?Bo("vertical",t):N1()}let _o=new AbortController;function Xi(){_o.abort(),_o=new AbortController;const r={capture:!0,signal:_o.signal};ri.size&&(kn?(Rt.length>0&&Zr.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",$o,r),n.addEventListener("pointerleave",Fo,r),n.addEventListener("pointermove",Fo,r))}),window.addEventListener("pointerup",$o,r),window.addEventListener("pointercancel",$o,r)):Zr.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",$1,r),n.addEventListener("pointermove",Fo,r))}))}function Yi(r,e){ri.forEach(t=>{const{setResizeHandlerState:n}=t,i=Rt.includes(t);n(r,i,e)})}function H1(){const[r,e]=z.useState(0);return z.useCallback(()=>e(t=>t+1),[])}function pe(r,e){if(!r)throw console.error(e),Error(e)}function Qr(r,e,t=Io){return r.toFixed(t)===e.toFixed(t)?0:r>e?1:-1}function tr(r,e,t=Io){return Qr(r,e,t)===0}function mt(r,e,t){return Qr(r,e,t)===0}function V1(r,e,t){if(r.length!==e.length)return!1;for(let n=0;n<r.length;n++){const i=r[n],s=e[n];if(!mt(i,s,t))return!1}return!0}function Mn({panelConstraints:r,panelIndex:e,size:t}){const n=r[e];pe(n!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:s,maxSize:o=100,minSize:a=0}=n;if(Qr(t,a)<0)if(s){const l=(i+a)/2;Qr(t,l)<0?t=i:t=a}else t=a;return t=Math.min(o,t),t=parseFloat(t.toFixed(Io)),t}function ni({delta:r,initialLayout:e,panelConstraints:t,pivotIndices:n,prevLayout:i,trigger:s}){if(mt(r,0))return e;const o=[...e],[a,l]=n;pe(a!=null,"Invalid first pivot index"),pe(l!=null,"Invalid second pivot index");let c=0;if(s==="keyboard"){{const d=r<0?l:a,h=t[d];pe(h,`Panel constraints not found for index ${d}`);const{collapsedSize:f=0,collapsible:m,minSize:y=0}=h;if(m){const v=e[d];if(pe(v!=null,`Previous layout not found for panel index ${d}`),mt(v,f)){const x=y-v;Qr(x,Math.abs(r))>0&&(r=r<0?0-x:x)}}}{const d=r<0?a:l,h=t[d];pe(h,`No panel constraints found for index ${d}`);const{collapsedSize:f=0,collapsible:m,minSize:y=0}=h;if(m){const v=e[d];if(pe(v!=null,`Previous layout not found for panel index ${d}`),mt(v,y)){const x=v-f;Qr(x,Math.abs(r))>0&&(r=r<0?0-x:x)}}}}{const d=r<0?1:-1;let h=r<0?l:a,f=0;for(;;){const y=e[h];pe(y!=null,`Previous layout not found for panel index ${h}`);const x=Mn({panelConstraints:t,panelIndex:h,size:100})-y;if(f+=x,h+=d,h<0||h>=t.length)break}const m=Math.min(Math.abs(r),Math.abs(f));r=r<0?0-m:m}{let h=r<0?a:l;for(;h>=0&&h<t.length;){const f=Math.abs(r)-Math.abs(c),m=e[h];pe(m!=null,`Previous layout not found for panel index ${h}`);const y=m-f,v=Mn({panelConstraints:t,panelIndex:h,size:y});if(!mt(m,v)&&(c+=m-v,o[h]=v,c.toPrecision(3).localeCompare(Math.abs(r).toPrecision(3),void 0,{numeric:!0})>=0))break;r<0?h--:h++}}if(V1(i,o))return i;{const d=r<0?l:a,h=e[d];pe(h!=null,`Previous layout not found for panel index ${d}`);const f=h+c,m=Mn({panelConstraints:t,panelIndex:d,size:f});if(o[d]=m,!mt(m,f)){let y=f-m,x=r<0?l:a;for(;x>=0&&x<t.length;){const T=o[x];pe(T!=null,`Previous layout not found for panel index ${x}`);const D=T+y,P=Mn({panelConstraints:t,panelIndex:x,size:D});if(mt(T,P)||(y-=P-T,o[x]=P),mt(y,0))break;r>0?x--:x++}}}const u=o.reduce((d,h)=>h+d,0);return mt(u,100)?o:i}function q1({layout:r,panelsArray:e,pivotIndices:t}){let n=0,i=100,s=0,o=0;const a=t[0];pe(a!=null,"No pivot index found"),e.forEach((d,h)=>{const{constraints:f}=d,{maxSize:m=100,minSize:y=0}=f;h===a?(n=y,i=m):(s+=y,o+=m)});const l=Math.min(i,100-s),c=Math.max(n,100-o),u=r[a];return{valueMax:l,valueMin:c,valueNow:u}}function ii(r,e=document){return Array.from(e.querySelectorAll(`[${Re.resizeHandleId}][data-panel-group-id="${r}"]`))}function G0(r,e,t=document){const i=ii(r,t).findIndex(s=>s.getAttribute(Re.resizeHandleId)===e);return i??null}function K0(r,e,t){const n=G0(r,e,t);return n!=null?[n,n+1]:[-1,-1]}function J0(r,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==r)return e;const n=e.querySelector(`[data-panel-group][data-panel-group-id="${r}"]`);return n||null}function Zi(r,e=document){const t=e.querySelector(`[${Re.resizeHandleId}="${r}"]`);return t||null}function _1(r,e,t,n=document){var i,s,o,a;const l=Zi(e,n),c=ii(r,n),u=l?c.indexOf(l):-1,d=(i=(s=t[u])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null,h=(o=(a=t[u+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[d,h]}function j1({committedValuesRef:r,eagerValuesRef:e,groupId:t,layout:n,panelDataArray:i,panelGroupElement:s,setLayout:o}){z.useRef({didWarnAboutMissingResizeHandle:!1}),Yr(()=>{if(!s)return;const a=ii(t,s);for(let l=0;l<i.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=q1({layout:n,panelsArray:i,pivotIndices:[l,l+1]}),h=a[l];if(h!=null){const f=i[l];pe(f,`No panel data found for index "${l}"`),h.setAttribute("aria-controls",f.id),h.setAttribute("aria-valuemax",""+Math.round(c)),h.setAttribute("aria-valuemin",""+Math.round(u)),h.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[t,n,i,s]),z.useEffect(()=>{if(!s)return;const a=e.current;pe(a,"Eager values not found");const{panelDataArray:l}=a,c=J0(t,s);pe(c!=null,`No group found for id "${t}"`);const u=ii(t,s);pe(u,`No resize handles found for group id "${t}"`);const d=u.map(h=>{const f=h.getAttribute(Re.resizeHandleId);pe(f,"Resize handle element has no handle id attribute");const[m,y]=_1(t,f,l,s);if(m==null||y==null)return()=>{};const v=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const T=l.findIndex(D=>D.id===m);if(T>=0){const D=l[T];pe(D,`No panel data found for index ${T}`);const P=n[T],{collapsedSize:N=0,collapsible:O,minSize:A=0}=D.constraints;if(P!=null&&O){const $=ni({delta:mt(P,N)?A-N:N-P,initialLayout:n,panelConstraints:l.map(F=>F.constraints),pivotIndices:K0(t,f,s),prevLayout:n,trigger:"keyboard"});n!==$&&o($)}}break}}};return h.addEventListener("keydown",v),()=>{h.removeEventListener("keydown",v)}});return()=>{d.forEach(h=>h())}},[s,r,e,t,n,i,o])}function X0(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function Y0(r,e){const t=r==="horizontal",{x:n,y:i}=Ki(e);return t?n:i}function U1(r,e,t,n,i){const s=t==="horizontal",o=Zi(e,i);pe(o,`No resize handle element found for id "${e}"`);const a=o.getAttribute(Re.groupId);pe(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=n;const c=Y0(t,r),u=J0(a,i);pe(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),h=s?d.width:d.height;return(c-l)/h*100}function W1(r,e,t,n,i,s){if(P0(r)){const o=t==="horizontal";let a=0;r.shiftKey?a=100:i!=null?a=i:a=10;let l=0;switch(r.key){case"ArrowDown":l=o?0:a;break;case"ArrowLeft":l=o?-a:0;break;case"ArrowRight":l=o?a:0;break;case"ArrowUp":l=o?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return n==null?0:U1(r,e,t,n,s)}function G1({panelDataArray:r}){const e=Array(r.length),t=r.map(s=>s.constraints);let n=0,i=100;for(let s=0;s<r.length;s++){const o=t[s];pe(o,`Panel constraints not found for index ${s}`);const{defaultSize:a}=o;a!=null&&(n++,e[s]=a,i-=a)}for(let s=0;s<r.length;s++){const o=t[s];pe(o,`Panel constraints not found for index ${s}`);const{defaultSize:a}=o;if(a!=null)continue;const l=r.length-n,c=i/l;n++,e[s]=c,i-=c}return e}function Tn(r,e,t){e.forEach((n,i)=>{const s=r[i];pe(s,`Panel data not found for index ${i}`);const{callbacks:o,constraints:a,id:l}=s,{collapsedSize:c=0,collapsible:u}=a,d=t[l];if(d==null||n!==d){t[l]=n;const{onCollapse:h,onExpand:f,onResize:m}=o;m&&m(n,d),u&&(h||f)&&(f&&(d==null||tr(d,c))&&!tr(n,c)&&f(),h&&(d==null||!tr(d,c))&&tr(n,c)&&h())}})}function Qi(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!=e[t])return!1;return!0}function K1({defaultSize:r,dragState:e,layout:t,panelData:n,panelIndex:i,precision:s=3}){const o=t[i];let a;return o==null?a=r!=null?r.toPrecision(s):"1":n.length===1?a="1":a=o.toPrecision(s),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function J1(r,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{r(...i)},e)}}function Z0(r){try{if(typeof localStorage<"u")r.getItem=e=>localStorage.getItem(e),r.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),r.getItem=()=>null,r.setItem=()=>{}}}function Q0(r){return`react-resizable-panels:${r}`}function ec(r){return r.map(e=>{const{constraints:t,id:n,idIsFromProps:i,order:s}=e;return i?n:s?`${s}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function tc(r,e){try{const t=Q0(r),n=e.getItem(t);if(n){const i=JSON.parse(n);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function X1(r,e,t){var n,i;const s=(n=tc(r,t))!==null&&n!==void 0?n:{},o=ec(e);return(i=s[o])!==null&&i!==void 0?i:null}function Y1(r,e,t,n,i){var s;const o=Q0(r),a=ec(e),l=(s=tc(r,i))!==null&&s!==void 0?s:{};l[a]={expandToSizes:Object.fromEntries(t.entries()),layout:n};try{i.setItem(o,JSON.stringify(l))}catch(c){console.error(c)}}function rc({layout:r,panelConstraints:e}){const t=[...r],n=t.reduce((s,o)=>s+o,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(s=>`${s}%`).join(", ")}`);if(!mt(n,100)&&t.length>0)for(let s=0;s<e.length;s++){const o=t[s];pe(o!=null,`No layout data found for index ${s}`);const a=100/n*o;t[s]=a}let i=0;for(let s=0;s<e.length;s++){const o=t[s];pe(o!=null,`No layout data found for index ${s}`);const a=Mn({panelConstraints:e,panelIndex:s,size:o});o!=a&&(i+=o-a,t[s]=a)}if(!mt(i,0))for(let s=0;s<e.length;s++){const o=t[s];pe(o!=null,`No layout data found for index ${s}`);const a=o+i,l=Mn({panelConstraints:e,panelIndex:s,size:a});if(o!==l&&(i-=l-o,t[s]=l,mt(i,0)))break}return t}const Z1=100,si={getItem:r=>(Z0(si),si.getItem(r)),setItem:(r,e)=>{Z0(si),si.setItem(r,e)}},nc={};function ic({autoSaveId:r=null,children:e,className:t="",direction:n,forwardedRef:i,id:s=null,onLayout:o=null,keyboardResizeBy:a=null,storage:l=si,style:c,tagName:u="div",...d}){const h=Ro(s),f=z.useRef(null),[m,y]=z.useState(null),[v,x]=z.useState([]),T=H1(),D=z.useRef({}),P=z.useRef(new Map),N=z.useRef(0),O=z.useRef({autoSaveId:r,direction:n,dragState:m,id:h,keyboardResizeBy:a,onLayout:o,storage:l}),A=z.useRef({layout:v,panelDataArray:[],panelDataArrayChanged:!1});z.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),z.useImperativeHandle(i,()=>({getId:()=>O.current.id,getLayout:()=>{const{layout:L}=A.current;return L},setLayout:L=>{const{onLayout:B}=O.current,{layout:K,panelDataArray:re}=A.current,j=rc({layout:L,panelConstraints:re.map(ie=>ie.constraints)});X0(K,j)||(x(j),A.current.layout=j,B&&B(j),Tn(re,j,D.current))}}),[]),Yr(()=>{O.current.autoSaveId=r,O.current.direction=n,O.current.dragState=m,O.current.id=h,O.current.onLayout=o,O.current.storage=l}),j1({committedValuesRef:O,eagerValuesRef:A,groupId:h,layout:v,panelDataArray:A.current.panelDataArray,setLayout:x,panelGroupElement:f.current}),z.useEffect(()=>{const{panelDataArray:L}=A.current;if(r){if(v.length===0||v.length!==L.length)return;let B=nc[r];B==null&&(B=J1(Y1,Z1),nc[r]=B);const K=[...L],re=new Map(P.current);B(r,K,re,v,l)}},[r,v,l]),z.useEffect(()=>{});const $=z.useCallback(L=>{const{onLayout:B}=O.current,{layout:K,panelDataArray:re}=A.current;if(L.constraints.collapsible){const j=re.map(zt=>zt.constraints),{collapsedSize:ie=0,panelSize:me,pivotIndices:Ce}=en(re,L,K);if(pe(me!=null,`Panel size not found for panel "${L.id}"`),!tr(me,ie)){P.current.set(L.id,me);const It=Cn(re,L)===re.length-1?me-ie:ie-me,Ne=ni({delta:It,initialLayout:K,panelConstraints:j,pivotIndices:Ce,prevLayout:K,trigger:"imperative-api"});Qi(K,Ne)||(x(Ne),A.current.layout=Ne,B&&B(Ne),Tn(re,Ne,D.current))}}},[]),F=z.useCallback((L,B)=>{const{onLayout:K}=O.current,{layout:re,panelDataArray:j}=A.current;if(L.constraints.collapsible){const ie=j.map(ct=>ct.constraints),{collapsedSize:me=0,panelSize:Ce=0,minSize:zt=0,pivotIndices:It}=en(j,L,re),Ne=B??zt;if(tr(Ce,me)){const ct=P.current.get(L.id),Xr=ct!=null&&ct>=Ne?ct:Ne,wn=Cn(j,L)===j.length-1?Ce-Xr:Xr-Ce,je=ni({delta:wn,initialLayout:re,panelConstraints:ie,pivotIndices:It,prevLayout:re,trigger:"imperative-api"});Qi(re,je)||(x(je),A.current.layout=je,K&&K(je),Tn(j,je,D.current))}}},[]),q=z.useCallback(L=>{const{layout:B,panelDataArray:K}=A.current,{panelSize:re}=en(K,L,B);return pe(re!=null,`Panel size not found for panel "${L.id}"`),re},[]),te=z.useCallback((L,B)=>{const{panelDataArray:K}=A.current,re=Cn(K,L);return K1({defaultSize:B,dragState:m,layout:v,panelData:K,panelIndex:re})},[m,v]),Y=z.useCallback(L=>{const{layout:B,panelDataArray:K}=A.current,{collapsedSize:re=0,collapsible:j,panelSize:ie}=en(K,L,B);return pe(ie!=null,`Panel size not found for panel "${L.id}"`),j===!0&&tr(ie,re)},[]),he=z.useCallback(L=>{const{layout:B,panelDataArray:K}=A.current,{collapsedSize:re=0,collapsible:j,panelSize:ie}=en(K,L,B);return pe(ie!=null,`Panel size not found for panel "${L.id}"`),!j||Qr(ie,re)>0},[]),Q=z.useCallback(L=>{const{panelDataArray:B}=A.current;B.push(L),B.sort((K,re)=>{const j=K.order,ie=re.order;return j==null&&ie==null?0:j==null?-1:ie==null?1:j-ie}),A.current.panelDataArrayChanged=!0,T()},[T]);Yr(()=>{if(A.current.panelDataArrayChanged){A.current.panelDataArrayChanged=!1;const{autoSaveId:L,onLayout:B,storage:K}=O.current,{layout:re,panelDataArray:j}=A.current;let ie=null;if(L){const Ce=X1(L,j,K);Ce&&(P.current=new Map(Object.entries(Ce.expandToSizes)),ie=Ce.layout)}ie==null&&(ie=G1({panelDataArray:j}));const me=rc({layout:ie,panelConstraints:j.map(Ce=>Ce.constraints)});X0(re,me)||(x(me),A.current.layout=me,B&&B(me),Tn(j,me,D.current))}}),Yr(()=>{const L=A.current;return()=>{L.layout=[]}},[]);const W=z.useCallback(L=>{let B=!1;const K=f.current;return K&&window.getComputedStyle(K,null).getPropertyValue("direction")==="rtl"&&(B=!0),function(j){j.preventDefault();const ie=f.current;if(!ie)return()=>null;const{direction:me,dragState:Ce,id:zt,keyboardResizeBy:It,onLayout:Ne}=O.current,{layout:ct,panelDataArray:Xr}=A.current,{initialLayout:xn}=Ce??{},wn=K0(zt,L,ie);let je=W1(j,L,me,Ce,It,ie);const Sn=me==="horizontal";Sn&&B&&(je=-je);const nw=Xr.map(iw=>iw.constraints),_i=ni({delta:je,initialLayout:xn??ct,panelConstraints:nw,pivotIndices:wn,prevLayout:ct,trigger:P0(j)?"keyboard":"mouse-or-touch"}),h1=!Qi(ct,_i);(L0(j)||B0(j))&&N.current!=je&&(N.current=je,!h1&&je!==0?Sn?Vo(L,je<0?q0:_0):Vo(L,je<0?j0:U0):Vo(L,0)),h1&&(x(_i),A.current.layout=_i,Ne&&Ne(_i),Tn(Xr,_i,D.current))}},[]),ne=z.useCallback((L,B)=>{const{onLayout:K}=O.current,{layout:re,panelDataArray:j}=A.current,ie=j.map(ct=>ct.constraints),{panelSize:me,pivotIndices:Ce}=en(j,L,re);pe(me!=null,`Panel size not found for panel "${L.id}"`);const It=Cn(j,L)===j.length-1?me-B:B-me,Ne=ni({delta:It,initialLayout:re,panelConstraints:ie,pivotIndices:Ce,prevLayout:re,trigger:"imperative-api"});Qi(re,Ne)||(x(Ne),A.current.layout=Ne,K&&K(Ne),Tn(j,Ne,D.current))},[]),ve=z.useCallback((L,B)=>{const{layout:K,panelDataArray:re}=A.current,{collapsedSize:j=0,collapsible:ie}=B,{collapsedSize:me=0,collapsible:Ce,maxSize:zt=100,minSize:It=0}=L.constraints,{panelSize:Ne}=en(re,L,K);Ne!=null&&(ie&&Ce&&tr(Ne,j)?tr(j,me)||ne(L,me):Ne<It?ne(L,It):Ne>zt&&ne(L,zt))},[ne]),ge=z.useCallback((L,B)=>{const{direction:K}=O.current,{layout:re}=A.current;if(!f.current)return;const j=Zi(L,f.current);pe(j,`Drag handle element not found for id "${L}"`);const ie=Y0(K,B);y({dragHandleId:L,dragHandleRect:j.getBoundingClientRect(),initialCursorPosition:ie,initialLayout:re})},[]),Ae=z.useCallback(()=>{y(null)},[]),C=z.useCallback(L=>{const{panelDataArray:B}=A.current,K=Cn(B,L);K>=0&&(B.splice(K,1),delete D.current[L.id],A.current.panelDataArrayChanged=!0,T())},[T]),w=z.useMemo(()=>({collapsePanel:$,direction:n,dragState:m,expandPanel:F,getPanelSize:q,getPanelStyle:te,groupId:h,isPanelCollapsed:Y,isPanelExpanded:he,reevaluatePanelConstraints:ve,registerPanel:Q,registerResizeHandle:W,resizePanel:ne,startDragging:ge,stopDragging:Ae,unregisterPanel:C,panelGroupElement:f.current}),[$,m,n,F,q,te,h,Y,he,ve,Q,W,ne,ge,Ae,C]),I={display:"flex",flexDirection:n==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return z.createElement(Wi.Provider,{value:w},z.createElement(u,{...d,children:e,className:t,id:s,ref:f,style:{...I,...c},[Re.group]:"",[Re.groupDirection]:n,[Re.groupId]:h}))}const sc=z.forwardRef((r,e)=>z.createElement(ic,{...r,forwardedRef:e}));ic.displayName="PanelGroup",sc.displayName="forwardRef(PanelGroup)";function Cn(r,e){return r.findIndex(t=>t===e||t.id===e.id)}function en(r,e,t){const n=Cn(r,e),s=n===r.length-1?[n-1,n]:[n,n+1],o=t[n];return{...e.constraints,panelSize:o,pivotIndices:s}}function Q1({disabled:r,handleId:e,resizeHandler:t,panelGroupElement:n}){z.useEffect(()=>{if(r||t==null||n==null)return;const i=Zi(e,n);if(i==null)return;const s=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),t(o);break}case"F6":{o.preventDefault();const a=i.getAttribute(Re.groupId);pe(a,`No group element found for id "${a}"`);const l=ii(a,n),c=G0(a,e,n);pe(c!==null,`No resize element found for id "${e}"`);const u=o.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}},[n,r,e,t])}function oc({children:r=null,className:e="",disabled:t=!1,hitAreaMargins:n,id:i,onBlur:s,onClick:o,onDragging:a,onFocus:l,onPointerDown:c,onPointerUp:u,style:d={},tabIndex:h=0,tagName:f="div",...m}){var y,v;const x=z.useRef(null),T=z.useRef({onClick:o,onDragging:a,onPointerDown:c,onPointerUp:u});z.useEffect(()=>{T.current.onClick=o,T.current.onDragging=a,T.current.onPointerDown=c,T.current.onPointerUp=u});const D=z.useContext(Wi);if(D===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:P,groupId:N,registerResizeHandle:O,startDragging:A,stopDragging:$,panelGroupElement:F}=D,q=Ro(i),[te,Y]=z.useState("inactive"),[he,Q]=z.useState(!1),[W,ne]=z.useState(null),ve=z.useRef({state:te});Yr(()=>{ve.current.state=te}),z.useEffect(()=>{if(t)ne(null);else{const w=O(q);ne(()=>w)}},[t,q,O]);const ge=(y=n?.coarse)!==null&&y!==void 0?y:15,Ae=(v=n?.fine)!==null&&v!==void 0?v:5;z.useEffect(()=>{if(t||W==null)return;const w=x.current;pe(w,"Element ref not attached");let I=!1;return F1(q,w,P,{coarse:ge,fine:Ae},(B,K,re)=>{if(!K){Y("inactive");return}switch(B){case"down":{Y("drag"),I=!1,pe(re,'Expected event to be defined for "down" action'),A(q,re);const{onDragging:j,onPointerDown:ie}=T.current;j?.(!0),ie?.();break}case"move":{const{state:j}=ve.current;I=!0,j!=="drag"&&Y("hover"),pe(re,'Expected event to be defined for "move" action'),W(re);break}case"up":{Y("hover"),$();const{onClick:j,onDragging:ie,onPointerUp:me}=T.current;ie?.(!1),me?.(),I||j?.();break}}})},[ge,P,t,Ae,O,q,W,A,$]),Q1({disabled:t,handleId:q,resizeHandler:W,panelGroupElement:F});const C={touchAction:"none",userSelect:"none"};return z.createElement(f,{...m,children:r,className:e,id:i,onBlur:()=>{Q(!1),s?.()},onFocus:()=>{Q(!0),l?.()},ref:x,role:"separator",style:{...C,...d},tabIndex:h,[Re.groupDirection]:P,[Re.groupId]:N,[Re.resizeHandle]:"",[Re.resizeHandleActive]:te==="drag"?"pointer":he?"keyboard":void 0,[Re.resizeHandleEnabled]:!t,[Re.resizeHandleId]:q,[Re.resizeHandleState]:te})}oc.displayName="PanelResizeHandle";function ac(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function e4(r){if(Array.isArray(r))return r}function t4(r,e,t){return(e=l4(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function r4(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function n4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
7
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function cc(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lc(Object(t),!0).forEach(function(n){t4(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):lc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function i4(r,e){if(r==null)return{};var t,n,i=s4(r,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(n=0;n<s.length;n++)t=s[n],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function s4(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function o4(r,e){return e4(r)||r4(r,e)||c4(r,e)||n4()}function a4(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function l4(r){var e=a4(r,"string");return typeof e=="symbol"?e:e+""}function c4(r,e){if(r){if(typeof r=="string")return ac(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ac(r,e):void 0}}function u4(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function uc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dc(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uc(Object(t),!0).forEach(function(n){u4(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):uc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function d4(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return e.reduceRight(function(i,s){return s(i)},n)}}function oi(r){return function e(){for(var t=this,n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return i.length>=r.length?r.apply(this,i):function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return e.apply(t,[].concat(i,a))}}}function es(r){return{}.toString.call(r).includes("Object")}function h4(r){return!Object.keys(r).length}function ai(r){return typeof r=="function"}function f4(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function p4(r,e){return es(e)||kr("changeType"),Object.keys(e).some(function(t){return!f4(r,t)})&&kr("changeField"),e}function m4(r){ai(r)||kr("selectorType")}function g4(r){ai(r)||es(r)||kr("handlerType"),es(r)&&Object.values(r).some(function(e){return!ai(e)})&&kr("handlersType")}function y4(r){r||kr("initialIsRequired"),es(r)||kr("initialType"),h4(r)&&kr("initialContent")}function v4(r,e){throw new Error(r[e]||r.default)}var b4={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},kr=oi(v4)(b4),ts={changes:p4,selector:m4,handler:g4,initial:y4};function x4(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ts.initial(r),ts.handler(e);var t={current:r},n=oi(k4)(t,e),i=oi(S4)(t),s=oi(ts.changes)(r),o=oi(w4)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return ts.selector(c),c(t.current)}function l(c){d4(n,i,s,o)(c)}return[a,l]}function w4(r,e){return ai(e)?e(r.current):e}function S4(r,e){return r.current=dc(dc({},r.current),e),e}function k4(r,e,t){return ai(e)?e(r.current):Object.keys(t).forEach(function(n){var i;return(i=e[n])===null||i===void 0?void 0:i.call(e,r.current[n])}),t}var M4={create:x4},T4={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function C4(r){return function e(){for(var t=this,n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return i.length>=r.length?r.apply(this,i):function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return e.apply(t,[].concat(i,a))}}}function E4(r){return{}.toString.call(r).includes("Object")}function A4(r){return r||fc("configIsRequired"),E4(r)||fc("configType"),r.urls?(O4(),{paths:{vs:r.urls.monacoBase}}):r}function O4(){console.warn(hc.deprecation)}function N4(r,e){throw new Error(r[e]||r.default)}var hc={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
8
8
  You are using deprecated way of configuration.
9
9
 
@@ -13,7 +13,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
13
13
  monaco.config({ paths: { vs: '...' } })
14
14
 
15
15
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
16
- `},fc=C4(N4)(hc),D4={config:A4},z4=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(i){return t.reduceRight(function(s,o){return o(s)},i)}};function pc(r,e){return Object.keys(e).forEach(function(t){e[t]instanceof Object&&r[t]&&Object.assign(e[t],pc(r[t],e[t]))}),cc(cc({},r),e)}var I4={type:"cancelation",msg:"operation is manually canceled"};function jo(r){var e=!1,t=new Promise(function(n,i){r.then(function(s){return e?i(I4):n(s)}),r.catch(i)});return t.cancel=function(){return e=!0},t}var R4=["monaco"],P4=M4.create({config:T4,isInitialized:!1,resolve:null,reject:null,monaco:null}),mc=o4(P4,2),li=mc[0],rs=mc[1];function L4(r){var e=D4.config(r),t=e.monaco,n=i4(e,R4);rs(function(i){return{config:pc(i.config,n),monaco:t}})}function B4(){var r=li(function(e){var t=e.monaco,n=e.isInitialized,i=e.resolve;return{monaco:t,isInitialized:n,resolve:i}});if(!r.isInitialized){if(rs({isInitialized:!0}),r.monaco)return r.resolve(r.monaco),jo(Uo);if(window.monaco&&window.monaco.editor)return gc(window.monaco),r.resolve(window.monaco),jo(Uo);z4(F4,H4)(V4)}return jo(Uo)}function F4(r){return document.body.appendChild(r)}function $4(r){var e=document.createElement("script");return r&&(e.src=r),e}function H4(r){var e=li(function(n){var i=n.config,s=n.reject;return{config:i,reject:s}}),t=$4("".concat(e.config.paths.vs,"/loader.js"));return t.onload=function(){return r()},t.onerror=e.reject,t}function V4(){var r=li(function(t){var n=t.config,i=t.resolve,s=t.reject;return{config:n,resolve:i,reject:s}}),e=window.require;e.config(r.config),e(["vs/editor/editor.main"],function(t){var n=t.m||t;gc(n),r.resolve(n)},function(t){r.reject(t)})}function gc(r){li().monaco||rs({monaco:r})}function q4(){return li(function(r){var e=r.monaco;return e})}var Uo=new Promise(function(r,e){return rs({resolve:r,reject:e})}),yc={config:L4,init:B4,__getMonacoInstance:q4},_4={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Wo=_4,j4={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},U4=j4;function W4({children:r}){return I.createElement("div",{style:U4.container},r)}var G4=W4,K4=G4;function J4({width:r,height:e,isEditorReady:t,loading:n,_ref:i,className:s,wrapperProps:o}){return I.createElement("section",{style:{...Wo.wrapper,width:r,height:e},...o},!t&&I.createElement(K4,null,n),I.createElement("div",{ref:i,style:{...Wo.fullWidth,...!t&&Wo.hide},className:s}))}var X4=J4,vc=I.memo(X4);function Y4(r){I.useEffect(r,[])}var bc=Y4;function Z4(r,e,t=!0){let n=I.useRef(!0);I.useEffect(n.current||!t?()=>{n.current=!1}:r,e)}var gt=Z4;function ci(){}function En(r,e,t,n){return Q4(r,n)||eg(r,e,t,n)}function Q4(r,e){return r.editor.getModel(xc(r,e))}function eg(r,e,t,n){return r.editor.createModel(e,t,n?xc(r,n):void 0)}function xc(r,e){return r.Uri.parse(e)}function tg({original:r,modified:e,language:t,originalLanguage:n,modifiedLanguage:i,originalModelPath:s,modifiedModelPath:o,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:h="100%",width:f="100%",className:m,wrapperProps:y={},beforeMount:v=ci,onMount:x=ci}){let[T,D]=I.useState(!1),[P,N]=I.useState(!0),O=I.useRef(null),A=I.useRef(null),$=I.useRef(null),F=I.useRef(x),q=I.useRef(v),te=I.useRef(!1);bc(()=>{let W=yc.init();return W.then(ne=>(A.current=ne)&&N(!1)).catch(ne=>ne?.type!=="cancelation"&&console.error("Monaco initialization: error:",ne)),()=>O.current?Q():W.cancel()}),gt(()=>{if(O.current&&A.current){let W=O.current.getOriginalEditor(),ne=En(A.current,r||"",n||t||"text",s||"");ne!==W.getModel()&&W.setModel(ne)}},[s],T),gt(()=>{if(O.current&&A.current){let W=O.current.getModifiedEditor(),ne=En(A.current,e||"",i||t||"text",o||"");ne!==W.getModel()&&W.setModel(ne)}},[o],T),gt(()=>{let W=O.current.getModifiedEditor();W.getOption(A.current.editor.EditorOption.readOnly)?W.setValue(e||""):e!==W.getValue()&&(W.executeEdits("",[{range:W.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),W.pushUndoStop())},[e],T),gt(()=>{O.current?.getModel()?.original.setValue(r||"")},[r],T),gt(()=>{let{original:W,modified:ne}=O.current.getModel();A.current.editor.setModelLanguage(W,n||t||"text"),A.current.editor.setModelLanguage(ne,i||t||"text")},[t,n,i],T),gt(()=>{A.current?.editor.setTheme(c)},[c],T),gt(()=>{O.current?.updateOptions(d)},[d],T);let Y=I.useCallback(()=>{if(!A.current)return;q.current(A.current);let W=En(A.current,r||"",n||t||"text",s||""),ne=En(A.current,e||"",i||t||"text",o||"");O.current?.setModel({original:W,modified:ne})},[t,e,i,r,n,s,o]),he=I.useCallback(()=>{!te.current&&$.current&&(O.current=A.current.editor.createDiffEditor($.current,{automaticLayout:!0,...d}),Y(),A.current?.editor.setTheme(c),D(!0),te.current=!0)},[d,c,Y]);I.useEffect(()=>{T&&F.current(O.current,A.current)},[T]),I.useEffect(()=>{!P&&!T&&he()},[P,T,he]);function Q(){let W=O.current?.getModel();a||W?.original?.dispose(),l||W?.modified?.dispose(),O.current?.dispose()}return I.createElement(vc,{width:f,height:h,isEditorReady:T,loading:u,_ref:$,className:m,wrapperProps:y})}var rg=tg;I.memo(rg);function ng(r){let e=I.useRef();return I.useEffect(()=>{e.current=r},[r]),e.current}var ig=ng,ns=new Map;function sg({defaultValue:r,defaultLanguage:e,defaultPath:t,value:n,language:i,path:s,theme:o="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:m="100%",className:y,wrapperProps:v={},beforeMount:x=ci,onMount:T=ci,onChange:D,onValidate:P=ci}){let[N,O]=I.useState(!1),[A,$]=I.useState(!0),F=I.useRef(null),q=I.useRef(null),te=I.useRef(null),Y=I.useRef(T),he=I.useRef(x),Q=I.useRef(),W=I.useRef(n),ne=ig(s),ve=I.useRef(!1),ge=I.useRef(!1);bc(()=>{let w=yc.init();return w.then(z=>(F.current=z)&&$(!1)).catch(z=>z?.type!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>q.current?C():w.cancel()}),gt(()=>{let w=En(F.current,r||n||"",e||i||"",s||t||"");w!==q.current?.getModel()&&(d&&ns.set(ne,q.current?.saveViewState()),q.current?.setModel(w),d&&q.current?.restoreViewState(ns.get(s)))},[s],N),gt(()=>{q.current?.updateOptions(c)},[c],N),gt(()=>{!q.current||n===void 0||(q.current.getOption(F.current.editor.EditorOption.readOnly)?q.current.setValue(n):n!==q.current.getValue()&&(ge.current=!0,q.current.executeEdits("",[{range:q.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),q.current.pushUndoStop(),ge.current=!1))},[n],N),gt(()=>{let w=q.current?.getModel();w&&i&&F.current?.editor.setModelLanguage(w,i)},[i],N),gt(()=>{a!==void 0&&q.current?.revealLine(a)},[a],N),gt(()=>{F.current?.editor.setTheme(o)},[o],N);let Ae=I.useCallback(()=>{if(!(!te.current||!F.current)&&!ve.current){he.current(F.current);let w=s||t,z=En(F.current,n||r||"",e||i||"",w||"");q.current=F.current?.editor.create(te.current,{model:z,automaticLayout:!0,...c},u),d&&q.current.restoreViewState(ns.get(w)),F.current.editor.setTheme(o),a!==void 0&&q.current.revealLine(a),O(!0),ve.current=!0}},[r,e,t,n,i,s,c,u,d,o,a]);I.useEffect(()=>{N&&Y.current(q.current,F.current)},[N]),I.useEffect(()=>{!A&&!N&&Ae()},[A,N,Ae]),W.current=n,I.useEffect(()=>{N&&D&&(Q.current?.dispose(),Q.current=q.current?.onDidChangeModelContent(w=>{ge.current||D(q.current.getValue(),w)}))},[N,D]),I.useEffect(()=>{if(N){let w=F.current.editor.onDidChangeMarkers(z=>{let L=q.current.getModel()?.uri;if(L&&z.find(B=>B.path===L.path)){let B=F.current.editor.getModelMarkers({resource:L});P?.(B)}});return()=>{w?.dispose()}}return()=>{}},[N,P]);function C(){Q.current?.dispose(),h?d&&ns.set(s,q.current.saveViewState()):q.current.getModel()?.dispose(),q.current.dispose()}return I.createElement(vc,{width:f,height:m,isEditorReady:N,loading:l,_ref:te,className:y,wrapperProps:v})}var og=sg,ag=I.memo(og);const lg={automaticLayout:!0,minimap:{enabled:!1},wordWrap:"on",insertSpaces:!0,tabSize:2,padding:{top:10,bottom:10}},wc=({content:r,onChange:e})=>{const t=I.useRef(null),n=I.useRef(null),i=I.useRef(null),[,s]=I.useState(!1),[,o]=I.useState(!1);I.useEffect(()=>()=>{n.current?.dispose?.(),i.current&&clearTimeout(i.current)},[]);const a=u=>{t.current=u,n.current?.dispose?.(),n.current=u.onDidChangeModelContent(()=>{l()}),l()},l=()=>{const u=t.current?.getModel?.();if(u&&typeof u.canUndo=="function"&&typeof u.canRedo=="function")try{s(u.canUndo()),o(u.canRedo());return}catch{}const d=!!t.current;s(d),o(d)},c=u=>{e(u)};return J.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:J.jsx("div",{style:{flex:1},children:J.jsx(ag,{options:lg,height:"100%",language:"xml",value:r,onMount:a,onChange:u=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{c(u||"")},500)}})})})};function Je(r){this.content=r}Je.prototype={constructor:Je,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),s=n.content.slice();return i==-1?s.push(t||r,e):(s[i+1]=e,t&&(s[i]=t)),new Je(s)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Je(t)},addToStart:function(r,e){return new Je([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Je(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),s=n.find(r);return i.splice(s==-1?i.length:s,0,e,t),new Je(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Je.from(r),r.size?new Je(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Je.from(r),r.size?new Je(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Je.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}},Je.from=function(r){if(r instanceof Je)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Je(e)};function Sc(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=Sc(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function kc(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,n-=l;continue}if(!o.sameMarkup(a))return{a:t,b:n};if(o.isText&&o.text!=a.text){let c=0,u=Math.min(o.text.length,a.text.length);for(;c<u&&o.text[o.text.length-c-1]==a.text[a.text.length-c-1];)c++,t--,n--;return{a:t,b:n}}if(o.content.size||a.content.size){let c=kc(o.content,a.content,t-1,n-1);if(c)return c}t-=l,n-=l}}class H{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&n(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),n,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(o?o=!1:s+=n),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new H(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),n.push(a),i+=a.nodeSize),o=l}return new H(n,i)}cutByIndex(e,t){return e==t?H.empty:e==0&&t==this.content.length?this:new H(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new H(i,s)}addToStart(e){return new H([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new H(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Sc(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return kc(this,e,t,n)}findIndex(e){if(e==0)return is(0,e);if(e==this.size)return is(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),s=n+i.nodeSize;if(s>=e)return s==e?is(t+1,s):is(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return H.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new H(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return H.empty;let t,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new H(t||e,n)}static from(e){if(!e)return H.empty;if(e instanceof H)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new H([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}H.empty=new H([],0);const Go={index:0,offset:0};function is(r,e){return Go.index=r,Go.offset=e,Go}function ss(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!ss(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!ss(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let Me=class E0{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ss(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return E0.none;if(e instanceof E0)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};Me.none=[];class as extends Error{}class X{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Tc(this.content,e+this.openStart,t);return n&&new X(n,this.openStart,this.openEnd)}removeBetween(e,t){return new X(Mc(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return X.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new X(H.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new X(e,n,i)}}X.empty=new X(H.empty,0,0);function Mc(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:a}=r.findIndex(t);if(i==e||s.isText){if(a!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(Mc(s.content,e-i-1,t-i-1)))}function Tc(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let a=Tc(o.content,e-s-1,t,o);return a&&r.replaceChild(i,o.copy(a))}function cg(r,e,t){if(t.openStart>r.depth)throw new as("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new as("Inconsistent open depths");return Cc(r,e,t,0)}function Cc(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=Cc(r,e,t,n+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,a=o.content;return rn(o,a.cut(0,r.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=ug(t,r);return rn(s,Ac(r,o,a,e,n))}else return rn(s,ls(r,e,n))}function Ec(r,e){if(!e.type.compatibleContent(r.type))throw new as("Cannot join "+e.type.name+" onto "+r.type.name)}function Ko(r,e,t){let n=r.node(t);return Ec(n,e.node(t)),n}function tn(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function ui(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(tn(r.nodeAfter,n),s++));for(let a=s;a<o;a++)tn(i.child(a),n);e&&e.depth==t&&e.textOffset&&tn(e.nodeBefore,n)}function rn(r,e){return r.type.checkContent(e),r.copy(e)}function Ac(r,e,t,n,i){let s=r.depth>i&&Ko(r,e,i+1),o=n.depth>i&&Ko(t,n,i+1),a=[];return ui(null,r,i,a),s&&o&&e.index(i)==t.index(i)?(Ec(s,o),tn(rn(s,Ac(r,e,t,n,i+1)),a)):(s&&tn(rn(s,ls(r,e,i+1)),a),ui(e,t,i,a),o&&tn(rn(o,ls(t,n,i+1)),a)),ui(n,null,i,a),new H(a)}function ls(r,e,t){let n=[];if(ui(null,r,t,n),r.depth>t){let i=Ko(r,e,t+1);tn(rn(i,ls(r,e,t+1)),n)}return ui(e,null,t,n),new H(n)}function ug(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(H.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class di{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Me.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let a=n;n=i,i=a}let s=n.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new cs(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(n.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new di(t,n,s)}static resolveCached(e,t){let n=Oc.get(e);if(n)for(let s=0;s<n.elts.length;s++){let o=n.elts[s];if(o.pos==t)return o}else Oc.set(e,n=new dg);let i=n.elts[n.i]=di.resolve(e,t);return n.i=(n.i+1)%hg,i}}class dg{constructor(){this.elts=[],this.i=0}}const hg=12,Oc=new WeakMap;class cs{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const fg=Object.create(null);let Mr=class A0{constructor(e,t,n,i=Me.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||H.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&ss(this.attrs,t||e.defaultAttrs||fg)&&Me.sameSet(this.marks,n||Me.none)}copy(e=null){return e==this.content?this:new A0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new A0(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return X.empty;let i=this.resolve(e),s=this.resolve(t),o=n?0:i.sharedDepth(t),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new X(c,i.depth-o,s.depth-o)}replace(e,t,n){return cg(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return di.resolveCached(this,e)}resolveNoCache(e){return di.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Nc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=H.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Me.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Me.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=H.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};Mr.prototype.text=void 0;let pg=class O0 extends Mr{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Nc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new O0(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new O0(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Nc(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class nn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new mg(e,t);if(n.next==null)return nn.empty;let i=Dc(n);n.next&&n.err("Unexpected trailing text");let s=Sg(wg(i));return kg(s,n),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let s=t;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function s(o,a){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return H.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=s(d,a.concat(u));if(h)return h}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)s+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return s}).join(`
16
+ `},fc=C4(N4)(hc),D4={config:A4},z4=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(i){return t.reduceRight(function(s,o){return o(s)},i)}};function pc(r,e){return Object.keys(e).forEach(function(t){e[t]instanceof Object&&r[t]&&Object.assign(e[t],pc(r[t],e[t]))}),cc(cc({},r),e)}var I4={type:"cancelation",msg:"operation is manually canceled"};function jo(r){var e=!1,t=new Promise(function(n,i){r.then(function(s){return e?i(I4):n(s)}),r.catch(i)});return t.cancel=function(){return e=!0},t}var R4=["monaco"],P4=M4.create({config:T4,isInitialized:!1,resolve:null,reject:null,monaco:null}),mc=o4(P4,2),li=mc[0],rs=mc[1];function L4(r){var e=D4.config(r),t=e.monaco,n=i4(e,R4);rs(function(i){return{config:pc(i.config,n),monaco:t}})}function B4(){var r=li(function(e){var t=e.monaco,n=e.isInitialized,i=e.resolve;return{monaco:t,isInitialized:n,resolve:i}});if(!r.isInitialized){if(rs({isInitialized:!0}),r.monaco)return r.resolve(r.monaco),jo(Uo);if(window.monaco&&window.monaco.editor)return gc(window.monaco),r.resolve(window.monaco),jo(Uo);z4(F4,H4)(V4)}return jo(Uo)}function F4(r){return document.body.appendChild(r)}function $4(r){var e=document.createElement("script");return r&&(e.src=r),e}function H4(r){var e=li(function(n){var i=n.config,s=n.reject;return{config:i,reject:s}}),t=$4("".concat(e.config.paths.vs,"/loader.js"));return t.onload=function(){return r()},t.onerror=e.reject,t}function V4(){var r=li(function(t){var n=t.config,i=t.resolve,s=t.reject;return{config:n,resolve:i,reject:s}}),e=window.require;e.config(r.config),e(["vs/editor/editor.main"],function(t){var n=t.m||t;gc(n),r.resolve(n)},function(t){r.reject(t)})}function gc(r){li().monaco||rs({monaco:r})}function q4(){return li(function(r){var e=r.monaco;return e})}var Uo=new Promise(function(r,e){return rs({resolve:r,reject:e})}),yc={config:L4,init:B4,__getMonacoInstance:q4},_4={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Wo=_4,j4={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},U4=j4;function W4({children:r}){return z.createElement("div",{style:U4.container},r)}var G4=W4,K4=G4;function J4({width:r,height:e,isEditorReady:t,loading:n,_ref:i,className:s,wrapperProps:o}){return z.createElement("section",{style:{...Wo.wrapper,width:r,height:e},...o},!t&&z.createElement(K4,null,n),z.createElement("div",{ref:i,style:{...Wo.fullWidth,...!t&&Wo.hide},className:s}))}var X4=J4,vc=z.memo(X4);function Y4(r){z.useEffect(r,[])}var bc=Y4;function Z4(r,e,t=!0){let n=z.useRef(!0);z.useEffect(n.current||!t?()=>{n.current=!1}:r,e)}var gt=Z4;function ci(){}function En(r,e,t,n){return Q4(r,n)||eg(r,e,t,n)}function Q4(r,e){return r.editor.getModel(xc(r,e))}function eg(r,e,t,n){return r.editor.createModel(e,t,n?xc(r,n):void 0)}function xc(r,e){return r.Uri.parse(e)}function tg({original:r,modified:e,language:t,originalLanguage:n,modifiedLanguage:i,originalModelPath:s,modifiedModelPath:o,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:h="100%",width:f="100%",className:m,wrapperProps:y={},beforeMount:v=ci,onMount:x=ci}){let[T,D]=z.useState(!1),[P,N]=z.useState(!0),O=z.useRef(null),A=z.useRef(null),$=z.useRef(null),F=z.useRef(x),q=z.useRef(v),te=z.useRef(!1);bc(()=>{let W=yc.init();return W.then(ne=>(A.current=ne)&&N(!1)).catch(ne=>ne?.type!=="cancelation"&&console.error("Monaco initialization: error:",ne)),()=>O.current?Q():W.cancel()}),gt(()=>{if(O.current&&A.current){let W=O.current.getOriginalEditor(),ne=En(A.current,r||"",n||t||"text",s||"");ne!==W.getModel()&&W.setModel(ne)}},[s],T),gt(()=>{if(O.current&&A.current){let W=O.current.getModifiedEditor(),ne=En(A.current,e||"",i||t||"text",o||"");ne!==W.getModel()&&W.setModel(ne)}},[o],T),gt(()=>{let W=O.current.getModifiedEditor();W.getOption(A.current.editor.EditorOption.readOnly)?W.setValue(e||""):e!==W.getValue()&&(W.executeEdits("",[{range:W.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),W.pushUndoStop())},[e],T),gt(()=>{O.current?.getModel()?.original.setValue(r||"")},[r],T),gt(()=>{let{original:W,modified:ne}=O.current.getModel();A.current.editor.setModelLanguage(W,n||t||"text"),A.current.editor.setModelLanguage(ne,i||t||"text")},[t,n,i],T),gt(()=>{A.current?.editor.setTheme(c)},[c],T),gt(()=>{O.current?.updateOptions(d)},[d],T);let Y=z.useCallback(()=>{if(!A.current)return;q.current(A.current);let W=En(A.current,r||"",n||t||"text",s||""),ne=En(A.current,e||"",i||t||"text",o||"");O.current?.setModel({original:W,modified:ne})},[t,e,i,r,n,s,o]),he=z.useCallback(()=>{!te.current&&$.current&&(O.current=A.current.editor.createDiffEditor($.current,{automaticLayout:!0,...d}),Y(),A.current?.editor.setTheme(c),D(!0),te.current=!0)},[d,c,Y]);z.useEffect(()=>{T&&F.current(O.current,A.current)},[T]),z.useEffect(()=>{!P&&!T&&he()},[P,T,he]);function Q(){let W=O.current?.getModel();a||W?.original?.dispose(),l||W?.modified?.dispose(),O.current?.dispose()}return z.createElement(vc,{width:f,height:h,isEditorReady:T,loading:u,_ref:$,className:m,wrapperProps:y})}var rg=tg;z.memo(rg);function ng(r){let e=z.useRef();return z.useEffect(()=>{e.current=r},[r]),e.current}var ig=ng,ns=new Map;function sg({defaultValue:r,defaultLanguage:e,defaultPath:t,value:n,language:i,path:s,theme:o="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:m="100%",className:y,wrapperProps:v={},beforeMount:x=ci,onMount:T=ci,onChange:D,onValidate:P=ci}){let[N,O]=z.useState(!1),[A,$]=z.useState(!0),F=z.useRef(null),q=z.useRef(null),te=z.useRef(null),Y=z.useRef(T),he=z.useRef(x),Q=z.useRef(),W=z.useRef(n),ne=ig(s),ve=z.useRef(!1),ge=z.useRef(!1);bc(()=>{let w=yc.init();return w.then(I=>(F.current=I)&&$(!1)).catch(I=>I?.type!=="cancelation"&&console.error("Monaco initialization: error:",I)),()=>q.current?C():w.cancel()}),gt(()=>{let w=En(F.current,r||n||"",e||i||"",s||t||"");w!==q.current?.getModel()&&(d&&ns.set(ne,q.current?.saveViewState()),q.current?.setModel(w),d&&q.current?.restoreViewState(ns.get(s)))},[s],N),gt(()=>{q.current?.updateOptions(c)},[c],N),gt(()=>{!q.current||n===void 0||(q.current.getOption(F.current.editor.EditorOption.readOnly)?q.current.setValue(n):n!==q.current.getValue()&&(ge.current=!0,q.current.executeEdits("",[{range:q.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),q.current.pushUndoStop(),ge.current=!1))},[n],N),gt(()=>{let w=q.current?.getModel();w&&i&&F.current?.editor.setModelLanguage(w,i)},[i],N),gt(()=>{a!==void 0&&q.current?.revealLine(a)},[a],N),gt(()=>{F.current?.editor.setTheme(o)},[o],N);let Ae=z.useCallback(()=>{if(!(!te.current||!F.current)&&!ve.current){he.current(F.current);let w=s||t,I=En(F.current,n||r||"",e||i||"",w||"");q.current=F.current?.editor.create(te.current,{model:I,automaticLayout:!0,...c},u),d&&q.current.restoreViewState(ns.get(w)),F.current.editor.setTheme(o),a!==void 0&&q.current.revealLine(a),O(!0),ve.current=!0}},[r,e,t,n,i,s,c,u,d,o,a]);z.useEffect(()=>{N&&Y.current(q.current,F.current)},[N]),z.useEffect(()=>{!A&&!N&&Ae()},[A,N,Ae]),W.current=n,z.useEffect(()=>{N&&D&&(Q.current?.dispose(),Q.current=q.current?.onDidChangeModelContent(w=>{ge.current||D(q.current.getValue(),w)}))},[N,D]),z.useEffect(()=>{if(N){let w=F.current.editor.onDidChangeMarkers(I=>{let L=q.current.getModel()?.uri;if(L&&I.find(B=>B.path===L.path)){let B=F.current.editor.getModelMarkers({resource:L});P?.(B)}});return()=>{w?.dispose()}}return()=>{}},[N,P]);function C(){Q.current?.dispose(),h?d&&ns.set(s,q.current.saveViewState()):q.current.getModel()?.dispose(),q.current.dispose()}return z.createElement(vc,{width:f,height:m,isEditorReady:N,loading:l,_ref:te,className:y,wrapperProps:v})}var og=sg,ag=z.memo(og);const lg={automaticLayout:!0,minimap:{enabled:!1},wordWrap:"on",insertSpaces:!0,tabSize:2,padding:{top:10,bottom:10}},wc=({content:r,onChange:e})=>{const t=z.useRef(null),n=z.useRef(null),i=z.useRef(null),[,s]=z.useState(!1),[,o]=z.useState(!1);z.useEffect(()=>()=>{n.current?.dispose?.(),i.current&&clearTimeout(i.current)},[]),z.useEffect(()=>{const u=t.current;if(!u)return;const d=u.getModel();if(d&&d.getValue()!==r){const h=u.getPosition(),f=u.getSelections();d.setValue(r),h&&u.setPosition(h),f&&u.setSelections(f)}},[r]);const a=u=>{t.current=u;const d=u.getModel();d&&d.getValue()!==r&&d.setValue(r),n.current?.dispose?.(),n.current=u.onDidChangeModelContent(()=>{l()}),l()},l=()=>{const u=t.current?.getModel?.();if(u&&typeof u.canUndo=="function"&&typeof u.canRedo=="function")try{s(u.canUndo()),o(u.canRedo());return}catch{}const d=!!t.current;s(d),o(d)},c=u=>{e(u)};return J.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:J.jsx("div",{style:{flex:1},children:J.jsx(ag,{options:lg,height:"100%",language:"xml",defaultValue:r,onMount:a,onChange:u=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{c(u||"")},500)}})})})};function Je(r){this.content=r}Je.prototype={constructor:Je,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),s=n.content.slice();return i==-1?s.push(t||r,e):(s[i+1]=e,t&&(s[i]=t)),new Je(s)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Je(t)},addToStart:function(r,e){return new Je([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Je(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),s=n.find(r);return i.splice(s==-1?i.length:s,0,e,t),new Je(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Je.from(r),r.size?new Je(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Je.from(r),r.size?new Je(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Je.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}},Je.from=function(r){if(r instanceof Je)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Je(e)};function Sc(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=Sc(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function kc(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,n-=l;continue}if(!o.sameMarkup(a))return{a:t,b:n};if(o.isText&&o.text!=a.text){let c=0,u=Math.min(o.text.length,a.text.length);for(;c<u&&o.text[o.text.length-c-1]==a.text[a.text.length-c-1];)c++,t--,n--;return{a:t,b:n}}if(o.content.size||a.content.size){let c=kc(o.content,a.content,t-1,n-1);if(c)return c}t-=l,n-=l}}class H{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&n(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),n,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(o?o=!1:s+=n),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new H(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),n.push(a),i+=a.nodeSize),o=l}return new H(n,i)}cutByIndex(e,t){return e==t?H.empty:e==0&&t==this.content.length?this:new H(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new H(i,s)}addToStart(e){return new H([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new H(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Sc(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return kc(this,e,t,n)}findIndex(e){if(e==0)return is(0,e);if(e==this.size)return is(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),s=n+i.nodeSize;if(s>=e)return s==e?is(t+1,s):is(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return H.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new H(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return H.empty;let t,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new H(t||e,n)}static from(e){if(!e)return H.empty;if(e instanceof H)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new H([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}H.empty=new H([],0);const Go={index:0,offset:0};function is(r,e){return Go.index=r,Go.offset=e,Go}function ss(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!ss(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!ss(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let Me=class E0{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ss(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return E0.none;if(e instanceof E0)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};Me.none=[];class as extends Error{}class X{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Tc(this.content,e+this.openStart,t);return n&&new X(n,this.openStart,this.openEnd)}removeBetween(e,t){return new X(Mc(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return X.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new X(H.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new X(e,n,i)}}X.empty=new X(H.empty,0,0);function Mc(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:a}=r.findIndex(t);if(i==e||s.isText){if(a!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(Mc(s.content,e-i-1,t-i-1)))}function Tc(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let a=Tc(o.content,e-s-1,t,o);return a&&r.replaceChild(i,o.copy(a))}function cg(r,e,t){if(t.openStart>r.depth)throw new as("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new as("Inconsistent open depths");return Cc(r,e,t,0)}function Cc(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=Cc(r,e,t,n+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,a=o.content;return rn(o,a.cut(0,r.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=ug(t,r);return rn(s,Ac(r,o,a,e,n))}else return rn(s,ls(r,e,n))}function Ec(r,e){if(!e.type.compatibleContent(r.type))throw new as("Cannot join "+e.type.name+" onto "+r.type.name)}function Ko(r,e,t){let n=r.node(t);return Ec(n,e.node(t)),n}function tn(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function ui(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(tn(r.nodeAfter,n),s++));for(let a=s;a<o;a++)tn(i.child(a),n);e&&e.depth==t&&e.textOffset&&tn(e.nodeBefore,n)}function rn(r,e){return r.type.checkContent(e),r.copy(e)}function Ac(r,e,t,n,i){let s=r.depth>i&&Ko(r,e,i+1),o=n.depth>i&&Ko(t,n,i+1),a=[];return ui(null,r,i,a),s&&o&&e.index(i)==t.index(i)?(Ec(s,o),tn(rn(s,Ac(r,e,t,n,i+1)),a)):(s&&tn(rn(s,ls(r,e,i+1)),a),ui(e,t,i,a),o&&tn(rn(o,ls(t,n,i+1)),a)),ui(n,null,i,a),new H(a)}function ls(r,e,t){let n=[];if(ui(null,r,t,n),r.depth>t){let i=Ko(r,e,t+1);tn(rn(i,ls(r,e,t+1)),n)}return ui(e,null,t,n),new H(n)}function ug(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(H.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class di{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Me.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let a=n;n=i,i=a}let s=n.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new cs(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(n.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new di(t,n,s)}static resolveCached(e,t){let n=Oc.get(e);if(n)for(let s=0;s<n.elts.length;s++){let o=n.elts[s];if(o.pos==t)return o}else Oc.set(e,n=new dg);let i=n.elts[n.i]=di.resolve(e,t);return n.i=(n.i+1)%hg,i}}class dg{constructor(){this.elts=[],this.i=0}}const hg=12,Oc=new WeakMap;class cs{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const fg=Object.create(null);let Mr=class A0{constructor(e,t,n,i=Me.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||H.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&ss(this.attrs,t||e.defaultAttrs||fg)&&Me.sameSet(this.marks,n||Me.none)}copy(e=null){return e==this.content?this:new A0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new A0(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return X.empty;let i=this.resolve(e),s=this.resolve(t),o=n?0:i.sharedDepth(t),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new X(c,i.depth-o,s.depth-o)}replace(e,t,n){return cg(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return di.resolveCached(this,e)}resolveNoCache(e){return di.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Nc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=H.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Me.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Me.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=H.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};Mr.prototype.text=void 0;let pg=class O0 extends Mr{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Nc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new O0(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new O0(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Nc(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class nn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new mg(e,t);if(n.next==null)return nn.empty;let i=Dc(n);n.next&&n.err("Unexpected trailing text");let s=Sg(wg(i));return kg(s,n),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let s=t;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function s(o,a){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return H.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=s(d,a.concat(u));if(h)return h}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)s+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return s}).join(`
17
17
  `)}}nn.empty=new nn(!0);class mg{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Dc(r){let e=[];do e.push(gg(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function gg(r){let e=[];do e.push(yg(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function yg(r){let e=xg(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=vg(r,e);else break;return e}function zc(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function vg(r,e){let t=zc(r),n=t;return r.eat(",")&&(r.next!="}"?n=zc(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function bg(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function xg(r){if(r.eat("(")){let e=Dc(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=bg(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function wg(r){let e=[[]];return i(s(r,0),t()),e;function t(){return e.push([])-1}function n(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=t())}else if(o.type=="star"){let l=t();return n(a,l),i(s(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=t();return i(s(o.expr,a),l),i(s(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let u=t();i(s(o.expr,l),u),l=u}if(o.max==-1)i(s(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let u=t();n(l,u),i(s(o.expr,l),u),l=u}return[n(l)]}else{if(o.type=="name")return[n(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Ic(r,e){return e-r}function Rc(r,e){let t=[];return n(e),t.sort(Ic);function n(i){let s=r[i];if(s.length==1&&!s[0].term)return n(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&t.indexOf(l)==-1&&n(l)}}}function Sg(r){let e=Object.create(null);return t(Rc(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);Rc(r,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[n.join(",")]=new nn(n.indexOf(r.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(Ic);s.next.push({type:i[o][0],next:e[a.join(",")]||t(a)})}return s}}function kg(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),n.indexOf(c)==-1&&n.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Pc(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function Lc(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let s=r[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function Bc(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in r){let s=r[i];s.validate&&s.validate(e[i])}}function Fc(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Tg(r,n,e[n]);return t}let $c=class f1{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Fc(e,n.attrs),this.defaultAttrs=Pc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==nn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Lc(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Mr(this,this.computeAttrs(e),H.from(t),Me.setFrom(n))}createChecked(e=null,t,n){return t=H.from(t),this.checkContent(t),new Mr(this,this.computeAttrs(e),t,Me.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=H.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(H.empty,!0);return s?new Mr(this,e,t.append(s),Me.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Bc(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Me.none:e}static compile(e,t){let n=Object.create(null);e.forEach((s,o)=>n[s]=new f1(s,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function Mg(r,e,t){let n=t.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${s}`)}}class Tg{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?Mg(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class us{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Fc(e,i.attrs),this.excluded=null;let s=Pc(this.attrs);this.instance=s?new Me(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Me(this,Lc(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new us(s,i++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Bc(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Hc{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Je.from(e.nodes),t.marks=Je.from(e.marks||{}),this.nodes=$c.compile(this.spec.nodes,this),this.marks=us.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=n[o]||(n[o]=nn.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?Vc(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Vc(this,o.split(" "))}this.nodeFromJSON=i=>Mr.fromJSON(this,i),this.markFromJSON=i=>Me.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof $c){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new pg(n,n.defaultAttrs,e,Me.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Vc(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],s=r.marks[i],o=s;if(s)t.push(s);else for(let a in r.marks){let l=r.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function Cg(r){return r.tag!=null}function Eg(r){return r.style!=null}class Tr{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(Cg(i))this.tags.push(i);else if(Eg(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let n=new Uc(this,t,!1);return n.addAll(e,Me.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Uc(this,t,!0);return n.addAll(e,Me.none,t.from,t.to),X.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Ng(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,n,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let a=t[o];if((a.priority==null?50:a.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{n(o=Wc(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=Wc(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Tr(e,Tr.schemaRules(e)))}}const qc={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ag={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},_c={ol:!0,ul:!0},hi=1,Jo=2,fi=4;function jc(r,e,t){return e!=null?(e?hi:0)|(e==="full"?Jo:0):r&&r.whitespace=="pre"?hi|Jo:t&~fi}class ds{constructor(e,t,n,i,s,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=Me.none,this.match=s||(o&fi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(H.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&hi)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=H.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(H.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!qc.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Uc{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=jc(null,t.preserveWhitespace,0)|(n?fi:0);i?s=new ds(i.type,i.attrs,Me.none,!0,t.topMatch||i.type.contentMatch,o):n?s=new ds(null,null,Me.none,!0,null,o):s=new ds(e.schema.topNodeType,null,Me.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,s=i.options&Jo?"full":this.localPreserveWS||(i.options&hi)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)if(s==="full")n=n.replace(/\r\n?/g,`
18
18
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=n.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(o.text(a[l]),t,!/\S/.test(a[l]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;_c.hasOwnProperty(o)&&this.parser.normalizeLists&&Og(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,n));e:if(l?l.ignore:Ag.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(qc.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=l&&l.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
19
19
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=n.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(c=>!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,n,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,t.attrs||null,n,t.preserveWhitespace);l&&(s=!0,n=l)}else{let l=this.parser.schema.marks[t.mark];n=n.concat(l.create(t.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,t,n,i){let s=n||0;for(let o=n?e.childNodes[n]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,n){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,s=l,!c.length))break;if(l.solid){if(n)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=Me.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):Gc(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let s=this.findPlace(e.create(t),n,!1);return s&&(s=this.enterInner(e,t,n,!0,i)),s}enterInner(e,t,n,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=jc(e,s,o.options);o.options&fi&&o.content.length==0&&(a|=fi);let l=Me.none;return n=n.filter(c=>(o.type?o.type.allowsMarkType(c.type):Gc(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new ds(e,t,l,i,null,a)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=hi)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=t[a];if(c==""){if(a==t.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:n&&l>=s?n.node(l-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function Og(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&_c.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function Ng(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function Wc(r){let e={};for(let t in r)e[t]=r[t];return e}function Gc(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class sn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Xo(t).createDocumentFragment());let i=n,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],u=this.serializeMark(c,o.isInline,t);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=hs(Xo(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&hs(Xo(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return hs(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new sn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Kc(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return Kc(e.marks)}}function Kc(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Xo(r){return r.document||window.document}const Jc=new WeakMap;function Dg(r){let e=Jc.get(r);return e===void 0&&Jc.set(r,e=zg(r)),e}function zg(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function hs(r,e,t,n){if(typeof e=="string")return{dom:r.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=Dg(n))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let a,l=t?r.createElementNS(t,i):r.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let h=d.indexOf(" ");h>0?l.setAttributeNS(d.slice(0,h),d.slice(h+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:m}=hs(r,h,t,n);if(l.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const Xc=65535,Yc=Math.pow(2,16);function Ig(r,e){return r+e*Yc}function Zc(r){return r&Xc}function Rg(r){return(r-(r&Xc))/Yc}const Qc=1,eu=2,fs=4,tu=8;class Yo{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&tu)>0}get deletedBefore(){return(this.delInfo&(Qc|fs))>0}get deletedAfter(){return(this.delInfo&(eu|fs))>0}get deletedAcross(){return(this.delInfo&fs)>0}}class yt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&yt.empty)return yt.empty}recover(e){let t=0,n=Zc(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+Rg(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+s],u=this.ranges[a+o],d=l+c;if(e<=d){let h=c?e==l?-1:e==d?1:t:t,f=l+i+(h<0?0:u);if(n)return f;let m=e==(t<0?l:d)?null:Ig(a/3,e-l),y=e==l?eu:e==d?Qc:fs;return(t<0?e!=l:e!=d)&&(y|=tu),new Yo(f,y,m)}i+=u-c}return n?e+i:new Yo(e+i,0,null)}touches(e,t){let n=0,i=Zc(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==i*3)return!0;n+=this.ranges[a+o]-c}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),c=this.ranges[i+t],u=this.ranges[i+n];e(a,a+c,l,l+u),s+=u-c}}invert(){return new yt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?yt.empty:new yt(e<0?[0,-e,0]:[0,0,e])}}yt.empty=new yt([]);class pi{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new pi(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new pi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return n?e:new Yo(e,i,null)}}const Zo=Object.create(null);class Ze{getMap(){return yt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Zo[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Zo)throw new RangeError("Duplicate use of step JSON ID "+e);return Zo[e]=t,t.prototype.jsonID=e,t}}class He{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new He(e,null)}static fail(e){return new He(null,e)}static fromReplace(e,t,n,i){try{return He.ok(e.replace(t,n,i))}catch(s){if(s instanceof as)return He.fail(s.message);throw s}}}function Qo(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let s=r.child(i);s.content.size&&(s=s.copy(Qo(s.content,e,s))),s.isInline&&(s=e(s,t,i)),n.push(s)}return H.fromArray(n)}class Cr extends Ze{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new X(Qo(t.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return He.fromReplace(e,this.from,this.to,s)}invert(){return new Pt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Cr(t.pos,n.pos,this.mark)}merge(e){return e instanceof Cr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Cr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Cr(t.from,t.to,e.markFromJSON(t.mark))}}Ze.jsonID("addMark",Cr);class Pt extends Ze{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new X(Qo(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return He.fromReplace(e,this.from,this.to,n)}invert(){return new Cr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Pt(t.pos,n.pos,this.mark)}merge(e){return e instanceof Pt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Pt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Pt(t.from,t.to,e.markFromJSON(t.mark))}}Ze.jsonID("removeMark",Pt);class Er extends Ze{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return He.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return He.fromReplace(e,this.pos,this.pos+1,new X(H.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new Er(this.pos,t.marks[i]);return new Er(this.pos,this.mark)}}return new on(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Er(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Er(t.pos,e.markFromJSON(t.mark))}}Ze.jsonID("addNodeMark",Er);class on extends Ze{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return He.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return He.fromReplace(e,this.pos,this.pos+1,new X(H.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Er(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new on(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new on(t.pos,e.markFromJSON(t.mark))}}Ze.jsonID("removeNodeMark",on);class Ue extends Ze{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&ea(e,this.from,this.to)?He.fail("Structure replace would overwrite content"):He.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new yt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ue(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Ue(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ue)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?X.empty:new X(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ue(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?X.empty:new X(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ue(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ue(t.from,t.to,X.fromJSON(e,t.slice),!!t.structure)}}Ze.jsonID("replace",Ue);class We extends Ze{constructor(e,t,n,i,s,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(ea(e,this.from,this.gapFrom)||ea(e,this.gapTo,this.to)))return He.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return He.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?He.fromReplace(e,this.from,this.to,n):He.fail("Content does not fit in gap")}getMap(){return new yt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new We(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||s>n.pos?null:new We(t.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new We(t.from,t.to,t.gapFrom,t.gapTo,X.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ze.jsonID("replaceAround",We);function ea(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Pg(r,e,t,n){let i=[],s=[],o,a;r.doc.nodesBetween(e,t,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){let h=Math.max(c,e),f=Math.min(c+l.nodeSize,t),m=n.addToSet(d);for(let y=0;y<d.length;y++)d[y].isInSet(m)||(o&&o.to==h&&o.mark.eq(d[y])?o.to=f:i.push(o=new Pt(h,f,d[y])));a&&a.to==h?a.to=f:s.push(a=new Cr(h,f,n))}}),i.forEach(l=>r.step(l)),s.forEach(l=>r.step(l))}function Lg(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(n instanceof us){let c=o.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,t);for(let u=0;u<l.length;u++){let d=l[u],h;for(let f=0;f<i.length;f++){let m=i[f];m.step==s-1&&d.eq(i[f].style)&&(h=m)}h?(h.to=c,h.step=s):i.push({style:d,from:Math.max(a,e),to:c,step:s})}}}),i.forEach(o=>r.step(new Pt(o.from,o.to,o.style)))}function ta(r,e,t,n=t.contentMatch,i=!0){let s=r.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),u=a+c.nodeSize,d=n.matchType(c.type);if(!d)o.push(new Ue(a,u,X.empty));else{n=d;for(let h=0;h<c.marks.length;h++)t.allowsMarkType(c.marks[h].type)||r.step(new Pt(a,u,c.marks[h]));if(i&&c.isText&&t.whitespace!="pre"){let h,f=/\r?\n|\r/g,m;for(;h=f.exec(c.text);)m||(m=new X(H.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new Ue(a+h.index,a+h.index+h[0].length,m))}}a=u}if(!n.validEnd){let l=n.fillBefore(H.empty,!0);r.replace(a,a,new X(l,0,0))}for(let l=o.length-1;l>=0;l--)r.step(o[l])}function Bg(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function An(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth,i=0,s=0;;--n){let o=r.$from.node(n),a=r.$from.index(n)+i,l=r.$to.indexAfter(n)-s;if(n<r.depth&&o.canReplace(a,l,t))return n;if(n==0||o.type.spec.isolating||!Bg(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function Fg(r,e,t){let{$from:n,$to:i,depth:s}=e,o=n.before(s+1),a=i.after(s+1),l=o,c=a,u=H.empty,d=0;for(let m=s,y=!1;m>t;m--)y||n.index(m)>0?(y=!0,u=H.from(n.node(m).copy(u)),d++):l--;let h=H.empty,f=0;for(let m=s,y=!1;m>t;m--)y||i.after(m+1)<i.end(m)?(y=!0,h=H.from(i.node(m).copy(h)),f++):c++;r.step(new We(l,c,o,a,new X(u.append(h),d,f),u.size-d,!0))}function ra(r,e,t=null,n=r){let i=$g(r,e),s=i&&Hg(n,e);return s?i.map(ru).concat({type:e,attrs:t}).concat(s.map(ru)):null}function ru(r){return{type:r,attrs:null}}function $g(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.contentMatchAt(n).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(n,i,o)?s:null}function Hg(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.child(n),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=n;l&&c<i;c++)l=l.matchType(t.child(c).type);return!l||!l.validEnd?null:o}function Vg(r,e,t){let n=H.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let a=t[o].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=H.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new We(i,s,i,s,new X(n,0,0),t.length,!0))}function qg(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&_g(r.doc,r.mapping.slice(s).map(a),n)){let c=null;if(n.schema.linebreakReplacement){let f=n.whitespace=="pre",m=!!n.contentMatch.matchType(n.schema.linebreakReplacement);f&&!m?c=!1:!f&&m&&(c=!0)}c===!1&&iu(r,o,a,s),ta(r,r.mapping.slice(s).map(a,1),n,void 0,c===null);let u=r.mapping.slice(s),d=u.map(a,1),h=u.map(a+o.nodeSize,1);return r.step(new We(d,h,d+1,h-1,new X(H.from(n.create(l,null,o.marks)),0,0),1,!0)),c===!0&&nu(r,o,a,s),!1}})}function nu(r,e,t,n){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=r.mapping.slice(n).map(t+1+s+o.index);r.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function iu(r,e,t,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+s);r.replaceWith(o,o+1,e.type.schema.text(`
@@ -112,7 +112,7 @@ ${v}
112
112
  `);N.trim()&&(e.customNestedParser?T=e.customNestedParser(N):T=t.blockTokens(N))}const P=e.createToken(m,T);l.push(P)}if(l.length!==0)return{items:l,raw:c}}function ol(r,e,t,n){if(!r||!Array.isArray(r.content))return"";const i=typeof t=="function"?t(n):t,[s,...o]=r.content,a=e.renderChildren([s]),l=[`${i}${a}`];return o&&o.length>0&&o.forEach(c=>{const u=e.renderChildren([c]);if(u){const d=u.split(`
113
113
  `).map(h=>h?e.indent(h):"").join(`
114
114
  `);l.push(d)}}),l.join(`
115
- `)}function d7(r,e,t={}){const{state:n}=e,{doc:i,tr:s}=n,o=r;i.descendants((a,l)=>{const c=s.mapping.map(l),u=s.mapping.map(l)+a.nodeSize;let d=null;if(a.marks.forEach(f=>{if(f!==o)return!1;d=f}),!d)return;let h=!1;if(Object.keys(t).forEach(f=>{t[f]!==d.attrs[f]&&(h=!0)}),h){const f=r.type.create({...r.attrs,...t});s.removeMark(c,u,r.type),s.addMark(c,u,f)}}),s.docChanged&&e.view.dispatch(s)}var we=class y1 extends tl{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new y1(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},h7=class{constructor(r,e,t){this.isDragging=!1,this.component=r,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...t},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(r){var e,t,n,i,s,o,a;const{view:l}=this.editor,c=r.target,u=c.nodeType===3?(e=c.parentElement)==null?void 0:e.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(t=this.contentDOM)!=null&&t.contains(c)||!u)return;let d=0,h=0;if(this.dom!==u){const T=this.dom.getBoundingClientRect(),D=u.getBoundingClientRect(),P=(i=r.offsetX)!=null?i:(n=r.nativeEvent)==null?void 0:n.offsetX,N=(o=r.offsetY)!=null?o:(s=r.nativeEvent)==null?void 0:s.offsetY;d=D.x-T.x+P,h=D.y-T.y+N}const f=this.dom.cloneNode(!0);try{const T=this.dom.getBoundingClientRect();f.style.width=`${Math.round(T.width)}px`,f.style.height=`${Math.round(T.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let m=null;try{m=document.createElement("div"),m.style.position="absolute",m.style.top="-9999px",m.style.left="-9999px",m.style.pointerEvents="none",m.appendChild(f),document.body.appendChild(m),(a=r.dataTransfer)==null||a.setDragImage(f,d,h)}finally{m&&setTimeout(()=>{try{m?.remove()}catch{}},0)}const y=this.getPos();if(typeof y!="number")return;const v=se.create(l.state.doc,y),x=l.state.tr.setSelection(v);l.dispatch(x)}stopEvent(r){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:r});const t=r.target;if(!(this.dom.contains(t)&&!((e=this.contentDOM)!=null&&e.contains(t))))return!1;const i=r.type.startsWith("drag"),s=r.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(t.tagName)||t.isContentEditable)&&!s&&!i)return!0;const{isEditable:a}=this.editor,{isDragging:l}=this,c=!!this.node.type.spec.draggable,u=se.isSelectable(this.node),d=r.type==="copy",h=r.type==="paste",f=r.type==="cut",m=r.type==="mousedown";if(!c&&u&&i&&r.target===this.dom&&r.preventDefault(),c&&i&&!l&&r.target===this.dom)return r.preventDefault(),!1;if(c&&a&&!l&&m){const y=t.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(l||s||d||h||f||m&&u)}ignoreMutation(r){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:r}):this.node.isLeaf||this.node.isAtom?!0:r.type==="selection"||this.dom.contains(r.target)&&r.type==="childList"&&(Ns()||Zd())&&this.editor.isFocused&&[...Array.from(r.addedNodes),...Array.from(r.removedNodes)].every(t=>t.isContentEditable)?!1:this.contentDOM===r.target&&r.type==="attributes"?!0:!this.contentDOM.contains(r.target)}updateAttributes(r){this.editor.commands.command(({tr:e})=>{const t=this.getPos();return typeof t!="number"?!1:(e.setNodeMarkup(t,void 0,{...this.node.attrs,...r}),!0)})}deleteNode(){const r=this.getPos();if(typeof r!="number")return;const e=r+this.node.nodeSize;this.editor.commands.deleteRange({from:r,to:e})}};function Hs(r){return new J6({find:r.find,handler:({state:e,range:t,match:n,pasteEvent:i})=>{const s=ke(r.getAttributes,void 0,n,i);if(s===!1||s===null)return null;const{tr:o}=e,a=n[n.length-1],l=n[0];let c=t.to;if(a){const u=l.search(/\S/),d=t.from+l.indexOf(a),h=d+a.length;if(dh(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(v=>v===r.type&&v!==m.mark.type)).filter(m=>m.to>d).length)return null;h<t.to&&o.delete(h,t.to),d>t.from&&o.delete(t.from+u,d),c=t.from+u+a.length,o.addMark(t.from+u,c,r.type.create(s||{})),o.removeStoredMark(r.type)}}})}function f7(r={}){return new Pe({view(e){return new p7(e,r)}})}class p7{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(t){let d=e.nodeBefore,h=e.nodeAfter;if(d||h){let f=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(f){let m=f.getBoundingClientRect(),y=d?m.bottom:m.top;d&&h&&(y=(y+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let v=this.width/2*a;n={left:m.left,right:m.right,top:y-v,bottom:y+v}}}}if(!n){let d=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;n={left:d.left-h,right:d.left+h,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=l.getBoundingClientRect(),h=d.width/l.offsetWidth,f=d.height/l.offsetHeight;c=d.left-l.scrollLeft*h,u=d.top-l.scrollTop*f}this.element.style.left=(n.left-c)/o+"px",this.element.style.top=(n.top-u)/a+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!s){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=ou(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Le extends ce{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Le.valid(n)?new Le(n):ce.near(n)}content(){return X.empty}eq(e){return e instanceof Le&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Le(e.resolve(t.pos))}getBookmark(){return new al(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!m7(e)||!g7(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Le.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(Le.valid(l))return l}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!se.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let a=e.doc.resolve(i);if(Le.valid(a))return a}return null}}}Le.prototype.visible=!1,Le.findFrom=Le.findGapCursorFrom,ce.jsonID("gapcursor",Le);class al{constructor(e){this.pos=e}map(e){return new al(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Le.valid(t)?new Le(t):ce.near(t)}}function Oh(r){return r.isAtom||r.spec.isolating||r.spec.createGapCursor}function m7(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Oh(i.type))return!0;if(i.inlineContent)return!1}}return!0}function g7(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Oh(i.type))return!0;if(i.inlineContent)return!1}}return!0}function y7(){return new Pe({props:{decorations:w7,createSelectionBetween(r,e,t){return e.pos==t.pos&&Le.valid(t)?new Le(t):null},handleClick:b7,handleKeyDown:v7,handleDOMEvents:{beforeinput:x7}}})}const v7=Ha({ArrowLeft:Vs("horiz",-1),ArrowRight:Vs("horiz",1),ArrowUp:Vs("vert",-1),ArrowDown:Vs("vert",1)});function Vs(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof de){if(!s.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=Le.findGapCursorFrom(a,e,l);return c?(i&&i(n.tr.setSelection(new Le(c))),!0):!1}}function b7(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!Le.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&se.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new Le(n))),!0)}function x7(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof Le))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=H.empty;for(let o=n.length-1;o>=0;o--)i=H.from(n[o].createAndFill(null,i));let s=r.state.tr.replace(t.pos,t.pos,new X(i,0,0));return s.setSelection(de.near(s.doc.resolve(t.pos+1))),r.dispatch(s),!1}function w7(r){if(!(r.selection instanceof Le))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",De.create(r.doc,[nt.widget(r.selection.head,e,{key:"gapcursor"})])}var qs=200,Ke=function(){};Ke.prototype.append=function(e){return e.length?(e=Ke.from(e),!this.length&&e||e.length<qs&&this.leafAppend(e)||this.length<qs&&e.leafPrepend(this)||this.appendInner(e)):this},Ke.prototype.prepend=function(e){return e.length?Ke.from(e).append(this):this},Ke.prototype.appendInner=function(e){return new S7(this,e)},Ke.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ke.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ke.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ke.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Ke.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i},Ke.from=function(e){return e instanceof Ke?e:e&&e.length?new Nh(e):Ke.empty};var Nh=(function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=qs)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=qs)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(Ke);Ke.empty=new Nh([]);var S7=(function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(n,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(Ke);const k7=500;class Lt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,a,l,c=[],u=[];return this.items.forEach((d,h)=>{if(!d.step){i||(i=this.remapping(n,h+1),s=i.maps.length),s--,u.push(d);return}if(i){u.push(new _t(d.map));let f=d.step.map(i.slice(s)),m;f&&o.maybeStep(f).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],c.push(new _t(m,void 0,void 0,c.length+u.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(s)):d.selection,l=new Lt(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,n,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),h=new _t(e.mapping.maps[u],d,t),f;(f=l&&l.merge(h))&&(h=f,u?s.pop():a=a.slice(0,a.length-1)),s.push(h),t&&(o++,t=void 0),i||(l=h)}let c=o-n.depth;return c>T7&&(a=M7(a,c),o-=c),new Lt(a.append(s),o)}remapping(e,t){let n=new pi;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new Lt(this.items.append(e.map(t=>new _t(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=t;this.items.forEach(h=>{let f=s.getMirror(--l);if(f==null)return;o=Math.min(o,f);let m=s.maps[f];if(h.step){let y=e.steps[f].invert(e.docs[f]),v=h.selection&&h.selection.map(s.slice(l+1,f));v&&a++,n.push(new _t(m,y,v))}else n.push(new _t(m))},i);let c=[];for(let h=t;h<o;h++)c.push(new _t(s.maps[h]));let u=this.items.slice(0,i).append(c).append(n),d=new Lt(u,a);return d.emptyItemCount()>k7&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(t.slice(n)),c=l&&l.getMap();if(n--,c&&t.appendMap(c,n),l){let u=o.selection&&o.selection.map(t.slice(n));u&&s++;let d=new _t(c.invert(),l,u),h,f=i.length-1;(h=i.length&&i[f].merge(d))?i[f]=h:i.push(d)}}else o.map&&n--},this.items.length,0),new Lt(Ke.from(i.reverse()),s)}}Lt.empty=new Lt(Ke.empty,0);function M7(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class _t{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new _t(t.getMap().invert(),t,this.selection)}}}class Hr{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const T7=20;function C7(r,e,t,n){let i=t.getMeta(pn),s;if(i)return i.historyState;t.getMeta(O7)&&(r=new Hr(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(pn))return o.getMeta(pn).redo?new Hr(r.done.addTransform(t,void 0,n,_s(e)),r.undone,Dh(t.mapping.maps),r.prevTime,r.prevComposition):new Hr(r.done,r.undone.addTransform(t,void 0,n,_s(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=r.prevTime==0||!o&&r.prevComposition!=a&&(r.prevTime<(t.time||0)-n.newGroupDelay||!E7(t,r.prevRanges)),c=o?ll(r.prevRanges,t.mapping):Dh(t.mapping.maps);return new Hr(r.done.addTransform(t,l?e.selection.getBookmark():void 0,n,_s(e)),Lt.empty,c,t.time,a??r.prevComposition)}else return(s=t.getMeta("rebased"))?new Hr(r.done.rebased(t,s),r.undone.rebased(t,s),ll(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new Hr(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),ll(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function E7(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function Dh(r){let e=[];for(let t=r.length-1;t>=0&&e.length==0;t--)r[t].forEach((n,i,s,o)=>e.push(s,o));return e}function ll(r,e){if(!r)return null;let t=[];for(let n=0;n<r.length;n+=2){let i=e.map(r[n],1),s=e.map(r[n+1],-1);i<=s&&t.push(i,s)}return t}function A7(r,e,t){let n=_s(e),i=pn.get(e).spec.config,s=(t?r.undone:r.done).popEvent(e,n);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(t?r.done:r.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),l=new Hr(t?a:s.remaining,t?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(pn,{redo:t,historyState:l})}let cl=!1,zh=null;function _s(r){let e=r.plugins;if(zh!=e){cl=!1,zh=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){cl=!0;break}}return cl}const pn=new Fe("history"),O7=new Fe("closeHistory");function N7(r={}){return r={depth:r.depth||100,newGroupDelay:r.newGroupDelay||500},new Pe({key:pn,state:{init(){return new Hr(Lt.empty,Lt.empty,null,0,-1)},apply(e,t,n){return C7(t,n,e,r)}},config:r,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?Rh:n=="historyRedo"?Ph:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function Ih(r,e){return(t,n)=>{let i=pn.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let s=A7(i,t,r);s&&n(e?s.scrollIntoView():s)}return!0}}const Rh=Ih(!1,!0),Ph=Ih(!0,!0);Se.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:r=>r.length,wordCounter:r=>r.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=r=>{const e=r?.node||this.editor.state.doc;if((r?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=r=>{const e=r?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let r=!1;return[new Pe({key:new Fe("characterCount"),appendTransaction:(e,t,n)=>{if(r)return;const i=this.options.limit;if(i==null||i===0){r=!0;return}const s=this.storage.characters({node:n.doc});if(s>i){const o=s-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=n.tr.deleteRange(a,l);return r=!0,c}r=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=n||i>n&&s>n&&s<=i)return!0;if(i>n&&s>n&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=s-n,c=a-l,u=a;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>n)}})]}}),Se.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[f7(this.options)]}});var D7=Se.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Pe({key:new Fe("focus"),props:{decorations:({doc:r,selection:e})=>{const{isEditable:t,isFocused:n}=this.editor,{anchor:i}=e,s=[];if(!t||!n)return De.create(r,[]);let o=0;this.options.mode==="deepest"&&r.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;o+=1});let a=0;return r.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(nt.node(c,c+l.nodeSize,{class:this.options.className}))}),De.create(r,s)}}})]}}),z7=Se.create({name:"gapCursor",addProseMirrorPlugins(){return[y7()]},extendNodeSchema(r){var e;const t={name:r.name,options:r.options,storage:r.storage};return{allowGapCursor:(e=ke(oe(r,"allowGapCursor",t)))!=null?e:null}}});Se.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Pe({key:new Fe("placeholder"),props:{decorations:({doc:r,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!t)return null;const s=this.editor.isEmpty;return r.descendants((o,a)=>{const l=n>=a&&n<=a+o.nodeSize,c=!o.isLeaf&&Ps(o);if((l||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];s&&u.push(this.options.emptyEditorClass);const d=nt.node(a,a+o.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),De.create(r,i)}}})]}}),Se.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:r,options:e}=this;return[new Pe({key:new Fe("selection"),props:{decorations(t){return t.selection.empty||r.isFocused||!r.isEditable||x6(t.selection)||r.view.dragging?null:De.create(t.doc,[nt.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function Lh({types:r,node:e}){return e&&Array.isArray(r)&&r.includes(e.type)||e?.type===r}Se.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var r;const e=new Fe(this.name),t=this.options.node||((r=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:r.name)||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new Pe({key:e,appendTransaction:(i,s,o)=>{const{doc:a,tr:l,schema:c}=o,u=e.getState(o),d=a.content.size,h=c.nodes[t];if(u)return l.insert(d,h.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!Lh({node:o,types:n})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!Lh({node:o,types:n})}}})]}});var I7=Se.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>Rh(r,e),redo:()=>({state:r,dispatch:e})=>Ph(r,e)}},addProseMirrorPlugins(){return[N7(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),js={exports:{}},ul={};var Bh;function R7(){if(Bh)return ul;Bh=1;var r=I;function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var t=typeof Object.is=="function"?Object.is:e,n=r.useState,i=r.useEffect,s=r.useLayoutEffect,o=r.useDebugValue;function a(d,h){var f=h(),m=n({inst:{value:f,getSnapshot:h}}),y=m[0].inst,v=m[1];return s(function(){y.value=f,y.getSnapshot=h,l(y)&&v({inst:y})},[d,f,h]),i(function(){return l(y)&&v({inst:y}),d(function(){l(y)&&v({inst:y})})},[d]),o(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!t(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return ul.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:u,ul}var dl={};var Fh;function P7(){return Fh||(Fh=1,process.env.NODE_ENV!=="production"&&(function(){function r(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}function e(f,m){u||i.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=m();if(!d){var v=m();s(y,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}v=o({inst:{value:y,getSnapshot:m}});var x=v[0].inst,T=v[1];return l(function(){x.value=y,x.getSnapshot=m,t(x)&&T({inst:x})},[f,y,m]),a(function(){return t(x)&&T({inst:x}),f(function(){t(x)&&T({inst:x})})},[f]),c(y),y}function t(f){var m=f.getSnapshot;f=f.value;try{var y=m();return!s(f,y)}catch{return!0}}function n(f,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=I,s=typeof Object.is=="function"?Object.is:r,o=i.useState,a=i.useEffect,l=i.useLayoutEffect,c=i.useDebugValue,u=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:e;dl.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),dl}var $h;function hl(){return $h||($h=1,process.env.NODE_ENV==="production"?js.exports=R7():js.exports=P7()),js.exports}var Hh=hl();const{getOwnPropertyNames:L7,getOwnPropertySymbols:B7}=Object,{hasOwnProperty:F7}=Object.prototype;function fl(r,e){return function(n,i,s){return r(n,i,s)&&e(n,i,s)}}function Us(r){return function(t,n,i){if(!t||!n||typeof t!="object"||typeof n!="object")return r(t,n,i);const{cache:s}=i,o=s.get(t),a=s.get(n);if(o&&a)return o===n&&a===t;s.set(t,n),s.set(n,t);const l=r(t,n,i);return s.delete(t),s.delete(n),l}}function $7(r){return r?.[Symbol.toStringTag]}function Vh(r){return L7(r).concat(B7(r))}const H7=Object.hasOwn||((r,e)=>F7.call(r,e));function mn(r,e){return r===e||!r&&!e&&r!==r&&e!==e}const V7="__v",q7="__o",_7="_owner",{getOwnPropertyDescriptor:qh,keys:_h}=Object;function j7(r,e){return r.byteLength===e.byteLength&&Ws(new Uint8Array(r),new Uint8Array(e))}function U7(r,e,t){let n=r.length;if(e.length!==n)return!1;for(;n-- >0;)if(!t.equals(r[n],e[n],n,n,r,e,t))return!1;return!0}function W7(r,e){return r.byteLength===e.byteLength&&Ws(new Uint8Array(r.buffer,r.byteOffset,r.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function G7(r,e){return mn(r.getTime(),e.getTime())}function K7(r,e){return r.name===e.name&&r.message===e.message&&r.cause===e.cause&&r.stack===e.stack}function J7(r,e){return r===e}function jh(r,e,t){const n=r.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),s=r.entries();let o,a,l=0;for(;(o=s.next())&&!o.done;){const c=e.entries();let u=!1,d=0;for(;(a=c.next())&&!a.done;){if(i[d]){d++;continue}const h=o.value,f=a.value;if(t.equals(h[0],f[0],l,d,r,e,t)&&t.equals(h[1],f[1],h[0],f[0],r,e,t)){u=i[d]=!0;break}d++}if(!u)return!1;l++}return!0}const X7=mn;function Y7(r,e,t){const n=_h(r);let i=n.length;if(_h(e).length!==i)return!1;for(;i-- >0;)if(!Wh(r,e,t,n[i]))return!1;return!0}function Di(r,e,t){const n=Vh(r);let i=n.length;if(Vh(e).length!==i)return!1;let s,o,a;for(;i-- >0;)if(s=n[i],!Wh(r,e,t,s)||(o=qh(r,s),a=qh(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function Z7(r,e){return mn(r.valueOf(),e.valueOf())}function Q7(r,e){return r.source===e.source&&r.flags===e.flags}function Uh(r,e,t){const n=r.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),s=r.values();let o,a;for(;(o=s.next())&&!o.done;){const l=e.values();let c=!1,u=0;for(;(a=l.next())&&!a.done;){if(!i[u]&&t.equals(o.value,a.value,o.value,a.value,r,e,t)){c=i[u]=!0;break}u++}if(!c)return!1}return!0}function Ws(r,e){let t=r.byteLength;if(e.byteLength!==t||r.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(r[t]!==e[t])return!1;return!0}function ey(r,e){return r.hostname===e.hostname&&r.pathname===e.pathname&&r.protocol===e.protocol&&r.port===e.port&&r.hash===e.hash&&r.username===e.username&&r.password===e.password}function Wh(r,e,t,n){return(n===_7||n===q7||n===V7)&&(r.$$typeof||e.$$typeof)?!0:H7(e,n)&&t.equals(r[n],e[n],n,n,r,e,t)}const ty="[object ArrayBuffer]",ry="[object Arguments]",ny="[object Boolean]",iy="[object DataView]",sy="[object Date]",oy="[object Error]",ay="[object Map]",ly="[object Number]",cy="[object Object]",uy="[object RegExp]",dy="[object Set]",hy="[object String]",fy={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},py="[object URL]",my=Object.prototype.toString;function gy({areArrayBuffersEqual:r,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:f,unknownTagComparators:m}){return function(v,x,T){if(v===x)return!0;if(v==null||x==null)return!1;const D=typeof v;if(D!==typeof x)return!1;if(D!=="object")return D==="number"?a(v,x,T):D==="function"?s(v,x,T):!1;const P=v.constructor;if(P!==x.constructor)return!1;if(P===Object)return l(v,x,T);if(Array.isArray(v))return e(v,x,T);if(P===Date)return n(v,x,T);if(P===RegExp)return u(v,x,T);if(P===Map)return o(v,x,T);if(P===Set)return d(v,x,T);const N=my.call(v);if(N===sy)return n(v,x,T);if(N===uy)return u(v,x,T);if(N===ay)return o(v,x,T);if(N===dy)return d(v,x,T);if(N===cy)return typeof v.then!="function"&&typeof x.then!="function"&&l(v,x,T);if(N===py)return f(v,x,T);if(N===oy)return i(v,x,T);if(N===ry)return l(v,x,T);if(fy[N])return h(v,x,T);if(N===ty)return r(v,x,T);if(N===iy)return t(v,x,T);if(N===ny||N===ly||N===hy)return c(v,x,T);if(m){let O=m[N];if(!O){const A=$7(v);A&&(O=m[A])}if(O)return O(v,x,T)}return!1}}function yy({circular:r,createCustomConfig:e,strict:t}){let n={areArrayBuffersEqual:j7,areArraysEqual:t?Di:U7,areDataViewsEqual:W7,areDatesEqual:G7,areErrorsEqual:K7,areFunctionsEqual:J7,areMapsEqual:t?fl(jh,Di):jh,areNumbersEqual:X7,areObjectsEqual:t?Di:Y7,arePrimitiveWrappersEqual:Z7,areRegExpsEqual:Q7,areSetsEqual:t?fl(Uh,Di):Uh,areTypedArraysEqual:t?fl(Ws,Di):Ws,areUrlsEqual:ey,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),r){const i=Us(n.areArraysEqual),s=Us(n.areMapsEqual),o=Us(n.areObjectsEqual),a=Us(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:a})}return n}function vy(r){return function(e,t,n,i,s,o,a){return r(e,t,a)}}function by({circular:r,comparator:e,createState:t,equals:n,strict:i}){if(t)return function(a,l){const{cache:c=r?new WeakMap:void 0,meta:u}=t();return e(a,l,{cache:c,equals:n,meta:u,strict:i})};if(r)return function(a,l){return e(a,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const s={cache:void 0,equals:n,meta:void 0,strict:i};return function(a,l){return e(a,l,s)}}const xy=Vr();Vr({strict:!0}),Vr({circular:!0}),Vr({circular:!0,strict:!0}),Vr({createInternalComparator:()=>mn}),Vr({strict:!0,createInternalComparator:()=>mn}),Vr({circular:!0,createInternalComparator:()=>mn}),Vr({circular:!0,createInternalComparator:()=>mn,strict:!0});function Vr(r={}){const{circular:e=!1,createInternalComparator:t,createState:n,strict:i=!1}=r,s=yy(r),o=gy(s),a=t?t(o):vy(o);return by({circular:e,comparator:o,createState:n,equals:a,strict:i})}var Gs={exports:{}},pl={};var Gh;function wy(){if(Gh)return pl;Gh=1;var r=I,e=hl();function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var n=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,s=r.useRef,o=r.useEffect,a=r.useMemo,l=r.useDebugValue;return pl.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var m=s(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function x(O){if(!T){if(T=!0,D=O,O=h(O),f!==void 0&&y.hasValue){var A=y.value;if(f(A,O))return P=A}return P=O}if(A=P,n(D,O))return A;var $=h(O);return f!==void 0&&f(A,$)?(D=O,A):(D=O,P=$)}var T=!1,D,P,N=d===void 0?null:d;return[function(){return x(u())},N===null?void 0:function(){return x(N())}]},[u,d,h,f]);var v=i(c,m[0],m[1]);return o(function(){y.hasValue=!0,y.value=v},[v]),l(v),v},pl}var ml={};var Kh;function Sy(){return Kh||(Kh=1,process.env.NODE_ENV!=="production"&&(function(){function r(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=I,t=hl(),n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;ml.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var m=s(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function x(O){if(!T){if(T=!0,D=O,O=h(O),f!==void 0&&y.hasValue){var A=y.value;if(f(A,O))return P=A}return P=O}if(A=P,n(D,O))return A;var $=h(O);return f!==void 0&&f(A,$)?(D=O,A):(D=O,P=$)}var T=!1,D,P,N=d===void 0?null:d;return[function(){return x(u())},N===null?void 0:function(){return x(N())}]},[u,d,h,f]);var v=i(c,m[0],m[1]);return o(function(){y.hasValue=!0,y.value=v},[v]),l(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ml}var Jh;function ky(){return Jh||(Jh=1,process.env.NODE_ENV==="production"?Gs.exports=wy():Gs.exports=Sy()),Gs.exports}var My=ky(),Ty=(...r)=>e=>{r.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},Cy=({contentComponent:r})=>{const e=Hh.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getServerSnapshot);return J.jsx(J.Fragment,{children:Object.values(e)})};function Ey(){const r=new Set;let e={};return{subscribe(t){return r.add(t),()=>{r.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,n){e={...e,[t]:ji.createPortal(n.reactElement,n.element,t)},r.forEach(i=>i())},removeRenderer(t){const n={...e};delete n[t],e=n,r.forEach(i=>i())}}}var Ay=class extends I.Component{constructor(r){var e;super(r),this.editorContentRef=I.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=r.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var r;const e=this.props.editor;if(e&&!e.isDestroyed&&((r=e.view.dom)!=null&&r.parentNode)){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=Ey(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var r;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((r=e.view.dom)!=null&&r.parentNode))return;const t=document.createElement("div");t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){const{editor:r,innerRef:e,...t}=this.props;return J.jsxs(J.Fragment,{children:[J.jsx("div",{ref:Ty(e,this.editorContentRef),...t}),r?.contentComponent&&J.jsx(Cy,{contentComponent:r.contentComponent})]})}},Oy=I.forwardRef((r,e)=>{const t=I.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[r.editor]);return I.createElement(Ay,{key:t,innerRef:e,...r})}),Ny=I.memo(Oy),Dy=typeof window<"u"?I.useLayoutEffect:I.useEffect,zy=class{constructor(r){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=r,this.lastSnapshot={editor:r,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(r){return this.subscribers.add(r),()=>{this.subscribers.delete(r)}}watch(r){if(this.editor=r,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(n=>n())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function Xh(r){var e;const[t]=I.useState(()=>new zy(r.editor)),n=My.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,r.selector,(e=r.equalityFn)!=null?e:xy);return Dy(()=>t.watch(r.editor),[r.editor,t]),I.useDebugValue(n),n}var Yh=process.env.NODE_ENV!=="production",gl=typeof window>"u",Iy=gl||!!(typeof window<"u"&&window.next),Ry=class v1{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(gl||Iy){if(Yh)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&gl&&Yh)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...n)},onBlur:(...n)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...n)},onCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...n)},onDestroy:(...n)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...n)},onFocus:(...n)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...n)},onSelectionUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...n)},onTransaction:(...n)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...n)},onUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...n)},onContentError:(...n)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...n)},onDrop:(...n)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...n)},onPaste:(...n)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...n)},onDelete:(...n)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...n)}};return new i7(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)?!0:n==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=t.extensions)==null?void 0:o[s])}):e[n]===t[n])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?v1.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,i)=>n===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Py(r={},e=[]){const t=I.useRef(r);t.current=r;const[n]=I.useState(()=>new Ry(t)),i=Hh.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return I.useDebugValue(i),I.useEffect(n.onRender(e)),Xh({editor:i,selector:({transactionNumber:s})=>r.shouldRerenderOnTransaction===!1||r.shouldRerenderOnTransaction===void 0?null:r.immediatelyRender&&s===0?0:s+1}),i}var Zh=I.createContext({editor:null});Zh.Consumer;var Qh=()=>I.useContext(Zh),ef=I.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),tf=()=>I.useContext(ef);function rf({as:r="div",...e}){const{nodeViewContentRef:t,nodeViewContentChildren:n}=tf();return J.jsx(r,{...e,ref:t,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style},children:n})}var nf=I.forwardRef((r,e)=>{const{onDragStart:t}=tf(),n=r.as||"div";return J.jsx(n,{...r,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...r.style}})});function sf(r){return!!(typeof r=="function"&&r.prototype&&r.prototype.isReactComponent)}function of(r){return!!(typeof r=="object"&&r.$$typeof&&(r.$$typeof.toString()==="Symbol(react.forward_ref)"||r.$$typeof.description==="react.forward_ref"))}function Ly(r){return!!(typeof r=="object"&&r.$$typeof&&(r.$$typeof.toString()==="Symbol(react.memo)"||r.$$typeof.description==="react.memo"))}function By(r){if(sf(r)||of(r))return!0;if(Ly(r)){const e=r.type;if(e)return sf(e)||of(e)}return!1}function Fy(){try{if(I.version)return parseInt(I.version.split(".")[0],10)>=19}catch{}return!1}var $y=class{constructor(r,{editor:e,props:t={},as:n="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=r,this.editor=e,this.props=t,this.element=document.createElement(n),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?ji.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var r;const e=this.component,t=this.props,n=this.editor,i=Fy(),s=By(e),o={...t};o.ref&&!(i||s)&&delete o.ref,!o.ref&&(i||s)&&(o.ref=a=>{this.ref=a}),this.reactElement=J.jsx(e,{...o}),(r=n?.contentComponent)==null||r.setRenderer(this.id,this)}updateProps(r={}){this.props={...this.props,...r},this.render()}destroy(){var r;const e=this.editor;(r=e?.contentComponent)==null||r.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(r){Object.keys(r).forEach(e=>{this.element.setAttribute(e,r[e])})}};I.createContext({markViewContentRef:()=>{}});var Hy=class extends h7{constructor(r,e,t){if(super(r,e,t),this.selectionRafId=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const n=this.dom.querySelector("[data-node-view-content]");if(!n)return;n.appendChild(this.contentDOMElement)}}mount(){const r={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(l={})=>this.updateAttributes(l),deleteNode:()=>this.deleteNode(),ref:I.createRef()};if(!this.component.displayName){const l=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=l(this.extension.name)}const n={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:l=>{l&&this.contentDOMElement&&l.firstChild!==this.contentDOMElement&&(l.hasAttribute("data-node-view-wrapper")&&l.removeAttribute("data-node-view-wrapper"),l.appendChild(this.contentDOMElement))}},i=this.component,s=I.memo(l=>J.jsx(ef.Provider,{value:n,children:I.createElement(i,l)}));s.displayName="ReactNodeView";let o=this.node.isInline?"span":"div";this.options.as&&(o=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new $y(s,{editor:this.editor,props:r,as:o,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var r;if(this.renderer.element.firstElementChild&&!((r=this.renderer.element.firstElementChild)!=null&&r.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:r,to:e}=this.editor.state.selection,t=this.getPos();if(typeof t=="number")if(r<=t&&e>=t+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(r,e,t){const n=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(r.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,s=this.decorations,o=this.innerDecorations;return this.node=r,this.decorations=e,this.innerDecorations=t,this.options.update({oldNode:i,oldDecorations:s,newNode:r,newDecorations:e,oldInnerDecorations:o,innerDecorations:t,updateProps:()=>n({node:r,decorations:e,innerDecorations:t})})}return r===this.node&&this.decorations===e&&this.innerDecorations===t||(this.node=r,this.decorations=e,this.innerDecorations=t,n({node:r,decorations:e,innerDecorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let r={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,t=Oi(this.node,e);r=this.options.attrs({node:this.node,HTMLAttributes:t})}else r=this.options.attrs;this.renderer.updateAttributes(r)}}};function gn(r,e){return t=>t.editor.contentComponent?new Hy(r,t,e):{}}var Vy=Object.defineProperty,qy=(r,e)=>{for(var t in e)Vy(r,t,{get:e[t],enumerable:!0})},_y="listItem",af="textStyle",lf=/^\s*([-+*])\s$/,cf=we.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:r}){return["ul",ye(this.options.HTMLAttributes,r),0]},markdownTokenName:"list",parseMarkdown:(r,e)=>r.type!=="list"||r.ordered?[]:{type:"bulletList",content:r.items?e.parseChildren(r.items):[]},renderMarkdown:(r,e)=>r.content?e.renderChildren(r.content,`
115
+ `)}function d7(r,e,t={}){const{state:n}=e,{doc:i,tr:s}=n,o=r;i.descendants((a,l)=>{const c=s.mapping.map(l),u=s.mapping.map(l)+a.nodeSize;let d=null;if(a.marks.forEach(f=>{if(f!==o)return!1;d=f}),!d)return;let h=!1;if(Object.keys(t).forEach(f=>{t[f]!==d.attrs[f]&&(h=!0)}),h){const f=r.type.create({...r.attrs,...t});s.removeMark(c,u,r.type),s.addMark(c,u,f)}}),s.docChanged&&e.view.dispatch(s)}var we=class y1 extends tl{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new y1(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},h7=class{constructor(r,e,t){this.isDragging=!1,this.component=r,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...t},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(r){var e,t,n,i,s,o,a;const{view:l}=this.editor,c=r.target,u=c.nodeType===3?(e=c.parentElement)==null?void 0:e.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(t=this.contentDOM)!=null&&t.contains(c)||!u)return;let d=0,h=0;if(this.dom!==u){const T=this.dom.getBoundingClientRect(),D=u.getBoundingClientRect(),P=(i=r.offsetX)!=null?i:(n=r.nativeEvent)==null?void 0:n.offsetX,N=(o=r.offsetY)!=null?o:(s=r.nativeEvent)==null?void 0:s.offsetY;d=D.x-T.x+P,h=D.y-T.y+N}const f=this.dom.cloneNode(!0);try{const T=this.dom.getBoundingClientRect();f.style.width=`${Math.round(T.width)}px`,f.style.height=`${Math.round(T.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let m=null;try{m=document.createElement("div"),m.style.position="absolute",m.style.top="-9999px",m.style.left="-9999px",m.style.pointerEvents="none",m.appendChild(f),document.body.appendChild(m),(a=r.dataTransfer)==null||a.setDragImage(f,d,h)}finally{m&&setTimeout(()=>{try{m?.remove()}catch{}},0)}const y=this.getPos();if(typeof y!="number")return;const v=se.create(l.state.doc,y),x=l.state.tr.setSelection(v);l.dispatch(x)}stopEvent(r){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:r});const t=r.target;if(!(this.dom.contains(t)&&!((e=this.contentDOM)!=null&&e.contains(t))))return!1;const i=r.type.startsWith("drag"),s=r.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(t.tagName)||t.isContentEditable)&&!s&&!i)return!0;const{isEditable:a}=this.editor,{isDragging:l}=this,c=!!this.node.type.spec.draggable,u=se.isSelectable(this.node),d=r.type==="copy",h=r.type==="paste",f=r.type==="cut",m=r.type==="mousedown";if(!c&&u&&i&&r.target===this.dom&&r.preventDefault(),c&&i&&!l&&r.target===this.dom)return r.preventDefault(),!1;if(c&&a&&!l&&m){const y=t.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(l||s||d||h||f||m&&u)}ignoreMutation(r){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:r}):this.node.isLeaf||this.node.isAtom?!0:r.type==="selection"||this.dom.contains(r.target)&&r.type==="childList"&&(Ns()||Zd())&&this.editor.isFocused&&[...Array.from(r.addedNodes),...Array.from(r.removedNodes)].every(t=>t.isContentEditable)?!1:this.contentDOM===r.target&&r.type==="attributes"?!0:!this.contentDOM.contains(r.target)}updateAttributes(r){this.editor.commands.command(({tr:e})=>{const t=this.getPos();return typeof t!="number"?!1:(e.setNodeMarkup(t,void 0,{...this.node.attrs,...r}),!0)})}deleteNode(){const r=this.getPos();if(typeof r!="number")return;const e=r+this.node.nodeSize;this.editor.commands.deleteRange({from:r,to:e})}};function Hs(r){return new J6({find:r.find,handler:({state:e,range:t,match:n,pasteEvent:i})=>{const s=ke(r.getAttributes,void 0,n,i);if(s===!1||s===null)return null;const{tr:o}=e,a=n[n.length-1],l=n[0];let c=t.to;if(a){const u=l.search(/\S/),d=t.from+l.indexOf(a),h=d+a.length;if(dh(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(v=>v===r.type&&v!==m.mark.type)).filter(m=>m.to>d).length)return null;h<t.to&&o.delete(h,t.to),d>t.from&&o.delete(t.from+u,d),c=t.from+u+a.length,o.addMark(t.from+u,c,r.type.create(s||{})),o.removeStoredMark(r.type)}}})}function f7(r={}){return new Pe({view(e){return new p7(e,r)}})}class p7{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(t){let d=e.nodeBefore,h=e.nodeAfter;if(d||h){let f=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(f){let m=f.getBoundingClientRect(),y=d?m.bottom:m.top;d&&h&&(y=(y+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let v=this.width/2*a;n={left:m.left,right:m.right,top:y-v,bottom:y+v}}}}if(!n){let d=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;n={left:d.left-h,right:d.left+h,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=l.getBoundingClientRect(),h=d.width/l.offsetWidth,f=d.height/l.offsetHeight;c=d.left-l.scrollLeft*h,u=d.top-l.scrollTop*f}this.element.style.left=(n.left-c)/o+"px",this.element.style.top=(n.top-u)/a+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!s){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=ou(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Le extends ce{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Le.valid(n)?new Le(n):ce.near(n)}content(){return X.empty}eq(e){return e instanceof Le&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Le(e.resolve(t.pos))}getBookmark(){return new al(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!m7(e)||!g7(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Le.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(Le.valid(l))return l}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!se.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let a=e.doc.resolve(i);if(Le.valid(a))return a}return null}}}Le.prototype.visible=!1,Le.findFrom=Le.findGapCursorFrom,ce.jsonID("gapcursor",Le);class al{constructor(e){this.pos=e}map(e){return new al(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Le.valid(t)?new Le(t):ce.near(t)}}function Oh(r){return r.isAtom||r.spec.isolating||r.spec.createGapCursor}function m7(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Oh(i.type))return!0;if(i.inlineContent)return!1}}return!0}function g7(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Oh(i.type))return!0;if(i.inlineContent)return!1}}return!0}function y7(){return new Pe({props:{decorations:w7,createSelectionBetween(r,e,t){return e.pos==t.pos&&Le.valid(t)?new Le(t):null},handleClick:b7,handleKeyDown:v7,handleDOMEvents:{beforeinput:x7}}})}const v7=Ha({ArrowLeft:Vs("horiz",-1),ArrowRight:Vs("horiz",1),ArrowUp:Vs("vert",-1),ArrowDown:Vs("vert",1)});function Vs(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof de){if(!s.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=Le.findGapCursorFrom(a,e,l);return c?(i&&i(n.tr.setSelection(new Le(c))),!0):!1}}function b7(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!Le.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&se.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new Le(n))),!0)}function x7(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof Le))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=H.empty;for(let o=n.length-1;o>=0;o--)i=H.from(n[o].createAndFill(null,i));let s=r.state.tr.replace(t.pos,t.pos,new X(i,0,0));return s.setSelection(de.near(s.doc.resolve(t.pos+1))),r.dispatch(s),!1}function w7(r){if(!(r.selection instanceof Le))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",De.create(r.doc,[nt.widget(r.selection.head,e,{key:"gapcursor"})])}var qs=200,Ke=function(){};Ke.prototype.append=function(e){return e.length?(e=Ke.from(e),!this.length&&e||e.length<qs&&this.leafAppend(e)||this.length<qs&&e.leafPrepend(this)||this.appendInner(e)):this},Ke.prototype.prepend=function(e){return e.length?Ke.from(e).append(this):this},Ke.prototype.appendInner=function(e){return new S7(this,e)},Ke.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ke.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ke.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ke.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Ke.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i},Ke.from=function(e){return e instanceof Ke?e:e&&e.length?new Nh(e):Ke.empty};var Nh=(function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=qs)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=qs)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(Ke);Ke.empty=new Nh([]);var S7=(function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(n,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(Ke);const k7=500;class Lt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,a,l,c=[],u=[];return this.items.forEach((d,h)=>{if(!d.step){i||(i=this.remapping(n,h+1),s=i.maps.length),s--,u.push(d);return}if(i){u.push(new _t(d.map));let f=d.step.map(i.slice(s)),m;f&&o.maybeStep(f).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],c.push(new _t(m,void 0,void 0,c.length+u.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(s)):d.selection,l=new Lt(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,n,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),h=new _t(e.mapping.maps[u],d,t),f;(f=l&&l.merge(h))&&(h=f,u?s.pop():a=a.slice(0,a.length-1)),s.push(h),t&&(o++,t=void 0),i||(l=h)}let c=o-n.depth;return c>T7&&(a=M7(a,c),o-=c),new Lt(a.append(s),o)}remapping(e,t){let n=new pi;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new Lt(this.items.append(e.map(t=>new _t(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=t;this.items.forEach(h=>{let f=s.getMirror(--l);if(f==null)return;o=Math.min(o,f);let m=s.maps[f];if(h.step){let y=e.steps[f].invert(e.docs[f]),v=h.selection&&h.selection.map(s.slice(l+1,f));v&&a++,n.push(new _t(m,y,v))}else n.push(new _t(m))},i);let c=[];for(let h=t;h<o;h++)c.push(new _t(s.maps[h]));let u=this.items.slice(0,i).append(c).append(n),d=new Lt(u,a);return d.emptyItemCount()>k7&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(t.slice(n)),c=l&&l.getMap();if(n--,c&&t.appendMap(c,n),l){let u=o.selection&&o.selection.map(t.slice(n));u&&s++;let d=new _t(c.invert(),l,u),h,f=i.length-1;(h=i.length&&i[f].merge(d))?i[f]=h:i.push(d)}}else o.map&&n--},this.items.length,0),new Lt(Ke.from(i.reverse()),s)}}Lt.empty=new Lt(Ke.empty,0);function M7(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class _t{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new _t(t.getMap().invert(),t,this.selection)}}}class Hr{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const T7=20;function C7(r,e,t,n){let i=t.getMeta(pn),s;if(i)return i.historyState;t.getMeta(O7)&&(r=new Hr(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(pn))return o.getMeta(pn).redo?new Hr(r.done.addTransform(t,void 0,n,_s(e)),r.undone,Dh(t.mapping.maps),r.prevTime,r.prevComposition):new Hr(r.done,r.undone.addTransform(t,void 0,n,_s(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=r.prevTime==0||!o&&r.prevComposition!=a&&(r.prevTime<(t.time||0)-n.newGroupDelay||!E7(t,r.prevRanges)),c=o?ll(r.prevRanges,t.mapping):Dh(t.mapping.maps);return new Hr(r.done.addTransform(t,l?e.selection.getBookmark():void 0,n,_s(e)),Lt.empty,c,t.time,a??r.prevComposition)}else return(s=t.getMeta("rebased"))?new Hr(r.done.rebased(t,s),r.undone.rebased(t,s),ll(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new Hr(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),ll(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function E7(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function Dh(r){let e=[];for(let t=r.length-1;t>=0&&e.length==0;t--)r[t].forEach((n,i,s,o)=>e.push(s,o));return e}function ll(r,e){if(!r)return null;let t=[];for(let n=0;n<r.length;n+=2){let i=e.map(r[n],1),s=e.map(r[n+1],-1);i<=s&&t.push(i,s)}return t}function A7(r,e,t){let n=_s(e),i=pn.get(e).spec.config,s=(t?r.undone:r.done).popEvent(e,n);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(t?r.done:r.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),l=new Hr(t?a:s.remaining,t?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(pn,{redo:t,historyState:l})}let cl=!1,zh=null;function _s(r){let e=r.plugins;if(zh!=e){cl=!1,zh=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){cl=!0;break}}return cl}const pn=new Fe("history"),O7=new Fe("closeHistory");function N7(r={}){return r={depth:r.depth||100,newGroupDelay:r.newGroupDelay||500},new Pe({key:pn,state:{init(){return new Hr(Lt.empty,Lt.empty,null,0,-1)},apply(e,t,n){return C7(t,n,e,r)}},config:r,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?Rh:n=="historyRedo"?Ph:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function Ih(r,e){return(t,n)=>{let i=pn.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let s=A7(i,t,r);s&&n(e?s.scrollIntoView():s)}return!0}}const Rh=Ih(!1,!0),Ph=Ih(!0,!0);Se.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:r=>r.length,wordCounter:r=>r.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=r=>{const e=r?.node||this.editor.state.doc;if((r?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=r=>{const e=r?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let r=!1;return[new Pe({key:new Fe("characterCount"),appendTransaction:(e,t,n)=>{if(r)return;const i=this.options.limit;if(i==null||i===0){r=!0;return}const s=this.storage.characters({node:n.doc});if(s>i){const o=s-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=n.tr.deleteRange(a,l);return r=!0,c}r=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=n||i>n&&s>n&&s<=i)return!0;if(i>n&&s>n&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=s-n,c=a-l,u=a;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>n)}})]}}),Se.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[f7(this.options)]}});var D7=Se.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Pe({key:new Fe("focus"),props:{decorations:({doc:r,selection:e})=>{const{isEditable:t,isFocused:n}=this.editor,{anchor:i}=e,s=[];if(!t||!n)return De.create(r,[]);let o=0;this.options.mode==="deepest"&&r.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;o+=1});let a=0;return r.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(nt.node(c,c+l.nodeSize,{class:this.options.className}))}),De.create(r,s)}}})]}}),z7=Se.create({name:"gapCursor",addProseMirrorPlugins(){return[y7()]},extendNodeSchema(r){var e;const t={name:r.name,options:r.options,storage:r.storage};return{allowGapCursor:(e=ke(oe(r,"allowGapCursor",t)))!=null?e:null}}});Se.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Pe({key:new Fe("placeholder"),props:{decorations:({doc:r,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!t)return null;const s=this.editor.isEmpty;return r.descendants((o,a)=>{const l=n>=a&&n<=a+o.nodeSize,c=!o.isLeaf&&Ps(o);if((l||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];s&&u.push(this.options.emptyEditorClass);const d=nt.node(a,a+o.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),De.create(r,i)}}})]}}),Se.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:r,options:e}=this;return[new Pe({key:new Fe("selection"),props:{decorations(t){return t.selection.empty||r.isFocused||!r.isEditable||x6(t.selection)||r.view.dragging?null:De.create(t.doc,[nt.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function Lh({types:r,node:e}){return e&&Array.isArray(r)&&r.includes(e.type)||e?.type===r}Se.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var r;const e=new Fe(this.name),t=this.options.node||((r=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:r.name)||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new Pe({key:e,appendTransaction:(i,s,o)=>{const{doc:a,tr:l,schema:c}=o,u=e.getState(o),d=a.content.size,h=c.nodes[t];if(u)return l.insert(d,h.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!Lh({node:o,types:n})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!Lh({node:o,types:n})}}})]}});var I7=Se.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>Rh(r,e),redo:()=>({state:r,dispatch:e})=>Ph(r,e)}},addProseMirrorPlugins(){return[N7(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),js={exports:{}},ul={};var Bh;function R7(){if(Bh)return ul;Bh=1;var r=z;function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var t=typeof Object.is=="function"?Object.is:e,n=r.useState,i=r.useEffect,s=r.useLayoutEffect,o=r.useDebugValue;function a(d,h){var f=h(),m=n({inst:{value:f,getSnapshot:h}}),y=m[0].inst,v=m[1];return s(function(){y.value=f,y.getSnapshot=h,l(y)&&v({inst:y})},[d,f,h]),i(function(){return l(y)&&v({inst:y}),d(function(){l(y)&&v({inst:y})})},[d]),o(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!t(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return ul.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:u,ul}var dl={};var Fh;function P7(){return Fh||(Fh=1,process.env.NODE_ENV!=="production"&&(function(){function r(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}function e(f,m){u||i.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=m();if(!d){var v=m();s(y,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}v=o({inst:{value:y,getSnapshot:m}});var x=v[0].inst,T=v[1];return l(function(){x.value=y,x.getSnapshot=m,t(x)&&T({inst:x})},[f,y,m]),a(function(){return t(x)&&T({inst:x}),f(function(){t(x)&&T({inst:x})})},[f]),c(y),y}function t(f){var m=f.getSnapshot;f=f.value;try{var y=m();return!s(f,y)}catch{return!0}}function n(f,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=z,s=typeof Object.is=="function"?Object.is:r,o=i.useState,a=i.useEffect,l=i.useLayoutEffect,c=i.useDebugValue,u=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:e;dl.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),dl}var $h;function hl(){return $h||($h=1,process.env.NODE_ENV==="production"?js.exports=R7():js.exports=P7()),js.exports}var Hh=hl();const{getOwnPropertyNames:L7,getOwnPropertySymbols:B7}=Object,{hasOwnProperty:F7}=Object.prototype;function fl(r,e){return function(n,i,s){return r(n,i,s)&&e(n,i,s)}}function Us(r){return function(t,n,i){if(!t||!n||typeof t!="object"||typeof n!="object")return r(t,n,i);const{cache:s}=i,o=s.get(t),a=s.get(n);if(o&&a)return o===n&&a===t;s.set(t,n),s.set(n,t);const l=r(t,n,i);return s.delete(t),s.delete(n),l}}function $7(r){return r?.[Symbol.toStringTag]}function Vh(r){return L7(r).concat(B7(r))}const H7=Object.hasOwn||((r,e)=>F7.call(r,e));function mn(r,e){return r===e||!r&&!e&&r!==r&&e!==e}const V7="__v",q7="__o",_7="_owner",{getOwnPropertyDescriptor:qh,keys:_h}=Object;function j7(r,e){return r.byteLength===e.byteLength&&Ws(new Uint8Array(r),new Uint8Array(e))}function U7(r,e,t){let n=r.length;if(e.length!==n)return!1;for(;n-- >0;)if(!t.equals(r[n],e[n],n,n,r,e,t))return!1;return!0}function W7(r,e){return r.byteLength===e.byteLength&&Ws(new Uint8Array(r.buffer,r.byteOffset,r.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function G7(r,e){return mn(r.getTime(),e.getTime())}function K7(r,e){return r.name===e.name&&r.message===e.message&&r.cause===e.cause&&r.stack===e.stack}function J7(r,e){return r===e}function jh(r,e,t){const n=r.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),s=r.entries();let o,a,l=0;for(;(o=s.next())&&!o.done;){const c=e.entries();let u=!1,d=0;for(;(a=c.next())&&!a.done;){if(i[d]){d++;continue}const h=o.value,f=a.value;if(t.equals(h[0],f[0],l,d,r,e,t)&&t.equals(h[1],f[1],h[0],f[0],r,e,t)){u=i[d]=!0;break}d++}if(!u)return!1;l++}return!0}const X7=mn;function Y7(r,e,t){const n=_h(r);let i=n.length;if(_h(e).length!==i)return!1;for(;i-- >0;)if(!Wh(r,e,t,n[i]))return!1;return!0}function Di(r,e,t){const n=Vh(r);let i=n.length;if(Vh(e).length!==i)return!1;let s,o,a;for(;i-- >0;)if(s=n[i],!Wh(r,e,t,s)||(o=qh(r,s),a=qh(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function Z7(r,e){return mn(r.valueOf(),e.valueOf())}function Q7(r,e){return r.source===e.source&&r.flags===e.flags}function Uh(r,e,t){const n=r.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),s=r.values();let o,a;for(;(o=s.next())&&!o.done;){const l=e.values();let c=!1,u=0;for(;(a=l.next())&&!a.done;){if(!i[u]&&t.equals(o.value,a.value,o.value,a.value,r,e,t)){c=i[u]=!0;break}u++}if(!c)return!1}return!0}function Ws(r,e){let t=r.byteLength;if(e.byteLength!==t||r.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(r[t]!==e[t])return!1;return!0}function ey(r,e){return r.hostname===e.hostname&&r.pathname===e.pathname&&r.protocol===e.protocol&&r.port===e.port&&r.hash===e.hash&&r.username===e.username&&r.password===e.password}function Wh(r,e,t,n){return(n===_7||n===q7||n===V7)&&(r.$$typeof||e.$$typeof)?!0:H7(e,n)&&t.equals(r[n],e[n],n,n,r,e,t)}const ty="[object ArrayBuffer]",ry="[object Arguments]",ny="[object Boolean]",iy="[object DataView]",sy="[object Date]",oy="[object Error]",ay="[object Map]",ly="[object Number]",cy="[object Object]",uy="[object RegExp]",dy="[object Set]",hy="[object String]",fy={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},py="[object URL]",my=Object.prototype.toString;function gy({areArrayBuffersEqual:r,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:f,unknownTagComparators:m}){return function(v,x,T){if(v===x)return!0;if(v==null||x==null)return!1;const D=typeof v;if(D!==typeof x)return!1;if(D!=="object")return D==="number"?a(v,x,T):D==="function"?s(v,x,T):!1;const P=v.constructor;if(P!==x.constructor)return!1;if(P===Object)return l(v,x,T);if(Array.isArray(v))return e(v,x,T);if(P===Date)return n(v,x,T);if(P===RegExp)return u(v,x,T);if(P===Map)return o(v,x,T);if(P===Set)return d(v,x,T);const N=my.call(v);if(N===sy)return n(v,x,T);if(N===uy)return u(v,x,T);if(N===ay)return o(v,x,T);if(N===dy)return d(v,x,T);if(N===cy)return typeof v.then!="function"&&typeof x.then!="function"&&l(v,x,T);if(N===py)return f(v,x,T);if(N===oy)return i(v,x,T);if(N===ry)return l(v,x,T);if(fy[N])return h(v,x,T);if(N===ty)return r(v,x,T);if(N===iy)return t(v,x,T);if(N===ny||N===ly||N===hy)return c(v,x,T);if(m){let O=m[N];if(!O){const A=$7(v);A&&(O=m[A])}if(O)return O(v,x,T)}return!1}}function yy({circular:r,createCustomConfig:e,strict:t}){let n={areArrayBuffersEqual:j7,areArraysEqual:t?Di:U7,areDataViewsEqual:W7,areDatesEqual:G7,areErrorsEqual:K7,areFunctionsEqual:J7,areMapsEqual:t?fl(jh,Di):jh,areNumbersEqual:X7,areObjectsEqual:t?Di:Y7,arePrimitiveWrappersEqual:Z7,areRegExpsEqual:Q7,areSetsEqual:t?fl(Uh,Di):Uh,areTypedArraysEqual:t?fl(Ws,Di):Ws,areUrlsEqual:ey,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),r){const i=Us(n.areArraysEqual),s=Us(n.areMapsEqual),o=Us(n.areObjectsEqual),a=Us(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:a})}return n}function vy(r){return function(e,t,n,i,s,o,a){return r(e,t,a)}}function by({circular:r,comparator:e,createState:t,equals:n,strict:i}){if(t)return function(a,l){const{cache:c=r?new WeakMap:void 0,meta:u}=t();return e(a,l,{cache:c,equals:n,meta:u,strict:i})};if(r)return function(a,l){return e(a,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const s={cache:void 0,equals:n,meta:void 0,strict:i};return function(a,l){return e(a,l,s)}}const xy=Vr();Vr({strict:!0}),Vr({circular:!0}),Vr({circular:!0,strict:!0}),Vr({createInternalComparator:()=>mn}),Vr({strict:!0,createInternalComparator:()=>mn}),Vr({circular:!0,createInternalComparator:()=>mn}),Vr({circular:!0,createInternalComparator:()=>mn,strict:!0});function Vr(r={}){const{circular:e=!1,createInternalComparator:t,createState:n,strict:i=!1}=r,s=yy(r),o=gy(s),a=t?t(o):vy(o);return by({circular:e,comparator:o,createState:n,equals:a,strict:i})}var Gs={exports:{}},pl={};var Gh;function wy(){if(Gh)return pl;Gh=1;var r=z,e=hl();function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var n=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,s=r.useRef,o=r.useEffect,a=r.useMemo,l=r.useDebugValue;return pl.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var m=s(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function x(O){if(!T){if(T=!0,D=O,O=h(O),f!==void 0&&y.hasValue){var A=y.value;if(f(A,O))return P=A}return P=O}if(A=P,n(D,O))return A;var $=h(O);return f!==void 0&&f(A,$)?(D=O,A):(D=O,P=$)}var T=!1,D,P,N=d===void 0?null:d;return[function(){return x(u())},N===null?void 0:function(){return x(N())}]},[u,d,h,f]);var v=i(c,m[0],m[1]);return o(function(){y.hasValue=!0,y.value=v},[v]),l(v),v},pl}var ml={};var Kh;function Sy(){return Kh||(Kh=1,process.env.NODE_ENV!=="production"&&(function(){function r(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=z,t=hl(),n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;ml.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var m=s(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function x(O){if(!T){if(T=!0,D=O,O=h(O),f!==void 0&&y.hasValue){var A=y.value;if(f(A,O))return P=A}return P=O}if(A=P,n(D,O))return A;var $=h(O);return f!==void 0&&f(A,$)?(D=O,A):(D=O,P=$)}var T=!1,D,P,N=d===void 0?null:d;return[function(){return x(u())},N===null?void 0:function(){return x(N())}]},[u,d,h,f]);var v=i(c,m[0],m[1]);return o(function(){y.hasValue=!0,y.value=v},[v]),l(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ml}var Jh;function ky(){return Jh||(Jh=1,process.env.NODE_ENV==="production"?Gs.exports=wy():Gs.exports=Sy()),Gs.exports}var My=ky(),Ty=(...r)=>e=>{r.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},Cy=({contentComponent:r})=>{const e=Hh.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getServerSnapshot);return J.jsx(J.Fragment,{children:Object.values(e)})};function Ey(){const r=new Set;let e={};return{subscribe(t){return r.add(t),()=>{r.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,n){e={...e,[t]:ji.createPortal(n.reactElement,n.element,t)},r.forEach(i=>i())},removeRenderer(t){const n={...e};delete n[t],e=n,r.forEach(i=>i())}}}var Ay=class extends z.Component{constructor(r){var e;super(r),this.editorContentRef=z.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=r.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var r;const e=this.props.editor;if(e&&!e.isDestroyed&&((r=e.view.dom)!=null&&r.parentNode)){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=Ey(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var r;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((r=e.view.dom)!=null&&r.parentNode))return;const t=document.createElement("div");t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){const{editor:r,innerRef:e,...t}=this.props;return J.jsxs(J.Fragment,{children:[J.jsx("div",{ref:Ty(e,this.editorContentRef),...t}),r?.contentComponent&&J.jsx(Cy,{contentComponent:r.contentComponent})]})}},Oy=z.forwardRef((r,e)=>{const t=z.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[r.editor]);return z.createElement(Ay,{key:t,innerRef:e,...r})}),Ny=z.memo(Oy),Dy=typeof window<"u"?z.useLayoutEffect:z.useEffect,zy=class{constructor(r){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=r,this.lastSnapshot={editor:r,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(r){return this.subscribers.add(r),()=>{this.subscribers.delete(r)}}watch(r){if(this.editor=r,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(n=>n())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function Xh(r){var e;const[t]=z.useState(()=>new zy(r.editor)),n=My.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,r.selector,(e=r.equalityFn)!=null?e:xy);return Dy(()=>t.watch(r.editor),[r.editor,t]),z.useDebugValue(n),n}var Yh=process.env.NODE_ENV!=="production",gl=typeof window>"u",Iy=gl||!!(typeof window<"u"&&window.next),Ry=class v1{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(gl||Iy){if(Yh)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&gl&&Yh)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...n)},onBlur:(...n)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...n)},onCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...n)},onDestroy:(...n)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...n)},onFocus:(...n)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...n)},onSelectionUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...n)},onTransaction:(...n)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...n)},onUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...n)},onContentError:(...n)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...n)},onDrop:(...n)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...n)},onPaste:(...n)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...n)},onDelete:(...n)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...n)}};return new i7(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)?!0:n==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=t.extensions)==null?void 0:o[s])}):e[n]===t[n])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?v1.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,i)=>n===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Py(r={},e=[]){const t=z.useRef(r);t.current=r;const[n]=z.useState(()=>new Ry(t)),i=Hh.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return z.useDebugValue(i),z.useEffect(n.onRender(e)),Xh({editor:i,selector:({transactionNumber:s})=>r.shouldRerenderOnTransaction===!1||r.shouldRerenderOnTransaction===void 0?null:r.immediatelyRender&&s===0?0:s+1}),i}var Zh=z.createContext({editor:null});Zh.Consumer;var Qh=()=>z.useContext(Zh),ef=z.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),tf=()=>z.useContext(ef);function rf({as:r="div",...e}){const{nodeViewContentRef:t,nodeViewContentChildren:n}=tf();return J.jsx(r,{...e,ref:t,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style},children:n})}var nf=z.forwardRef((r,e)=>{const{onDragStart:t}=tf(),n=r.as||"div";return J.jsx(n,{...r,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...r.style}})});function sf(r){return!!(typeof r=="function"&&r.prototype&&r.prototype.isReactComponent)}function of(r){return!!(typeof r=="object"&&r.$$typeof&&(r.$$typeof.toString()==="Symbol(react.forward_ref)"||r.$$typeof.description==="react.forward_ref"))}function Ly(r){return!!(typeof r=="object"&&r.$$typeof&&(r.$$typeof.toString()==="Symbol(react.memo)"||r.$$typeof.description==="react.memo"))}function By(r){if(sf(r)||of(r))return!0;if(Ly(r)){const e=r.type;if(e)return sf(e)||of(e)}return!1}function Fy(){try{if(z.version)return parseInt(z.version.split(".")[0],10)>=19}catch{}return!1}var $y=class{constructor(r,{editor:e,props:t={},as:n="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=r,this.editor=e,this.props=t,this.element=document.createElement(n),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?ji.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var r;const e=this.component,t=this.props,n=this.editor,i=Fy(),s=By(e),o={...t};o.ref&&!(i||s)&&delete o.ref,!o.ref&&(i||s)&&(o.ref=a=>{this.ref=a}),this.reactElement=J.jsx(e,{...o}),(r=n?.contentComponent)==null||r.setRenderer(this.id,this)}updateProps(r={}){this.props={...this.props,...r},this.render()}destroy(){var r;const e=this.editor;(r=e?.contentComponent)==null||r.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(r){Object.keys(r).forEach(e=>{this.element.setAttribute(e,r[e])})}};z.createContext({markViewContentRef:()=>{}});var Hy=class extends h7{constructor(r,e,t){if(super(r,e,t),this.selectionRafId=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const n=this.dom.querySelector("[data-node-view-content]");if(!n)return;n.appendChild(this.contentDOMElement)}}mount(){const r={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(l={})=>this.updateAttributes(l),deleteNode:()=>this.deleteNode(),ref:z.createRef()};if(!this.component.displayName){const l=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=l(this.extension.name)}const n={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:l=>{l&&this.contentDOMElement&&l.firstChild!==this.contentDOMElement&&(l.hasAttribute("data-node-view-wrapper")&&l.removeAttribute("data-node-view-wrapper"),l.appendChild(this.contentDOMElement))}},i=this.component,s=z.memo(l=>J.jsx(ef.Provider,{value:n,children:z.createElement(i,l)}));s.displayName="ReactNodeView";let o=this.node.isInline?"span":"div";this.options.as&&(o=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new $y(s,{editor:this.editor,props:r,as:o,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var r;if(this.renderer.element.firstElementChild&&!((r=this.renderer.element.firstElementChild)!=null&&r.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:r,to:e}=this.editor.state.selection,t=this.getPos();if(typeof t=="number")if(r<=t&&e>=t+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(r,e,t){const n=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(r.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,s=this.decorations,o=this.innerDecorations;return this.node=r,this.decorations=e,this.innerDecorations=t,this.options.update({oldNode:i,oldDecorations:s,newNode:r,newDecorations:e,oldInnerDecorations:o,innerDecorations:t,updateProps:()=>n({node:r,decorations:e,innerDecorations:t})})}return r===this.node&&this.decorations===e&&this.innerDecorations===t||(this.node=r,this.decorations=e,this.innerDecorations=t,n({node:r,decorations:e,innerDecorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let r={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,t=Oi(this.node,e);r=this.options.attrs({node:this.node,HTMLAttributes:t})}else r=this.options.attrs;this.renderer.updateAttributes(r)}}};function gn(r,e){return t=>t.editor.contentComponent?new Hy(r,t,e):{}}var Vy=Object.defineProperty,qy=(r,e)=>{for(var t in e)Vy(r,t,{get:e[t],enumerable:!0})},_y="listItem",af="textStyle",lf=/^\s*([-+*])\s$/,cf=we.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:r}){return["ul",ye(this.options.HTMLAttributes,r),0]},markdownTokenName:"list",parseMarkdown:(r,e)=>r.type!=="list"||r.ordered?[]:{type:"bulletList",content:r.items?e.parseChildren(r.items):[]},renderMarkdown:(r,e)=>r.content?e.renderChildren(r.content,`
116
116
  `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(_y,this.editor.getAttributes(af)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let r=it({find:lf,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(r=it({find:lf,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(af),editor:this.editor})),[r]}}),uf=we.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",ye(this.options.HTMLAttributes,r),0]},markdownTokenName:"list_item",parseMarkdown:(r,e)=>{if(r.type!=="list_item")return[];let t=[];if(r.tokens&&r.tokens.length>0)if(r.tokens.some(i=>i.type==="paragraph"))t=e.parseChildren(r.tokens);else{const i=r.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(t=[{type:"paragraph",content:e.parseInline(i.tokens)}],r.tokens.length>1){const o=r.tokens.slice(1),a=e.parseChildren(o);t.push(...a)}}else t=e.parseChildren(r.tokens)}return t.length===0&&(t=[{type:"paragraph",content:[]}]),{type:"listItem",content:t}},renderMarkdown:(r,e,t)=>ol(r,e,n=>n.parentType==="bulletList"?"- ":n.parentType==="orderedList"?`${n.index+1}. `:"- ",t),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),jy={};qy(jy,{findListItemPos:()=>zi,getNextListDepth:()=>yl,handleBackspace:()=>vl,handleDelete:()=>bl,hasListBefore:()=>df,hasListItemAfter:()=>Uy,hasListItemBefore:()=>hf,listItemHasSubList:()=>ff,nextListIsDeeper:()=>pf,nextListIsHigher:()=>mf});var zi=(r,e)=>{const{$from:t}=e.selection,n=Ve(r,e.schema);let i=null,s=t.depth,o=t.pos,a=null;for(;s>0&&a===null;)i=t.node(s),i.type===n?a=s:(s-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},yl=(r,e)=>{const t=zi(r,e);if(!t)return!1;const[,n]=m6(e,r,t.$pos.pos+4);return n},df=(r,e,t)=>{const{$anchor:n}=r.selection,i=Math.max(0,n.pos-2),s=r.doc.resolve(i).node();return!(!s||!t.includes(s.type.name))},hf=(r,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-2);return!(i.index()===0||((t=i.nodeBefore)==null?void 0:t.type.name)!==r)},ff=(r,e,t)=>{if(!t)return!1;const n=Ve(r,e.schema);let i=!1;return t.descendants(s=>{s.type===n&&(i=!0)}),i},vl=(r,e,t)=>{if(r.commands.undoInputRule())return!0;if(r.state.selection.from!==r.state.selection.to)return!1;if(!Fr(r.state,e)&&df(r.state,e,t)){const{$anchor:a}=r.state.selection,l=r.state.doc.resolve(a.before()-1),c=[];l.node().descendants((h,f)=>{h.type.name===e&&c.push({node:h,pos:f})});const u=c.at(-1);if(!u)return!1;const d=r.state.doc.resolve(l.start()+u.pos+1);return r.chain().cut({from:a.start()-1,to:a.end()+1},d.end()).joinForward().run()}if(!Fr(r.state,e)||!b6(r.state))return!1;const n=zi(e,r.state);if(!n)return!1;const s=r.state.doc.resolve(n.$pos.pos-2).node(n.depth),o=ff(e,r.state,s);return hf(e,r.state)&&!o?r.commands.joinItemBackward():r.chain().liftListItem(e).run()},pf=(r,e)=>{const t=yl(r,e),n=zi(r,e);return!n||!t?!1:t>n.depth},mf=(r,e)=>{const t=yl(r,e),n=zi(r,e);return!n||!t?!1:t<n.depth},bl=(r,e)=>{if(!Fr(r.state,e)||!v6(r.state,e))return!1;const{selection:t}=r.state,{$from:n,$to:i}=t;return!t.empty&&n.sameParent(i)?!1:pf(e,r.state)?r.chain().focus(r.state.selection.from+4).lift(e).joinBackward().run():mf(e,r.state)?r.chain().joinForward().joinBackward().run():r.commands.joinItemForward()},Uy=(r,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-n.parentOffset-2);return!(i.index()===i.parent.childCount-1||((t=i.nodeAfter)==null?void 0:t.type.name)!==r)},Wy=Se.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:r})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{r.state.schema.nodes[t]!==void 0&&bl(r,t)&&(e=!0)}),e},"Mod-Delete":({editor:r})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{r.state.schema.nodes[t]!==void 0&&bl(r,t)&&(e=!0)}),e},Backspace:({editor:r})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{r.state.schema.nodes[t]!==void 0&&vl(r,t,n)&&(e=!0)}),e},"Mod-Backspace":({editor:r})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{r.state.schema.nodes[t]!==void 0&&vl(r,t,n)&&(e=!0)}),e}}}}),gf=/^(\s*)(\d+)\.\s+(.*)$/,Gy=/^\s/;function Ky(r){const e=[];let t=0,n=0;for(;t<r.length;){const i=r[t],s=i.match(gf);if(!s)break;const[,o,a,l]=s,c=o.length;let u=l,d=t+1;const h=[i];for(;d<r.length;){const f=r[d];if(f.match(gf))break;if(f.trim()==="")h.push(f),u+=`
117
117
  `,d+=1;else if(f.match(Gy))h.push(f),u+=`
118
118
  ${f.slice(c+2)}`,d+=1;else break}e.push({indent:c,number:parseInt(a,10),content:u.trim(),raw:h.join(`
@@ -378,19 +378,19 @@ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
378
378
  c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
379
379
  l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
380
380
  -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Ri{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 this.classes.includes(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(){var e=t=>t.toText();return this.children.map(e).join("")}}var Ut={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],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],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Ys={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Mf={Å:"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",а:"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 Ev(r,e){Ut[r]=e}function kl(r,e,t){if(!Ut[e])throw new Error("Font metrics not found for font: "+e+".");var n=r.charCodeAt(0),i=Ut[e][n];if(!i&&r[0]in Mf&&(n=Mf[r[0]].charCodeAt(0),i=Ut[e][n]),!i&&t==="text"&&Sf(n)&&(i=Ut[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Ml={};function Av(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!Ml[e]){var t=Ml[e]={cssEmPerMu:Ys.quad[e]/18};for(var n in Ys)Ys.hasOwnProperty(n)&&(t[n]=Ys[n][e])}return Ml[e]}var Ov=[[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]],Tf=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Cf=function(e,t){return t.size<2?e:Ov[e-1][t.size-1]};class ur{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,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||ur.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=Tf[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 ur(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Cf(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,textSize:e,sizeMultiplier:Tf[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Cf(ur.BASESIZE,e);return this.size===t&&this.textSize===ur.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!==ur.BASESIZE?["sizing","reset-size"+this.size,"size"+ur.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Av(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}ur.BASESIZE=6;var Tl={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Nv={ex:!0,em:!0,mu:!0},Ef=function(e){return typeof e!="string"&&(e=e.unit),e in Tl||e in Nv||e==="ex"},ze=function(e,t){var n;if(e.unit in Tl)n=Tl[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")n=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new U("Invalid unit: '"+e.unit+"'");i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},G=function(e){return+e.toFixed(4)+"em"},_r=function(e){return e.filter(t=>t).join(" ")},Af=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},Of=function(e){var t=document.createElement(e);t.className=_r(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var s=0;s<this.children.length;s++)t.appendChild(this.children[s].toNode());return t},Dv=/[\s"'>/=\x00-\x1f]/,Nf=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+xe.escape(_r(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=xe.hyphenate(i)+":"+this.style[i]+";");n&&(t+=' style="'+xe.escape(n)+'"');for(var s in this.attributes)if(this.attributes.hasOwnProperty(s)){if(Dv.test(s))throw new U("Invalid attribute name '"+s+"'");t+=" "+s+'="'+xe.escape(this.attributes[s])+'"'}t+=">";for(var o=0;o<this.children.length;o++)t+=this.children[o].toMarkup();return t+="</"+e+">",t};class Pi{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Af.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Of.call(this,"span")}toMarkup(){return Nf.call(this,"span")}}class Cl{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Af.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Of.call(this,"a")}toMarkup(){return Nf.call(this,"a")}}class zv{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 this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+xe.escape(this.src)+'"'+(' alt="'+xe.escape(this.alt)+'"'),t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=xe.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+xe.escape(t)+'"'),e+="'/>",e}}var Iv={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Ot{constructor(e,t,n,i,s,o,a,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=s||0,this.width=o||0,this.classes=a||[],this.style=l||{},this.maxFontSize=0;var c=gv(this.text.charCodeAt(0));c&&this.classes.push(c+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Iv[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=G(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=_r(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(t=t||document.createElement("span"),t.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+=xe.escape(_r(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=xe.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+xe.escape(n)+'"');var s=xe.escape(this.text);return e?(t+=">",t+=s,t+="</span>",t):s}}class dr{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t}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+'="'+xe.escape(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class jr{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",kf[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+xe.escape(this.alternate)+'"/>':'<path d="'+xe.escape(kf[this.pathName])+'"/>'}}class El{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+xe.escape(this.attributes[t])+'"');return e+="/>",e}}function Df(r){if(r instanceof Ot)return r;throw new Error("Expected symbolNode but got "+String(r)+".")}function Rv(r){if(r instanceof Pi)return r;throw new Error("Expected span<HtmlDomNode> but got "+String(r)+".")}var Pv={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Lv={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Ee={math:{},text:{}};function p(r,e,t,n,i,s){Ee[r][i]={font:e,group:t,replace:n},s&&n&&(Ee[r][n]=Ee[r][i])}var g="math",V="text",b="main",k="ams",Oe="accent-token",ee="bin",ot="close",jn="inner",le="mathord",qe="op-token",xt="open",Zs="punct",M="rel",hr="spacing",E="textord";p(g,b,M,"≡","\\equiv",!0),p(g,b,M,"≺","\\prec",!0),p(g,b,M,"≻","\\succ",!0),p(g,b,M,"∼","\\sim",!0),p(g,b,M,"⊥","\\perp"),p(g,b,M,"⪯","\\preceq",!0),p(g,b,M,"⪰","\\succeq",!0),p(g,b,M,"≃","\\simeq",!0),p(g,b,M,"∣","\\mid",!0),p(g,b,M,"≪","\\ll",!0),p(g,b,M,"≫","\\gg",!0),p(g,b,M,"≍","\\asymp",!0),p(g,b,M,"∥","\\parallel"),p(g,b,M,"⋈","\\bowtie",!0),p(g,b,M,"⌣","\\smile",!0),p(g,b,M,"⊑","\\sqsubseteq",!0),p(g,b,M,"⊒","\\sqsupseteq",!0),p(g,b,M,"≐","\\doteq",!0),p(g,b,M,"⌢","\\frown",!0),p(g,b,M,"∋","\\ni",!0),p(g,b,M,"∝","\\propto",!0),p(g,b,M,"⊢","\\vdash",!0),p(g,b,M,"⊣","\\dashv",!0),p(g,b,M,"∋","\\owns"),p(g,b,Zs,".","\\ldotp"),p(g,b,Zs,"⋅","\\cdotp"),p(g,b,E,"#","\\#"),p(V,b,E,"#","\\#"),p(g,b,E,"&","\\&"),p(V,b,E,"&","\\&"),p(g,b,E,"ℵ","\\aleph",!0),p(g,b,E,"∀","\\forall",!0),p(g,b,E,"ℏ","\\hbar",!0),p(g,b,E,"∃","\\exists",!0),p(g,b,E,"∇","\\nabla",!0),p(g,b,E,"♭","\\flat",!0),p(g,b,E,"ℓ","\\ell",!0),p(g,b,E,"♮","\\natural",!0),p(g,b,E,"♣","\\clubsuit",!0),p(g,b,E,"℘","\\wp",!0),p(g,b,E,"♯","\\sharp",!0),p(g,b,E,"♢","\\diamondsuit",!0),p(g,b,E,"ℜ","\\Re",!0),p(g,b,E,"♡","\\heartsuit",!0),p(g,b,E,"ℑ","\\Im",!0),p(g,b,E,"♠","\\spadesuit",!0),p(g,b,E,"§","\\S",!0),p(V,b,E,"§","\\S"),p(g,b,E,"¶","\\P",!0),p(V,b,E,"¶","\\P"),p(g,b,E,"†","\\dag"),p(V,b,E,"†","\\dag"),p(V,b,E,"†","\\textdagger"),p(g,b,E,"‡","\\ddag"),p(V,b,E,"‡","\\ddag"),p(V,b,E,"‡","\\textdaggerdbl"),p(g,b,ot,"⎱","\\rmoustache",!0),p(g,b,xt,"⎰","\\lmoustache",!0),p(g,b,ot,"⟯","\\rgroup",!0),p(g,b,xt,"⟮","\\lgroup",!0),p(g,b,ee,"∓","\\mp",!0),p(g,b,ee,"⊖","\\ominus",!0),p(g,b,ee,"⊎","\\uplus",!0),p(g,b,ee,"⊓","\\sqcap",!0),p(g,b,ee,"∗","\\ast"),p(g,b,ee,"⊔","\\sqcup",!0),p(g,b,ee,"◯","\\bigcirc",!0),p(g,b,ee,"∙","\\bullet",!0),p(g,b,ee,"‡","\\ddagger"),p(g,b,ee,"≀","\\wr",!0),p(g,b,ee,"⨿","\\amalg"),p(g,b,ee,"&","\\And"),p(g,b,M,"⟵","\\longleftarrow",!0),p(g,b,M,"⇐","\\Leftarrow",!0),p(g,b,M,"⟸","\\Longleftarrow",!0),p(g,b,M,"⟶","\\longrightarrow",!0),p(g,b,M,"⇒","\\Rightarrow",!0),p(g,b,M,"⟹","\\Longrightarrow",!0),p(g,b,M,"↔","\\leftrightarrow",!0),p(g,b,M,"⟷","\\longleftrightarrow",!0),p(g,b,M,"⇔","\\Leftrightarrow",!0),p(g,b,M,"⟺","\\Longleftrightarrow",!0),p(g,b,M,"↦","\\mapsto",!0),p(g,b,M,"⟼","\\longmapsto",!0),p(g,b,M,"↗","\\nearrow",!0),p(g,b,M,"↩","\\hookleftarrow",!0),p(g,b,M,"↪","\\hookrightarrow",!0),p(g,b,M,"↘","\\searrow",!0),p(g,b,M,"↼","\\leftharpoonup",!0),p(g,b,M,"⇀","\\rightharpoonup",!0),p(g,b,M,"↙","\\swarrow",!0),p(g,b,M,"↽","\\leftharpoondown",!0),p(g,b,M,"⇁","\\rightharpoondown",!0),p(g,b,M,"↖","\\nwarrow",!0),p(g,b,M,"⇌","\\rightleftharpoons",!0),p(g,k,M,"≮","\\nless",!0),p(g,k,M,"","\\@nleqslant"),p(g,k,M,"","\\@nleqq"),p(g,k,M,"⪇","\\lneq",!0),p(g,k,M,"≨","\\lneqq",!0),p(g,k,M,"","\\@lvertneqq"),p(g,k,M,"⋦","\\lnsim",!0),p(g,k,M,"⪉","\\lnapprox",!0),p(g,k,M,"⊀","\\nprec",!0),p(g,k,M,"⋠","\\npreceq",!0),p(g,k,M,"⋨","\\precnsim",!0),p(g,k,M,"⪹","\\precnapprox",!0),p(g,k,M,"≁","\\nsim",!0),p(g,k,M,"","\\@nshortmid"),p(g,k,M,"∤","\\nmid",!0),p(g,k,M,"⊬","\\nvdash",!0),p(g,k,M,"⊭","\\nvDash",!0),p(g,k,M,"⋪","\\ntriangleleft"),p(g,k,M,"⋬","\\ntrianglelefteq",!0),p(g,k,M,"⊊","\\subsetneq",!0),p(g,k,M,"","\\@varsubsetneq"),p(g,k,M,"⫋","\\subsetneqq",!0),p(g,k,M,"","\\@varsubsetneqq"),p(g,k,M,"≯","\\ngtr",!0),p(g,k,M,"","\\@ngeqslant"),p(g,k,M,"","\\@ngeqq"),p(g,k,M,"⪈","\\gneq",!0),p(g,k,M,"≩","\\gneqq",!0),p(g,k,M,"","\\@gvertneqq"),p(g,k,M,"⋧","\\gnsim",!0),p(g,k,M,"⪊","\\gnapprox",!0),p(g,k,M,"⊁","\\nsucc",!0),p(g,k,M,"⋡","\\nsucceq",!0),p(g,k,M,"⋩","\\succnsim",!0),p(g,k,M,"⪺","\\succnapprox",!0),p(g,k,M,"≆","\\ncong",!0),p(g,k,M,"","\\@nshortparallel"),p(g,k,M,"∦","\\nparallel",!0),p(g,k,M,"⊯","\\nVDash",!0),p(g,k,M,"⋫","\\ntriangleright"),p(g,k,M,"⋭","\\ntrianglerighteq",!0),p(g,k,M,"","\\@nsupseteqq"),p(g,k,M,"⊋","\\supsetneq",!0),p(g,k,M,"","\\@varsupsetneq"),p(g,k,M,"⫌","\\supsetneqq",!0),p(g,k,M,"","\\@varsupsetneqq"),p(g,k,M,"⊮","\\nVdash",!0),p(g,k,M,"⪵","\\precneqq",!0),p(g,k,M,"⪶","\\succneqq",!0),p(g,k,M,"","\\@nsubseteqq"),p(g,k,ee,"⊴","\\unlhd"),p(g,k,ee,"⊵","\\unrhd"),p(g,k,M,"↚","\\nleftarrow",!0),p(g,k,M,"↛","\\nrightarrow",!0),p(g,k,M,"⇍","\\nLeftarrow",!0),p(g,k,M,"⇏","\\nRightarrow",!0),p(g,k,M,"↮","\\nleftrightarrow",!0),p(g,k,M,"⇎","\\nLeftrightarrow",!0),p(g,k,M,"△","\\vartriangle"),p(g,k,E,"ℏ","\\hslash"),p(g,k,E,"▽","\\triangledown"),p(g,k,E,"◊","\\lozenge"),p(g,k,E,"Ⓢ","\\circledS"),p(g,k,E,"®","\\circledR"),p(V,k,E,"®","\\circledR"),p(g,k,E,"∡","\\measuredangle",!0),p(g,k,E,"∄","\\nexists"),p(g,k,E,"℧","\\mho"),p(g,k,E,"Ⅎ","\\Finv",!0),p(g,k,E,"⅁","\\Game",!0),p(g,k,E,"‵","\\backprime"),p(g,k,E,"▲","\\blacktriangle"),p(g,k,E,"▼","\\blacktriangledown"),p(g,k,E,"■","\\blacksquare"),p(g,k,E,"⧫","\\blacklozenge"),p(g,k,E,"★","\\bigstar"),p(g,k,E,"∢","\\sphericalangle",!0),p(g,k,E,"∁","\\complement",!0),p(g,k,E,"ð","\\eth",!0),p(V,b,E,"ð","ð"),p(g,k,E,"╱","\\diagup"),p(g,k,E,"╲","\\diagdown"),p(g,k,E,"□","\\square"),p(g,k,E,"□","\\Box"),p(g,k,E,"◊","\\Diamond"),p(g,k,E,"¥","\\yen",!0),p(V,k,E,"¥","\\yen",!0),p(g,k,E,"✓","\\checkmark",!0),p(V,k,E,"✓","\\checkmark"),p(g,k,E,"ℶ","\\beth",!0),p(g,k,E,"ℸ","\\daleth",!0),p(g,k,E,"ℷ","\\gimel",!0),p(g,k,E,"ϝ","\\digamma",!0),p(g,k,E,"ϰ","\\varkappa"),p(g,k,xt,"┌","\\@ulcorner",!0),p(g,k,ot,"┐","\\@urcorner",!0),p(g,k,xt,"└","\\@llcorner",!0),p(g,k,ot,"┘","\\@lrcorner",!0),p(g,k,M,"≦","\\leqq",!0),p(g,k,M,"⩽","\\leqslant",!0),p(g,k,M,"⪕","\\eqslantless",!0),p(g,k,M,"≲","\\lesssim",!0),p(g,k,M,"⪅","\\lessapprox",!0),p(g,k,M,"≊","\\approxeq",!0),p(g,k,ee,"⋖","\\lessdot"),p(g,k,M,"⋘","\\lll",!0),p(g,k,M,"≶","\\lessgtr",!0),p(g,k,M,"⋚","\\lesseqgtr",!0),p(g,k,M,"⪋","\\lesseqqgtr",!0),p(g,k,M,"≑","\\doteqdot"),p(g,k,M,"≓","\\risingdotseq",!0),p(g,k,M,"≒","\\fallingdotseq",!0),p(g,k,M,"∽","\\backsim",!0),p(g,k,M,"⋍","\\backsimeq",!0),p(g,k,M,"⫅","\\subseteqq",!0),p(g,k,M,"⋐","\\Subset",!0),p(g,k,M,"⊏","\\sqsubset",!0),p(g,k,M,"≼","\\preccurlyeq",!0),p(g,k,M,"⋞","\\curlyeqprec",!0),p(g,k,M,"≾","\\precsim",!0),p(g,k,M,"⪷","\\precapprox",!0),p(g,k,M,"⊲","\\vartriangleleft"),p(g,k,M,"⊴","\\trianglelefteq"),p(g,k,M,"⊨","\\vDash",!0),p(g,k,M,"⊪","\\Vvdash",!0),p(g,k,M,"⌣","\\smallsmile"),p(g,k,M,"⌢","\\smallfrown"),p(g,k,M,"≏","\\bumpeq",!0),p(g,k,M,"≎","\\Bumpeq",!0),p(g,k,M,"≧","\\geqq",!0),p(g,k,M,"⩾","\\geqslant",!0),p(g,k,M,"⪖","\\eqslantgtr",!0),p(g,k,M,"≳","\\gtrsim",!0),p(g,k,M,"⪆","\\gtrapprox",!0),p(g,k,ee,"⋗","\\gtrdot"),p(g,k,M,"⋙","\\ggg",!0),p(g,k,M,"≷","\\gtrless",!0),p(g,k,M,"⋛","\\gtreqless",!0),p(g,k,M,"⪌","\\gtreqqless",!0),p(g,k,M,"≖","\\eqcirc",!0),p(g,k,M,"≗","\\circeq",!0),p(g,k,M,"≜","\\triangleq",!0),p(g,k,M,"∼","\\thicksim"),p(g,k,M,"≈","\\thickapprox"),p(g,k,M,"⫆","\\supseteqq",!0),p(g,k,M,"⋑","\\Supset",!0),p(g,k,M,"⊐","\\sqsupset",!0),p(g,k,M,"≽","\\succcurlyeq",!0),p(g,k,M,"⋟","\\curlyeqsucc",!0),p(g,k,M,"≿","\\succsim",!0),p(g,k,M,"⪸","\\succapprox",!0),p(g,k,M,"⊳","\\vartriangleright"),p(g,k,M,"⊵","\\trianglerighteq"),p(g,k,M,"⊩","\\Vdash",!0),p(g,k,M,"∣","\\shortmid"),p(g,k,M,"∥","\\shortparallel"),p(g,k,M,"≬","\\between",!0),p(g,k,M,"⋔","\\pitchfork",!0),p(g,k,M,"∝","\\varpropto"),p(g,k,M,"◀","\\blacktriangleleft"),p(g,k,M,"∴","\\therefore",!0),p(g,k,M,"∍","\\backepsilon"),p(g,k,M,"▶","\\blacktriangleright"),p(g,k,M,"∵","\\because",!0),p(g,k,M,"⋘","\\llless"),p(g,k,M,"⋙","\\gggtr"),p(g,k,ee,"⊲","\\lhd"),p(g,k,ee,"⊳","\\rhd"),p(g,k,M,"≂","\\eqsim",!0),p(g,b,M,"⋈","\\Join"),p(g,k,M,"≑","\\Doteq",!0),p(g,k,ee,"∔","\\dotplus",!0),p(g,k,ee,"∖","\\smallsetminus"),p(g,k,ee,"⋒","\\Cap",!0),p(g,k,ee,"⋓","\\Cup",!0),p(g,k,ee,"⩞","\\doublebarwedge",!0),p(g,k,ee,"⊟","\\boxminus",!0),p(g,k,ee,"⊞","\\boxplus",!0),p(g,k,ee,"⋇","\\divideontimes",!0),p(g,k,ee,"⋉","\\ltimes",!0),p(g,k,ee,"⋊","\\rtimes",!0),p(g,k,ee,"⋋","\\leftthreetimes",!0),p(g,k,ee,"⋌","\\rightthreetimes",!0),p(g,k,ee,"⋏","\\curlywedge",!0),p(g,k,ee,"⋎","\\curlyvee",!0),p(g,k,ee,"⊝","\\circleddash",!0),p(g,k,ee,"⊛","\\circledast",!0),p(g,k,ee,"⋅","\\centerdot"),p(g,k,ee,"⊺","\\intercal",!0),p(g,k,ee,"⋒","\\doublecap"),p(g,k,ee,"⋓","\\doublecup"),p(g,k,ee,"⊠","\\boxtimes",!0),p(g,k,M,"⇢","\\dashrightarrow",!0),p(g,k,M,"⇠","\\dashleftarrow",!0),p(g,k,M,"⇇","\\leftleftarrows",!0),p(g,k,M,"⇆","\\leftrightarrows",!0),p(g,k,M,"⇚","\\Lleftarrow",!0),p(g,k,M,"↞","\\twoheadleftarrow",!0),p(g,k,M,"↢","\\leftarrowtail",!0),p(g,k,M,"↫","\\looparrowleft",!0),p(g,k,M,"⇋","\\leftrightharpoons",!0),p(g,k,M,"↶","\\curvearrowleft",!0),p(g,k,M,"↺","\\circlearrowleft",!0),p(g,k,M,"↰","\\Lsh",!0),p(g,k,M,"⇈","\\upuparrows",!0),p(g,k,M,"↿","\\upharpoonleft",!0),p(g,k,M,"⇃","\\downharpoonleft",!0),p(g,b,M,"⊶","\\origof",!0),p(g,b,M,"⊷","\\imageof",!0),p(g,k,M,"⊸","\\multimap",!0),p(g,k,M,"↭","\\leftrightsquigarrow",!0),p(g,k,M,"⇉","\\rightrightarrows",!0),p(g,k,M,"⇄","\\rightleftarrows",!0),p(g,k,M,"↠","\\twoheadrightarrow",!0),p(g,k,M,"↣","\\rightarrowtail",!0),p(g,k,M,"↬","\\looparrowright",!0),p(g,k,M,"↷","\\curvearrowright",!0),p(g,k,M,"↻","\\circlearrowright",!0),p(g,k,M,"↱","\\Rsh",!0),p(g,k,M,"⇊","\\downdownarrows",!0),p(g,k,M,"↾","\\upharpoonright",!0),p(g,k,M,"⇂","\\downharpoonright",!0),p(g,k,M,"⇝","\\rightsquigarrow",!0),p(g,k,M,"⇝","\\leadsto"),p(g,k,M,"⇛","\\Rrightarrow",!0),p(g,k,M,"↾","\\restriction"),p(g,b,E,"‘","`"),p(g,b,E,"$","\\$"),p(V,b,E,"$","\\$"),p(V,b,E,"$","\\textdollar"),p(g,b,E,"%","\\%"),p(V,b,E,"%","\\%"),p(g,b,E,"_","\\_"),p(V,b,E,"_","\\_"),p(V,b,E,"_","\\textunderscore"),p(g,b,E,"∠","\\angle",!0),p(g,b,E,"∞","\\infty",!0),p(g,b,E,"′","\\prime"),p(g,b,E,"△","\\triangle"),p(g,b,E,"Γ","\\Gamma",!0),p(g,b,E,"Δ","\\Delta",!0),p(g,b,E,"Θ","\\Theta",!0),p(g,b,E,"Λ","\\Lambda",!0),p(g,b,E,"Ξ","\\Xi",!0),p(g,b,E,"Π","\\Pi",!0),p(g,b,E,"Σ","\\Sigma",!0),p(g,b,E,"Υ","\\Upsilon",!0),p(g,b,E,"Φ","\\Phi",!0),p(g,b,E,"Ψ","\\Psi",!0),p(g,b,E,"Ω","\\Omega",!0),p(g,b,E,"A","Α"),p(g,b,E,"B","Β"),p(g,b,E,"E","Ε"),p(g,b,E,"Z","Ζ"),p(g,b,E,"H","Η"),p(g,b,E,"I","Ι"),p(g,b,E,"K","Κ"),p(g,b,E,"M","Μ"),p(g,b,E,"N","Ν"),p(g,b,E,"O","Ο"),p(g,b,E,"P","Ρ"),p(g,b,E,"T","Τ"),p(g,b,E,"X","Χ"),p(g,b,E,"¬","\\neg",!0),p(g,b,E,"¬","\\lnot"),p(g,b,E,"⊤","\\top"),p(g,b,E,"⊥","\\bot"),p(g,b,E,"∅","\\emptyset"),p(g,k,E,"∅","\\varnothing"),p(g,b,le,"α","\\alpha",!0),p(g,b,le,"β","\\beta",!0),p(g,b,le,"γ","\\gamma",!0),p(g,b,le,"δ","\\delta",!0),p(g,b,le,"ϵ","\\epsilon",!0),p(g,b,le,"ζ","\\zeta",!0),p(g,b,le,"η","\\eta",!0),p(g,b,le,"θ","\\theta",!0),p(g,b,le,"ι","\\iota",!0),p(g,b,le,"κ","\\kappa",!0),p(g,b,le,"λ","\\lambda",!0),p(g,b,le,"μ","\\mu",!0),p(g,b,le,"ν","\\nu",!0),p(g,b,le,"ξ","\\xi",!0),p(g,b,le,"ο","\\omicron",!0),p(g,b,le,"π","\\pi",!0),p(g,b,le,"ρ","\\rho",!0),p(g,b,le,"σ","\\sigma",!0),p(g,b,le,"τ","\\tau",!0),p(g,b,le,"υ","\\upsilon",!0),p(g,b,le,"ϕ","\\phi",!0),p(g,b,le,"χ","\\chi",!0),p(g,b,le,"ψ","\\psi",!0),p(g,b,le,"ω","\\omega",!0),p(g,b,le,"ε","\\varepsilon",!0),p(g,b,le,"ϑ","\\vartheta",!0),p(g,b,le,"ϖ","\\varpi",!0),p(g,b,le,"ϱ","\\varrho",!0),p(g,b,le,"ς","\\varsigma",!0),p(g,b,le,"φ","\\varphi",!0),p(g,b,ee,"∗","*",!0),p(g,b,ee,"+","+"),p(g,b,ee,"−","-",!0),p(g,b,ee,"⋅","\\cdot",!0),p(g,b,ee,"∘","\\circ",!0),p(g,b,ee,"÷","\\div",!0),p(g,b,ee,"±","\\pm",!0),p(g,b,ee,"×","\\times",!0),p(g,b,ee,"∩","\\cap",!0),p(g,b,ee,"∪","\\cup",!0),p(g,b,ee,"∖","\\setminus",!0),p(g,b,ee,"∧","\\land"),p(g,b,ee,"∨","\\lor"),p(g,b,ee,"∧","\\wedge",!0),p(g,b,ee,"∨","\\vee",!0),p(g,b,E,"√","\\surd"),p(g,b,xt,"⟨","\\langle",!0),p(g,b,xt,"∣","\\lvert"),p(g,b,xt,"∥","\\lVert"),p(g,b,ot,"?","?"),p(g,b,ot,"!","!"),p(g,b,ot,"⟩","\\rangle",!0),p(g,b,ot,"∣","\\rvert"),p(g,b,ot,"∥","\\rVert"),p(g,b,M,"=","="),p(g,b,M,":",":"),p(g,b,M,"≈","\\approx",!0),p(g,b,M,"≅","\\cong",!0),p(g,b,M,"≥","\\ge"),p(g,b,M,"≥","\\geq",!0),p(g,b,M,"←","\\gets"),p(g,b,M,">","\\gt",!0),p(g,b,M,"∈","\\in",!0),p(g,b,M,"","\\@not"),p(g,b,M,"⊂","\\subset",!0),p(g,b,M,"⊃","\\supset",!0),p(g,b,M,"⊆","\\subseteq",!0),p(g,b,M,"⊇","\\supseteq",!0),p(g,k,M,"⊈","\\nsubseteq",!0),p(g,k,M,"⊉","\\nsupseteq",!0),p(g,b,M,"⊨","\\models"),p(g,b,M,"←","\\leftarrow",!0),p(g,b,M,"≤","\\le"),p(g,b,M,"≤","\\leq",!0),p(g,b,M,"<","\\lt",!0),p(g,b,M,"→","\\rightarrow",!0),p(g,b,M,"→","\\to"),p(g,k,M,"≱","\\ngeq",!0),p(g,k,M,"≰","\\nleq",!0),p(g,b,hr," ","\\ "),p(g,b,hr," ","\\space"),p(g,b,hr," ","\\nobreakspace"),p(V,b,hr," ","\\ "),p(V,b,hr," "," "),p(V,b,hr," ","\\space"),p(V,b,hr," ","\\nobreakspace"),p(g,b,hr,null,"\\nobreak"),p(g,b,hr,null,"\\allowbreak"),p(g,b,Zs,",",","),p(g,b,Zs,";",";"),p(g,k,ee,"⊼","\\barwedge",!0),p(g,k,ee,"⊻","\\veebar",!0),p(g,b,ee,"⊙","\\odot",!0),p(g,b,ee,"⊕","\\oplus",!0),p(g,b,ee,"⊗","\\otimes",!0),p(g,b,E,"∂","\\partial",!0),p(g,b,ee,"⊘","\\oslash",!0),p(g,k,ee,"⊚","\\circledcirc",!0),p(g,k,ee,"⊡","\\boxdot",!0),p(g,b,ee,"△","\\bigtriangleup"),p(g,b,ee,"▽","\\bigtriangledown"),p(g,b,ee,"†","\\dagger"),p(g,b,ee,"⋄","\\diamond"),p(g,b,ee,"⋆","\\star"),p(g,b,ee,"◃","\\triangleleft"),p(g,b,ee,"▹","\\triangleright"),p(g,b,xt,"{","\\{"),p(V,b,E,"{","\\{"),p(V,b,E,"{","\\textbraceleft"),p(g,b,ot,"}","\\}"),p(V,b,E,"}","\\}"),p(V,b,E,"}","\\textbraceright"),p(g,b,xt,"{","\\lbrace"),p(g,b,ot,"}","\\rbrace"),p(g,b,xt,"[","\\lbrack",!0),p(V,b,E,"[","\\lbrack",!0),p(g,b,ot,"]","\\rbrack",!0),p(V,b,E,"]","\\rbrack",!0),p(g,b,xt,"(","\\lparen",!0),p(g,b,ot,")","\\rparen",!0),p(V,b,E,"<","\\textless",!0),p(V,b,E,">","\\textgreater",!0),p(g,b,xt,"⌊","\\lfloor",!0),p(g,b,ot,"⌋","\\rfloor",!0),p(g,b,xt,"⌈","\\lceil",!0),p(g,b,ot,"⌉","\\rceil",!0),p(g,b,E,"\\","\\backslash"),p(g,b,E,"∣","|"),p(g,b,E,"∣","\\vert"),p(V,b,E,"|","\\textbar",!0),p(g,b,E,"∥","\\|"),p(g,b,E,"∥","\\Vert"),p(V,b,E,"∥","\\textbardbl"),p(V,b,E,"~","\\textasciitilde"),p(V,b,E,"\\","\\textbackslash"),p(V,b,E,"^","\\textasciicircum"),p(g,b,M,"↑","\\uparrow",!0),p(g,b,M,"⇑","\\Uparrow",!0),p(g,b,M,"↓","\\downarrow",!0),p(g,b,M,"⇓","\\Downarrow",!0),p(g,b,M,"↕","\\updownarrow",!0),p(g,b,M,"⇕","\\Updownarrow",!0),p(g,b,qe,"∐","\\coprod"),p(g,b,qe,"⋁","\\bigvee"),p(g,b,qe,"⋀","\\bigwedge"),p(g,b,qe,"⨄","\\biguplus"),p(g,b,qe,"⋂","\\bigcap"),p(g,b,qe,"⋃","\\bigcup"),p(g,b,qe,"∫","\\int"),p(g,b,qe,"∫","\\intop"),p(g,b,qe,"∬","\\iint"),p(g,b,qe,"∭","\\iiint"),p(g,b,qe,"∏","\\prod"),p(g,b,qe,"∑","\\sum"),p(g,b,qe,"⨂","\\bigotimes"),p(g,b,qe,"⨁","\\bigoplus"),p(g,b,qe,"⨀","\\bigodot"),p(g,b,qe,"∮","\\oint"),p(g,b,qe,"∯","\\oiint"),p(g,b,qe,"∰","\\oiiint"),p(g,b,qe,"⨆","\\bigsqcup"),p(g,b,qe,"∫","\\smallint"),p(V,b,jn,"…","\\textellipsis"),p(g,b,jn,"…","\\mathellipsis"),p(V,b,jn,"…","\\ldots",!0),p(g,b,jn,"…","\\ldots",!0),p(g,b,jn,"⋯","\\@cdots",!0),p(g,b,jn,"⋱","\\ddots",!0),p(g,b,E,"⋮","\\varvdots"),p(V,b,E,"⋮","\\varvdots"),p(g,b,Oe,"ˊ","\\acute"),p(g,b,Oe,"ˋ","\\grave"),p(g,b,Oe,"¨","\\ddot"),p(g,b,Oe,"~","\\tilde"),p(g,b,Oe,"ˉ","\\bar"),p(g,b,Oe,"˘","\\breve"),p(g,b,Oe,"ˇ","\\check"),p(g,b,Oe,"^","\\hat"),p(g,b,Oe,"⃗","\\vec"),p(g,b,Oe,"˙","\\dot"),p(g,b,Oe,"˚","\\mathring"),p(g,b,le,"","\\@imath"),p(g,b,le,"","\\@jmath"),p(g,b,E,"ı","ı"),p(g,b,E,"ȷ","ȷ"),p(V,b,E,"ı","\\i",!0),p(V,b,E,"ȷ","\\j",!0),p(V,b,E,"ß","\\ss",!0),p(V,b,E,"æ","\\ae",!0),p(V,b,E,"œ","\\oe",!0),p(V,b,E,"ø","\\o",!0),p(V,b,E,"Æ","\\AE",!0),p(V,b,E,"Œ","\\OE",!0),p(V,b,E,"Ø","\\O",!0),p(V,b,Oe,"ˊ","\\'"),p(V,b,Oe,"ˋ","\\`"),p(V,b,Oe,"ˆ","\\^"),p(V,b,Oe,"˜","\\~"),p(V,b,Oe,"ˉ","\\="),p(V,b,Oe,"˘","\\u"),p(V,b,Oe,"˙","\\."),p(V,b,Oe,"¸","\\c"),p(V,b,Oe,"˚","\\r"),p(V,b,Oe,"ˇ","\\v"),p(V,b,Oe,"¨",'\\"'),p(V,b,Oe,"˝","\\H"),p(V,b,Oe,"◯","\\textcircled");var zf={"--":!0,"---":!0,"``":!0,"''":!0};p(V,b,E,"–","--",!0),p(V,b,E,"–","\\textendash"),p(V,b,E,"—","---",!0),p(V,b,E,"—","\\textemdash"),p(V,b,E,"‘","`",!0),p(V,b,E,"‘","\\textquoteleft"),p(V,b,E,"’","'",!0),p(V,b,E,"’","\\textquoteright"),p(V,b,E,"“","``",!0),p(V,b,E,"“","\\textquotedblleft"),p(V,b,E,"”","''",!0),p(V,b,E,"”","\\textquotedblright"),p(g,b,E,"°","\\degree",!0),p(V,b,E,"°","\\degree"),p(V,b,E,"°","\\textdegree",!0),p(g,b,E,"£","\\pounds"),p(g,b,E,"£","\\mathsterling",!0),p(V,b,E,"£","\\pounds"),p(V,b,E,"£","\\textsterling",!0),p(g,k,E,"✠","\\maltese"),p(V,k,E,"✠","\\maltese");for(var If='0123456789/@."',Al=0;Al<If.length;Al++){var Rf=If.charAt(Al);p(g,b,E,Rf,Rf)}for(var Pf='0123456789!@*()-=+";:?/.,',Ol=0;Ol<Pf.length;Ol++){var Lf=Pf.charAt(Ol);p(V,b,E,Lf,Lf)}for(var Qs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Nl=0;Nl<Qs.length;Nl++){var eo=Qs.charAt(Nl);p(g,b,le,eo,eo),p(V,b,E,eo,eo)}p(g,k,E,"C","ℂ"),p(V,k,E,"C","ℂ"),p(g,k,E,"H","ℍ"),p(V,k,E,"H","ℍ"),p(g,k,E,"N","ℕ"),p(V,k,E,"N","ℕ"),p(g,k,E,"P","ℙ"),p(V,k,E,"P","ℙ"),p(g,k,E,"Q","ℚ"),p(V,k,E,"Q","ℚ"),p(g,k,E,"R","ℝ"),p(V,k,E,"R","ℝ"),p(g,k,E,"Z","ℤ"),p(V,k,E,"Z","ℤ"),p(g,b,le,"h","ℎ"),p(V,b,le,"h","ℎ");for(var ue="",at=0;at<Qs.length;at++){var Be=Qs.charAt(at);ue=String.fromCharCode(55349,56320+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue),ue=String.fromCharCode(55349,56372+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue),ue=String.fromCharCode(55349,56424+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue),ue=String.fromCharCode(55349,56580+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue),ue=String.fromCharCode(55349,56684+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue),ue=String.fromCharCode(55349,56736+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue),ue=String.fromCharCode(55349,56788+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue),ue=String.fromCharCode(55349,56840+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue),ue=String.fromCharCode(55349,56944+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue),at<26&&(ue=String.fromCharCode(55349,56632+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue),ue=String.fromCharCode(55349,56476+at),p(g,b,le,Be,ue),p(V,b,E,Be,ue))}ue="𝕜",p(g,b,le,"k",ue),p(V,b,E,"k",ue);for(var yn=0;yn<10;yn++){var Ur=yn.toString();ue=String.fromCharCode(55349,57294+yn),p(g,b,le,Ur,ue),p(V,b,E,Ur,ue),ue=String.fromCharCode(55349,57314+yn),p(g,b,le,Ur,ue),p(V,b,E,Ur,ue),ue=String.fromCharCode(55349,57324+yn),p(g,b,le,Ur,ue),p(V,b,E,Ur,ue),ue=String.fromCharCode(55349,57334+yn),p(g,b,le,Ur,ue),p(V,b,E,Ur,ue)}for(var Dl="ÐÞþ",zl=0;zl<Dl.length;zl++){var to=Dl.charAt(zl);p(g,b,le,to,to),p(V,b,E,to,to)}var ro=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Bf=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Bv=function(e,t){var n=e.charCodeAt(0),i=e.charCodeAt(1),s=(n-55296)*1024+(i-56320)+65536,o=t==="math"?0:1;if(119808<=s&&s<120484){var a=Math.floor((s-119808)/26);return[ro[a][2],ro[a][o]]}else if(120782<=s&&s<=120831){var l=Math.floor((s-120782)/10);return[Bf[l][2],Bf[l][o]]}else{if(s===120485||s===120486)return[ro[0][2],ro[0][o]];if(120486<s&&s<120782)return["",""];throw new U("Unsupported character: "+e)}},no=function(e,t,n){return Ee[n][e]&&Ee[n][e].replace&&(e=Ee[n][e].replace),{value:e,metrics:kl(e,t,n)}},Bt=function(e,t,n,i,s){var o=no(e,t,n),a=o.metrics;e=o.value;var l;if(a){var c=a.italic;(n==="text"||i&&i.font==="mathit")&&(c=0),l=new Ot(e,a.height,a.depth,c,a.skew,a.width,s)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+t+"' and mode '"+n+"'")),l=new Ot(e,0,0,0,0,0,s);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var u=i.getColor();u&&(l.style.color=u)}return l},Fv=function(e,t,n,i){return i===void 0&&(i=[]),n.font==="boldsymbol"&&no(e,"Main-Bold",t).metrics?Bt(e,"Main-Bold",t,n,i.concat(["mathbf"])):e==="\\"||Ee[t][e].font==="main"?Bt(e,"Main-Regular",t,n,i):Bt(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},$v=function(e,t,n,i,s){return s!=="textord"&&no(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Hv=function(e,t,n){var i=e.mode,s=e.text,o=["mord"],a=i==="math"||i==="text"&&t.font,l=a?t.font:t.fontFamily,c="",u="";if(s.charCodeAt(0)===55349&&([c,u]=Bv(s,i)),c.length>0)return Bt(s,c,i,t,o.concat(u));if(l){var d,h;if(l==="boldsymbol"){var f=$v(s,i,t,o,n);d=f.fontName,h=[f.fontClass]}else a?(d=Hf[l].fontName,h=[l]):(d=io(l,t.fontWeight,t.fontShape),h=[l,t.fontWeight,t.fontShape]);if(no(s,d,i).metrics)return Bt(s,d,i,t,o.concat(h));if(zf.hasOwnProperty(s)&&d.slice(0,10)==="Typewriter"){for(var m=[],y=0;y<s.length;y++)m.push(Bt(s[y],d,i,t,o.concat(h)));return $f(m)}}if(n==="mathord")return Bt(s,"Math-Italic",i,t,o.concat(["mathnormal"]));if(n==="textord"){var v=Ee[i][s]&&Ee[i][s].font;if(v==="ams"){var x=io("amsrm",t.fontWeight,t.fontShape);return Bt(s,x,i,t,o.concat("amsrm",t.fontWeight,t.fontShape))}else if(v==="main"||!v){var T=io("textrm",t.fontWeight,t.fontShape);return Bt(s,T,i,t,o.concat(t.fontWeight,t.fontShape))}else{var D=io(v,t.fontWeight,t.fontShape);return Bt(s,D,i,t,o.concat(D,t.fontWeight,t.fontShape))}}else throw new Error("unexpected type: "+n+" in makeOrd")},Vv=(r,e)=>{if(_r(r.classes)!==_r(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize)return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var n in r.style)if(r.style.hasOwnProperty(n)&&r.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&r.style[i]!==e.style[i])return!1;return!0},qv=r=>{for(var e=0;e<r.length-1;e++){var t=r[e],n=r[e+1];t instanceof Ot&&n instanceof Ot&&Vv(t,n)&&(t.text+=n.text,t.height=Math.max(t.height,n.height),t.depth=Math.max(t.depth,n.depth),t.italic=n.italic,r.splice(e+1,1),e--)}return r},Il=function(e){for(var t=0,n=0,i=0,s=0;s<e.children.length;s++){var o=e.children[s];o.height>t&&(t=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},ht=function(e,t,n,i){var s=new Pi(e,t,n,i);return Il(s),s},Ff=(r,e,t,n)=>new Pi(r,e,t,n),_v=function(e,t,n){var i=ht([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=G(i.height),i.maxFontSize=1,i},jv=function(e,t,n,i){var s=new Cl(e,t,n,i);return Il(s),s},$f=function(e){var t=new Ri(e);return Il(t),t},Uv=function(e,t){return e instanceof Ri?ht([],[e],t):e},Wv=function(e){if(e.positionType==="individualShift"){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,s=i,o=1;o<t.length;o++){var a=-t[o].shift-s-t[o].elem.depth,l=a-(t[o-1].elem.height+t[o-1].elem.depth);s=s+a,n.push({type:"kern",size:l}),n.push(t[o])}return{children:n,depth:i}}var c;if(e.positionType==="top"){for(var u=e.positionData,d=0;d<e.children.length;d++){var h=e.children[d];u-=h.type==="kern"?h.size:h.elem.height+h.elem.depth}c=u}else if(e.positionType==="bottom")c=-e.positionData;else{var f=e.children[0];if(f.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")c=-f.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")c=-f.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:c}},Gv=function(e,t){for(var{children:n,depth:i}=Wv(e),s=0,o=0;o<n.length;o++){var a=n[o];if(a.type==="elem"){var l=a.elem;s=Math.max(s,l.maxFontSize,l.height)}}s+=2;var c=ht(["pstrut"],[]);c.style.height=G(s);for(var u=[],d=i,h=i,f=i,m=0;m<n.length;m++){var y=n[m];if(y.type==="kern")f+=y.size;else{var v=y.elem,x=y.wrapperClasses||[],T=y.wrapperStyle||{},D=ht(x,[c,v],void 0,T);D.style.top=G(-s-f-v.depth),y.marginLeft&&(D.style.marginLeft=y.marginLeft),y.marginRight&&(D.style.marginRight=y.marginRight),u.push(D),f+=v.height+v.depth}d=Math.min(d,f),h=Math.max(h,f)}var P=ht(["vlist"],u);P.style.height=G(h);var N;if(d<0){var O=ht([],[]),A=ht(["vlist"],[O]);A.style.height=G(-d);var $=ht(["vlist-s"],[new Ot("​")]);N=[ht(["vlist-r"],[P,$]),ht(["vlist-r"],[A])]}else N=[ht(["vlist-r"],[P])];var F=ht(["vlist-t"],N);return N.length===2&&F.classes.push("vlist-t2"),F.height=h,F.depth=-d,F},Kv=(r,e)=>{var t=ht(["mspace"],[],e),n=ze(r,e);return t.style.marginRight=G(n),t},io=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var s;return t==="textbf"&&n==="textit"?s="BoldItalic":t==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",i+"-"+s},Hf={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Vf={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Jv=function(e,t){var[n,i,s]=Vf[e],o=new jr(n),a=new dr([o],{width:G(i),height:G(s),style:"width:"+G(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=Ff(["overlay"],[a],t);return l.height=s,l.style.height=G(s),l.style.width=G(i),l},R={fontMap:Hf,makeSymbol:Bt,mathsym:Fv,makeSpan:ht,makeSvgSpan:Ff,makeLineSpan:_v,makeAnchor:jv,makeFragment:$f,wrapFragment:Uv,makeVList:Gv,makeOrd:Hv,makeGlue:Kv,staticSvg:Jv,svgData:Vf,tryCombineChars:qv},Ie={number:3,unit:"mu"},vn={number:4,unit:"mu"},fr={number:5,unit:"mu"},Xv={mord:{mop:Ie,mbin:vn,mrel:fr,minner:Ie},mop:{mord:Ie,mop:Ie,mrel:fr,minner:Ie},mbin:{mord:vn,mop:vn,mopen:vn,minner:vn},mrel:{mord:fr,mop:fr,mopen:fr,minner:fr},mopen:{},mclose:{mop:Ie,mbin:vn,mrel:fr,minner:Ie},mpunct:{mord:Ie,mop:Ie,mrel:fr,mopen:Ie,mclose:Ie,mpunct:Ie,minner:Ie},minner:{mord:Ie,mop:Ie,mbin:vn,mrel:fr,mopen:Ie,mpunct:Ie,minner:Ie}},Yv={mord:{mop:Ie},mop:{mord:Ie,mop:Ie},mbin:{},mrel:{},mopen:{},mclose:{mop:Ie},mpunct:{},minner:{mop:Ie}},qf={},so={},oo={};function Z(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,a={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l<t.length;++l)qf[t[l]]=a;e&&(s&&(so[e]=s),o&&(oo[e]=o))}function bn(r){var{type:e,htmlBuilder:t,mathmlBuilder:n}=r;Z({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:t,mathmlBuilder:n})}var ao=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},$e=function(e){return e.type==="ordgroup"?e.body:[e]},pr=R.makeSpan,Zv=["leftmost","mbin","mopen","mrel","mop","mpunct"],Qv=["rightmost","mrel","mclose","mpunct"],e8={display:ae.DISPLAY,text:ae.TEXT,script:ae.SCRIPT,scriptscript:ae.SCRIPTSCRIPT},t8={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},_e=function(e,t,n,i){i===void 0&&(i=[null,null]);for(var s=[],o=0;o<e.length;o++){var a=be(e[o],t);if(a instanceof Ri){var l=a.children;s.push(...l)}else s.push(a)}if(R.tryCombineChars(s),!n)return s;var c=t;if(e.length===1){var u=e[0];u.type==="sizing"?c=t.havingSize(u.size):u.type==="styling"&&(c=t.havingStyle(e8[u.style]))}var d=pr([i[0]||"leftmost"],[],t),h=pr([i[1]||"rightmost"],[],t),f=n==="root";return _f(s,(m,y)=>{var v=y.classes[0],x=m.classes[0];v==="mbin"&&Qv.includes(x)?y.classes[0]="mord":x==="mbin"&&Zv.includes(v)&&(m.classes[0]="mord")},{node:d},h,f),_f(s,(m,y)=>{var v=Rl(y),x=Rl(m),T=v&&x?m.hasClass("mtight")?Yv[v][x]:Xv[v][x]:null;if(T)return R.makeGlue(T,c)},{node:d},h,f),s},_f=function r(e,t,n,i,s){i&&e.push(i);for(var o=0;o<e.length;o++){var a=e[o],l=jf(a);if(l){r(l.children,t,n,null,s);continue}var c=!a.hasClass("mspace");if(c){var u=t(a,n.node);u&&(n.insertAfter?n.insertAfter(u):(e.unshift(u),o++))}c?n.node=a:s&&a.hasClass("newline")&&(n.node=pr(["leftmost"])),n.insertAfter=(d=>h=>{e.splice(d+1,0,h),o++})(o)}i&&e.pop()},jf=function(e){return e instanceof Ri||e instanceof Cl||e instanceof Pi&&e.hasClass("enclosing")?e:null},r8=function r(e,t){var n=jf(e);if(n){var i=n.children;if(i.length){if(t==="right")return r(i[i.length-1],"right");if(t==="left")return r(i[0],"left")}}return e},Rl=function(e,t){return e?(t&&(e=r8(e,t)),t8[e.classes[0]]||null):null},Li=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return pr(t.concat(n))},be=function(e,t,n){if(!e)return pr();if(so[e.type]){var i=so[e.type](e,t);if(n&&t.size!==n.size){i=pr(t.sizingClasses(n),[i],t);var s=t.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new U("Got group of unknown type: '"+e.type+"'")};function lo(r,e){var t=pr(["base"],r,e),n=pr(["strut"]);return n.style.height=G(t.height+t.depth),t.depth&&(n.style.verticalAlign=G(-t.depth)),t.children.unshift(n),t}function Pl(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var n=_e(r,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],o=[],a=0;a<n.length;a++)if(o.push(n[a]),n[a].hasClass("mbin")||n[a].hasClass("mrel")||n[a].hasClass("allowbreak")){for(var l=!1;a<n.length-1&&n[a+1].hasClass("mspace")&&!n[a+1].hasClass("newline");)a++,o.push(n[a]),n[a].hasClass("nobreak")&&(l=!0);l||(s.push(lo(o,e)),o=[])}else n[a].hasClass("newline")&&(o.pop(),o.length>0&&(s.push(lo(o,e)),o=[]),s.push(n[a]));o.length>0&&s.push(lo(o,e));var c;t?(c=lo(_e(t,e,!0)),c.classes=["tag"],s.push(c)):i&&s.push(i);var u=pr(["katex-html"],s);if(u.setAttribute("aria-hidden","true"),c){var d=c.children[0];d.style.height=G(u.height+u.depth),u.depth&&(d.style.verticalAlign=G(-u.depth))}return u}function Uf(r){return new Ri(r)}class wt{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=_r(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Wt&&this.children[n+1]instanceof Wt){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Wt;)i+=this.children[++n].toText();e.appendChild(new Wt(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=xe.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+xe.escape(_r(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Wt{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return xe.escape(this.toText())}toText(){return this.text}}class n8{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=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",G(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+G(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var _={MathNode:wt,TextNode:Wt,SpaceNode:n8,newDocumentFragment:Uf},Nt=function(e,t,n){return Ee[t][e]&&Ee[t][e].replace&&e.charCodeAt(0)!==55349&&!(zf.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Ee[t][e].replace),new _.TextNode(e)},Ll=function(e){return e.length===1?e[0]:new _.MathNode("mrow",e)},Bl=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var n=t.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var s=e.text;if(["\\imath","\\jmath"].includes(s))return null;Ee[i][s]&&Ee[i][s].replace&&(s=Ee[i][s].replace);var o=R.fontMap[n].fontName;return kl(s,o,i)?R.fontMap[n].variant:null};function Fl(r){if(!r)return!1;if(r.type==="mi"&&r.children.length===1){var e=r.children[0];return e instanceof Wt&&e.text==="."}else if(r.type==="mo"&&r.children.length===1&&r.getAttribute("separator")==="true"&&r.getAttribute("lspace")==="0em"&&r.getAttribute("rspace")==="0em"){var t=r.children[0];return t instanceof Wt&&t.text===","}else return!1}var ft=function(e,t,n){if(e.length===1){var i=Te(e[0],t);return n&&i instanceof wt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],o,a=0;a<e.length;a++){var l=Te(e[a],t);if(l instanceof wt&&o instanceof wt){if(l.type==="mtext"&&o.type==="mtext"&&l.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...l.children);continue}else if(l.type==="mn"&&o.type==="mn"){o.children.push(...l.children);continue}else if(Fl(l)&&o.type==="mn"){o.children.push(...l.children);continue}else if(l.type==="mn"&&Fl(o))l.children=[...o.children,...l.children],s.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(o.type==="mn"||Fl(o))){var c=l.children[0];c instanceof wt&&c.type==="mn"&&(c.children=[...o.children,...c.children],s.pop())}else if(o.type==="mi"&&o.children.length===1){var u=o.children[0];if(u instanceof Wt&&u.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Wt&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),o=l}return s},Wr=function(e,t,n){return Ll(ft(e,t,n))},Te=function(e,t){if(!e)return new _.MathNode("mrow");if(oo[e.type]){var n=oo[e.type](e,t);return n}else throw new U("Got group of unknown type: '"+e.type+"'")};function Wf(r,e,t,n,i){var s=ft(r,t),o;s.length===1&&s[0]instanceof wt&&["mrow","mtable"].includes(s[0].type)?o=s[0]:o=new _.MathNode("mrow",s);var a=new _.MathNode("annotation",[new _.TextNode(e)]);a.setAttribute("encoding","application/x-tex");var l=new _.MathNode("semantics",[o,a]),c=new _.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var u=i?"katex":"katex-mathml";return R.makeSpan([u],[c])}var Gf=function(e){return new ur({style:e.displayMode?ae.DISPLAY:ae.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Kf=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=R.makeSpan(n,[e])}return e},i8=function(e,t,n){var i=Gf(n),s;if(n.output==="mathml")return Wf(e,t,i,n.displayMode,!0);if(n.output==="html"){var o=Pl(e,i);s=R.makeSpan(["katex"],[o])}else{var a=Wf(e,t,i,n.displayMode,!1),l=Pl(e,i);s=R.makeSpan(["katex"],[a,l])}return Kf(s,n)},s8=function(e,t,n){var i=Gf(n),s=Pl(e,i),o=R.makeSpan(["katex"],[s]);return Kf(o,n)},o8={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":"="},a8=function(e){var t=new _.MathNode("mo",[new _.TextNode(o8[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},l8={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},c8=function(e){return e.type==="ordgroup"?e.body.length:1},u8=function(e,t){function n(){var a=4e5,l=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(l)){var c=e,u=c8(c.base),d,h,f;if(u>5)l==="widehat"||l==="widecheck"?(d=420,a=2364,f=.42,h=l+"4"):(d=312,a=2340,f=.34,h="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(a=[0,1062,2364,2364,2364][m],d=[0,239,300,360,420][m],f=[0,.24,.3,.3,.36,.42][m],h=l+m):(a=[0,600,1033,2339,2340][m],d=[0,260,286,306,312][m],f=[0,.26,.286,.3,.306,.34][m],h="tilde"+m)}var y=new jr(h),v=new dr([y],{width:"100%",height:G(f),viewBox:"0 0 "+a+" "+d,preserveAspectRatio:"none"});return{span:R.makeSvgSpan([],[v],t),minWidth:0,height:f}}else{var x=[],T=l8[l],[D,P,N]=T,O=N/1e3,A=D.length,$,F;if(A===1){var q=T[3];$=["hide-tail"],F=[q]}else if(A===2)$=["halfarrow-left","halfarrow-right"],F=["xMinYMin","xMaxYMin"];else if(A===3)$=["brace-left","brace-center","brace-right"],F=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
381
- `+A+" children.");for(var te=0;te<A;te++){var Y=new jr(D[te]),he=new dr([Y],{width:"400em",height:G(O),viewBox:"0 0 "+a+" "+N,preserveAspectRatio:F[te]+" slice"}),Q=R.makeSvgSpan([$[te]],[he],t);if(A===1)return{span:Q,minWidth:P,height:O};Q.style.height=G(O),x.push(Q)}return{span:R.makeSpan(["stretchy"],x,t),minWidth:P,height:O}}}var{span:i,minWidth:s,height:o}=n();return i.height=o,i.style.height=G(o),s>0&&(i.style.minWidth=G(s)),i},d8=function(e,t,n,i,s){var o,a=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(o=R.makeSpan(["stretchy",t],[],s),t==="fbox"){var l=s.color&&s.getColor();l&&(o.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new El({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&c.push(new El({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new dr(c,{width:"100%",height:G(a)});o=R.makeSvgSpan([],[u],s)}return o.height=a,o.style.height=G(a),o},mr={encloseSpan:d8,mathMLnode:a8,svgSpan:u8};function fe(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function $l(r){var e=co(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function co(r){return r&&(r.type==="atom"||Lv.hasOwnProperty(r.type))?r:null}var Hl=(r,e)=>{var t,n,i;r&&r.type==="supsub"?(n=fe(r.base,"accent"),t=n.base,r.base=t,i=Rv(be(r,e)),r.base=n):(n=fe(r,"accent"),t=n.base);var s=be(t,e.havingCrampedStyle()),o=n.isShifty&&xe.isCharacterBox(t),a=0;if(o){var l=xe.getBaseElem(t),c=be(l,e.havingCrampedStyle());a=Df(c).skew}var u=n.label==="\\c",d=u?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=mr.svgSpan(n,e),h=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+G(2*a)+")",marginLeft:G(2*a)}:void 0}]},e);else{var f,m;n.label==="\\vec"?(f=R.staticSvg("vec",e),m=R.svgData.vec[1]):(f=R.makeOrd({mode:n.mode,text:n.label},e,"textord"),f=Df(f),f.italic=0,m=f.width,u&&(d+=f.depth)),h=R.makeSpan(["accent-body"],[f]);var y=n.label==="\\textcircled";y&&(h.classes.push("accent-full"),d=s.height);var v=a;y||(v-=m/2),h.style.left=G(v),n.label==="\\textcircled"&&(h.style.top=".2em"),h=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:h}]},e)}var x=R.makeSpan(["mord","accent"],[h],e);return i?(i.children[0]=x,i.height=Math.max(x.height,i.height),i.classes[0]="mord",i):x},Jf=(r,e)=>{var t=r.isStretchy?mr.mathMLnode(r.label):new _.MathNode("mo",[Nt(r.label,r.mode)]),n=new _.MathNode("mover",[Te(r.base,e),t]);return n.setAttribute("accent","true"),n},h8=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));Z({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:(r,e)=>{var t=ao(e[0]),n=!h8.test(r.funcName),i=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:i,base:t}},htmlBuilder:Hl,mathmlBuilder:Jf}),Z({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Hl,mathmlBuilder:Jf}),Z({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:i}},htmlBuilder:(r,e)=>{var t=be(r.base,e),n=mr.svgSpan(r,e),i=r.label==="\\utilde"?.12:0,s=R.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]},e);return R.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=mr.mathMLnode(r.label),n=new _.MathNode("munder",[Te(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var uo=r=>{var e=new _.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Z({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(r,e,t){var{parser:n,funcName:i}=r;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),i=R.wrapFragment(be(r.body,n,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var o;r.below&&(n=e.havingStyle(t.sub()),o=R.wrapFragment(be(r.below,n,e),e),o.classes.push(s+"-arrow-pad"));var a=mr.svgSpan(r,e),l=-e.fontMetrics().axisHeight+.5*a.height,c=-e.fontMetrics().axisHeight-.5*a.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(c-=i.depth);var u;if(o){var d=-e.fontMetrics().axisHeight+o.height+.5*a.height+.111;u=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l},{type:"elem",elem:o,shift:d}]},e)}else u=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l}]},e);return u.children[0].children[0].children[1].classes.push("svg-align"),R.makeSpan(["mrel","x-arrow"],[u],e)},mathmlBuilder(r,e){var t=mr.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var i=uo(Te(r.body,e));if(r.below){var s=uo(Te(r.below,e));n=new _.MathNode("munderover",[t,s,i])}else n=new _.MathNode("mover",[t,i])}else if(r.below){var o=uo(Te(r.below,e));n=new _.MathNode("munder",[t,o])}else n=uo(),n=new _.MathNode("mover",[t,n]);return n}});var f8=R.makeSpan;function Xf(r,e){var t=_e(r.body,e,!0);return f8([r.mclass],t,e)}function Yf(r,e){var t,n=ft(r.body,e);return r.mclass==="minner"?t=new _.MathNode("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new _.MathNode("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new _.MathNode("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}Z({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:$e(i),isCharacterBox:xe.isCharacterBox(i)}},htmlBuilder:Xf,mathmlBuilder:Yf});var ho=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Z({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:ho(e[0]),body:$e(e[1]),isCharacterBox:xe.isCharacterBox(e[1])}}}),Z({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:n}=r,i=e[1],s=e[0],o;n!=="\\stackrel"?o=ho(i):o="mrel";var a={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:$e(i)},l={type:"supsub",mode:s.mode,base:a,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:t.mode,mclass:o,body:[l],isCharacterBox:xe.isCharacterBox(l)}},htmlBuilder:Xf,mathmlBuilder:Yf}),Z({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:ho(e[0]),body:$e(e[0])}},htmlBuilder(r,e){var t=_e(r.body,e,!0),n=R.makeSpan([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=ft(r.body,e),n=new _.MathNode("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var p8={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Zf=()=>({type:"styling",body:[],mode:"math",style:"display"}),Qf=r=>r.type==="textord"&&r.text==="@",m8=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function g8(r,e,t){var n=p8[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},o=t.callFunction("\\Big",[s],[]),a=t.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,a]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function y8(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new U("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],i=[n],s=0;s<e.length;s++){for(var o=e[s],a=Zf(),l=0;l<o.length;l++)if(!Qf(o[l]))a.body.push(o[l]);else{n.push(a),l+=1;var c=$l(o[l]).text,u=new Array(2);if(u[0]={type:"ordgroup",mode:"math",body:[]},u[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(c)>-1))if("<>AV".indexOf(c)>-1)for(var d=0;d<2;d++){for(var h=!0,f=l+1;f<o.length;f++){if(m8(o[f],c)){h=!1,l=f;break}if(Qf(o[f]))throw new U("Missing a "+c+" character to complete a CD arrow.",o[f]);u[d].body.push(o[f])}if(h)throw new U("Missing a "+c+" character to complete a CD arrow.",o[l])}else throw new U('Expected one of "<>AV=|." after @',o[l]);var m=g8(c,u,r),y={type:"styling",body:[m],mode:"math",style:"display"};n.push(y),a=Zf()}s%2===0?n.push(a):n.shift(),n=[],i.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var v=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Z({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=R.wrapFragment(be(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=G(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new _.MathNode("mrow",[Te(r.label,e)]);return t=new _.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new _.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}}),Z({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=R.wrapFragment(be(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new _.MathNode("mrow",[Te(r.fragment,e)])}}),Z({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,n=fe(e[0],"ordgroup"),i=n.body,s="",o=0;o<i.length;o++){var a=fe(i[o],"textord");s+=a.text}var l=parseInt(s),c;if(isNaN(l))throw new U("\\@char has non-numeric argument "+s);if(l<0||l>=1114111)throw new U("\\@char with invalid code point "+s);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:c}}});var ep=(r,e)=>{var t=_e(r.body,e.withColor(r.color),!1);return R.makeFragment(t)},tp=(r,e)=>{var t=ft(r.body,e.withColor(r.color)),n=new _.MathNode("mstyle",t);return n.setAttribute("mathcolor",r.color),n};Z({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,n=fe(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:n,body:$e(i)}},htmlBuilder:ep,mathmlBuilder:tp}),Z({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:n}=r,i=fe(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var s=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:i,body:s}},htmlBuilder:ep,mathmlBuilder:tp}),Z({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:n}=r,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&fe(i,"size").value}},htmlBuilder(r,e){var t=R.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=G(ze(r.size,e)))),t},mathmlBuilder(r,e){var t=new _.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",G(ze(r.size,e)))),t}});var Vl={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},rp=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new U("Expected a control sequence",r);return e},v8=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},np=(r,e,t,n)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,n)};Z({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(Vl[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=Vl[n.text]),fe(e.parseFunction(),"internal");throw new U("Invalid token after macro prefix",n)}}),Z({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new U("Expected a control sequence",n);for(var s=0,o,a=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),a[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new U('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new U('Argument number "'+n.text+'" out of order');s++,a.push([])}else{if(n.text==="EOF")throw new U("Expected a macro definition");a[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return o&&l.unshift(o),(t==="\\edef"||t==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:a},t===Vl[t]),{type:"internal",mode:e.mode}}}),Z({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=rp(e.gullet.popToken());e.gullet.consumeSpaces();var i=v8(e);return np(e,n,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}}),Z({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=rp(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return np(e,n,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Bi=function(e,t,n){var i=Ee.math[e]&&Ee.math[e].replace,s=kl(i||e,t,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},ql=function(e,t,n,i){var s=n.havingBaseStyle(t),o=R.makeSpan(i.concat(s.sizingClasses(n)),[e],n),a=s.sizeMultiplier/n.sizeMultiplier;return o.height*=a,o.depth*=a,o.maxFontSize=s.sizeMultiplier,o},ip=function(e,t,n){var i=t.havingBaseStyle(n),s=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=G(s),e.height-=s,e.depth+=s},b8=function(e,t,n,i,s,o){var a=R.makeSymbol(e,"Main-Regular",s,i),l=ql(a,t,i,o);return n&&ip(l,i,t),l},x8=function(e,t,n,i){return R.makeSymbol(e,"Size"+t+"-Regular",n,i)},sp=function(e,t,n,i,s,o){var a=x8(e,t,s,i),l=ql(R.makeSpan(["delimsizing","size"+t],[a],i),ae.TEXT,i,o);return n&&ip(l,i,ae.TEXT),l},_l=function(e,t,n){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=R.makeSpan(["delimsizinginner",i],[R.makeSpan([],[R.makeSymbol(e,t,n)])]);return{type:"elem",elem:s}},jl=function(e,t,n){var i=Ut["Size4-Regular"][e.charCodeAt(0)]?Ut["Size4-Regular"][e.charCodeAt(0)][4]:Ut["Size1-Regular"][e.charCodeAt(0)][4],s=new jr("inner",Tv(e,Math.round(1e3*t))),o=new dr([s],{width:G(i),height:G(t),style:"width:"+G(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=R.makeSvgSpan([],[o],n);return a.height=t,a.style.height=G(t),a.style.width=G(i),{type:"elem",elem:a}},Ul=.008,fo={type:"kern",size:-1*Ul},w8=["|","\\lvert","\\rvert","\\vert"],S8=["\\|","\\lVert","\\rVert","\\Vert"],op=function(e,t,n,i,s,o){var a,l,c,u,d="",h=0;a=c=u=e,l=null;var f="Size1-Regular";e==="\\uparrow"?c=u="⏐":e==="\\Uparrow"?c=u="‖":e==="\\downarrow"?a=c="⏐":e==="\\Downarrow"?a=c="‖":e==="\\updownarrow"?(a="\\uparrow",c="⏐",u="\\downarrow"):e==="\\Updownarrow"?(a="\\Uparrow",c="‖",u="\\Downarrow"):w8.includes(e)?(c="∣",d="vert",h=333):S8.includes(e)?(c="∥",d="doublevert",h=556):e==="["||e==="\\lbrack"?(a="⎡",c="⎢",u="⎣",f="Size4-Regular",d="lbrack",h=667):e==="]"||e==="\\rbrack"?(a="⎤",c="⎥",u="⎦",f="Size4-Regular",d="rbrack",h=667):e==="\\lfloor"||e==="⌊"?(c=a="⎢",u="⎣",f="Size4-Regular",d="lfloor",h=667):e==="\\lceil"||e==="⌈"?(a="⎡",c=u="⎢",f="Size4-Regular",d="lceil",h=667):e==="\\rfloor"||e==="⌋"?(c=a="⎥",u="⎦",f="Size4-Regular",d="rfloor",h=667):e==="\\rceil"||e==="⌉"?(a="⎤",c=u="⎥",f="Size4-Regular",d="rceil",h=667):e==="("||e==="\\lparen"?(a="⎛",c="⎜",u="⎝",f="Size4-Regular",d="lparen",h=875):e===")"||e==="\\rparen"?(a="⎞",c="⎟",u="⎠",f="Size4-Regular",d="rparen",h=875):e==="\\{"||e==="\\lbrace"?(a="⎧",l="⎨",u="⎩",c="⎪",f="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(a="⎫",l="⎬",u="⎭",c="⎪",f="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(a="⎧",u="⎩",c="⎪",f="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(a="⎫",u="⎭",c="⎪",f="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(a="⎧",u="⎭",c="⎪",f="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(a="⎫",u="⎩",c="⎪",f="Size4-Regular");var m=Bi(a,f,s),y=m.height+m.depth,v=Bi(c,f,s),x=v.height+v.depth,T=Bi(u,f,s),D=T.height+T.depth,P=0,N=1;if(l!==null){var O=Bi(l,f,s);P=O.height+O.depth,N=2}var A=y+D+P,$=Math.max(0,Math.ceil((t-A)/(N*x))),F=A+$*N*x,q=i.fontMetrics().axisHeight;n&&(q*=i.sizeMultiplier);var te=F/2-q,Y=[];if(d.length>0){var he=F-y-D,Q=Math.round(F*1e3),W=Cv(d,Math.round(he*1e3)),ne=new jr(d,W),ve=(h/1e3).toFixed(3)+"em",ge=(Q/1e3).toFixed(3)+"em",Ae=new dr([ne],{width:ve,height:ge,viewBox:"0 0 "+h+" "+Q}),C=R.makeSvgSpan([],[Ae],i);C.height=Q/1e3,C.style.width=ve,C.style.height=ge,Y.push({type:"elem",elem:C})}else{if(Y.push(_l(u,f,s)),Y.push(fo),l===null){var w=F-y-D+2*Ul;Y.push(jl(c,w,i))}else{var z=(F-y-D-P)/2+2*Ul;Y.push(jl(c,z,i)),Y.push(fo),Y.push(_l(l,f,s)),Y.push(fo),Y.push(jl(c,z,i))}Y.push(fo),Y.push(_l(a,f,s))}var L=i.havingBaseStyle(ae.TEXT),B=R.makeVList({positionType:"bottom",positionData:te,children:Y},L);return ql(R.makeSpan(["delimsizing","mult"],[B],L),ae.TEXT,i,o)},Wl=80,Gl=.08,Kl=function(e,t,n,i,s){var o=Mv(e,i,n),a=new jr(e,o),l=new dr([a],{width:"400em",height:G(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return R.makeSvgSpan(["hide-tail"],[l],s)},k8=function(e,t){var n=t.havingBaseSizing(),i=up("\\surd",e*n.sizeMultiplier,cp,n),s=n.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),a,l=0,c=0,u=0,d;return i.type==="small"?(u=1e3+1e3*o+Wl,e<1?s=1:e<1.4&&(s=.7),l=(1+o+Gl)/s,c=(1+o)/s,a=Kl("sqrtMain",l,u,o,t),a.style.minWidth="0.853em",d=.833/s):i.type==="large"?(u=(1e3+Wl)*Fi[i.size],c=(Fi[i.size]+o)/s,l=(Fi[i.size]+o+Gl)/s,a=Kl("sqrtSize"+i.size,l,u,o,t),a.style.minWidth="1.02em",d=1/s):(l=e+o+Gl,c=e+o,u=Math.floor(1e3*e+o)+Wl,a=Kl("sqrtTall",l,u,o,t),a.style.minWidth="0.742em",d=1.056),a.height=c,a.style.height=G(l),{span:a,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},ap=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],M8=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],lp=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Fi=[0,1.2,1.8,2.4,3],T8=function(e,t,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),ap.includes(e)||lp.includes(e))return sp(e,t,!1,n,i,s);if(M8.includes(e))return op(e,Fi[t],!1,n,i,s);throw new U("Illegal delimiter: '"+e+"'")},C8=[{type:"small",style:ae.SCRIPTSCRIPT},{type:"small",style:ae.SCRIPT},{type:"small",style:ae.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],E8=[{type:"small",style:ae.SCRIPTSCRIPT},{type:"small",style:ae.SCRIPT},{type:"small",style:ae.TEXT},{type:"stack"}],cp=[{type:"small",style:ae.SCRIPTSCRIPT},{type:"small",style:ae.SCRIPT},{type:"small",style:ae.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],A8=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},up=function(e,t,n,i){for(var s=Math.min(2,3-i.style.size),o=s;o<n.length&&n[o].type!=="stack";o++){var a=Bi(e,A8(n[o]),"math"),l=a.height+a.depth;if(n[o].type==="small"){var c=i.havingBaseStyle(n[o].style);l*=c.sizeMultiplier}if(l>t)return n[o]}return n[n.length-1]},dp=function(e,t,n,i,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var a;lp.includes(e)?a=C8:ap.includes(e)?a=cp:a=E8;var l=up(e,t,a,i);return l.type==="small"?b8(e,l.style,n,i,s,o):l.type==="large"?sp(e,l.size,n,i,s,o):op(e,t,n,i,s,o)},O8=function(e,t,n,i,s,o){var a=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,u=Math.max(t-a,n+a),d=Math.max(u/500*l,2*u-c);return dp(e,d,!0,i,s,o)},gr={sqrtImage:k8,sizedDelim:T8,sizeToMaxHeight:Fi,customSizedDelim:dp,leftRightDelim:O8},hp={"\\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}},N8=["(","\\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 po(r,e){var t=co(r);if(t&&N8.includes(t.text))return t;throw t?new U("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new U("Invalid delimiter type '"+r.type+"'",r)}Z({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:(r,e)=>{var t=po(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:hp[r.funcName].size,mclass:hp[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?R.makeSpan([r.mclass]):gr.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(Nt(r.delim,r.mode));var t=new _.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=G(gr.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function fp(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Z({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new U("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:po(e[0],r).text,color:t}}}),Z({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=po(e[0],r),n=r.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=fe(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{fp(r);for(var t=_e(r.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,o=0;o<t.length;o++)t[o].isMiddle?s=!0:(n=Math.max(t[o].height,n),i=Math.max(t[o].depth,i));n*=e.sizeMultiplier,i*=e.sizeMultiplier;var a;if(r.left==="."?a=Li(e,["mopen"]):a=gr.leftRightDelim(r.left,n,i,e,r.mode,["mopen"]),t.unshift(a),s)for(var l=1;l<t.length;l++){var c=t[l],u=c.isMiddle;u&&(t[l]=gr.leftRightDelim(u.delim,n,i,u.options,r.mode,[]))}var d;if(r.right===".")d=Li(e,["mclose"]);else{var h=r.rightColor?e.withColor(r.rightColor):e;d=gr.leftRightDelim(r.right,n,i,h,r.mode,["mclose"])}return t.push(d),R.makeSpan(["minner"],t,e)},mathmlBuilder:(r,e)=>{fp(r);var t=ft(r.body,e);if(r.left!=="."){var n=new _.MathNode("mo",[Nt(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var i=new _.MathNode("mo",[Nt(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return Ll(t)}}),Z({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=po(e[0],r);if(!r.parser.leftrightDepth)throw new U("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=Li(e,[]);else{t=gr.sizedDelim(r.delim,1,e,r.mode,[]);var n={delim:r.delim,options:e};t.isMiddle=n}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?Nt("|","text"):Nt(r.delim,r.mode),n=new _.MathNode("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var Jl=(r,e)=>{var t=R.wrapFragment(be(r.body,e),e),n=r.label.slice(1),i=e.sizeMultiplier,s,o=0,a=xe.isCharacterBox(r.body);if(n==="sout")s=R.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=ze({number:.6,unit:"pt"},e),c=ze({number:.35,unit:"ex"},e),u=e.havingBaseSizing();i=i/u.sizeMultiplier;var d=t.height+t.depth+l+c;t.style.paddingLeft=G(d/2+l);var h=Math.floor(1e3*d*i),f=Sv(h),m=new dr([new jr("phase",f)],{width:"400em",height:G(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});s=R.makeSvgSpan(["hide-tail"],[m],e),s.style.height=G(d),o=t.depth+l+c}else{/cancel/.test(n)?a||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var y=0,v=0,x=0;/box/.test(n)?(x=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),y=e.fontMetrics().fboxsep+(n==="colorbox"?0:x),v=y):n==="angl"?(x=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),y=4*x,v=Math.max(0,.25-t.depth)):(y=a?.2:0,v=y),s=mr.encloseSpan(t,n,y,v,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=G(x)):n==="angl"&&x!==.049&&(s.style.borderTopWidth=G(x),s.style.borderRightWidth=G(x)),o=t.depth+v,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var T;if(r.backgroundColor)T=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:t,shift:0}]},e);else{var D=/cancel|phase/.test(n)?["svg-align"]:[];T=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:D}]},e)}return/cancel/.test(n)&&(T.height=t.height,T.depth=t.depth),/cancel/.test(n)&&!a?R.makeSpan(["mord","cancel-lap"],[T],e):R.makeSpan(["mord"],[T],e)},Xl=(r,e)=>{var t=0,n=new _.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Te(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(r.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};Z({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=fe(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:Jl,mathmlBuilder:Xl}),Z({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=fe(e[0],"color-token").color,o=fe(e[1],"color-token").color,a=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:Jl,mathmlBuilder:Xl}),Z({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}}),Z({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:Jl,mathmlBuilder:Xl}),Z({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var pp={};function Gt(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,a={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<t.length;++l)pp[t[l]]=a;s&&(so[e]=s),o&&(oo[e]=o)}var mp={};function S(r,e){mp[r]=e}function gp(r){var e=[];r.consumeSpaces();var t=r.fetch().text;for(t==="\\relax"&&(r.consume(),r.consumeSpaces(),t=r.fetch().text);t==="\\hline"||t==="\\hdashline";)r.consume(),e.push(t==="\\hdashline"),r.consumeSpaces(),t=r.fetch().text;return e}var mo=r=>{var e=r.parser.settings;if(!e.displayMode)throw new U("{"+r.envName+"} can be used only in display mode.")};function Yl(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function Gr(r,e,t){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:d,leqno:h}=e;if(r.gullet.beginGroup(),c||r.gullet.macros.set("\\cr","\\\\\\relax"),!o){var f=r.gullet.expandMacroAsText("\\arraystretch");if(f==null)o=1;else if(o=parseFloat(f),!o||o<0)throw new U("Invalid \\arraystretch: "+f)}r.gullet.beginGroup();var m=[],y=[m],v=[],x=[],T=l!=null?[]:void 0;function D(){l&&r.gullet.macros.set("\\@eqnsw","1",!0)}function P(){T&&(r.gullet.macros.get("\\df@tag")?(T.push(r.subparse([new bt("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!l&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(D(),x.push(gp(r));;){var N=r.parseExpression(!1,c?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),N={type:"ordgroup",mode:r.mode,body:N},t&&(N={type:"styling",mode:r.mode,style:t,body:[N]}),m.push(N);var O=r.fetch().text;if(O==="&"){if(d&&m.length===d){if(c||a)throw new U("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(O==="\\end"){P(),m.length===1&&N.type==="styling"&&N.body[0].body.length===0&&(y.length>1||!u)&&y.pop(),x.length<y.length+1&&x.push([]);break}else if(O==="\\\\"){r.consume();var A=void 0;r.gullet.future().text!==" "&&(A=r.parseSizeGroup(!0)),v.push(A?A.value:null),P(),x.push(gp(r)),m=[],y.push(m),D()}else throw new U("Expected & or \\\\ or \\cr or \\end",r.nextToken)}return r.gullet.endGroup(),r.gullet.endGroup(),{type:"array",mode:r.mode,addJot:i,arraystretch:o,body:y,cols:s,rowGaps:v,hskipBeforeAndAfter:n,hLinesBeforeRow:x,colSeparationType:a,tags:T,leqno:h}}function Zl(r){return r.slice(0,1)==="d"?"display":"text"}var Kt=function(e,t){var n,i,s=e.body.length,o=e.hLinesBeforeRow,a=0,l=new Array(s),c=[],u=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,h=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var f=t.havingStyle(ae.SCRIPT).sizeMultiplier;h=.2778*(f/t.sizeMultiplier)}var m=e.colSeparationType==="CD"?ze({number:3,unit:"ex"},t):12*d,y=3*d,v=e.arraystretch*m,x=.7*v,T=.3*v,D=0;function P(je){for(var Sn=0;Sn<je.length;++Sn)Sn>0&&(D+=.25),c.push({pos:D,isDashed:je[Sn]})}for(P(o[0]),n=0;n<e.body.length;++n){var N=e.body[n],O=x,A=T;a<N.length&&(a=N.length);var $=new Array(N.length);for(i=0;i<N.length;++i){var F=be(N[i],t);A<F.depth&&(A=F.depth),O<F.height&&(O=F.height),$[i]=F}var q=e.rowGaps[n],te=0;q&&(te=ze(q,t),te>0&&(te+=T,A<te&&(A=te),te=0)),e.addJot&&(A+=y),$.height=O,$.depth=A,D+=O,$.pos=D,D+=A+te,l[n]=$,P(o[n+1])}var Y=D/2+t.fontMetrics().axisHeight,he=e.cols||[],Q=[],W,ne,ve=[];if(e.tags&&e.tags.some(je=>je))for(n=0;n<s;++n){var ge=l[n],Ae=ge.pos-Y,C=e.tags[n],w=void 0;C===!0?w=R.makeSpan(["eqn-num"],[],t):C===!1?w=R.makeSpan([],[],t):w=R.makeSpan([],_e(C,t,!0),t),w.depth=ge.depth,w.height=ge.height,ve.push({type:"elem",elem:w,shift:Ae})}for(i=0,ne=0;i<a||ne<he.length;++i,++ne){for(var z=he[ne]||{},L=!0;z.type==="separator";){if(L||(W=R.makeSpan(["arraycolsep"],[]),W.style.width=G(t.fontMetrics().doubleRuleSep),Q.push(W)),z.separator==="|"||z.separator===":"){var B=z.separator==="|"?"solid":"dashed",K=R.makeSpan(["vertical-separator"],[],t);K.style.height=G(D),K.style.borderRightWidth=G(u),K.style.borderRightStyle=B,K.style.margin="0 "+G(-u/2);var re=D-Y;re&&(K.style.verticalAlign=G(-re)),Q.push(K)}else throw new U("Invalid separator type: "+z.separator);ne++,z=he[ne]||{},L=!1}if(!(i>=a)){var j=void 0;(i>0||e.hskipBeforeAndAfter)&&(j=xe.deflt(z.pregap,h),j!==0&&(W=R.makeSpan(["arraycolsep"],[]),W.style.width=G(j),Q.push(W)));var ie=[];for(n=0;n<s;++n){var me=l[n],Ce=me[i];if(Ce){var zt=me.pos-Y;Ce.depth=me.depth,Ce.height=me.height,ie.push({type:"elem",elem:Ce,shift:zt})}}ie=R.makeVList({positionType:"individualShift",children:ie},t),ie=R.makeSpan(["col-align-"+(z.align||"c")],[ie]),Q.push(ie),(i<a-1||e.hskipBeforeAndAfter)&&(j=xe.deflt(z.postgap,h),j!==0&&(W=R.makeSpan(["arraycolsep"],[]),W.style.width=G(j),Q.push(W)))}}if(l=R.makeSpan(["mtable"],Q),c.length>0){for(var It=R.makeLineSpan("hline",t,u),Ne=R.makeLineSpan("hdashline",t,u),ct=[{type:"elem",elem:l,shift:0}];c.length>0;){var Xr=c.pop(),xn=Xr.pos-Y;Xr.isDashed?ct.push({type:"elem",elem:Ne,shift:xn}):ct.push({type:"elem",elem:It,shift:xn})}l=R.makeVList({positionType:"individualShift",children:ct},t)}if(ve.length===0)return R.makeSpan(["mord"],[l],t);var wn=R.makeVList({positionType:"individualShift",children:ve},t);return wn=R.makeSpan(["tag"],[wn],t),R.makeFragment([l,wn])},D8={c:"center ",l:"left ",r:"right "},Jt=function(e,t){for(var n=[],i=new _.MathNode("mtd",[],["mtr-glue"]),s=new _.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<e.body.length;o++){for(var a=e.body[o],l=[],c=0;c<a.length;c++)l.push(new _.MathNode("mtd",[Te(a[c],t)]));e.tags&&e.tags[o]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(s):l.push(s)),n.push(new _.MathNode("mtr",l))}var u=new _.MathNode("mtable",n),d=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);u.setAttribute("rowspacing",G(d));var h="",f="";if(e.cols&&e.cols.length>0){var m=e.cols,y="",v=!1,x=0,T=m.length;m[0].type==="separator"&&(h+="top ",x=1),m[m.length-1].type==="separator"&&(h+="bottom ",T-=1);for(var D=x;D<T;D++)m[D].type==="align"?(f+=D8[m[D].align],v&&(y+="none "),v=!0):m[D].type==="separator"&&v&&(y+=m[D].separator==="|"?"solid ":"dashed ",v=!1);u.setAttribute("columnalign",f.trim()),/[sd]/.test(y)&&u.setAttribute("columnlines",y.trim())}if(e.colSeparationType==="align"){for(var P=e.cols||[],N="",O=1;O<P.length;O++)N+=O%2?"0em ":"1em ";u.setAttribute("columnspacing",N.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?u.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?u.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?u.setAttribute("columnspacing","0.5em"):u.setAttribute("columnspacing","1em");var A="",$=e.hLinesBeforeRow;h+=$[0].length>0?"left ":"",h+=$[$.length-1].length>0?"right ":"";for(var F=1;F<$.length-1;F++)A+=$[F].length===0?"none ":$[F][0]?"dashed ":"solid ";return/[sd]/.test(A)&&u.setAttribute("rowlines",A.trim()),h!==""&&(u=new _.MathNode("menclose",[u]),u.setAttribute("notation",h.trim())),e.arraystretch&&e.arraystretch<1&&(u=new _.MathNode("mstyle",[u]),u.setAttribute("scriptlevel","1")),u},yp=function(e,t){e.envName.indexOf("ed")===-1&&mo(e);var n=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s=e.envName==="split",o=Gr(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:Yl(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a,l=0,c={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var u="",d=0;d<t[0].body.length;d++){var h=fe(t[0].body[d],"textord");u+=h.text}a=Number(u),l=a*2}var f=!l;o.body.forEach(function(x){for(var T=1;T<x.length;T+=2){var D=fe(x[T],"styling"),P=fe(D.body[0],"ordgroup");P.body.unshift(c)}if(f)l<x.length&&(l=x.length);else{var N=x.length/2;if(a<N)throw new U("Too many math in a row: "+("expected "+a+", but got "+N),x[0])}});for(var m=0;m<l;++m){var y="r",v=0;m%2===1?y="l":m>0&&f&&(v=1),n[m]={type:"align",align:y,pregap:v,postgap:0}}return o.colSeparationType=f?"align":"alignat",o};Gt({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=co(e[0]),n=t?[e[0]]:fe(e[0],"ordgroup").body,i=n.map(function(o){var a=$l(o),l=a.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new U("Unknown column alignment: "+l,o)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Gr(r.parser,s,Zl(r.envName))},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,"lcr".indexOf(t)===-1)throw new U("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:t}]}}var s=Gr(r.parser,n,Zl(r.envName)),o=Math.max(0,...s.body.map(a=>a.length));return s.cols=new Array(o).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=Gr(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=co(e[0]),n=t?[e[0]]:fe(e[0],"ordgroup").body,i=n.map(function(o){var a=$l(o),l=a.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new U("Unknown column alignment: "+l,o)});if(i.length>1)throw new U("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=Gr(r.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new U("{subarray} can contain only one column");return s},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Gr(r.parser,e,Zl(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:yp,htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){["gather","gather*"].includes(r.envName)&&mo(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Yl(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return Gr(r.parser,e,"display")},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:yp,htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){mo(r);var e={autoTag:Yl(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return Gr(r.parser,e,"display")},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["CD"],props:{numArgs:0},handler(r){return mo(r),y8(r.parser)},htmlBuilder:Kt,mathmlBuilder:Jt}),S("\\nonumber","\\gdef\\@eqnsw{0}"),S("\\notag","\\nonumber"),Z({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new U(r.funcName+" valid only within array environment")}});var vp=pp;Z({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];if(i.type!=="ordgroup")throw new U("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=fe(i.body[o],"textord").text;if(n==="\\begin"){if(!vp.hasOwnProperty(s))throw new U("No such environment: "+s,i);var a=vp[s],{args:l,optArgs:c}=t.parseArguments("\\begin{"+s+"}",a),u={mode:t.mode,envName:s,parser:t},d=a.handler(u,l,c);t.expect("\\end",!1);var h=t.nextToken,f=fe(t.parseFunction(),"environment");if(f.name!==s)throw new U("Mismatch: \\begin{"+s+"} matched by \\end{"+f.name+"}",h);return d}return{type:"environment",mode:t.mode,name:s,nameGroup:i}}});var bp=(r,e)=>{var t=r.font,n=e.withFont(t);return be(r.body,n)},xp=(r,e)=>{var t=r.font,n=e.withFont(t);return Te(r.body,n)},wp={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Z({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=ao(e[0]),s=n;return s in wp&&(s=wp[s]),{type:"font",mode:t.mode,font:s.slice(1),body:i}},htmlBuilder:bp,mathmlBuilder:xp}),Z({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,n=e[0],i=xe.isCharacterBox(n);return{type:"mclass",mode:t.mode,mclass:ho(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}}),Z({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:i}=r,{mode:s}=t,o=t.parseExpression(!0,i),a="math"+n.slice(1);return{type:"font",mode:s,font:a,body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:bp,mathmlBuilder:xp});var Sp=(r,e)=>{var t=e;return r==="display"?t=t.id>=ae.SCRIPT.id?t.text():ae.DISPLAY:r==="text"&&t.size===ae.DISPLAY.size?t=ae.TEXT:r==="script"?t=ae.SCRIPT:r==="scriptscript"&&(t=ae.SCRIPTSCRIPT),t},Ql=(r,e)=>{var t=Sp(r.size,e.style),n=t.fracNum(),i=t.fracDen(),s;s=e.havingStyle(n);var o=be(r.numer,s,e);if(r.continued){var a=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}s=e.havingStyle(i);var c=be(r.denom,s,e),u,d,h;r.hasBarLine?(r.barSize?(d=ze(r.barSize,e),u=R.makeLineSpan("frac-line",e,d)):u=R.makeLineSpan("frac-line",e),d=u.height,h=u.height):(u=null,d=0,h=e.fontMetrics().defaultRuleThickness);var f,m,y;t.size===ae.DISPLAY.size||r.size==="display"?(f=e.fontMetrics().num1,d>0?m=3*h:m=7*h,y=e.fontMetrics().denom1):(d>0?(f=e.fontMetrics().num2,m=h):(f=e.fontMetrics().num3,m=3*h),y=e.fontMetrics().denom2);var v;if(u){var T=e.fontMetrics().axisHeight;f-o.depth-(T+.5*d)<m&&(f+=m-(f-o.depth-(T+.5*d))),T-.5*d-(c.height-y)<m&&(y+=m-(T-.5*d-(c.height-y)));var D=-(T-.5*d);v=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:y},{type:"elem",elem:u,shift:D},{type:"elem",elem:o,shift:-f}]},e)}else{var x=f-o.depth-(c.height-y);x<m&&(f+=.5*(m-x),y+=.5*(m-x)),v=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:y},{type:"elem",elem:o,shift:-f}]},e)}s=e.havingStyle(t),v.height*=s.sizeMultiplier/e.sizeMultiplier,v.depth*=s.sizeMultiplier/e.sizeMultiplier;var P;t.size===ae.DISPLAY.size?P=e.fontMetrics().delim1:t.size===ae.SCRIPTSCRIPT.size?P=e.havingStyle(ae.SCRIPT).fontMetrics().delim2:P=e.fontMetrics().delim2;var N,O;return r.leftDelim==null?N=Li(e,["mopen"]):N=gr.customSizedDelim(r.leftDelim,P,!0,e.havingStyle(t),r.mode,["mopen"]),r.continued?O=R.makeSpan([]):r.rightDelim==null?O=Li(e,["mclose"]):O=gr.customSizedDelim(r.rightDelim,P,!0,e.havingStyle(t),r.mode,["mclose"]),R.makeSpan(["mord"].concat(s.sizingClasses(e)),[N,R.makeSpan(["mfrac"],[v]),O],e)},e0=(r,e)=>{var t=new _.MathNode("mfrac",[Te(r.numer,e),Te(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=ze(r.barSize,e);t.setAttribute("linethickness",G(n))}var i=Sp(r.size,e.style);if(i.size!==e.style.size){t=new _.MathNode("mstyle",[t]);var s=i.size===ae.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",s),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var o=[];if(r.leftDelim!=null){var a=new _.MathNode("mo",[new _.TextNode(r.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(t),r.rightDelim!=null){var l=new _.MathNode("mo",[new _.TextNode(r.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Ll(o)}return t};Z({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1],o,a=null,l=null,c="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,a="(",l=")";break;case"\\\\bracefrac":o=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:i,denom:s,hasBarLine:o,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:Ql,mathmlBuilder:e0}),Z({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),Z({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:n}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var kp=["display","text","script","scriptscript"],Mp=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};Z({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,n=e[4],i=e[5],s=ao(e[0]),o=s.type==="atom"&&s.family==="open"?Mp(s.text):null,a=ao(e[1]),l=a.type==="atom"&&a.family==="close"?Mp(a.text):null,c=fe(e[2],"size"),u,d=null;c.isBlank?u=!0:(d=c.value,u=d.number>0);var h="auto",f=e[3];if(f.type==="ordgroup"){if(f.body.length>0){var m=fe(f.body[0],"textord");h=kp[Number(m.text)]}}else f=fe(f,"textord"),h=kp[Number(f.text)];return{type:"genfrac",mode:t.mode,numer:n,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:l,size:h}},htmlBuilder:Ql,mathmlBuilder:e0}),Z({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:n,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:fe(e[0],"size").value,token:i}}}),Z({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=av(fe(e[1],"infix").size),o=e[2],a=s.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Ql,mathmlBuilder:e0});var Tp=(r,e)=>{var t=e.style,n,i;r.type==="supsub"?(n=r.sup?be(r.sup,e.havingStyle(t.sup()),e):be(r.sub,e.havingStyle(t.sub()),e),i=fe(r.base,"horizBrace")):i=fe(r,"horizBrace");var s=be(i.base,e.havingBaseStyle(ae.DISPLAY)),o=mr.svgSpan(i,e),a;if(i.isOver?(a=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),a.children[0].children[0].children[1].classes.push("svg-align")):(a=R.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),a.children[0].children[0].children[0].classes.push("svg-align")),n){var l=R.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e);i.isOver?a=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):a=R.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return R.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e)},z8=(r,e)=>{var t=mr.mathMLnode(r.label);return new _.MathNode(r.isOver?"mover":"munder",[Te(r.base,e),t])};Z({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:Tp,mathmlBuilder:z8}),Z({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[1],i=fe(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:$e(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=_e(r.body,e,!1);return R.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=Wr(r.body,e);return t instanceof wt||(t=new wt("mrow",[t])),t.setAttribute("href",r.href),t}}),Z({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=fe(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<n.length;s++){var o=n[s];o==="~"&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:t.mode,font:"\\texttt",body:i};return{type:"href",mode:t.mode,href:n,body:$e(a)}}}),Z({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(r,e){var{parser:t}=r;return{type:"hbox",mode:t.mode,body:$e(e[0])}},htmlBuilder(r,e){var t=_e(r.body,e,!1);return R.makeFragment(t)},mathmlBuilder(r,e){return new _.MathNode("mrow",ft(r.body,e))}}),Z({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,token:i}=r,s=fe(e[0],"raw").string,o=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,l={};switch(n){case"\\htmlClass":l.class=s,a={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,a={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,a={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var c=s.split(","),u=0;u<c.length;u++){var d=c[u],h=d.indexOf("=");if(h<0)throw new U("\\htmlData key/value '"+d+"' missing equals sign");var f=d.slice(0,h),m=d.slice(h+1);l["data-"+f.trim()]=m}a={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return t.settings.isTrusted(a)?{type:"html",mode:t.mode,attributes:l,body:$e(o)}:t.formatUnsupportedCmd(n)},htmlBuilder:(r,e)=>{var t=_e(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var i=R.makeSpan(n,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&i.setAttribute(s,r.attributes[s]);return i},mathmlBuilder:(r,e)=>Wr(r.body,e)}),Z({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:$e(e[0]),mathml:$e(e[1])}},htmlBuilder:(r,e)=>{var t=_e(r.html,e,!1);return R.makeFragment(t)},mathmlBuilder:(r,e)=>Wr(r.mathml,e)});var t0=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 U("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Ef(n))throw new U("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Z({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:n}=r,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(t[0])for(var l=fe(t[0],"raw").string,c=l.split(","),u=0;u<c.length;u++){var d=c[u].split("=");if(d.length===2){var h=d[1].trim();switch(d[0].trim()){case"alt":a=h;break;case"width":i=t0(h);break;case"height":s=t0(h);break;case"totalheight":o=t0(h);break;default:throw new U("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var f=fe(e[0],"url").url;return a===""&&(a=f,a=a.replace(/^.*[\\/]/,""),a=a.substring(0,a.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:f})?{type:"includegraphics",mode:n.mode,alt:a,width:i,height:s,totalheight:o,src:f}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(r,e)=>{var t=ze(r.height,e),n=0;r.totalheight.number>0&&(n=ze(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=ze(r.width,e));var s={height:G(t+n)};i>0&&(s.width=G(i)),n>0&&(s.verticalAlign=G(-n));var o=new zv(r.src,r.alt,s);return o.height=t,o.depth=n,o},mathmlBuilder:(r,e)=>{var t=new _.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var n=ze(r.height,e),i=0;if(r.totalheight.number>0&&(i=ze(r.totalheight,e)-n,t.setAttribute("valign",G(-i))),t.setAttribute("height",G(n+i)),r.width.number>0){var s=ze(r.width,e);t.setAttribute("width",G(s))}return t.setAttribute("src",r.src),t}}),Z({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=fe(e[0],"size");if(t.settings.strict){var s=n[1]==="m",o=i.value.unit==="mu";s?(o||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return R.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=ze(r.dimension,e);return new _.SpaceNode(t)}}),Z({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=R.makeSpan([],[be(r.body,e)]),t=R.makeSpan(["inner"],[t],e)):t=R.makeSpan(["inner"],[be(r.body,e)]);var n=R.makeSpan(["fix"],[]),i=R.makeSpan([r.alignment],[t,n],e),s=R.makeSpan(["strut"]);return s.style.height=G(i.height+i.depth),i.depth&&(s.style.verticalAlign=G(-i.depth)),i.children.unshift(s),i=R.makeSpan(["thinbox"],[i],e),R.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new _.MathNode("mpadded",[Te(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}}),Z({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:n}=r,i=n.mode;n.switchMode("math");var s=t==="\\("?"\\)":"$",o=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:o}}}),Z({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new U("Mismatched "+r.funcName)}});var Cp=(r,e)=>{switch(e.style.size){case ae.DISPLAY.size:return r.display;case ae.TEXT.size:return r.text;case ae.SCRIPT.size:return r.script;case ae.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};Z({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:$e(e[0]),text:$e(e[1]),script:$e(e[2]),scriptscript:$e(e[3])}},htmlBuilder:(r,e)=>{var t=Cp(r,e),n=_e(t,e,!1);return R.makeFragment(n)},mathmlBuilder:(r,e)=>{var t=Cp(r,e);return Wr(t,e)}});var Ep=(r,e,t,n,i,s,o)=>{r=R.makeSpan([],[r]);var a=t&&xe.isCharacterBox(t),l,c;if(e){var u=be(e,n.havingStyle(i.sup()),n);c={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-u.depth)}}if(t){var d=be(t,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var h;if(c&&l){var f=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+r.depth+o;h=R.makeVList({positionType:"bottom",positionData:f,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:G(-s)},{type:"kern",size:l.kern},{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:G(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var m=r.height-o;h=R.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:G(-s)},{type:"kern",size:l.kern},{type:"elem",elem:r}]},n)}else if(c){var y=r.depth+o;h=R.makeVList({positionType:"bottom",positionData:y,children:[{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:G(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return r;var v=[h];if(l&&s!==0&&!a){var x=R.makeSpan(["mspace"],[],n);x.style.marginRight=G(s),v.unshift(x)}return R.makeSpan(["mop","op-limits"],v,n)},Ap=["\\smallint"],Un=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=fe(r.base,"op"),i=!0):s=fe(r,"op");var o=e.style,a=!1;o.size===ae.DISPLAY.size&&s.symbol&&!Ap.includes(s.name)&&(a=!0);var l;if(s.symbol){var c=a?"Size2-Regular":"Size1-Regular",u="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(u=s.name.slice(1),s.name=u==="oiint"?"\\iint":"\\iiint"),l=R.makeSymbol(s.name,c,"math",e,["mop","op-symbol",a?"large-op":"small-op"]),u.length>0){var d=l.italic,h=R.staticSvg(u+"Size"+(a?"2":"1"),e);l=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:h,shift:a?.08:0}]},e),s.name="\\"+u,l.classes.unshift("mop"),l.italic=d}}else if(s.body){var f=_e(s.body,e,!0);f.length===1&&f[0]instanceof Ot?(l=f[0],l.classes[0]="mop"):l=R.makeSpan(["mop"],f,e)}else{for(var m=[],y=1;y<s.name.length;y++)m.push(R.mathsym(s.name[y],s.mode,e));l=R.makeSpan(["mop"],m,e)}var v=0,x=0;return(l instanceof Ot||s.name==="\\oiint"||s.name==="\\oiiint")&&!s.suppressBaseShift&&(v=(l.height-l.depth)/2-e.fontMetrics().axisHeight,x=l.italic),i?Ep(l,t,n,e,o,x,v):(v&&(l.style.position="relative",l.style.top=G(v)),l)},$i=(r,e)=>{var t;if(r.symbol)t=new wt("mo",[Nt(r.name,r.mode)]),Ap.includes(r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new wt("mo",ft(r.body,e));else{t=new wt("mi",[new Wt(r.name.slice(1))]);var n=new wt("mo",[Nt("⁡","text")]);r.parentIsSupSub?t=new wt("mrow",[t,n]):t=Uf([t,n])}return t},I8={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Z({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=n;return i.length===1&&(i=I8[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Un,mathmlBuilder:$i}),Z({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:$e(n)}},htmlBuilder:Un,mathmlBuilder:$i});var R8={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Z({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Un,mathmlBuilder:$i}),Z({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Un,mathmlBuilder:$i}),Z({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=R8[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Un,mathmlBuilder:$i});var Op=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=fe(r.base,"operatorname"),i=!0):s=fe(r,"operatorname");var o;if(s.body.length>0){for(var a=s.body.map(d=>{var h=d.text;return typeof h=="string"?{type:"textord",mode:d.mode,text:h}:d}),l=_e(a,e.withFont("mathrm"),!0),c=0;c<l.length;c++){var u=l[c];u instanceof Ot&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=R.makeSpan(["mop"],l,e)}else o=R.makeSpan(["mop"],[],e);return i?Ep(o,t,n,e,e.style,0,0):o},P8=(r,e)=>{for(var t=ft(r.body,e.withFont("mathrm")),n=!0,i=0;i<t.length;i++){var s=t[i];if(!(s instanceof _.SpaceNode))if(s instanceof _.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var o=s.children[0];s.children.length===1&&o instanceof _.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var a=t.map(u=>u.toText()).join("");t=[new _.TextNode(a)]}var l=new _.MathNode("mi",t);l.setAttribute("mathvariant","normal");var c=new _.MathNode("mo",[Nt("⁡","text")]);return r.parentIsSupSub?new _.MathNode("mrow",[l,c]):_.newDocumentFragment([l,c])};Z({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:$e(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Op,mathmlBuilder:P8}),S("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),bn({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?R.makeFragment(_e(r.body,e,!1)):R.makeSpan(["mord"],_e(r.body,e,!0),e)},mathmlBuilder(r,e){return Wr(r.body,e,!0)}}),Z({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=be(r.body,e.havingCrampedStyle()),n=R.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return R.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new _.MathNode("mo",[new _.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new _.MathNode("mover",[Te(r.body,e),t]);return n.setAttribute("accent","true"),n}}),Z({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:$e(n)}},htmlBuilder:(r,e)=>{var t=_e(r.body,e.withPhantom(),!1);return R.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=ft(r.body,e);return new _.MathNode("mphantom",t)}}),Z({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"hphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=R.makeSpan([],[be(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var n=0;n<t.children.length;n++)t.children[n].height=0,t.children[n].depth=0;return t=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e),R.makeSpan(["mord"],[t],e)},mathmlBuilder:(r,e)=>{var t=ft($e(r.body),e),n=new _.MathNode("mphantom",t),i=new _.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),Z({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=R.makeSpan(["inner"],[be(r.body,e.withPhantom())]),n=R.makeSpan(["fix"],[]);return R.makeSpan(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=ft($e(r.body),e),n=new _.MathNode("mphantom",t),i=new _.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}}),Z({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,n=fe(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:i}},htmlBuilder(r,e){var t=be(r.body,e),n=ze(r.dy,e);return R.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new _.MathNode("mpadded",[Te(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}}),Z({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}}),Z({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(r,e,t){var{parser:n}=r,i=t[0],s=fe(e[0],"size"),o=fe(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&fe(i,"size").value,width:s.value,height:o.value}},htmlBuilder(r,e){var t=R.makeSpan(["mord","rule"],[],e),n=ze(r.width,e),i=ze(r.height,e),s=r.shift?ze(r.shift,e):0;return t.style.borderRightWidth=G(n),t.style.borderTopWidth=G(i),t.style.bottom=G(s),t.width=n,t.height=i+s,t.depth=-s,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=ze(r.width,e),n=ze(r.height,e),i=r.shift?ze(r.shift,e):0,s=e.color&&e.getColor()||"black",o=new _.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",G(t)),o.setAttribute("height",G(n));var a=new _.MathNode("mpadded",[o]);return i>=0?a.setAttribute("height",G(i)):(a.setAttribute("height",G(i)),a.setAttribute("depth",G(-i))),a.setAttribute("voffset",G(i)),a}});function Np(r,e,t){for(var n=_e(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,s=0;s<n.length;s++){var o=n[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(n[s].classes,e.sizingClasses(t)):n[s].classes[o+1]==="reset-size"+e.size&&(n[s].classes[o+1]="reset-size"+t.size),n[s].height*=i,n[s].depth*=i}return R.makeFragment(n)}var Dp=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],L8=(r,e)=>{var t=e.havingSize(r.size);return Np(r.body,t,e)};Z({type:"sizing",names:Dp,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:Dp.indexOf(n)+1,body:s}},htmlBuilder:L8,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=ft(r.body,t),i=new _.MathNode("mstyle",n);return i.setAttribute("mathsize",G(t.sizeMultiplier)),i}}),Z({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:n}=r,i=!1,s=!1,o=t[0]&&fe(t[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l){var c=o.body[l];if(a=c.text,a==="t")i=!0;else if(a==="b")s=!0;else{i=!1,s=!1;break}}else i=!0,s=!0;var u=e[0];return{type:"smash",mode:n.mode,body:u,smashHeight:i,smashDepth:s}},htmlBuilder:(r,e)=>{var t=R.makeSpan([],[be(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var n=0;n<t.children.length;n++)t.children[n].height=0;if(r.smashDepth&&(t.depth=0,t.children))for(var i=0;i<t.children.length;i++)t.children[i].depth=0;var s=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e);return R.makeSpan(["mord"],[s],e)},mathmlBuilder:(r,e)=>{var t=new _.MathNode("mpadded",[Te(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}}),Z({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n}=r,i=t[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(r,e){var t=be(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=R.wrapFragment(t,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.id<ae.TEXT.id&&(s=e.fontMetrics().xHeight);var o=i+s/4,a=t.height+t.depth+o+i,{span:l,ruleWidth:c,advanceWidth:u}=gr.sqrtImage(a,e),d=l.height-c;d>t.height+t.depth+o&&(o=(o+d-t.height-t.depth)/2);var h=l.height-t.height-o-c;t.style.paddingLeft=G(u);var f=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+h)},{type:"elem",elem:l},{type:"kern",size:c}]},e);if(r.index){var m=e.havingStyle(ae.SCRIPTSCRIPT),y=be(r.index,m,e),v=.6*(f.height-f.depth),x=R.makeVList({positionType:"shift",positionData:-v,children:[{type:"elem",elem:y}]},e),T=R.makeSpan(["root"],[x]);return R.makeSpan(["mord","sqrt"],[T,f],e)}else return R.makeSpan(["mord","sqrt"],[f],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new _.MathNode("mroot",[Te(t,e),Te(n,e)]):new _.MathNode("msqrt",[Te(t,e)])}});var zp={display:ae.DISPLAY,text:ae.TEXT,script:ae.SCRIPT,scriptscript:ae.SCRIPTSCRIPT};Z({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!0,t),o=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(r,e){var t=zp[r.style],n=e.havingStyle(t).withFont("");return Np(r.body,n,e)},mathmlBuilder(r,e){var t=zp[r.style],n=e.havingStyle(t),i=ft(r.body,n),s=new _.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},a=o[r.style];return s.setAttribute("scriptlevel",a[0]),s.setAttribute("displaystyle",a[1]),s}});var B8=function(e,t){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(t.style.size===ae.DISPLAY.size||n.alwaysHandleSupSub);return i?Un:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(t.style.size===ae.DISPLAY.size||n.limits);return s?Op:null}else{if(n.type==="accent")return xe.isCharacterBox(n.base)?Hl:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?Tp:null}else return null}else return null};bn({type:"supsub",htmlBuilder(r,e){var t=B8(r,e);if(t)return t(r,e);var{base:n,sup:i,sub:s}=r,o=be(n,e),a,l,c=e.fontMetrics(),u=0,d=0,h=n&&xe.isCharacterBox(n);if(i){var f=e.havingStyle(e.style.sup());a=be(i,f,e),h||(u=o.height-f.fontMetrics().supDrop*f.sizeMultiplier/e.sizeMultiplier)}if(s){var m=e.havingStyle(e.style.sub());l=be(s,m,e),h||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/e.sizeMultiplier)}var y;e.style===ae.DISPLAY?y=c.sup1:e.style.cramped?y=c.sup3:y=c.sup2;var v=e.sizeMultiplier,x=G(.5/c.ptPerEm/v),T=null;if(l){var D=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(o instanceof Ot||D)&&(T=G(-o.italic))}var P;if(a&&l){u=Math.max(u,y,a.depth+.25*c.xHeight),d=Math.max(d,c.sub2);var N=c.defaultRuleThickness,O=4*N;if(u-a.depth-(l.height-d)<O){d=O-(u-a.depth)+l.height;var A=.8*c.xHeight-(u-a.depth);A>0&&(u+=A,d-=A)}var $=[{type:"elem",elem:l,shift:d,marginRight:x,marginLeft:T},{type:"elem",elem:a,shift:-u,marginRight:x}];P=R.makeVList({positionType:"individualShift",children:$},e)}else if(l){d=Math.max(d,c.sub1,l.height-.8*c.xHeight);var F=[{type:"elem",elem:l,marginLeft:T,marginRight:x}];P=R.makeVList({positionType:"shift",positionData:d,children:F},e)}else if(a)u=Math.max(u,y,a.depth+.25*c.xHeight),P=R.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:a,marginRight:x}]},e);else throw new Error("supsub must have either sup or sub.");var q=Rl(o,"right")||"mord";return R.makeSpan([q],[o,R.makeSpan(["msupsub"],[P])],e)},mathmlBuilder(r,e){var t=!1,n,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[Te(r.base,e)];r.sub&&s.push(Te(r.sub,e)),r.sup&&s.push(Te(r.sup,e));var o;if(t)o=n?"mover":"munder";else if(r.sub)if(r.sup){var c=r.base;c&&c.type==="op"&&c.limits&&e.style===ae.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(e.style===ae.DISPLAY||c.limits)?o="munderover":o="msubsup"}else{var l=r.base;l&&l.type==="op"&&l.limits&&(e.style===ae.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===ae.DISPLAY)?o="munder":o="msub"}else{var a=r.base;a&&a.type==="op"&&a.limits&&(e.style===ae.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||e.style===ae.DISPLAY)?o="mover":o="msup"}return new _.MathNode(o,s)}}),bn({type:"atom",htmlBuilder(r,e){return R.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new _.MathNode("mo",[Nt(r.text,r.mode)]);if(r.family==="bin"){var n=Bl(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var Ip={mi:"italic",mn:"normal",mtext:"normal"};bn({type:"mathord",htmlBuilder(r,e){return R.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new _.MathNode("mi",[Nt(r.text,r.mode,e)]),n=Bl(r,e)||"italic";return n!==Ip[t.type]&&t.setAttribute("mathvariant",n),t}}),bn({type:"textord",htmlBuilder(r,e){return R.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=Nt(r.text,r.mode,e),n=Bl(r,e)||"normal",i;return r.mode==="text"?i=new _.MathNode("mtext",[t]):/[0-9]/.test(r.text)?i=new _.MathNode("mn",[t]):r.text==="\\prime"?i=new _.MathNode("mo",[t]):i=new _.MathNode("mi",[t]),n!==Ip[i.type]&&i.setAttribute("mathvariant",n),i}});var r0={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},n0={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};bn({type:"spacing",htmlBuilder(r,e){if(n0.hasOwnProperty(r.text)){var t=n0[r.text].className||"";if(r.mode==="text"){var n=R.makeOrd(r,e,"textord");return n.classes.push(t),n}else return R.makeSpan(["mspace",t],[R.mathsym(r.text,r.mode,e)],e)}else{if(r0.hasOwnProperty(r.text))return R.makeSpan(["mspace",r0[r.text]],[],e);throw new U('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(n0.hasOwnProperty(r.text))t=new _.MathNode("mtext",[new _.TextNode(" ")]);else{if(r0.hasOwnProperty(r.text))return new _.MathNode("mspace");throw new U('Unknown type of space "'+r.text+'"')}return t}});var Rp=()=>{var r=new _.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};bn({type:"tag",mathmlBuilder(r,e){var t=new _.MathNode("mtable",[new _.MathNode("mtr",[Rp(),new _.MathNode("mtd",[Wr(r.body,e)]),Rp(),new _.MathNode("mtd",[Wr(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var Pp={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Lp={"\\textbf":"textbf","\\textmd":"textmd"},F8={"\\textit":"textit","\\textup":"textup"},Bp=(r,e)=>{var t=r.font;if(t){if(Pp[t])return e.withTextFontFamily(Pp[t]);if(Lp[t])return e.withTextFontWeight(Lp[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(F8[t])};Z({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"text",mode:t.mode,body:$e(i),font:n}},htmlBuilder(r,e){var t=Bp(r,e),n=_e(r.body,t,!0);return R.makeSpan(["mord","text"],n,t)},mathmlBuilder(r,e){var t=Bp(r,e);return Wr(r.body,t)}}),Z({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=be(r.body,e),n=R.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=R.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:t}]},e);return R.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new _.MathNode("mo",[new _.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new _.MathNode("munder",[Te(r.body,e),t]);return n.setAttribute("accentunder","true"),n}}),Z({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=be(r.body,e),n=e.fontMetrics().axisHeight,i=.5*(t.height-n-(t.depth+n));return R.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new _.MathNode("mpadded",[Te(r.body,e)],["vcenter"])}}),Z({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new U("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=Fp(r),n=[],i=e.havingStyle(e.style.text()),s=0;s<t.length;s++){var o=t[s];o==="~"&&(o="\\textasciitilde"),n.push(R.makeSymbol(o,"Typewriter-Regular",r.mode,i,["mord","texttt"]))}return R.makeSpan(["mord","text"].concat(i.sizingClasses(e)),R.tryCombineChars(n),i)},mathmlBuilder(r,e){var t=new _.TextNode(Fp(r)),n=new _.MathNode("mtext",[t]);return n.setAttribute("mathvariant","monospace"),n}});var Fp=r=>r.body.replace(/ /g,r.star?"␣":" "),Kr=qf,$p=`[ \r
381
+ `+A+" children.");for(var te=0;te<A;te++){var Y=new jr(D[te]),he=new dr([Y],{width:"400em",height:G(O),viewBox:"0 0 "+a+" "+N,preserveAspectRatio:F[te]+" slice"}),Q=R.makeSvgSpan([$[te]],[he],t);if(A===1)return{span:Q,minWidth:P,height:O};Q.style.height=G(O),x.push(Q)}return{span:R.makeSpan(["stretchy"],x,t),minWidth:P,height:O}}}var{span:i,minWidth:s,height:o}=n();return i.height=o,i.style.height=G(o),s>0&&(i.style.minWidth=G(s)),i},d8=function(e,t,n,i,s){var o,a=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(o=R.makeSpan(["stretchy",t],[],s),t==="fbox"){var l=s.color&&s.getColor();l&&(o.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new El({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&c.push(new El({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new dr(c,{width:"100%",height:G(a)});o=R.makeSvgSpan([],[u],s)}return o.height=a,o.style.height=G(a),o},mr={encloseSpan:d8,mathMLnode:a8,svgSpan:u8};function fe(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function $l(r){var e=co(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function co(r){return r&&(r.type==="atom"||Lv.hasOwnProperty(r.type))?r:null}var Hl=(r,e)=>{var t,n,i;r&&r.type==="supsub"?(n=fe(r.base,"accent"),t=n.base,r.base=t,i=Rv(be(r,e)),r.base=n):(n=fe(r,"accent"),t=n.base);var s=be(t,e.havingCrampedStyle()),o=n.isShifty&&xe.isCharacterBox(t),a=0;if(o){var l=xe.getBaseElem(t),c=be(l,e.havingCrampedStyle());a=Df(c).skew}var u=n.label==="\\c",d=u?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=mr.svgSpan(n,e),h=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+G(2*a)+")",marginLeft:G(2*a)}:void 0}]},e);else{var f,m;n.label==="\\vec"?(f=R.staticSvg("vec",e),m=R.svgData.vec[1]):(f=R.makeOrd({mode:n.mode,text:n.label},e,"textord"),f=Df(f),f.italic=0,m=f.width,u&&(d+=f.depth)),h=R.makeSpan(["accent-body"],[f]);var y=n.label==="\\textcircled";y&&(h.classes.push("accent-full"),d=s.height);var v=a;y||(v-=m/2),h.style.left=G(v),n.label==="\\textcircled"&&(h.style.top=".2em"),h=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:h}]},e)}var x=R.makeSpan(["mord","accent"],[h],e);return i?(i.children[0]=x,i.height=Math.max(x.height,i.height),i.classes[0]="mord",i):x},Jf=(r,e)=>{var t=r.isStretchy?mr.mathMLnode(r.label):new _.MathNode("mo",[Nt(r.label,r.mode)]),n=new _.MathNode("mover",[Te(r.base,e),t]);return n.setAttribute("accent","true"),n},h8=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));Z({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:(r,e)=>{var t=ao(e[0]),n=!h8.test(r.funcName),i=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:i,base:t}},htmlBuilder:Hl,mathmlBuilder:Jf}),Z({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Hl,mathmlBuilder:Jf}),Z({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:i}},htmlBuilder:(r,e)=>{var t=be(r.base,e),n=mr.svgSpan(r,e),i=r.label==="\\utilde"?.12:0,s=R.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]},e);return R.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=mr.mathMLnode(r.label),n=new _.MathNode("munder",[Te(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var uo=r=>{var e=new _.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Z({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(r,e,t){var{parser:n,funcName:i}=r;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),i=R.wrapFragment(be(r.body,n,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var o;r.below&&(n=e.havingStyle(t.sub()),o=R.wrapFragment(be(r.below,n,e),e),o.classes.push(s+"-arrow-pad"));var a=mr.svgSpan(r,e),l=-e.fontMetrics().axisHeight+.5*a.height,c=-e.fontMetrics().axisHeight-.5*a.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(c-=i.depth);var u;if(o){var d=-e.fontMetrics().axisHeight+o.height+.5*a.height+.111;u=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l},{type:"elem",elem:o,shift:d}]},e)}else u=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l}]},e);return u.children[0].children[0].children[1].classes.push("svg-align"),R.makeSpan(["mrel","x-arrow"],[u],e)},mathmlBuilder(r,e){var t=mr.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var i=uo(Te(r.body,e));if(r.below){var s=uo(Te(r.below,e));n=new _.MathNode("munderover",[t,s,i])}else n=new _.MathNode("mover",[t,i])}else if(r.below){var o=uo(Te(r.below,e));n=new _.MathNode("munder",[t,o])}else n=uo(),n=new _.MathNode("mover",[t,n]);return n}});var f8=R.makeSpan;function Xf(r,e){var t=_e(r.body,e,!0);return f8([r.mclass],t,e)}function Yf(r,e){var t,n=ft(r.body,e);return r.mclass==="minner"?t=new _.MathNode("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new _.MathNode("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new _.MathNode("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}Z({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:$e(i),isCharacterBox:xe.isCharacterBox(i)}},htmlBuilder:Xf,mathmlBuilder:Yf});var ho=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Z({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:ho(e[0]),body:$e(e[1]),isCharacterBox:xe.isCharacterBox(e[1])}}}),Z({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:n}=r,i=e[1],s=e[0],o;n!=="\\stackrel"?o=ho(i):o="mrel";var a={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:$e(i)},l={type:"supsub",mode:s.mode,base:a,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:t.mode,mclass:o,body:[l],isCharacterBox:xe.isCharacterBox(l)}},htmlBuilder:Xf,mathmlBuilder:Yf}),Z({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:ho(e[0]),body:$e(e[0])}},htmlBuilder(r,e){var t=_e(r.body,e,!0),n=R.makeSpan([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=ft(r.body,e),n=new _.MathNode("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var p8={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Zf=()=>({type:"styling",body:[],mode:"math",style:"display"}),Qf=r=>r.type==="textord"&&r.text==="@",m8=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function g8(r,e,t){var n=p8[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},o=t.callFunction("\\Big",[s],[]),a=t.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,a]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function y8(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new U("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],i=[n],s=0;s<e.length;s++){for(var o=e[s],a=Zf(),l=0;l<o.length;l++)if(!Qf(o[l]))a.body.push(o[l]);else{n.push(a),l+=1;var c=$l(o[l]).text,u=new Array(2);if(u[0]={type:"ordgroup",mode:"math",body:[]},u[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(c)>-1))if("<>AV".indexOf(c)>-1)for(var d=0;d<2;d++){for(var h=!0,f=l+1;f<o.length;f++){if(m8(o[f],c)){h=!1,l=f;break}if(Qf(o[f]))throw new U("Missing a "+c+" character to complete a CD arrow.",o[f]);u[d].body.push(o[f])}if(h)throw new U("Missing a "+c+" character to complete a CD arrow.",o[l])}else throw new U('Expected one of "<>AV=|." after @',o[l]);var m=g8(c,u,r),y={type:"styling",body:[m],mode:"math",style:"display"};n.push(y),a=Zf()}s%2===0?n.push(a):n.shift(),n=[],i.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var v=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Z({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=R.wrapFragment(be(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=G(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new _.MathNode("mrow",[Te(r.label,e)]);return t=new _.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new _.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}}),Z({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=R.wrapFragment(be(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new _.MathNode("mrow",[Te(r.fragment,e)])}}),Z({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,n=fe(e[0],"ordgroup"),i=n.body,s="",o=0;o<i.length;o++){var a=fe(i[o],"textord");s+=a.text}var l=parseInt(s),c;if(isNaN(l))throw new U("\\@char has non-numeric argument "+s);if(l<0||l>=1114111)throw new U("\\@char with invalid code point "+s);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:c}}});var ep=(r,e)=>{var t=_e(r.body,e.withColor(r.color),!1);return R.makeFragment(t)},tp=(r,e)=>{var t=ft(r.body,e.withColor(r.color)),n=new _.MathNode("mstyle",t);return n.setAttribute("mathcolor",r.color),n};Z({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,n=fe(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:n,body:$e(i)}},htmlBuilder:ep,mathmlBuilder:tp}),Z({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:n}=r,i=fe(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var s=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:i,body:s}},htmlBuilder:ep,mathmlBuilder:tp}),Z({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:n}=r,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&fe(i,"size").value}},htmlBuilder(r,e){var t=R.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=G(ze(r.size,e)))),t},mathmlBuilder(r,e){var t=new _.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",G(ze(r.size,e)))),t}});var Vl={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},rp=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new U("Expected a control sequence",r);return e},v8=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},np=(r,e,t,n)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,n)};Z({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(Vl[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=Vl[n.text]),fe(e.parseFunction(),"internal");throw new U("Invalid token after macro prefix",n)}}),Z({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new U("Expected a control sequence",n);for(var s=0,o,a=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),a[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new U('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new U('Argument number "'+n.text+'" out of order');s++,a.push([])}else{if(n.text==="EOF")throw new U("Expected a macro definition");a[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return o&&l.unshift(o),(t==="\\edef"||t==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:a},t===Vl[t]),{type:"internal",mode:e.mode}}}),Z({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=rp(e.gullet.popToken());e.gullet.consumeSpaces();var i=v8(e);return np(e,n,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}}),Z({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=rp(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return np(e,n,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Bi=function(e,t,n){var i=Ee.math[e]&&Ee.math[e].replace,s=kl(i||e,t,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},ql=function(e,t,n,i){var s=n.havingBaseStyle(t),o=R.makeSpan(i.concat(s.sizingClasses(n)),[e],n),a=s.sizeMultiplier/n.sizeMultiplier;return o.height*=a,o.depth*=a,o.maxFontSize=s.sizeMultiplier,o},ip=function(e,t,n){var i=t.havingBaseStyle(n),s=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=G(s),e.height-=s,e.depth+=s},b8=function(e,t,n,i,s,o){var a=R.makeSymbol(e,"Main-Regular",s,i),l=ql(a,t,i,o);return n&&ip(l,i,t),l},x8=function(e,t,n,i){return R.makeSymbol(e,"Size"+t+"-Regular",n,i)},sp=function(e,t,n,i,s,o){var a=x8(e,t,s,i),l=ql(R.makeSpan(["delimsizing","size"+t],[a],i),ae.TEXT,i,o);return n&&ip(l,i,ae.TEXT),l},_l=function(e,t,n){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=R.makeSpan(["delimsizinginner",i],[R.makeSpan([],[R.makeSymbol(e,t,n)])]);return{type:"elem",elem:s}},jl=function(e,t,n){var i=Ut["Size4-Regular"][e.charCodeAt(0)]?Ut["Size4-Regular"][e.charCodeAt(0)][4]:Ut["Size1-Regular"][e.charCodeAt(0)][4],s=new jr("inner",Tv(e,Math.round(1e3*t))),o=new dr([s],{width:G(i),height:G(t),style:"width:"+G(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=R.makeSvgSpan([],[o],n);return a.height=t,a.style.height=G(t),a.style.width=G(i),{type:"elem",elem:a}},Ul=.008,fo={type:"kern",size:-1*Ul},w8=["|","\\lvert","\\rvert","\\vert"],S8=["\\|","\\lVert","\\rVert","\\Vert"],op=function(e,t,n,i,s,o){var a,l,c,u,d="",h=0;a=c=u=e,l=null;var f="Size1-Regular";e==="\\uparrow"?c=u="⏐":e==="\\Uparrow"?c=u="‖":e==="\\downarrow"?a=c="⏐":e==="\\Downarrow"?a=c="‖":e==="\\updownarrow"?(a="\\uparrow",c="⏐",u="\\downarrow"):e==="\\Updownarrow"?(a="\\Uparrow",c="‖",u="\\Downarrow"):w8.includes(e)?(c="∣",d="vert",h=333):S8.includes(e)?(c="∥",d="doublevert",h=556):e==="["||e==="\\lbrack"?(a="⎡",c="⎢",u="⎣",f="Size4-Regular",d="lbrack",h=667):e==="]"||e==="\\rbrack"?(a="⎤",c="⎥",u="⎦",f="Size4-Regular",d="rbrack",h=667):e==="\\lfloor"||e==="⌊"?(c=a="⎢",u="⎣",f="Size4-Regular",d="lfloor",h=667):e==="\\lceil"||e==="⌈"?(a="⎡",c=u="⎢",f="Size4-Regular",d="lceil",h=667):e==="\\rfloor"||e==="⌋"?(c=a="⎥",u="⎦",f="Size4-Regular",d="rfloor",h=667):e==="\\rceil"||e==="⌉"?(a="⎤",c=u="⎥",f="Size4-Regular",d="rceil",h=667):e==="("||e==="\\lparen"?(a="⎛",c="⎜",u="⎝",f="Size4-Regular",d="lparen",h=875):e===")"||e==="\\rparen"?(a="⎞",c="⎟",u="⎠",f="Size4-Regular",d="rparen",h=875):e==="\\{"||e==="\\lbrace"?(a="⎧",l="⎨",u="⎩",c="⎪",f="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(a="⎫",l="⎬",u="⎭",c="⎪",f="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(a="⎧",u="⎩",c="⎪",f="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(a="⎫",u="⎭",c="⎪",f="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(a="⎧",u="⎭",c="⎪",f="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(a="⎫",u="⎩",c="⎪",f="Size4-Regular");var m=Bi(a,f,s),y=m.height+m.depth,v=Bi(c,f,s),x=v.height+v.depth,T=Bi(u,f,s),D=T.height+T.depth,P=0,N=1;if(l!==null){var O=Bi(l,f,s);P=O.height+O.depth,N=2}var A=y+D+P,$=Math.max(0,Math.ceil((t-A)/(N*x))),F=A+$*N*x,q=i.fontMetrics().axisHeight;n&&(q*=i.sizeMultiplier);var te=F/2-q,Y=[];if(d.length>0){var he=F-y-D,Q=Math.round(F*1e3),W=Cv(d,Math.round(he*1e3)),ne=new jr(d,W),ve=(h/1e3).toFixed(3)+"em",ge=(Q/1e3).toFixed(3)+"em",Ae=new dr([ne],{width:ve,height:ge,viewBox:"0 0 "+h+" "+Q}),C=R.makeSvgSpan([],[Ae],i);C.height=Q/1e3,C.style.width=ve,C.style.height=ge,Y.push({type:"elem",elem:C})}else{if(Y.push(_l(u,f,s)),Y.push(fo),l===null){var w=F-y-D+2*Ul;Y.push(jl(c,w,i))}else{var I=(F-y-D-P)/2+2*Ul;Y.push(jl(c,I,i)),Y.push(fo),Y.push(_l(l,f,s)),Y.push(fo),Y.push(jl(c,I,i))}Y.push(fo),Y.push(_l(a,f,s))}var L=i.havingBaseStyle(ae.TEXT),B=R.makeVList({positionType:"bottom",positionData:te,children:Y},L);return ql(R.makeSpan(["delimsizing","mult"],[B],L),ae.TEXT,i,o)},Wl=80,Gl=.08,Kl=function(e,t,n,i,s){var o=Mv(e,i,n),a=new jr(e,o),l=new dr([a],{width:"400em",height:G(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return R.makeSvgSpan(["hide-tail"],[l],s)},k8=function(e,t){var n=t.havingBaseSizing(),i=up("\\surd",e*n.sizeMultiplier,cp,n),s=n.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),a,l=0,c=0,u=0,d;return i.type==="small"?(u=1e3+1e3*o+Wl,e<1?s=1:e<1.4&&(s=.7),l=(1+o+Gl)/s,c=(1+o)/s,a=Kl("sqrtMain",l,u,o,t),a.style.minWidth="0.853em",d=.833/s):i.type==="large"?(u=(1e3+Wl)*Fi[i.size],c=(Fi[i.size]+o)/s,l=(Fi[i.size]+o+Gl)/s,a=Kl("sqrtSize"+i.size,l,u,o,t),a.style.minWidth="1.02em",d=1/s):(l=e+o+Gl,c=e+o,u=Math.floor(1e3*e+o)+Wl,a=Kl("sqrtTall",l,u,o,t),a.style.minWidth="0.742em",d=1.056),a.height=c,a.style.height=G(l),{span:a,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},ap=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],M8=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],lp=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Fi=[0,1.2,1.8,2.4,3],T8=function(e,t,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),ap.includes(e)||lp.includes(e))return sp(e,t,!1,n,i,s);if(M8.includes(e))return op(e,Fi[t],!1,n,i,s);throw new U("Illegal delimiter: '"+e+"'")},C8=[{type:"small",style:ae.SCRIPTSCRIPT},{type:"small",style:ae.SCRIPT},{type:"small",style:ae.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],E8=[{type:"small",style:ae.SCRIPTSCRIPT},{type:"small",style:ae.SCRIPT},{type:"small",style:ae.TEXT},{type:"stack"}],cp=[{type:"small",style:ae.SCRIPTSCRIPT},{type:"small",style:ae.SCRIPT},{type:"small",style:ae.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],A8=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},up=function(e,t,n,i){for(var s=Math.min(2,3-i.style.size),o=s;o<n.length&&n[o].type!=="stack";o++){var a=Bi(e,A8(n[o]),"math"),l=a.height+a.depth;if(n[o].type==="small"){var c=i.havingBaseStyle(n[o].style);l*=c.sizeMultiplier}if(l>t)return n[o]}return n[n.length-1]},dp=function(e,t,n,i,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var a;lp.includes(e)?a=C8:ap.includes(e)?a=cp:a=E8;var l=up(e,t,a,i);return l.type==="small"?b8(e,l.style,n,i,s,o):l.type==="large"?sp(e,l.size,n,i,s,o):op(e,t,n,i,s,o)},O8=function(e,t,n,i,s,o){var a=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,u=Math.max(t-a,n+a),d=Math.max(u/500*l,2*u-c);return dp(e,d,!0,i,s,o)},gr={sqrtImage:k8,sizedDelim:T8,sizeToMaxHeight:Fi,customSizedDelim:dp,leftRightDelim:O8},hp={"\\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}},N8=["(","\\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 po(r,e){var t=co(r);if(t&&N8.includes(t.text))return t;throw t?new U("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new U("Invalid delimiter type '"+r.type+"'",r)}Z({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:(r,e)=>{var t=po(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:hp[r.funcName].size,mclass:hp[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?R.makeSpan([r.mclass]):gr.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(Nt(r.delim,r.mode));var t=new _.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=G(gr.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function fp(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Z({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new U("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:po(e[0],r).text,color:t}}}),Z({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=po(e[0],r),n=r.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=fe(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{fp(r);for(var t=_e(r.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,o=0;o<t.length;o++)t[o].isMiddle?s=!0:(n=Math.max(t[o].height,n),i=Math.max(t[o].depth,i));n*=e.sizeMultiplier,i*=e.sizeMultiplier;var a;if(r.left==="."?a=Li(e,["mopen"]):a=gr.leftRightDelim(r.left,n,i,e,r.mode,["mopen"]),t.unshift(a),s)for(var l=1;l<t.length;l++){var c=t[l],u=c.isMiddle;u&&(t[l]=gr.leftRightDelim(u.delim,n,i,u.options,r.mode,[]))}var d;if(r.right===".")d=Li(e,["mclose"]);else{var h=r.rightColor?e.withColor(r.rightColor):e;d=gr.leftRightDelim(r.right,n,i,h,r.mode,["mclose"])}return t.push(d),R.makeSpan(["minner"],t,e)},mathmlBuilder:(r,e)=>{fp(r);var t=ft(r.body,e);if(r.left!=="."){var n=new _.MathNode("mo",[Nt(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var i=new _.MathNode("mo",[Nt(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return Ll(t)}}),Z({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=po(e[0],r);if(!r.parser.leftrightDepth)throw new U("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=Li(e,[]);else{t=gr.sizedDelim(r.delim,1,e,r.mode,[]);var n={delim:r.delim,options:e};t.isMiddle=n}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?Nt("|","text"):Nt(r.delim,r.mode),n=new _.MathNode("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var Jl=(r,e)=>{var t=R.wrapFragment(be(r.body,e),e),n=r.label.slice(1),i=e.sizeMultiplier,s,o=0,a=xe.isCharacterBox(r.body);if(n==="sout")s=R.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=ze({number:.6,unit:"pt"},e),c=ze({number:.35,unit:"ex"},e),u=e.havingBaseSizing();i=i/u.sizeMultiplier;var d=t.height+t.depth+l+c;t.style.paddingLeft=G(d/2+l);var h=Math.floor(1e3*d*i),f=Sv(h),m=new dr([new jr("phase",f)],{width:"400em",height:G(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});s=R.makeSvgSpan(["hide-tail"],[m],e),s.style.height=G(d),o=t.depth+l+c}else{/cancel/.test(n)?a||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var y=0,v=0,x=0;/box/.test(n)?(x=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),y=e.fontMetrics().fboxsep+(n==="colorbox"?0:x),v=y):n==="angl"?(x=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),y=4*x,v=Math.max(0,.25-t.depth)):(y=a?.2:0,v=y),s=mr.encloseSpan(t,n,y,v,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=G(x)):n==="angl"&&x!==.049&&(s.style.borderTopWidth=G(x),s.style.borderRightWidth=G(x)),o=t.depth+v,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var T;if(r.backgroundColor)T=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:t,shift:0}]},e);else{var D=/cancel|phase/.test(n)?["svg-align"]:[];T=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:D}]},e)}return/cancel/.test(n)&&(T.height=t.height,T.depth=t.depth),/cancel/.test(n)&&!a?R.makeSpan(["mord","cancel-lap"],[T],e):R.makeSpan(["mord"],[T],e)},Xl=(r,e)=>{var t=0,n=new _.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Te(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(r.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};Z({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=fe(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:Jl,mathmlBuilder:Xl}),Z({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=fe(e[0],"color-token").color,o=fe(e[1],"color-token").color,a=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:Jl,mathmlBuilder:Xl}),Z({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}}),Z({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:Jl,mathmlBuilder:Xl}),Z({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var pp={};function Gt(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,a={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<t.length;++l)pp[t[l]]=a;s&&(so[e]=s),o&&(oo[e]=o)}var mp={};function S(r,e){mp[r]=e}function gp(r){var e=[];r.consumeSpaces();var t=r.fetch().text;for(t==="\\relax"&&(r.consume(),r.consumeSpaces(),t=r.fetch().text);t==="\\hline"||t==="\\hdashline";)r.consume(),e.push(t==="\\hdashline"),r.consumeSpaces(),t=r.fetch().text;return e}var mo=r=>{var e=r.parser.settings;if(!e.displayMode)throw new U("{"+r.envName+"} can be used only in display mode.")};function Yl(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function Gr(r,e,t){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:d,leqno:h}=e;if(r.gullet.beginGroup(),c||r.gullet.macros.set("\\cr","\\\\\\relax"),!o){var f=r.gullet.expandMacroAsText("\\arraystretch");if(f==null)o=1;else if(o=parseFloat(f),!o||o<0)throw new U("Invalid \\arraystretch: "+f)}r.gullet.beginGroup();var m=[],y=[m],v=[],x=[],T=l!=null?[]:void 0;function D(){l&&r.gullet.macros.set("\\@eqnsw","1",!0)}function P(){T&&(r.gullet.macros.get("\\df@tag")?(T.push(r.subparse([new bt("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!l&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(D(),x.push(gp(r));;){var N=r.parseExpression(!1,c?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),N={type:"ordgroup",mode:r.mode,body:N},t&&(N={type:"styling",mode:r.mode,style:t,body:[N]}),m.push(N);var O=r.fetch().text;if(O==="&"){if(d&&m.length===d){if(c||a)throw new U("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(O==="\\end"){P(),m.length===1&&N.type==="styling"&&N.body[0].body.length===0&&(y.length>1||!u)&&y.pop(),x.length<y.length+1&&x.push([]);break}else if(O==="\\\\"){r.consume();var A=void 0;r.gullet.future().text!==" "&&(A=r.parseSizeGroup(!0)),v.push(A?A.value:null),P(),x.push(gp(r)),m=[],y.push(m),D()}else throw new U("Expected & or \\\\ or \\cr or \\end",r.nextToken)}return r.gullet.endGroup(),r.gullet.endGroup(),{type:"array",mode:r.mode,addJot:i,arraystretch:o,body:y,cols:s,rowGaps:v,hskipBeforeAndAfter:n,hLinesBeforeRow:x,colSeparationType:a,tags:T,leqno:h}}function Zl(r){return r.slice(0,1)==="d"?"display":"text"}var Kt=function(e,t){var n,i,s=e.body.length,o=e.hLinesBeforeRow,a=0,l=new Array(s),c=[],u=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,h=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var f=t.havingStyle(ae.SCRIPT).sizeMultiplier;h=.2778*(f/t.sizeMultiplier)}var m=e.colSeparationType==="CD"?ze({number:3,unit:"ex"},t):12*d,y=3*d,v=e.arraystretch*m,x=.7*v,T=.3*v,D=0;function P(je){for(var Sn=0;Sn<je.length;++Sn)Sn>0&&(D+=.25),c.push({pos:D,isDashed:je[Sn]})}for(P(o[0]),n=0;n<e.body.length;++n){var N=e.body[n],O=x,A=T;a<N.length&&(a=N.length);var $=new Array(N.length);for(i=0;i<N.length;++i){var F=be(N[i],t);A<F.depth&&(A=F.depth),O<F.height&&(O=F.height),$[i]=F}var q=e.rowGaps[n],te=0;q&&(te=ze(q,t),te>0&&(te+=T,A<te&&(A=te),te=0)),e.addJot&&(A+=y),$.height=O,$.depth=A,D+=O,$.pos=D,D+=A+te,l[n]=$,P(o[n+1])}var Y=D/2+t.fontMetrics().axisHeight,he=e.cols||[],Q=[],W,ne,ve=[];if(e.tags&&e.tags.some(je=>je))for(n=0;n<s;++n){var ge=l[n],Ae=ge.pos-Y,C=e.tags[n],w=void 0;C===!0?w=R.makeSpan(["eqn-num"],[],t):C===!1?w=R.makeSpan([],[],t):w=R.makeSpan([],_e(C,t,!0),t),w.depth=ge.depth,w.height=ge.height,ve.push({type:"elem",elem:w,shift:Ae})}for(i=0,ne=0;i<a||ne<he.length;++i,++ne){for(var I=he[ne]||{},L=!0;I.type==="separator";){if(L||(W=R.makeSpan(["arraycolsep"],[]),W.style.width=G(t.fontMetrics().doubleRuleSep),Q.push(W)),I.separator==="|"||I.separator===":"){var B=I.separator==="|"?"solid":"dashed",K=R.makeSpan(["vertical-separator"],[],t);K.style.height=G(D),K.style.borderRightWidth=G(u),K.style.borderRightStyle=B,K.style.margin="0 "+G(-u/2);var re=D-Y;re&&(K.style.verticalAlign=G(-re)),Q.push(K)}else throw new U("Invalid separator type: "+I.separator);ne++,I=he[ne]||{},L=!1}if(!(i>=a)){var j=void 0;(i>0||e.hskipBeforeAndAfter)&&(j=xe.deflt(I.pregap,h),j!==0&&(W=R.makeSpan(["arraycolsep"],[]),W.style.width=G(j),Q.push(W)));var ie=[];for(n=0;n<s;++n){var me=l[n],Ce=me[i];if(Ce){var zt=me.pos-Y;Ce.depth=me.depth,Ce.height=me.height,ie.push({type:"elem",elem:Ce,shift:zt})}}ie=R.makeVList({positionType:"individualShift",children:ie},t),ie=R.makeSpan(["col-align-"+(I.align||"c")],[ie]),Q.push(ie),(i<a-1||e.hskipBeforeAndAfter)&&(j=xe.deflt(I.postgap,h),j!==0&&(W=R.makeSpan(["arraycolsep"],[]),W.style.width=G(j),Q.push(W)))}}if(l=R.makeSpan(["mtable"],Q),c.length>0){for(var It=R.makeLineSpan("hline",t,u),Ne=R.makeLineSpan("hdashline",t,u),ct=[{type:"elem",elem:l,shift:0}];c.length>0;){var Xr=c.pop(),xn=Xr.pos-Y;Xr.isDashed?ct.push({type:"elem",elem:Ne,shift:xn}):ct.push({type:"elem",elem:It,shift:xn})}l=R.makeVList({positionType:"individualShift",children:ct},t)}if(ve.length===0)return R.makeSpan(["mord"],[l],t);var wn=R.makeVList({positionType:"individualShift",children:ve},t);return wn=R.makeSpan(["tag"],[wn],t),R.makeFragment([l,wn])},D8={c:"center ",l:"left ",r:"right "},Jt=function(e,t){for(var n=[],i=new _.MathNode("mtd",[],["mtr-glue"]),s=new _.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<e.body.length;o++){for(var a=e.body[o],l=[],c=0;c<a.length;c++)l.push(new _.MathNode("mtd",[Te(a[c],t)]));e.tags&&e.tags[o]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(s):l.push(s)),n.push(new _.MathNode("mtr",l))}var u=new _.MathNode("mtable",n),d=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);u.setAttribute("rowspacing",G(d));var h="",f="";if(e.cols&&e.cols.length>0){var m=e.cols,y="",v=!1,x=0,T=m.length;m[0].type==="separator"&&(h+="top ",x=1),m[m.length-1].type==="separator"&&(h+="bottom ",T-=1);for(var D=x;D<T;D++)m[D].type==="align"?(f+=D8[m[D].align],v&&(y+="none "),v=!0):m[D].type==="separator"&&v&&(y+=m[D].separator==="|"?"solid ":"dashed ",v=!1);u.setAttribute("columnalign",f.trim()),/[sd]/.test(y)&&u.setAttribute("columnlines",y.trim())}if(e.colSeparationType==="align"){for(var P=e.cols||[],N="",O=1;O<P.length;O++)N+=O%2?"0em ":"1em ";u.setAttribute("columnspacing",N.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?u.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?u.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?u.setAttribute("columnspacing","0.5em"):u.setAttribute("columnspacing","1em");var A="",$=e.hLinesBeforeRow;h+=$[0].length>0?"left ":"",h+=$[$.length-1].length>0?"right ":"";for(var F=1;F<$.length-1;F++)A+=$[F].length===0?"none ":$[F][0]?"dashed ":"solid ";return/[sd]/.test(A)&&u.setAttribute("rowlines",A.trim()),h!==""&&(u=new _.MathNode("menclose",[u]),u.setAttribute("notation",h.trim())),e.arraystretch&&e.arraystretch<1&&(u=new _.MathNode("mstyle",[u]),u.setAttribute("scriptlevel","1")),u},yp=function(e,t){e.envName.indexOf("ed")===-1&&mo(e);var n=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s=e.envName==="split",o=Gr(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:Yl(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a,l=0,c={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var u="",d=0;d<t[0].body.length;d++){var h=fe(t[0].body[d],"textord");u+=h.text}a=Number(u),l=a*2}var f=!l;o.body.forEach(function(x){for(var T=1;T<x.length;T+=2){var D=fe(x[T],"styling"),P=fe(D.body[0],"ordgroup");P.body.unshift(c)}if(f)l<x.length&&(l=x.length);else{var N=x.length/2;if(a<N)throw new U("Too many math in a row: "+("expected "+a+", but got "+N),x[0])}});for(var m=0;m<l;++m){var y="r",v=0;m%2===1?y="l":m>0&&f&&(v=1),n[m]={type:"align",align:y,pregap:v,postgap:0}}return o.colSeparationType=f?"align":"alignat",o};Gt({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=co(e[0]),n=t?[e[0]]:fe(e[0],"ordgroup").body,i=n.map(function(o){var a=$l(o),l=a.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new U("Unknown column alignment: "+l,o)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Gr(r.parser,s,Zl(r.envName))},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,"lcr".indexOf(t)===-1)throw new U("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:t}]}}var s=Gr(r.parser,n,Zl(r.envName)),o=Math.max(0,...s.body.map(a=>a.length));return s.cols=new Array(o).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=Gr(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=co(e[0]),n=t?[e[0]]:fe(e[0],"ordgroup").body,i=n.map(function(o){var a=$l(o),l=a.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new U("Unknown column alignment: "+l,o)});if(i.length>1)throw new U("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=Gr(r.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new U("{subarray} can contain only one column");return s},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Gr(r.parser,e,Zl(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:yp,htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){["gather","gather*"].includes(r.envName)&&mo(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Yl(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return Gr(r.parser,e,"display")},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:yp,htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){mo(r);var e={autoTag:Yl(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return Gr(r.parser,e,"display")},htmlBuilder:Kt,mathmlBuilder:Jt}),Gt({type:"array",names:["CD"],props:{numArgs:0},handler(r){return mo(r),y8(r.parser)},htmlBuilder:Kt,mathmlBuilder:Jt}),S("\\nonumber","\\gdef\\@eqnsw{0}"),S("\\notag","\\nonumber"),Z({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new U(r.funcName+" valid only within array environment")}});var vp=pp;Z({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];if(i.type!=="ordgroup")throw new U("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=fe(i.body[o],"textord").text;if(n==="\\begin"){if(!vp.hasOwnProperty(s))throw new U("No such environment: "+s,i);var a=vp[s],{args:l,optArgs:c}=t.parseArguments("\\begin{"+s+"}",a),u={mode:t.mode,envName:s,parser:t},d=a.handler(u,l,c);t.expect("\\end",!1);var h=t.nextToken,f=fe(t.parseFunction(),"environment");if(f.name!==s)throw new U("Mismatch: \\begin{"+s+"} matched by \\end{"+f.name+"}",h);return d}return{type:"environment",mode:t.mode,name:s,nameGroup:i}}});var bp=(r,e)=>{var t=r.font,n=e.withFont(t);return be(r.body,n)},xp=(r,e)=>{var t=r.font,n=e.withFont(t);return Te(r.body,n)},wp={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Z({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=ao(e[0]),s=n;return s in wp&&(s=wp[s]),{type:"font",mode:t.mode,font:s.slice(1),body:i}},htmlBuilder:bp,mathmlBuilder:xp}),Z({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,n=e[0],i=xe.isCharacterBox(n);return{type:"mclass",mode:t.mode,mclass:ho(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}}),Z({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:i}=r,{mode:s}=t,o=t.parseExpression(!0,i),a="math"+n.slice(1);return{type:"font",mode:s,font:a,body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:bp,mathmlBuilder:xp});var Sp=(r,e)=>{var t=e;return r==="display"?t=t.id>=ae.SCRIPT.id?t.text():ae.DISPLAY:r==="text"&&t.size===ae.DISPLAY.size?t=ae.TEXT:r==="script"?t=ae.SCRIPT:r==="scriptscript"&&(t=ae.SCRIPTSCRIPT),t},Ql=(r,e)=>{var t=Sp(r.size,e.style),n=t.fracNum(),i=t.fracDen(),s;s=e.havingStyle(n);var o=be(r.numer,s,e);if(r.continued){var a=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}s=e.havingStyle(i);var c=be(r.denom,s,e),u,d,h;r.hasBarLine?(r.barSize?(d=ze(r.barSize,e),u=R.makeLineSpan("frac-line",e,d)):u=R.makeLineSpan("frac-line",e),d=u.height,h=u.height):(u=null,d=0,h=e.fontMetrics().defaultRuleThickness);var f,m,y;t.size===ae.DISPLAY.size||r.size==="display"?(f=e.fontMetrics().num1,d>0?m=3*h:m=7*h,y=e.fontMetrics().denom1):(d>0?(f=e.fontMetrics().num2,m=h):(f=e.fontMetrics().num3,m=3*h),y=e.fontMetrics().denom2);var v;if(u){var T=e.fontMetrics().axisHeight;f-o.depth-(T+.5*d)<m&&(f+=m-(f-o.depth-(T+.5*d))),T-.5*d-(c.height-y)<m&&(y+=m-(T-.5*d-(c.height-y)));var D=-(T-.5*d);v=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:y},{type:"elem",elem:u,shift:D},{type:"elem",elem:o,shift:-f}]},e)}else{var x=f-o.depth-(c.height-y);x<m&&(f+=.5*(m-x),y+=.5*(m-x)),v=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:y},{type:"elem",elem:o,shift:-f}]},e)}s=e.havingStyle(t),v.height*=s.sizeMultiplier/e.sizeMultiplier,v.depth*=s.sizeMultiplier/e.sizeMultiplier;var P;t.size===ae.DISPLAY.size?P=e.fontMetrics().delim1:t.size===ae.SCRIPTSCRIPT.size?P=e.havingStyle(ae.SCRIPT).fontMetrics().delim2:P=e.fontMetrics().delim2;var N,O;return r.leftDelim==null?N=Li(e,["mopen"]):N=gr.customSizedDelim(r.leftDelim,P,!0,e.havingStyle(t),r.mode,["mopen"]),r.continued?O=R.makeSpan([]):r.rightDelim==null?O=Li(e,["mclose"]):O=gr.customSizedDelim(r.rightDelim,P,!0,e.havingStyle(t),r.mode,["mclose"]),R.makeSpan(["mord"].concat(s.sizingClasses(e)),[N,R.makeSpan(["mfrac"],[v]),O],e)},e0=(r,e)=>{var t=new _.MathNode("mfrac",[Te(r.numer,e),Te(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=ze(r.barSize,e);t.setAttribute("linethickness",G(n))}var i=Sp(r.size,e.style);if(i.size!==e.style.size){t=new _.MathNode("mstyle",[t]);var s=i.size===ae.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",s),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var o=[];if(r.leftDelim!=null){var a=new _.MathNode("mo",[new _.TextNode(r.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(t),r.rightDelim!=null){var l=new _.MathNode("mo",[new _.TextNode(r.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Ll(o)}return t};Z({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1],o,a=null,l=null,c="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,a="(",l=")";break;case"\\\\bracefrac":o=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:i,denom:s,hasBarLine:o,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:Ql,mathmlBuilder:e0}),Z({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),Z({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:n}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var kp=["display","text","script","scriptscript"],Mp=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};Z({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,n=e[4],i=e[5],s=ao(e[0]),o=s.type==="atom"&&s.family==="open"?Mp(s.text):null,a=ao(e[1]),l=a.type==="atom"&&a.family==="close"?Mp(a.text):null,c=fe(e[2],"size"),u,d=null;c.isBlank?u=!0:(d=c.value,u=d.number>0);var h="auto",f=e[3];if(f.type==="ordgroup"){if(f.body.length>0){var m=fe(f.body[0],"textord");h=kp[Number(m.text)]}}else f=fe(f,"textord"),h=kp[Number(f.text)];return{type:"genfrac",mode:t.mode,numer:n,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:l,size:h}},htmlBuilder:Ql,mathmlBuilder:e0}),Z({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:n,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:fe(e[0],"size").value,token:i}}}),Z({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=av(fe(e[1],"infix").size),o=e[2],a=s.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Ql,mathmlBuilder:e0});var Tp=(r,e)=>{var t=e.style,n,i;r.type==="supsub"?(n=r.sup?be(r.sup,e.havingStyle(t.sup()),e):be(r.sub,e.havingStyle(t.sub()),e),i=fe(r.base,"horizBrace")):i=fe(r,"horizBrace");var s=be(i.base,e.havingBaseStyle(ae.DISPLAY)),o=mr.svgSpan(i,e),a;if(i.isOver?(a=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),a.children[0].children[0].children[1].classes.push("svg-align")):(a=R.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),a.children[0].children[0].children[0].classes.push("svg-align")),n){var l=R.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e);i.isOver?a=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):a=R.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return R.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e)},z8=(r,e)=>{var t=mr.mathMLnode(r.label);return new _.MathNode(r.isOver?"mover":"munder",[Te(r.base,e),t])};Z({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:Tp,mathmlBuilder:z8}),Z({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[1],i=fe(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:$e(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=_e(r.body,e,!1);return R.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=Wr(r.body,e);return t instanceof wt||(t=new wt("mrow",[t])),t.setAttribute("href",r.href),t}}),Z({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=fe(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<n.length;s++){var o=n[s];o==="~"&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:t.mode,font:"\\texttt",body:i};return{type:"href",mode:t.mode,href:n,body:$e(a)}}}),Z({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(r,e){var{parser:t}=r;return{type:"hbox",mode:t.mode,body:$e(e[0])}},htmlBuilder(r,e){var t=_e(r.body,e,!1);return R.makeFragment(t)},mathmlBuilder(r,e){return new _.MathNode("mrow",ft(r.body,e))}}),Z({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,token:i}=r,s=fe(e[0],"raw").string,o=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,l={};switch(n){case"\\htmlClass":l.class=s,a={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,a={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,a={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var c=s.split(","),u=0;u<c.length;u++){var d=c[u],h=d.indexOf("=");if(h<0)throw new U("\\htmlData key/value '"+d+"' missing equals sign");var f=d.slice(0,h),m=d.slice(h+1);l["data-"+f.trim()]=m}a={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return t.settings.isTrusted(a)?{type:"html",mode:t.mode,attributes:l,body:$e(o)}:t.formatUnsupportedCmd(n)},htmlBuilder:(r,e)=>{var t=_e(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var i=R.makeSpan(n,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&i.setAttribute(s,r.attributes[s]);return i},mathmlBuilder:(r,e)=>Wr(r.body,e)}),Z({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:$e(e[0]),mathml:$e(e[1])}},htmlBuilder:(r,e)=>{var t=_e(r.html,e,!1);return R.makeFragment(t)},mathmlBuilder:(r,e)=>Wr(r.mathml,e)});var t0=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 U("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Ef(n))throw new U("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Z({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:n}=r,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(t[0])for(var l=fe(t[0],"raw").string,c=l.split(","),u=0;u<c.length;u++){var d=c[u].split("=");if(d.length===2){var h=d[1].trim();switch(d[0].trim()){case"alt":a=h;break;case"width":i=t0(h);break;case"height":s=t0(h);break;case"totalheight":o=t0(h);break;default:throw new U("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var f=fe(e[0],"url").url;return a===""&&(a=f,a=a.replace(/^.*[\\/]/,""),a=a.substring(0,a.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:f})?{type:"includegraphics",mode:n.mode,alt:a,width:i,height:s,totalheight:o,src:f}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(r,e)=>{var t=ze(r.height,e),n=0;r.totalheight.number>0&&(n=ze(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=ze(r.width,e));var s={height:G(t+n)};i>0&&(s.width=G(i)),n>0&&(s.verticalAlign=G(-n));var o=new zv(r.src,r.alt,s);return o.height=t,o.depth=n,o},mathmlBuilder:(r,e)=>{var t=new _.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var n=ze(r.height,e),i=0;if(r.totalheight.number>0&&(i=ze(r.totalheight,e)-n,t.setAttribute("valign",G(-i))),t.setAttribute("height",G(n+i)),r.width.number>0){var s=ze(r.width,e);t.setAttribute("width",G(s))}return t.setAttribute("src",r.src),t}}),Z({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=fe(e[0],"size");if(t.settings.strict){var s=n[1]==="m",o=i.value.unit==="mu";s?(o||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return R.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=ze(r.dimension,e);return new _.SpaceNode(t)}}),Z({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=R.makeSpan([],[be(r.body,e)]),t=R.makeSpan(["inner"],[t],e)):t=R.makeSpan(["inner"],[be(r.body,e)]);var n=R.makeSpan(["fix"],[]),i=R.makeSpan([r.alignment],[t,n],e),s=R.makeSpan(["strut"]);return s.style.height=G(i.height+i.depth),i.depth&&(s.style.verticalAlign=G(-i.depth)),i.children.unshift(s),i=R.makeSpan(["thinbox"],[i],e),R.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new _.MathNode("mpadded",[Te(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}}),Z({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:n}=r,i=n.mode;n.switchMode("math");var s=t==="\\("?"\\)":"$",o=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:o}}}),Z({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new U("Mismatched "+r.funcName)}});var Cp=(r,e)=>{switch(e.style.size){case ae.DISPLAY.size:return r.display;case ae.TEXT.size:return r.text;case ae.SCRIPT.size:return r.script;case ae.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};Z({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:$e(e[0]),text:$e(e[1]),script:$e(e[2]),scriptscript:$e(e[3])}},htmlBuilder:(r,e)=>{var t=Cp(r,e),n=_e(t,e,!1);return R.makeFragment(n)},mathmlBuilder:(r,e)=>{var t=Cp(r,e);return Wr(t,e)}});var Ep=(r,e,t,n,i,s,o)=>{r=R.makeSpan([],[r]);var a=t&&xe.isCharacterBox(t),l,c;if(e){var u=be(e,n.havingStyle(i.sup()),n);c={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-u.depth)}}if(t){var d=be(t,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var h;if(c&&l){var f=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+r.depth+o;h=R.makeVList({positionType:"bottom",positionData:f,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:G(-s)},{type:"kern",size:l.kern},{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:G(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var m=r.height-o;h=R.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:G(-s)},{type:"kern",size:l.kern},{type:"elem",elem:r}]},n)}else if(c){var y=r.depth+o;h=R.makeVList({positionType:"bottom",positionData:y,children:[{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:G(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return r;var v=[h];if(l&&s!==0&&!a){var x=R.makeSpan(["mspace"],[],n);x.style.marginRight=G(s),v.unshift(x)}return R.makeSpan(["mop","op-limits"],v,n)},Ap=["\\smallint"],Un=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=fe(r.base,"op"),i=!0):s=fe(r,"op");var o=e.style,a=!1;o.size===ae.DISPLAY.size&&s.symbol&&!Ap.includes(s.name)&&(a=!0);var l;if(s.symbol){var c=a?"Size2-Regular":"Size1-Regular",u="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(u=s.name.slice(1),s.name=u==="oiint"?"\\iint":"\\iiint"),l=R.makeSymbol(s.name,c,"math",e,["mop","op-symbol",a?"large-op":"small-op"]),u.length>0){var d=l.italic,h=R.staticSvg(u+"Size"+(a?"2":"1"),e);l=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:h,shift:a?.08:0}]},e),s.name="\\"+u,l.classes.unshift("mop"),l.italic=d}}else if(s.body){var f=_e(s.body,e,!0);f.length===1&&f[0]instanceof Ot?(l=f[0],l.classes[0]="mop"):l=R.makeSpan(["mop"],f,e)}else{for(var m=[],y=1;y<s.name.length;y++)m.push(R.mathsym(s.name[y],s.mode,e));l=R.makeSpan(["mop"],m,e)}var v=0,x=0;return(l instanceof Ot||s.name==="\\oiint"||s.name==="\\oiiint")&&!s.suppressBaseShift&&(v=(l.height-l.depth)/2-e.fontMetrics().axisHeight,x=l.italic),i?Ep(l,t,n,e,o,x,v):(v&&(l.style.position="relative",l.style.top=G(v)),l)},$i=(r,e)=>{var t;if(r.symbol)t=new wt("mo",[Nt(r.name,r.mode)]),Ap.includes(r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new wt("mo",ft(r.body,e));else{t=new wt("mi",[new Wt(r.name.slice(1))]);var n=new wt("mo",[Nt("⁡","text")]);r.parentIsSupSub?t=new wt("mrow",[t,n]):t=Uf([t,n])}return t},I8={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Z({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=n;return i.length===1&&(i=I8[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Un,mathmlBuilder:$i}),Z({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:$e(n)}},htmlBuilder:Un,mathmlBuilder:$i});var R8={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Z({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Un,mathmlBuilder:$i}),Z({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Un,mathmlBuilder:$i}),Z({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=R8[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Un,mathmlBuilder:$i});var Op=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=fe(r.base,"operatorname"),i=!0):s=fe(r,"operatorname");var o;if(s.body.length>0){for(var a=s.body.map(d=>{var h=d.text;return typeof h=="string"?{type:"textord",mode:d.mode,text:h}:d}),l=_e(a,e.withFont("mathrm"),!0),c=0;c<l.length;c++){var u=l[c];u instanceof Ot&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=R.makeSpan(["mop"],l,e)}else o=R.makeSpan(["mop"],[],e);return i?Ep(o,t,n,e,e.style,0,0):o},P8=(r,e)=>{for(var t=ft(r.body,e.withFont("mathrm")),n=!0,i=0;i<t.length;i++){var s=t[i];if(!(s instanceof _.SpaceNode))if(s instanceof _.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var o=s.children[0];s.children.length===1&&o instanceof _.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var a=t.map(u=>u.toText()).join("");t=[new _.TextNode(a)]}var l=new _.MathNode("mi",t);l.setAttribute("mathvariant","normal");var c=new _.MathNode("mo",[Nt("⁡","text")]);return r.parentIsSupSub?new _.MathNode("mrow",[l,c]):_.newDocumentFragment([l,c])};Z({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:$e(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Op,mathmlBuilder:P8}),S("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),bn({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?R.makeFragment(_e(r.body,e,!1)):R.makeSpan(["mord"],_e(r.body,e,!0),e)},mathmlBuilder(r,e){return Wr(r.body,e,!0)}}),Z({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=be(r.body,e.havingCrampedStyle()),n=R.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return R.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new _.MathNode("mo",[new _.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new _.MathNode("mover",[Te(r.body,e),t]);return n.setAttribute("accent","true"),n}}),Z({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:$e(n)}},htmlBuilder:(r,e)=>{var t=_e(r.body,e.withPhantom(),!1);return R.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=ft(r.body,e);return new _.MathNode("mphantom",t)}}),Z({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"hphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=R.makeSpan([],[be(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var n=0;n<t.children.length;n++)t.children[n].height=0,t.children[n].depth=0;return t=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e),R.makeSpan(["mord"],[t],e)},mathmlBuilder:(r,e)=>{var t=ft($e(r.body),e),n=new _.MathNode("mphantom",t),i=new _.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),Z({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=R.makeSpan(["inner"],[be(r.body,e.withPhantom())]),n=R.makeSpan(["fix"],[]);return R.makeSpan(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=ft($e(r.body),e),n=new _.MathNode("mphantom",t),i=new _.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}}),Z({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,n=fe(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:i}},htmlBuilder(r,e){var t=be(r.body,e),n=ze(r.dy,e);return R.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new _.MathNode("mpadded",[Te(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}}),Z({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}}),Z({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(r,e,t){var{parser:n}=r,i=t[0],s=fe(e[0],"size"),o=fe(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&fe(i,"size").value,width:s.value,height:o.value}},htmlBuilder(r,e){var t=R.makeSpan(["mord","rule"],[],e),n=ze(r.width,e),i=ze(r.height,e),s=r.shift?ze(r.shift,e):0;return t.style.borderRightWidth=G(n),t.style.borderTopWidth=G(i),t.style.bottom=G(s),t.width=n,t.height=i+s,t.depth=-s,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=ze(r.width,e),n=ze(r.height,e),i=r.shift?ze(r.shift,e):0,s=e.color&&e.getColor()||"black",o=new _.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",G(t)),o.setAttribute("height",G(n));var a=new _.MathNode("mpadded",[o]);return i>=0?a.setAttribute("height",G(i)):(a.setAttribute("height",G(i)),a.setAttribute("depth",G(-i))),a.setAttribute("voffset",G(i)),a}});function Np(r,e,t){for(var n=_e(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,s=0;s<n.length;s++){var o=n[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(n[s].classes,e.sizingClasses(t)):n[s].classes[o+1]==="reset-size"+e.size&&(n[s].classes[o+1]="reset-size"+t.size),n[s].height*=i,n[s].depth*=i}return R.makeFragment(n)}var Dp=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],L8=(r,e)=>{var t=e.havingSize(r.size);return Np(r.body,t,e)};Z({type:"sizing",names:Dp,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:Dp.indexOf(n)+1,body:s}},htmlBuilder:L8,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=ft(r.body,t),i=new _.MathNode("mstyle",n);return i.setAttribute("mathsize",G(t.sizeMultiplier)),i}}),Z({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:n}=r,i=!1,s=!1,o=t[0]&&fe(t[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l){var c=o.body[l];if(a=c.text,a==="t")i=!0;else if(a==="b")s=!0;else{i=!1,s=!1;break}}else i=!0,s=!0;var u=e[0];return{type:"smash",mode:n.mode,body:u,smashHeight:i,smashDepth:s}},htmlBuilder:(r,e)=>{var t=R.makeSpan([],[be(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var n=0;n<t.children.length;n++)t.children[n].height=0;if(r.smashDepth&&(t.depth=0,t.children))for(var i=0;i<t.children.length;i++)t.children[i].depth=0;var s=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e);return R.makeSpan(["mord"],[s],e)},mathmlBuilder:(r,e)=>{var t=new _.MathNode("mpadded",[Te(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}}),Z({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n}=r,i=t[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(r,e){var t=be(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=R.wrapFragment(t,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.id<ae.TEXT.id&&(s=e.fontMetrics().xHeight);var o=i+s/4,a=t.height+t.depth+o+i,{span:l,ruleWidth:c,advanceWidth:u}=gr.sqrtImage(a,e),d=l.height-c;d>t.height+t.depth+o&&(o=(o+d-t.height-t.depth)/2);var h=l.height-t.height-o-c;t.style.paddingLeft=G(u);var f=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+h)},{type:"elem",elem:l},{type:"kern",size:c}]},e);if(r.index){var m=e.havingStyle(ae.SCRIPTSCRIPT),y=be(r.index,m,e),v=.6*(f.height-f.depth),x=R.makeVList({positionType:"shift",positionData:-v,children:[{type:"elem",elem:y}]},e),T=R.makeSpan(["root"],[x]);return R.makeSpan(["mord","sqrt"],[T,f],e)}else return R.makeSpan(["mord","sqrt"],[f],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new _.MathNode("mroot",[Te(t,e),Te(n,e)]):new _.MathNode("msqrt",[Te(t,e)])}});var zp={display:ae.DISPLAY,text:ae.TEXT,script:ae.SCRIPT,scriptscript:ae.SCRIPTSCRIPT};Z({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!0,t),o=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(r,e){var t=zp[r.style],n=e.havingStyle(t).withFont("");return Np(r.body,n,e)},mathmlBuilder(r,e){var t=zp[r.style],n=e.havingStyle(t),i=ft(r.body,n),s=new _.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},a=o[r.style];return s.setAttribute("scriptlevel",a[0]),s.setAttribute("displaystyle",a[1]),s}});var B8=function(e,t){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(t.style.size===ae.DISPLAY.size||n.alwaysHandleSupSub);return i?Un:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(t.style.size===ae.DISPLAY.size||n.limits);return s?Op:null}else{if(n.type==="accent")return xe.isCharacterBox(n.base)?Hl:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?Tp:null}else return null}else return null};bn({type:"supsub",htmlBuilder(r,e){var t=B8(r,e);if(t)return t(r,e);var{base:n,sup:i,sub:s}=r,o=be(n,e),a,l,c=e.fontMetrics(),u=0,d=0,h=n&&xe.isCharacterBox(n);if(i){var f=e.havingStyle(e.style.sup());a=be(i,f,e),h||(u=o.height-f.fontMetrics().supDrop*f.sizeMultiplier/e.sizeMultiplier)}if(s){var m=e.havingStyle(e.style.sub());l=be(s,m,e),h||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/e.sizeMultiplier)}var y;e.style===ae.DISPLAY?y=c.sup1:e.style.cramped?y=c.sup3:y=c.sup2;var v=e.sizeMultiplier,x=G(.5/c.ptPerEm/v),T=null;if(l){var D=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(o instanceof Ot||D)&&(T=G(-o.italic))}var P;if(a&&l){u=Math.max(u,y,a.depth+.25*c.xHeight),d=Math.max(d,c.sub2);var N=c.defaultRuleThickness,O=4*N;if(u-a.depth-(l.height-d)<O){d=O-(u-a.depth)+l.height;var A=.8*c.xHeight-(u-a.depth);A>0&&(u+=A,d-=A)}var $=[{type:"elem",elem:l,shift:d,marginRight:x,marginLeft:T},{type:"elem",elem:a,shift:-u,marginRight:x}];P=R.makeVList({positionType:"individualShift",children:$},e)}else if(l){d=Math.max(d,c.sub1,l.height-.8*c.xHeight);var F=[{type:"elem",elem:l,marginLeft:T,marginRight:x}];P=R.makeVList({positionType:"shift",positionData:d,children:F},e)}else if(a)u=Math.max(u,y,a.depth+.25*c.xHeight),P=R.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:a,marginRight:x}]},e);else throw new Error("supsub must have either sup or sub.");var q=Rl(o,"right")||"mord";return R.makeSpan([q],[o,R.makeSpan(["msupsub"],[P])],e)},mathmlBuilder(r,e){var t=!1,n,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[Te(r.base,e)];r.sub&&s.push(Te(r.sub,e)),r.sup&&s.push(Te(r.sup,e));var o;if(t)o=n?"mover":"munder";else if(r.sub)if(r.sup){var c=r.base;c&&c.type==="op"&&c.limits&&e.style===ae.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(e.style===ae.DISPLAY||c.limits)?o="munderover":o="msubsup"}else{var l=r.base;l&&l.type==="op"&&l.limits&&(e.style===ae.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===ae.DISPLAY)?o="munder":o="msub"}else{var a=r.base;a&&a.type==="op"&&a.limits&&(e.style===ae.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||e.style===ae.DISPLAY)?o="mover":o="msup"}return new _.MathNode(o,s)}}),bn({type:"atom",htmlBuilder(r,e){return R.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new _.MathNode("mo",[Nt(r.text,r.mode)]);if(r.family==="bin"){var n=Bl(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var Ip={mi:"italic",mn:"normal",mtext:"normal"};bn({type:"mathord",htmlBuilder(r,e){return R.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new _.MathNode("mi",[Nt(r.text,r.mode,e)]),n=Bl(r,e)||"italic";return n!==Ip[t.type]&&t.setAttribute("mathvariant",n),t}}),bn({type:"textord",htmlBuilder(r,e){return R.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=Nt(r.text,r.mode,e),n=Bl(r,e)||"normal",i;return r.mode==="text"?i=new _.MathNode("mtext",[t]):/[0-9]/.test(r.text)?i=new _.MathNode("mn",[t]):r.text==="\\prime"?i=new _.MathNode("mo",[t]):i=new _.MathNode("mi",[t]),n!==Ip[i.type]&&i.setAttribute("mathvariant",n),i}});var r0={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},n0={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};bn({type:"spacing",htmlBuilder(r,e){if(n0.hasOwnProperty(r.text)){var t=n0[r.text].className||"";if(r.mode==="text"){var n=R.makeOrd(r,e,"textord");return n.classes.push(t),n}else return R.makeSpan(["mspace",t],[R.mathsym(r.text,r.mode,e)],e)}else{if(r0.hasOwnProperty(r.text))return R.makeSpan(["mspace",r0[r.text]],[],e);throw new U('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(n0.hasOwnProperty(r.text))t=new _.MathNode("mtext",[new _.TextNode(" ")]);else{if(r0.hasOwnProperty(r.text))return new _.MathNode("mspace");throw new U('Unknown type of space "'+r.text+'"')}return t}});var Rp=()=>{var r=new _.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};bn({type:"tag",mathmlBuilder(r,e){var t=new _.MathNode("mtable",[new _.MathNode("mtr",[Rp(),new _.MathNode("mtd",[Wr(r.body,e)]),Rp(),new _.MathNode("mtd",[Wr(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var Pp={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Lp={"\\textbf":"textbf","\\textmd":"textmd"},F8={"\\textit":"textit","\\textup":"textup"},Bp=(r,e)=>{var t=r.font;if(t){if(Pp[t])return e.withTextFontFamily(Pp[t]);if(Lp[t])return e.withTextFontWeight(Lp[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(F8[t])};Z({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"text",mode:t.mode,body:$e(i),font:n}},htmlBuilder(r,e){var t=Bp(r,e),n=_e(r.body,t,!0);return R.makeSpan(["mord","text"],n,t)},mathmlBuilder(r,e){var t=Bp(r,e);return Wr(r.body,t)}}),Z({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=be(r.body,e),n=R.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=R.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:t}]},e);return R.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new _.MathNode("mo",[new _.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new _.MathNode("munder",[Te(r.body,e),t]);return n.setAttribute("accentunder","true"),n}}),Z({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=be(r.body,e),n=e.fontMetrics().axisHeight,i=.5*(t.height-n-(t.depth+n));return R.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new _.MathNode("mpadded",[Te(r.body,e)],["vcenter"])}}),Z({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new U("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=Fp(r),n=[],i=e.havingStyle(e.style.text()),s=0;s<t.length;s++){var o=t[s];o==="~"&&(o="\\textasciitilde"),n.push(R.makeSymbol(o,"Typewriter-Regular",r.mode,i,["mord","texttt"]))}return R.makeSpan(["mord","text"].concat(i.sizingClasses(e)),R.tryCombineChars(n),i)},mathmlBuilder(r,e){var t=new _.TextNode(Fp(r)),n=new _.MathNode("mtext",[t]);return n.setAttribute("mathvariant","monospace"),n}});var Fp=r=>r.body.replace(/ /g,r.star?"␣":" "),Kr=qf,$p=`[ \r
382
382
  ]`,$8="\\\\[a-zA-Z@]+",H8="\\\\[^\uD800-\uDFFF]",V8="("+$8+")"+$p+"*",q8=`\\\\(
383
383
  |[ \r ]+
384
384
  ?)[ \r ]*`,i0="[̀-ͯ]",_8=new RegExp(i0+"+$"),j8="("+$p+"+)|"+(q8+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(i0+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(i0+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+V8)+("|"+H8+")");class Hp{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(j8,"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 bt("EOF",new dt(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new U("Unexpected character: '"+e[t]+"'",new bt(e[t],new dt(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(`
385
385
  `,this.tokenRegex.lastIndex);return s===-1?(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=s+1,this.lex()}return new bt(i,new dt(this,t,this.tokenRegex.lastIndex))}}class U8{constructor(e,t){e===void 0&&(e={}),t===void 0&&(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(this.undefStack.length===0)throw new U("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)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var W8=mp;S("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),S("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}}),S("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}}),S("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}}),S("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),S("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),S("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Vp={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};S("\\char",function(r){var e=r.popToken(),t,n="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new U("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=Vp[e.text],n==null||n>=t)throw new U("Invalid base-"+t+" digit "+e.text);for(var i;(i=Vp[r.future().text])!=null&&i<t;)n*=t,n+=i,r.popToken()}return"\\@char{"+n+"}"});var s0=(r,e,t,n)=>{var i=r.consumeArg().tokens;if(i.length!==1)throw new U("\\newcommand's first argument must be a macro name");var s=i[0].text,o=r.isDefined(s);if(o&&!e)throw new U("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!o&&!t)throw new U("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(i=r.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=r.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new U("Invalid number of arguments: "+l);a=parseInt(l),i=r.consumeArg().tokens}return o&&n||r.macros.set(s,{tokens:i,numArgs:a}),""};S("\\newcommand",r=>s0(r,!1,!0,!1)),S("\\renewcommand",r=>s0(r,!0,!1,!1)),S("\\providecommand",r=>s0(r,!0,!0,!0)),S("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""}),S("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""}),S("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),Kr[t],Ee.math[t],Ee.text[t]),""}),S("\\bgroup","{"),S("\\egroup","}"),S("~","\\nobreakspace"),S("\\lq","`"),S("\\rq","'"),S("\\aa","\\r a"),S("\\AA","\\r A"),S("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),S("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),S("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),S("ℬ","\\mathscr{B}"),S("ℰ","\\mathscr{E}"),S("ℱ","\\mathscr{F}"),S("ℋ","\\mathscr{H}"),S("ℐ","\\mathscr{I}"),S("ℒ","\\mathscr{L}"),S("ℳ","\\mathscr{M}"),S("ℛ","\\mathscr{R}"),S("ℭ","\\mathfrak{C}"),S("ℌ","\\mathfrak{H}"),S("ℨ","\\mathfrak{Z}"),S("\\Bbbk","\\Bbb{k}"),S("·","\\cdotp"),S("\\llap","\\mathllap{\\textrm{#1}}"),S("\\rlap","\\mathrlap{\\textrm{#1}}"),S("\\clap","\\mathclap{\\textrm{#1}}"),S("\\mathstrut","\\vphantom{(}"),S("\\underbar","\\underline{\\text{#1}}"),S("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),S("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),S("\\ne","\\neq"),S("≠","\\neq"),S("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),S("∉","\\notin"),S("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),S("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),S("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),S("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),S("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),S("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),S("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),S("⟂","\\perp"),S("‼","\\mathclose{!\\mkern-0.8mu!}"),S("∌","\\notni"),S("⌜","\\ulcorner"),S("⌝","\\urcorner"),S("⌞","\\llcorner"),S("⌟","\\lrcorner"),S("©","\\copyright"),S("®","\\textregistered"),S("️","\\textregistered"),S("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),S("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),S("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),S("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),S("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),S("⋮","\\vdots"),S("\\varGamma","\\mathit{\\Gamma}"),S("\\varDelta","\\mathit{\\Delta}"),S("\\varTheta","\\mathit{\\Theta}"),S("\\varLambda","\\mathit{\\Lambda}"),S("\\varXi","\\mathit{\\Xi}"),S("\\varPi","\\mathit{\\Pi}"),S("\\varSigma","\\mathit{\\Sigma}"),S("\\varUpsilon","\\mathit{\\Upsilon}"),S("\\varPhi","\\mathit{\\Phi}"),S("\\varPsi","\\mathit{\\Psi}"),S("\\varOmega","\\mathit{\\Omega}"),S("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),S("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),S("\\boxed","\\fbox{$\\displaystyle{#1}$}"),S("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),S("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),S("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),S("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),S("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var qp={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};S("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in qp?e=qp[t]:(t.slice(0,4)==="\\not"||t in Ee.math&&["bin","rel"].includes(Ee.math[t].group))&&(e="\\dotsb"),e});var o0={")":!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};S("\\dotso",function(r){var e=r.future().text;return e in o0?"\\ldots\\,":"\\ldots"}),S("\\dotsc",function(r){var e=r.future().text;return e in o0&&e!==","?"\\ldots\\,":"\\ldots"}),S("\\cdots",function(r){var e=r.future().text;return e in o0?"\\@cdots\\,":"\\@cdots"}),S("\\dotsb","\\cdots"),S("\\dotsm","\\cdots"),S("\\dotsi","\\!\\cdots"),S("\\dotsx","\\ldots\\,"),S("\\DOTSI","\\relax"),S("\\DOTSB","\\relax"),S("\\DOTSX","\\relax"),S("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),S("\\,","\\tmspace+{3mu}{.1667em}"),S("\\thinspace","\\,"),S("\\>","\\mskip{4mu}"),S("\\:","\\tmspace+{4mu}{.2222em}"),S("\\medspace","\\:"),S("\\;","\\tmspace+{5mu}{.2777em}"),S("\\thickspace","\\;"),S("\\!","\\tmspace-{3mu}{.1667em}"),S("\\negthinspace","\\!"),S("\\negmedspace","\\tmspace-{4mu}{.2222em}"),S("\\negthickspace","\\tmspace-{5mu}{.277em}"),S("\\enspace","\\kern.5em "),S("\\enskip","\\hskip.5em\\relax"),S("\\quad","\\hskip1em\\relax"),S("\\qquad","\\hskip2em\\relax"),S("\\tag","\\@ifstar\\tag@literal\\tag@paren"),S("\\tag@paren","\\tag@literal{({#1})}"),S("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new U("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),S("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),S("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),S("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),S("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),S("\\newline","\\\\\\relax"),S("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var _p=G(Ut["Main-Regular"][84][1]-.7*Ut["Main-Regular"][65][1]);S("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+_p+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),S("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+_p+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),S("\\hspace","\\@ifstar\\@hspacer\\@hspace"),S("\\@hspace","\\hskip #1\\relax"),S("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),S("\\ordinarycolon",":"),S("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),S("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),S("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),S("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),S("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),S("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),S("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),S("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),S("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),S("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),S("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),S("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),S("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),S("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),S("∷","\\dblcolon"),S("∹","\\eqcolon"),S("≔","\\coloneqq"),S("≕","\\eqqcolon"),S("⩴","\\Coloneqq"),S("\\ratio","\\vcentcolon"),S("\\coloncolon","\\dblcolon"),S("\\colonequals","\\coloneqq"),S("\\coloncolonequals","\\Coloneqq"),S("\\equalscolon","\\eqqcolon"),S("\\equalscoloncolon","\\Eqqcolon"),S("\\colonminus","\\coloneq"),S("\\coloncolonminus","\\Coloneq"),S("\\minuscolon","\\eqcolon"),S("\\minuscoloncolon","\\Eqcolon"),S("\\coloncolonapprox","\\Colonapprox"),S("\\coloncolonsim","\\Colonsim"),S("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),S("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),S("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),S("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),S("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),S("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),S("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),S("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),S("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),S("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),S("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),S("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),S("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),S("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),S("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),S("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),S("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),S("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),S("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),S("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),S("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),S("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),S("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),S("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),S("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),S("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),S("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),S("\\imath","\\html@mathml{\\@imath}{ı}"),S("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),S("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),S("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),S("⟦","\\llbracket"),S("⟧","\\rrbracket"),S("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),S("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),S("⦃","\\lBrace"),S("⦄","\\rBrace"),S("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),S("⦵","\\minuso"),S("\\darr","\\downarrow"),S("\\dArr","\\Downarrow"),S("\\Darr","\\Downarrow"),S("\\lang","\\langle"),S("\\rang","\\rangle"),S("\\uarr","\\uparrow"),S("\\uArr","\\Uparrow"),S("\\Uarr","\\Uparrow"),S("\\N","\\mathbb{N}"),S("\\R","\\mathbb{R}"),S("\\Z","\\mathbb{Z}"),S("\\alef","\\aleph"),S("\\alefsym","\\aleph"),S("\\Alpha","\\mathrm{A}"),S("\\Beta","\\mathrm{B}"),S("\\bull","\\bullet"),S("\\Chi","\\mathrm{X}"),S("\\clubs","\\clubsuit"),S("\\cnums","\\mathbb{C}"),S("\\Complex","\\mathbb{C}"),S("\\Dagger","\\ddagger"),S("\\diamonds","\\diamondsuit"),S("\\empty","\\emptyset"),S("\\Epsilon","\\mathrm{E}"),S("\\Eta","\\mathrm{H}"),S("\\exist","\\exists"),S("\\harr","\\leftrightarrow"),S("\\hArr","\\Leftrightarrow"),S("\\Harr","\\Leftrightarrow"),S("\\hearts","\\heartsuit"),S("\\image","\\Im"),S("\\infin","\\infty"),S("\\Iota","\\mathrm{I}"),S("\\isin","\\in"),S("\\Kappa","\\mathrm{K}"),S("\\larr","\\leftarrow"),S("\\lArr","\\Leftarrow"),S("\\Larr","\\Leftarrow"),S("\\lrarr","\\leftrightarrow"),S("\\lrArr","\\Leftrightarrow"),S("\\Lrarr","\\Leftrightarrow"),S("\\Mu","\\mathrm{M}"),S("\\natnums","\\mathbb{N}"),S("\\Nu","\\mathrm{N}"),S("\\Omicron","\\mathrm{O}"),S("\\plusmn","\\pm"),S("\\rarr","\\rightarrow"),S("\\rArr","\\Rightarrow"),S("\\Rarr","\\Rightarrow"),S("\\real","\\Re"),S("\\reals","\\mathbb{R}"),S("\\Reals","\\mathbb{R}"),S("\\Rho","\\mathrm{P}"),S("\\sdot","\\cdot"),S("\\sect","\\S"),S("\\spades","\\spadesuit"),S("\\sub","\\subset"),S("\\sube","\\subseteq"),S("\\supe","\\supseteq"),S("\\Tau","\\mathrm{T}"),S("\\thetasym","\\vartheta"),S("\\weierp","\\wp"),S("\\Zeta","\\mathrm{Z}"),S("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),S("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),S("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),S("\\bra","\\mathinner{\\langle{#1}|}"),S("\\ket","\\mathinner{|{#1}\\rangle}"),S("\\braket","\\mathinner{\\langle{#1}\\rangle}"),S("\\Bra","\\left\\langle#1\\right|"),S("\\Ket","\\left|#1\\right\\rangle");var jp=r=>e=>{var t=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),a=e.macros.get("\\|");e.macros.beginGroup();var l=d=>h=>{r&&(h.macros.set("|",o),i.length&&h.macros.set("\\|",a));var f=d;if(!d&&i.length){var m=h.future();m.text==="|"&&(h.popToken(),f=!0)}return{tokens:f?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var c=e.consumeArg().tokens,u=e.expandTokens([...s,...c,...t]);return e.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};S("\\bra@ket",jp(!1)),S("\\bra@set",jp(!0)),S("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),S("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),S("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),S("\\angln","{\\angl n}"),S("\\blue","\\textcolor{##6495ed}{#1}"),S("\\orange","\\textcolor{##ffa500}{#1}"),S("\\pink","\\textcolor{##ff00af}{#1}"),S("\\red","\\textcolor{##df0030}{#1}"),S("\\green","\\textcolor{##28ae7b}{#1}"),S("\\gray","\\textcolor{gray}{#1}"),S("\\purple","\\textcolor{##9d38bd}{#1}"),S("\\blueA","\\textcolor{##ccfaff}{#1}"),S("\\blueB","\\textcolor{##80f6ff}{#1}"),S("\\blueC","\\textcolor{##63d9ea}{#1}"),S("\\blueD","\\textcolor{##11accd}{#1}"),S("\\blueE","\\textcolor{##0c7f99}{#1}"),S("\\tealA","\\textcolor{##94fff5}{#1}"),S("\\tealB","\\textcolor{##26edd5}{#1}"),S("\\tealC","\\textcolor{##01d1c1}{#1}"),S("\\tealD","\\textcolor{##01a995}{#1}"),S("\\tealE","\\textcolor{##208170}{#1}"),S("\\greenA","\\textcolor{##b6ffb0}{#1}"),S("\\greenB","\\textcolor{##8af281}{#1}"),S("\\greenC","\\textcolor{##74cf70}{#1}"),S("\\greenD","\\textcolor{##1fab54}{#1}"),S("\\greenE","\\textcolor{##0d923f}{#1}"),S("\\goldA","\\textcolor{##ffd0a9}{#1}"),S("\\goldB","\\textcolor{##ffbb71}{#1}"),S("\\goldC","\\textcolor{##ff9c39}{#1}"),S("\\goldD","\\textcolor{##e07d10}{#1}"),S("\\goldE","\\textcolor{##a75a05}{#1}"),S("\\redA","\\textcolor{##fca9a9}{#1}"),S("\\redB","\\textcolor{##ff8482}{#1}"),S("\\redC","\\textcolor{##f9685d}{#1}"),S("\\redD","\\textcolor{##e84d39}{#1}"),S("\\redE","\\textcolor{##bc2612}{#1}"),S("\\maroonA","\\textcolor{##ffbde0}{#1}"),S("\\maroonB","\\textcolor{##ff92c6}{#1}"),S("\\maroonC","\\textcolor{##ed5fa6}{#1}"),S("\\maroonD","\\textcolor{##ca337c}{#1}"),S("\\maroonE","\\textcolor{##9e034e}{#1}"),S("\\purpleA","\\textcolor{##ddd7ff}{#1}"),S("\\purpleB","\\textcolor{##c6b9fc}{#1}"),S("\\purpleC","\\textcolor{##aa87ff}{#1}"),S("\\purpleD","\\textcolor{##7854ab}{#1}"),S("\\purpleE","\\textcolor{##543b78}{#1}"),S("\\mintA","\\textcolor{##f5f9e8}{#1}"),S("\\mintB","\\textcolor{##edf2df}{#1}"),S("\\mintC","\\textcolor{##e0e5cc}{#1}"),S("\\grayA","\\textcolor{##f6f7f7}{#1}"),S("\\grayB","\\textcolor{##f0f1f2}{#1}"),S("\\grayC","\\textcolor{##e3e5e6}{#1}"),S("\\grayD","\\textcolor{##d6d8da}{#1}"),S("\\grayE","\\textcolor{##babec2}{#1}"),S("\\grayF","\\textcolor{##888d93}{#1}"),S("\\grayG","\\textcolor{##626569}{#1}"),S("\\grayH","\\textcolor{##3b3e40}{#1}"),S("\\grayI","\\textcolor{##21242c}{#1}"),S("\\kaBlue","\\textcolor{##314453}{#1}"),S("\\kaGreen","\\textcolor{##71B307}{#1}");var Up={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class G8{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 U8(W8,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Hp(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&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,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new bt("EOF",n.loc)),this.pushTokens(i),new bt("",dt.range(t,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,o=0,a=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new U("Extra }",s)}else if(s.text==="EOF")throw new U("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",s);if(e&&n)if((o===0||o===1&&e[a]==="{")&&s.text===e[a]){if(++a,a===e.length){t.splice(-a,a);break}}else a=0}while(o!==0||n);return i.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new U("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;i<n.length;i++){var s=this.popToken();if(n[i]!==s.text)throw new U("Use of the macro doesn't match its definition",s)}}for(var o=[],a=0;a<e;a++)o.push(this.consumeArg(t&&t[a+1]).tokens);return o}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new U("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new U("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var s=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var a=s.length-1;a>=0;--a){var l=s[a];if(l.text==="#"){if(a===0)throw new U("Incomplete placeholder at end of macro body",l);if(l=s[--a],l.text==="#")s.splice(a+1,1);else if(/^[1-9]$/.test(l.text))s.splice(a,2,...o[+l.text-1]);else throw new U("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new bt(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(n=>n.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof t=="function"?t(this):t;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var o=i.replace(/##/g,"");o.indexOf("#"+(s+1))!==-1;)++s;for(var a=new Hp(i,this.settings),l=[],c=a.lex();c.text!=="EOF";)l.push(c),c=a.lex();l.reverse();var u={tokens:l,numArgs:s};return u}return i}isDefined(e){return this.macros.has(e)||Kr.hasOwnProperty(e)||Ee.math.hasOwnProperty(e)||Ee.text.hasOwnProperty(e)||Up.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:Kr.hasOwnProperty(e)&&!Kr[e].primitive}}var Wp=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,go=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),a0={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Gp={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class yo{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 G8(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new U("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new bt("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(yo.endOfExpression.indexOf(i.text)!==-1||t&&i.text===t||e&&Kr[i.text]&&Kr[i.text].infix)break;var s=this.parseAtom(t);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n,i=0;i<e.length;i++)if(e[i].type==="infix"){if(t!==-1)throw new U("only one infix operator per group",e[i].token);t=i,n=e[i].replaceWith}if(t!==-1&&n){var s,o,a=e.slice(0,t),l=e.slice(t+1);a.length===1&&a[0].type==="ordgroup"?s=a[0]:s={type:"ordgroup",mode:this.mode,body:a},l.length===1&&l[0].type==="ordgroup"?o=l[0]:o={type:"ordgroup",mode:this.mode,body:l};var c;return n==="\\\\abovefrac"?c=this.callFunction(n,[s,e[t],o],[]):c=this.callFunction(n,[s,o],[]),[c]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var i;do{var s;i=this.parseGroup(e)}while(((s=i)==null?void 0:s.type)==="internal");if(!i)throw new U("Expected group after '"+n+"'",t);return i}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t},s={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return s}parseAtom(e){var t=this.parseGroup("atom",e);if(t?.type==="internal"||this.mode==="text")return t;for(var n,i;;){this.consumeSpaces();var s=this.fetch();if(s.text==="\\limits"||s.text==="\\nolimits"){if(t&&t.type==="op"){var o=s.text==="\\limits";t.limits=o,t.alwaysHandleSupSub=!0}else if(t&&t.type==="operatorname")t.alwaysHandleSupSub&&(t.limits=s.text==="\\limits");else throw new U("Limit controls must follow a math operator",s);this.consume()}else if(s.text==="^"){if(n)throw new U("Double superscript",s);n=this.handleSupSubscript("superscript")}else if(s.text==="_"){if(i)throw new U("Double subscript",s);i=this.handleSupSubscript("subscript")}else if(s.text==="'"){if(n)throw new U("Double superscript",s);var a={type:"textord",mode:this.mode,text:"\\prime"},l=[a];for(this.consume();this.fetch().text==="'";)l.push(a),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:l}}else if(go[s.text]){var c=Wp.test(s.text),u=[];for(u.push(new bt(go[s.text])),this.consume();;){var d=this.fetch().text;if(!go[d]||Wp.test(d)!==c)break;u.unshift(new bt(go[d])),this.consume()}var h=this.subparse(u);c?i={type:"ordgroup",mode:"math",body:h}:n={type:"ordgroup",mode:"math",body:h}}else break}return n||i?{type:"supsub",mode:this.mode,base:t,sup:n,sub:i}:t}parseFunction(e,t){var n=this.fetch(),i=n.text,s=Kr[i];if(!s)return null;if(this.consume(),t&&t!=="atom"&&!s.allowedInArgument)throw new U("Got function '"+i+"' with no arguments"+(t?" as "+t:""),n);if(this.mode==="text"&&!s.allowedInText)throw new U("Can't use function '"+i+"' in text mode",n);if(this.mode==="math"&&s.allowedInMath===!1)throw new U("Can't use function '"+i+"' in math mode",n);var{args:o,optArgs:a}=this.parseArguments(i,s);return this.callFunction(i,o,a,n,e)}callFunction(e,t,n,i,s){var o={funcName:e,parser:this,token:i,breakOnTokenText:s},a=Kr[e];if(a&&a.handler)return a.handler(o,t,n);throw new U("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var i=[],s=[],o=0;o<n;o++){var a=t.argTypes&&t.argTypes[o],l=o<t.numOptionalArgs;(t.primitive&&a==null||t.type==="sqrt"&&o===1&&s[0]==null)&&(a="primitive");var c=this.parseGroupOfType("argument to '"+e+"'",a,l);if(l)s.push(c);else if(c!=null)i.push(c);else throw new U("Null argument, please report this as a bug")}return{args:i,optArgs:s}}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 i=this.parseArgumentGroup(n,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var s=this.parseStringGroup("raw",n);return s!=null?{type:"raw",mode:"text",string:s.text}:null}case"primitive":{if(n)throw new U("A primitive argument cannot be optional");var o=this.parseGroup(e);if(o==null)throw new U("Expected group as "+e,this.fetch());return o}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new U("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var i="",s;(s=this.fetch()).text!=="EOF";)i+=s.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,t){for(var n=this.fetch(),i=n,s="",o;(o=this.fetch()).text!=="EOF"&&e.test(s+o.text);)i=o,s+=i.text,this.consume();if(s==="")throw new U("Invalid "+t+": '"+n.text+"'",n);return n.range(i,s)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new U("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):t=this.parseStringGroup("size",e),!t)return null;!e&&t.text.length===0&&(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new U("Invalid size: '"+t.text+"'",t);var s={number:+(i[1]+i[2]),unit:i[3]};if(!Ef(s))throw new U("Invalid unit: '"+s.unit+"'",t);return{type:"size",mode:this.mode,value:s,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),t==null)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(n==null)return null;var i=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var s=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:n.loc,body:s};return t&&this.switchMode(i),o}parseGroup(e,t){var n=this.fetch(),i=n.text,s;if(i==="{"||i==="\\begingroup"){this.consume();var o=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:dt.range(n,l),body:a,semisimple:i==="\\begingroup"||void 0}}else if(s=this.parseFunction(t,e)||this.parseSymbol(),s==null&&i[0]==="\\"&&!Up.hasOwnProperty(i)){if(this.settings.throwOnError)throw new U("Undefined control sequence: "+i,n);s=this.formatUnsupportedCmd(i),this.consume()}return s}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var i=e[n],s=i.text;s==="-"&&e[n+1].text==="-"&&(n+1<t&&e[n+2].text==="-"?(e.splice(n,3,{type:"textord",mode:"text",loc:dt.range(i,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:dt.range(i,e[n+1]),text:"--"}),t-=1)),(s==="'"||s==="`")&&e[n+1].text===s&&(e.splice(n,2,{type:"textord",mode:"text",loc:dt.range(i,e[n+1]),text:s+s}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),i=n.charAt(0)==="*";if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new U(`\\verb assertion failed --
386
386
  please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}Gp.hasOwnProperty(t[0])&&!Ee[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Gp[t[0]]+t.slice(1));var s=_8.exec(t);s&&(t=t.substring(0,s.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var o;if(Ee[this.mode][t]){this.settings.strict&&this.mode==="math"&&Dl.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a=Ee[this.mode][t].group,l=dt.range(e),c;if(Pv.hasOwnProperty(a)){var u=a;c={type:"atom",mode:this.mode,family:u,loc:l,text:t}}else c={type:a,mode:this.mode,loc:l,text:t};o=c}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Sf(t.charCodeAt(0))?this.mode==="math"&&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:dt.range(e),text:t};else return null;if(this.consume(),s)for(var d=0;d<s[0].length;d++){var h=s[0][d];if(!a0[h])throw new U("Unknown accent ' "+h+"'",e);var f=a0[h][this.mode]||a0[h].text;if(!f)throw new U("Accent "+h+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:dt.range(e),label:f,isStretchy:!1,isShifty:!0,base:o}}return o}}yo.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var l0=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new yo(e,t);delete n.gullet.macros.current["\\df@tag"];var i=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 U("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new bt("\\df@tag")])}]}return i},Kp=function(e,t,n){t.textContent="";var i=c0(e,n).toNode();t.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Kp=function(){throw new U("KaTeX doesn't work in quirks mode.")});var K8=function(e,t){var n=c0(e,t).toMarkup();return n},J8=function(e,t){var n=new xl(t);return l0(e,n)},Jp=function(e,t,n){if(n.throwOnError||!(e instanceof U))throw e;var i=R.makeSpan(["katex-error"],[new Ot(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},c0=function(e,t){var n=new xl(t);try{var i=l0(e,n);return i8(i,e,n)}catch(s){return Jp(s,e,n)}},X8=function(e,t){var n=new xl(t);try{var i=l0(e,n);return s8(i,e,n)}catch(s){return Jp(s,e,n)}},Y8="0.16.27",Z8={Span:Pi,Anchor:Cl,SymbolNode:Ot,SvgNode:dr,PathNode:jr,LineNode:El},Wn={version:Y8,render:Kp,renderToString:K8,ParseError:U,SETTINGS_SCHEMA:Ks,__parse:J8,__renderToDomTree:c0,__renderToHTMLTree:X8,__setFontMetrics:Ev,__defineSymbol:p,__defineFunction:Z,__defineMacro:S,__domTree:Z8};const Q8=we.create({name:"m",content:"text*",group:"inline math",inline:!0,parseHTML(){return[{tag:"m"}]},renderHTML({HTMLAttributes:r}){return["span",ye({class:"inlineMath"},r)]},addNodeView(){return({node:r,HTMLAttributes:e})=>{const t=document.createElement("span");t.classList.add("node-view","math"),Object.entries(e).forEach(([a,l])=>{t.setAttribute(a,l)});const n=document.createElement("span"),i=document.createElement("span"),s=r.textContent.trim();return n.classList.add("katex-rendered"),n.innerHTML=Wn.renderToString(s,{throwOnError:!1}),n.contentEditable="false",n.style.pointerEvents="none",i.classList.add("edit-math"),i.classList.add("is-editable"),i.innerHTML="<m>"+r.textContent+"</m>",i.contentEditable="true",i.draggable=!1,new MutationObserver(()=>{const a=i.textContent||"";n.innerHTML=Wn.renderToString(a,{throwOnError:!1})}).observe(i,{characterData:!0,subtree:!0}),i.addEventListener("focus",()=>{t.classList.add("has-focus")}),i.addEventListener("blur",()=>{t.classList.remove("has-focus")}),t.appendChild(i),t.appendChild(n),{dom:t,contentDOM:i}}}}),eb=we.create({name:"me",content:"text*",group:"inline math",inline:!0,parseHTML(){return[{tag:"me"}]},renderHTML({HTMLAttributes:r}){return["div",ye({class:"displayMath"},r)]},addNodeView(){return({node:r,HTMLAttributes:e})=>{const t=document.createElement("div");t.classList.add("node-view","math"),t.classList.add("display"),Object.entries(e).forEach(([a,l])=>{t.setAttribute(a,l)});const n=document.createElement("span"),i=document.createElement("span"),s=r.textContent.trim();return n.classList.add("katex-rendered"),n.innerHTML=Wn.renderToString(s,{throwOnError:!1}),n.contentEditable="false",n.style.pointerEvents="none",i.classList.add("edit-math"),i.classList.add("is-editable"),i.contentEditable="true",i.innerHTML="<md>"+r.textContent+"</md>",i.draggable=!1,new MutationObserver(()=>{const a=i.textContent||"";n.innerHTML=Wn.renderToString(a,{throwOnError:!1})}).observe(i,{characterData:!0,subtree:!0}),i.addEventListener("focus",()=>{t.classList.add("has-focus")}),i.addEventListener("blur",()=>{t.classList.remove("has-focus")}),t.appendChild(i),t.appendChild(n),{dom:t,contentDOM:i}}}}),tb=we.create({name:"md",content:"text*",group:"inline math",inline:!0,parseHTML(){return[{tag:"md"}]},renderHTML({HTMLAttributes:r}){return["div",ye({class:"displayMath"},r)]},addNodeView(){return({node:r,HTMLAttributes:e})=>{const t=document.createElement("div");t.classList.add("node-view","math"),t.classList.add("display"),Object.entries(e).forEach(([a,l])=>{t.setAttribute(a,l)});const n=document.createElement("span"),i=document.createElement("span"),s=r.textContent.trim();return n.classList.add("katex-rendered"),n.innerHTML=Wn.renderToString(s,{throwOnError:!1}),n.contentEditable="false",n.style.pointerEvents="none",i.classList.add("edit-math"),i.classList.add("is-editable"),i.innerHTML="<md>"+r.textContent+"</md>",i.contentEditable="true",i.draggable=!1,new MutationObserver(()=>{const a=i.textContent||"";n.innerHTML=Wn.renderToString(a,{throwOnError:!1})}).observe(i,{characterData:!0,subtree:!0}),i.addEventListener("focus",()=>{t.classList.add("has-focus")}),i.addEventListener("blur",()=>{t.classList.remove("has-focus")}),t.appendChild(i),t.appendChild(n),{dom:t,contentDOM:i}}}}),rb=we.create({name:"ptxdoc",content:"title? (BasicBlock|block|rawptx|division)*",group:"root",selectable:!1,draggable:!1,defining:!1,parseHTML(){return[{tag:"ptxdoc"}]},renderHTML({HTMLAttributes:r}){return["article",ye({class:"ptxdoc",label:"ptxdoc"},r),0]}}),nb=we.create({name:"introduction",content:"(BasicBlock|block|rawptx)*",group:"division introduction",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:"introduction"}]},renderHTML({HTMLAttributes:r}){return["article",ye({class:"introduction",label:"introduction"},r),0]},addInputRules(){return[it({find:new RegExp("^#intro\\s$"),type:this.type})]}}),ib=we.create({name:"part",content:"title ((introduction?|chapter+)|(BasicBlock|block|rawptx)+)",group:"division",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:"part"}]},renderHTML({HTMLAttributes:r}){return["section",ye({class:"part",ptxtag:"part"},r),0]},addInputRules(){return[it({find:new RegExp("^#part\\s$"),type:this.type})]}}),sb=we.create({name:"chapter",content:"title ((introduction?|section+)|(BasicBlock|block|rawptx)+)",group:"division",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:"chapter"}]},renderHTML({HTMLAttributes:r}){return["section",ye({class:"chapter",ptxtag:"chapter"},r),0]},addInputRules(){return[it({find:new RegExp("^#ch\\s$"),type:this.type})]}}),ob=we.create({name:"section",content:"title ((introduction?|subsection+)|(BasicBlock|block|rawptx)+)",group:"division",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:"section"}]},renderHTML({HTMLAttributes:r}){return["section",ye({class:"section",ptxtag:"section"},r),0]},addInputRules(){return[it({find:new RegExp("^#sec\\s$"),type:this.type})]}}),ab=we.create({name:"subsection",content:"title (BasicBlock|block|rawptx)+",group:"division",selectable:!1,draggable:!0,defining:!1,parseHTML(){return[{tag:"subsection"}]},addAttributes(){return{label:{default:null,parseHTML:r=>r.getAttribute("label")},"xml:id":{parseHTML:r=>r.getAttribute("xml:id")}}},renderHTML({HTMLAttributes:r}){return["section",ye({class:"subsection",ptxtag:"subsection"},r),0]},addInputRules(){return[it({find:new RegExp("^#subsec\\s$"),type:this.type})]}}),lb=we.create({name:"worksheet",content:"title? ((introduction?)|(BasicBlock|block|rawptx)+)",group:"division",selectable:!1,draggable:!0,defining:!1,parseHTML(){return[{tag:"worksheet"}]},addAttributes(){return{label:{default:null,parseHTML:r=>r.getAttribute("label")},"xml:id":{parseHTML:r=>r.getAttribute("xml:id")}}},renderHTML({HTMLAttributes:r}){return["section",ye({class:"worksheet",ptxtag:"worksheet"},r),0]},addInputRules(){return[it({find:new RegExp("^#ws\\s$"),type:this.type})]}}),cb=Se.create({name:"divisions",addExtensions(){return[nb,ib,sb,ob,ab,lb,rb]}});var ub=we.create({name:"text",group:"inline",parseMarkdown:r=>({type:"text",text:r.text||""}),renderMarkdown:r=>r.text||""}),db=we.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:r}){return["br",ye(this.options.HTMLAttributes,r)]},renderText(){return`
387
387
  `},renderMarkdown:()=>`
388
- `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=n.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&o){const d=l.filter(h=>a.includes(h.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});const hb=ub.extend({}),fb=db.extend({}),pb=Ni.create({name:"term",group:"inline",parseHTML(){return[{tag:"term"}]},renderHTML({HTMLAttributes:r}){return["span",ye({class:"term"},r),0]},addInputRules(){return[$r({find:/(?:^|\s)(<term>(.*?)<\/term>)$/,type:this.type}),$r({find:/(?:^|\s)(_(.*?)_)$/,type:this.type})]},addPasteRules(){return[Hs({find:/(?:^|\s)(<term>(.*?)<\/term>)/g,type:this.type})]}}),mb=Ni.create({name:"em",group:"inline",parseHTML(){return[{tag:"em"}]},renderHTML({HTMLAttributes:r}){return["span",ye({class:"em"},r),0]},addInputRules(){return[$r({find:/(?:^|\s)(<em>(.*?)<\/em>)$/,type:this.type}),$r({find:/(?:^|\s)(\*(.*?)\*)$/,type:this.type})]},addPasteRules(){return[Hs({find:/(?:^|\s)(<em>(.*?)<\/em>)/g,type:this.type})]}}),gb=Ni.create({name:"alert",group:"inline",parseHTML(){return[{tag:"alert"}]},renderHTML({HTMLAttributes:r}){return["span",ye({class:"alert"},r),0]},addInputRules(){return[$r({find:/(?:^|\s)(<alert>(.*?)<\/alert>)$/,type:this.type}),$r({find:/(?:^|\s)(\*\*(.*?)\*\*)$/,type:this.type})]},addPasteRules(){return[Hs({find:/(?:^|\s)(<alert>(.*?)<\/alert>)/g,type:this.type})]}}),yb=Ni.create({name:"c",group:"inline",parseHTML(){return[{tag:"c"}]},renderHTML({HTMLAttributes:r}){return["span",ye({class:"c"},r),0]},addInputRules(){return[$r({find:/(?:^|\s)(<c>(.*?)<\/c>)$/,type:this.type}),$r({find:/(?:^|\s)(\*\*(.*?)\*\*)$/,type:this.type})]},addPasteRules(){return[Hs({find:/(?:^|\s)(<c>(.*?)<\/c>)/g,type:this.type})]}}),vb=Se.create({name:"myinline",addExtensions(){return[hb,fb,pb,mb,gb,yb]}}),Hi=r=>{const e=r.node.type.name.charAt(0).toUpperCase()+r.node.type.name.slice(1);return J.jsxs(nf,{className:"block-component",ptxtag:r.node.type.name,children:[J.jsxs("div",{className:"block-title",children:[e,"."]}),J.jsx(rf,{className:"thm-component-content"})]})},Xp=()=>J.jsxs(nf,{className:"proof",ptxtag:"proof",children:[J.jsx("div",{className:"block-title",children:"Proof."}),J.jsx(rf,{className:"thm-component-content"})]});var u0,Yp;function bb(){if(Yp)return u0;Yp=1;var r=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i=(C,w)=>{for(var z in w)r(C,z,{get:w[z],enumerable:!0})},s=(C,w,z,L)=>{if(w&&typeof w=="object"||typeof w=="function")for(let B of t(w))!n.call(C,B)&&B!==z&&r(C,B,{get:()=>w[B],enumerable:!(L=e(w,B))||L.enumerable});return C},o=C=>s(r({},"__esModule",{value:!0}),C),a={};i(a,{XmlCdata:()=>$,XmlComment:()=>F,XmlDeclaration:()=>q,XmlDocument:()=>Y,XmlDocumentType:()=>he,XmlElement:()=>te,XmlError:()=>Q,XmlNode:()=>O,XmlProcessingInstruction:()=>W,XmlText:()=>A,parseXml:()=>Ae}),u0=o(a);var l="",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=class{constructor(C){if(this.k=this.u(C,!0),this.d=0,this.length=C.length,this.l=this.k!==this.length,this.h=C,this.l){let w=[];for(let z=0,L=0;L<this.k;++L)w[L]=z,z+=C.codePointAt(z)>65535?2:1;this.A=w}}get B(){return this.d>=this.k}u(C,w=this.l){return w?C.replace(c,"_").length:C.length}p(C=1){this.d=Math.min(this.k,this.d+C)}f(C=this.d){var w;return this.l?(w=this.A[C])!=null?w:1/0:C}G(C=1){let w=this.m(C);return this.p(C),w}v(C){let w=this.f(),z=this.h.slice(w,w+C);return this.p(this.u(z)),z}w(C){let{length:w,l:z,h:L}=this,B=this.f(),K=B;if(z)for(;K<w;){let re=L[K],j=re>="\uD800"&&re<="\uDBFF";if(j&&(re+=L[K+1]),!C(re))break;K+=j?2:1}else for(;K<w&&C(L[K]);)++K;return this.v(K-B)}b(C){let{length:w}=C,z=this.f();return C===this.h.slice(z,z+w)?(this.p(w===1?1:this.u(C)),C):l}x(C){let w=this.h.slice(this.f()).search(C);return w>0?this.v(w):l}s(C){let w=this.f(),z=this.h.indexOf(C,w);return z>0?this.v(z-w):l}m(C=1){let{d:w,h:z}=this;return this.l?z.slice(this.f(w),this.f(w+C)):z.slice(w,w+C)}n(C=0){this.d=C>=0?Math.min(this.k,C):Math.max(0,this.d+C)}},d=/["&<]/,h=/['&<]/,f=/\r\n|[\n\r\t]/g,m=/<|&|]]>/,y=Object.freeze(Object.assign(Object.create(null),{amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}));function v(C){let w=C.codePointAt(0);return w>=97&&w<=122||w>=65&&w<=90||w>=48&&w<=57||w===45||w===46||w===183||w>=768&&w<=879||w===8255||w===8256||x(C,w)}function x(C,w=C.codePointAt(0)){return w>=97&&w<=122||w>=65&&w<=90||w===58||w===95||w>=192&&w<=214||w>=216&&w<=246||w>=248&&w<=767||w>=880&&w<=893||w>=895&&w<=8191||w===8204||w===8205||w>=8304&&w<=8591||w>=11264&&w<=12271||w>=12289&&w<=55295||w>=63744&&w<=64975||w>=65008&&w<=65533||w>=65536&&w<=983039}function T(C){return C==="#"||v(C)}function D(C){let w=C.codePointAt(0);return w===32||w===9||w===10||w===13}function P(C){return C>=32&&C<=55295||C===10||C===9||C===13||C>=57344&&C<=65533||C>=65536&&C<=1114111}var N=class b1{constructor(){this.parent=null,this.start=-1,this.end=-1}get document(){var w,z;return(z=(w=this.parent)==null?void 0:w.document)!=null?z:null}get isRootNode(){return this.parent!==null&&this.parent===this.document&&this.type===b1.TYPE_ELEMENT}get preserveWhitespace(){var w;return!!((w=this.parent)!=null&&w.preserveWhitespace)}get type(){return""}toJSON(){let w={type:this.type};return this.isRootNode&&(w.isRootNode=!0),this.preserveWhitespace&&(w.preserveWhitespace=!0),this.start!==-1&&(w.start=this.start,w.end=this.end),w}};N.TYPE_CDATA="cdata",N.TYPE_COMMENT="comment",N.TYPE_DOCUMENT="document",N.TYPE_DOCUMENT_TYPE="doctype",N.TYPE_ELEMENT="element",N.TYPE_PROCESSING_INSTRUCTION="pi",N.TYPE_TEXT="text",N.TYPE_XML_DECLARATION="xmldecl";var O=N,A=class extends O{constructor(C=""){super(),this.text=C}get type(){return O.TYPE_TEXT}toJSON(){return Object.assign(O.prototype.toJSON.call(this),{text:this.text})}},$=class extends A{get type(){return O.TYPE_CDATA}},F=class extends O{constructor(C=""){super(),this.content=C}get type(){return O.TYPE_COMMENT}toJSON(){return Object.assign(O.prototype.toJSON.call(this),{content:this.content})}},q=class extends O{constructor(C,w,z){super(),this.version=C,this.encoding=w??null,this.standalone=z??null}get type(){return O.TYPE_XML_DECLARATION}toJSON(){let C=O.prototype.toJSON.call(this);C.version=this.version;for(let w of["encoding","standalone"])this[w]!==null&&(C[w]=this[w]);return C}},te=class x1 extends O{constructor(w,z=Object.create(null),L=[]){super(),this.name=w,this.attributes=z,this.children=L}get isEmpty(){return this.children.length===0}get preserveWhitespace(){let w=this;for(;w instanceof x1;){if("xml:space"in w.attributes)return w.attributes["xml:space"]==="preserve";w=w.parent}return!1}get text(){return this.children.map(w=>"text"in w?w.text:"").join("")}get type(){return O.TYPE_ELEMENT}toJSON(){return Object.assign(O.prototype.toJSON.call(this),{name:this.name,attributes:this.attributes,children:this.children.map(w=>w.toJSON())})}},Y=class extends O{constructor(C=[]){super(),this.children=C}get document(){return this}get root(){for(let C of this.children)if(C instanceof te)return C;return null}get text(){return this.children.map(C=>"text"in C?C.text:"").join("")}get type(){return O.TYPE_DOCUMENT}toJSON(){return Object.assign(O.prototype.toJSON.call(this),{children:this.children.map(C=>C.toJSON())})}},he=class extends O{constructor(C,w,z,L){super(),this.name=C,this.publicId=w??null,this.systemId=z??null,this.internalSubset=L??null}get type(){return O.TYPE_DOCUMENT_TYPE}toJSON(){let C=O.prototype.toJSON.call(this);C.name=this.name;for(let w of["publicId","systemId","internalSubset"])this[w]!==null&&(C[w]=this[w]);return C}},Q=class extends Error{constructor(C,w,z){let L=1,B="",K=1;for(let ie=0;ie<w;++ie){let me=z[ie];me===`
389
- `?(L=1,B="",K+=1):(L+=1,B+=me)}let re=z.indexOf(`
390
- `,w);B+=re===-1?z.slice(w):z.slice(w,re);let j=0;B.length>50&&(L<40?B=B.slice(0,50):(j=L-20,B=B.slice(j,L+30))),super(`${C} (line ${K}, column ${L})
388
+ `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=n.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&o){const d=l.filter(h=>a.includes(h.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});const hb=ub.extend({}),fb=db.extend({}),pb=Ni.create({name:"term",group:"inline",parseHTML(){return[{tag:"term"}]},renderHTML({HTMLAttributes:r}){return["span",ye({class:"term"},r),0]},addInputRules(){return[$r({find:/(?:^|\s)(<term>(.*?)<\/term>)$/,type:this.type}),$r({find:/(?:^|\s)(_(.*?)_)$/,type:this.type})]},addPasteRules(){return[Hs({find:/(?:^|\s)(<term>(.*?)<\/term>)/g,type:this.type})]}}),mb=Ni.create({name:"em",group:"inline",parseHTML(){return[{tag:"em"}]},renderHTML({HTMLAttributes:r}){return["span",ye({class:"em"},r),0]},addInputRules(){return[$r({find:/(?:^|\s)(<em>(.*?)<\/em>)$/,type:this.type}),$r({find:/(?:^|\s)(\*(.*?)\*)$/,type:this.type})]},addPasteRules(){return[Hs({find:/(?:^|\s)(<em>(.*?)<\/em>)/g,type:this.type})]}}),gb=Ni.create({name:"alert",group:"inline",parseHTML(){return[{tag:"alert"}]},renderHTML({HTMLAttributes:r}){return["span",ye({class:"alert"},r),0]},addInputRules(){return[$r({find:/(?:^|\s)(<alert>(.*?)<\/alert>)$/,type:this.type}),$r({find:/(?:^|\s)(\*\*(.*?)\*\*)$/,type:this.type})]},addPasteRules(){return[Hs({find:/(?:^|\s)(<alert>(.*?)<\/alert>)/g,type:this.type})]}}),yb=Ni.create({name:"c",group:"inline",parseHTML(){return[{tag:"c"}]},renderHTML({HTMLAttributes:r}){return["span",ye({class:"c"},r),0]},addInputRules(){return[$r({find:/(?:^|\s)(<c>(.*?)<\/c>)$/,type:this.type}),$r({find:/(?:^|\s)(\*\*(.*?)\*\*)$/,type:this.type})]},addPasteRules(){return[Hs({find:/(?:^|\s)(<c>(.*?)<\/c>)/g,type:this.type})]}}),vb=Se.create({name:"myinline",addExtensions(){return[hb,fb,pb,mb,gb,yb]}}),Hi=r=>{const e=r.node.type.name.charAt(0).toUpperCase()+r.node.type.name.slice(1);return J.jsxs(nf,{className:"block-component",ptxtag:r.node.type.name,children:[J.jsxs("div",{className:"block-title",children:[e,"."]}),J.jsx(rf,{className:"thm-component-content"})]})},Xp=()=>J.jsxs(nf,{className:"proof",ptxtag:"proof",children:[J.jsx("div",{className:"block-title",children:"Proof."}),J.jsx(rf,{className:"thm-component-content"})]});var u0,Yp;function bb(){if(Yp)return u0;Yp=1;var r=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i=(C,w)=>{for(var I in w)r(C,I,{get:w[I],enumerable:!0})},s=(C,w,I,L)=>{if(w&&typeof w=="object"||typeof w=="function")for(let B of t(w))!n.call(C,B)&&B!==I&&r(C,B,{get:()=>w[B],enumerable:!(L=e(w,B))||L.enumerable});return C},o=C=>s(r({},"__esModule",{value:!0}),C),a={};i(a,{XmlCdata:()=>$,XmlComment:()=>F,XmlDeclaration:()=>q,XmlDocument:()=>Y,XmlDocumentType:()=>he,XmlElement:()=>te,XmlError:()=>Q,XmlNode:()=>O,XmlProcessingInstruction:()=>W,XmlText:()=>A,parseXml:()=>Ae}),u0=o(a);var l="",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=class{constructor(C){if(this.k=this.u(C,!0),this.d=0,this.length=C.length,this.l=this.k!==this.length,this.h=C,this.l){let w=[];for(let I=0,L=0;L<this.k;++L)w[L]=I,I+=C.codePointAt(I)>65535?2:1;this.A=w}}get B(){return this.d>=this.k}u(C,w=this.l){return w?C.replace(c,"_").length:C.length}p(C=1){this.d=Math.min(this.k,this.d+C)}f(C=this.d){var w;return this.l?(w=this.A[C])!=null?w:1/0:C}G(C=1){let w=this.m(C);return this.p(C),w}v(C){let w=this.f(),I=this.h.slice(w,w+C);return this.p(this.u(I)),I}w(C){let{length:w,l:I,h:L}=this,B=this.f(),K=B;if(I)for(;K<w;){let re=L[K],j=re>="\uD800"&&re<="\uDBFF";if(j&&(re+=L[K+1]),!C(re))break;K+=j?2:1}else for(;K<w&&C(L[K]);)++K;return this.v(K-B)}b(C){let{length:w}=C,I=this.f();return C===this.h.slice(I,I+w)?(this.p(w===1?1:this.u(C)),C):l}x(C){let w=this.h.slice(this.f()).search(C);return w>0?this.v(w):l}s(C){let w=this.f(),I=this.h.indexOf(C,w);return I>0?this.v(I-w):l}m(C=1){let{d:w,h:I}=this;return this.l?I.slice(this.f(w),this.f(w+C)):I.slice(w,w+C)}n(C=0){this.d=C>=0?Math.min(this.k,C):Math.max(0,this.d+C)}},d=/["&<]/,h=/['&<]/,f=/\r\n|[\n\r\t]/g,m=/<|&|]]>/,y=Object.freeze(Object.assign(Object.create(null),{amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}));function v(C){let w=C.codePointAt(0);return w>=97&&w<=122||w>=65&&w<=90||w>=48&&w<=57||w===45||w===46||w===183||w>=768&&w<=879||w===8255||w===8256||x(C,w)}function x(C,w=C.codePointAt(0)){return w>=97&&w<=122||w>=65&&w<=90||w===58||w===95||w>=192&&w<=214||w>=216&&w<=246||w>=248&&w<=767||w>=880&&w<=893||w>=895&&w<=8191||w===8204||w===8205||w>=8304&&w<=8591||w>=11264&&w<=12271||w>=12289&&w<=55295||w>=63744&&w<=64975||w>=65008&&w<=65533||w>=65536&&w<=983039}function T(C){return C==="#"||v(C)}function D(C){let w=C.codePointAt(0);return w===32||w===9||w===10||w===13}function P(C){return C>=32&&C<=55295||C===10||C===9||C===13||C>=57344&&C<=65533||C>=65536&&C<=1114111}var N=class b1{constructor(){this.parent=null,this.start=-1,this.end=-1}get document(){var w,I;return(I=(w=this.parent)==null?void 0:w.document)!=null?I:null}get isRootNode(){return this.parent!==null&&this.parent===this.document&&this.type===b1.TYPE_ELEMENT}get preserveWhitespace(){var w;return!!((w=this.parent)!=null&&w.preserveWhitespace)}get type(){return""}toJSON(){let w={type:this.type};return this.isRootNode&&(w.isRootNode=!0),this.preserveWhitespace&&(w.preserveWhitespace=!0),this.start!==-1&&(w.start=this.start,w.end=this.end),w}};N.TYPE_CDATA="cdata",N.TYPE_COMMENT="comment",N.TYPE_DOCUMENT="document",N.TYPE_DOCUMENT_TYPE="doctype",N.TYPE_ELEMENT="element",N.TYPE_PROCESSING_INSTRUCTION="pi",N.TYPE_TEXT="text",N.TYPE_XML_DECLARATION="xmldecl";var O=N,A=class extends O{constructor(C=""){super(),this.text=C}get type(){return O.TYPE_TEXT}toJSON(){return Object.assign(O.prototype.toJSON.call(this),{text:this.text})}},$=class extends A{get type(){return O.TYPE_CDATA}},F=class extends O{constructor(C=""){super(),this.content=C}get type(){return O.TYPE_COMMENT}toJSON(){return Object.assign(O.prototype.toJSON.call(this),{content:this.content})}},q=class extends O{constructor(C,w,I){super(),this.version=C,this.encoding=w??null,this.standalone=I??null}get type(){return O.TYPE_XML_DECLARATION}toJSON(){let C=O.prototype.toJSON.call(this);C.version=this.version;for(let w of["encoding","standalone"])this[w]!==null&&(C[w]=this[w]);return C}},te=class x1 extends O{constructor(w,I=Object.create(null),L=[]){super(),this.name=w,this.attributes=I,this.children=L}get isEmpty(){return this.children.length===0}get preserveWhitespace(){let w=this;for(;w instanceof x1;){if("xml:space"in w.attributes)return w.attributes["xml:space"]==="preserve";w=w.parent}return!1}get text(){return this.children.map(w=>"text"in w?w.text:"").join("")}get type(){return O.TYPE_ELEMENT}toJSON(){return Object.assign(O.prototype.toJSON.call(this),{name:this.name,attributes:this.attributes,children:this.children.map(w=>w.toJSON())})}},Y=class extends O{constructor(C=[]){super(),this.children=C}get document(){return this}get root(){for(let C of this.children)if(C instanceof te)return C;return null}get text(){return this.children.map(C=>"text"in C?C.text:"").join("")}get type(){return O.TYPE_DOCUMENT}toJSON(){return Object.assign(O.prototype.toJSON.call(this),{children:this.children.map(C=>C.toJSON())})}},he=class extends O{constructor(C,w,I,L){super(),this.name=C,this.publicId=w??null,this.systemId=I??null,this.internalSubset=L??null}get type(){return O.TYPE_DOCUMENT_TYPE}toJSON(){let C=O.prototype.toJSON.call(this);C.name=this.name;for(let w of["publicId","systemId","internalSubset"])this[w]!==null&&(C[w]=this[w]);return C}},Q=class extends Error{constructor(C,w,I){let L=1,B="",K=1;for(let ie=0;ie<w;++ie){let me=I[ie];me===`
389
+ `?(L=1,B="",K+=1):(L+=1,B+=me)}let re=I.indexOf(`
390
+ `,w);B+=re===-1?I.slice(w):I.slice(w,re);let j=0;B.length>50&&(L<40?B=B.slice(0,50):(j=L-20,B=B.slice(j,L+30))),super(`${C} (line ${K}, column ${L})
391
391
  ${B}
392
392
  `+" ".repeat(L-j+1)+`^
393
- `),this.column=L,this.excerpt=B,this.line=K,this.name="XmlError",this.pos=w}},W=class extends O{constructor(C,w=""){super(),this.name=C,this.content=w}get type(){return O.TYPE_PROCESSING_INSTRUCTION}toJSON(){return Object.assign(O.prototype.toJSON.call(this),{name:this.name,content:this.content})}},ne="",ve=class{constructor(C,w={}){let z=this.document=new Y;this.j=z,this.g=w,this.c=new u(C),this.g.includeOffsets&&(z.start=0,z.end=C.length),this.parse()}i(C,w){return C.parent=this.j,this.g.includeOffsets&&(C.start=this.c.f(w),C.end=this.c.f()),this.j.children.push(C),!0}y(C,w){let{children:z}=this.j,{length:L}=z;if(C=ge(C),L>0){let B=z[L-1];if(B?.type===O.TYPE_TEXT){let K=B;return K.text+=C,this.g.includeOffsets&&(K.end=this.c.f()),!0}}return this.i(new A(C),w)}H(){let C=Object.create(null);for(;this.e();){let w=this.q();if(!w)break;let z=this.t()&&this.I();if(z===!1)throw this.a("Attribute value expected");if(w in C)throw this.a(`Duplicate attribute: ${w}`);if(w==="xml:space"&&z!=="default"&&z!=="preserve")throw this.a('Value of the `xml:space` attribute must be "default" or "preserve"');C[w]=z}if(this.g.sortAttributes){let w=Object.keys(C).sort(),z=Object.create(null);for(let L=0;L<w.length;++L){let B=w[L];z[B]=C[B]}C=z}return C}I(){let{c:C}=this,w=C.m();if(w!=='"'&&w!=="'")return!1;C.p();let z,L=!1,B=ne,K=w==='"'?d:h;e:for(;!C.B;)switch(z=C.x(K),z&&(this.o(z),B+=z.replace(f," ")),C.m()){case w:L=!0;break e;case"&":B+=this.C();continue;case"<":throw this.a("Unescaped `<` is not allowed in an attribute value");default:break e}if(!L)throw this.a("Unclosed attribute");return C.p(),B}J(){let{c:C}=this,w=C.d;if(!C.b("<![CDATA["))return!1;let z=C.s("]]>");if(this.o(z),!C.b("]]>"))throw this.a("Unclosed CDATA section");return this.g.preserveCdata?this.i(new $(ge(z)),w):this.y(z,w)}K(){let{c:C}=this,w=C.d,z=C.x(m);if(!z)return!1;if(this.o(z),C.m(3)==="]]>")throw this.a("Element content may not contain the CDATA section close delimiter `]]>`");return this.y(z,w)}D(){let{c:C}=this,w=C.d;if(!C.b("<!--"))return!1;let z=C.s("--");if(this.o(z),!C.b("-->"))throw C.m(2)==="--"?this.a("The string `--` isn't allowed inside a comment"):this.a("Unclosed comment");return this.g.preserveComments?this.i(new F(ge(z)),w):!0}L(){let C=this.c.d,w=this.C();return w?this.y(w,C):!1}M(){let{c:C}=this,w=C.d;if(!C.b("<!DOCTYPE"))return!1;let z=this.e()&&this.q();if(!z)throw this.a("Expected a name");let L,B;if(this.e()){if(C.b("PUBLIC")){if(L=this.e()&&this.N(),L===!1)throw this.a("Expected a public identifier");this.e()}if(L!==void 0||C.b("SYSTEM")){if(this.e(),B=this.r(),B===!1)throw this.a("Expected a system identifier");this.e()}}let K;if(C.b("[")){if(K=C.x(/\][\x20\t\r\n]*>/),!C.b("]"))throw this.a("Unclosed internal subset");this.e()}if(!C.b(">"))throw this.a("Unclosed doctype declaration");return this.g.preserveDocumentType?this.i(new he(z,L,B,K),w):!0}E(){let{c:C}=this,w=C.d;if(!C.b("<"))return!1;let z=this.q();if(!z)return C.n(w),!1;let L=this.H(),B=!!C.b("/>"),K=new te(z,L);if(K.parent=this.j,!B){if(!C.b(">"))throw this.a(`Unclosed start tag for element \`${z}\``);this.j=K;do this.K();while(this.E()||this.L()||this.J()||this.F()||this.D());let re=C.d,j;if(!C.b("</")||!(j=this.q())||j!==z)throw C.n(re),this.a(`Missing end tag for element ${z}`);if(this.e(),!C.b(">"))throw this.a(`Unclosed end tag for element ${z}`);this.j=K.parent}return this.i(K,w)}t(){return this.e(),this.c.b("=")?(this.e(),!0):!1}z(){return this.D()||this.F()||this.e()}q(){return x(this.c.m())?this.c.w(v):ne}F(){let{c:C}=this,w=C.d;if(!C.b("<?"))return!1;let z=this.q();if(z){if(z.toLowerCase()==="xml")throw C.n(w),this.a("XML declaration isn't allowed here")}else throw this.a("Invalid processing instruction");if(!this.e()){if(C.b("?>"))return this.i(new W(z),w);throw this.a("Whitespace is required after a processing instruction name")}let L=C.s("?>");if(this.o(L),!C.b("?>"))throw this.a("Unterminated processing instruction");return this.i(new W(z,ge(L)),w)}O(){let{c:C}=this,w=C.d;for(this.P();this.z(););if(this.M())for(;this.z(););return w<C.d}N(){let C=this.c.d,w=this.r();if(w!==!1&&!/^[-\x20\r\na-zA-Z0-9'()+,./:=?;!*#@$_%]*$/.test(w))throw this.c.n(C),this.a("Invalid character in public identifier");return w}C(){let{c:C}=this;if(!C.b("&"))return!1;let w=C.w(T);if(C.G()!==";")throw this.a("Unterminated reference (a reference must end with `;`)");let z;if(w[0]==="#"){let L=w[1]==="x"?parseInt(w.slice(2),16):parseInt(w.slice(1),10);if(isNaN(L))throw this.a("Invalid character reference");if(!P(L))throw this.a("Character reference resolves to an invalid character");z=String.fromCodePoint(L)}else if(z=y[w],z===void 0){let{ignoreUndefinedEntities:L,resolveUndefinedEntity:B}=this.g,K=`&${w};`;if(B){let re=B(K);if(re!=null){let j=typeof re;if(j!=="string")throw new TypeError(`\`resolveUndefinedEntity()\` must return a string, \`null\`, or \`undefined\`, but returned a value of type ${j}`);return re}}if(L)return K;throw C.n(-K.length),this.a(`Named entity isn't defined: ${K}`)}return z}r(){let{c:C}=this,w=C.b('"')||C.b("'");if(!w)return!1;let z=C.s(w);if(this.o(z),!C.b(w))throw this.a("Missing end quote");return z}e(){return!!this.c.w(D)}P(){let{c:C}=this,w=C.d;if(!C.b("<?xml"))return!1;if(!this.e())throw this.a("Invalid XML declaration");let z=!!C.b("version")&&this.t()&&this.r();if(z===!1)throw this.a("XML version is missing or invalid");if(!/^1\.[0-9]+$/.test(z))throw this.a("Invalid character in version number");let L,B;if(this.e()){if(L=!!C.b("encoding")&&this.t()&&this.r(),L){if(!/^[A-Za-z][\w.-]*$/.test(L))throw this.a("Invalid character in encoding name");this.e()}if(B=!!C.b("standalone")&&this.t()&&this.r(),B){if(B!=="yes"&&B!=="no")throw this.a('Only "yes" and "no" are permitted as values of `standalone`');this.e()}}if(!C.b("?>"))throw this.a("Invalid or unclosed XML declaration");return this.g.preserveXmlDeclaration?this.i(new q(z,L||void 0,B||void 0),w):!0}a(C){let{c:w}=this;return new Q(C,w.d,w.h)}parse(){if(this.c.b("\uFEFF"),this.O(),!this.E())throw this.a("Root element is missing or invalid");for(;this.z(););if(!this.c.B)throw this.a("Extra content at the end of the document")}o(C){let{length:w}=C;for(let z=0;z<w;++z){let L=C.codePointAt(z);if(!P(L))throw this.c.n(-([...C].length-z)),this.a("Invalid character");L>65535&&(z+=1)}}};function ge(C){let w=0;for(;(w=C.indexOf("\r",w))!==-1;)C=C[w+1]===`
393
+ `),this.column=L,this.excerpt=B,this.line=K,this.name="XmlError",this.pos=w}},W=class extends O{constructor(C,w=""){super(),this.name=C,this.content=w}get type(){return O.TYPE_PROCESSING_INSTRUCTION}toJSON(){return Object.assign(O.prototype.toJSON.call(this),{name:this.name,content:this.content})}},ne="",ve=class{constructor(C,w={}){let I=this.document=new Y;this.j=I,this.g=w,this.c=new u(C),this.g.includeOffsets&&(I.start=0,I.end=C.length),this.parse()}i(C,w){return C.parent=this.j,this.g.includeOffsets&&(C.start=this.c.f(w),C.end=this.c.f()),this.j.children.push(C),!0}y(C,w){let{children:I}=this.j,{length:L}=I;if(C=ge(C),L>0){let B=I[L-1];if(B?.type===O.TYPE_TEXT){let K=B;return K.text+=C,this.g.includeOffsets&&(K.end=this.c.f()),!0}}return this.i(new A(C),w)}H(){let C=Object.create(null);for(;this.e();){let w=this.q();if(!w)break;let I=this.t()&&this.I();if(I===!1)throw this.a("Attribute value expected");if(w in C)throw this.a(`Duplicate attribute: ${w}`);if(w==="xml:space"&&I!=="default"&&I!=="preserve")throw this.a('Value of the `xml:space` attribute must be "default" or "preserve"');C[w]=I}if(this.g.sortAttributes){let w=Object.keys(C).sort(),I=Object.create(null);for(let L=0;L<w.length;++L){let B=w[L];I[B]=C[B]}C=I}return C}I(){let{c:C}=this,w=C.m();if(w!=='"'&&w!=="'")return!1;C.p();let I,L=!1,B=ne,K=w==='"'?d:h;e:for(;!C.B;)switch(I=C.x(K),I&&(this.o(I),B+=I.replace(f," ")),C.m()){case w:L=!0;break e;case"&":B+=this.C();continue;case"<":throw this.a("Unescaped `<` is not allowed in an attribute value");default:break e}if(!L)throw this.a("Unclosed attribute");return C.p(),B}J(){let{c:C}=this,w=C.d;if(!C.b("<![CDATA["))return!1;let I=C.s("]]>");if(this.o(I),!C.b("]]>"))throw this.a("Unclosed CDATA section");return this.g.preserveCdata?this.i(new $(ge(I)),w):this.y(I,w)}K(){let{c:C}=this,w=C.d,I=C.x(m);if(!I)return!1;if(this.o(I),C.m(3)==="]]>")throw this.a("Element content may not contain the CDATA section close delimiter `]]>`");return this.y(I,w)}D(){let{c:C}=this,w=C.d;if(!C.b("<!--"))return!1;let I=C.s("--");if(this.o(I),!C.b("-->"))throw C.m(2)==="--"?this.a("The string `--` isn't allowed inside a comment"):this.a("Unclosed comment");return this.g.preserveComments?this.i(new F(ge(I)),w):!0}L(){let C=this.c.d,w=this.C();return w?this.y(w,C):!1}M(){let{c:C}=this,w=C.d;if(!C.b("<!DOCTYPE"))return!1;let I=this.e()&&this.q();if(!I)throw this.a("Expected a name");let L,B;if(this.e()){if(C.b("PUBLIC")){if(L=this.e()&&this.N(),L===!1)throw this.a("Expected a public identifier");this.e()}if(L!==void 0||C.b("SYSTEM")){if(this.e(),B=this.r(),B===!1)throw this.a("Expected a system identifier");this.e()}}let K;if(C.b("[")){if(K=C.x(/\][\x20\t\r\n]*>/),!C.b("]"))throw this.a("Unclosed internal subset");this.e()}if(!C.b(">"))throw this.a("Unclosed doctype declaration");return this.g.preserveDocumentType?this.i(new he(I,L,B,K),w):!0}E(){let{c:C}=this,w=C.d;if(!C.b("<"))return!1;let I=this.q();if(!I)return C.n(w),!1;let L=this.H(),B=!!C.b("/>"),K=new te(I,L);if(K.parent=this.j,!B){if(!C.b(">"))throw this.a(`Unclosed start tag for element \`${I}\``);this.j=K;do this.K();while(this.E()||this.L()||this.J()||this.F()||this.D());let re=C.d,j;if(!C.b("</")||!(j=this.q())||j!==I)throw C.n(re),this.a(`Missing end tag for element ${I}`);if(this.e(),!C.b(">"))throw this.a(`Unclosed end tag for element ${I}`);this.j=K.parent}return this.i(K,w)}t(){return this.e(),this.c.b("=")?(this.e(),!0):!1}z(){return this.D()||this.F()||this.e()}q(){return x(this.c.m())?this.c.w(v):ne}F(){let{c:C}=this,w=C.d;if(!C.b("<?"))return!1;let I=this.q();if(I){if(I.toLowerCase()==="xml")throw C.n(w),this.a("XML declaration isn't allowed here")}else throw this.a("Invalid processing instruction");if(!this.e()){if(C.b("?>"))return this.i(new W(I),w);throw this.a("Whitespace is required after a processing instruction name")}let L=C.s("?>");if(this.o(L),!C.b("?>"))throw this.a("Unterminated processing instruction");return this.i(new W(I,ge(L)),w)}O(){let{c:C}=this,w=C.d;for(this.P();this.z(););if(this.M())for(;this.z(););return w<C.d}N(){let C=this.c.d,w=this.r();if(w!==!1&&!/^[-\x20\r\na-zA-Z0-9'()+,./:=?;!*#@$_%]*$/.test(w))throw this.c.n(C),this.a("Invalid character in public identifier");return w}C(){let{c:C}=this;if(!C.b("&"))return!1;let w=C.w(T);if(C.G()!==";")throw this.a("Unterminated reference (a reference must end with `;`)");let I;if(w[0]==="#"){let L=w[1]==="x"?parseInt(w.slice(2),16):parseInt(w.slice(1),10);if(isNaN(L))throw this.a("Invalid character reference");if(!P(L))throw this.a("Character reference resolves to an invalid character");I=String.fromCodePoint(L)}else if(I=y[w],I===void 0){let{ignoreUndefinedEntities:L,resolveUndefinedEntity:B}=this.g,K=`&${w};`;if(B){let re=B(K);if(re!=null){let j=typeof re;if(j!=="string")throw new TypeError(`\`resolveUndefinedEntity()\` must return a string, \`null\`, or \`undefined\`, but returned a value of type ${j}`);return re}}if(L)return K;throw C.n(-K.length),this.a(`Named entity isn't defined: ${K}`)}return I}r(){let{c:C}=this,w=C.b('"')||C.b("'");if(!w)return!1;let I=C.s(w);if(this.o(I),!C.b(w))throw this.a("Missing end quote");return I}e(){return!!this.c.w(D)}P(){let{c:C}=this,w=C.d;if(!C.b("<?xml"))return!1;if(!this.e())throw this.a("Invalid XML declaration");let I=!!C.b("version")&&this.t()&&this.r();if(I===!1)throw this.a("XML version is missing or invalid");if(!/^1\.[0-9]+$/.test(I))throw this.a("Invalid character in version number");let L,B;if(this.e()){if(L=!!C.b("encoding")&&this.t()&&this.r(),L){if(!/^[A-Za-z][\w.-]*$/.test(L))throw this.a("Invalid character in encoding name");this.e()}if(B=!!C.b("standalone")&&this.t()&&this.r(),B){if(B!=="yes"&&B!=="no")throw this.a('Only "yes" and "no" are permitted as values of `standalone`');this.e()}}if(!C.b("?>"))throw this.a("Invalid or unclosed XML declaration");return this.g.preserveXmlDeclaration?this.i(new q(I,L||void 0,B||void 0),w):!0}a(C){let{c:w}=this;return new Q(C,w.d,w.h)}parse(){if(this.c.b("\uFEFF"),this.O(),!this.E())throw this.a("Root element is missing or invalid");for(;this.z(););if(!this.c.B)throw this.a("Extra content at the end of the document")}o(C){let{length:w}=C;for(let I=0;I<w;++I){let L=C.codePointAt(I);if(!P(L))throw this.c.n(-([...C].length-I)),this.a("Invalid character");L>65535&&(I+=1)}}};function ge(C){let w=0;for(;(w=C.indexOf("\r",w))!==-1;)C=C[w+1]===`
394
394
  `?C.slice(0,w)+C.slice(w+1):C.slice(0,w)+`
395
395
  `+C.slice(w+1);return C}function Ae(C,w){return new ve(C,w).document}return u0}var xb=bb();function wb(r){const e=String(r),t=[];return{toOffset:i,toPoint:n};function n(s){if(typeof s=="number"&&s>-1&&s<=e.length){let o=0;for(;;){let a=t[o];if(a===void 0){const l=Zp(e,t[o-1]);a=l===-1?e.length+1:l+1,t[o]=a}if(a>s)return{line:o+1,column:s-(o>0?t[o-1]:0)+1,offset:s};o++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;t.length<s.line;){const a=t[t.length-1],l=Zp(e,a),c=l===-1?e.length+1:l+1;if(a===c)break;t.push(c)}const o=(s.line>1?t[s.line-2]:0)+s.column-1;if(o<t[s.line-1])return o}}}function Zp(r,e){const t=r.indexOf("\r",e),n=r.indexOf(`
396
396
  `,e);return n===-1?t:t===-1||t+1===n?n:t<n?t:n}function Sb(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?Qp(r.position):"start"in r||"end"in r?Qp(r):"line"in r||"column"in r?d0(r):""}function d0(r){return em(r&&r.line)+":"+em(r&&r.column)}function Qp(r){return d0(r&&r.start)+"-"+d0(r&&r.end)}function em(r){return r&&typeof r=="number"?r:1}class pt extends Error{constructor(e,t,n){super(),typeof t=="string"&&(n=t,t=void 0);let i="",s={},o=!1;if(t&&("line"in t&&"column"in t?s={place:t}:"start"in t&&"end"in t?s={place:t}:"type"in t?s={ancestors:[t],place:t.position}:s={...t}),typeof e=="string"?i=e:!s.cause&&e&&(o=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?s.ruleId=n:(s.source=n.slice(0,l),s.ruleId=n.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Sb(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}pt.prototype.file="",pt.prototype.name="",pt.prototype.reason="",pt.prototype.message="",pt.prototype.stack="",pt.prototype.column=void 0,pt.prototype.line=void 0,pt.prototype.ancestors=void 0,pt.prototype.cause=void 0,pt.prototype.fatal=void 0,pt.prototype.place=void 0,pt.prototype.ruleId=void 0,pt.prototype.source=void 0;function kb(r){const e=wb(r);let t;try{t=xb.parseXml(String(r),{includeOffsets:!0,preserveCdata:!0,preserveComments:!0,preserveDocumentType:!0,preserveXmlDeclaration:!0})}catch(s){const o=s,a=e.toPoint(o.pos),l=new pt("Could not parse XML with `@rgrove/parse-xml`",{cause:o,place:a,ruleId:"error",source:"xast-util-from-xml"});throw l.fatal=!0,l.url="https://github.com/syntax-tree/xast-util-from-xml#throws",l}const n={location:e},i=Cb(t,n);return rm(t,i,n),i}function Mb(r){return{type:"cdata",value:r.text}}function Tb(r){return{type:"comment",value:r.content}}function Cb(r,e){return{type:"root",children:tm(r.children,e)}}function Eb(r){return{type:"doctype",name:r.name,public:r.publicId||void 0,system:r.systemId||void 0}}function Ab(r,e){const t=tm(r.children,e);return{type:"element",name:r.name,attributes:{...r.attributes},children:t}}function Ob(r){return{type:"instruction",name:r.name,value:r.content}}function Nb(r){return{type:"text",value:r.text}}function Db(r){const e=[];return r.version&&e.push('version="'+r.version+'"'),r.encoding&&e.push('encoding="'+r.encoding+'"'),r.standalone&&e.push('standalone="'+r.standalone+'"'),{type:"instruction",name:"xml",value:e.join(" ")}}function tm(r,e){const t=[];let n=-1;for(;++n<r.length;){const i=r[n];let s;i.type==="cdata"?s=Mb(i):i.type==="comment"?s=Tb(i):i.type==="doctype"?s=Eb(i):i.type==="element"?s=Ab(i,e):i.type==="pi"?s=Ob(i):i.type==="text"?s=Nb(i):i.type==="xmldecl"&&(s=Db(i)),s&&(rm(i,s,e),t.push(s))}return t}function rm(r,e,t){const n=r.start===-1?void 0:t.location.toPoint(r.start),i=r.end===-1?void 0:t.location.toPoint(r.end);n&&i&&(e.position={start:n,end:i})}const zb=/["&'<>`]/g,Ib=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Rb=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Pb=/[|\\{}()[\]^$+*?.]/g,nm=new WeakMap;function Lb(r,e){if(r=r.replace(e.subset?Bb(e.subset):zb,n),e.subset||e.escapeOnly)return r;return r.replace(Ib,t).replace(Rb,n);function t(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function n(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}function Bb(r){let e=nm.get(r);return e||(e=Fb(r),nm.set(r,e)),e}function Fb(r){const e=[];let t=-1;for(;++t<r.length;)e.push(r[t].replace(Pb,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}function $b(r){return"&#x"+r.toString(16).toUpperCase()+";"}function Hb(r,e){return Lb(r,Object.assign({format:$b},e))}const Vb=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function Gn(r,e,t){const n=qb(r);return t?n.replace(t,i):i(n);function i(s){return Hb(s,{subset:e})}}function qb(r){return String(r||"").replace(Vb,"")}const _b=/]]>/g,jb=[">"];function Ub(r){return"<![CDATA["+Gn(r.value,jb,_b)+"]]>"}function Wb(r){return"<!--"+Gn(r.value,["-"])+"-->"}const Gb=[" ",`
@@ -418,7 +418,7 @@ ${e}
418
418
  `;for(const i of r.content)e=e+mm(i);e=e+`
419
419
  </`+t+`>
420
420
  `}}else if(r.type==="text")if(r.marks){const t=r.marks[0].type in xo?xo[r.marks[0].type]:r.marks[0].type;e=e+"<"+t+">"+pm(r.text)+"</"+t+">"}else e=e+pm(r.text);else r.type==="hardBreak"?e=e+`
421
- `:e=e+"<!-- Something is missing; got "+JSON.stringify(r)+" -->";return e}const gm=["top","right","bottom","left"],ym=["start","end"],vm=gm.reduce((r,e)=>r.concat(e,e+"-"+ym[0],e+"-"+ym[1]),[]),Xt=Math.min,lt=Math.max,wo=Math.round,Yt=r=>({x:r,y:r}),V9={left:"right",right:"left",bottom:"top",top:"bottom"},q9={start:"end",end:"start"};function p0(r,e,t){return lt(r,Xt(e,t))}function vr(r,e){return typeof r=="function"?r(e):r}function Dt(r){return r.split("-")[0]}function Ft(r){return r.split("-")[1]}function bm(r){return r==="x"?"y":"x"}function m0(r){return r==="y"?"height":"width"}const _9=new Set(["top","bottom"]);function Zt(r){return _9.has(Dt(r))?"y":"x"}function g0(r){return bm(Zt(r))}function xm(r,e,t){t===void 0&&(t=!1);const n=Ft(r),i=g0(r),s=m0(i);let o=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=ko(o)),[o,ko(o)]}function j9(r){const e=ko(r);return[So(r),e,So(e)]}function So(r){return r.replace(/start|end/g,e=>q9[e])}const wm=["left","right"],Sm=["right","left"],U9=["top","bottom"],W9=["bottom","top"];function G9(r,e,t){switch(r){case"top":case"bottom":return t?e?Sm:wm:e?wm:Sm;case"left":case"right":return e?U9:W9;default:return[]}}function K9(r,e,t,n){const i=Ft(r);let s=G9(Dt(r),t==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(So)))),s}function ko(r){return r.replace(/left|right|bottom|top/g,e=>V9[e])}function J9(r){return{top:0,right:0,bottom:0,left:0,...r}}function y0(r){return typeof r!="number"?J9(r):{top:r,right:r,bottom:r,left:r}}function Kn(r){const{x:e,y:t,width:n,height:i}=r;return{width:n,height:i,top:t,left:e,right:e+n,bottom:t+i,x:e,y:t}}function km(r,e,t){let{reference:n,floating:i}=r;const s=Zt(e),o=g0(e),a=m0(o),l=Dt(e),c=s==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,h=n[a]/2-i[a]/2;let f;switch(l){case"top":f={x:u,y:n.y-i.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-i.width,y:d};break;default:f={x:n.x,y:n.y}}switch(Ft(e)){case"start":f[o]-=h*(t&&c?-1:1);break;case"end":f[o]+=h*(t&&c?-1:1);break}return f}const X9=async(r,e,t)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=t,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:r,floating:e,strategy:i}),{x:u,y:d}=km(c,n,l),h=n,f={},m=0;for(let y=0;y<a.length;y++){const{name:v,fn:x}=a[y],{x:T,y:D,data:P,reset:N}=await x({x:u,y:d,initialPlacement:n,placement:h,strategy:i,middlewareData:f,rects:c,platform:o,elements:{reference:r,floating:e}});u=T??u,d=D??d,f={...f,[v]:{...f[v],...P}},N&&m<=50&&(m++,typeof N=="object"&&(N.placement&&(h=N.placement),N.rects&&(c=N.rects===!0?await o.getElementRects({reference:r,floating:e,strategy:i}):N.rects),{x:u,y:d}=km(c,h,l)),y=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}};async function Jn(r,e){var t;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=r,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=vr(e,r),m=y0(f),v=a[h?d==="floating"?"reference":"floating":d],x=Kn(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(v)))==null||t?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),T=d==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),P=await(s.isElement==null?void 0:s.isElement(D))?await(s.getScale==null?void 0:s.getScale(D))||{x:1,y:1}:{x:1,y:1},N=Kn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:T,offsetParent:D,strategy:l}):T);return{top:(x.top-N.top+m.top)/P.y,bottom:(N.bottom-x.bottom+m.bottom)/P.y,left:(x.left-N.left+m.left)/P.x,right:(N.right-x.right+m.right)/P.x}}const Y9=r=>({name:"arrow",options:r,async fn(e){const{x:t,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=vr(r,e)||{};if(c==null)return{};const d=y0(u),h={x:t,y:n},f=g0(i),m=m0(f),y=await o.getDimensions(c),v=f==="y",x=v?"top":"left",T=v?"bottom":"right",D=v?"clientHeight":"clientWidth",P=s.reference[m]+s.reference[f]-h[f]-s.floating[m],N=h[f]-s.reference[f],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let A=O?O[D]:0;(!A||!await(o.isElement==null?void 0:o.isElement(O)))&&(A=a.floating[D]||s.floating[m]);const $=P/2-N/2,F=A/2-y[m]/2-1,q=Xt(d[x],F),te=Xt(d[T],F),Y=q,he=A-y[m]-te,Q=A/2-y[m]/2+$,W=p0(Y,Q,he),ne=!l.arrow&&Ft(i)!=null&&Q!==W&&s.reference[m]/2-(Q<Y?q:te)-y[m]/2<0,ve=ne?Q<Y?Q-Y:Q-he:0;return{[f]:h[f]+ve,data:{[f]:W,centerOffset:Q-W-ve,...ne&&{alignmentOffset:ve}},reset:ne}}});function Z9(r,e,t){return(r?[...t.filter(i=>Ft(i)===r),...t.filter(i=>Ft(i)!==r)]:t.filter(i=>Dt(i)===i)).filter(i=>r?Ft(i)===r||(e?So(i)!==i:!1):!0)}const Q9=function(r){return r===void 0&&(r={}),{name:"autoPlacement",options:r,async fn(e){var t,n,i;const{rects:s,middlewareData:o,placement:a,platform:l,elements:c}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:h=vm,autoAlignment:f=!0,...m}=vr(r,e),y=d!==void 0||h===vm?Z9(d||null,f,h):h,v=await Jn(e,m),x=((t=o.autoPlacement)==null?void 0:t.index)||0,T=y[x];if(T==null)return{};const D=xm(T,s,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(a!==T)return{reset:{placement:y[0]}};const P=[v[Dt(T)],v[D[0]],v[D[1]]],N=[...((n=o.autoPlacement)==null?void 0:n.overflows)||[],{placement:T,overflows:P}],O=y[x+1];if(O)return{data:{index:x+1,overflows:N},reset:{placement:O}};const A=N.map(q=>{const te=Ft(q.placement);return[q.placement,te&&u?q.overflows.slice(0,2).reduce((Y,he)=>Y+he,0):q.overflows[0],q.overflows]}).sort((q,te)=>q[1]-te[1]),F=((i=A.filter(q=>q[2].slice(0,Ft(q[0])?2:3).every(te=>te<=0))[0])==null?void 0:i[0])||A[0][0];return F!==a?{data:{index:x+1,overflows:N},reset:{placement:F}}:{}}}},ex=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(e){var t,n;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...v}=vr(r,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const x=Dt(i),T=Zt(a),D=Dt(a)===a,P=await(l.isRTL==null?void 0:l.isRTL(c.floating)),N=h||(D||!y?[ko(a)]:j9(a)),O=m!=="none";!h&&O&&N.push(...K9(a,y,m,P));const A=[a,...N],$=await Jn(e,v),F=[];let q=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&F.push($[x]),d){const Q=xm(i,o,P);F.push($[Q[0]],$[Q[1]])}if(q=[...q,{placement:i,overflows:F}],!F.every(Q=>Q<=0)){var te,Y;const Q=(((te=s.flip)==null?void 0:te.index)||0)+1,W=A[Q];if(W&&(!(d==="alignment"?T!==Zt(W):!1)||q.every(ge=>Zt(ge.placement)===T?ge.overflows[0]>0:!0)))return{data:{index:Q,overflows:q},reset:{placement:W}};let ne=(Y=q.filter(ve=>ve.overflows[0]<=0).sort((ve,ge)=>ve.overflows[1]-ge.overflows[1])[0])==null?void 0:Y.placement;if(!ne)switch(f){case"bestFit":{var he;const ve=(he=q.filter(ge=>{if(O){const Ae=Zt(ge.placement);return Ae===T||Ae==="y"}return!0}).map(ge=>[ge.placement,ge.overflows.filter(Ae=>Ae>0).reduce((Ae,C)=>Ae+C,0)]).sort((ge,Ae)=>ge[1]-Ae[1])[0])==null?void 0:he[0];ve&&(ne=ve);break}case"initialPlacement":ne=a;break}if(i!==ne)return{reset:{placement:ne}}}return{}}}};function Mm(r,e){return{top:r.top-e.height,right:r.right-e.width,bottom:r.bottom-e.height,left:r.left-e.width}}function Tm(r){return gm.some(e=>r[e]>=0)}const tx=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(e){const{rects:t}=e,{strategy:n="referenceHidden",...i}=vr(r,e);switch(n){case"referenceHidden":{const s=await Jn(e,{...i,elementContext:"reference"}),o=Mm(s,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Tm(o)}}}case"escaped":{const s=await Jn(e,{...i,altBoundary:!0}),o=Mm(s,t.floating);return{data:{escapedOffsets:o,escaped:Tm(o)}}}default:return{}}}}};function Cm(r){const e=Xt(...r.map(s=>s.left)),t=Xt(...r.map(s=>s.top)),n=lt(...r.map(s=>s.right)),i=lt(...r.map(s=>s.bottom));return{x:e,y:t,width:n-e,height:i-t}}function rx(r){const e=r.slice().sort((i,s)=>i.y-s.y),t=[];let n=null;for(let i=0;i<e.length;i++){const s=e[i];!n||s.y-n.y>n.height/2?t.push([s]):t[t.length-1].push(s),n=s}return t.map(i=>Kn(Cm(i)))}const nx=function(r){return r===void 0&&(r={}),{name:"inline",options:r,async fn(e){const{placement:t,elements:n,rects:i,platform:s,strategy:o}=e,{padding:a=2,x:l,y:c}=vr(r,e),u=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),d=rx(u),h=Kn(Cm(u)),f=y0(a);function m(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&c!=null)return d.find(v=>l>v.left-f.left&&l<v.right+f.right&&c>v.top-f.top&&c<v.bottom+f.bottom)||h;if(d.length>=2){if(Zt(t)==="y"){const q=d[0],te=d[d.length-1],Y=Dt(t)==="top",he=q.top,Q=te.bottom,W=Y?q.left:te.left,ne=Y?q.right:te.right,ve=ne-W,ge=Q-he;return{top:he,bottom:Q,left:W,right:ne,width:ve,height:ge,x:W,y:he}}const v=Dt(t)==="left",x=lt(...d.map(q=>q.right)),T=Xt(...d.map(q=>q.left)),D=d.filter(q=>v?q.left===T:q.right===x),P=D[0].top,N=D[D.length-1].bottom,O=T,A=x,$=A-O,F=N-P;return{top:P,bottom:N,left:O,right:A,width:$,height:F,x:O,y:P}}return h}const y=await s.getElementRects({reference:{getBoundingClientRect:m},floating:n.floating,strategy:o});return i.reference.x!==y.reference.x||i.reference.y!==y.reference.y||i.reference.width!==y.reference.width||i.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},ix=new Set(["left","top"]);async function sx(r,e){const{placement:t,platform:n,elements:i}=r,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Dt(t),a=Ft(t),l=Zt(t)==="y",c=ix.has(o)?-1:1,u=s&&l?-1:1,d=vr(e,r);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(f=a==="end"?m*-1:m),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const ox=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(e){var t,n;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await sx(e,r);return o===((t=a.offset)==null?void 0:t.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},ax=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(e){const{x:t,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:v=>{let{x,y:T}=v;return{x,y:T}}},...l}=vr(r,e),c={x:t,y:n},u=await Jn(e,l),d=Zt(Dt(i)),h=bm(d);let f=c[h],m=c[d];if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",T=f+u[v],D=f-u[x];f=p0(T,f,D)}if(o){const v=d==="y"?"top":"left",x=d==="y"?"bottom":"right",T=m+u[v],D=m-u[x];m=p0(T,m,D)}const y=a.fn({...e,[h]:f,[d]:m});return{...y,data:{x:y.x-t,y:y.y-n,enabled:{[h]:s,[d]:o}}}}}},lx=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(e){var t,n;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=vr(r,e),u=await Jn(e,c),d=Dt(i),h=Ft(i),f=Zt(i)==="y",{width:m,height:y}=s.floating;let v,x;d==="top"||d==="bottom"?(v=d,x=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,v=h==="end"?"top":"bottom");const T=y-u.top-u.bottom,D=m-u.left-u.right,P=Xt(y-u[v],T),N=Xt(m-u[x],D),O=!e.middlewareData.shift;let A=P,$=N;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&($=D),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(A=T),O&&!h){const q=lt(u.left,0),te=lt(u.right,0),Y=lt(u.top,0),he=lt(u.bottom,0);f?$=m-2*(q!==0||te!==0?q+te:lt(u.left,u.right)):A=y-2*(Y!==0||he!==0?Y+he:lt(u.top,u.bottom))}await l({...e,availableWidth:$,availableHeight:A});const F=await o.getDimensions(a.floating);return m!==F.width||y!==F.height?{reset:{rects:!0}}:{}}}};function Mo(){return typeof window<"u"}function Xn(r){return Em(r)?(r.nodeName||"").toLowerCase():"#document"}function St(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function br(r){var e;return(e=(Em(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function Em(r){return Mo()?r instanceof Node||r instanceof St(r).Node:!1}function $t(r){return Mo()?r instanceof Element||r instanceof St(r).Element:!1}function Qt(r){return Mo()?r instanceof HTMLElement||r instanceof St(r).HTMLElement:!1}function Am(r){return!Mo()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof St(r).ShadowRoot}const cx=new Set(["inline","contents"]);function Vi(r){const{overflow:e,overflowX:t,overflowY:n,display:i}=Ht(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!cx.has(i)}const ux=new Set(["table","td","th"]);function dx(r){return ux.has(Xn(r))}const hx=[":popover-open",":modal"];function To(r){return hx.some(e=>{try{return r.matches(e)}catch{return!1}})}const fx=["transform","translate","scale","rotate","perspective"],px=["transform","translate","scale","rotate","perspective","filter"],mx=["paint","layout","strict","content"];function v0(r){const e=b0(),t=$t(r)?Ht(r):r;return fx.some(n=>t[n]?t[n]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||px.some(n=>(t.willChange||"").includes(n))||mx.some(n=>(t.contain||"").includes(n))}function gx(r){let e=Jr(r);for(;Qt(e)&&!Yn(e);){if(v0(e))return e;if(To(e))return null;e=Jr(e)}return null}function b0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yx=new Set(["html","body","#document"]);function Yn(r){return yx.has(Xn(r))}function Ht(r){return St(r).getComputedStyle(r)}function Co(r){return $t(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function Jr(r){if(Xn(r)==="html")return r;const e=r.assignedSlot||r.parentNode||Am(r)&&r.host||br(r);return Am(e)?e.host:e}function Om(r){const e=Jr(r);return Yn(e)?r.ownerDocument?r.ownerDocument.body:r.body:Qt(e)&&Vi(e)?e:Om(e)}function Nm(r,e,t){var n;e===void 0&&(e=[]);const i=Om(r),s=i===((n=r.ownerDocument)==null?void 0:n.body),o=St(i);return s?(x0(o),e.concat(o,o.visualViewport||[],Vi(i)?i:[],[])):e.concat(i,Nm(i,[]))}function x0(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function Dm(r){const e=Ht(r);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Qt(r),s=i?r.offsetWidth:t,o=i?r.offsetHeight:n,a=wo(t)!==s||wo(n)!==o;return a&&(t=s,n=o),{width:t,height:n,$:a}}function zm(r){return $t(r)?r:r.contextElement}function Zn(r){const e=zm(r);if(!Qt(e))return Yt(1);const t=e.getBoundingClientRect(),{width:n,height:i,$:s}=Dm(e);let o=(s?wo(t.width):t.width)/n,a=(s?wo(t.height):t.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const vx=Yt(0);function Im(r){const e=St(r);return!b0()||!e.visualViewport?vx:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bx(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==St(r)?!1:e}function qi(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=r.getBoundingClientRect(),s=zm(r);let o=Yt(1);e&&(n?$t(n)&&(o=Zn(n)):o=Zn(r));const a=bx(s,t,n)?Im(s):Yt(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const h=St(s),f=n&&$t(n)?St(n):n;let m=h,y=x0(m);for(;y&&n&&f!==m;){const v=Zn(y),x=y.getBoundingClientRect(),T=Ht(y),D=x.left+(y.clientLeft+parseFloat(T.paddingLeft))*v.x,P=x.top+(y.clientTop+parseFloat(T.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=D,c+=P,m=St(y),y=x0(m)}}return Kn({width:u,height:d,x:l,y:c})}function Eo(r,e){const t=Co(r).scrollLeft;return e?e.left+t:qi(br(r)).left+t}function Rm(r,e){const t=r.getBoundingClientRect(),n=t.left+e.scrollLeft-Eo(r,t),i=t.top+e.scrollTop;return{x:n,y:i}}function xx(r){let{elements:e,rect:t,offsetParent:n,strategy:i}=r;const s=i==="fixed",o=br(n),a=e?To(e.floating):!1;if(n===o||a&&s)return t;let l={scrollLeft:0,scrollTop:0},c=Yt(1);const u=Yt(0),d=Qt(n);if((d||!d&&!s)&&((Xn(n)!=="body"||Vi(o))&&(l=Co(n)),Qt(n))){const f=qi(n);c=Zn(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}const h=o&&!d&&!s?Rm(o,l):Yt(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:t.y*c.y-l.scrollTop*c.y+u.y+h.y}}function wx(r){return Array.from(r.getClientRects())}function Sx(r){const e=br(r),t=Co(r),n=r.ownerDocument.body,i=lt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=lt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Eo(r);const a=-t.scrollTop;return Ht(n).direction==="rtl"&&(o+=lt(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}const Pm=25;function kx(r,e){const t=St(r),n=br(r),i=t.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=b0();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=Eo(n);if(c<=0){const u=n.ownerDocument,d=u.body,h=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(n.clientWidth-d.clientWidth-f);m<=Pm&&(s-=m)}else c<=Pm&&(s+=c);return{width:s,height:o,x:a,y:l}}const Mx=new Set(["absolute","fixed"]);function Tx(r,e){const t=qi(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,s=Qt(r)?Zn(r):Yt(1),o=r.clientWidth*s.x,a=r.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:o,height:a,x:l,y:c}}function Lm(r,e,t){let n;if(e==="viewport")n=kx(r,t);else if(e==="document")n=Sx(br(r));else if($t(e))n=Tx(e,t);else{const i=Im(r);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Kn(n)}function Bm(r,e){const t=Jr(r);return t===e||!$t(t)||Yn(t)?!1:Ht(t).position==="fixed"||Bm(t,e)}function Cx(r,e){const t=e.get(r);if(t)return t;let n=Nm(r,[]).filter(a=>$t(a)&&Xn(a)!=="body"),i=null;const s=Ht(r).position==="fixed";let o=s?Jr(r):r;for(;$t(o)&&!Yn(o);){const a=Ht(o),l=v0(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&Mx.has(i.position)||Vi(o)&&!l&&Bm(r,o))?n=n.filter(u=>u!==o):i=a,o=Jr(o)}return e.set(r,n),n}function Ex(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r;const o=[...t==="clippingAncestors"?To(e)?[]:Cx(e,this._c):[].concat(t),n],a=o[0],l=o.reduce((c,u)=>{const d=Lm(e,u,i);return c.top=lt(d.top,c.top),c.right=Xt(d.right,c.right),c.bottom=Xt(d.bottom,c.bottom),c.left=lt(d.left,c.left),c},Lm(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ax(r){const{width:e,height:t}=Dm(r);return{width:e,height:t}}function Ox(r,e,t){const n=Qt(e),i=br(e),s=t==="fixed",o=qi(r,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Yt(0);function c(){l.x=Eo(i)}if(n||!n&&!s)if((Xn(e)!=="body"||Vi(i))&&(a=Co(e)),n){const f=qi(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&c();s&&!n&&i&&c();const u=i&&!n&&!s?Rm(i,a):Yt(0),d=o.left+a.scrollLeft-l.x-u.x,h=o.top+a.scrollTop-l.y-u.y;return{x:d,y:h,width:o.width,height:o.height}}function w0(r){return Ht(r).position==="static"}function Fm(r,e){if(!Qt(r)||Ht(r).position==="fixed")return null;if(e)return e(r);let t=r.offsetParent;return br(r)===t&&(t=t.ownerDocument.body),t}function $m(r,e){const t=St(r);if(To(r))return t;if(!Qt(r)){let i=Jr(r);for(;i&&!Yn(i);){if($t(i)&&!w0(i))return i;i=Jr(i)}return t}let n=Fm(r,e);for(;n&&dx(n)&&w0(n);)n=Fm(n,e);return n&&Yn(n)&&w0(n)&&!v0(n)?t:n||gx(r)||t}const Nx=async function(r){const e=this.getOffsetParent||$m,t=this.getDimensions,n=await t(r.floating);return{reference:Ox(r.reference,await e(r.floating),r.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Dx(r){return Ht(r).direction==="rtl"}const zx={convertOffsetParentRelativeRectToViewportRelativeRect:xx,getDocumentElement:br,getClippingRect:Ex,getOffsetParent:$m,getElementRects:Nx,getClientRects:wx,getDimensions:Ax,getScale:Zn,isElement:$t,isRTL:Dx},Hm=ox,Vm=Q9,qm=ax,_m=ex,jm=lx,Um=tx,Wm=Y9,Gm=nx,Km=(r,e,t)=>{const n=new Map,i={platform:zx,...t},s={...i.platform,_c:n};return X9(r,e,{...i,platform:s})};let S0,k0;if(typeof WeakMap<"u"){let r=new WeakMap;S0=e=>r.get(e),k0=(e,t)=>(r.set(e,t),t)}else{const r=[];let t=0;S0=n=>{for(let i=0;i<r.length;i+=2)if(r[i]==n)return r[i+1]},k0=(n,i)=>(t==10&&(t=0),r[t++]=n,r[t++]=i)}var xr=class{constructor(r,e,t,n){this.width=r,this.height=e,this.map=t,this.problems=n}findCell(r){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=r)continue;const n=e%this.width,i=e/this.width|0;let s=n+1,o=i+1;for(let a=1;s<this.width&&this.map[e+a]==t;a++)s++;for(let a=1;o<this.height&&this.map[e+this.width*a]==t;a++)o++;return{left:n,top:i,right:s,bottom:o}}throw new RangeError(`No cell with offset ${r} found`)}colCount(r){for(let e=0;e<this.map.length;e++)if(this.map[e]==r)return e%this.width;throw new RangeError(`No cell with offset ${r} found`)}nextCell(r,e,t){const{left:n,right:i,top:s,bottom:o}=this.findCell(r);return e=="horiz"?(t<0?n==0:i==this.width)?null:this.map[s*this.width+(t<0?n-1:i)]:(t<0?s==0:o==this.height)?null:this.map[n+this.width*(t<0?s-1:o)]}rectBetween(r,e){const{left:t,right:n,top:i,bottom:s}=this.findCell(r),{left:o,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(t,o),top:Math.min(i,l),right:Math.max(n,a),bottom:Math.max(s,c)}}cellsInRect(r){const e=[],t={};for(let n=r.top;n<r.bottom;n++)for(let i=r.left;i<r.right;i++){const s=n*this.width+i,o=this.map[s];t[o]||(t[o]=!0,!(i==r.left&&i&&this.map[s-1]==o||n==r.top&&n&&this.map[s-this.width]==o)&&e.push(o))}return e}positionAt(r,e,t){for(let n=0,i=0;;n++){const s=i+t.child(n).nodeSize;if(n==r){let o=e+r*this.width;const a=(r+1)*this.width;for(;o<a&&this.map[o]<i;)o++;return o==a?s-1:this.map[o]}i=s}}static get(r){return S0(r)||k0(r,Ix(r))}};function Ix(r){if(r.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+r.type.name);const e=Rx(r),t=r.childCount,n=[];let i=0,s=null;const o=[];for(let c=0,u=e*t;c<u;c++)n[c]=0;for(let c=0,u=0;c<t;c++){const d=r.child(c);u++;for(let m=0;;m++){for(;i<n.length&&n[i]!=0;)i++;if(m==d.childCount)break;const y=d.child(m),{colspan:v,rowspan:x,colwidth:T}=y.attrs;for(let D=0;D<x;D++){if(D+c>=t){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:x-D});break}const P=i+D*e;for(let N=0;N<v;N++){n[P+N]==0?n[P+N]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:v-N});const O=T&&T[N];if(O){const A=(P+N)%e*2,$=o[A];$==null||$!=O&&o[A+1]==1?(o[A]=O,o[A+1]=1):$==O&&o[A+1]++}}}i+=v,u+=y.nodeSize}const h=(c+1)*e;let f=0;for(;i<h;)n[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(e===0||t===0)&&(s||(s=[])).push({type:"zero_sized"});const a=new xr(e,t,n,s);let l=!1;for(let c=0;!l&&c<o.length;c+=2)o[c]!=null&&o[c+1]<t&&(l=!0);return l&&Px(a,o,r),a}function Rx(r){let e=-1,t=!1;for(let n=0;n<r.childCount;n++){const i=r.child(n);let s=0;if(t)for(let o=0;o<n;o++){const a=r.child(o);for(let l=0;l<a.childCount;l++){const c=a.child(l);o+c.attrs.rowspan>n&&(s+=c.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const a=i.child(o);s+=a.attrs.colspan,a.attrs.rowspan>1&&(t=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function Px(r,e,t){r.problems||(r.problems=[]);const n={};for(let i=0;i<r.map.length;i++){const s=r.map[i];if(n[s])continue;n[s]=!0;const o=t.nodeAt(s);if(!o)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=o.attrs;for(let c=0;c<l.colspan;c++){const u=e[(i+c)%r.width*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((a||(a=Lx(l)))[c]=u)}a&&r.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function Lx(r){if(r.colwidth)return r.colwidth.slice();const e=[];for(let t=0;t<r.colspan;t++)e.push(0);return e}function M0(r){let e=r.cached.tableNodeTypes;if(!e){e=r.cached.tableNodeTypes={};for(const t in r.nodes){const n=r.nodes[t],i=n.spec.tableRole;i&&(e[i]=n)}}return e}new Fe("selectingCells");function Bx(r){for(let e=r.depth-1;e>0;e--)if(r.node(e).type.spec.tableRole=="row")return r.node(0).resolve(r.before(e+1));return null}function Jm(r){const e=r.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function Fx(r){const e=r.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=Bx(e.$head)||$x(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function $x(r){for(let e=r.nodeAfter,t=r.pos;e;e=e.firstChild,t++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t)}for(let e=r.nodeBefore,t=r.pos;e;e=e.lastChild,t--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t-e.nodeSize)}}function Xm(r){return r.parent.type.spec.tableRole=="row"&&!!r.nodeAfter}function Ym(r,e){return r.depth==e.depth&&r.pos>=e.start(-1)&&r.pos<=e.end(-1)}function Zm(r,e,t){const n=r.node(-1),i=xr.get(n),s=r.start(-1),o=i.nextCell(r.pos-s,e,t);return o==null?null:r.node(0).resolve(s+o)}function Qm(r,e,t=1){const n={...r,colspan:r.colspan-t};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,t),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}var er=class wr extends ce{constructor(e,t=e){const n=e.node(-1),i=xr.get(n),s=e.start(-1),o=i.rectBetween(e.pos-s,t.pos-s),a=e.node(0),l=i.cellsInRect(o).filter(u=>u!=t.pos-s);l.unshift(t.pos-s);const c=l.map(u=>{const d=n.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new hu(a.resolve(h),a.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(e,t){const n=e.resolve(t.map(this.$anchorCell.pos)),i=e.resolve(t.map(this.$headCell.pos));if(Xm(n)&&Xm(i)&&Ym(n,i)){const s=this.$anchorCell.node(-1)!=n.node(-1);return s&&this.isRowSelection()?wr.rowSelection(n,i):s&&this.isColSelection()?wr.colSelection(n,i):new wr(n,i)}return de.between(n,i)}content(){const e=this.$anchorCell.node(-1),t=xr.get(e),n=this.$anchorCell.start(-1),i=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),s={},o=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let u=l*t.width+i.left,d=i.left;d<i.right;d++,u++){const h=t.map[u];if(s[h])continue;s[h]=!0;const f=t.findCell(h);let m=e.nodeAt(h);if(!m)throw new RangeError(`No cell with offset ${h} found`);const y=i.left-f.left,v=f.right-i.right;if(y>0||v>0){let x=m.attrs;if(y>0&&(x=Qm(x,0,y)),v>0&&(x=Qm(x,x.colspan-v,v)),f.left<i.left){if(m=m.type.createAndFill(x),!m)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(x)}`)}else m=m.type.create(x,m.content)}if(f.top<i.top||f.bottom>i.bottom){const x={...m.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?m=m.type.createAndFill(x):m=m.type.create(x,m.content)}c.push(m)}o.push(e.child(l).copy(H.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new X(H.from(a),1,1)}replace(e,t=X.empty){const n=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:a,$to:l}=i[o],c=e.mapping.slice(n);e.replace(c.map(a.pos),c.map(l.pos),o?X.empty:t)}const s=ce.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,t){this.replace(e,new X(H.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=xr.get(t),i=this.$anchorCell.start(-1),s=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(t.nodeAt(s[o]),i+s[o])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const n=e.node(-1),i=xr.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(t.pos-s),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(s+i.map[o.left])),a.bottom<i.height&&(t=l.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(t=l.resolve(s+i.map[a.left])),o.bottom<i.height&&(e=l.resolve(s+i.map[i.width*(i.height-1)+o.right-1]))),new wr(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=xr.get(e),n=this.$anchorCell.start(-1),i=t.colCount(this.$anchorCell.pos-n),s=t.colCount(this.$headCell.pos-n);if(Math.min(i,s)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==t.width}eq(e){return e instanceof wr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const n=e.node(-1),i=xr.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(t.pos-s),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(s+i.map[o.top*i.width])),a.right<i.width&&(t=l.resolve(s+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(t=l.resolve(s+i.map[a.top*i.width])),o.right<i.width&&(e=l.resolve(s+i.map[i.width*(o.top+1)-1]))),new wr(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new wr(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new wr(e.resolve(t),e.resolve(n))}getBookmark(){return new Hx(this.$anchorCell.pos,this.$headCell.pos)}};er.prototype.visible=!1,ce.jsonID("cell",er);var Hx=class w1{constructor(e,t){this.anchor=e,this.head=t}map(e){return new w1(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Ym(t,n)?new er(t,n):ce.near(n,1)}};new Fe("fix-tables");function e1(r){const e=r.selection,t=Fx(r),n=t.node(-1),i=t.start(-1),s=xr.get(n);return{...e instanceof er?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(t.pos-i),tableStart:i,map:s,table:n}}function Vx(r){return function(e,t){if(!Jm(e))return!1;if(t){const n=M0(e.schema),i=e1(e),s=e.tr,o=i.map.cellsInRect(r=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:r=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==n.header_cell&&s.setNodeMarkup(i.tableStart+o[l],n.cell,a[l].attrs);if(s.steps.length===0)for(let l=0;l<o.length;l++)s.setNodeMarkup(i.tableStart+o[l],n.header_cell,a[l].attrs);t(s)}return!0}}function t1(r,e,t){const n=e.map.cellsInRect({left:0,top:0,right:r=="row"?e.map.width:1,bottom:r=="column"?e.map.height:1});for(let i=0;i<n.length;i++){const s=e.table.nodeAt(n[i]);if(s&&s.type!==t.header_cell)return!1}return!0}function T0(r,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Vx(r):function(t,n){if(!Jm(t))return!1;if(n){const i=M0(t.schema),s=e1(t),o=t.tr,a=t1("row",s,i),l=t1("column",s,i),c=(r==="column"?a:r==="row"&&l)?1:0,u=r=="column"?{left:0,top:c,right:1,bottom:s.map.height}:r=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=r=="column"?l?i.cell:i.header_cell:r=="row"?a?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,m=o.doc.nodeAt(f);m&&o.setNodeMarkup(f,d,m.attrs)}),n(o)}return!0}}T0("row",{useDeprecatedLogic:!0}),T0("column",{useDeprecatedLogic:!0}),T0("cell",{useDeprecatedLogic:!0});function Ao(r,e){const t=r.selection;if(!(t instanceof er))return!1;if(e){const n=r.tr,i=M0(r.schema).cell.createAndFill().content;t.forEachCell((s,o)=>{s.content.eq(i)||n.replace(n.mapping.map(o+1),n.mapping.map(o+s.nodeSize-1),new X(i,0,0))}),n.docChanged&&e(n)}return!0}Ha({ArrowLeft:No("horiz",-1),ArrowRight:No("horiz",1),ArrowUp:No("vert",-1),ArrowDown:No("vert",1),"Shift-ArrowLeft":Do("horiz",-1),"Shift-ArrowRight":Do("horiz",1),"Shift-ArrowUp":Do("vert",-1),"Shift-ArrowDown":Do("vert",1),Backspace:Ao,"Mod-Backspace":Ao,Delete:Ao,"Mod-Delete":Ao});function Oo(r,e,t){return t.eq(r.selection)?!1:(e&&e(r.tr.setSelection(t).scrollIntoView()),!0)}function No(r,e){return(t,n,i)=>{if(!i)return!1;const s=t.selection;if(s instanceof er)return Oo(t,n,ce.near(s.$headCell,e));if(r!="horiz"&&!s.empty)return!1;const o=r1(i,r,e);if(o==null)return!1;if(r=="horiz")return Oo(t,n,ce.near(t.doc.resolve(s.head+e),e));{const a=t.doc.resolve(o),l=Zm(a,r,e);let c;return l?c=ce.near(l,1):e<0?c=ce.near(t.doc.resolve(a.before(-1)),-1):c=ce.near(t.doc.resolve(a.after(-1)),1),Oo(t,n,c)}}}function Do(r,e){return(t,n,i)=>{if(!i)return!1;const s=t.selection;let o;if(s instanceof er)o=s;else{const l=r1(i,r,e);if(l==null)return!1;o=new er(t.doc.resolve(l))}const a=Zm(o.$headCell,r,e);return a?Oo(t,n,new er(o.$anchorCell,a)):!1}}function r1(r,e,t){if(!(r.state.selection instanceof de))return null;const{$head:n}=r.state.selection;for(let i=n.depth-1;i>=0;i--){const s=n.node(i);if((t<0?n.index(i):n.indexAfter(i))!=(t<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const o=n.before(i),a=e=="vert"?t>0?"down":"up":t>0?"right":"left";return r.endOfTextblock(a)?o:null}}return null}new Fe("tableColumnResizing");function qx(r,e){const t=Math.min(r.top,e.top),n=Math.max(r.bottom,e.bottom),i=Math.min(r.left,e.left),o=Math.max(r.right,e.right)-i,a=n-t,l=i,c=t;return new DOMRect(l,c,o,a)}var _x=class{constructor({editor:r,element:e,view:t,updateDelay:n=250,resizeDelay:i=60,shouldShow:s,appendTo:o,getReferencedVirtualElement:a,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:u,state:d,from:h,to:f})=>{const{doc:m,selection:y}=d,{empty:v}=y,x=!m.textBetween(h,f).length&&ja(d.selection),T=this.element.contains(document.activeElement);return!(!(u.hasFocus()||T)||v||x||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&((d=this.element.parentNode)!=null&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(u,d)=>{const h=!d?.selection.eq(u.state.selection),f=!d?.doc.eq(u.state.doc);!h&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,h,f,d)},this.updateDelay))},this.updateHandler=(u,d,h,f)=>{const{composing:m}=u;if(m||!d&&!h)return;if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:u})=>{u.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var c;this.editor=r,this.element=e,this.view=t,this.updateDelay=n,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=(c=l?.scrollTarget)!=null?c:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const r=[];return this.floatingUIOptions.flip&&r.push(_m(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&r.push(qm(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&r.push(Hm(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&r.push(Wm(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&r.push(jm(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&r.push(Vm(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&r.push(Um(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&r.push(Gm(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),r}get virtualElement(){var r;const{selection:e}=this.editor.state,t=(r=this.getReferencedVirtualElement)==null?void 0:r.call(this);if(t)return t;const n=mh(this.view,e.from,e.to);let i={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof se){let s=this.view.nodeDOM(e.from);const o=s.dataset.nodeViewWrapper?s:s.querySelector("[data-node-view-wrapper]");o&&(s=o),s&&(i={getBoundingClientRect:()=>s.getBoundingClientRect(),getClientRects:()=>[s.getBoundingClientRect()]})}if(e instanceof er){const{$anchorCell:s,$headCell:o}=e,a=s?s.pos:o.pos,l=o?o.pos:s.pos,c=this.view.nodeDOM(a),u=this.view.nodeDOM(l);if(!c||!u)return;const d=c===u?c.getBoundingClientRect():qx(c.getBoundingClientRect(),u.getBoundingClientRect());i={getBoundingClientRect:()=>d,getClientRects:()=>[d]}}return i}updatePosition(){const r=this.virtualElement;r&&Km(r,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n})=>{this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(r,e){const{state:t}=r,n=t.selection.from!==t.selection.to;if(this.updateDelay>0&&n){this.handleDebouncedUpdate(r,e);return}const i=!e?.selection.eq(r.state.selection),s=!e?.doc.eq(r.state.doc);this.updateHandler(r,i,s,e)}getShouldShow(r){var e;const{state:t}=this.view,{selection:n}=t,{ranges:i}=n,s=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:r,from:s,to:o}))||!1}show(){var r;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(r=e??this.view.dom.parentElement)==null||r.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},n1=r=>new Pe({key:typeof r.pluginKey=="string"?new Fe(r.pluginKey):r.pluginKey,view:e=>new _x({view:e,...r})});Se.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[n1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var jx=class{constructor({editor:r,element:e,view:t,options:n,appendTo:i,shouldShow:s}){this.preventHide=!1,this.isVisible=!1,this.shouldShow=({view:o,state:a})=>{const{selection:l}=a,{$anchor:c,empty:u}=l,d=c.depth===1,h=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent&&c.parent.childCount===0&&!this.getTextContent(c.parent);return!(!o.hasFocus()||!u||!d||!h||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(o,a,l,c)=>{const{composing:u}=o;if(u||!a&&!l)return;if(!this.getShouldShow(c)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var a;if(this.preventHide){this.preventHide=!1;return}o?.relatedTarget&&((a=this.element.parentNode)!=null&&a.contains(o.relatedTarget))||o?.relatedTarget!==this.editor.view.dom&&this.hide()},this.editor=r,this.element=e,this.view=t,this.appendTo=i,this.floatingUIOptions={...this.floatingUIOptions,...n},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(r){return uh(r,{textSerializers:Ja(this.editor.schema)})}get middlewares(){const r=[];return this.floatingUIOptions.flip&&r.push(_m(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&r.push(qm(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&r.push(Hm(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&r.push(Wm(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&r.push(jm(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&r.push(Vm(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&r.push(Um(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&r.push(Gm(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),r}getShouldShow(r){var e;const{state:t}=this.view,{selection:n}=t,{ranges:i}=n,s=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:t,oldState:r,from:s,to:o})}updatePosition(){const{selection:r}=this.editor.state,e=mh(this.view,r.from,r.to);Km({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:n,y:i,strategy:s})=>{this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${n}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(r,e){const t=!e?.selection.eq(r.state.selection),n=!e?.doc.eq(r.state.doc);this.updateHandler(r,t,n,e)}show(){var r;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(r=e??this.view.dom.parentElement)==null||r.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},i1=r=>new Pe({key:typeof r.pluginKey=="string"?new Fe(r.pluginKey):r.pluginKey,view:e=>new jx({view:e,...r})});Se.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[i1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var Ux=I.forwardRef(({pluginKey:r="bubbleMenu",editor:e,updateDelay:t,resizeDelay:n,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:o,options:a,children:l,...c},u)=>{const d=I.useRef(document.createElement("div"));typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:h}=Qh(),f=e||h,m={updateDelay:t,resizeDelay:n,appendTo:i,pluginKey:r,shouldShow:s,getReferencedVirtualElement:o,options:a},y=I.useRef(m);return y.current=m,I.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const v=d.current;v.style.visibility="hidden",v.style.position="absolute";const x=n1({...y.current,editor:f,element:v});f.registerPlugin(x);const T=y.current.pluginKey;return()=>{f.unregisterPlugin(T),window.requestAnimationFrame(()=>{v.parentNode&&v.parentNode.removeChild(v)})}},[f]),ji.createPortal(J.jsx("div",{...c,children:l}),d.current)});I.forwardRef(({pluginKey:r="floatingMenu",editor:e,appendTo:t,shouldShow:n=null,options:i,children:s,...o},a)=>{const l=I.useRef(document.createElement("div"));typeof a=="function"?a(l.current):a&&(a.current=l.current);const{editor:c}=Qh();return I.useEffect(()=>{const u=l.current;if(u.style.visibility="hidden",u.style.position="absolute",e?.isDestroyed||c?.isDestroyed)return;const d=e||c;if(!d){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const h=i1({editor:d,element:u,pluginKey:r,appendTo:t,shouldShow:n,options:i});return d.registerPlugin(h),()=>{d.unregisterPlugin(r),window.requestAnimationFrame(()=>{u.parentNode&&u.parentNode.removeChild(u)})}},[e,c,t,r,n,i]),ji.createPortal(J.jsx("div",{...o,children:s}),l.current)});const Wx=({editor:r})=>{if(!r)return null;const[e]=I.useState(!0),[t]=I.useState(!0);I.useEffect(()=>{r&&r.setEditable(t)},[t,r]);const n=Xh({editor:r,selector:i=>({isTerm:i.editor.isActive("term"),canTerm:i.editor.can().chain().focus().toggleMark("term").run(),isEm:i.editor.isActive("em"),canEm:i.editor.can().chain().focus().toggleMark("em").run(),isAlert:i.editor.isActive("alert"),canAlert:i.editor.can().chain().focus().toggleMark("alert").run()})});return J.jsx(J.Fragment,{children:r&&e&&J.jsx(Ux,{shouldShow:null,editor:r,options:{placement:"bottom",autoPlacement:!0,offset:8},children:J.jsxs("div",{className:"button-group",children:[J.jsx("button",{onClick:()=>r.chain().focus().toggleMark("em").run(),disabled:!n.canEm,className:n.isEm?"is-active":"",children:"<em>"}),J.jsx("button",{onClick:()=>r.chain().focus().toggleMark("term").run(),disabled:!n.canTerm,className:n.isTerm?"is-active":"",children:"<term>"}),J.jsx("button",{onClick:()=>r.chain().focus().toggleMark("alert").run(),disabled:!n.canAlert,className:n.isAlert?"is-active":"",children:"<alert>"})]})})})},s1=["abstract","acknowledgement","affiliation","appendix","article","author","backmatter","biography","book","chapter","colophon","contributor","contributors","copyright","credit","dedication","docinfo","editor","feedback","frontmatter","google","html","index","macros","mathbook","preface","pretext","references","search","shortlicense","solutions","subsection","titlepage","website"],o1=["assemblage","chapter","conclusion","introduction","objectives","outcomes","paragraphs","part","postlude","prelude","reading-questions","sbsgroup","section","stack","subsection","subsubsection","task","technology","worksheet"],a1=["activity","algorithm","answer","axiom","biblio","blockquote","case","choice","choices","claim","conjecture","console","corollary","definition","demonstration","description","example","exercise","exploration","fact","hint","image","images","insight","investigation","lemma","list","listing","note","openconjecture","openproblem","openquestion","page","poem","principle","problem","program","project","proof","proposition","question","remark","shortdescription","solution","stanza","statement","subtask","table","tabular","theorem","warning","webwork"],Gx=["address","attribution","caption","cd","cell","cline","date","department","description","edition","entity","holder","idx","institution","journal","line","location","minilicense","mrow","personname","pg-macros","pubtitle","row","subtitle","support","title","usage","volume","year","xi:include"],Kx=["me","men","md","mdn"],l1=["ul","ol","li","p","task","figure","sidebyside","notation","row"],zo=["latex-image-preamble","latex-image","latex-preamble","slate","sage","sageplot","asymptote","macros","prefigure","program","input","output","prompt","pre","pg-code","tikzpicture","tikz","code","c"],Jx=[...s1,...o1,...a1,...l1,"xi:include"],C0=[...s1,...o1,...a1,...l1,...Kx];function Xx(r){let e=!1,t=r.split(/\r\n|\r|\n/g),n=[t[0].trim()];t.length>1&&n.push(t[1].trim());for(let i=2;i<t.length;i++){let s=/^<(\w\S*?)(\s.*?|>)$/.exec(t[i].trim()),o=/^<\/(\w\S*?)(\s.*?|>)(.?)$/.exec(t[i].trim());if(s&&zo.includes(s[1]))n.push(t[i]),e=!0;else if(o&&zo.includes(o[1]))n.push(t[i]),e=!1;else if(e)n.push(t[i]);else{t[i]=t[i].trim();let a=n.pop();a?n.push(a.trim()+" "+t[i]):n.push(t[i])}}return n.join(`
421
+ `:e=e+"<!-- Something is missing; got "+JSON.stringify(r)+" -->";return e}const gm=["top","right","bottom","left"],ym=["start","end"],vm=gm.reduce((r,e)=>r.concat(e,e+"-"+ym[0],e+"-"+ym[1]),[]),Xt=Math.min,lt=Math.max,wo=Math.round,Yt=r=>({x:r,y:r}),V9={left:"right",right:"left",bottom:"top",top:"bottom"},q9={start:"end",end:"start"};function p0(r,e,t){return lt(r,Xt(e,t))}function vr(r,e){return typeof r=="function"?r(e):r}function Dt(r){return r.split("-")[0]}function Ft(r){return r.split("-")[1]}function bm(r){return r==="x"?"y":"x"}function m0(r){return r==="y"?"height":"width"}const _9=new Set(["top","bottom"]);function Zt(r){return _9.has(Dt(r))?"y":"x"}function g0(r){return bm(Zt(r))}function xm(r,e,t){t===void 0&&(t=!1);const n=Ft(r),i=g0(r),s=m0(i);let o=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=ko(o)),[o,ko(o)]}function j9(r){const e=ko(r);return[So(r),e,So(e)]}function So(r){return r.replace(/start|end/g,e=>q9[e])}const wm=["left","right"],Sm=["right","left"],U9=["top","bottom"],W9=["bottom","top"];function G9(r,e,t){switch(r){case"top":case"bottom":return t?e?Sm:wm:e?wm:Sm;case"left":case"right":return e?U9:W9;default:return[]}}function K9(r,e,t,n){const i=Ft(r);let s=G9(Dt(r),t==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(So)))),s}function ko(r){return r.replace(/left|right|bottom|top/g,e=>V9[e])}function J9(r){return{top:0,right:0,bottom:0,left:0,...r}}function y0(r){return typeof r!="number"?J9(r):{top:r,right:r,bottom:r,left:r}}function Kn(r){const{x:e,y:t,width:n,height:i}=r;return{width:n,height:i,top:t,left:e,right:e+n,bottom:t+i,x:e,y:t}}function km(r,e,t){let{reference:n,floating:i}=r;const s=Zt(e),o=g0(e),a=m0(o),l=Dt(e),c=s==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,h=n[a]/2-i[a]/2;let f;switch(l){case"top":f={x:u,y:n.y-i.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-i.width,y:d};break;default:f={x:n.x,y:n.y}}switch(Ft(e)){case"start":f[o]-=h*(t&&c?-1:1);break;case"end":f[o]+=h*(t&&c?-1:1);break}return f}const X9=async(r,e,t)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=t,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:r,floating:e,strategy:i}),{x:u,y:d}=km(c,n,l),h=n,f={},m=0;for(let y=0;y<a.length;y++){const{name:v,fn:x}=a[y],{x:T,y:D,data:P,reset:N}=await x({x:u,y:d,initialPlacement:n,placement:h,strategy:i,middlewareData:f,rects:c,platform:o,elements:{reference:r,floating:e}});u=T??u,d=D??d,f={...f,[v]:{...f[v],...P}},N&&m<=50&&(m++,typeof N=="object"&&(N.placement&&(h=N.placement),N.rects&&(c=N.rects===!0?await o.getElementRects({reference:r,floating:e,strategy:i}):N.rects),{x:u,y:d}=km(c,h,l)),y=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}};async function Jn(r,e){var t;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=r,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=vr(e,r),m=y0(f),v=a[h?d==="floating"?"reference":"floating":d],x=Kn(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(v)))==null||t?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),T=d==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),P=await(s.isElement==null?void 0:s.isElement(D))?await(s.getScale==null?void 0:s.getScale(D))||{x:1,y:1}:{x:1,y:1},N=Kn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:T,offsetParent:D,strategy:l}):T);return{top:(x.top-N.top+m.top)/P.y,bottom:(N.bottom-x.bottom+m.bottom)/P.y,left:(x.left-N.left+m.left)/P.x,right:(N.right-x.right+m.right)/P.x}}const Y9=r=>({name:"arrow",options:r,async fn(e){const{x:t,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=vr(r,e)||{};if(c==null)return{};const d=y0(u),h={x:t,y:n},f=g0(i),m=m0(f),y=await o.getDimensions(c),v=f==="y",x=v?"top":"left",T=v?"bottom":"right",D=v?"clientHeight":"clientWidth",P=s.reference[m]+s.reference[f]-h[f]-s.floating[m],N=h[f]-s.reference[f],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let A=O?O[D]:0;(!A||!await(o.isElement==null?void 0:o.isElement(O)))&&(A=a.floating[D]||s.floating[m]);const $=P/2-N/2,F=A/2-y[m]/2-1,q=Xt(d[x],F),te=Xt(d[T],F),Y=q,he=A-y[m]-te,Q=A/2-y[m]/2+$,W=p0(Y,Q,he),ne=!l.arrow&&Ft(i)!=null&&Q!==W&&s.reference[m]/2-(Q<Y?q:te)-y[m]/2<0,ve=ne?Q<Y?Q-Y:Q-he:0;return{[f]:h[f]+ve,data:{[f]:W,centerOffset:Q-W-ve,...ne&&{alignmentOffset:ve}},reset:ne}}});function Z9(r,e,t){return(r?[...t.filter(i=>Ft(i)===r),...t.filter(i=>Ft(i)!==r)]:t.filter(i=>Dt(i)===i)).filter(i=>r?Ft(i)===r||(e?So(i)!==i:!1):!0)}const Q9=function(r){return r===void 0&&(r={}),{name:"autoPlacement",options:r,async fn(e){var t,n,i;const{rects:s,middlewareData:o,placement:a,platform:l,elements:c}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:h=vm,autoAlignment:f=!0,...m}=vr(r,e),y=d!==void 0||h===vm?Z9(d||null,f,h):h,v=await Jn(e,m),x=((t=o.autoPlacement)==null?void 0:t.index)||0,T=y[x];if(T==null)return{};const D=xm(T,s,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(a!==T)return{reset:{placement:y[0]}};const P=[v[Dt(T)],v[D[0]],v[D[1]]],N=[...((n=o.autoPlacement)==null?void 0:n.overflows)||[],{placement:T,overflows:P}],O=y[x+1];if(O)return{data:{index:x+1,overflows:N},reset:{placement:O}};const A=N.map(q=>{const te=Ft(q.placement);return[q.placement,te&&u?q.overflows.slice(0,2).reduce((Y,he)=>Y+he,0):q.overflows[0],q.overflows]}).sort((q,te)=>q[1]-te[1]),F=((i=A.filter(q=>q[2].slice(0,Ft(q[0])?2:3).every(te=>te<=0))[0])==null?void 0:i[0])||A[0][0];return F!==a?{data:{index:x+1,overflows:N},reset:{placement:F}}:{}}}},ex=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(e){var t,n;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...v}=vr(r,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const x=Dt(i),T=Zt(a),D=Dt(a)===a,P=await(l.isRTL==null?void 0:l.isRTL(c.floating)),N=h||(D||!y?[ko(a)]:j9(a)),O=m!=="none";!h&&O&&N.push(...K9(a,y,m,P));const A=[a,...N],$=await Jn(e,v),F=[];let q=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&F.push($[x]),d){const Q=xm(i,o,P);F.push($[Q[0]],$[Q[1]])}if(q=[...q,{placement:i,overflows:F}],!F.every(Q=>Q<=0)){var te,Y;const Q=(((te=s.flip)==null?void 0:te.index)||0)+1,W=A[Q];if(W&&(!(d==="alignment"?T!==Zt(W):!1)||q.every(ge=>Zt(ge.placement)===T?ge.overflows[0]>0:!0)))return{data:{index:Q,overflows:q},reset:{placement:W}};let ne=(Y=q.filter(ve=>ve.overflows[0]<=0).sort((ve,ge)=>ve.overflows[1]-ge.overflows[1])[0])==null?void 0:Y.placement;if(!ne)switch(f){case"bestFit":{var he;const ve=(he=q.filter(ge=>{if(O){const Ae=Zt(ge.placement);return Ae===T||Ae==="y"}return!0}).map(ge=>[ge.placement,ge.overflows.filter(Ae=>Ae>0).reduce((Ae,C)=>Ae+C,0)]).sort((ge,Ae)=>ge[1]-Ae[1])[0])==null?void 0:he[0];ve&&(ne=ve);break}case"initialPlacement":ne=a;break}if(i!==ne)return{reset:{placement:ne}}}return{}}}};function Mm(r,e){return{top:r.top-e.height,right:r.right-e.width,bottom:r.bottom-e.height,left:r.left-e.width}}function Tm(r){return gm.some(e=>r[e]>=0)}const tx=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(e){const{rects:t}=e,{strategy:n="referenceHidden",...i}=vr(r,e);switch(n){case"referenceHidden":{const s=await Jn(e,{...i,elementContext:"reference"}),o=Mm(s,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Tm(o)}}}case"escaped":{const s=await Jn(e,{...i,altBoundary:!0}),o=Mm(s,t.floating);return{data:{escapedOffsets:o,escaped:Tm(o)}}}default:return{}}}}};function Cm(r){const e=Xt(...r.map(s=>s.left)),t=Xt(...r.map(s=>s.top)),n=lt(...r.map(s=>s.right)),i=lt(...r.map(s=>s.bottom));return{x:e,y:t,width:n-e,height:i-t}}function rx(r){const e=r.slice().sort((i,s)=>i.y-s.y),t=[];let n=null;for(let i=0;i<e.length;i++){const s=e[i];!n||s.y-n.y>n.height/2?t.push([s]):t[t.length-1].push(s),n=s}return t.map(i=>Kn(Cm(i)))}const nx=function(r){return r===void 0&&(r={}),{name:"inline",options:r,async fn(e){const{placement:t,elements:n,rects:i,platform:s,strategy:o}=e,{padding:a=2,x:l,y:c}=vr(r,e),u=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),d=rx(u),h=Kn(Cm(u)),f=y0(a);function m(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&c!=null)return d.find(v=>l>v.left-f.left&&l<v.right+f.right&&c>v.top-f.top&&c<v.bottom+f.bottom)||h;if(d.length>=2){if(Zt(t)==="y"){const q=d[0],te=d[d.length-1],Y=Dt(t)==="top",he=q.top,Q=te.bottom,W=Y?q.left:te.left,ne=Y?q.right:te.right,ve=ne-W,ge=Q-he;return{top:he,bottom:Q,left:W,right:ne,width:ve,height:ge,x:W,y:he}}const v=Dt(t)==="left",x=lt(...d.map(q=>q.right)),T=Xt(...d.map(q=>q.left)),D=d.filter(q=>v?q.left===T:q.right===x),P=D[0].top,N=D[D.length-1].bottom,O=T,A=x,$=A-O,F=N-P;return{top:P,bottom:N,left:O,right:A,width:$,height:F,x:O,y:P}}return h}const y=await s.getElementRects({reference:{getBoundingClientRect:m},floating:n.floating,strategy:o});return i.reference.x!==y.reference.x||i.reference.y!==y.reference.y||i.reference.width!==y.reference.width||i.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},ix=new Set(["left","top"]);async function sx(r,e){const{placement:t,platform:n,elements:i}=r,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Dt(t),a=Ft(t),l=Zt(t)==="y",c=ix.has(o)?-1:1,u=s&&l?-1:1,d=vr(e,r);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(f=a==="end"?m*-1:m),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const ox=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(e){var t,n;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await sx(e,r);return o===((t=a.offset)==null?void 0:t.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},ax=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(e){const{x:t,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:v=>{let{x,y:T}=v;return{x,y:T}}},...l}=vr(r,e),c={x:t,y:n},u=await Jn(e,l),d=Zt(Dt(i)),h=bm(d);let f=c[h],m=c[d];if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",T=f+u[v],D=f-u[x];f=p0(T,f,D)}if(o){const v=d==="y"?"top":"left",x=d==="y"?"bottom":"right",T=m+u[v],D=m-u[x];m=p0(T,m,D)}const y=a.fn({...e,[h]:f,[d]:m});return{...y,data:{x:y.x-t,y:y.y-n,enabled:{[h]:s,[d]:o}}}}}},lx=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(e){var t,n;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=vr(r,e),u=await Jn(e,c),d=Dt(i),h=Ft(i),f=Zt(i)==="y",{width:m,height:y}=s.floating;let v,x;d==="top"||d==="bottom"?(v=d,x=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,v=h==="end"?"top":"bottom");const T=y-u.top-u.bottom,D=m-u.left-u.right,P=Xt(y-u[v],T),N=Xt(m-u[x],D),O=!e.middlewareData.shift;let A=P,$=N;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&($=D),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(A=T),O&&!h){const q=lt(u.left,0),te=lt(u.right,0),Y=lt(u.top,0),he=lt(u.bottom,0);f?$=m-2*(q!==0||te!==0?q+te:lt(u.left,u.right)):A=y-2*(Y!==0||he!==0?Y+he:lt(u.top,u.bottom))}await l({...e,availableWidth:$,availableHeight:A});const F=await o.getDimensions(a.floating);return m!==F.width||y!==F.height?{reset:{rects:!0}}:{}}}};function Mo(){return typeof window<"u"}function Xn(r){return Em(r)?(r.nodeName||"").toLowerCase():"#document"}function St(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function br(r){var e;return(e=(Em(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function Em(r){return Mo()?r instanceof Node||r instanceof St(r).Node:!1}function $t(r){return Mo()?r instanceof Element||r instanceof St(r).Element:!1}function Qt(r){return Mo()?r instanceof HTMLElement||r instanceof St(r).HTMLElement:!1}function Am(r){return!Mo()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof St(r).ShadowRoot}const cx=new Set(["inline","contents"]);function Vi(r){const{overflow:e,overflowX:t,overflowY:n,display:i}=Ht(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!cx.has(i)}const ux=new Set(["table","td","th"]);function dx(r){return ux.has(Xn(r))}const hx=[":popover-open",":modal"];function To(r){return hx.some(e=>{try{return r.matches(e)}catch{return!1}})}const fx=["transform","translate","scale","rotate","perspective"],px=["transform","translate","scale","rotate","perspective","filter"],mx=["paint","layout","strict","content"];function v0(r){const e=b0(),t=$t(r)?Ht(r):r;return fx.some(n=>t[n]?t[n]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||px.some(n=>(t.willChange||"").includes(n))||mx.some(n=>(t.contain||"").includes(n))}function gx(r){let e=Jr(r);for(;Qt(e)&&!Yn(e);){if(v0(e))return e;if(To(e))return null;e=Jr(e)}return null}function b0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yx=new Set(["html","body","#document"]);function Yn(r){return yx.has(Xn(r))}function Ht(r){return St(r).getComputedStyle(r)}function Co(r){return $t(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function Jr(r){if(Xn(r)==="html")return r;const e=r.assignedSlot||r.parentNode||Am(r)&&r.host||br(r);return Am(e)?e.host:e}function Om(r){const e=Jr(r);return Yn(e)?r.ownerDocument?r.ownerDocument.body:r.body:Qt(e)&&Vi(e)?e:Om(e)}function Nm(r,e,t){var n;e===void 0&&(e=[]);const i=Om(r),s=i===((n=r.ownerDocument)==null?void 0:n.body),o=St(i);return s?(x0(o),e.concat(o,o.visualViewport||[],Vi(i)?i:[],[])):e.concat(i,Nm(i,[]))}function x0(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function Dm(r){const e=Ht(r);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Qt(r),s=i?r.offsetWidth:t,o=i?r.offsetHeight:n,a=wo(t)!==s||wo(n)!==o;return a&&(t=s,n=o),{width:t,height:n,$:a}}function zm(r){return $t(r)?r:r.contextElement}function Zn(r){const e=zm(r);if(!Qt(e))return Yt(1);const t=e.getBoundingClientRect(),{width:n,height:i,$:s}=Dm(e);let o=(s?wo(t.width):t.width)/n,a=(s?wo(t.height):t.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const vx=Yt(0);function Im(r){const e=St(r);return!b0()||!e.visualViewport?vx:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bx(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==St(r)?!1:e}function qi(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=r.getBoundingClientRect(),s=zm(r);let o=Yt(1);e&&(n?$t(n)&&(o=Zn(n)):o=Zn(r));const a=bx(s,t,n)?Im(s):Yt(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const h=St(s),f=n&&$t(n)?St(n):n;let m=h,y=x0(m);for(;y&&n&&f!==m;){const v=Zn(y),x=y.getBoundingClientRect(),T=Ht(y),D=x.left+(y.clientLeft+parseFloat(T.paddingLeft))*v.x,P=x.top+(y.clientTop+parseFloat(T.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=D,c+=P,m=St(y),y=x0(m)}}return Kn({width:u,height:d,x:l,y:c})}function Eo(r,e){const t=Co(r).scrollLeft;return e?e.left+t:qi(br(r)).left+t}function Rm(r,e){const t=r.getBoundingClientRect(),n=t.left+e.scrollLeft-Eo(r,t),i=t.top+e.scrollTop;return{x:n,y:i}}function xx(r){let{elements:e,rect:t,offsetParent:n,strategy:i}=r;const s=i==="fixed",o=br(n),a=e?To(e.floating):!1;if(n===o||a&&s)return t;let l={scrollLeft:0,scrollTop:0},c=Yt(1);const u=Yt(0),d=Qt(n);if((d||!d&&!s)&&((Xn(n)!=="body"||Vi(o))&&(l=Co(n)),Qt(n))){const f=qi(n);c=Zn(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}const h=o&&!d&&!s?Rm(o,l):Yt(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:t.y*c.y-l.scrollTop*c.y+u.y+h.y}}function wx(r){return Array.from(r.getClientRects())}function Sx(r){const e=br(r),t=Co(r),n=r.ownerDocument.body,i=lt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=lt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Eo(r);const a=-t.scrollTop;return Ht(n).direction==="rtl"&&(o+=lt(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}const Pm=25;function kx(r,e){const t=St(r),n=br(r),i=t.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=b0();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=Eo(n);if(c<=0){const u=n.ownerDocument,d=u.body,h=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(n.clientWidth-d.clientWidth-f);m<=Pm&&(s-=m)}else c<=Pm&&(s+=c);return{width:s,height:o,x:a,y:l}}const Mx=new Set(["absolute","fixed"]);function Tx(r,e){const t=qi(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,s=Qt(r)?Zn(r):Yt(1),o=r.clientWidth*s.x,a=r.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:o,height:a,x:l,y:c}}function Lm(r,e,t){let n;if(e==="viewport")n=kx(r,t);else if(e==="document")n=Sx(br(r));else if($t(e))n=Tx(e,t);else{const i=Im(r);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Kn(n)}function Bm(r,e){const t=Jr(r);return t===e||!$t(t)||Yn(t)?!1:Ht(t).position==="fixed"||Bm(t,e)}function Cx(r,e){const t=e.get(r);if(t)return t;let n=Nm(r,[]).filter(a=>$t(a)&&Xn(a)!=="body"),i=null;const s=Ht(r).position==="fixed";let o=s?Jr(r):r;for(;$t(o)&&!Yn(o);){const a=Ht(o),l=v0(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&Mx.has(i.position)||Vi(o)&&!l&&Bm(r,o))?n=n.filter(u=>u!==o):i=a,o=Jr(o)}return e.set(r,n),n}function Ex(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r;const o=[...t==="clippingAncestors"?To(e)?[]:Cx(e,this._c):[].concat(t),n],a=o[0],l=o.reduce((c,u)=>{const d=Lm(e,u,i);return c.top=lt(d.top,c.top),c.right=Xt(d.right,c.right),c.bottom=Xt(d.bottom,c.bottom),c.left=lt(d.left,c.left),c},Lm(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ax(r){const{width:e,height:t}=Dm(r);return{width:e,height:t}}function Ox(r,e,t){const n=Qt(e),i=br(e),s=t==="fixed",o=qi(r,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Yt(0);function c(){l.x=Eo(i)}if(n||!n&&!s)if((Xn(e)!=="body"||Vi(i))&&(a=Co(e)),n){const f=qi(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&c();s&&!n&&i&&c();const u=i&&!n&&!s?Rm(i,a):Yt(0),d=o.left+a.scrollLeft-l.x-u.x,h=o.top+a.scrollTop-l.y-u.y;return{x:d,y:h,width:o.width,height:o.height}}function w0(r){return Ht(r).position==="static"}function Fm(r,e){if(!Qt(r)||Ht(r).position==="fixed")return null;if(e)return e(r);let t=r.offsetParent;return br(r)===t&&(t=t.ownerDocument.body),t}function $m(r,e){const t=St(r);if(To(r))return t;if(!Qt(r)){let i=Jr(r);for(;i&&!Yn(i);){if($t(i)&&!w0(i))return i;i=Jr(i)}return t}let n=Fm(r,e);for(;n&&dx(n)&&w0(n);)n=Fm(n,e);return n&&Yn(n)&&w0(n)&&!v0(n)?t:n||gx(r)||t}const Nx=async function(r){const e=this.getOffsetParent||$m,t=this.getDimensions,n=await t(r.floating);return{reference:Ox(r.reference,await e(r.floating),r.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Dx(r){return Ht(r).direction==="rtl"}const zx={convertOffsetParentRelativeRectToViewportRelativeRect:xx,getDocumentElement:br,getClippingRect:Ex,getOffsetParent:$m,getElementRects:Nx,getClientRects:wx,getDimensions:Ax,getScale:Zn,isElement:$t,isRTL:Dx},Hm=ox,Vm=Q9,qm=ax,_m=ex,jm=lx,Um=tx,Wm=Y9,Gm=nx,Km=(r,e,t)=>{const n=new Map,i={platform:zx,...t},s={...i.platform,_c:n};return X9(r,e,{...i,platform:s})};let S0,k0;if(typeof WeakMap<"u"){let r=new WeakMap;S0=e=>r.get(e),k0=(e,t)=>(r.set(e,t),t)}else{const r=[];let t=0;S0=n=>{for(let i=0;i<r.length;i+=2)if(r[i]==n)return r[i+1]},k0=(n,i)=>(t==10&&(t=0),r[t++]=n,r[t++]=i)}var xr=class{constructor(r,e,t,n){this.width=r,this.height=e,this.map=t,this.problems=n}findCell(r){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=r)continue;const n=e%this.width,i=e/this.width|0;let s=n+1,o=i+1;for(let a=1;s<this.width&&this.map[e+a]==t;a++)s++;for(let a=1;o<this.height&&this.map[e+this.width*a]==t;a++)o++;return{left:n,top:i,right:s,bottom:o}}throw new RangeError(`No cell with offset ${r} found`)}colCount(r){for(let e=0;e<this.map.length;e++)if(this.map[e]==r)return e%this.width;throw new RangeError(`No cell with offset ${r} found`)}nextCell(r,e,t){const{left:n,right:i,top:s,bottom:o}=this.findCell(r);return e=="horiz"?(t<0?n==0:i==this.width)?null:this.map[s*this.width+(t<0?n-1:i)]:(t<0?s==0:o==this.height)?null:this.map[n+this.width*(t<0?s-1:o)]}rectBetween(r,e){const{left:t,right:n,top:i,bottom:s}=this.findCell(r),{left:o,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(t,o),top:Math.min(i,l),right:Math.max(n,a),bottom:Math.max(s,c)}}cellsInRect(r){const e=[],t={};for(let n=r.top;n<r.bottom;n++)for(let i=r.left;i<r.right;i++){const s=n*this.width+i,o=this.map[s];t[o]||(t[o]=!0,!(i==r.left&&i&&this.map[s-1]==o||n==r.top&&n&&this.map[s-this.width]==o)&&e.push(o))}return e}positionAt(r,e,t){for(let n=0,i=0;;n++){const s=i+t.child(n).nodeSize;if(n==r){let o=e+r*this.width;const a=(r+1)*this.width;for(;o<a&&this.map[o]<i;)o++;return o==a?s-1:this.map[o]}i=s}}static get(r){return S0(r)||k0(r,Ix(r))}};function Ix(r){if(r.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+r.type.name);const e=Rx(r),t=r.childCount,n=[];let i=0,s=null;const o=[];for(let c=0,u=e*t;c<u;c++)n[c]=0;for(let c=0,u=0;c<t;c++){const d=r.child(c);u++;for(let m=0;;m++){for(;i<n.length&&n[i]!=0;)i++;if(m==d.childCount)break;const y=d.child(m),{colspan:v,rowspan:x,colwidth:T}=y.attrs;for(let D=0;D<x;D++){if(D+c>=t){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:x-D});break}const P=i+D*e;for(let N=0;N<v;N++){n[P+N]==0?n[P+N]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:v-N});const O=T&&T[N];if(O){const A=(P+N)%e*2,$=o[A];$==null||$!=O&&o[A+1]==1?(o[A]=O,o[A+1]=1):$==O&&o[A+1]++}}}i+=v,u+=y.nodeSize}const h=(c+1)*e;let f=0;for(;i<h;)n[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(e===0||t===0)&&(s||(s=[])).push({type:"zero_sized"});const a=new xr(e,t,n,s);let l=!1;for(let c=0;!l&&c<o.length;c+=2)o[c]!=null&&o[c+1]<t&&(l=!0);return l&&Px(a,o,r),a}function Rx(r){let e=-1,t=!1;for(let n=0;n<r.childCount;n++){const i=r.child(n);let s=0;if(t)for(let o=0;o<n;o++){const a=r.child(o);for(let l=0;l<a.childCount;l++){const c=a.child(l);o+c.attrs.rowspan>n&&(s+=c.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const a=i.child(o);s+=a.attrs.colspan,a.attrs.rowspan>1&&(t=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function Px(r,e,t){r.problems||(r.problems=[]);const n={};for(let i=0;i<r.map.length;i++){const s=r.map[i];if(n[s])continue;n[s]=!0;const o=t.nodeAt(s);if(!o)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=o.attrs;for(let c=0;c<l.colspan;c++){const u=e[(i+c)%r.width*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((a||(a=Lx(l)))[c]=u)}a&&r.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function Lx(r){if(r.colwidth)return r.colwidth.slice();const e=[];for(let t=0;t<r.colspan;t++)e.push(0);return e}function M0(r){let e=r.cached.tableNodeTypes;if(!e){e=r.cached.tableNodeTypes={};for(const t in r.nodes){const n=r.nodes[t],i=n.spec.tableRole;i&&(e[i]=n)}}return e}new Fe("selectingCells");function Bx(r){for(let e=r.depth-1;e>0;e--)if(r.node(e).type.spec.tableRole=="row")return r.node(0).resolve(r.before(e+1));return null}function Jm(r){const e=r.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function Fx(r){const e=r.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=Bx(e.$head)||$x(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function $x(r){for(let e=r.nodeAfter,t=r.pos;e;e=e.firstChild,t++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t)}for(let e=r.nodeBefore,t=r.pos;e;e=e.lastChild,t--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t-e.nodeSize)}}function Xm(r){return r.parent.type.spec.tableRole=="row"&&!!r.nodeAfter}function Ym(r,e){return r.depth==e.depth&&r.pos>=e.start(-1)&&r.pos<=e.end(-1)}function Zm(r,e,t){const n=r.node(-1),i=xr.get(n),s=r.start(-1),o=i.nextCell(r.pos-s,e,t);return o==null?null:r.node(0).resolve(s+o)}function Qm(r,e,t=1){const n={...r,colspan:r.colspan-t};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,t),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}var er=class wr extends ce{constructor(e,t=e){const n=e.node(-1),i=xr.get(n),s=e.start(-1),o=i.rectBetween(e.pos-s,t.pos-s),a=e.node(0),l=i.cellsInRect(o).filter(u=>u!=t.pos-s);l.unshift(t.pos-s);const c=l.map(u=>{const d=n.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new hu(a.resolve(h),a.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(e,t){const n=e.resolve(t.map(this.$anchorCell.pos)),i=e.resolve(t.map(this.$headCell.pos));if(Xm(n)&&Xm(i)&&Ym(n,i)){const s=this.$anchorCell.node(-1)!=n.node(-1);return s&&this.isRowSelection()?wr.rowSelection(n,i):s&&this.isColSelection()?wr.colSelection(n,i):new wr(n,i)}return de.between(n,i)}content(){const e=this.$anchorCell.node(-1),t=xr.get(e),n=this.$anchorCell.start(-1),i=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),s={},o=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let u=l*t.width+i.left,d=i.left;d<i.right;d++,u++){const h=t.map[u];if(s[h])continue;s[h]=!0;const f=t.findCell(h);let m=e.nodeAt(h);if(!m)throw new RangeError(`No cell with offset ${h} found`);const y=i.left-f.left,v=f.right-i.right;if(y>0||v>0){let x=m.attrs;if(y>0&&(x=Qm(x,0,y)),v>0&&(x=Qm(x,x.colspan-v,v)),f.left<i.left){if(m=m.type.createAndFill(x),!m)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(x)}`)}else m=m.type.create(x,m.content)}if(f.top<i.top||f.bottom>i.bottom){const x={...m.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?m=m.type.createAndFill(x):m=m.type.create(x,m.content)}c.push(m)}o.push(e.child(l).copy(H.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new X(H.from(a),1,1)}replace(e,t=X.empty){const n=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:a,$to:l}=i[o],c=e.mapping.slice(n);e.replace(c.map(a.pos),c.map(l.pos),o?X.empty:t)}const s=ce.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,t){this.replace(e,new X(H.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=xr.get(t),i=this.$anchorCell.start(-1),s=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(t.nodeAt(s[o]),i+s[o])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const n=e.node(-1),i=xr.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(t.pos-s),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(s+i.map[o.left])),a.bottom<i.height&&(t=l.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(t=l.resolve(s+i.map[a.left])),o.bottom<i.height&&(e=l.resolve(s+i.map[i.width*(i.height-1)+o.right-1]))),new wr(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=xr.get(e),n=this.$anchorCell.start(-1),i=t.colCount(this.$anchorCell.pos-n),s=t.colCount(this.$headCell.pos-n);if(Math.min(i,s)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==t.width}eq(e){return e instanceof wr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const n=e.node(-1),i=xr.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(t.pos-s),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(s+i.map[o.top*i.width])),a.right<i.width&&(t=l.resolve(s+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(t=l.resolve(s+i.map[a.top*i.width])),o.right<i.width&&(e=l.resolve(s+i.map[i.width*(o.top+1)-1]))),new wr(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new wr(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new wr(e.resolve(t),e.resolve(n))}getBookmark(){return new Hx(this.$anchorCell.pos,this.$headCell.pos)}};er.prototype.visible=!1,ce.jsonID("cell",er);var Hx=class w1{constructor(e,t){this.anchor=e,this.head=t}map(e){return new w1(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Ym(t,n)?new er(t,n):ce.near(n,1)}};new Fe("fix-tables");function e1(r){const e=r.selection,t=Fx(r),n=t.node(-1),i=t.start(-1),s=xr.get(n);return{...e instanceof er?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(t.pos-i),tableStart:i,map:s,table:n}}function Vx(r){return function(e,t){if(!Jm(e))return!1;if(t){const n=M0(e.schema),i=e1(e),s=e.tr,o=i.map.cellsInRect(r=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:r=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==n.header_cell&&s.setNodeMarkup(i.tableStart+o[l],n.cell,a[l].attrs);if(s.steps.length===0)for(let l=0;l<o.length;l++)s.setNodeMarkup(i.tableStart+o[l],n.header_cell,a[l].attrs);t(s)}return!0}}function t1(r,e,t){const n=e.map.cellsInRect({left:0,top:0,right:r=="row"?e.map.width:1,bottom:r=="column"?e.map.height:1});for(let i=0;i<n.length;i++){const s=e.table.nodeAt(n[i]);if(s&&s.type!==t.header_cell)return!1}return!0}function T0(r,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Vx(r):function(t,n){if(!Jm(t))return!1;if(n){const i=M0(t.schema),s=e1(t),o=t.tr,a=t1("row",s,i),l=t1("column",s,i),c=(r==="column"?a:r==="row"&&l)?1:0,u=r=="column"?{left:0,top:c,right:1,bottom:s.map.height}:r=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=r=="column"?l?i.cell:i.header_cell:r=="row"?a?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,m=o.doc.nodeAt(f);m&&o.setNodeMarkup(f,d,m.attrs)}),n(o)}return!0}}T0("row",{useDeprecatedLogic:!0}),T0("column",{useDeprecatedLogic:!0}),T0("cell",{useDeprecatedLogic:!0});function Ao(r,e){const t=r.selection;if(!(t instanceof er))return!1;if(e){const n=r.tr,i=M0(r.schema).cell.createAndFill().content;t.forEachCell((s,o)=>{s.content.eq(i)||n.replace(n.mapping.map(o+1),n.mapping.map(o+s.nodeSize-1),new X(i,0,0))}),n.docChanged&&e(n)}return!0}Ha({ArrowLeft:No("horiz",-1),ArrowRight:No("horiz",1),ArrowUp:No("vert",-1),ArrowDown:No("vert",1),"Shift-ArrowLeft":Do("horiz",-1),"Shift-ArrowRight":Do("horiz",1),"Shift-ArrowUp":Do("vert",-1),"Shift-ArrowDown":Do("vert",1),Backspace:Ao,"Mod-Backspace":Ao,Delete:Ao,"Mod-Delete":Ao});function Oo(r,e,t){return t.eq(r.selection)?!1:(e&&e(r.tr.setSelection(t).scrollIntoView()),!0)}function No(r,e){return(t,n,i)=>{if(!i)return!1;const s=t.selection;if(s instanceof er)return Oo(t,n,ce.near(s.$headCell,e));if(r!="horiz"&&!s.empty)return!1;const o=r1(i,r,e);if(o==null)return!1;if(r=="horiz")return Oo(t,n,ce.near(t.doc.resolve(s.head+e),e));{const a=t.doc.resolve(o),l=Zm(a,r,e);let c;return l?c=ce.near(l,1):e<0?c=ce.near(t.doc.resolve(a.before(-1)),-1):c=ce.near(t.doc.resolve(a.after(-1)),1),Oo(t,n,c)}}}function Do(r,e){return(t,n,i)=>{if(!i)return!1;const s=t.selection;let o;if(s instanceof er)o=s;else{const l=r1(i,r,e);if(l==null)return!1;o=new er(t.doc.resolve(l))}const a=Zm(o.$headCell,r,e);return a?Oo(t,n,new er(o.$anchorCell,a)):!1}}function r1(r,e,t){if(!(r.state.selection instanceof de))return null;const{$head:n}=r.state.selection;for(let i=n.depth-1;i>=0;i--){const s=n.node(i);if((t<0?n.index(i):n.indexAfter(i))!=(t<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const o=n.before(i),a=e=="vert"?t>0?"down":"up":t>0?"right":"left";return r.endOfTextblock(a)?o:null}}return null}new Fe("tableColumnResizing");function qx(r,e){const t=Math.min(r.top,e.top),n=Math.max(r.bottom,e.bottom),i=Math.min(r.left,e.left),o=Math.max(r.right,e.right)-i,a=n-t,l=i,c=t;return new DOMRect(l,c,o,a)}var _x=class{constructor({editor:r,element:e,view:t,updateDelay:n=250,resizeDelay:i=60,shouldShow:s,appendTo:o,getReferencedVirtualElement:a,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:u,state:d,from:h,to:f})=>{const{doc:m,selection:y}=d,{empty:v}=y,x=!m.textBetween(h,f).length&&ja(d.selection),T=this.element.contains(document.activeElement);return!(!(u.hasFocus()||T)||v||x||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&((d=this.element.parentNode)!=null&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(u,d)=>{const h=!d?.selection.eq(u.state.selection),f=!d?.doc.eq(u.state.doc);!h&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,h,f,d)},this.updateDelay))},this.updateHandler=(u,d,h,f)=>{const{composing:m}=u;if(m||!d&&!h)return;if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:u})=>{u.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var c;this.editor=r,this.element=e,this.view=t,this.updateDelay=n,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=(c=l?.scrollTarget)!=null?c:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const r=[];return this.floatingUIOptions.flip&&r.push(_m(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&r.push(qm(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&r.push(Hm(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&r.push(Wm(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&r.push(jm(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&r.push(Vm(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&r.push(Um(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&r.push(Gm(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),r}get virtualElement(){var r;const{selection:e}=this.editor.state,t=(r=this.getReferencedVirtualElement)==null?void 0:r.call(this);if(t)return t;const n=mh(this.view,e.from,e.to);let i={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof se){let s=this.view.nodeDOM(e.from);const o=s.dataset.nodeViewWrapper?s:s.querySelector("[data-node-view-wrapper]");o&&(s=o),s&&(i={getBoundingClientRect:()=>s.getBoundingClientRect(),getClientRects:()=>[s.getBoundingClientRect()]})}if(e instanceof er){const{$anchorCell:s,$headCell:o}=e,a=s?s.pos:o.pos,l=o?o.pos:s.pos,c=this.view.nodeDOM(a),u=this.view.nodeDOM(l);if(!c||!u)return;const d=c===u?c.getBoundingClientRect():qx(c.getBoundingClientRect(),u.getBoundingClientRect());i={getBoundingClientRect:()=>d,getClientRects:()=>[d]}}return i}updatePosition(){const r=this.virtualElement;r&&Km(r,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n})=>{this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(r,e){const{state:t}=r,n=t.selection.from!==t.selection.to;if(this.updateDelay>0&&n){this.handleDebouncedUpdate(r,e);return}const i=!e?.selection.eq(r.state.selection),s=!e?.doc.eq(r.state.doc);this.updateHandler(r,i,s,e)}getShouldShow(r){var e;const{state:t}=this.view,{selection:n}=t,{ranges:i}=n,s=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:r,from:s,to:o}))||!1}show(){var r;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(r=e??this.view.dom.parentElement)==null||r.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},n1=r=>new Pe({key:typeof r.pluginKey=="string"?new Fe(r.pluginKey):r.pluginKey,view:e=>new _x({view:e,...r})});Se.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[n1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var jx=class{constructor({editor:r,element:e,view:t,options:n,appendTo:i,shouldShow:s}){this.preventHide=!1,this.isVisible=!1,this.shouldShow=({view:o,state:a})=>{const{selection:l}=a,{$anchor:c,empty:u}=l,d=c.depth===1,h=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent&&c.parent.childCount===0&&!this.getTextContent(c.parent);return!(!o.hasFocus()||!u||!d||!h||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(o,a,l,c)=>{const{composing:u}=o;if(u||!a&&!l)return;if(!this.getShouldShow(c)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var a;if(this.preventHide){this.preventHide=!1;return}o?.relatedTarget&&((a=this.element.parentNode)!=null&&a.contains(o.relatedTarget))||o?.relatedTarget!==this.editor.view.dom&&this.hide()},this.editor=r,this.element=e,this.view=t,this.appendTo=i,this.floatingUIOptions={...this.floatingUIOptions,...n},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(r){return uh(r,{textSerializers:Ja(this.editor.schema)})}get middlewares(){const r=[];return this.floatingUIOptions.flip&&r.push(_m(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&r.push(qm(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&r.push(Hm(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&r.push(Wm(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&r.push(jm(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&r.push(Vm(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&r.push(Um(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&r.push(Gm(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),r}getShouldShow(r){var e;const{state:t}=this.view,{selection:n}=t,{ranges:i}=n,s=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:t,oldState:r,from:s,to:o})}updatePosition(){const{selection:r}=this.editor.state,e=mh(this.view,r.from,r.to);Km({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:n,y:i,strategy:s})=>{this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${n}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(r,e){const t=!e?.selection.eq(r.state.selection),n=!e?.doc.eq(r.state.doc);this.updateHandler(r,t,n,e)}show(){var r;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(r=e??this.view.dom.parentElement)==null||r.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},i1=r=>new Pe({key:typeof r.pluginKey=="string"?new Fe(r.pluginKey):r.pluginKey,view:e=>new jx({view:e,...r})});Se.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[i1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var Ux=z.forwardRef(({pluginKey:r="bubbleMenu",editor:e,updateDelay:t,resizeDelay:n,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:o,options:a,children:l,...c},u)=>{const d=z.useRef(document.createElement("div"));typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:h}=Qh(),f=e||h,m={updateDelay:t,resizeDelay:n,appendTo:i,pluginKey:r,shouldShow:s,getReferencedVirtualElement:o,options:a},y=z.useRef(m);return y.current=m,z.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const v=d.current;v.style.visibility="hidden",v.style.position="absolute";const x=n1({...y.current,editor:f,element:v});f.registerPlugin(x);const T=y.current.pluginKey;return()=>{f.unregisterPlugin(T),window.requestAnimationFrame(()=>{v.parentNode&&v.parentNode.removeChild(v)})}},[f]),ji.createPortal(J.jsx("div",{...c,children:l}),d.current)});z.forwardRef(({pluginKey:r="floatingMenu",editor:e,appendTo:t,shouldShow:n=null,options:i,children:s,...o},a)=>{const l=z.useRef(document.createElement("div"));typeof a=="function"?a(l.current):a&&(a.current=l.current);const{editor:c}=Qh();return z.useEffect(()=>{const u=l.current;if(u.style.visibility="hidden",u.style.position="absolute",e?.isDestroyed||c?.isDestroyed)return;const d=e||c;if(!d){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const h=i1({editor:d,element:u,pluginKey:r,appendTo:t,shouldShow:n,options:i});return d.registerPlugin(h),()=>{d.unregisterPlugin(r),window.requestAnimationFrame(()=>{u.parentNode&&u.parentNode.removeChild(u)})}},[e,c,t,r,n,i]),ji.createPortal(J.jsx("div",{...o,children:s}),l.current)});const Wx=({editor:r})=>{if(!r)return null;const[e]=z.useState(!0),[t]=z.useState(!0);z.useEffect(()=>{r&&r.setEditable(t)},[t,r]);const n=Xh({editor:r,selector:i=>({isTerm:i.editor.isActive("term"),canTerm:i.editor.can().chain().focus().toggleMark("term").run(),isEm:i.editor.isActive("em"),canEm:i.editor.can().chain().focus().toggleMark("em").run(),isAlert:i.editor.isActive("alert"),canAlert:i.editor.can().chain().focus().toggleMark("alert").run()})});return J.jsx(J.Fragment,{children:r&&e&&J.jsx(Ux,{shouldShow:null,editor:r,options:{placement:"bottom",autoPlacement:!0,offset:8},children:J.jsxs("div",{className:"button-group",children:[J.jsx("button",{onClick:()=>r.chain().focus().toggleMark("em").run(),disabled:!n.canEm,className:n.isEm?"is-active":"",children:"<em>"}),J.jsx("button",{onClick:()=>r.chain().focus().toggleMark("term").run(),disabled:!n.canTerm,className:n.isTerm?"is-active":"",children:"<term>"}),J.jsx("button",{onClick:()=>r.chain().focus().toggleMark("alert").run(),disabled:!n.canAlert,className:n.isAlert?"is-active":"",children:"<alert>"})]})})})},s1=["abstract","acknowledgement","affiliation","appendix","article","author","backmatter","biography","book","chapter","colophon","contributor","contributors","copyright","credit","dedication","docinfo","editor","feedback","frontmatter","google","html","index","macros","mathbook","preface","pretext","references","search","shortlicense","solutions","subsection","titlepage","website"],o1=["assemblage","chapter","conclusion","introduction","objectives","outcomes","paragraphs","part","postlude","prelude","reading-questions","sbsgroup","section","stack","subsection","subsubsection","task","technology","worksheet"],a1=["activity","algorithm","answer","axiom","biblio","blockquote","case","choice","choices","claim","conjecture","console","corollary","definition","demonstration","description","example","exercise","exploration","fact","hint","image","images","insight","investigation","lemma","list","listing","note","openconjecture","openproblem","openquestion","page","poem","principle","problem","program","project","proof","proposition","question","remark","shortdescription","solution","stanza","statement","subtask","table","tabular","theorem","warning","webwork"],Gx=["address","attribution","caption","cd","cell","cline","date","department","description","edition","entity","holder","idx","institution","journal","line","location","minilicense","mrow","personname","pg-macros","pubtitle","row","subtitle","support","title","usage","volume","year","xi:include"],Kx=["me","men","md","mdn"],l1=["ul","ol","li","p","task","figure","sidebyside","notation","row"],zo=["latex-image-preamble","latex-image","latex-preamble","slate","sage","sageplot","asymptote","macros","prefigure","program","input","output","prompt","pre","pg-code","tikzpicture","tikz","code","c"],Jx=[...s1,...o1,...a1,...l1,"xi:include"],C0=[...s1,...o1,...a1,...l1,...Kx];function Xx(r){let e=!1,t=r.split(/\r\n|\r|\n/g),n=[t[0].trim()];t.length>1&&n.push(t[1].trim());for(let i=2;i<t.length;i++){let s=/^<(\w\S*?)(\s.*?|>)$/.exec(t[i].trim()),o=/^<\/(\w\S*?)(\s.*?|>)(.?)$/.exec(t[i].trim());if(s&&zo.includes(s[1]))n.push(t[i]),e=!0;else if(o&&zo.includes(o[1]))n.push(t[i]),e=!1;else if(e)n.push(t[i]);else{t[i]=t[i].trim();let a=n.pop();a?n.push(a.trim()+" "+t[i]):n.push(t[i])}}return n.join(`
422
422
  `)}function Yx(r,e){const n="some";let i=Xx(r);console.log("Getting ready to start formatting.");for(let u of C0)if(i.includes("<"+u)){let d=new RegExp("<"+u+"(>|(\\s[^\\/]*?)>|(.*xmlns.*?)>)","g"),h=new RegExp("<\\/"+u+">([\\s\\S]*?[.,!?;:]?)","g");i=i.replace(d,`
423
423
  $&
424
424
  `),i=i.replace(h,`
@@ -431,7 +431,7 @@ $&`),i=i.replace(h,`$&
431
431
  `);else c[u].trim().startsWith("<title>")&&(c[u]+=`
432
432
  `);break;case"many":for(let u=0;u<c.length-1;u++)(c[u].trim().startsWith("</")||c[u].trim().startsWith("<")&&c[u+1].trim().startsWith("<"))&&(c[u]+=`
433
433
  `);break}return i=c.join(`
434
- `),i}const Zx=we.create({name:"ptxFragment",topNode:!0,content:"ptxdoc"}),Qx=[P9.configure({defaultLanguage:"xml"}),Zx,vb,cf,xf,uf,D9,cb,L9,B9,F9,$9,Q8,eb,tb,D7.configure({mode:"deepest"}),I7,z7],c1=({content:r,onChange:e})=>{const t=I.useRef(null),n=I.useRef(!1),i=Py({extensions:Qx,content:r,onContentError(l){console.log("Content error: ",l.error),l.disableCollaboration(),l.editor.setEditable(!1,!1)},enableContentCheck:!0,onUpdate:({editor:l})=>{console.log("Editor update detected."),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{n.current&&e(Yx(H9(l.getJSON())))},500)}});I.useEffect(()=>()=>{t.current&&clearTimeout(t.current)},[]);const s=I.useRef(!0);I.useEffect(()=>{if(i&&r!==i.getHTML()&&s.current){const l=r;if(i)try{i.commands.setContent(b9(l),{emitUpdate:!1}),console.log("External content set in visual editor.")}catch(c){console.error("Error setting content: ",c)}}},[r,i]),I.useEffect(()=>{if(!i)return;const l=()=>{s.current=!1};return i.on("update",l),()=>{i.off("update",l)}},[i]),I.useEffect(()=>{s.current=!0},[r]);const[o,a]=I.useState(!1);return I.useEffect(()=>{n.current=o,i&&i.setEditable(o,!1)},[i,o]),J.jsxs("div",{className:"pretext-plus-editor__visual-editor",children:[J.jsxs("div",{className:"pretext-plus-editor__visual-editor-header",children:[J.jsx("p",{className:"pretext-plus-editor__visual-editor-title",children:"Simple Preview"}),J.jsxs("label",{className:"pretext-plus-editor__edit-toggle",children:[J.jsx("input",{className:"pretext-plus-editor__edit-checkbox",type:"checkbox",checked:o,onChange:()=>a(!o)}),"Edit"]})]}),J.jsx("div",{className:(o?"editable":"read-only")+" ptx-page",children:J.jsx(Ny,{editor:i})}),J.jsx(Wx,{editor:i})]})},u1=(r,e,t)=>{const n=document.createElement("form");n.method="POST",n.action=r,n.target=t,n.style.display="none";for(const i in e)if(Object.hasOwnProperty.call(e,i)){const s=document.createElement("input");s.type="hidden",s.name=i,s.value=e[i],n.appendChild(s)}document.body.appendChild(n),n.submit(),n.remove()},d1=({content:r,title:e,onRebuild:t})=>{const[n,i]=I.useState(!1),s=I.useRef(null),o=I.useCallback(()=>{const l=r,c=e||"Document Title";if(i(!0),t){t(l,c,(d,h)=>{u1(d,h,"fullPreview")});return}},[r,e,t]);I.useEffect(()=>{o()},[]);const a=()=>{i(!1)};return J.jsxs("div",{className:"pretext-plus-editor__full-preview",children:[J.jsxs("div",{className:"pretext-plus-editor__preview-header",children:[J.jsx("p",{className:"pretext-plus-editor__preview-title",children:"Full Preview"}),J.jsx("button",{className:"pretext-plus-editor__rebuild-button",onClick:()=>o(),children:"Rebuild"})]}),J.jsxs("div",{className:"pretext-plus-editor__preview-container",children:[n&&J.jsx("div",{className:"pretext-plus-editor__rebuilding-overlay",children:J.jsxs("div",{className:"pretext-plus-editor__rebuilding-popup",children:[J.jsx("div",{className:"pretext-plus-editor__spinner"}),J.jsx("p",{className:"pretext-plus-editor__rebuilding-text",children:"Rebuilding..."})]})}),J.jsx("iframe",{ref:s,className:"pretext-plus-editor__preview-iframe",name:"fullPreview",onLoad:a})]})]})},ew=r=>{let e;return r.showPreviewModeToggle===!1?e=null:e=J.jsxs("label",{className:"pretext-plus-editor__preview-toggle",children:[J.jsx("input",{type:"checkbox",checked:!r.isChecked,onChange:r.onChange,className:"pretext-plus-editor__preview-toggle-input"}),J.jsxs("div",{className:"pretext-plus-editor__preview-toggle-container",children:[J.jsx("span",{className:"pretext-plus-editor__preview-toggle-label",children:"Simple"}),J.jsx("span",{className:`pretext-plus-editor__preview-toggle-slider ${r.isChecked?"pretext-plus-editor__preview-toggle-slider--active":""}`,children:J.jsx("span",{className:`pretext-plus-editor__preview-toggle-dot ${r.isChecked?"pretext-plus-editor__preview-toggle-dot--active":""}`})}),J.jsx("span",{className:"pretext-plus-editor__preview-toggle-label",children:"Full"})]}),J.jsx("span",{className:"pretext-plus-editor__preview-toggle-caption",children:"Preview Mode"}),J.jsx("input",{type:"checkbox",checked:r.isChecked,onChange:r.onChange,className:"pretext-plus-editor__preview-toggle-input"})]}),J.jsxs("div",{className:"pretext-plus-editor__menu-bar",children:[J.jsx("div",{className:"pretext-plus-editor__menu-left",children:r.title!==void 0&&r.onTitleChange&&J.jsxs("label",{className:"pretext-plus-editor__title-label",children:["Title"," ",J.jsx("input",{className:"pretext-plus-editor__title-input",type:"text",value:r.title,onChange:t=>r.onTitleChange?.(t.target.value)})]})}),J.jsxs("div",{className:"pretext-plus-editor__menu-right",children:[r.onSaveButton&&J.jsx("button",{className:"pretext-plus-editor__button pretext-plus-editor__button--save",onClick:r.onSaveButton,children:r.saveButtonLabel||"Save"}),r.onCancelButton&&J.jsx("button",{className:"pretext-plus-editor__button pretext-plus-editor__button--cancel",onClick:r.onCancelButton,children:r.cancelButtonLabel||"Cancel"}),e]})]})},tw=`
434
+ `),i}const Zx=we.create({name:"ptxFragment",topNode:!0,content:"ptxdoc"}),Qx=[P9.configure({defaultLanguage:"xml"}),Zx,vb,cf,xf,uf,D9,cb,L9,B9,F9,$9,Q8,eb,tb,D7.configure({mode:"deepest"}),I7,z7],c1=({content:r,onChange:e})=>{const t=z.useRef(null),n=z.useRef(!1),i=Py({extensions:Qx,content:r,onContentError(l){console.log("Content error: ",l.error),l.disableCollaboration(),l.editor.setEditable(!1,!1)},enableContentCheck:!0,onUpdate:({editor:l})=>{console.log("Editor update detected."),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{n.current&&e(Yx(H9(l.getJSON())))},500)}});z.useEffect(()=>()=>{t.current&&clearTimeout(t.current)},[]);const s=z.useRef(!0);z.useEffect(()=>{if(i&&r!==i.getHTML()&&s.current){const l=r;if(i)try{i.commands.setContent(b9(l),{emitUpdate:!1}),console.log("External content set in visual editor.")}catch(c){console.error("Error setting content: ",c)}}},[r,i]),z.useEffect(()=>{if(!i)return;const l=()=>{s.current=!1};return i.on("update",l),()=>{i.off("update",l)}},[i]),z.useEffect(()=>{s.current=!0},[r]);const[o,a]=z.useState(!1);return z.useEffect(()=>{n.current=o,i&&i.setEditable(o,!1)},[i,o]),J.jsxs("div",{className:"pretext-plus-editor__visual-editor",children:[J.jsxs("div",{className:"pretext-plus-editor__visual-editor-header",children:[J.jsx("p",{className:"pretext-plus-editor__visual-editor-title",children:"Simple Preview"}),J.jsxs("label",{className:"pretext-plus-editor__edit-toggle",children:[J.jsx("input",{className:"pretext-plus-editor__edit-checkbox",type:"checkbox",checked:o,onChange:()=>a(!o)}),"Edit"]})]}),J.jsx("div",{className:(o?"editable":"read-only")+" ptx-page",children:J.jsx(Ny,{editor:i})}),J.jsx(Wx,{editor:i})]})},u1=(r,e,t)=>{const n=document.createElement("form");n.method="POST",n.action=r,n.target=t,n.style.display="none";for(const i in e)if(Object.hasOwnProperty.call(e,i)){const s=document.createElement("input");s.type="hidden",s.name=i,s.value=e[i],n.appendChild(s)}document.body.appendChild(n),n.submit(),n.remove()},d1=({content:r,title:e,onRebuild:t})=>{const[n,i]=z.useState(!1),s=z.useRef(null),o=z.useRef(null),a=z.useCallback(()=>{const c=r,u=e||"Document Title";try{const d=s.current?.contentWindow;d&&(o.current={x:d.scrollX,y:d.scrollY})}catch{o.current=null}if(i(!0),t){t(c,u,(h,f)=>{u1(h,f,"fullPreview")});return}},[r,e,t]);z.useEffect(()=>{a()},[]);const l=()=>{if(i(!1),o.current){try{s.current?.contentWindow?.scrollTo(o.current.x,o.current.y)}catch{}o.current=null}};return J.jsxs("div",{className:"pretext-plus-editor__full-preview",children:[J.jsxs("div",{className:"pretext-plus-editor__preview-header",children:[J.jsx("p",{className:"pretext-plus-editor__preview-title",children:"Full Preview"}),J.jsx("button",{className:"pretext-plus-editor__rebuild-button",onClick:()=>a(),children:"Rebuild"})]}),J.jsxs("div",{className:"pretext-plus-editor__preview-container",children:[n&&J.jsx("div",{className:"pretext-plus-editor__rebuilding-overlay",children:J.jsxs("div",{className:"pretext-plus-editor__rebuilding-popup",children:[J.jsx("div",{className:"pretext-plus-editor__spinner"}),J.jsx("p",{className:"pretext-plus-editor__rebuilding-text",children:"Rebuilding..."})]})}),J.jsx("iframe",{ref:s,className:"pretext-plus-editor__preview-iframe",name:"fullPreview",onLoad:l})]})]})},ew=r=>{let e;return r.showPreviewModeToggle===!1?e=null:e=J.jsxs("label",{className:"pretext-plus-editor__preview-toggle",children:[J.jsx("input",{type:"checkbox",checked:!r.isChecked,onChange:r.onChange,className:"pretext-plus-editor__preview-toggle-input"}),J.jsxs("div",{className:"pretext-plus-editor__preview-toggle-container",children:[J.jsx("span",{className:"pretext-plus-editor__preview-toggle-label",children:"Simple"}),J.jsx("span",{className:`pretext-plus-editor__preview-toggle-slider ${r.isChecked?"pretext-plus-editor__preview-toggle-slider--active":""}`,children:J.jsx("span",{className:`pretext-plus-editor__preview-toggle-dot ${r.isChecked?"pretext-plus-editor__preview-toggle-dot--active":""}`})}),J.jsx("span",{className:"pretext-plus-editor__preview-toggle-label",children:"Full"})]}),J.jsx("span",{className:"pretext-plus-editor__preview-toggle-caption",children:"Preview Mode"}),J.jsx("input",{type:"checkbox",checked:r.isChecked,onChange:r.onChange,className:"pretext-plus-editor__preview-toggle-input"})]}),J.jsxs("div",{className:"pretext-plus-editor__menu-bar",children:[J.jsx("div",{className:"pretext-plus-editor__menu-left",children:r.title!==void 0&&r.onTitleChange&&J.jsxs("label",{className:"pretext-plus-editor__title-label",children:["Title"," ",J.jsx("input",{className:"pretext-plus-editor__title-input",type:"text",value:r.title,onChange:t=>r.onTitleChange?.(t.target.value)})]})}),J.jsxs("div",{className:"pretext-plus-editor__menu-right",children:[r.onSaveButton&&J.jsx("button",{className:"pretext-plus-editor__button pretext-plus-editor__button--save",onClick:r.onSaveButton,children:r.saveButtonLabel||"Save"}),r.onCancelButton&&J.jsx("button",{className:"pretext-plus-editor__button pretext-plus-editor__button--cancel",onClick:r.onCancelButton,children:r.cancelButtonLabel||"Cancel"}),e]})]})},tw=`
435
435
  <?xml version="1.0" encoding="UTF-8"?>
436
436
  <section>
437
437
  <title>My Section</title>
@@ -511,5 +511,5 @@ $&`),i=i.replace(h,`$&
511
511
 
512
512
  <p> And that's the end of the demo. Thanks for coming!</p>
513
513
  </section>
514
- `,rw=r=>{const[e,t]=I.useState(r.content||tw),[n,i]=I.useState(r.title||"Document Title"),[s,o]=I.useState(!0),[a,l]=I.useState(window.innerWidth<800),[c,u]=I.useState("editor"),d="pretext-plus-tab-editor",h="pretext-plus-tab-preview",f="pretext-plus-tabpanel";I.useEffect(()=>{const x=()=>{l(window.innerWidth<800)};return window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]);const m=J.jsx(wc,{content:e,onChange:x=>{t(x||""),r.onContentChange(x)}});let y;s&&r.onPreviewRebuild?y=J.jsx(d1,{content:e,title:n,onRebuild:r.onPreviewRebuild}):y=J.jsx(c1,{content:e,onChange:x=>{t(x||""),r.onContentChange(x)}});let v;return a?v=J.jsxs("div",{className:"pretext-plus-editor__tabs",children:[J.jsxs("div",{className:"pretext-plus-editor__tab-list",role:"tablist",children:[J.jsx("button",{type:"button",id:d,role:"tab","aria-controls":f,"aria-selected":c==="editor",tabIndex:c==="editor"?0:-1,className:`pretext-plus-editor__tab-button ${c==="editor"?"is-active":""}`,onClick:()=>u("editor"),children:"Editor"}),J.jsx("button",{type:"button",id:h,role:"tab","aria-controls":f,"aria-selected":c==="preview",tabIndex:c==="preview"?0:-1,className:`pretext-plus-editor__tab-button ${c==="preview"?"is-active":""}`,onClick:()=>u("preview"),children:"Preview"})]}),J.jsx("div",{id:f,className:"pretext-plus-editor__tab-panel",role:"tabpanel","aria-labelledby":c==="editor"?d:h,children:J.jsx("div",{style:{height:"60vh"},children:c==="editor"?m:y})})]}):v=J.jsxs(sc,{direction:"horizontal",className:"pretext-plus-editor__splitter",children:[J.jsx(Po,{className:"pretext-plus-editor__editor-panel",children:m}),J.jsx(oc,{className:"pretext-plus-editor__resize-handle",children:J.jsx("div",{className:"pretext-plus-editor__resize-dots"})}),J.jsx(Po,{className:"pretext-plus-editor__preview-panel",children:y})]}),J.jsxs("div",{className:"pretext-plus-editor",children:[J.jsx(ew,{isChecked:s,onChange:()=>o(!s),title:n,onTitleChange:x=>{i(x),r.onTitleChange?.(x)},onSaveButton:r.onSaveButton,saveButtonLabel:r.saveButtonLabel,onCancelButton:r.onCancelButton,cancelButtonLabel:r.cancelButtonLabel,showPreviewModeToggle:r.onPreviewRebuild!==void 0}),v]})};kt.CodeEditor=wc,kt.Editors=rw,kt.FullPreview=d1,kt.VisualEditor=c1,kt.postToIframe=u1,Object.defineProperty(kt,Symbol.toStringTag,{value:"Module"})}));
514
+ `,rw=r=>{const[e,t]=z.useState(r.content||tw),[n,i]=z.useState(r.title||"Document Title"),[s,o]=z.useState(!0),[a,l]=z.useState(window.innerWidth<800),[c,u]=z.useState("editor"),d="pretext-plus-tab-editor",h="pretext-plus-tab-preview",f="pretext-plus-tabpanel";z.useEffect(()=>{const x=()=>{l(window.innerWidth<800)};return window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]);const m=J.jsx(wc,{content:e,onChange:x=>{t(x||""),r.onContentChange(x)}});let y;s&&r.onPreviewRebuild?y=J.jsx(d1,{content:e,title:n,onRebuild:r.onPreviewRebuild}):y=J.jsx(c1,{content:e,onChange:x=>{t(x||""),r.onContentChange(x)}});let v;return a?v=J.jsxs("div",{className:"pretext-plus-editor__tabs",children:[J.jsxs("div",{className:"pretext-plus-editor__tab-list",role:"tablist",children:[J.jsx("button",{type:"button",id:d,role:"tab","aria-controls":f,"aria-selected":c==="editor",tabIndex:c==="editor"?0:-1,className:`pretext-plus-editor__tab-button ${c==="editor"?"is-active":""}`,onClick:()=>u("editor"),children:"Editor"}),J.jsx("button",{type:"button",id:h,role:"tab","aria-controls":f,"aria-selected":c==="preview",tabIndex:c==="preview"?0:-1,className:`pretext-plus-editor__tab-button ${c==="preview"?"is-active":""}`,onClick:()=>u("preview"),children:"Preview"})]}),J.jsx("div",{id:f,className:"pretext-plus-editor__tab-panel",role:"tabpanel","aria-labelledby":c==="editor"?d:h,children:J.jsx("div",{style:{height:"60vh"},children:c==="editor"?m:y})})]}):v=J.jsxs(sc,{direction:"horizontal",className:"pretext-plus-editor__splitter",children:[J.jsx(Po,{className:"pretext-plus-editor__editor-panel",children:m}),J.jsx(oc,{className:"pretext-plus-editor__resize-handle",children:J.jsx("div",{className:"pretext-plus-editor__resize-dots"})}),J.jsx(Po,{className:"pretext-plus-editor__preview-panel",children:y})]}),J.jsxs("div",{className:"pretext-plus-editor",children:[J.jsx(ew,{isChecked:s,onChange:()=>o(!s),title:n,onTitleChange:x=>{i(x),r.onTitleChange?.(x)},onSaveButton:r.onSaveButton,saveButtonLabel:r.saveButtonLabel,onCancelButton:r.onCancelButton,cancelButtonLabel:r.cancelButtonLabel,showPreviewModeToggle:r.onPreviewRebuild!==void 0}),v]})};kt.CodeEditor=wc,kt.Editors=rw,kt.FullPreview=d1,kt.VisualEditor=c1,kt.postToIframe=u1,Object.defineProperty(kt,Symbol.toStringTag,{value:"Module"})}));
515
515
  //# sourceMappingURL=index.js.map