var cB=Object.defineProperty;var dB=(t,e,n)=>e in t?cB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Wa=(t,e,n)=>dB(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Wfe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Cy={exports:{}},D0={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Z5;function fB(){if(Z5)return D0;Z5=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var l in i)l!=="key"&&(s[l]=i[l])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:a,ref:i!==void 0?i:null,props:s}}return D0.Fragment=e,D0.jsx=n,D0.jsxs=n,D0}var J5;function hB(){return J5||(J5=1,Cy.exports=fB()),Cy.exports}var C=hB(),Ay={exports:{}},Mt={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var eS;function pB(){if(eS)return Mt;eS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function g(N){return N===null||typeof N!="object"?null:(N=p&&N[p]||N["@@iterator"],typeof N=="function"?N:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,E={};function T(N,X,me){this.props=N,this.context=X,this.refs=E,this.updater=me||b}T.prototype.isReactComponent={},T.prototype.setState=function(N,X){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,X,"setState")},T.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function S(){}S.prototype=T.prototype;function A(N,X,me){this.props=N,this.context=X,this.refs=E,this.updater=me||b}var R=A.prototype=new S;R.constructor=A,y(R,T.prototype),R.isPureReactComponent=!0;var z=Array.isArray,I={H:null,A:null,T:null,S:null,V:null},P=Object.prototype.hasOwnProperty;function $(N,X,me,B,Ee,Qe){return me=Qe.ref,{$$typeof:t,type:N,key:X,ref:me!==void 0?me:null,props:Qe}}function K(N,X){return $(N.type,X,void 0,void 0,void 0,N.props)}function Z(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function W(N){var X={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(me){return X[me]})}var re=/\/+/g;function ie(N,X){return typeof N=="object"&&N!==null&&N.key!=null?W(""+N.key):X.toString(36)}function ye(){}function ae(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(ye,ye):(N.status="pending",N.then(function(X){N.status==="pending"&&(N.status="fulfilled",N.value=X)},function(X){N.status==="pending"&&(N.status="rejected",N.reason=X)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function de(N,X,me,B,Ee){var Qe=typeof N;(Qe==="undefined"||Qe==="boolean")&&(N=null);var Fe=!1;if(N===null)Fe=!0;else switch(Qe){case"bigint":case"string":case"number":Fe=!0;break;case"object":switch(N.$$typeof){case t:case e:Fe=!0;break;case h:return Fe=N._init,de(Fe(N._payload),X,me,B,Ee)}}if(Fe)return Ee=Ee(N),Fe=B===""?"."+ie(N,0):B,z(Ee)?(me="",Fe!=null&&(me=Fe.replace(re,"$&/")+"/"),de(Ee,X,me,"",function(en){return en})):Ee!=null&&(Z(Ee)&&(Ee=K(Ee,me+(Ee.key==null||N&&N.key===Ee.key?"":(""+Ee.key).replace(re,"$&/")+"/")+Fe)),X.push(Ee)),1;Fe=0;var Ft=B===""?".":B+":";if(z(N))for(var ut=0;ut<N.length;ut++)B=N[ut],Qe=Ft+ie(B,ut),Fe+=de(B,X,me,Qe,Ee);else if(ut=g(N),typeof ut=="function")for(N=ut.call(N),ut=0;!(B=N.next()).done;)B=B.value,Qe=Ft+ie(B,ut++),Fe+=de(B,X,me,Qe,Ee);else if(Qe==="object"){if(typeof N.then=="function")return de(ae(N),X,me,B,Ee);throw X=String(N),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return Fe}function J(N,X,me){if(N==null)return N;var B=[],Ee=0;return de(N,B,"","",function(Qe){return X.call(me,Qe,Ee++)}),B}function ne(N){if(N._status===-1){var X=N._result;X=X(),X.then(function(me){(N._status===0||N._status===-1)&&(N._status=1,N._result=me)},function(me){(N._status===0||N._status===-1)&&(N._status=2,N._result=me)}),N._status===-1&&(N._status=0,N._result=X)}if(N._status===1)return N._result.default;throw N._result}var he=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function Oe(){}return Mt.Children={map:J,forEach:function(N,X,me){J(N,function(){X.apply(this,arguments)},me)},count:function(N){var X=0;return J(N,function(){X++}),X},toArray:function(N){return J(N,function(X){return X})||[]},only:function(N){if(!Z(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},Mt.Component=T,Mt.Fragment=n,Mt.Profiler=i,Mt.PureComponent=A,Mt.StrictMode=r,Mt.Suspense=u,Mt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Mt.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},Mt.cache=function(N){return function(){return N.apply(null,arguments)}},Mt.cloneElement=function(N,X,me){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var B=y({},N.props),Ee=N.key,Qe=void 0;if(X!=null)for(Fe in X.ref!==void 0&&(Qe=void 0),X.key!==void 0&&(Ee=""+X.key),X)!P.call(X,Fe)||Fe==="key"||Fe==="__self"||Fe==="__source"||Fe==="ref"&&X.ref===void 0||(B[Fe]=X[Fe]);var Fe=arguments.length-2;if(Fe===1)B.children=me;else if(1<Fe){for(var Ft=Array(Fe),ut=0;ut<Fe;ut++)Ft[ut]=arguments[ut+2];B.children=Ft}return $(N.type,Ee,void 0,void 0,Qe,B)},Mt.createContext=function(N){return N={$$typeof:a,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:s,_context:N},N},Mt.createElement=function(N,X,me){var B,Ee={},Qe=null;if(X!=null)for(B in X.key!==void 0&&(Qe=""+X.key),X)P.call(X,B)&&B!=="key"&&B!=="__self"&&B!=="__source"&&(Ee[B]=X[B]);var Fe=arguments.length-2;if(Fe===1)Ee.children=me;else if(1<Fe){for(var Ft=Array(Fe),ut=0;ut<Fe;ut++)Ft[ut]=arguments[ut+2];Ee.children=Ft}if(N&&N.defaultProps)for(B in Fe=N.defaultProps,Fe)Ee[B]===void 0&&(Ee[B]=Fe[B]);return $(N,Qe,void 0,void 0,null,Ee)},Mt.createRef=function(){return{current:null}},Mt.forwardRef=function(N){return{$$typeof:l,render:N}},Mt.isValidElement=Z,Mt.lazy=function(N){return{$$typeof:h,_payload:{_status:-1,_result:N},_init:ne}},Mt.memo=function(N,X){return{$$typeof:d,type:N,compare:X===void 0?null:X}},Mt.startTransition=function(N){var X=I.T,me={};I.T=me;try{var B=N(),Ee=I.S;Ee!==null&&Ee(me,B),typeof B=="object"&&B!==null&&typeof B.then=="function"&&B.then(Oe,he)}catch(Qe){he(Qe)}finally{I.T=X}},Mt.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Mt.use=function(N){return I.H.use(N)},Mt.useActionState=function(N,X,me){return I.H.useActionState(N,X,me)},Mt.useCallback=function(N,X){return I.H.useCallback(N,X)},Mt.useContext=function(N){return I.H.useContext(N)},Mt.useDebugValue=function(){},Mt.useDeferredValue=function(N,X){return I.H.useDeferredValue(N,X)},Mt.useEffect=function(N,X,me){var B=I.H;if(typeof me=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return B.useEffect(N,X)},Mt.useId=function(){return I.H.useId()},Mt.useImperativeHandle=function(N,X,me){return I.H.useImperativeHandle(N,X,me)},Mt.useInsertionEffect=function(N,X){return I.H.useInsertionEffect(N,X)},Mt.useLayoutEffect=function(N,X){return I.H.useLayoutEffect(N,X)},Mt.useMemo=function(N,X){return I.H.useMemo(N,X)},Mt.useOptimistic=function(N,X){return I.H.useOptimistic(N,X)},Mt.useReducer=function(N,X,me){return I.H.useReducer(N,X,me)},Mt.useRef=function(N){return I.H.useRef(N)},Mt.useState=function(N){return I.H.useState(N)},Mt.useSyncExternalStore=function(N,X,me){return I.H.useSyncExternalStore(N,X,me)},Mt.useTransition=function(){return I.H.useTransition()},Mt.version="19.1.0",Mt}var tS;function gh(){return tS||(tS=1,Ay.exports=pB()),Ay.exports}var U=gh();const le=mh(U);var Ny={exports:{}},I0={},My={exports:{}},Oy={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var nS;function mB(){return nS||(nS=1,function(t){function e(J,ne){var he=J.length;J.push(ne);e:for(;0<he;){var Oe=he-1>>>1,N=J[Oe];if(0<i(N,ne))J[Oe]=ne,J[he]=N,he=Oe;else break e}}function n(J){return J.length===0?null:J[0]}function r(J){if(J.length===0)return null;var ne=J[0],he=J.pop();if(he!==ne){J[0]=he;e:for(var Oe=0,N=J.length,X=N>>>1;Oe<X;){var me=2*(Oe+1)-1,B=J[me],Ee=me+1,Qe=J[Ee];if(0>i(B,he))Ee<N&&0>i(Qe,B)?(J[Oe]=Qe,J[Ee]=he,Oe=Ee):(J[Oe]=B,J[me]=he,Oe=me);else if(Ee<N&&0>i(Qe,he))J[Oe]=Qe,J[Ee]=he,Oe=Ee;else break e}}return ne}function i(J,ne){var he=J.sortIndex-ne.sortIndex;return he!==0?he:J.id-ne.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],d=[],h=1,p=null,g=3,b=!1,y=!1,E=!1,T=!1,S=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function z(J){for(var ne=n(d);ne!==null;){if(ne.callback===null)r(d);else if(ne.startTime<=J)r(d),ne.sortIndex=ne.expirationTime,e(u,ne);else break;ne=n(d)}}function I(J){if(E=!1,z(J),!y)if(n(u)!==null)y=!0,P||(P=!0,ie());else{var ne=n(d);ne!==null&&de(I,ne.startTime-J)}}var P=!1,$=-1,K=5,Z=-1;function W(){return T?!0:!(t.unstable_now()-Z<K)}function re(){if(T=!1,P){var J=t.unstable_now();Z=J;var ne=!0;try{e:{y=!1,E&&(E=!1,A($),$=-1),b=!0;var he=g;try{t:{for(z(J),p=n(u);p!==null&&!(p.expirationTime>J&&W());){var Oe=p.callback;if(typeof Oe=="function"){p.callback=null,g=p.priorityLevel;var N=Oe(p.expirationTime<=J);if(J=t.unstable_now(),typeof N=="function"){p.callback=N,z(J),ne=!0;break t}p===n(u)&&r(u),z(J)}else r(u);p=n(u)}if(p!==null)ne=!0;else{var X=n(d);X!==null&&de(I,X.startTime-J),ne=!1}}break e}finally{p=null,g=he,b=!1}ne=void 0}}finally{ne?ie():P=!1}}}var ie;if(typeof R=="function")ie=function(){R(re)};else if(typeof MessageChannel<"u"){var ye=new MessageChannel,ae=ye.port2;ye.port1.onmessage=re,ie=function(){ae.postMessage(null)}}else ie=function(){S(re,0)};function de(J,ne){$=S(function(){J(t.unstable_now())},ne)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(J){J.callback=null},t.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<J?Math.floor(1e3/J):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(J){switch(g){case 1:case 2:case 3:var ne=3;break;default:ne=g}var he=g;g=ne;try{return J()}finally{g=he}},t.unstable_requestPaint=function(){T=!0},t.unstable_runWithPriority=function(J,ne){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var he=g;g=J;try{return ne()}finally{g=he}},t.unstable_scheduleCallback=function(J,ne,he){var Oe=t.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?Oe+he:Oe):he=Oe,J){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=he+N,J={id:h++,callback:ne,priorityLevel:J,startTime:he,expirationTime:N,sortIndex:-1},he>Oe?(J.sortIndex=he,e(d,J),n(u)===null&&J===n(d)&&(E?(A($),$=-1):E=!0,de(I,he-Oe))):(J.sortIndex=N,e(u,J),y||b||(y=!0,P||(P=!0,ie()))),J},t.unstable_shouldYield=W,t.unstable_wrapCallback=function(J){var ne=g;return function(){var he=g;g=ne;try{return J.apply(this,arguments)}finally{g=he}}}}(Oy)),Oy}var rS;function gB(){return rS||(rS=1,My.exports=mB()),My.exports}var Ry={exports:{}},ai={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var iS;function bB(){if(iS)return ai;iS=1;var t=gh();function e(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)d+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(u,d,h){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:u,containerInfo:d,implementation:h}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return ai.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ai.createPortal=function(u,d){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return s(u,d,null,h)},ai.flushSync=function(u){var d=a.T,h=r.p;try{if(a.T=null,r.p=2,u)return u()}finally{a.T=d,r.p=h,r.d.f()}},ai.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},ai.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},ai.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var h=d.as,p=l(h,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;h==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:b}):h==="script"&&r.d.X(u,{crossOrigin:p,integrity:g,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},ai.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var h=l(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},ai.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var h=d.as,p=l(h,d.crossOrigin);r.d.L(u,h,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},ai.preloadModule=function(u,d){if(typeof u=="string")if(d){var h=l(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},ai.requestFormReset=function(u){r.d.r(u)},ai.unstable_batchedUpdates=function(u,d){return u(d)},ai.useFormState=function(u,d,h){return a.H.useFormState(u,d,h)},ai.useFormStatus=function(){return a.H.useHostTransitionStatus()},ai.version="19.1.0",ai}var sS;function zC(){if(sS)return Ry.exports;sS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Ry.exports=bB(),Ry.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var aS;function vB(){if(aS)return I0;aS=1;var t=gB(),e=gh(),n=zC();function r(o){var c="https://react.dev/errors/"+o;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var c=o,f=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(f=c.return),o=c.return;while(o)}return c.tag===3?f:null}function a(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function l(o){if(s(o)!==o)throw Error(r(188))}function u(o){var c=o.alternate;if(!c){if(c=s(o),c===null)throw Error(r(188));return c!==o?null:o}for(var f=o,m=c;;){var v=f.return;if(v===null)break;var _=v.alternate;if(_===null){if(m=v.return,m!==null){f=m;continue}break}if(v.child===_.child){for(_=v.child;_;){if(_===f)return l(v),o;if(_===m)return l(v),c;_=_.sibling}throw Error(r(188))}if(f.return!==m.return)f=v,m=_;else{for(var M=!1,D=v.child;D;){if(D===f){M=!0,f=v,m=_;break}if(D===m){M=!0,m=v,f=_;break}D=D.sibling}if(!M){for(D=_.child;D;){if(D===f){M=!0,f=_,m=v;break}if(D===m){M=!0,m=_,f=v;break}D=D.sibling}if(!M)throw Error(r(189))}}if(f.alternate!==m)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?o:c}function d(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o;for(o=o.child;o!==null;){if(c=d(o),c!==null)return c;o=o.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),A=Symbol.for("react.consumer"),R=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),re=Symbol.iterator;function ie(o){return o===null||typeof o!="object"?null:(o=re&&o[re]||o["@@iterator"],typeof o=="function"?o:null)}var ye=Symbol.for("react.client.reference");function ae(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===ye?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case y:return"Fragment";case T:return"Profiler";case E:return"StrictMode";case I:return"Suspense";case P:return"SuspenseList";case Z:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case R:return(o.displayName||"Context")+".Provider";case A:return(o._context.displayName||"Context")+".Consumer";case z:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case $:return c=o.displayName||null,c!==null?c:ae(o.type)||"Memo";case K:c=o._payload,o=o._init;try{return ae(o(c))}catch{}}return null}var de=Array.isArray,J=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},Oe=[],N=-1;function X(o){return{current:o}}function me(o){0>N||(o.current=Oe[N],Oe[N]=null,N--)}function B(o,c){N++,Oe[N]=o.current,o.current=c}var Ee=X(null),Qe=X(null),Fe=X(null),Ft=X(null);function ut(o,c){switch(B(Fe,c),B(Qe,o),B(Ee,null),c.nodeType){case 9:case 11:o=(o=c.documentElement)&&(o=o.namespaceURI)?k5(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=k5(c),o=C5(c,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}me(Ee),B(Ee,o)}function en(){me(Ee),me(Qe),me(Fe)}function Nt(o){o.memoizedState!==null&&B(Ft,o);var c=Ee.current,f=C5(c,o.type);c!==f&&(B(Qe,o),B(Ee,f))}function Mn(o){Qe.current===o&&(me(Ee),me(Qe)),Ft.current===o&&(me(Ft),A0._currentValue=he)}var Vr=Object.prototype.hasOwnProperty,gt=t.unstable_scheduleCallback,St=t.unstable_cancelCallback,Gt=t.unstable_shouldYield,tt=t.unstable_requestPaint,kt=t.unstable_now,fn=t.unstable_getCurrentPriorityLevel,qt=t.unstable_ImmediatePriority,hn=t.unstable_UserBlockingPriority,fr=t.unstable_NormalPriority,ea=t.unstable_LowPriority,fs=t.unstable_IdlePriority,ri=t.log,ir=t.unstable_setDisableYieldValue,ge=null,we=null;function rt(o){if(typeof ri=="function"&&ir(o),we&&typeof we.setStrictMode=="function")try{we.setStrictMode(ge,o)}catch{}}var st=Math.clz32?Math.clz32:On,Be=Math.log,Yt=Math.LN2;function On(o){return o>>>=0,o===0?32:31-(Be(o)/Yt|0)|0}var hr=256,Cr=4194304;function sr(o){var c=o&42;if(c!==0)return c;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Tn(o,c,f){var m=o.pendingLanes;if(m===0)return 0;var v=0,_=o.suspendedLanes,M=o.pingedLanes;o=o.warmLanes;var D=m&134217727;return D!==0?(m=D&~_,m!==0?v=sr(m):(M&=D,M!==0?v=sr(M):f||(f=D&~o,f!==0&&(v=sr(f))))):(D=m&~_,D!==0?v=sr(D):M!==0?v=sr(M):f||(f=m&~o,f!==0&&(v=sr(f)))),v===0?0:c!==0&&c!==v&&(c&_)===0&&(_=v&-v,f=c&-c,_>=f||_===32&&(f&4194048)!==0)?c:v}function tn(o,c){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&c)===0}function ar(o,c){switch(o){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ft(){var o=hr;return hr<<=1,(hr&4194048)===0&&(hr=256),o}function Wt(){var o=Cr;return Cr<<=1,(Cr&62914560)===0&&(Cr=4194304),o}function ze(o){for(var c=[],f=0;31>f;f++)c.push(o);return c}function pn(o,c){o.pendingLanes|=c,c!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Sn(o,c,f,m,v,_){var M=o.pendingLanes;o.pendingLanes=f,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=f,o.entangledLanes&=f,o.errorRecoveryDisabledLanes&=f,o.shellSuspendCounter=0;var D=o.entanglements,Y=o.expirationTimes,ue=o.hiddenUpdates;for(f=M&~f;0<f;){var _e=31-st(f),Se=1<<_e;D[_e]=0,Y[_e]=-1;var fe=ue[_e];if(fe!==null)for(ue[_e]=null,_e=0;_e<fe.length;_e++){var pe=fe[_e];pe!==null&&(pe.lane&=-536870913)}f&=~Se}m!==0&&q(o,m,0),_!==0&&v===0&&o.tag!==0&&(o.suspendedLanes|=_&~(M&~c))}function q(o,c,f){o.pendingLanes|=c,o.suspendedLanes&=~c;var m=31-st(c);o.entangledLanes|=c,o.entanglements[m]=o.entanglements[m]|1073741824|f&4194090}function xe(o,c){var f=o.entangledLanes|=c;for(o=o.entanglements;f;){var m=31-st(f),v=1<<m;v&c|o[m]&c&&(o[m]|=c),f&=~v}}function je(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function yt(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Pn(){var o=ne.p;return o!==0?o:(o=window.event,o===void 0?32:G5(o.type))}function jn(o,c){var f=ne.p;try{return ne.p=o,c()}finally{ne.p=f}}var Ke=Math.random().toString(36).slice(2),He="__reactFiber$"+Ke,nt="__reactProps$"+Ke,Rn="__reactContainer$"+Ke,Bn="__reactEvents$"+Ke,Hl="__reactListeners$"+Ke,Bd="__reactHandles$"+Ke,ec="__reactResources$"+Ke,jl="__reactMarker$"+Ke;function $l(o){delete o[He],delete o[nt],delete o[Bn],delete o[Hl],delete o[Bd]}function Co(o){var c=o[He];if(c)return c;for(var f=o.parentNode;f;){if(c=f[Rn]||f[He]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(o=O5(o);o!==null;){if(f=o[He])return f;o=O5(o)}return c}o=f,f=o.parentNode}return null}function Ao(o){if(o=o[He]||o[Rn]){var c=o.tag;if(c===5||c===6||c===13||c===26||c===27||c===3)return o}return null}function ql(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o.stateNode;throw Error(r(33))}function Ma(o){var c=o[ec];return c||(c=o[ec]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function $n(o){o[jl]=!0}var $h=new Set,qh={};function Oa(o,c){pi(o,c),pi(o+"Capture",c)}function pi(o,c){for(qh[o]=c,o=0;o<c.length;o++)$h.add(c[o])}var Vh=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),zd={},Gh={};function Ab(o){return Vr.call(Gh,o)?!0:Vr.call(zd,o)?!1:Vh.test(o)?Gh[o]=!0:(zd[o]=!0,!1)}function tc(o,c,f){if(Ab(c))if(f===null)o.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":o.removeAttribute(c);return;case"boolean":var m=c.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){o.removeAttribute(c);return}}o.setAttribute(c,""+f)}}function Ra(o,c,f){if(f===null)o.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttribute(c,""+f)}}function zs(o,c,f,m){if(m===null)o.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(f);return}o.setAttributeNS(c,f,""+m)}}var Ie,at;function Ct(o){if(Ie===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);Ie=c&&c[1]||"",at=-1<f.stack.indexOf(`
    at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Ie+o+at}var nn=!1;function qn(o,c){if(!o||nn)return"";nn=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(c){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(pe){var fe=pe}Reflect.construct(o,[],Se)}else{try{Se.call()}catch(pe){fe=pe}o.call(Se.prototype)}}else{try{throw Error()}catch(pe){fe=pe}(Se=o())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(pe){if(pe&&fe&&typeof pe.stack=="string")return[pe.stack,fe.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=m.DetermineComponentFrameRoot(),M=_[0],D=_[1];if(M&&D){var Y=M.split(`
`),ue=D.split(`
`);for(v=m=0;m<Y.length&&!Y[m].includes("DetermineComponentFrameRoot");)m++;for(;v<ue.length&&!ue[v].includes("DetermineComponentFrameRoot");)v++;if(m===Y.length||v===ue.length)for(m=Y.length-1,v=ue.length-1;1<=m&&0<=v&&Y[m]!==ue[v];)v--;for(;1<=m&&0<=v;m--,v--)if(Y[m]!==ue[v]){if(m!==1||v!==1)do if(m--,v--,0>v||Y[m]!==ue[v]){var _e=`
`+Y[m].replace(" at new "," at ");return o.displayName&&_e.includes("<anonymous>")&&(_e=_e.replace("<anonymous>",o.displayName)),_e}while(1<=m&&0<=v);break}}}finally{nn=!1,Error.prepareStackTrace=f}return(f=o?o.displayName||o.name:"")?Ct(f):""}function Vi(o){switch(o.tag){case 26:case 27:case 5:return Ct(o.type);case 16:return Ct("Lazy");case 13:return Ct("Suspense");case 19:return Ct("SuspenseList");case 0:case 15:return qn(o.type,!1);case 11:return qn(o.type.render,!1);case 1:return qn(o.type,!0);case 31:return Ct("Activity");default:return""}}function Fs(o){try{var c="";do c+=Vi(o),o=o.return;while(o);return c}catch(f){return`
Error generating stack: `+f.message+`
`+f.stack}}function Gr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ii(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function hs(o){var c=ii(o)?"checked":"value",f=Object.getOwnPropertyDescriptor(o.constructor.prototype,c),m=""+o[c];if(!o.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var v=f.get,_=f.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return v.call(this)},set:function(M){m=""+M,_.call(this,M)}}),Object.defineProperty(o,c,{enumerable:f.enumerable}),{getValue:function(){return m},setValue:function(M){m=""+M},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function Vl(o){o._valueTracker||(o._valueTracker=hs(o))}function Fd(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var f=c.getValue(),m="";return o&&(m=ii(o)?o.checked?"true":"false":o.value),o=m,o!==f?(c.setValue(o),!0):!1}function Gl(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var Nb=/[\n"\\]/g;function Ni(o){return o.replace(Nb,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Ud(o,c,f,m,v,_,M,D){o.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?o.type=M:o.removeAttribute("type"),c!=null?M==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+Gr(c)):o.value!==""+Gr(c)&&(o.value=""+Gr(c)):M!=="submit"&&M!=="reset"||o.removeAttribute("value"),c!=null?No(o,M,Gr(c)):f!=null?No(o,M,Gr(f)):m!=null&&o.removeAttribute("value"),v==null&&_!=null&&(o.defaultChecked=!!_),v!=null&&(o.checked=v&&typeof v!="function"&&typeof v!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?o.name=""+Gr(D):o.removeAttribute("name")}function Yh(o,c,f,m,v,_,M,D){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(o.type=_),c!=null||f!=null){if(!(_!=="submit"&&_!=="reset"||c!=null))return;f=f!=null?""+Gr(f):"",c=c!=null?""+Gr(c):f,D||c===o.value||(o.value=c),o.defaultValue=c}m=m??v,m=typeof m!="function"&&typeof m!="symbol"&&!!m,o.checked=D?o.checked:!!m,o.defaultChecked=!!m,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(o.name=M)}function No(o,c,f){c==="number"&&Gl(o.ownerDocument)===o||o.defaultValue===""+f||(o.defaultValue=""+f)}function Da(o,c,f,m){if(o=o.options,c){c={};for(var v=0;v<f.length;v++)c["$"+f[v]]=!0;for(f=0;f<o.length;f++)v=c.hasOwnProperty("$"+o[f].value),o[f].selected!==v&&(o[f].selected=v),v&&m&&(o[f].defaultSelected=!0)}else{for(f=""+Gr(f),c=null,v=0;v<o.length;v++){if(o[v].value===f){o[v].selected=!0,m&&(o[v].defaultSelected=!0);return}c!==null||o[v].disabled||(c=o[v])}c!==null&&(c.selected=!0)}}function Gi(o,c,f){if(c!=null&&(c=""+Gr(c),c!==o.value&&(o.value=c),f==null)){o.defaultValue!==c&&(o.defaultValue=c);return}o.defaultValue=f!=null?""+Gr(f):""}function Wh(o,c,f,m){if(c==null){if(m!=null){if(f!=null)throw Error(r(92));if(de(m)){if(1<m.length)throw Error(r(93));m=m[0]}f=m}f==null&&(f=""),c=f}f=Gr(c),o.defaultValue=f,m=o.textContent,m===f&&m!==""&&m!==null&&(o.value=m)}function ta(o,c){if(c){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=c;return}}o.textContent=c}var wt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Hd(o,c,f){var m=c.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?o.setProperty(c,""):c==="float"?o.cssFloat="":o[c]="":m?o.setProperty(c,f):typeof f!="number"||f===0||wt.has(c)?c==="float"?o.cssFloat=f:o[c]=(""+f).trim():o[c]=f+"px"}function pr(o,c,f){if(c!=null&&typeof c!="object")throw Error(r(62));if(o=o.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||c!=null&&c.hasOwnProperty(m)||(m.indexOf("--")===0?o.setProperty(m,""):m==="float"?o.cssFloat="":o[m]="");for(var v in c)m=c[v],c.hasOwnProperty(v)&&f[v]!==m&&Hd(o,v,m)}else for(var _ in c)c.hasOwnProperty(_)&&Hd(o,_,c[_])}function rn(o){if(o.indexOf("-")===-1)return!1;switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nc=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ia=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Mo(o){return Ia.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}var Yl=null;function $e(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Je=null,xt=null;function Qt(o){var c=Ao(o);if(c&&(o=c.stateNode)){var f=o[nt]||null;e:switch(o=c.stateNode,c.type){case"input":if(Ud(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),c=f.name,f.type==="radio"&&c!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Ni(""+c)+'"][type="radio"]'),c=0;c<f.length;c++){var m=f[c];if(m!==o&&m.form===o.form){var v=m[nt]||null;if(!v)throw Error(r(90));Ud(m,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(c=0;c<f.length;c++)m=f[c],m.form===o.form&&Fd(m)}break e;case"textarea":Gi(o,f.value,f.defaultValue);break e;case"select":c=f.value,c!=null&&Da(o,!!f.multiple,c,!1)}}}var mr=!1;function ps(o,c,f){if(mr)return o(c,f);mr=!0;try{var m=o(c);return m}finally{if(mr=!1,(Je!==null||xt!==null)&&(Dp(),Je&&(c=Je,o=xt,xt=Je=null,Qt(c),o)))for(c=0;c<o.length;c++)Qt(o[c])}}function Wl(o,c){var f=o.stateNode;if(f===null)return null;var m=f[nt]||null;if(m===null)return null;f=m[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(o=o.type,m=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!m;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(r(231,c,typeof f));return f}var Us=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mb=!1;if(Us)try{var jd={};Object.defineProperty(jd,"passive",{get:function(){Mb=!0}}),window.addEventListener("test",jd,jd),window.removeEventListener("test",jd,jd)}catch{Mb=!1}var Oo=null,Ob=null,Kh=null;function Mx(){if(Kh)return Kh;var o,c=Ob,f=c.length,m,v="value"in Oo?Oo.value:Oo.textContent,_=v.length;for(o=0;o<f&&c[o]===v[o];o++);var M=f-o;for(m=1;m<=M&&c[f-m]===v[_-m];m++);return Kh=v.slice(o,1<m?1-m:void 0)}function Xh(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function Qh(){return!0}function Ox(){return!1}function Mi(o){function c(f,m,v,_,M){this._reactName=f,this._targetInst=v,this.type=m,this.nativeEvent=_,this.target=M,this.currentTarget=null;for(var D in o)o.hasOwnProperty(D)&&(f=o[D],this[D]=f?f(_):_[D]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Qh:Ox,this.isPropagationStopped=Ox,this}return h(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Qh)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Qh)},persist:function(){},isPersistent:Qh}),c}var Kl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zh=Mi(Kl),$d=h({},Kl,{view:0,detail:0}),cL=Mi($d),Rb,Db,qd,Jh=h({},$d,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Lb,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==qd&&(qd&&o.type==="mousemove"?(Rb=o.screenX-qd.screenX,Db=o.screenY-qd.screenY):Db=Rb=0,qd=o),Rb)},movementY:function(o){return"movementY"in o?o.movementY:Db}}),Rx=Mi(Jh),dL=h({},Jh,{dataTransfer:0}),fL=Mi(dL),hL=h({},$d,{relatedTarget:0}),Ib=Mi(hL),pL=h({},Kl,{animationName:0,elapsedTime:0,pseudoElement:0}),mL=Mi(pL),gL=h({},Kl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),bL=Mi(gL),vL=h({},Kl,{data:0}),Dx=Mi(vL),yL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},EL={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_L={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xL(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=_L[o])?!!c[o]:!1}function Lb(){return xL}var TL=h({},$d,{key:function(o){if(o.key){var c=yL[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=Xh(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?EL[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Lb,charCode:function(o){return o.type==="keypress"?Xh(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Xh(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),SL=Mi(TL),wL=h({},Jh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ix=Mi(wL),kL=h({},$d,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lb}),CL=Mi(kL),AL=h({},Kl,{propertyName:0,elapsedTime:0,pseudoElement:0}),NL=Mi(AL),ML=h({},Jh,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),OL=Mi(ML),RL=h({},Kl,{newState:0,oldState:0}),DL=Mi(RL),IL=[9,13,27,32],Pb=Us&&"CompositionEvent"in window,Vd=null;Us&&"documentMode"in document&&(Vd=document.documentMode);var LL=Us&&"TextEvent"in window&&!Vd,Lx=Us&&(!Pb||Vd&&8<Vd&&11>=Vd),Px=" ",Bx=!1;function zx(o,c){switch(o){case"keyup":return IL.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fx(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var rc=!1;function PL(o,c){switch(o){case"compositionend":return Fx(c);case"keypress":return c.which!==32?null:(Bx=!0,Px);case"textInput":return o=c.data,o===Px&&Bx?null:o;default:return null}}function BL(o,c){if(rc)return o==="compositionend"||!Pb&&zx(o,c)?(o=Mx(),Kh=Ob=Oo=null,rc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Lx&&c.locale!=="ko"?null:c.data;default:return null}}var zL={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ux(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!zL[o.type]:c==="textarea"}function Hx(o,c,f,m){Je?xt?xt.push(m):xt=[m]:Je=m,c=Fp(c,"onChange"),0<c.length&&(f=new Zh("onChange","change",null,f,m),o.push({event:f,listeners:c}))}var Gd=null,Yd=null;function FL(o){_5(o,0)}function ep(o){var c=ql(o);if(Fd(c))return o}function jx(o,c){if(o==="change")return c}var $x=!1;if(Us){var Bb;if(Us){var zb="oninput"in document;if(!zb){var qx=document.createElement("div");qx.setAttribute("oninput","return;"),zb=typeof qx.oninput=="function"}Bb=zb}else Bb=!1;$x=Bb&&(!document.documentMode||9<document.documentMode)}function Vx(){Gd&&(Gd.detachEvent("onpropertychange",Gx),Yd=Gd=null)}function Gx(o){if(o.propertyName==="value"&&ep(Yd)){var c=[];Hx(c,Yd,o,$e(o)),ps(FL,c)}}function UL(o,c,f){o==="focusin"?(Vx(),Gd=c,Yd=f,Gd.attachEvent("onpropertychange",Gx)):o==="focusout"&&Vx()}function HL(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return ep(Yd)}function jL(o,c){if(o==="click")return ep(c)}function $L(o,c){if(o==="input"||o==="change")return ep(c)}function qL(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var Yi=typeof Object.is=="function"?Object.is:qL;function Wd(o,c){if(Yi(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var f=Object.keys(o),m=Object.keys(c);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var v=f[m];if(!Vr.call(c,v)||!Yi(o[v],c[v]))return!1}return!0}function Yx(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Wx(o,c){var f=Yx(o);o=0;for(var m;f;){if(f.nodeType===3){if(m=o+f.textContent.length,o<=c&&m>=c)return{node:f,offset:c-o};o=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Yx(f)}}function Kx(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?Kx(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function Xx(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=Gl(o.document);c instanceof o.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)o=c.contentWindow;else break;c=Gl(o.document)}return c}function Fb(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}var VL=Us&&"documentMode"in document&&11>=document.documentMode,ic=null,Ub=null,Kd=null,Hb=!1;function Qx(o,c,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Hb||ic==null||ic!==Gl(m)||(m=ic,"selectionStart"in m&&Fb(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Kd&&Wd(Kd,m)||(Kd=m,m=Fp(Ub,"onSelect"),0<m.length&&(c=new Zh("onSelect","select",null,c,f),o.push({event:c,listeners:m}),c.target=ic)))}function Xl(o,c){var f={};return f[o.toLowerCase()]=c.toLowerCase(),f["Webkit"+o]="webkit"+c,f["Moz"+o]="moz"+c,f}var sc={animationend:Xl("Animation","AnimationEnd"),animationiteration:Xl("Animation","AnimationIteration"),animationstart:Xl("Animation","AnimationStart"),transitionrun:Xl("Transition","TransitionRun"),transitionstart:Xl("Transition","TransitionStart"),transitioncancel:Xl("Transition","TransitionCancel"),transitionend:Xl("Transition","TransitionEnd")},jb={},Zx={};Us&&(Zx=document.createElement("div").style,"AnimationEvent"in window||(delete sc.animationend.animation,delete sc.animationiteration.animation,delete sc.animationstart.animation),"TransitionEvent"in window||delete sc.transitionend.transition);function Ql(o){if(jb[o])return jb[o];if(!sc[o])return o;var c=sc[o],f;for(f in c)if(c.hasOwnProperty(f)&&f in Zx)return jb[o]=c[f];return o}var Jx=Ql("animationend"),e6=Ql("animationiteration"),t6=Ql("animationstart"),GL=Ql("transitionrun"),YL=Ql("transitionstart"),WL=Ql("transitioncancel"),n6=Ql("transitionend"),r6=new Map,$b="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");$b.push("scrollEnd");function Hs(o,c){r6.set(o,c),Oa(c,[o])}var i6=new WeakMap;function ms(o,c){if(typeof o=="object"&&o!==null){var f=i6.get(o);return f!==void 0?f:(c={value:o,source:c,stack:Fs(c)},i6.set(o,c),c)}return{value:o,source:c,stack:Fs(c)}}var gs=[],ac=0,qb=0;function tp(){for(var o=ac,c=qb=ac=0;c<o;){var f=gs[c];gs[c++]=null;var m=gs[c];gs[c++]=null;var v=gs[c];gs[c++]=null;var _=gs[c];if(gs[c++]=null,m!==null&&v!==null){var M=m.pending;M===null?v.next=v:(v.next=M.next,M.next=v),m.pending=v}_!==0&&s6(f,v,_)}}function np(o,c,f,m){gs[ac++]=o,gs[ac++]=c,gs[ac++]=f,gs[ac++]=m,qb|=m,o.lanes|=m,o=o.alternate,o!==null&&(o.lanes|=m)}function Vb(o,c,f,m){return np(o,c,f,m),rp(o)}function oc(o,c){return np(o,null,null,c),rp(o)}function s6(o,c,f){o.lanes|=f;var m=o.alternate;m!==null&&(m.lanes|=f);for(var v=!1,_=o.return;_!==null;)_.childLanes|=f,m=_.alternate,m!==null&&(m.childLanes|=f),_.tag===22&&(o=_.stateNode,o===null||o._visibility&1||(v=!0)),o=_,_=_.return;return o.tag===3?(_=o.stateNode,v&&c!==null&&(v=31-st(f),o=_.hiddenUpdates,m=o[v],m===null?o[v]=[c]:m.push(c),c.lane=f|536870912),_):null}function rp(o){if(50<E0)throw E0=0,Qv=null,Error(r(185));for(var c=o.return;c!==null;)o=c,c=o.return;return o.tag===3?o.stateNode:null}var lc={};function KL(o,c,f,m){this.tag=o,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wi(o,c,f,m){return new KL(o,c,f,m)}function Gb(o){return o=o.prototype,!(!o||!o.isReactComponent)}function La(o,c){var f=o.alternate;return f===null?(f=Wi(o.tag,c,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=c,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&65011712,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,c=o.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f.refCleanup=o.refCleanup,f}function a6(o,c){o.flags&=65011714;var f=o.alternate;return f===null?(o.childLanes=0,o.lanes=c,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=f.childLanes,o.lanes=f.lanes,o.child=f.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=f.memoizedProps,o.memoizedState=f.memoizedState,o.updateQueue=f.updateQueue,o.type=f.type,c=f.dependencies,o.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),o}function ip(o,c,f,m,v,_){var M=0;if(m=o,typeof o=="function")Gb(o)&&(M=1);else if(typeof o=="string")M=QP(o,f,Ee.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case Z:return o=Wi(31,f,c,v),o.elementType=Z,o.lanes=_,o;case y:return Zl(f.children,v,_,c);case E:M=8,v|=24;break;case T:return o=Wi(12,f,c,v|2),o.elementType=T,o.lanes=_,o;case I:return o=Wi(13,f,c,v),o.elementType=I,o.lanes=_,o;case P:return o=Wi(19,f,c,v),o.elementType=P,o.lanes=_,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case S:case R:M=10;break e;case A:M=9;break e;case z:M=11;break e;case $:M=14;break e;case K:M=16,m=null;break e}M=29,f=Error(r(130,o===null?"null":typeof o,"")),m=null}return c=Wi(M,f,c,v),c.elementType=o,c.type=m,c.lanes=_,c}function Zl(o,c,f,m){return o=Wi(7,o,m,c),o.lanes=f,o}function Yb(o,c,f){return o=Wi(6,o,null,c),o.lanes=f,o}function Wb(o,c,f){return c=Wi(4,o.children!==null?o.children:[],o.key,c),c.lanes=f,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}var uc=[],cc=0,sp=null,ap=0,bs=[],vs=0,Jl=null,Pa=1,Ba="";function eu(o,c){uc[cc++]=ap,uc[cc++]=sp,sp=o,ap=c}function o6(o,c,f){bs[vs++]=Pa,bs[vs++]=Ba,bs[vs++]=Jl,Jl=o;var m=Pa;o=Ba;var v=32-st(m)-1;m&=~(1<<v),f+=1;var _=32-st(c)+v;if(30<_){var M=v-v%5;_=(m&(1<<M)-1).toString(32),m>>=M,v-=M,Pa=1<<32-st(c)+v|f<<v|m,Ba=_+o}else Pa=1<<_|f<<v|m,Ba=o}function Kb(o){o.return!==null&&(eu(o,1),o6(o,1,0))}function Xb(o){for(;o===sp;)sp=uc[--cc],uc[cc]=null,ap=uc[--cc],uc[cc]=null;for(;o===Jl;)Jl=bs[--vs],bs[vs]=null,Ba=bs[--vs],bs[vs]=null,Pa=bs[--vs],bs[vs]=null}var mi=null,Qn=null,Jt=!1,tu=null,na=!1,Qb=Error(r(519));function nu(o){var c=Error(r(418,""));throw Zd(ms(c,o)),Qb}function l6(o){var c=o.stateNode,f=o.type,m=o.memoizedProps;switch(c[He]=o,c[nt]=m,f){case"dialog":Ht("cancel",c),Ht("close",c);break;case"iframe":case"object":case"embed":Ht("load",c);break;case"video":case"audio":for(f=0;f<x0.length;f++)Ht(x0[f],c);break;case"source":Ht("error",c);break;case"img":case"image":case"link":Ht("error",c),Ht("load",c);break;case"details":Ht("toggle",c);break;case"input":Ht("invalid",c),Yh(c,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0),Vl(c);break;case"select":Ht("invalid",c);break;case"textarea":Ht("invalid",c),Wh(c,m.value,m.defaultValue,m.children),Vl(c)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||c.textContent===""+f||m.suppressHydrationWarning===!0||w5(c.textContent,f)?(m.popover!=null&&(Ht("beforetoggle",c),Ht("toggle",c)),m.onScroll!=null&&Ht("scroll",c),m.onScrollEnd!=null&&Ht("scrollend",c),m.onClick!=null&&(c.onclick=Up),c=!0):c=!1,c||nu(o)}function u6(o){for(mi=o.return;mi;)switch(mi.tag){case 5:case 13:na=!1;return;case 27:case 3:na=!0;return;default:mi=mi.return}}function Xd(o){if(o!==mi)return!1;if(!Jt)return u6(o),Jt=!0,!1;var c=o.tag,f;if((f=c!==3&&c!==27)&&((f=c===5)&&(f=o.type,f=!(f!=="form"&&f!=="button")||hy(o.type,o.memoizedProps)),f=!f),f&&Qn&&nu(o),u6(o),c===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));e:{for(o=o.nextSibling,c=0;o;){if(o.nodeType===8)if(f=o.data,f==="/$"){if(c===0){Qn=$s(o.nextSibling);break e}c--}else f!=="$"&&f!=="$!"&&f!=="$?"||c++;o=o.nextSibling}Qn=null}}else c===27?(c=Qn,Yo(o.type)?(o=by,by=null,Qn=o):Qn=c):Qn=mi?$s(o.stateNode.nextSibling):null;return!0}function Qd(){Qn=mi=null,Jt=!1}function c6(){var o=tu;return o!==null&&(Di===null?Di=o:Di.push.apply(Di,o),tu=null),o}function Zd(o){tu===null?tu=[o]:tu.push(o)}var Zb=X(null),ru=null,za=null;function Ro(o,c,f){B(Zb,c._currentValue),c._currentValue=f}function Fa(o){o._currentValue=Zb.current,me(Zb)}function Jb(o,c,f){for(;o!==null;){var m=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,m!==null&&(m.childLanes|=c)):m!==null&&(m.childLanes&c)!==c&&(m.childLanes|=c),o===f)break;o=o.return}}function ev(o,c,f,m){var v=o.child;for(v!==null&&(v.return=o);v!==null;){var _=v.dependencies;if(_!==null){var M=v.child;_=_.firstContext;e:for(;_!==null;){var D=_;_=v;for(var Y=0;Y<c.length;Y++)if(D.context===c[Y]){_.lanes|=f,D=_.alternate,D!==null&&(D.lanes|=f),Jb(_.return,f,o),m||(M=null);break e}_=D.next}}else if(v.tag===18){if(M=v.return,M===null)throw Error(r(341));M.lanes|=f,_=M.alternate,_!==null&&(_.lanes|=f),Jb(M,f,o),M=null}else M=v.child;if(M!==null)M.return=v;else for(M=v;M!==null;){if(M===o){M=null;break}if(v=M.sibling,v!==null){v.return=M.return,M=v;break}M=M.return}v=M}}function Jd(o,c,f,m){o=null;for(var v=c,_=!1;v!==null;){if(!_){if((v.flags&524288)!==0)_=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var M=v.alternate;if(M===null)throw Error(r(387));if(M=M.memoizedProps,M!==null){var D=v.type;Yi(v.pendingProps.value,M.value)||(o!==null?o.push(D):o=[D])}}else if(v===Ft.current){if(M=v.alternate,M===null)throw Error(r(387));M.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(o!==null?o.push(A0):o=[A0])}v=v.return}o!==null&&ev(c,o,f,m),c.flags|=262144}function op(o){for(o=o.firstContext;o!==null;){if(!Yi(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function iu(o){ru=o,za=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function si(o){return d6(ru,o)}function lp(o,c){return ru===null&&iu(o),d6(o,c)}function d6(o,c){var f=c._currentValue;if(c={context:c,memoizedValue:f,next:null},za===null){if(o===null)throw Error(r(308));za=c,o.dependencies={lanes:0,firstContext:c},o.flags|=524288}else za=za.next=c;return f}var XL=typeof AbortController<"u"?AbortController:function(){var o=[],c=this.signal={aborted:!1,addEventListener:function(f,m){o.push(m)}};this.abort=function(){c.aborted=!0,o.forEach(function(f){return f()})}},QL=t.unstable_scheduleCallback,ZL=t.unstable_NormalPriority,Ar={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tv(){return{controller:new XL,data:new Map,refCount:0}}function e0(o){o.refCount--,o.refCount===0&&QL(ZL,function(){o.controller.abort()})}var t0=null,nv=0,dc=0,fc=null;function JL(o,c){if(t0===null){var f=t0=[];nv=0,dc=iy(),fc={status:"pending",value:void 0,then:function(m){f.push(m)}}}return nv++,c.then(f6,f6),c}function f6(){if(--nv===0&&t0!==null){fc!==null&&(fc.status="fulfilled");var o=t0;t0=null,dc=0,fc=null;for(var c=0;c<o.length;c++)(0,o[c])()}}function eP(o,c){var f=[],m={status:"pending",value:null,reason:null,then:function(v){f.push(v)}};return o.then(function(){m.status="fulfilled",m.value=c;for(var v=0;v<f.length;v++)(0,f[v])(c)},function(v){for(m.status="rejected",m.reason=v,v=0;v<f.length;v++)(0,f[v])(void 0)}),m}var h6=J.S;J.S=function(o,c){typeof c=="object"&&c!==null&&typeof c.then=="function"&&JL(o,c),h6!==null&&h6(o,c)};var su=X(null);function rv(){var o=su.current;return o!==null?o:wn.pooledCache}function up(o,c){c===null?B(su,su.current):B(su,c.pool)}function p6(){var o=rv();return o===null?null:{parent:Ar._currentValue,pool:o}}var n0=Error(r(460)),m6=Error(r(474)),cp=Error(r(542)),iv={then:function(){}};function g6(o){return o=o.status,o==="fulfilled"||o==="rejected"}function dp(){}function b6(o,c,f){switch(f=o[f],f===void 0?o.push(c):f!==c&&(c.then(dp,dp),c=f),c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,y6(o),o;default:if(typeof c.status=="string")c.then(dp,dp);else{if(o=wn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=c,o.status="pending",o.then(function(m){if(c.status==="pending"){var v=c;v.status="fulfilled",v.value=m}},function(m){if(c.status==="pending"){var v=c;v.status="rejected",v.reason=m}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,y6(o),o}throw r0=c,n0}}var r0=null;function v6(){if(r0===null)throw Error(r(459));var o=r0;return r0=null,o}function y6(o){if(o===n0||o===cp)throw Error(r(483))}var Do=!1;function sv(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function av(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Io(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Lo(o,c,f){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,(on&2)!==0){var v=m.pending;return v===null?c.next=c:(c.next=v.next,v.next=c),m.pending=c,c=rp(o),s6(o,null,f),c}return np(o,m,c,f),rp(o)}function i0(o,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194048)!==0)){var m=c.lanes;m&=o.pendingLanes,f|=m,c.lanes=f,xe(o,f)}}function ov(o,c){var f=o.updateQueue,m=o.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var v=null,_=null;if(f=f.firstBaseUpdate,f!==null){do{var M={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};_===null?v=_=M:_=_.next=M,f=f.next}while(f!==null);_===null?v=_=c:_=_.next=c}else v=_=c;f={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:_,shared:m.shared,callbacks:m.callbacks},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=c:o.next=c,f.lastBaseUpdate=c}var lv=!1;function s0(){if(lv){var o=fc;if(o!==null)throw o}}function a0(o,c,f,m){lv=!1;var v=o.updateQueue;Do=!1;var _=v.firstBaseUpdate,M=v.lastBaseUpdate,D=v.shared.pending;if(D!==null){v.shared.pending=null;var Y=D,ue=Y.next;Y.next=null,M===null?_=ue:M.next=ue,M=Y;var _e=o.alternate;_e!==null&&(_e=_e.updateQueue,D=_e.lastBaseUpdate,D!==M&&(D===null?_e.firstBaseUpdate=ue:D.next=ue,_e.lastBaseUpdate=Y))}if(_!==null){var Se=v.baseState;M=0,_e=ue=Y=null,D=_;do{var fe=D.lane&-536870913,pe=fe!==D.lane;if(pe?(Vt&fe)===fe:(m&fe)===fe){fe!==0&&fe===dc&&(lv=!0),_e!==null&&(_e=_e.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var Et=o,mt=D;fe=c;var bn=f;switch(mt.tag){case 1:if(Et=mt.payload,typeof Et=="function"){Se=Et.call(bn,Se,fe);break e}Se=Et;break e;case 3:Et.flags=Et.flags&-65537|128;case 0:if(Et=mt.payload,fe=typeof Et=="function"?Et.call(bn,Se,fe):Et,fe==null)break e;Se=h({},Se,fe);break e;case 2:Do=!0}}fe=D.callback,fe!==null&&(o.flags|=64,pe&&(o.flags|=8192),pe=v.callbacks,pe===null?v.callbacks=[fe]:pe.push(fe))}else pe={lane:fe,tag:D.tag,payload:D.payload,callback:D.callback,next:null},_e===null?(ue=_e=pe,Y=Se):_e=_e.next=pe,M|=fe;if(D=D.next,D===null){if(D=v.shared.pending,D===null)break;pe=D,D=pe.next,pe.next=null,v.lastBaseUpdate=pe,v.shared.pending=null}}while(!0);_e===null&&(Y=Se),v.baseState=Y,v.firstBaseUpdate=ue,v.lastBaseUpdate=_e,_===null&&(v.shared.lanes=0),$o|=M,o.lanes=M,o.memoizedState=Se}}function E6(o,c){if(typeof o!="function")throw Error(r(191,o));o.call(c)}function _6(o,c){var f=o.callbacks;if(f!==null)for(o.callbacks=null,o=0;o<f.length;o++)E6(f[o],c)}var hc=X(null),fp=X(0);function x6(o,c){o=Ga,B(fp,o),B(hc,c),Ga=o|c.baseLanes}function uv(){B(fp,Ga),B(hc,hc.current)}function cv(){Ga=fp.current,me(hc),me(fp)}var Po=0,Lt=null,mn=null,gr=null,hp=!1,pc=!1,au=!1,pp=0,o0=0,mc=null,tP=0;function or(){throw Error(r(321))}function dv(o,c){if(c===null)return!1;for(var f=0;f<c.length&&f<o.length;f++)if(!Yi(o[f],c[f]))return!1;return!0}function fv(o,c,f,m,v,_){return Po=_,Lt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,J.H=o===null||o.memoizedState===null?sT:aT,au=!1,_=f(m,v),au=!1,pc&&(_=S6(c,f,m,v)),T6(o),_}function T6(o){J.H=Ep;var c=mn!==null&&mn.next!==null;if(Po=0,gr=mn=Lt=null,hp=!1,o0=0,mc=null,c)throw Error(r(300));o===null||Ir||(o=o.dependencies,o!==null&&op(o)&&(Ir=!0))}function S6(o,c,f,m){Lt=o;var v=0;do{if(pc&&(mc=null),o0=0,pc=!1,25<=v)throw Error(r(301));if(v+=1,gr=mn=null,o.updateQueue!=null){var _=o.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}J.H=lP,_=c(f,m)}while(pc);return _}function nP(){var o=J.H,c=o.useState()[0];return c=typeof c.then=="function"?l0(c):c,o=o.useState()[0],(mn!==null?mn.memoizedState:null)!==o&&(Lt.flags|=1024),c}function hv(){var o=pp!==0;return pp=0,o}function pv(o,c,f){c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~f}function mv(o){if(hp){for(o=o.memoizedState;o!==null;){var c=o.queue;c!==null&&(c.pending=null),o=o.next}hp=!1}Po=0,gr=mn=Lt=null,pc=!1,o0=pp=0,mc=null}function Oi(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gr===null?Lt.memoizedState=gr=o:gr=gr.next=o,gr}function br(){if(mn===null){var o=Lt.alternate;o=o!==null?o.memoizedState:null}else o=mn.next;var c=gr===null?Lt.memoizedState:gr.next;if(c!==null)gr=c,mn=o;else{if(o===null)throw Lt.alternate===null?Error(r(467)):Error(r(310));mn=o,o={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},gr===null?Lt.memoizedState=gr=o:gr=gr.next=o}return gr}function gv(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function l0(o){var c=o0;return o0+=1,mc===null&&(mc=[]),o=b6(mc,o,c),c=Lt,(gr===null?c.memoizedState:gr.next)===null&&(c=c.alternate,J.H=c===null||c.memoizedState===null?sT:aT),o}function mp(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return l0(o);if(o.$$typeof===R)return si(o)}throw Error(r(438,String(o)))}function bv(o){var c=null,f=Lt.updateQueue;if(f!==null&&(c=f.memoCache),c==null){var m=Lt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(c={data:m.data.map(function(v){return v.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),f===null&&(f=gv(),Lt.updateQueue=f),f.memoCache=c,f=c.data[c.index],f===void 0)for(f=c.data[c.index]=Array(o),m=0;m<o;m++)f[m]=W;return c.index++,f}function Ua(o,c){return typeof c=="function"?c(o):c}function gp(o){var c=br();return vv(c,mn,o)}function vv(o,c,f){var m=o.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=f;var v=o.baseQueue,_=m.pending;if(_!==null){if(v!==null){var M=v.next;v.next=_.next,_.next=M}c.baseQueue=v=_,m.pending=null}if(_=o.baseState,v===null)o.memoizedState=_;else{c=v.next;var D=M=null,Y=null,ue=c,_e=!1;do{var Se=ue.lane&-536870913;if(Se!==ue.lane?(Vt&Se)===Se:(Po&Se)===Se){var fe=ue.revertLane;if(fe===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),Se===dc&&(_e=!0);else if((Po&fe)===fe){ue=ue.next,fe===dc&&(_e=!0);continue}else Se={lane:0,revertLane:ue.revertLane,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Y===null?(D=Y=Se,M=_):Y=Y.next=Se,Lt.lanes|=fe,$o|=fe;Se=ue.action,au&&f(_,Se),_=ue.hasEagerState?ue.eagerState:f(_,Se)}else fe={lane:Se,revertLane:ue.revertLane,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Y===null?(D=Y=fe,M=_):Y=Y.next=fe,Lt.lanes|=Se,$o|=Se;ue=ue.next}while(ue!==null&&ue!==c);if(Y===null?M=_:Y.next=D,!Yi(_,o.memoizedState)&&(Ir=!0,_e&&(f=fc,f!==null)))throw f;o.memoizedState=_,o.baseState=M,o.baseQueue=Y,m.lastRenderedState=_}return v===null&&(m.lanes=0),[o.memoizedState,m.dispatch]}function yv(o){var c=br(),f=c.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=o;var m=f.dispatch,v=f.pending,_=c.memoizedState;if(v!==null){f.pending=null;var M=v=v.next;do _=o(_,M.action),M=M.next;while(M!==v);Yi(_,c.memoizedState)||(Ir=!0),c.memoizedState=_,c.baseQueue===null&&(c.baseState=_),f.lastRenderedState=_}return[_,m]}function w6(o,c,f){var m=Lt,v=br(),_=Jt;if(_){if(f===void 0)throw Error(r(407));f=f()}else f=c();var M=!Yi((mn||v).memoizedState,f);M&&(v.memoizedState=f,Ir=!0),v=v.queue;var D=A6.bind(null,m,v,o);if(u0(2048,8,D,[o]),v.getSnapshot!==c||M||gr!==null&&gr.memoizedState.tag&1){if(m.flags|=2048,gc(9,bp(),C6.bind(null,m,v,f,c),null),wn===null)throw Error(r(349));_||(Po&124)!==0||k6(m,c,f)}return f}function k6(o,c,f){o.flags|=16384,o={getSnapshot:c,value:f},c=Lt.updateQueue,c===null?(c=gv(),Lt.updateQueue=c,c.stores=[o]):(f=c.stores,f===null?c.stores=[o]:f.push(o))}function C6(o,c,f,m){c.value=f,c.getSnapshot=m,N6(c)&&M6(o)}function A6(o,c,f){return f(function(){N6(c)&&M6(o)})}function N6(o){var c=o.getSnapshot;o=o.value;try{var f=c();return!Yi(o,f)}catch{return!0}}function M6(o){var c=oc(o,2);c!==null&&Ji(c,o,2)}function Ev(o){var c=Oi();if(typeof o=="function"){var f=o;if(o=f(),au){rt(!0);try{f()}finally{rt(!1)}}}return c.memoizedState=c.baseState=o,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:o},c}function O6(o,c,f,m){return o.baseState=f,vv(o,mn,typeof m=="function"?m:Ua)}function rP(o,c,f,m,v){if(yp(o))throw Error(r(485));if(o=c.action,o!==null){var _={payload:v,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){_.listeners.push(M)}};J.T!==null?f(!0):_.isTransition=!1,m(_),f=c.pending,f===null?(_.next=c.pending=_,R6(c,_)):(_.next=f.next,c.pending=f.next=_)}}function R6(o,c){var f=c.action,m=c.payload,v=o.state;if(c.isTransition){var _=J.T,M={};J.T=M;try{var D=f(v,m),Y=J.S;Y!==null&&Y(M,D),D6(o,c,D)}catch(ue){_v(o,c,ue)}finally{J.T=_}}else try{_=f(v,m),D6(o,c,_)}catch(ue){_v(o,c,ue)}}function D6(o,c,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){I6(o,c,m)},function(m){return _v(o,c,m)}):I6(o,c,f)}function I6(o,c,f){c.status="fulfilled",c.value=f,L6(c),o.state=f,c=o.pending,c!==null&&(f=c.next,f===c?o.pending=null:(f=f.next,c.next=f,R6(o,f)))}function _v(o,c,f){var m=o.pending;if(o.pending=null,m!==null){m=m.next;do c.status="rejected",c.reason=f,L6(c),c=c.next;while(c!==m)}o.action=null}function L6(o){o=o.listeners;for(var c=0;c<o.length;c++)(0,o[c])()}function P6(o,c){return c}function B6(o,c){if(Jt){var f=wn.formState;if(f!==null){e:{var m=Lt;if(Jt){if(Qn){t:{for(var v=Qn,_=na;v.nodeType!==8;){if(!_){v=null;break t}if(v=$s(v.nextSibling),v===null){v=null;break t}}_=v.data,v=_==="F!"||_==="F"?v:null}if(v){Qn=$s(v.nextSibling),m=v.data==="F!";break e}}nu(m)}m=!1}m&&(c=f[0])}}return f=Oi(),f.memoizedState=f.baseState=c,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:P6,lastRenderedState:c},f.queue=m,f=nT.bind(null,Lt,m),m.dispatch=f,m=Ev(!1),_=kv.bind(null,Lt,!1,m.queue),m=Oi(),v={state:c,dispatch:null,action:o,pending:null},m.queue=v,f=rP.bind(null,Lt,v,_,f),v.dispatch=f,m.memoizedState=o,[c,f,!1]}function z6(o){var c=br();return F6(c,mn,o)}function F6(o,c,f){if(c=vv(o,c,P6)[0],o=gp(Ua)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var m=l0(c)}catch(M){throw M===n0?cp:M}else m=c;c=br();var v=c.queue,_=v.dispatch;return f!==c.memoizedState&&(Lt.flags|=2048,gc(9,bp(),iP.bind(null,v,f),null)),[m,_,o]}function iP(o,c){o.action=c}function U6(o){var c=br(),f=mn;if(f!==null)return F6(c,f,o);br(),c=c.memoizedState,f=br();var m=f.queue.dispatch;return f.memoizedState=o,[c,m,!1]}function gc(o,c,f,m){return o={tag:o,create:f,deps:m,inst:c,next:null},c=Lt.updateQueue,c===null&&(c=gv(),Lt.updateQueue=c),f=c.lastEffect,f===null?c.lastEffect=o.next=o:(m=f.next,f.next=o,o.next=m,c.lastEffect=o),o}function bp(){return{destroy:void 0,resource:void 0}}function H6(){return br().memoizedState}function vp(o,c,f,m){var v=Oi();m=m===void 0?null:m,Lt.flags|=o,v.memoizedState=gc(1|c,bp(),f,m)}function u0(o,c,f,m){var v=br();m=m===void 0?null:m;var _=v.memoizedState.inst;mn!==null&&m!==null&&dv(m,mn.memoizedState.deps)?v.memoizedState=gc(c,_,f,m):(Lt.flags|=o,v.memoizedState=gc(1|c,_,f,m))}function j6(o,c){vp(8390656,8,o,c)}function $6(o,c){u0(2048,8,o,c)}function q6(o,c){return u0(4,2,o,c)}function V6(o,c){return u0(4,4,o,c)}function G6(o,c){if(typeof c=="function"){o=o();var f=c(o);return function(){typeof f=="function"?f():c(null)}}if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function Y6(o,c,f){f=f!=null?f.concat([o]):null,u0(4,4,G6.bind(null,c,o),f)}function xv(){}function W6(o,c){var f=br();c=c===void 0?null:c;var m=f.memoizedState;return c!==null&&dv(c,m[1])?m[0]:(f.memoizedState=[o,c],o)}function K6(o,c){var f=br();c=c===void 0?null:c;var m=f.memoizedState;if(c!==null&&dv(c,m[1]))return m[0];if(m=o(),au){rt(!0);try{o()}finally{rt(!1)}}return f.memoizedState=[m,c],m}function Tv(o,c,f){return f===void 0||(Po&1073741824)!==0?o.memoizedState=c:(o.memoizedState=f,o=ZT(),Lt.lanes|=o,$o|=o,f)}function X6(o,c,f,m){return Yi(f,c)?f:hc.current!==null?(o=Tv(o,f,m),Yi(o,c)||(Ir=!0),o):(Po&42)===0?(Ir=!0,o.memoizedState=f):(o=ZT(),Lt.lanes|=o,$o|=o,c)}function Q6(o,c,f,m,v){var _=ne.p;ne.p=_!==0&&8>_?_:8;var M=J.T,D={};J.T=D,kv(o,!1,c,f);try{var Y=v(),ue=J.S;if(ue!==null&&ue(D,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var _e=eP(Y,m);c0(o,c,_e,Zi(o))}else c0(o,c,m,Zi(o))}catch(Se){c0(o,c,{then:function(){},status:"rejected",reason:Se},Zi())}finally{ne.p=_,J.T=M}}function sP(){}function Sv(o,c,f,m){if(o.tag!==5)throw Error(r(476));var v=Z6(o).queue;Q6(o,v,c,he,f===null?sP:function(){return J6(o),f(m)})}function Z6(o){var c=o.memoizedState;if(c!==null)return c;c={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:he},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:f},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function J6(o){var c=Z6(o).next.queue;c0(o,c,{},Zi())}function wv(){return si(A0)}function eT(){return br().memoizedState}function tT(){return br().memoizedState}function aP(o){for(var c=o.return;c!==null;){switch(c.tag){case 24:case 3:var f=Zi();o=Io(f);var m=Lo(c,o,f);m!==null&&(Ji(m,c,f),i0(m,c,f)),c={cache:tv()},o.payload=c;return}c=c.return}}function oP(o,c,f){var m=Zi();f={lane:m,revertLane:0,action:f,hasEagerState:!1,eagerState:null,next:null},yp(o)?rT(c,f):(f=Vb(o,c,f,m),f!==null&&(Ji(f,o,m),iT(f,c,m)))}function nT(o,c,f){var m=Zi();c0(o,c,f,m)}function c0(o,c,f,m){var v={lane:m,revertLane:0,action:f,hasEagerState:!1,eagerState:null,next:null};if(yp(o))rT(c,v);else{var _=o.alternate;if(o.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var M=c.lastRenderedState,D=_(M,f);if(v.hasEagerState=!0,v.eagerState=D,Yi(D,M))return np(o,c,v,0),wn===null&&tp(),!1}catch{}finally{}if(f=Vb(o,c,v,m),f!==null)return Ji(f,o,m),iT(f,c,m),!0}return!1}function kv(o,c,f,m){if(m={lane:2,revertLane:iy(),action:m,hasEagerState:!1,eagerState:null,next:null},yp(o)){if(c)throw Error(r(479))}else c=Vb(o,f,m,2),c!==null&&Ji(c,o,2)}function yp(o){var c=o.alternate;return o===Lt||c!==null&&c===Lt}function rT(o,c){pc=hp=!0;var f=o.pending;f===null?c.next=c:(c.next=f.next,f.next=c),o.pending=c}function iT(o,c,f){if((f&4194048)!==0){var m=c.lanes;m&=o.pendingLanes,f|=m,c.lanes=f,xe(o,f)}}var Ep={readContext:si,use:mp,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useLayoutEffect:or,useInsertionEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useSyncExternalStore:or,useId:or,useHostTransitionStatus:or,useFormState:or,useActionState:or,useOptimistic:or,useMemoCache:or,useCacheRefresh:or},sT={readContext:si,use:mp,useCallback:function(o,c){return Oi().memoizedState=[o,c===void 0?null:c],o},useContext:si,useEffect:j6,useImperativeHandle:function(o,c,f){f=f!=null?f.concat([o]):null,vp(4194308,4,G6.bind(null,c,o),f)},useLayoutEffect:function(o,c){return vp(4194308,4,o,c)},useInsertionEffect:function(o,c){vp(4,2,o,c)},useMemo:function(o,c){var f=Oi();c=c===void 0?null:c;var m=o();if(au){rt(!0);try{o()}finally{rt(!1)}}return f.memoizedState=[m,c],m},useReducer:function(o,c,f){var m=Oi();if(f!==void 0){var v=f(c);if(au){rt(!0);try{f(c)}finally{rt(!1)}}}else v=c;return m.memoizedState=m.baseState=v,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:v},m.queue=o,o=o.dispatch=oP.bind(null,Lt,o),[m.memoizedState,o]},useRef:function(o){var c=Oi();return o={current:o},c.memoizedState=o},useState:function(o){o=Ev(o);var c=o.queue,f=nT.bind(null,Lt,c);return c.dispatch=f,[o.memoizedState,f]},useDebugValue:xv,useDeferredValue:function(o,c){var f=Oi();return Tv(f,o,c)},useTransition:function(){var o=Ev(!1);return o=Q6.bind(null,Lt,o.queue,!0,!1),Oi().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,c,f){var m=Lt,v=Oi();if(Jt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=c(),wn===null)throw Error(r(349));(Vt&124)!==0||k6(m,c,f)}v.memoizedState=f;var _={value:f,getSnapshot:c};return v.queue=_,j6(A6.bind(null,m,_,o),[o]),m.flags|=2048,gc(9,bp(),C6.bind(null,m,_,f,c),null),f},useId:function(){var o=Oi(),c=wn.identifierPrefix;if(Jt){var f=Ba,m=Pa;f=(m&~(1<<32-st(m)-1)).toString(32)+f,c="«"+c+"R"+f,f=pp++,0<f&&(c+="H"+f.toString(32)),c+="»"}else f=tP++,c="«"+c+"r"+f.toString(32)+"»";return o.memoizedState=c},useHostTransitionStatus:wv,useFormState:B6,useActionState:B6,useOptimistic:function(o){var c=Oi();c.memoizedState=c.baseState=o;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=f,c=kv.bind(null,Lt,!0,f),f.dispatch=c,[o,c]},useMemoCache:bv,useCacheRefresh:function(){return Oi().memoizedState=aP.bind(null,Lt)}},aT={readContext:si,use:mp,useCallback:W6,useContext:si,useEffect:$6,useImperativeHandle:Y6,useInsertionEffect:q6,useLayoutEffect:V6,useMemo:K6,useReducer:gp,useRef:H6,useState:function(){return gp(Ua)},useDebugValue:xv,useDeferredValue:function(o,c){var f=br();return X6(f,mn.memoizedState,o,c)},useTransition:function(){var o=gp(Ua)[0],c=br().memoizedState;return[typeof o=="boolean"?o:l0(o),c]},useSyncExternalStore:w6,useId:eT,useHostTransitionStatus:wv,useFormState:z6,useActionState:z6,useOptimistic:function(o,c){var f=br();return O6(f,mn,o,c)},useMemoCache:bv,useCacheRefresh:tT},lP={readContext:si,use:mp,useCallback:W6,useContext:si,useEffect:$6,useImperativeHandle:Y6,useInsertionEffect:q6,useLayoutEffect:V6,useMemo:K6,useReducer:yv,useRef:H6,useState:function(){return yv(Ua)},useDebugValue:xv,useDeferredValue:function(o,c){var f=br();return mn===null?Tv(f,o,c):X6(f,mn.memoizedState,o,c)},useTransition:function(){var o=yv(Ua)[0],c=br().memoizedState;return[typeof o=="boolean"?o:l0(o),c]},useSyncExternalStore:w6,useId:eT,useHostTransitionStatus:wv,useFormState:U6,useActionState:U6,useOptimistic:function(o,c){var f=br();return mn!==null?O6(f,mn,o,c):(f.baseState=o,[o,f.queue.dispatch])},useMemoCache:bv,useCacheRefresh:tT},bc=null,d0=0;function _p(o){var c=d0;return d0+=1,bc===null&&(bc=[]),b6(bc,o,c)}function f0(o,c){c=c.props.ref,o.ref=c!==void 0?c:null}function xp(o,c){throw c.$$typeof===p?Error(r(525)):(o=Object.prototype.toString.call(c),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o)))}function oT(o){var c=o._init;return c(o._payload)}function lT(o){function c(te,Q){if(o){var se=te.deletions;se===null?(te.deletions=[Q],te.flags|=16):se.push(Q)}}function f(te,Q){if(!o)return null;for(;Q!==null;)c(te,Q),Q=Q.sibling;return null}function m(te){for(var Q=new Map;te!==null;)te.key!==null?Q.set(te.key,te):Q.set(te.index,te),te=te.sibling;return Q}function v(te,Q){return te=La(te,Q),te.index=0,te.sibling=null,te}function _(te,Q,se){return te.index=se,o?(se=te.alternate,se!==null?(se=se.index,se<Q?(te.flags|=67108866,Q):se):(te.flags|=67108866,Q)):(te.flags|=1048576,Q)}function M(te){return o&&te.alternate===null&&(te.flags|=67108866),te}function D(te,Q,se,Te){return Q===null||Q.tag!==6?(Q=Yb(se,te.mode,Te),Q.return=te,Q):(Q=v(Q,se),Q.return=te,Q)}function Y(te,Q,se,Te){var et=se.type;return et===y?_e(te,Q,se.props.children,Te,se.key):Q!==null&&(Q.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===K&&oT(et)===Q.type)?(Q=v(Q,se.props),f0(Q,se),Q.return=te,Q):(Q=ip(se.type,se.key,se.props,null,te.mode,Te),f0(Q,se),Q.return=te,Q)}function ue(te,Q,se,Te){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==se.containerInfo||Q.stateNode.implementation!==se.implementation?(Q=Wb(se,te.mode,Te),Q.return=te,Q):(Q=v(Q,se.children||[]),Q.return=te,Q)}function _e(te,Q,se,Te,et){return Q===null||Q.tag!==7?(Q=Zl(se,te.mode,Te,et),Q.return=te,Q):(Q=v(Q,se),Q.return=te,Q)}function Se(te,Q,se){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Yb(""+Q,te.mode,se),Q.return=te,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case g:return se=ip(Q.type,Q.key,Q.props,null,te.mode,se),f0(se,Q),se.return=te,se;case b:return Q=Wb(Q,te.mode,se),Q.return=te,Q;case K:var Te=Q._init;return Q=Te(Q._payload),Se(te,Q,se)}if(de(Q)||ie(Q))return Q=Zl(Q,te.mode,se,null),Q.return=te,Q;if(typeof Q.then=="function")return Se(te,_p(Q),se);if(Q.$$typeof===R)return Se(te,lp(te,Q),se);xp(te,Q)}return null}function fe(te,Q,se,Te){var et=Q!==null?Q.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return et!==null?null:D(te,Q,""+se,Te);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case g:return se.key===et?Y(te,Q,se,Te):null;case b:return se.key===et?ue(te,Q,se,Te):null;case K:return et=se._init,se=et(se._payload),fe(te,Q,se,Te)}if(de(se)||ie(se))return et!==null?null:_e(te,Q,se,Te,null);if(typeof se.then=="function")return fe(te,Q,_p(se),Te);if(se.$$typeof===R)return fe(te,Q,lp(te,se),Te);xp(te,se)}return null}function pe(te,Q,se,Te,et){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return te=te.get(se)||null,D(Q,te,""+Te,et);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case g:return te=te.get(Te.key===null?se:Te.key)||null,Y(Q,te,Te,et);case b:return te=te.get(Te.key===null?se:Te.key)||null,ue(Q,te,Te,et);case K:var Pt=Te._init;return Te=Pt(Te._payload),pe(te,Q,se,Te,et)}if(de(Te)||ie(Te))return te=te.get(se)||null,_e(Q,te,Te,et,null);if(typeof Te.then=="function")return pe(te,Q,se,_p(Te),et);if(Te.$$typeof===R)return pe(te,Q,se,lp(Q,Te),et);xp(Q,Te)}return null}function Et(te,Q,se,Te){for(var et=null,Pt=null,ot=Q,bt=Q=0,Pr=null;ot!==null&&bt<se.length;bt++){ot.index>bt?(Pr=ot,ot=null):Pr=ot.sibling;var Zt=fe(te,ot,se[bt],Te);if(Zt===null){ot===null&&(ot=Pr);break}o&&ot&&Zt.alternate===null&&c(te,ot),Q=_(Zt,Q,bt),Pt===null?et=Zt:Pt.sibling=Zt,Pt=Zt,ot=Pr}if(bt===se.length)return f(te,ot),Jt&&eu(te,bt),et;if(ot===null){for(;bt<se.length;bt++)ot=Se(te,se[bt],Te),ot!==null&&(Q=_(ot,Q,bt),Pt===null?et=ot:Pt.sibling=ot,Pt=ot);return Jt&&eu(te,bt),et}for(ot=m(ot);bt<se.length;bt++)Pr=pe(ot,te,bt,se[bt],Te),Pr!==null&&(o&&Pr.alternate!==null&&ot.delete(Pr.key===null?bt:Pr.key),Q=_(Pr,Q,bt),Pt===null?et=Pr:Pt.sibling=Pr,Pt=Pr);return o&&ot.forEach(function(Zo){return c(te,Zo)}),Jt&&eu(te,bt),et}function mt(te,Q,se,Te){if(se==null)throw Error(r(151));for(var et=null,Pt=null,ot=Q,bt=Q=0,Pr=null,Zt=se.next();ot!==null&&!Zt.done;bt++,Zt=se.next()){ot.index>bt?(Pr=ot,ot=null):Pr=ot.sibling;var Zo=fe(te,ot,Zt.value,Te);if(Zo===null){ot===null&&(ot=Pr);break}o&&ot&&Zo.alternate===null&&c(te,ot),Q=_(Zo,Q,bt),Pt===null?et=Zo:Pt.sibling=Zo,Pt=Zo,ot=Pr}if(Zt.done)return f(te,ot),Jt&&eu(te,bt),et;if(ot===null){for(;!Zt.done;bt++,Zt=se.next())Zt=Se(te,Zt.value,Te),Zt!==null&&(Q=_(Zt,Q,bt),Pt===null?et=Zt:Pt.sibling=Zt,Pt=Zt);return Jt&&eu(te,bt),et}for(ot=m(ot);!Zt.done;bt++,Zt=se.next())Zt=pe(ot,te,bt,Zt.value,Te),Zt!==null&&(o&&Zt.alternate!==null&&ot.delete(Zt.key===null?bt:Zt.key),Q=_(Zt,Q,bt),Pt===null?et=Zt:Pt.sibling=Zt,Pt=Zt);return o&&ot.forEach(function(uB){return c(te,uB)}),Jt&&eu(te,bt),et}function bn(te,Q,se,Te){if(typeof se=="object"&&se!==null&&se.type===y&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case g:e:{for(var et=se.key;Q!==null;){if(Q.key===et){if(et=se.type,et===y){if(Q.tag===7){f(te,Q.sibling),Te=v(Q,se.props.children),Te.return=te,te=Te;break e}}else if(Q.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===K&&oT(et)===Q.type){f(te,Q.sibling),Te=v(Q,se.props),f0(Te,se),Te.return=te,te=Te;break e}f(te,Q);break}else c(te,Q);Q=Q.sibling}se.type===y?(Te=Zl(se.props.children,te.mode,Te,se.key),Te.return=te,te=Te):(Te=ip(se.type,se.key,se.props,null,te.mode,Te),f0(Te,se),Te.return=te,te=Te)}return M(te);case b:e:{for(et=se.key;Q!==null;){if(Q.key===et)if(Q.tag===4&&Q.stateNode.containerInfo===se.containerInfo&&Q.stateNode.implementation===se.implementation){f(te,Q.sibling),Te=v(Q,se.children||[]),Te.return=te,te=Te;break e}else{f(te,Q);break}else c(te,Q);Q=Q.sibling}Te=Wb(se,te.mode,Te),Te.return=te,te=Te}return M(te);case K:return et=se._init,se=et(se._payload),bn(te,Q,se,Te)}if(de(se))return Et(te,Q,se,Te);if(ie(se)){if(et=ie(se),typeof et!="function")throw Error(r(150));return se=et.call(se),mt(te,Q,se,Te)}if(typeof se.then=="function")return bn(te,Q,_p(se),Te);if(se.$$typeof===R)return bn(te,Q,lp(te,se),Te);xp(te,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,Q!==null&&Q.tag===6?(f(te,Q.sibling),Te=v(Q,se),Te.return=te,te=Te):(f(te,Q),Te=Yb(se,te.mode,Te),Te.return=te,te=Te),M(te)):f(te,Q)}return function(te,Q,se,Te){try{d0=0;var et=bn(te,Q,se,Te);return bc=null,et}catch(ot){if(ot===n0||ot===cp)throw ot;var Pt=Wi(29,ot,null,te.mode);return Pt.lanes=Te,Pt.return=te,Pt}finally{}}}var vc=lT(!0),uT=lT(!1),ys=X(null),ra=null;function Bo(o){var c=o.alternate;B(Nr,Nr.current&1),B(ys,o),ra===null&&(c===null||hc.current!==null||c.memoizedState!==null)&&(ra=o)}function cT(o){if(o.tag===22){if(B(Nr,Nr.current),B(ys,o),ra===null){var c=o.alternate;c!==null&&c.memoizedState!==null&&(ra=o)}}else zo()}function zo(){B(Nr,Nr.current),B(ys,ys.current)}function Ha(o){me(ys),ra===o&&(ra=null),me(Nr)}var Nr=X(0);function Tp(o){for(var c=o;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||gy(f)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function Cv(o,c,f,m){c=o.memoizedState,f=f(m,c),f=f==null?c:h({},c,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var Av={enqueueSetState:function(o,c,f){o=o._reactInternals;var m=Zi(),v=Io(m);v.payload=c,f!=null&&(v.callback=f),c=Lo(o,v,m),c!==null&&(Ji(c,o,m),i0(c,o,m))},enqueueReplaceState:function(o,c,f){o=o._reactInternals;var m=Zi(),v=Io(m);v.tag=1,v.payload=c,f!=null&&(v.callback=f),c=Lo(o,v,m),c!==null&&(Ji(c,o,m),i0(c,o,m))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var f=Zi(),m=Io(f);m.tag=2,c!=null&&(m.callback=c),c=Lo(o,m,f),c!==null&&(Ji(c,o,f),i0(c,o,f))}};function dT(o,c,f,m,v,_,M){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,_,M):c.prototype&&c.prototype.isPureReactComponent?!Wd(f,m)||!Wd(v,_):!0}function fT(o,c,f,m){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,m),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,m),c.state!==o&&Av.enqueueReplaceState(c,c.state,null)}function ou(o,c){var f=c;if("ref"in c){f={};for(var m in c)m!=="ref"&&(f[m]=c[m])}if(o=o.defaultProps){f===c&&(f=h({},f));for(var v in o)f[v]===void 0&&(f[v]=o[v])}return f}var Sp=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)};function hT(o){Sp(o)}function pT(o){console.error(o)}function mT(o){Sp(o)}function wp(o,c){try{var f=o.onUncaughtError;f(c.value,{componentStack:c.stack})}catch(m){setTimeout(function(){throw m})}}function gT(o,c,f){try{var m=o.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Nv(o,c,f){return f=Io(f),f.tag=3,f.payload={element:null},f.callback=function(){wp(o,c)},f}function bT(o){return o=Io(o),o.tag=3,o}function vT(o,c,f,m){var v=f.type.getDerivedStateFromError;if(typeof v=="function"){var _=m.value;o.payload=function(){return v(_)},o.callback=function(){gT(c,f,m)}}var M=f.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(o.callback=function(){gT(c,f,m),typeof v!="function"&&(qo===null?qo=new Set([this]):qo.add(this));var D=m.stack;this.componentDidCatch(m.value,{componentStack:D!==null?D:""})})}function uP(o,c,f,m,v){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(c=f.alternate,c!==null&&Jd(c,f,v,!0),f=ys.current,f!==null){switch(f.tag){case 13:return ra===null?Jv():f.alternate===null&&Zn===0&&(Zn=3),f.flags&=-257,f.flags|=65536,f.lanes=v,m===iv?f.flags|=16384:(c=f.updateQueue,c===null?f.updateQueue=new Set([m]):c.add(m),ty(o,m,v)),!1;case 22:return f.flags|=65536,m===iv?f.flags|=16384:(c=f.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=c):(f=c.retryQueue,f===null?c.retryQueue=new Set([m]):f.add(m)),ty(o,m,v)),!1}throw Error(r(435,f.tag))}return ty(o,m,v),Jv(),!1}if(Jt)return c=ys.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=v,m!==Qb&&(o=Error(r(422),{cause:m}),Zd(ms(o,f)))):(m!==Qb&&(c=Error(r(423),{cause:m}),Zd(ms(c,f))),o=o.current.alternate,o.flags|=65536,v&=-v,o.lanes|=v,m=ms(m,f),v=Nv(o.stateNode,m,v),ov(o,v),Zn!==4&&(Zn=2)),!1;var _=Error(r(520),{cause:m});if(_=ms(_,f),y0===null?y0=[_]:y0.push(_),Zn!==4&&(Zn=2),c===null)return!0;m=ms(m,f),f=c;do{switch(f.tag){case 3:return f.flags|=65536,o=v&-v,f.lanes|=o,o=Nv(f.stateNode,m,o),ov(f,o),!1;case 1:if(c=f.type,_=f.stateNode,(f.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(qo===null||!qo.has(_))))return f.flags|=65536,v&=-v,f.lanes|=v,v=bT(v),vT(v,o,f,m),ov(f,v),!1}f=f.return}while(f!==null);return!1}var yT=Error(r(461)),Ir=!1;function Yr(o,c,f,m){c.child=o===null?uT(c,null,f,m):vc(c,o.child,f,m)}function ET(o,c,f,m,v){f=f.render;var _=c.ref;if("ref"in m){var M={};for(var D in m)D!=="ref"&&(M[D]=m[D])}else M=m;return iu(c),m=fv(o,c,f,M,_,v),D=hv(),o!==null&&!Ir?(pv(o,c,v),ja(o,c,v)):(Jt&&D&&Kb(c),c.flags|=1,Yr(o,c,m,v),c.child)}function _T(o,c,f,m,v){if(o===null){var _=f.type;return typeof _=="function"&&!Gb(_)&&_.defaultProps===void 0&&f.compare===null?(c.tag=15,c.type=_,xT(o,c,_,m,v)):(o=ip(f.type,null,m,c,c.mode,v),o.ref=c.ref,o.return=c,c.child=o)}if(_=o.child,!Bv(o,v)){var M=_.memoizedProps;if(f=f.compare,f=f!==null?f:Wd,f(M,m)&&o.ref===c.ref)return ja(o,c,v)}return c.flags|=1,o=La(_,m),o.ref=c.ref,o.return=c,c.child=o}function xT(o,c,f,m,v){if(o!==null){var _=o.memoizedProps;if(Wd(_,m)&&o.ref===c.ref)if(Ir=!1,c.pendingProps=m=_,Bv(o,v))(o.flags&131072)!==0&&(Ir=!0);else return c.lanes=o.lanes,ja(o,c,v)}return Mv(o,c,f,m,v)}function TT(o,c,f){var m=c.pendingProps,v=m.children,_=o!==null?o.memoizedState:null;if(m.mode==="hidden"){if((c.flags&128)!==0){if(m=_!==null?_.baseLanes|f:f,o!==null){for(v=c.child=o.child,_=0;v!==null;)_=_|v.lanes|v.childLanes,v=v.sibling;c.childLanes=_&~m}else c.childLanes=0,c.child=null;return ST(o,c,m,f)}if((f&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},o!==null&&up(c,_!==null?_.cachePool:null),_!==null?x6(c,_):uv(),cT(c);else return c.lanes=c.childLanes=536870912,ST(o,c,_!==null?_.baseLanes|f:f,f)}else _!==null?(up(c,_.cachePool),x6(c,_),zo(),c.memoizedState=null):(o!==null&&up(c,null),uv(),zo());return Yr(o,c,v,f),c.child}function ST(o,c,f,m){var v=rv();return v=v===null?null:{parent:Ar._currentValue,pool:v},c.memoizedState={baseLanes:f,cachePool:v},o!==null&&up(c,null),uv(),cT(c),o!==null&&Jd(o,c,m,!0),null}function kp(o,c){var f=c.ref;if(f===null)o!==null&&o.ref!==null&&(c.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(o===null||o.ref!==f)&&(c.flags|=4194816)}}function Mv(o,c,f,m,v){return iu(c),f=fv(o,c,f,m,void 0,v),m=hv(),o!==null&&!Ir?(pv(o,c,v),ja(o,c,v)):(Jt&&m&&Kb(c),c.flags|=1,Yr(o,c,f,v),c.child)}function wT(o,c,f,m,v,_){return iu(c),c.updateQueue=null,f=S6(c,m,f,v),T6(o),m=hv(),o!==null&&!Ir?(pv(o,c,_),ja(o,c,_)):(Jt&&m&&Kb(c),c.flags|=1,Yr(o,c,f,_),c.child)}function kT(o,c,f,m,v){if(iu(c),c.stateNode===null){var _=lc,M=f.contextType;typeof M=="object"&&M!==null&&(_=si(M)),_=new f(m,_),c.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Av,c.stateNode=_,_._reactInternals=c,_=c.stateNode,_.props=m,_.state=c.memoizedState,_.refs={},sv(c),M=f.contextType,_.context=typeof M=="object"&&M!==null?si(M):lc,_.state=c.memoizedState,M=f.getDerivedStateFromProps,typeof M=="function"&&(Cv(c,f,M,m),_.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(M=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),M!==_.state&&Av.enqueueReplaceState(_,_.state,null),a0(c,m,_,v),s0(),_.state=c.memoizedState),typeof _.componentDidMount=="function"&&(c.flags|=4194308),m=!0}else if(o===null){_=c.stateNode;var D=c.memoizedProps,Y=ou(f,D);_.props=Y;var ue=_.context,_e=f.contextType;M=lc,typeof _e=="object"&&_e!==null&&(M=si(_e));var Se=f.getDerivedStateFromProps;_e=typeof Se=="function"||typeof _.getSnapshotBeforeUpdate=="function",D=c.pendingProps!==D,_e||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D||ue!==M)&&fT(c,_,m,M),Do=!1;var fe=c.memoizedState;_.state=fe,a0(c,m,_,v),s0(),ue=c.memoizedState,D||fe!==ue||Do?(typeof Se=="function"&&(Cv(c,f,Se,m),ue=c.memoizedState),(Y=Do||dT(c,f,Y,m,fe,ue,M))?(_e||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(c.flags|=4194308)):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=m,c.memoizedState=ue),_.props=m,_.state=ue,_.context=M,m=Y):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),m=!1)}else{_=c.stateNode,av(o,c),M=c.memoizedProps,_e=ou(f,M),_.props=_e,Se=c.pendingProps,fe=_.context,ue=f.contextType,Y=lc,typeof ue=="object"&&ue!==null&&(Y=si(ue)),D=f.getDerivedStateFromProps,(ue=typeof D=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(M!==Se||fe!==Y)&&fT(c,_,m,Y),Do=!1,fe=c.memoizedState,_.state=fe,a0(c,m,_,v),s0();var pe=c.memoizedState;M!==Se||fe!==pe||Do||o!==null&&o.dependencies!==null&&op(o.dependencies)?(typeof D=="function"&&(Cv(c,f,D,m),pe=c.memoizedState),(_e=Do||dT(c,f,_e,m,fe,pe,Y)||o!==null&&o.dependencies!==null&&op(o.dependencies))?(ue||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(m,pe,Y),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(m,pe,Y)),typeof _.componentDidUpdate=="function"&&(c.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof _.componentDidUpdate!="function"||M===o.memoizedProps&&fe===o.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&fe===o.memoizedState||(c.flags|=1024),c.memoizedProps=m,c.memoizedState=pe),_.props=m,_.state=pe,_.context=Y,m=_e):(typeof _.componentDidUpdate!="function"||M===o.memoizedProps&&fe===o.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&fe===o.memoizedState||(c.flags|=1024),m=!1)}return _=m,kp(o,c),m=(c.flags&128)!==0,_||m?(_=c.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:_.render(),c.flags|=1,o!==null&&m?(c.child=vc(c,o.child,null,v),c.child=vc(c,null,f,v)):Yr(o,c,f,v),c.memoizedState=_.state,o=c.child):o=ja(o,c,v),o}function CT(o,c,f,m){return Qd(),c.flags|=256,Yr(o,c,f,m),c.child}var Ov={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rv(o){return{baseLanes:o,cachePool:p6()}}function Dv(o,c,f){return o=o!==null?o.childLanes&~f:0,c&&(o|=Es),o}function AT(o,c,f){var m=c.pendingProps,v=!1,_=(c.flags&128)!==0,M;if((M=_)||(M=o!==null&&o.memoizedState===null?!1:(Nr.current&2)!==0),M&&(v=!0,c.flags&=-129),M=(c.flags&32)!==0,c.flags&=-33,o===null){if(Jt){if(v?Bo(c):zo(),Jt){var D=Qn,Y;if(Y=D){e:{for(Y=D,D=na;Y.nodeType!==8;){if(!D){D=null;break e}if(Y=$s(Y.nextSibling),Y===null){D=null;break e}}D=Y}D!==null?(c.memoizedState={dehydrated:D,treeContext:Jl!==null?{id:Pa,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},Y=Wi(18,null,null,0),Y.stateNode=D,Y.return=c,c.child=Y,mi=c,Qn=null,Y=!0):Y=!1}Y||nu(c)}if(D=c.memoizedState,D!==null&&(D=D.dehydrated,D!==null))return gy(D)?c.lanes=32:c.lanes=536870912,null;Ha(c)}return D=m.children,m=m.fallback,v?(zo(),v=c.mode,D=Cp({mode:"hidden",children:D},v),m=Zl(m,v,f,null),D.return=c,m.return=c,D.sibling=m,c.child=D,v=c.child,v.memoizedState=Rv(f),v.childLanes=Dv(o,M,f),c.memoizedState=Ov,m):(Bo(c),Iv(c,D))}if(Y=o.memoizedState,Y!==null&&(D=Y.dehydrated,D!==null)){if(_)c.flags&256?(Bo(c),c.flags&=-257,c=Lv(o,c,f)):c.memoizedState!==null?(zo(),c.child=o.child,c.flags|=128,c=null):(zo(),v=m.fallback,D=c.mode,m=Cp({mode:"visible",children:m.children},D),v=Zl(v,D,f,null),v.flags|=2,m.return=c,v.return=c,m.sibling=v,c.child=m,vc(c,o.child,null,f),m=c.child,m.memoizedState=Rv(f),m.childLanes=Dv(o,M,f),c.memoizedState=Ov,c=v);else if(Bo(c),gy(D)){if(M=D.nextSibling&&D.nextSibling.dataset,M)var ue=M.dgst;M=ue,m=Error(r(419)),m.stack="",m.digest=M,Zd({value:m,source:null,stack:null}),c=Lv(o,c,f)}else if(Ir||Jd(o,c,f,!1),M=(f&o.childLanes)!==0,Ir||M){if(M=wn,M!==null&&(m=f&-f,m=(m&42)!==0?1:je(m),m=(m&(M.suspendedLanes|f))!==0?0:m,m!==0&&m!==Y.retryLane))throw Y.retryLane=m,oc(o,m),Ji(M,o,m),yT;D.data==="$?"||Jv(),c=Lv(o,c,f)}else D.data==="$?"?(c.flags|=192,c.child=o.child,c=null):(o=Y.treeContext,Qn=$s(D.nextSibling),mi=c,Jt=!0,tu=null,na=!1,o!==null&&(bs[vs++]=Pa,bs[vs++]=Ba,bs[vs++]=Jl,Pa=o.id,Ba=o.overflow,Jl=c),c=Iv(c,m.children),c.flags|=4096);return c}return v?(zo(),v=m.fallback,D=c.mode,Y=o.child,ue=Y.sibling,m=La(Y,{mode:"hidden",children:m.children}),m.subtreeFlags=Y.subtreeFlags&65011712,ue!==null?v=La(ue,v):(v=Zl(v,D,f,null),v.flags|=2),v.return=c,m.return=c,m.sibling=v,c.child=m,m=v,v=c.child,D=o.child.memoizedState,D===null?D=Rv(f):(Y=D.cachePool,Y!==null?(ue=Ar._currentValue,Y=Y.parent!==ue?{parent:ue,pool:ue}:Y):Y=p6(),D={baseLanes:D.baseLanes|f,cachePool:Y}),v.memoizedState=D,v.childLanes=Dv(o,M,f),c.memoizedState=Ov,m):(Bo(c),f=o.child,o=f.sibling,f=La(f,{mode:"visible",children:m.children}),f.return=c,f.sibling=null,o!==null&&(M=c.deletions,M===null?(c.deletions=[o],c.flags|=16):M.push(o)),c.child=f,c.memoizedState=null,f)}function Iv(o,c){return c=Cp({mode:"visible",children:c},o.mode),c.return=o,o.child=c}function Cp(o,c){return o=Wi(22,o,null,c),o.lanes=0,o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},o}function Lv(o,c,f){return vc(c,o.child,null,f),o=Iv(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function NT(o,c,f){o.lanes|=c;var m=o.alternate;m!==null&&(m.lanes|=c),Jb(o.return,c,f)}function Pv(o,c,f,m,v){var _=o.memoizedState;_===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:v}:(_.isBackwards=c,_.rendering=null,_.renderingStartTime=0,_.last=m,_.tail=f,_.tailMode=v)}function MT(o,c,f){var m=c.pendingProps,v=m.revealOrder,_=m.tail;if(Yr(o,c,m.children,f),m=Nr.current,(m&2)!==0)m=m&1|2,c.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&NT(o,f,c);else if(o.tag===19)NT(o,f,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}m&=1}switch(B(Nr,m),v){case"forwards":for(f=c.child,v=null;f!==null;)o=f.alternate,o!==null&&Tp(o)===null&&(v=f),f=f.sibling;f=v,f===null?(v=c.child,c.child=null):(v=f.sibling,f.sibling=null),Pv(c,!1,v,f,_);break;case"backwards":for(f=null,v=c.child,c.child=null;v!==null;){if(o=v.alternate,o!==null&&Tp(o)===null){c.child=v;break}o=v.sibling,v.sibling=f,f=v,v=o}Pv(c,!0,f,null,_);break;case"together":Pv(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function ja(o,c,f){if(o!==null&&(c.dependencies=o.dependencies),$o|=c.lanes,(f&c.childLanes)===0)if(o!==null){if(Jd(o,c,f,!1),(f&c.childLanes)===0)return null}else return null;if(o!==null&&c.child!==o.child)throw Error(r(153));if(c.child!==null){for(o=c.child,f=La(o,o.pendingProps),c.child=f,f.return=c;o.sibling!==null;)o=o.sibling,f=f.sibling=La(o,o.pendingProps),f.return=c;f.sibling=null}return c.child}function Bv(o,c){return(o.lanes&c)!==0?!0:(o=o.dependencies,!!(o!==null&&op(o)))}function cP(o,c,f){switch(c.tag){case 3:ut(c,c.stateNode.containerInfo),Ro(c,Ar,o.memoizedState.cache),Qd();break;case 27:case 5:Nt(c);break;case 4:ut(c,c.stateNode.containerInfo);break;case 10:Ro(c,c.type,c.memoizedProps.value);break;case 13:var m=c.memoizedState;if(m!==null)return m.dehydrated!==null?(Bo(c),c.flags|=128,null):(f&c.child.childLanes)!==0?AT(o,c,f):(Bo(c),o=ja(o,c,f),o!==null?o.sibling:null);Bo(c);break;case 19:var v=(o.flags&128)!==0;if(m=(f&c.childLanes)!==0,m||(Jd(o,c,f,!1),m=(f&c.childLanes)!==0),v){if(m)return MT(o,c,f);c.flags|=128}if(v=c.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),B(Nr,Nr.current),m)break;return null;case 22:case 23:return c.lanes=0,TT(o,c,f);case 24:Ro(c,Ar,o.memoizedState.cache)}return ja(o,c,f)}function OT(o,c,f){if(o!==null)if(o.memoizedProps!==c.pendingProps)Ir=!0;else{if(!Bv(o,f)&&(c.flags&128)===0)return Ir=!1,cP(o,c,f);Ir=(o.flags&131072)!==0}else Ir=!1,Jt&&(c.flags&1048576)!==0&&o6(c,ap,c.index);switch(c.lanes=0,c.tag){case 16:e:{o=c.pendingProps;var m=c.elementType,v=m._init;if(m=v(m._payload),c.type=m,typeof m=="function")Gb(m)?(o=ou(m,o),c.tag=1,c=kT(null,c,m,o,f)):(c.tag=0,c=Mv(null,c,m,o,f));else{if(m!=null){if(v=m.$$typeof,v===z){c.tag=11,c=ET(null,c,m,o,f);break e}else if(v===$){c.tag=14,c=_T(null,c,m,o,f);break e}}throw c=ae(m)||m,Error(r(306,c,""))}}return c;case 0:return Mv(o,c,c.type,c.pendingProps,f);case 1:return m=c.type,v=ou(m,c.pendingProps),kT(o,c,m,v,f);case 3:e:{if(ut(c,c.stateNode.containerInfo),o===null)throw Error(r(387));m=c.pendingProps;var _=c.memoizedState;v=_.element,av(o,c),a0(c,m,null,f);var M=c.memoizedState;if(m=M.cache,Ro(c,Ar,m),m!==_.cache&&ev(c,[Ar],f,!0),s0(),m=M.element,_.isDehydrated)if(_={element:m,isDehydrated:!1,cache:M.cache},c.updateQueue.baseState=_,c.memoizedState=_,c.flags&256){c=CT(o,c,m,f);break e}else if(m!==v){v=ms(Error(r(424)),c),Zd(v),c=CT(o,c,m,f);break e}else{switch(o=c.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Qn=$s(o.firstChild),mi=c,Jt=!0,tu=null,na=!0,f=uT(c,null,m,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Qd(),m===v){c=ja(o,c,f);break e}Yr(o,c,m,f)}c=c.child}return c;case 26:return kp(o,c),o===null?(f=L5(c.type,null,c.pendingProps,null))?c.memoizedState=f:Jt||(f=c.type,o=c.pendingProps,m=Hp(Fe.current).createElement(f),m[He]=c,m[nt]=o,Kr(m,f,o),$n(m),c.stateNode=m):c.memoizedState=L5(c.type,o.memoizedProps,c.pendingProps,o.memoizedState),null;case 27:return Nt(c),o===null&&Jt&&(m=c.stateNode=R5(c.type,c.pendingProps,Fe.current),mi=c,na=!0,v=Qn,Yo(c.type)?(by=v,Qn=$s(m.firstChild)):Qn=v),Yr(o,c,c.pendingProps.children,f),kp(o,c),o===null&&(c.flags|=4194304),c.child;case 5:return o===null&&Jt&&((v=m=Qn)&&(m=zP(m,c.type,c.pendingProps,na),m!==null?(c.stateNode=m,mi=c,Qn=$s(m.firstChild),na=!1,v=!0):v=!1),v||nu(c)),Nt(c),v=c.type,_=c.pendingProps,M=o!==null?o.memoizedProps:null,m=_.children,hy(v,_)?m=null:M!==null&&hy(v,M)&&(c.flags|=32),c.memoizedState!==null&&(v=fv(o,c,nP,null,null,f),A0._currentValue=v),kp(o,c),Yr(o,c,m,f),c.child;case 6:return o===null&&Jt&&((o=f=Qn)&&(f=FP(f,c.pendingProps,na),f!==null?(c.stateNode=f,mi=c,Qn=null,o=!0):o=!1),o||nu(c)),null;case 13:return AT(o,c,f);case 4:return ut(c,c.stateNode.containerInfo),m=c.pendingProps,o===null?c.child=vc(c,null,m,f):Yr(o,c,m,f),c.child;case 11:return ET(o,c,c.type,c.pendingProps,f);case 7:return Yr(o,c,c.pendingProps,f),c.child;case 8:return Yr(o,c,c.pendingProps.children,f),c.child;case 12:return Yr(o,c,c.pendingProps.children,f),c.child;case 10:return m=c.pendingProps,Ro(c,c.type,m.value),Yr(o,c,m.children,f),c.child;case 9:return v=c.type._context,m=c.pendingProps.children,iu(c),v=si(v),m=m(v),c.flags|=1,Yr(o,c,m,f),c.child;case 14:return _T(o,c,c.type,c.pendingProps,f);case 15:return xT(o,c,c.type,c.pendingProps,f);case 19:return MT(o,c,f);case 31:return m=c.pendingProps,f=c.mode,m={mode:m.mode,children:m.children},o===null?(f=Cp(m,f),f.ref=c.ref,c.child=f,f.return=c,c=f):(f=La(o.child,m),f.ref=c.ref,c.child=f,f.return=c,c=f),c;case 22:return TT(o,c,f);case 24:return iu(c),m=si(Ar),o===null?(v=rv(),v===null&&(v=wn,_=tv(),v.pooledCache=_,_.refCount++,_!==null&&(v.pooledCacheLanes|=f),v=_),c.memoizedState={parent:m,cache:v},sv(c),Ro(c,Ar,v)):((o.lanes&f)!==0&&(av(o,c),a0(c,null,null,f),s0()),v=o.memoizedState,_=c.memoizedState,v.parent!==m?(v={parent:m,cache:m},c.memoizedState=v,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=v),Ro(c,Ar,m)):(m=_.cache,Ro(c,Ar,m),m!==v.cache&&ev(c,[Ar],f,!0))),Yr(o,c,c.pendingProps.children,f),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function $a(o){o.flags|=4}function RT(o,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!U5(c)){if(c=ys.current,c!==null&&((Vt&4194048)===Vt?ra!==null:(Vt&62914560)!==Vt&&(Vt&536870912)===0||c!==ra))throw r0=iv,m6;o.flags|=8192}}function Ap(o,c){c!==null&&(o.flags|=4),o.flags&16384&&(c=o.tag!==22?Wt():536870912,o.lanes|=c,xc|=c)}function h0(o,c){if(!Jt)switch(o.tailMode){case"hidden":c=o.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function Vn(o){var c=o.alternate!==null&&o.alternate.child===o.child,f=0,m=0;if(c)for(var v=o.child;v!==null;)f|=v.lanes|v.childLanes,m|=v.subtreeFlags&65011712,m|=v.flags&65011712,v.return=o,v=v.sibling;else for(v=o.child;v!==null;)f|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=o,v=v.sibling;return o.subtreeFlags|=m,o.childLanes=f,c}function dP(o,c,f){var m=c.pendingProps;switch(Xb(c),c.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vn(c),null;case 1:return Vn(c),null;case 3:return f=c.stateNode,m=null,o!==null&&(m=o.memoizedState.cache),c.memoizedState.cache!==m&&(c.flags|=2048),Fa(Ar),en(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(o===null||o.child===null)&&(Xd(c)?$a(c):o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,c6())),Vn(c),null;case 26:return f=c.memoizedState,o===null?($a(c),f!==null?(Vn(c),RT(c,f)):(Vn(c),c.flags&=-16777217)):f?f!==o.memoizedState?($a(c),Vn(c),RT(c,f)):(Vn(c),c.flags&=-16777217):(o.memoizedProps!==m&&$a(c),Vn(c),c.flags&=-16777217),null;case 27:Mn(c),f=Fe.current;var v=c.type;if(o!==null&&c.stateNode!=null)o.memoizedProps!==m&&$a(c);else{if(!m){if(c.stateNode===null)throw Error(r(166));return Vn(c),null}o=Ee.current,Xd(c)?l6(c):(o=R5(v,m,f),c.stateNode=o,$a(c))}return Vn(c),null;case 5:if(Mn(c),f=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==m&&$a(c);else{if(!m){if(c.stateNode===null)throw Error(r(166));return Vn(c),null}if(o=Ee.current,Xd(c))l6(c);else{switch(v=Hp(Fe.current),o){case 1:o=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:o=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":o=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":o=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":o=v.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof m.is=="string"?v.createElement("select",{is:m.is}):v.createElement("select"),m.multiple?o.multiple=!0:m.size&&(o.size=m.size);break;default:o=typeof m.is=="string"?v.createElement(f,{is:m.is}):v.createElement(f)}}o[He]=c,o[nt]=m;e:for(v=c.child;v!==null;){if(v.tag===5||v.tag===6)o.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===c)break e;for(;v.sibling===null;){if(v.return===null||v.return===c)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}c.stateNode=o;e:switch(Kr(o,f,m),f){case"button":case"input":case"select":case"textarea":o=!!m.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&$a(c)}}return Vn(c),c.flags&=-16777217,null;case 6:if(o&&c.stateNode!=null)o.memoizedProps!==m&&$a(c);else{if(typeof m!="string"&&c.stateNode===null)throw Error(r(166));if(o=Fe.current,Xd(c)){if(o=c.stateNode,f=c.memoizedProps,m=null,v=mi,v!==null)switch(v.tag){case 27:case 5:m=v.memoizedProps}o[He]=c,o=!!(o.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||w5(o.nodeValue,f)),o||nu(c)}else o=Hp(o).createTextNode(m),o[He]=c,c.stateNode=o}return Vn(c),null;case 13:if(m=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(v=Xd(c),m!==null&&m.dehydrated!==null){if(o===null){if(!v)throw Error(r(318));if(v=c.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[He]=c}else Qd(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Vn(c),v=!1}else v=c6(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=v),v=!0;if(!v)return c.flags&256?(Ha(c),c):(Ha(c),null)}if(Ha(c),(c.flags&128)!==0)return c.lanes=f,c;if(f=m!==null,o=o!==null&&o.memoizedState!==null,f){m=c.child,v=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(v=m.alternate.memoizedState.cachePool.pool);var _=null;m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(_=m.memoizedState.cachePool.pool),_!==v&&(m.flags|=2048)}return f!==o&&f&&(c.child.flags|=8192),Ap(c,c.updateQueue),Vn(c),null;case 4:return en(),o===null&&ly(c.stateNode.containerInfo),Vn(c),null;case 10:return Fa(c.type),Vn(c),null;case 19:if(me(Nr),v=c.memoizedState,v===null)return Vn(c),null;if(m=(c.flags&128)!==0,_=v.rendering,_===null)if(m)h0(v,!1);else{if(Zn!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(_=Tp(o),_!==null){for(c.flags|=128,h0(v,!1),o=_.updateQueue,c.updateQueue=o,Ap(c,o),c.subtreeFlags=0,o=f,f=c.child;f!==null;)a6(f,o),f=f.sibling;return B(Nr,Nr.current&1|2),c.child}o=o.sibling}v.tail!==null&&kt()>Op&&(c.flags|=128,m=!0,h0(v,!1),c.lanes=4194304)}else{if(!m)if(o=Tp(_),o!==null){if(c.flags|=128,m=!0,o=o.updateQueue,c.updateQueue=o,Ap(c,o),h0(v,!0),v.tail===null&&v.tailMode==="hidden"&&!_.alternate&&!Jt)return Vn(c),null}else 2*kt()-v.renderingStartTime>Op&&f!==536870912&&(c.flags|=128,m=!0,h0(v,!1),c.lanes=4194304);v.isBackwards?(_.sibling=c.child,c.child=_):(o=v.last,o!==null?o.sibling=_:c.child=_,v.last=_)}return v.tail!==null?(c=v.tail,v.rendering=c,v.tail=c.sibling,v.renderingStartTime=kt(),c.sibling=null,o=Nr.current,B(Nr,m?o&1|2:o&1),c):(Vn(c),null);case 22:case 23:return Ha(c),cv(),m=c.memoizedState!==null,o!==null?o.memoizedState!==null!==m&&(c.flags|=8192):m&&(c.flags|=8192),m?(f&536870912)!==0&&(c.flags&128)===0&&(Vn(c),c.subtreeFlags&6&&(c.flags|=8192)):Vn(c),f=c.updateQueue,f!==null&&Ap(c,f.retryQueue),f=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),m=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),m!==f&&(c.flags|=2048),o!==null&&me(su),null;case 24:return f=null,o!==null&&(f=o.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),Fa(Ar),Vn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function fP(o,c){switch(Xb(c),c.tag){case 1:return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return Fa(Ar),en(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 26:case 27:case 5:return Mn(c),null;case 13:if(Ha(c),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Qd()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return me(Nr),null;case 4:return en(),null;case 10:return Fa(c.type),null;case 22:case 23:return Ha(c),cv(),o!==null&&me(su),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 24:return Fa(Ar),null;case 25:return null;default:return null}}function DT(o,c){switch(Xb(c),c.tag){case 3:Fa(Ar),en();break;case 26:case 27:case 5:Mn(c);break;case 4:en();break;case 13:Ha(c);break;case 19:me(Nr);break;case 10:Fa(c.type);break;case 22:case 23:Ha(c),cv(),o!==null&&me(su);break;case 24:Fa(Ar)}}function p0(o,c){try{var f=c.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var v=m.next;f=v;do{if((f.tag&o)===o){m=void 0;var _=f.create,M=f.inst;m=_(),M.destroy=m}f=f.next}while(f!==v)}}catch(D){yn(c,c.return,D)}}function Fo(o,c,f){try{var m=c.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var _=v.next;m=_;do{if((m.tag&o)===o){var M=m.inst,D=M.destroy;if(D!==void 0){M.destroy=void 0,v=c;var Y=f,ue=D;try{ue()}catch(_e){yn(v,Y,_e)}}}m=m.next}while(m!==_)}}catch(_e){yn(c,c.return,_e)}}function IT(o){var c=o.updateQueue;if(c!==null){var f=o.stateNode;try{_6(c,f)}catch(m){yn(o,o.return,m)}}}function LT(o,c,f){f.props=ou(o.type,o.memoizedProps),f.state=o.memoizedState;try{f.componentWillUnmount()}catch(m){yn(o,c,m)}}function m0(o,c){try{var f=o.ref;if(f!==null){switch(o.tag){case 26:case 27:case 5:var m=o.stateNode;break;case 30:m=o.stateNode;break;default:m=o.stateNode}typeof f=="function"?o.refCleanup=f(m):f.current=m}}catch(v){yn(o,c,v)}}function ia(o,c){var f=o.ref,m=o.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(v){yn(o,c,v)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(v){yn(o,c,v)}else f.current=null}function PT(o){var c=o.type,f=o.memoizedProps,m=o.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(v){yn(o,o.return,v)}}function zv(o,c,f){try{var m=o.stateNode;DP(m,o.type,f,c),m[nt]=c}catch(v){yn(o,o.return,v)}}function BT(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Yo(o.type)||o.tag===4}function Fv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||BT(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Yo(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Uv(o,c,f){var m=o.tag;if(m===5||m===6)o=o.stateNode,c?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(o,c):(c=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,c.appendChild(o),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=Up));else if(m!==4&&(m===27&&Yo(o.type)&&(f=o.stateNode,c=null),o=o.child,o!==null))for(Uv(o,c,f),o=o.sibling;o!==null;)Uv(o,c,f),o=o.sibling}function Np(o,c,f){var m=o.tag;if(m===5||m===6)o=o.stateNode,c?f.insertBefore(o,c):f.appendChild(o);else if(m!==4&&(m===27&&Yo(o.type)&&(f=o.stateNode),o=o.child,o!==null))for(Np(o,c,f),o=o.sibling;o!==null;)Np(o,c,f),o=o.sibling}function zT(o){var c=o.stateNode,f=o.memoizedProps;try{for(var m=o.type,v=c.attributes;v.length;)c.removeAttributeNode(v[0]);Kr(c,m,f),c[He]=o,c[nt]=f}catch(_){yn(o,o.return,_)}}var qa=!1,lr=!1,Hv=!1,FT=typeof WeakSet=="function"?WeakSet:Set,Lr=null;function hP(o,c){if(o=o.containerInfo,dy=Yp,o=Xx(o),Fb(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var v=m.anchorOffset,_=m.focusNode;m=m.focusOffset;try{f.nodeType,_.nodeType}catch{f=null;break e}var M=0,D=-1,Y=-1,ue=0,_e=0,Se=o,fe=null;t:for(;;){for(var pe;Se!==f||v!==0&&Se.nodeType!==3||(D=M+v),Se!==_||m!==0&&Se.nodeType!==3||(Y=M+m),Se.nodeType===3&&(M+=Se.nodeValue.length),(pe=Se.firstChild)!==null;)fe=Se,Se=pe;for(;;){if(Se===o)break t;if(fe===f&&++ue===v&&(D=M),fe===_&&++_e===m&&(Y=M),(pe=Se.nextSibling)!==null)break;Se=fe,fe=Se.parentNode}Se=pe}f=D===-1||Y===-1?null:{start:D,end:Y}}else f=null}f=f||{start:0,end:0}}else f=null;for(fy={focusedElem:o,selectionRange:f},Yp=!1,Lr=c;Lr!==null;)if(c=Lr,o=c.child,(c.subtreeFlags&1024)!==0&&o!==null)o.return=c,Lr=o;else for(;Lr!==null;){switch(c=Lr,_=c.alternate,o=c.flags,c.tag){case 0:break;case 11:case 15:break;case 1:if((o&1024)!==0&&_!==null){o=void 0,f=c,v=_.memoizedProps,_=_.memoizedState,m=f.stateNode;try{var Et=ou(f.type,v,f.elementType===f.type);o=m.getSnapshotBeforeUpdate(Et,_),m.__reactInternalSnapshotBeforeUpdate=o}catch(mt){yn(f,f.return,mt)}}break;case 3:if((o&1024)!==0){if(o=c.stateNode.containerInfo,f=o.nodeType,f===9)my(o);else if(f===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":my(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=c.sibling,o!==null){o.return=c.return,Lr=o;break}Lr=c.return}}function UT(o,c,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:Uo(o,f),m&4&&p0(5,f);break;case 1:if(Uo(o,f),m&4)if(o=f.stateNode,c===null)try{o.componentDidMount()}catch(M){yn(f,f.return,M)}else{var v=ou(f.type,c.memoizedProps);c=c.memoizedState;try{o.componentDidUpdate(v,c,o.__reactInternalSnapshotBeforeUpdate)}catch(M){yn(f,f.return,M)}}m&64&&IT(f),m&512&&m0(f,f.return);break;case 3:if(Uo(o,f),m&64&&(o=f.updateQueue,o!==null)){if(c=null,f.child!==null)switch(f.child.tag){case 27:case 5:c=f.child.stateNode;break;case 1:c=f.child.stateNode}try{_6(o,c)}catch(M){yn(f,f.return,M)}}break;case 27:c===null&&m&4&&zT(f);case 26:case 5:Uo(o,f),c===null&&m&4&&PT(f),m&512&&m0(f,f.return);break;case 12:Uo(o,f);break;case 13:Uo(o,f),m&4&&$T(o,f),m&64&&(o=f.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(f=xP.bind(null,f),UP(o,f))));break;case 22:if(m=f.memoizedState!==null||qa,!m){c=c!==null&&c.memoizedState!==null||lr,v=qa;var _=lr;qa=m,(lr=c)&&!_?Ho(o,f,(f.subtreeFlags&8772)!==0):Uo(o,f),qa=v,lr=_}break;case 30:break;default:Uo(o,f)}}function HT(o){var c=o.alternate;c!==null&&(o.alternate=null,HT(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&$l(c)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var zn=null,Ri=!1;function Va(o,c,f){for(f=f.child;f!==null;)jT(o,c,f),f=f.sibling}function jT(o,c,f){if(we&&typeof we.onCommitFiberUnmount=="function")try{we.onCommitFiberUnmount(ge,f)}catch{}switch(f.tag){case 26:lr||ia(f,c),Va(o,c,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:lr||ia(f,c);var m=zn,v=Ri;Yo(f.type)&&(zn=f.stateNode,Ri=!1),Va(o,c,f),S0(f.stateNode),zn=m,Ri=v;break;case 5:lr||ia(f,c);case 6:if(m=zn,v=Ri,zn=null,Va(o,c,f),zn=m,Ri=v,zn!==null)if(Ri)try{(zn.nodeType===9?zn.body:zn.nodeName==="HTML"?zn.ownerDocument.body:zn).removeChild(f.stateNode)}catch(_){yn(f,c,_)}else try{zn.removeChild(f.stateNode)}catch(_){yn(f,c,_)}break;case 18:zn!==null&&(Ri?(o=zn,M5(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,f.stateNode),R0(o)):M5(zn,f.stateNode));break;case 4:m=zn,v=Ri,zn=f.stateNode.containerInfo,Ri=!0,Va(o,c,f),zn=m,Ri=v;break;case 0:case 11:case 14:case 15:lr||Fo(2,f,c),lr||Fo(4,f,c),Va(o,c,f);break;case 1:lr||(ia(f,c),m=f.stateNode,typeof m.componentWillUnmount=="function"&&LT(f,c,m)),Va(o,c,f);break;case 21:Va(o,c,f);break;case 22:lr=(m=lr)||f.memoizedState!==null,Va(o,c,f),lr=m;break;default:Va(o,c,f)}}function $T(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{R0(o)}catch(f){yn(c,c.return,f)}}function pP(o){switch(o.tag){case 13:case 19:var c=o.stateNode;return c===null&&(c=o.stateNode=new FT),c;case 22:return o=o.stateNode,c=o._retryCache,c===null&&(c=o._retryCache=new FT),c;default:throw Error(r(435,o.tag))}}function jv(o,c){var f=pP(o);c.forEach(function(m){var v=TP.bind(null,o,m);f.has(m)||(f.add(m),m.then(v,v))})}function Ki(o,c){var f=c.deletions;if(f!==null)for(var m=0;m<f.length;m++){var v=f[m],_=o,M=c,D=M;e:for(;D!==null;){switch(D.tag){case 27:if(Yo(D.type)){zn=D.stateNode,Ri=!1;break e}break;case 5:zn=D.stateNode,Ri=!1;break e;case 3:case 4:zn=D.stateNode.containerInfo,Ri=!0;break e}D=D.return}if(zn===null)throw Error(r(160));jT(_,M,v),zn=null,Ri=!1,_=v.alternate,_!==null&&(_.return=null),v.return=null}if(c.subtreeFlags&13878)for(c=c.child;c!==null;)qT(c,o),c=c.sibling}var js=null;function qT(o,c){var f=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Ki(c,o),Xi(o),m&4&&(Fo(3,o,o.return),p0(3,o),Fo(5,o,o.return));break;case 1:Ki(c,o),Xi(o),m&512&&(lr||f===null||ia(f,f.return)),m&64&&qa&&(o=o.updateQueue,o!==null&&(m=o.callbacks,m!==null&&(f=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var v=js;if(Ki(c,o),Xi(o),m&512&&(lr||f===null||ia(f,f.return)),m&4){var _=f!==null?f.memoizedState:null;if(m=o.memoizedState,f===null)if(m===null)if(o.stateNode===null){e:{m=o.type,f=o.memoizedProps,v=v.ownerDocument||v;t:switch(m){case"title":_=v.getElementsByTagName("title")[0],(!_||_[jl]||_[He]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=v.createElement(m),v.head.insertBefore(_,v.querySelector("head > title"))),Kr(_,m,f),_[He]=o,$n(_),m=_;break e;case"link":var M=z5("link","href",v).get(m+(f.href||""));if(M){for(var D=0;D<M.length;D++)if(_=M[D],_.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&_.getAttribute("rel")===(f.rel==null?null:f.rel)&&_.getAttribute("title")===(f.title==null?null:f.title)&&_.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){M.splice(D,1);break t}}_=v.createElement(m),Kr(_,m,f),v.head.appendChild(_);break;case"meta":if(M=z5("meta","content",v).get(m+(f.content||""))){for(D=0;D<M.length;D++)if(_=M[D],_.getAttribute("content")===(f.content==null?null:""+f.content)&&_.getAttribute("name")===(f.name==null?null:f.name)&&_.getAttribute("property")===(f.property==null?null:f.property)&&_.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&_.getAttribute("charset")===(f.charSet==null?null:f.charSet)){M.splice(D,1);break t}}_=v.createElement(m),Kr(_,m,f),v.head.appendChild(_);break;default:throw Error(r(468,m))}_[He]=o,$n(_),m=_}o.stateNode=m}else F5(v,o.type,o.stateNode);else o.stateNode=B5(v,m,o.memoizedProps);else _!==m?(_===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):_.count--,m===null?F5(v,o.type,o.stateNode):B5(v,m,o.memoizedProps)):m===null&&o.stateNode!==null&&zv(o,o.memoizedProps,f.memoizedProps)}break;case 27:Ki(c,o),Xi(o),m&512&&(lr||f===null||ia(f,f.return)),f!==null&&m&4&&zv(o,o.memoizedProps,f.memoizedProps);break;case 5:if(Ki(c,o),Xi(o),m&512&&(lr||f===null||ia(f,f.return)),o.flags&32){v=o.stateNode;try{ta(v,"")}catch(pe){yn(o,o.return,pe)}}m&4&&o.stateNode!=null&&(v=o.memoizedProps,zv(o,v,f!==null?f.memoizedProps:v)),m&1024&&(Hv=!0);break;case 6:if(Ki(c,o),Xi(o),m&4){if(o.stateNode===null)throw Error(r(162));m=o.memoizedProps,f=o.stateNode;try{f.nodeValue=m}catch(pe){yn(o,o.return,pe)}}break;case 3:if(qp=null,v=js,js=jp(c.containerInfo),Ki(c,o),js=v,Xi(o),m&4&&f!==null&&f.memoizedState.isDehydrated)try{R0(c.containerInfo)}catch(pe){yn(o,o.return,pe)}Hv&&(Hv=!1,VT(o));break;case 4:m=js,js=jp(o.stateNode.containerInfo),Ki(c,o),Xi(o),js=m;break;case 12:Ki(c,o),Xi(o);break;case 13:Ki(c,o),Xi(o),o.child.flags&8192&&o.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Wv=kt()),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,jv(o,m)));break;case 22:v=o.memoizedState!==null;var Y=f!==null&&f.memoizedState!==null,ue=qa,_e=lr;if(qa=ue||v,lr=_e||Y,Ki(c,o),lr=_e,qa=ue,Xi(o),m&8192)e:for(c=o.stateNode,c._visibility=v?c._visibility&-2:c._visibility|1,v&&(f===null||Y||qa||lr||lu(o)),f=null,c=o;;){if(c.tag===5||c.tag===26){if(f===null){Y=f=c;try{if(_=Y.stateNode,v)M=_.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{D=Y.stateNode;var Se=Y.memoizedProps.style,fe=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;D.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(pe){yn(Y,Y.return,pe)}}}else if(c.tag===6){if(f===null){Y=c;try{Y.stateNode.nodeValue=v?"":Y.memoizedProps}catch(pe){yn(Y,Y.return,pe)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===o)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;f===c&&(f=null),c=c.return}f===c&&(f=null),c.sibling.return=c.return,c=c.sibling}m&4&&(m=o.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,jv(o,f))));break;case 19:Ki(c,o),Xi(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,jv(o,m)));break;case 30:break;case 21:break;default:Ki(c,o),Xi(o)}}function Xi(o){var c=o.flags;if(c&2){try{for(var f,m=o.return;m!==null;){if(BT(m)){f=m;break}m=m.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var v=f.stateNode,_=Fv(o);Np(o,_,v);break;case 5:var M=f.stateNode;f.flags&32&&(ta(M,""),f.flags&=-33);var D=Fv(o);Np(o,D,M);break;case 3:case 4:var Y=f.stateNode.containerInfo,ue=Fv(o);Uv(o,ue,Y);break;default:throw Error(r(161))}}catch(_e){yn(o,o.return,_e)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function VT(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var c=o;VT(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),o=o.sibling}}function Uo(o,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)UT(o,c.alternate,c),c=c.sibling}function lu(o){for(o=o.child;o!==null;){var c=o;switch(c.tag){case 0:case 11:case 14:case 15:Fo(4,c,c.return),lu(c);break;case 1:ia(c,c.return);var f=c.stateNode;typeof f.componentWillUnmount=="function"&&LT(c,c.return,f),lu(c);break;case 27:S0(c.stateNode);case 26:case 5:ia(c,c.return),lu(c);break;case 22:c.memoizedState===null&&lu(c);break;case 30:lu(c);break;default:lu(c)}o=o.sibling}}function Ho(o,c,f){for(f=f&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var m=c.alternate,v=o,_=c,M=_.flags;switch(_.tag){case 0:case 11:case 15:Ho(v,_,f),p0(4,_);break;case 1:if(Ho(v,_,f),m=_,v=m.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ue){yn(m,m.return,ue)}if(m=_,v=m.updateQueue,v!==null){var D=m.stateNode;try{var Y=v.shared.hiddenCallbacks;if(Y!==null)for(v.shared.hiddenCallbacks=null,v=0;v<Y.length;v++)E6(Y[v],D)}catch(ue){yn(m,m.return,ue)}}f&&M&64&&IT(_),m0(_,_.return);break;case 27:zT(_);case 26:case 5:Ho(v,_,f),f&&m===null&&M&4&&PT(_),m0(_,_.return);break;case 12:Ho(v,_,f);break;case 13:Ho(v,_,f),f&&M&4&&$T(v,_);break;case 22:_.memoizedState===null&&Ho(v,_,f),m0(_,_.return);break;case 30:break;default:Ho(v,_,f)}c=c.sibling}}function $v(o,c){var f=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),o=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(o=c.memoizedState.cachePool.pool),o!==f&&(o!=null&&o.refCount++,f!=null&&e0(f))}function qv(o,c){o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&e0(o))}function sa(o,c,f,m){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)GT(o,c,f,m),c=c.sibling}function GT(o,c,f,m){var v=c.flags;switch(c.tag){case 0:case 11:case 15:sa(o,c,f,m),v&2048&&p0(9,c);break;case 1:sa(o,c,f,m);break;case 3:sa(o,c,f,m),v&2048&&(o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&e0(o)));break;case 12:if(v&2048){sa(o,c,f,m),o=c.stateNode;try{var _=c.memoizedProps,M=_.id,D=_.onPostCommit;typeof D=="function"&&D(M,c.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Y){yn(c,c.return,Y)}}else sa(o,c,f,m);break;case 13:sa(o,c,f,m);break;case 23:break;case 22:_=c.stateNode,M=c.alternate,c.memoizedState!==null?_._visibility&2?sa(o,c,f,m):g0(o,c):_._visibility&2?sa(o,c,f,m):(_._visibility|=2,yc(o,c,f,m,(c.subtreeFlags&10256)!==0)),v&2048&&$v(M,c);break;case 24:sa(o,c,f,m),v&2048&&qv(c.alternate,c);break;default:sa(o,c,f,m)}}function yc(o,c,f,m,v){for(v=v&&(c.subtreeFlags&10256)!==0,c=c.child;c!==null;){var _=o,M=c,D=f,Y=m,ue=M.flags;switch(M.tag){case 0:case 11:case 15:yc(_,M,D,Y,v),p0(8,M);break;case 23:break;case 22:var _e=M.stateNode;M.memoizedState!==null?_e._visibility&2?yc(_,M,D,Y,v):g0(_,M):(_e._visibility|=2,yc(_,M,D,Y,v)),v&&ue&2048&&$v(M.alternate,M);break;case 24:yc(_,M,D,Y,v),v&&ue&2048&&qv(M.alternate,M);break;default:yc(_,M,D,Y,v)}c=c.sibling}}function g0(o,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var f=o,m=c,v=m.flags;switch(m.tag){case 22:g0(f,m),v&2048&&$v(m.alternate,m);break;case 24:g0(f,m),v&2048&&qv(m.alternate,m);break;default:g0(f,m)}c=c.sibling}}var b0=8192;function Ec(o){if(o.subtreeFlags&b0)for(o=o.child;o!==null;)YT(o),o=o.sibling}function YT(o){switch(o.tag){case 26:Ec(o),o.flags&b0&&o.memoizedState!==null&&JP(js,o.memoizedState,o.memoizedProps);break;case 5:Ec(o);break;case 3:case 4:var c=js;js=jp(o.stateNode.containerInfo),Ec(o),js=c;break;case 22:o.memoizedState===null&&(c=o.alternate,c!==null&&c.memoizedState!==null?(c=b0,b0=16777216,Ec(o),b0=c):Ec(o));break;default:Ec(o)}}function WT(o){var c=o.alternate;if(c!==null&&(o=c.child,o!==null)){c.child=null;do c=o.sibling,o.sibling=null,o=c;while(o!==null)}}function v0(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var f=0;f<c.length;f++){var m=c[f];Lr=m,XT(m,o)}WT(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)KT(o),o=o.sibling}function KT(o){switch(o.tag){case 0:case 11:case 15:v0(o),o.flags&2048&&Fo(9,o,o.return);break;case 3:v0(o);break;case 12:v0(o);break;case 22:var c=o.stateNode;o.memoizedState!==null&&c._visibility&2&&(o.return===null||o.return.tag!==13)?(c._visibility&=-3,Mp(o)):v0(o);break;default:v0(o)}}function Mp(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var f=0;f<c.length;f++){var m=c[f];Lr=m,XT(m,o)}WT(o)}for(o=o.child;o!==null;){switch(c=o,c.tag){case 0:case 11:case 15:Fo(8,c,c.return),Mp(c);break;case 22:f=c.stateNode,f._visibility&2&&(f._visibility&=-3,Mp(c));break;default:Mp(c)}o=o.sibling}}function XT(o,c){for(;Lr!==null;){var f=Lr;switch(f.tag){case 0:case 11:case 15:Fo(8,f,c);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:e0(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,Lr=m;else e:for(f=o;Lr!==null;){m=Lr;var v=m.sibling,_=m.return;if(HT(m),m===f){Lr=null;break e}if(v!==null){v.return=_,Lr=v;break e}Lr=_}}}var mP={getCacheForType:function(o){var c=si(Ar),f=c.data.get(o);return f===void 0&&(f=o(),c.data.set(o,f)),f}},gP=typeof WeakMap=="function"?WeakMap:Map,on=0,wn=null,Ut=null,Vt=0,ln=0,Qi=null,jo=!1,_c=!1,Vv=!1,Ga=0,Zn=0,$o=0,uu=0,Gv=0,Es=0,xc=0,y0=null,Di=null,Yv=!1,Wv=0,Op=1/0,Rp=null,qo=null,Wr=0,Vo=null,Tc=null,Sc=0,Kv=0,Xv=null,QT=null,E0=0,Qv=null;function Zi(){if((on&2)!==0&&Vt!==0)return Vt&-Vt;if(J.T!==null){var o=dc;return o!==0?o:iy()}return Pn()}function ZT(){Es===0&&(Es=(Vt&536870912)===0||Jt?ft():536870912);var o=ys.current;return o!==null&&(o.flags|=32),Es}function Ji(o,c,f){(o===wn&&(ln===2||ln===9)||o.cancelPendingCommit!==null)&&(wc(o,0),Go(o,Vt,Es,!1)),pn(o,f),((on&2)===0||o!==wn)&&(o===wn&&((on&2)===0&&(uu|=f),Zn===4&&Go(o,Vt,Es,!1)),aa(o))}function JT(o,c,f){if((on&6)!==0)throw Error(r(327));var m=!f&&(c&124)===0&&(c&o.expiredLanes)===0||tn(o,c),v=m?yP(o,c):ey(o,c,!0),_=m;do{if(v===0){_c&&!m&&Go(o,c,0,!1);break}else{if(f=o.current.alternate,_&&!bP(f)){v=ey(o,c,!1),_=!1;continue}if(v===2){if(_=c,o.errorRecoveryDisabledLanes&_)var M=0;else M=o.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){c=M;e:{var D=o;v=y0;var Y=D.current.memoizedState.isDehydrated;if(Y&&(wc(D,M).flags|=256),M=ey(D,M,!1),M!==2){if(Vv&&!Y){D.errorRecoveryDisabledLanes|=_,uu|=_,v=4;break e}_=Di,Di=v,_!==null&&(Di===null?Di=_:Di.push.apply(Di,_))}v=M}if(_=!1,v!==2)continue}}if(v===1){wc(o,0),Go(o,c,0,!0);break}e:{switch(m=o,_=v,_){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:Go(m,c,Es,!jo);break e;case 2:Di=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(v=Wv+300-kt(),10<v)){if(Go(m,c,Es,!jo),Tn(m,0,!0)!==0)break e;m.timeoutHandle=A5(e5.bind(null,m,f,Di,Rp,Yv,c,Es,uu,xc,jo,_,2,-0,0),v);break e}e5(m,f,Di,Rp,Yv,c,Es,uu,xc,jo,_,0,-0,0)}}break}while(!0);aa(o)}function e5(o,c,f,m,v,_,M,D,Y,ue,_e,Se,fe,pe){if(o.timeoutHandle=-1,Se=c.subtreeFlags,(Se&8192||(Se&16785408)===16785408)&&(C0={stylesheets:null,count:0,unsuspend:ZP},YT(c),Se=eB(),Se!==null)){o.cancelPendingCommit=Se(o5.bind(null,o,c,_,f,m,v,M,D,Y,_e,1,fe,pe)),Go(o,_,M,!ue);return}o5(o,c,_,f,m,v,M,D,Y)}function bP(o){for(var c=o;;){var f=c.tag;if((f===0||f===11||f===15)&&c.flags&16384&&(f=c.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var v=f[m],_=v.getSnapshot;v=v.value;try{if(!Yi(_(),v))return!1}catch{return!1}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Go(o,c,f,m){c&=~Gv,c&=~uu,o.suspendedLanes|=c,o.pingedLanes&=~c,m&&(o.warmLanes|=c),m=o.expirationTimes;for(var v=c;0<v;){var _=31-st(v),M=1<<_;m[_]=-1,v&=~M}f!==0&&q(o,f,c)}function Dp(){return(on&6)===0?(_0(0),!1):!0}function Zv(){if(Ut!==null){if(ln===0)var o=Ut.return;else o=Ut,za=ru=null,mv(o),bc=null,d0=0,o=Ut;for(;o!==null;)DT(o.alternate,o),o=o.return;Ut=null}}function wc(o,c){var f=o.timeoutHandle;f!==-1&&(o.timeoutHandle=-1,LP(f)),f=o.cancelPendingCommit,f!==null&&(o.cancelPendingCommit=null,f()),Zv(),wn=o,Ut=f=La(o.current,null),Vt=c,ln=0,Qi=null,jo=!1,_c=tn(o,c),Vv=!1,xc=Es=Gv=uu=$o=Zn=0,Di=y0=null,Yv=!1,(c&8)!==0&&(c|=c&32);var m=o.entangledLanes;if(m!==0)for(o=o.entanglements,m&=c;0<m;){var v=31-st(m),_=1<<v;c|=o[v],m&=~_}return Ga=c,tp(),f}function t5(o,c){Lt=null,J.H=Ep,c===n0||c===cp?(c=v6(),ln=3):c===m6?(c=v6(),ln=4):ln=c===yT?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Qi=c,Ut===null&&(Zn=1,wp(o,ms(c,o.current)))}function n5(){var o=J.H;return J.H=Ep,o===null?Ep:o}function r5(){var o=J.A;return J.A=mP,o}function Jv(){Zn=4,jo||(Vt&4194048)!==Vt&&ys.current!==null||(_c=!0),($o&134217727)===0&&(uu&134217727)===0||wn===null||Go(wn,Vt,Es,!1)}function ey(o,c,f){var m=on;on|=2;var v=n5(),_=r5();(wn!==o||Vt!==c)&&(Rp=null,wc(o,c)),c=!1;var M=Zn;e:do try{if(ln!==0&&Ut!==null){var D=Ut,Y=Qi;switch(ln){case 8:Zv(),M=6;break e;case 3:case 2:case 9:case 6:ys.current===null&&(c=!0);var ue=ln;if(ln=0,Qi=null,kc(o,D,Y,ue),f&&_c){M=0;break e}break;default:ue=ln,ln=0,Qi=null,kc(o,D,Y,ue)}}vP(),M=Zn;break}catch(_e){t5(o,_e)}while(!0);return c&&o.shellSuspendCounter++,za=ru=null,on=m,J.H=v,J.A=_,Ut===null&&(wn=null,Vt=0,tp()),M}function vP(){for(;Ut!==null;)i5(Ut)}function yP(o,c){var f=on;on|=2;var m=n5(),v=r5();wn!==o||Vt!==c?(Rp=null,Op=kt()+500,wc(o,c)):_c=tn(o,c);e:do try{if(ln!==0&&Ut!==null){c=Ut;var _=Qi;t:switch(ln){case 1:ln=0,Qi=null,kc(o,c,_,1);break;case 2:case 9:if(g6(_)){ln=0,Qi=null,s5(c);break}c=function(){ln!==2&&ln!==9||wn!==o||(ln=7),aa(o)},_.then(c,c);break e;case 3:ln=7;break e;case 4:ln=5;break e;case 7:g6(_)?(ln=0,Qi=null,s5(c)):(ln=0,Qi=null,kc(o,c,_,7));break;case 5:var M=null;switch(Ut.tag){case 26:M=Ut.memoizedState;case 5:case 27:var D=Ut;if(!M||U5(M)){ln=0,Qi=null;var Y=D.sibling;if(Y!==null)Ut=Y;else{var ue=D.return;ue!==null?(Ut=ue,Ip(ue)):Ut=null}break t}}ln=0,Qi=null,kc(o,c,_,5);break;case 6:ln=0,Qi=null,kc(o,c,_,6);break;case 8:Zv(),Zn=6;break e;default:throw Error(r(462))}}EP();break}catch(_e){t5(o,_e)}while(!0);return za=ru=null,J.H=m,J.A=v,on=f,Ut!==null?0:(wn=null,Vt=0,tp(),Zn)}function EP(){for(;Ut!==null&&!Gt();)i5(Ut)}function i5(o){var c=OT(o.alternate,o,Ga);o.memoizedProps=o.pendingProps,c===null?Ip(o):Ut=c}function s5(o){var c=o,f=c.alternate;switch(c.tag){case 15:case 0:c=wT(f,c,c.pendingProps,c.type,void 0,Vt);break;case 11:c=wT(f,c,c.pendingProps,c.type.render,c.ref,Vt);break;case 5:mv(c);default:DT(f,c),c=Ut=a6(c,Ga),c=OT(f,c,Ga)}o.memoizedProps=o.pendingProps,c===null?Ip(o):Ut=c}function kc(o,c,f,m){za=ru=null,mv(c),bc=null,d0=0;var v=c.return;try{if(uP(o,v,c,f,Vt)){Zn=1,wp(o,ms(f,o.current)),Ut=null;return}}catch(_){if(v!==null)throw Ut=v,_;Zn=1,wp(o,ms(f,o.current)),Ut=null;return}c.flags&32768?(Jt||m===1?o=!0:_c||(Vt&536870912)!==0?o=!1:(jo=o=!0,(m===2||m===9||m===3||m===6)&&(m=ys.current,m!==null&&m.tag===13&&(m.flags|=16384))),a5(c,o)):Ip(c)}function Ip(o){var c=o;do{if((c.flags&32768)!==0){a5(c,jo);return}o=c.return;var f=dP(c.alternate,c,Ga);if(f!==null){Ut=f;return}if(c=c.sibling,c!==null){Ut=c;return}Ut=c=o}while(c!==null);Zn===0&&(Zn=5)}function a5(o,c){do{var f=fP(o.alternate,o);if(f!==null){f.flags&=32767,Ut=f;return}if(f=o.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!c&&(o=o.sibling,o!==null)){Ut=o;return}Ut=o=f}while(o!==null);Zn=6,Ut=null}function o5(o,c,f,m,v,_,M,D,Y){o.cancelPendingCommit=null;do Lp();while(Wr!==0);if((on&6)!==0)throw Error(r(327));if(c!==null){if(c===o.current)throw Error(r(177));if(_=c.lanes|c.childLanes,_|=qb,Sn(o,f,_,M,D,Y),o===wn&&(Ut=wn=null,Vt=0),Tc=c,Vo=o,Sc=f,Kv=_,Xv=v,QT=m,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,SP(fr,function(){return f5(),null})):(o.callbackNode=null,o.callbackPriority=0),m=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||m){m=J.T,J.T=null,v=ne.p,ne.p=2,M=on,on|=4;try{hP(o,c,f)}finally{on=M,ne.p=v,J.T=m}}Wr=1,l5(),u5(),c5()}}function l5(){if(Wr===1){Wr=0;var o=Vo,c=Tc,f=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||f){f=J.T,J.T=null;var m=ne.p;ne.p=2;var v=on;on|=4;try{qT(c,o);var _=fy,M=Xx(o.containerInfo),D=_.focusedElem,Y=_.selectionRange;if(M!==D&&D&&D.ownerDocument&&Kx(D.ownerDocument.documentElement,D)){if(Y!==null&&Fb(D)){var ue=Y.start,_e=Y.end;if(_e===void 0&&(_e=ue),"selectionStart"in D)D.selectionStart=ue,D.selectionEnd=Math.min(_e,D.value.length);else{var Se=D.ownerDocument||document,fe=Se&&Se.defaultView||window;if(fe.getSelection){var pe=fe.getSelection(),Et=D.textContent.length,mt=Math.min(Y.start,Et),bn=Y.end===void 0?mt:Math.min(Y.end,Et);!pe.extend&&mt>bn&&(M=bn,bn=mt,mt=M);var te=Wx(D,mt),Q=Wx(D,bn);if(te&&Q&&(pe.rangeCount!==1||pe.anchorNode!==te.node||pe.anchorOffset!==te.offset||pe.focusNode!==Q.node||pe.focusOffset!==Q.offset)){var se=Se.createRange();se.setStart(te.node,te.offset),pe.removeAllRanges(),mt>bn?(pe.addRange(se),pe.extend(Q.node,Q.offset)):(se.setEnd(Q.node,Q.offset),pe.addRange(se))}}}}for(Se=[],pe=D;pe=pe.parentNode;)pe.nodeType===1&&Se.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<Se.length;D++){var Te=Se[D];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}Yp=!!dy,fy=dy=null}finally{on=v,ne.p=m,J.T=f}}o.current=c,Wr=2}}function u5(){if(Wr===2){Wr=0;var o=Vo,c=Tc,f=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||f){f=J.T,J.T=null;var m=ne.p;ne.p=2;var v=on;on|=4;try{UT(o,c.alternate,c)}finally{on=v,ne.p=m,J.T=f}}Wr=3}}function c5(){if(Wr===4||Wr===3){Wr=0,tt();var o=Vo,c=Tc,f=Sc,m=QT;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Wr=5:(Wr=0,Tc=Vo=null,d5(o,o.pendingLanes));var v=o.pendingLanes;if(v===0&&(qo=null),yt(f),c=c.stateNode,we&&typeof we.onCommitFiberRoot=="function")try{we.onCommitFiberRoot(ge,c,void 0,(c.current.flags&128)===128)}catch{}if(m!==null){c=J.T,v=ne.p,ne.p=2,J.T=null;try{for(var _=o.onRecoverableError,M=0;M<m.length;M++){var D=m[M];_(D.value,{componentStack:D.stack})}}finally{J.T=c,ne.p=v}}(Sc&3)!==0&&Lp(),aa(o),v=o.pendingLanes,(f&4194090)!==0&&(v&42)!==0?o===Qv?E0++:(E0=0,Qv=o):E0=0,_0(0)}}function d5(o,c){(o.pooledCacheLanes&=c)===0&&(c=o.pooledCache,c!=null&&(o.pooledCache=null,e0(c)))}function Lp(o){return l5(),u5(),c5(),f5()}function f5(){if(Wr!==5)return!1;var o=Vo,c=Kv;Kv=0;var f=yt(Sc),m=J.T,v=ne.p;try{ne.p=32>f?32:f,J.T=null,f=Xv,Xv=null;var _=Vo,M=Sc;if(Wr=0,Tc=Vo=null,Sc=0,(on&6)!==0)throw Error(r(331));var D=on;if(on|=4,KT(_.current),GT(_,_.current,M,f),on=D,_0(0,!1),we&&typeof we.onPostCommitFiberRoot=="function")try{we.onPostCommitFiberRoot(ge,_)}catch{}return!0}finally{ne.p=v,J.T=m,d5(o,c)}}function h5(o,c,f){c=ms(f,c),c=Nv(o.stateNode,c,2),o=Lo(o,c,2),o!==null&&(pn(o,2),aa(o))}function yn(o,c,f){if(o.tag===3)h5(o,o,f);else for(;c!==null;){if(c.tag===3){h5(c,o,f);break}else if(c.tag===1){var m=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(qo===null||!qo.has(m))){o=ms(f,o),f=bT(2),m=Lo(c,f,2),m!==null&&(vT(f,m,c,o),pn(m,2),aa(m));break}}c=c.return}}function ty(o,c,f){var m=o.pingCache;if(m===null){m=o.pingCache=new gP;var v=new Set;m.set(c,v)}else v=m.get(c),v===void 0&&(v=new Set,m.set(c,v));v.has(f)||(Vv=!0,v.add(f),o=_P.bind(null,o,c,f),c.then(o,o))}function _P(o,c,f){var m=o.pingCache;m!==null&&m.delete(c),o.pingedLanes|=o.suspendedLanes&f,o.warmLanes&=~f,wn===o&&(Vt&f)===f&&(Zn===4||Zn===3&&(Vt&62914560)===Vt&&300>kt()-Wv?(on&2)===0&&wc(o,0):Gv|=f,xc===Vt&&(xc=0)),aa(o)}function p5(o,c){c===0&&(c=Wt()),o=oc(o,c),o!==null&&(pn(o,c),aa(o))}function xP(o){var c=o.memoizedState,f=0;c!==null&&(f=c.retryLane),p5(o,f)}function TP(o,c){var f=0;switch(o.tag){case 13:var m=o.stateNode,v=o.memoizedState;v!==null&&(f=v.retryLane);break;case 19:m=o.stateNode;break;case 22:m=o.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(c),p5(o,f)}function SP(o,c){return gt(o,c)}var Pp=null,Cc=null,ny=!1,Bp=!1,ry=!1,cu=0;function aa(o){o!==Cc&&o.next===null&&(Cc===null?Pp=Cc=o:Cc=Cc.next=o),Bp=!0,ny||(ny=!0,kP())}function _0(o,c){if(!ry&&Bp){ry=!0;do for(var f=!1,m=Pp;m!==null;){if(o!==0){var v=m.pendingLanes;if(v===0)var _=0;else{var M=m.suspendedLanes,D=m.pingedLanes;_=(1<<31-st(42|o)+1)-1,_&=v&~(M&~D),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(f=!0,v5(m,_))}else _=Vt,_=Tn(m,m===wn?_:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(_&3)===0||tn(m,_)||(f=!0,v5(m,_));m=m.next}while(f);ry=!1}}function wP(){m5()}function m5(){Bp=ny=!1;var o=0;cu!==0&&(IP()&&(o=cu),cu=0);for(var c=kt(),f=null,m=Pp;m!==null;){var v=m.next,_=g5(m,c);_===0?(m.next=null,f===null?Pp=v:f.next=v,v===null&&(Cc=f)):(f=m,(o!==0||(_&3)!==0)&&(Bp=!0)),m=v}_0(o)}function g5(o,c){for(var f=o.suspendedLanes,m=o.pingedLanes,v=o.expirationTimes,_=o.pendingLanes&-62914561;0<_;){var M=31-st(_),D=1<<M,Y=v[M];Y===-1?((D&f)===0||(D&m)!==0)&&(v[M]=ar(D,c)):Y<=c&&(o.expiredLanes|=D),_&=~D}if(c=wn,f=Vt,f=Tn(o,o===c?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m=o.callbackNode,f===0||o===c&&(ln===2||ln===9)||o.cancelPendingCommit!==null)return m!==null&&m!==null&&St(m),o.callbackNode=null,o.callbackPriority=0;if((f&3)===0||tn(o,f)){if(c=f&-f,c===o.callbackPriority)return c;switch(m!==null&&St(m),yt(f)){case 2:case 8:f=hn;break;case 32:f=fr;break;case 268435456:f=fs;break;default:f=fr}return m=b5.bind(null,o),f=gt(f,m),o.callbackPriority=c,o.callbackNode=f,c}return m!==null&&m!==null&&St(m),o.callbackPriority=2,o.callbackNode=null,2}function b5(o,c){if(Wr!==0&&Wr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var f=o.callbackNode;if(Lp()&&o.callbackNode!==f)return null;var m=Vt;return m=Tn(o,o===wn?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m===0?null:(JT(o,m,c),g5(o,kt()),o.callbackNode!=null&&o.callbackNode===f?b5.bind(null,o):null)}function v5(o,c){if(Lp())return null;JT(o,c,!0)}function kP(){PP(function(){(on&6)!==0?gt(qt,wP):m5()})}function iy(){return cu===0&&(cu=ft()),cu}function y5(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Mo(""+o)}function E5(o,c){var f=c.ownerDocument.createElement("input");return f.name=c.name,f.value=c.value,o.id&&f.setAttribute("form",o.id),c.parentNode.insertBefore(f,c),o=new FormData(o),f.parentNode.removeChild(f),o}function CP(o,c,f,m,v){if(c==="submit"&&f&&f.stateNode===v){var _=y5((v[nt]||null).action),M=m.submitter;M&&(c=(c=M[nt]||null)?y5(c.formAction):M.getAttribute("formAction"),c!==null&&(_=c,M=null));var D=new Zh("action","action",null,m,v);o.push({event:D,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(cu!==0){var Y=M?E5(v,M):new FormData(v);Sv(f,{pending:!0,data:Y,method:v.method,action:_},null,Y)}}else typeof _=="function"&&(D.preventDefault(),Y=M?E5(v,M):new FormData(v),Sv(f,{pending:!0,data:Y,method:v.method,action:_},_,Y))},currentTarget:v}]})}}for(var sy=0;sy<$b.length;sy++){var ay=$b[sy],AP=ay.toLowerCase(),NP=ay[0].toUpperCase()+ay.slice(1);Hs(AP,"on"+NP)}Hs(Jx,"onAnimationEnd"),Hs(e6,"onAnimationIteration"),Hs(t6,"onAnimationStart"),Hs("dblclick","onDoubleClick"),Hs("focusin","onFocus"),Hs("focusout","onBlur"),Hs(GL,"onTransitionRun"),Hs(YL,"onTransitionStart"),Hs(WL,"onTransitionCancel"),Hs(n6,"onTransitionEnd"),pi("onMouseEnter",["mouseout","mouseover"]),pi("onMouseLeave",["mouseout","mouseover"]),pi("onPointerEnter",["pointerout","pointerover"]),pi("onPointerLeave",["pointerout","pointerover"]),Oa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Oa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Oa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Oa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Oa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Oa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var x0="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),MP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(x0));function _5(o,c){c=(c&4)!==0;for(var f=0;f<o.length;f++){var m=o[f],v=m.event;m=m.listeners;e:{var _=void 0;if(c)for(var M=m.length-1;0<=M;M--){var D=m[M],Y=D.instance,ue=D.currentTarget;if(D=D.listener,Y!==_&&v.isPropagationStopped())break e;_=D,v.currentTarget=ue;try{_(v)}catch(_e){Sp(_e)}v.currentTarget=null,_=Y}else for(M=0;M<m.length;M++){if(D=m[M],Y=D.instance,ue=D.currentTarget,D=D.listener,Y!==_&&v.isPropagationStopped())break e;_=D,v.currentTarget=ue;try{_(v)}catch(_e){Sp(_e)}v.currentTarget=null,_=Y}}}}function Ht(o,c){var f=c[Bn];f===void 0&&(f=c[Bn]=new Set);var m=o+"__bubble";f.has(m)||(x5(c,o,2,!1),f.add(m))}function oy(o,c,f){var m=0;c&&(m|=4),x5(f,o,m,c)}var zp="_reactListening"+Math.random().toString(36).slice(2);function ly(o){if(!o[zp]){o[zp]=!0,$h.forEach(function(f){f!=="selectionchange"&&(MP.has(f)||oy(f,!1,o),oy(f,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[zp]||(c[zp]=!0,oy("selectionchange",!1,c))}}function x5(o,c,f,m){switch(G5(c)){case 2:var v=rB;break;case 8:v=iB;break;default:v=xy}f=v.bind(null,c,f,o),v=void 0,!Mb||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(v=!0),m?v!==void 0?o.addEventListener(c,f,{capture:!0,passive:v}):o.addEventListener(c,f,!0):v!==void 0?o.addEventListener(c,f,{passive:v}):o.addEventListener(c,f,!1)}function uy(o,c,f,m,v){var _=m;if((c&1)===0&&(c&2)===0&&m!==null)e:for(;;){if(m===null)return;var M=m.tag;if(M===3||M===4){var D=m.stateNode.containerInfo;if(D===v)break;if(M===4)for(M=m.return;M!==null;){var Y=M.tag;if((Y===3||Y===4)&&M.stateNode.containerInfo===v)return;M=M.return}for(;D!==null;){if(M=Co(D),M===null)return;if(Y=M.tag,Y===5||Y===6||Y===26||Y===27){m=_=M;continue e}D=D.parentNode}}m=m.return}ps(function(){var ue=_,_e=$e(f),Se=[];e:{var fe=r6.get(o);if(fe!==void 0){var pe=Zh,Et=o;switch(o){case"keypress":if(Xh(f)===0)break e;case"keydown":case"keyup":pe=SL;break;case"focusin":Et="focus",pe=Ib;break;case"focusout":Et="blur",pe=Ib;break;case"beforeblur":case"afterblur":pe=Ib;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Rx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=fL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=CL;break;case Jx:case e6:case t6:pe=mL;break;case n6:pe=NL;break;case"scroll":case"scrollend":pe=cL;break;case"wheel":pe=OL;break;case"copy":case"cut":case"paste":pe=bL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Ix;break;case"toggle":case"beforetoggle":pe=DL}var mt=(c&4)!==0,bn=!mt&&(o==="scroll"||o==="scrollend"),te=mt?fe!==null?fe+"Capture":null:fe;mt=[];for(var Q=ue,se;Q!==null;){var Te=Q;if(se=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||se===null||te===null||(Te=Wl(Q,te),Te!=null&&mt.push(T0(Q,Te,se))),bn)break;Q=Q.return}0<mt.length&&(fe=new pe(fe,Et,null,f,_e),Se.push({event:fe,listeners:mt}))}}if((c&7)===0){e:{if(fe=o==="mouseover"||o==="pointerover",pe=o==="mouseout"||o==="pointerout",fe&&f!==Yl&&(Et=f.relatedTarget||f.fromElement)&&(Co(Et)||Et[Rn]))break e;if((pe||fe)&&(fe=_e.window===_e?_e:(fe=_e.ownerDocument)?fe.defaultView||fe.parentWindow:window,pe?(Et=f.relatedTarget||f.toElement,pe=ue,Et=Et?Co(Et):null,Et!==null&&(bn=s(Et),mt=Et.tag,Et!==bn||mt!==5&&mt!==27&&mt!==6)&&(Et=null)):(pe=null,Et=ue),pe!==Et)){if(mt=Rx,Te="onMouseLeave",te="onMouseEnter",Q="mouse",(o==="pointerout"||o==="pointerover")&&(mt=Ix,Te="onPointerLeave",te="onPointerEnter",Q="pointer"),bn=pe==null?fe:ql(pe),se=Et==null?fe:ql(Et),fe=new mt(Te,Q+"leave",pe,f,_e),fe.target=bn,fe.relatedTarget=se,Te=null,Co(_e)===ue&&(mt=new mt(te,Q+"enter",Et,f,_e),mt.target=se,mt.relatedTarget=bn,Te=mt),bn=Te,pe&&Et)t:{for(mt=pe,te=Et,Q=0,se=mt;se;se=Ac(se))Q++;for(se=0,Te=te;Te;Te=Ac(Te))se++;for(;0<Q-se;)mt=Ac(mt),Q--;for(;0<se-Q;)te=Ac(te),se--;for(;Q--;){if(mt===te||te!==null&&mt===te.alternate)break t;mt=Ac(mt),te=Ac(te)}mt=null}else mt=null;pe!==null&&T5(Se,fe,pe,mt,!1),Et!==null&&bn!==null&&T5(Se,bn,Et,mt,!0)}}e:{if(fe=ue?ql(ue):window,pe=fe.nodeName&&fe.nodeName.toLowerCase(),pe==="select"||pe==="input"&&fe.type==="file")var et=jx;else if(Ux(fe))if($x)et=$L;else{et=HL;var Pt=UL}else pe=fe.nodeName,!pe||pe.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ue&&rn(ue.elementType)&&(et=jx):et=jL;if(et&&(et=et(o,ue))){Hx(Se,et,f,_e);break e}Pt&&Pt(o,fe,ue),o==="focusout"&&ue&&fe.type==="number"&&ue.memoizedProps.value!=null&&No(fe,"number",fe.value)}switch(Pt=ue?ql(ue):window,o){case"focusin":(Ux(Pt)||Pt.contentEditable==="true")&&(ic=Pt,Ub=ue,Kd=null);break;case"focusout":Kd=Ub=ic=null;break;case"mousedown":Hb=!0;break;case"contextmenu":case"mouseup":case"dragend":Hb=!1,Qx(Se,f,_e);break;case"selectionchange":if(VL)break;case"keydown":case"keyup":Qx(Se,f,_e)}var ot;if(Pb)e:{switch(o){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else rc?zx(o,f)&&(bt="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(bt="onCompositionStart");bt&&(Lx&&f.locale!=="ko"&&(rc||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&rc&&(ot=Mx()):(Oo=_e,Ob="value"in Oo?Oo.value:Oo.textContent,rc=!0)),Pt=Fp(ue,bt),0<Pt.length&&(bt=new Dx(bt,o,null,f,_e),Se.push({event:bt,listeners:Pt}),ot?bt.data=ot:(ot=Fx(f),ot!==null&&(bt.data=ot)))),(ot=LL?PL(o,f):BL(o,f))&&(bt=Fp(ue,"onBeforeInput"),0<bt.length&&(Pt=new Dx("onBeforeInput","beforeinput",null,f,_e),Se.push({event:Pt,listeners:bt}),Pt.data=ot)),CP(Se,o,ue,f,_e)}_5(Se,c)})}function T0(o,c,f){return{instance:o,listener:c,currentTarget:f}}function Fp(o,c){for(var f=c+"Capture",m=[];o!==null;){var v=o,_=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||_===null||(v=Wl(o,f),v!=null&&m.unshift(T0(o,v,_)),v=Wl(o,c),v!=null&&m.push(T0(o,v,_))),o.tag===3)return m;o=o.return}return[]}function Ac(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function T5(o,c,f,m,v){for(var _=c._reactName,M=[];f!==null&&f!==m;){var D=f,Y=D.alternate,ue=D.stateNode;if(D=D.tag,Y!==null&&Y===m)break;D!==5&&D!==26&&D!==27||ue===null||(Y=ue,v?(ue=Wl(f,_),ue!=null&&M.unshift(T0(f,ue,Y))):v||(ue=Wl(f,_),ue!=null&&M.push(T0(f,ue,Y)))),f=f.return}M.length!==0&&o.push({event:c,listeners:M})}var OP=/\r\n?/g,RP=/\u0000|\uFFFD/g;function S5(o){return(typeof o=="string"?o:""+o).replace(OP,`
`).replace(RP,"")}function w5(o,c){return c=S5(c),S5(o)===c}function Up(){}function gn(o,c,f,m,v,_){switch(f){case"children":typeof m=="string"?c==="body"||c==="textarea"&&m===""||ta(o,m):(typeof m=="number"||typeof m=="bigint")&&c!=="body"&&ta(o,""+m);break;case"className":Ra(o,"class",m);break;case"tabIndex":Ra(o,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Ra(o,f,m);break;case"style":pr(o,m,_);break;case"data":if(c!=="object"){Ra(o,"data",m);break}case"src":case"href":if(m===""&&(c!=="a"||f!=="href")){o.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){o.removeAttribute(f);break}m=Mo(""+m),o.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){o.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(f==="formAction"?(c!=="input"&&gn(o,c,"name",v.name,v,null),gn(o,c,"formEncType",v.formEncType,v,null),gn(o,c,"formMethod",v.formMethod,v,null),gn(o,c,"formTarget",v.formTarget,v,null)):(gn(o,c,"encType",v.encType,v,null),gn(o,c,"method",v.method,v,null),gn(o,c,"target",v.target,v,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){o.removeAttribute(f);break}m=Mo(""+m),o.setAttribute(f,m);break;case"onClick":m!=null&&(o.onclick=Up);break;case"onScroll":m!=null&&Ht("scroll",o);break;case"onScrollEnd":m!=null&&Ht("scrollend",o);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(r(60));o.innerHTML=f}}break;case"multiple":o.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":o.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){o.removeAttribute("xlink:href");break}f=Mo(""+m),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(f,""+m):o.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(f,""):o.removeAttribute(f);break;case"capture":case"download":m===!0?o.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(f,m):o.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?o.setAttribute(f,m):o.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?o.removeAttribute(f):o.setAttribute(f,m);break;case"popover":Ht("beforetoggle",o),Ht("toggle",o),tc(o,"popover",m);break;case"xlinkActuate":zs(o,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":zs(o,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":zs(o,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":zs(o,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":zs(o,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":zs(o,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":zs(o,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":zs(o,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":zs(o,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":tc(o,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=nc.get(f)||f,tc(o,f,m))}}function cy(o,c,f,m,v,_){switch(f){case"style":pr(o,m,_);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(r(60));o.innerHTML=f}}break;case"children":typeof m=="string"?ta(o,m):(typeof m=="number"||typeof m=="bigint")&&ta(o,""+m);break;case"onScroll":m!=null&&Ht("scroll",o);break;case"onScrollEnd":m!=null&&Ht("scrollend",o);break;case"onClick":m!=null&&(o.onclick=Up);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qh.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(v=f.endsWith("Capture"),c=f.slice(2,v?f.length-7:void 0),_=o[nt]||null,_=_!=null?_[f]:null,typeof _=="function"&&o.removeEventListener(c,_,v),typeof m=="function")){typeof _!="function"&&_!==null&&(f in o?o[f]=null:o.hasAttribute(f)&&o.removeAttribute(f)),o.addEventListener(c,m,v);break e}f in o?o[f]=m:m===!0?o.setAttribute(f,""):tc(o,f,m)}}}function Kr(o,c,f){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ht("error",o),Ht("load",o);var m=!1,v=!1,_;for(_ in f)if(f.hasOwnProperty(_)){var M=f[_];if(M!=null)switch(_){case"src":m=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:gn(o,c,_,M,f,null)}}v&&gn(o,c,"srcSet",f.srcSet,f,null),m&&gn(o,c,"src",f.src,f,null);return;case"input":Ht("invalid",o);var D=_=M=v=null,Y=null,ue=null;for(m in f)if(f.hasOwnProperty(m)){var _e=f[m];if(_e!=null)switch(m){case"name":v=_e;break;case"type":M=_e;break;case"checked":Y=_e;break;case"defaultChecked":ue=_e;break;case"value":_=_e;break;case"defaultValue":D=_e;break;case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(r(137,c));break;default:gn(o,c,m,_e,f,null)}}Yh(o,_,D,Y,ue,M,v,!1),Vl(o);return;case"select":Ht("invalid",o),m=M=_=null;for(v in f)if(f.hasOwnProperty(v)&&(D=f[v],D!=null))switch(v){case"value":_=D;break;case"defaultValue":M=D;break;case"multiple":m=D;default:gn(o,c,v,D,f,null)}c=_,f=M,o.multiple=!!m,c!=null?Da(o,!!m,c,!1):f!=null&&Da(o,!!m,f,!0);return;case"textarea":Ht("invalid",o),_=v=m=null;for(M in f)if(f.hasOwnProperty(M)&&(D=f[M],D!=null))switch(M){case"value":m=D;break;case"defaultValue":v=D;break;case"children":_=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(91));break;default:gn(o,c,M,D,f,null)}Wh(o,m,v,_),Vl(o);return;case"option":for(Y in f)if(f.hasOwnProperty(Y)&&(m=f[Y],m!=null))switch(Y){case"selected":o.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:gn(o,c,Y,m,f,null)}return;case"dialog":Ht("beforetoggle",o),Ht("toggle",o),Ht("cancel",o),Ht("close",o);break;case"iframe":case"object":Ht("load",o);break;case"video":case"audio":for(m=0;m<x0.length;m++)Ht(x0[m],o);break;case"image":Ht("error",o),Ht("load",o);break;case"details":Ht("toggle",o);break;case"embed":case"source":case"link":Ht("error",o),Ht("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in f)if(f.hasOwnProperty(ue)&&(m=f[ue],m!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:gn(o,c,ue,m,f,null)}return;default:if(rn(c)){for(_e in f)f.hasOwnProperty(_e)&&(m=f[_e],m!==void 0&&cy(o,c,_e,m,f,void 0));return}}for(D in f)f.hasOwnProperty(D)&&(m=f[D],m!=null&&gn(o,c,D,m,f,null))}function DP(o,c,f,m){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,_=null,M=null,D=null,Y=null,ue=null,_e=null;for(pe in f){var Se=f[pe];if(f.hasOwnProperty(pe)&&Se!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":Y=Se;default:m.hasOwnProperty(pe)||gn(o,c,pe,null,m,Se)}}for(var fe in m){var pe=m[fe];if(Se=f[fe],m.hasOwnProperty(fe)&&(pe!=null||Se!=null))switch(fe){case"type":_=pe;break;case"name":v=pe;break;case"checked":ue=pe;break;case"defaultChecked":_e=pe;break;case"value":M=pe;break;case"defaultValue":D=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,c));break;default:pe!==Se&&gn(o,c,fe,pe,m,Se)}}Ud(o,M,D,Y,ue,_e,_,v);return;case"select":pe=M=D=fe=null;for(_ in f)if(Y=f[_],f.hasOwnProperty(_)&&Y!=null)switch(_){case"value":break;case"multiple":pe=Y;default:m.hasOwnProperty(_)||gn(o,c,_,null,m,Y)}for(v in m)if(_=m[v],Y=f[v],m.hasOwnProperty(v)&&(_!=null||Y!=null))switch(v){case"value":fe=_;break;case"defaultValue":D=_;break;case"multiple":M=_;default:_!==Y&&gn(o,c,v,_,m,Y)}c=D,f=M,m=pe,fe!=null?Da(o,!!f,fe,!1):!!m!=!!f&&(c!=null?Da(o,!!f,c,!0):Da(o,!!f,f?[]:"",!1));return;case"textarea":pe=fe=null;for(D in f)if(v=f[D],f.hasOwnProperty(D)&&v!=null&&!m.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:gn(o,c,D,null,m,v)}for(M in m)if(v=m[M],_=f[M],m.hasOwnProperty(M)&&(v!=null||_!=null))switch(M){case"value":fe=v;break;case"defaultValue":pe=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==_&&gn(o,c,M,v,m,_)}Gi(o,fe,pe);return;case"option":for(var Et in f)if(fe=f[Et],f.hasOwnProperty(Et)&&fe!=null&&!m.hasOwnProperty(Et))switch(Et){case"selected":o.selected=!1;break;default:gn(o,c,Et,null,m,fe)}for(Y in m)if(fe=m[Y],pe=f[Y],m.hasOwnProperty(Y)&&fe!==pe&&(fe!=null||pe!=null))switch(Y){case"selected":o.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:gn(o,c,Y,fe,m,pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var mt in f)fe=f[mt],f.hasOwnProperty(mt)&&fe!=null&&!m.hasOwnProperty(mt)&&gn(o,c,mt,null,m,fe);for(ue in m)if(fe=m[ue],pe=f[ue],m.hasOwnProperty(ue)&&fe!==pe&&(fe!=null||pe!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,c));break;default:gn(o,c,ue,fe,m,pe)}return;default:if(rn(c)){for(var bn in f)fe=f[bn],f.hasOwnProperty(bn)&&fe!==void 0&&!m.hasOwnProperty(bn)&&cy(o,c,bn,void 0,m,fe);for(_e in m)fe=m[_e],pe=f[_e],!m.hasOwnProperty(_e)||fe===pe||fe===void 0&&pe===void 0||cy(o,c,_e,fe,m,pe);return}}for(var te in f)fe=f[te],f.hasOwnProperty(te)&&fe!=null&&!m.hasOwnProperty(te)&&gn(o,c,te,null,m,fe);for(Se in m)fe=m[Se],pe=f[Se],!m.hasOwnProperty(Se)||fe===pe||fe==null&&pe==null||gn(o,c,Se,fe,m,pe)}var dy=null,fy=null;function Hp(o){return o.nodeType===9?o:o.ownerDocument}function k5(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function C5(o,c){if(o===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&c==="foreignObject"?0:o}function hy(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var py=null;function IP(){var o=window.event;return o&&o.type==="popstate"?o===py?!1:(py=o,!0):(py=null,!1)}var A5=typeof setTimeout=="function"?setTimeout:void 0,LP=typeof clearTimeout=="function"?clearTimeout:void 0,N5=typeof Promise=="function"?Promise:void 0,PP=typeof queueMicrotask=="function"?queueMicrotask:typeof N5<"u"?function(o){return N5.resolve(null).then(o).catch(BP)}:A5;function BP(o){setTimeout(function(){throw o})}function Yo(o){return o==="head"}function M5(o,c){var f=c,m=0,v=0;do{var _=f.nextSibling;if(o.removeChild(f),_&&_.nodeType===8)if(f=_.data,f==="/$"){if(0<m&&8>m){f=m;var M=o.ownerDocument;if(f&1&&S0(M.documentElement),f&2&&S0(M.body),f&4)for(f=M.head,S0(f),M=f.firstChild;M;){var D=M.nextSibling,Y=M.nodeName;M[jl]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&M.rel.toLowerCase()==="stylesheet"||f.removeChild(M),M=D}}if(v===0){o.removeChild(_),R0(c);return}v--}else f==="$"||f==="$?"||f==="$!"?v++:m=f.charCodeAt(0)-48;else m=0;f=_}while(f);R0(c)}function my(o){var c=o.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var f=c;switch(c=c.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":my(f),$l(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}o.removeChild(f)}}function zP(o,c,f,m){for(;o.nodeType===1;){var v=f;if(o.nodeName.toLowerCase()!==c.toLowerCase()){if(!m&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(m){if(!o[jl])switch(c){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(_=o.getAttribute("rel"),_==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(_!==v.rel||o.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||o.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||o.getAttribute("title")!==(v.title==null?null:v.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(_=o.getAttribute("src"),(_!==(v.src==null?null:v.src)||o.getAttribute("type")!==(v.type==null?null:v.type)||o.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&_&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(c==="input"&&o.type==="hidden"){var _=v.name==null?null:""+v.name;if(v.type==="hidden"&&o.getAttribute("name")===_)return o}else return o;if(o=$s(o.nextSibling),o===null)break}return null}function FP(o,c,f){if(c==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!f||(o=$s(o.nextSibling),o===null))return null;return o}function gy(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState==="complete"}function UP(o,c){var f=o.ownerDocument;if(o.data!=="$?"||f.readyState==="complete")c();else{var m=function(){c(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),o._reactRetry=m}}function $s(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?"||c==="F!"||c==="F")break;if(c==="/$")return null}}return o}var by=null;function O5(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"){if(c===0)return o;c--}else f==="/$"&&c++}o=o.previousSibling}return null}function R5(o,c,f){switch(c=Hp(f),o){case"html":if(o=c.documentElement,!o)throw Error(r(452));return o;case"head":if(o=c.head,!o)throw Error(r(453));return o;case"body":if(o=c.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function S0(o){for(var c=o.attributes;c.length;)o.removeAttributeNode(c[0]);$l(o)}var _s=new Map,D5=new Set;function jp(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Ya=ne.d;ne.d={f:HP,r:jP,D:$P,C:qP,L:VP,m:GP,X:WP,S:YP,M:KP};function HP(){var o=Ya.f(),c=Dp();return o||c}function jP(o){var c=Ao(o);c!==null&&c.tag===5&&c.type==="form"?J6(c):Ya.r(o)}var Nc=typeof document>"u"?null:document;function I5(o,c,f){var m=Nc;if(m&&typeof c=="string"&&c){var v=Ni(c);v='link[rel="'+o+'"][href="'+v+'"]',typeof f=="string"&&(v+='[crossorigin="'+f+'"]'),D5.has(v)||(D5.add(v),o={rel:o,crossOrigin:f,href:c},m.querySelector(v)===null&&(c=m.createElement("link"),Kr(c,"link",o),$n(c),m.head.appendChild(c)))}}function $P(o){Ya.D(o),I5("dns-prefetch",o,null)}function qP(o,c){Ya.C(o,c),I5("preconnect",o,c)}function VP(o,c,f){Ya.L(o,c,f);var m=Nc;if(m&&o&&c){var v='link[rel="preload"][as="'+Ni(c)+'"]';c==="image"&&f&&f.imageSrcSet?(v+='[imagesrcset="'+Ni(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(v+='[imagesizes="'+Ni(f.imageSizes)+'"]')):v+='[href="'+Ni(o)+'"]';var _=v;switch(c){case"style":_=Mc(o);break;case"script":_=Oc(o)}_s.has(_)||(o=h({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:o,as:c},f),_s.set(_,o),m.querySelector(v)!==null||c==="style"&&m.querySelector(w0(_))||c==="script"&&m.querySelector(k0(_))||(c=m.createElement("link"),Kr(c,"link",o),$n(c),m.head.appendChild(c)))}}function GP(o,c){Ya.m(o,c);var f=Nc;if(f&&o){var m=c&&typeof c.as=="string"?c.as:"script",v='link[rel="modulepreload"][as="'+Ni(m)+'"][href="'+Ni(o)+'"]',_=v;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Oc(o)}if(!_s.has(_)&&(o=h({rel:"modulepreload",href:o},c),_s.set(_,o),f.querySelector(v)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(k0(_)))return}m=f.createElement("link"),Kr(m,"link",o),$n(m),f.head.appendChild(m)}}}function YP(o,c,f){Ya.S(o,c,f);var m=Nc;if(m&&o){var v=Ma(m).hoistableStyles,_=Mc(o);c=c||"default";var M=v.get(_);if(!M){var D={loading:0,preload:null};if(M=m.querySelector(w0(_)))D.loading=5;else{o=h({rel:"stylesheet",href:o,"data-precedence":c},f),(f=_s.get(_))&&vy(o,f);var Y=M=m.createElement("link");$n(Y),Kr(Y,"link",o),Y._p=new Promise(function(ue,_e){Y.onload=ue,Y.onerror=_e}),Y.addEventListener("load",function(){D.loading|=1}),Y.addEventListener("error",function(){D.loading|=2}),D.loading|=4,$p(M,c,m)}M={type:"stylesheet",instance:M,count:1,state:D},v.set(_,M)}}}function WP(o,c){Ya.X(o,c);var f=Nc;if(f&&o){var m=Ma(f).hoistableScripts,v=Oc(o),_=m.get(v);_||(_=f.querySelector(k0(v)),_||(o=h({src:o,async:!0},c),(c=_s.get(v))&&yy(o,c),_=f.createElement("script"),$n(_),Kr(_,"link",o),f.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},m.set(v,_))}}function KP(o,c){Ya.M(o,c);var f=Nc;if(f&&o){var m=Ma(f).hoistableScripts,v=Oc(o),_=m.get(v);_||(_=f.querySelector(k0(v)),_||(o=h({src:o,async:!0,type:"module"},c),(c=_s.get(v))&&yy(o,c),_=f.createElement("script"),$n(_),Kr(_,"link",o),f.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},m.set(v,_))}}function L5(o,c,f,m){var v=(v=Fe.current)?jp(v):null;if(!v)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=Mc(f.href),f=Ma(v).hoistableStyles,m=f.get(c),m||(m={type:"style",instance:null,count:0,state:null},f.set(c,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){o=Mc(f.href);var _=Ma(v).hoistableStyles,M=_.get(o);if(M||(v=v.ownerDocument||v,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(o,M),(_=v.querySelector(w0(o)))&&!_._p&&(M.instance=_,M.state.loading=5),_s.has(o)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},_s.set(o,f),_||XP(v,o,f,M.state))),c&&m===null)throw Error(r(528,""));return M}if(c&&m!==null)throw Error(r(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Oc(f),f=Ma(v).hoistableScripts,m=f.get(c),m||(m={type:"script",instance:null,count:0,state:null},f.set(c,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Mc(o){return'href="'+Ni(o)+'"'}function w0(o){return'link[rel="stylesheet"]['+o+"]"}function P5(o){return h({},o,{"data-precedence":o.precedence,precedence:null})}function XP(o,c,f,m){o.querySelector('link[rel="preload"][as="style"]['+c+"]")?m.loading=1:(c=o.createElement("link"),m.preload=c,c.addEventListener("load",function(){return m.loading|=1}),c.addEventListener("error",function(){return m.loading|=2}),Kr(c,"link",f),$n(c),o.head.appendChild(c))}function Oc(o){return'[src="'+Ni(o)+'"]'}function k0(o){return"script[async]"+o}function B5(o,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var m=o.querySelector('style[data-href~="'+Ni(f.href)+'"]');if(m)return c.instance=m,$n(m),m;var v=h({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(o.ownerDocument||o).createElement("style"),$n(m),Kr(m,"style",v),$p(m,f.precedence,o),c.instance=m;case"stylesheet":v=Mc(f.href);var _=o.querySelector(w0(v));if(_)return c.state.loading|=4,c.instance=_,$n(_),_;m=P5(f),(v=_s.get(v))&&vy(m,v),_=(o.ownerDocument||o).createElement("link"),$n(_);var M=_;return M._p=new Promise(function(D,Y){M.onload=D,M.onerror=Y}),Kr(_,"link",m),c.state.loading|=4,$p(_,f.precedence,o),c.instance=_;case"script":return _=Oc(f.src),(v=o.querySelector(k0(_)))?(c.instance=v,$n(v),v):(m=f,(v=_s.get(_))&&(m=h({},f),yy(m,v)),o=o.ownerDocument||o,v=o.createElement("script"),$n(v),Kr(v,"link",m),o.head.appendChild(v),c.instance=v);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(m=c.instance,c.state.loading|=4,$p(m,f.precedence,o));return c.instance}function $p(o,c,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=m.length?m[m.length-1]:null,_=v,M=0;M<m.length;M++){var D=m[M];if(D.dataset.precedence===c)_=D;else if(_!==v)break}_?_.parentNode.insertBefore(o,_.nextSibling):(c=f.nodeType===9?f.head:f,c.insertBefore(o,c.firstChild))}function vy(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.title==null&&(o.title=c.title)}function yy(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.integrity==null&&(o.integrity=c.integrity)}var qp=null;function z5(o,c,f){if(qp===null){var m=new Map,v=qp=new Map;v.set(f,m)}else v=qp,m=v.get(f),m||(m=new Map,v.set(f,m));if(m.has(o))return m;for(m.set(o,null),f=f.getElementsByTagName(o),v=0;v<f.length;v++){var _=f[v];if(!(_[jl]||_[He]||o==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var M=_.getAttribute(c)||"";M=o+M;var D=m.get(M);D?D.push(_):m.set(M,[_])}}return m}function F5(o,c,f){o=o.ownerDocument||o,o.head.insertBefore(f,c==="title"?o.querySelector("head > title"):null)}function QP(o,c,f){if(f===1||c.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return o=c.disabled,typeof c.precedence=="string"&&o==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function U5(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}var C0=null;function ZP(){}function JP(o,c,f){if(C0===null)throw Error(r(475));var m=C0;if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=Mc(f.href),_=o.querySelector(w0(v));if(_){o=_._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(m.count++,m=Vp.bind(m),o.then(m,m)),c.state.loading|=4,c.instance=_,$n(_);return}_=o.ownerDocument||o,f=P5(f),(v=_s.get(v))&&vy(f,v),_=_.createElement("link"),$n(_);var M=_;M._p=new Promise(function(D,Y){M.onload=D,M.onerror=Y}),Kr(_,"link",f),c.instance=_}m.stylesheets===null&&(m.stylesheets=new Map),m.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(m.count++,c=Vp.bind(m),o.addEventListener("load",c),o.addEventListener("error",c))}}function eB(){if(C0===null)throw Error(r(475));var o=C0;return o.stylesheets&&o.count===0&&Ey(o,o.stylesheets),0<o.count?function(c){var f=setTimeout(function(){if(o.stylesheets&&Ey(o,o.stylesheets),o.unsuspend){var m=o.unsuspend;o.unsuspend=null,m()}},6e4);return o.unsuspend=c,function(){o.unsuspend=null,clearTimeout(f)}}:null}function Vp(){if(this.count--,this.count===0){if(this.stylesheets)Ey(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Gp=null;function Ey(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Gp=new Map,c.forEach(tB,o),Gp=null,Vp.call(o))}function tB(o,c){if(!(c.state.loading&4)){var f=Gp.get(o);if(f)var m=f.get(null);else{f=new Map,Gp.set(o,f);for(var v=o.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<v.length;_++){var M=v[_];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(f.set(M.dataset.precedence,M),m=M)}m&&f.set(null,m)}v=c.instance,M=v.getAttribute("data-precedence"),_=f.get(M)||m,_===m&&f.set(null,v),f.set(M,v),this.count++,m=Vp.bind(this),v.addEventListener("load",m),v.addEventListener("error",m),_?_.parentNode.insertBefore(v,_.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(v,o.firstChild)),c.state.loading|=4}}var A0={$$typeof:R,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function nB(o,c,f,m,v,_,M,D){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ze(0),this.hiddenUpdates=ze(null),this.identifierPrefix=m,this.onUncaughtError=v,this.onCaughtError=_,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function H5(o,c,f,m,v,_,M,D,Y,ue,_e,Se){return o=new nB(o,c,f,M,D,Y,ue,Se),c=1,_===!0&&(c|=24),_=Wi(3,null,null,c),o.current=_,_.stateNode=o,c=tv(),c.refCount++,o.pooledCache=c,c.refCount++,_.memoizedState={element:m,isDehydrated:f,cache:c},sv(_),o}function j5(o){return o?(o=lc,o):lc}function $5(o,c,f,m,v,_){v=j5(v),m.context===null?m.context=v:m.pendingContext=v,m=Io(c),m.payload={element:f},_=_===void 0?null:_,_!==null&&(m.callback=_),f=Lo(o,m,c),f!==null&&(Ji(f,o,c),i0(f,o,c))}function q5(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<c?f:c}}function _y(o,c){q5(o,c),(o=o.alternate)&&q5(o,c)}function V5(o){if(o.tag===13){var c=oc(o,67108864);c!==null&&Ji(c,o,67108864),_y(o,67108864)}}var Yp=!0;function rB(o,c,f,m){var v=J.T;J.T=null;var _=ne.p;try{ne.p=2,xy(o,c,f,m)}finally{ne.p=_,J.T=v}}function iB(o,c,f,m){var v=J.T;J.T=null;var _=ne.p;try{ne.p=8,xy(o,c,f,m)}finally{ne.p=_,J.T=v}}function xy(o,c,f,m){if(Yp){var v=Ty(m);if(v===null)uy(o,c,m,Wp,f),Y5(o,m);else if(aB(v,o,c,f,m))m.stopPropagation();else if(Y5(o,m),c&4&&-1<sB.indexOf(o)){for(;v!==null;){var _=Ao(v);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var M=sr(_.pendingLanes);if(M!==0){var D=_;for(D.pendingLanes|=2,D.entangledLanes|=2;M;){var Y=1<<31-st(M);D.entanglements[1]|=Y,M&=~Y}aa(_),(on&6)===0&&(Op=kt()+500,_0(0))}}break;case 13:D=oc(_,2),D!==null&&Ji(D,_,2),Dp(),_y(_,2)}if(_=Ty(m),_===null&&uy(o,c,m,Wp,f),_===v)break;v=_}v!==null&&m.stopPropagation()}else uy(o,c,m,null,f)}}function Ty(o){return o=$e(o),Sy(o)}var Wp=null;function Sy(o){if(Wp=null,o=Co(o),o!==null){var c=s(o);if(c===null)o=null;else{var f=c.tag;if(f===13){if(o=a(c),o!==null)return o;o=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null)}}return Wp=o,null}function G5(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(fn()){case qt:return 2;case hn:return 8;case fr:case ea:return 32;case fs:return 268435456;default:return 32}default:return 32}}var wy=!1,Wo=null,Ko=null,Xo=null,N0=new Map,M0=new Map,Qo=[],sB="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Y5(o,c){switch(o){case"focusin":case"focusout":Wo=null;break;case"dragenter":case"dragleave":Ko=null;break;case"mouseover":case"mouseout":Xo=null;break;case"pointerover":case"pointerout":N0.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":M0.delete(c.pointerId)}}function O0(o,c,f,m,v,_){return o===null||o.nativeEvent!==_?(o={blockedOn:c,domEventName:f,eventSystemFlags:m,nativeEvent:_,targetContainers:[v]},c!==null&&(c=Ao(c),c!==null&&V5(c)),o):(o.eventSystemFlags|=m,c=o.targetContainers,v!==null&&c.indexOf(v)===-1&&c.push(v),o)}function aB(o,c,f,m,v){switch(c){case"focusin":return Wo=O0(Wo,o,c,f,m,v),!0;case"dragenter":return Ko=O0(Ko,o,c,f,m,v),!0;case"mouseover":return Xo=O0(Xo,o,c,f,m,v),!0;case"pointerover":var _=v.pointerId;return N0.set(_,O0(N0.get(_)||null,o,c,f,m,v)),!0;case"gotpointercapture":return _=v.pointerId,M0.set(_,O0(M0.get(_)||null,o,c,f,m,v)),!0}return!1}function W5(o){var c=Co(o.target);if(c!==null){var f=s(c);if(f!==null){if(c=f.tag,c===13){if(c=a(f),c!==null){o.blockedOn=c,jn(o.priority,function(){if(f.tag===13){var m=Zi();m=je(m);var v=oc(f,m);v!==null&&Ji(v,f,m),_y(f,m)}});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Kp(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var f=Ty(o.nativeEvent);if(f===null){f=o.nativeEvent;var m=new f.constructor(f.type,f);Yl=m,f.target.dispatchEvent(m),Yl=null}else return c=Ao(f),c!==null&&V5(c),o.blockedOn=f,!1;c.shift()}return!0}function K5(o,c,f){Kp(o)&&f.delete(c)}function oB(){wy=!1,Wo!==null&&Kp(Wo)&&(Wo=null),Ko!==null&&Kp(Ko)&&(Ko=null),Xo!==null&&Kp(Xo)&&(Xo=null),N0.forEach(K5),M0.forEach(K5)}function Xp(o,c){o.blockedOn===c&&(o.blockedOn=null,wy||(wy=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,oB)))}var Qp=null;function X5(o){Qp!==o&&(Qp=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Qp===o&&(Qp=null);for(var c=0;c<o.length;c+=3){var f=o[c],m=o[c+1],v=o[c+2];if(typeof m!="function"){if(Sy(m||f)===null)continue;break}var _=Ao(f);_!==null&&(o.splice(c,3),c-=3,Sv(_,{pending:!0,data:v,method:f.method,action:m},m,v))}}))}function R0(o){function c(Y){return Xp(Y,o)}Wo!==null&&Xp(Wo,o),Ko!==null&&Xp(Ko,o),Xo!==null&&Xp(Xo,o),N0.forEach(c),M0.forEach(c);for(var f=0;f<Qo.length;f++){var m=Qo[f];m.blockedOn===o&&(m.blockedOn=null)}for(;0<Qo.length&&(f=Qo[0],f.blockedOn===null);)W5(f),f.blockedOn===null&&Qo.shift();if(f=(o.ownerDocument||o).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var v=f[m],_=f[m+1],M=v[nt]||null;if(typeof _=="function")M||X5(f);else if(M){var D=null;if(_&&_.hasAttribute("formAction")){if(v=_,M=_[nt]||null)D=M.formAction;else if(Sy(v)!==null)continue}else D=M.action;typeof D=="function"?f[m+1]=D:(f.splice(m,3),m-=3),X5(f)}}}function ky(o){this._internalRoot=o}Zp.prototype.render=ky.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(r(409));var f=c.current,m=Zi();$5(f,m,o,c,null,null)},Zp.prototype.unmount=ky.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;$5(o.current,2,null,o,null,null),Dp(),c[Rn]=null}};function Zp(o){this._internalRoot=o}Zp.prototype.unstable_scheduleHydration=function(o){if(o){var c=Pn();o={blockedOn:null,target:o,priority:c};for(var f=0;f<Qo.length&&c!==0&&c<Qo[f].priority;f++);Qo.splice(f,0,o),f===0&&W5(o)}};var Q5=e.version;if(Q5!=="19.1.0")throw Error(r(527,Q5,"19.1.0"));ne.findDOMNode=function(o){var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=u(c),o=o!==null?d(o):null,o=o===null?null:o.stateNode,o};var lB={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jp.isDisabled&&Jp.supportsFiber)try{ge=Jp.inject(lB),we=Jp}catch{}}return I0.createRoot=function(o,c){if(!i(o))throw Error(r(299));var f=!1,m="",v=hT,_=pT,M=mT,D=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(v=c.onUncaughtError),c.onCaughtError!==void 0&&(_=c.onCaughtError),c.onRecoverableError!==void 0&&(M=c.onRecoverableError),c.unstable_transitionCallbacks!==void 0&&(D=c.unstable_transitionCallbacks)),c=H5(o,1,!1,null,null,f,m,v,_,M,D,null),o[Rn]=c.current,ly(o),new ky(c)},I0.hydrateRoot=function(o,c,f){if(!i(o))throw Error(r(299));var m=!1,v="",_=hT,M=pT,D=mT,Y=null,ue=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(_=f.onUncaughtError),f.onCaughtError!==void 0&&(M=f.onCaughtError),f.onRecoverableError!==void 0&&(D=f.onRecoverableError),f.unstable_transitionCallbacks!==void 0&&(Y=f.unstable_transitionCallbacks),f.formState!==void 0&&(ue=f.formState)),c=H5(o,1,!0,c,f??null,m,v,_,M,D,Y,ue),c.context=j5(null),f=c.current,m=Zi(),m=je(m),v=Io(m),v.callback=null,Lo(f,v,m),f=m,c.current.lanes=f,pn(c,f),aa(c),o[Rn]=c.current,ly(o),new Zp(c)},I0.version="19.1.0",I0}var oS;function yB(){if(oS)return Ny.exports;oS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Ny.exports=vB(),Ny.exports}var EB=yB();const FC=U.createContext({theme:"system",resolvedTheme:"light",setTheme:()=>{},toggleTheme:()=>{}}),UC=()=>U.useContext(FC),ME="cycls_theme_preference",lS=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",uS=()=>{if(typeof window>"u")return"system";try{return localStorage.getItem(ME)||"system"}catch{return"system"}},cS=(t,e)=>{const n=document.documentElement;n.classList.remove("light","dark"),n.removeAttribute("data-theme"),t==="system"?n.setAttribute("data-resolved-theme",e):(n.classList.add(t),n.setAttribute("data-theme",t),n.setAttribute("data-resolved-theme",t))},Dy=({children:t})=>{const[e,n]=U.useState(()=>uS()),[r,i]=U.useState(()=>{const u=uS();return u==="system"?lS():u});U.useEffect(()=>{const u=window.matchMedia("(prefers-color-scheme: dark)"),d=h=>{if(e==="system"){const p=h.matches?"dark":"light";i(p),cS("system",p)}};return u.addEventListener("change",d),()=>u.removeEventListener("change",d)},[e]),U.useEffect(()=>{const u=e==="system"?lS():e;cS(e,u),requestAnimationFrame(()=>{i(u)})},[e]);const s=U.useCallback(u=>{n(u);try{u==="system"?localStorage.removeItem(ME):localStorage.setItem(ME,u)}catch{}},[]),a=U.useCallback(()=>{s(r==="dark"?"light":"dark")},[r,s]),l={theme:e,resolvedTheme:r,setTheme:s,toggleTheme:a};return C.jsx(FC.Provider,{value:l,children:t})},HC=({className:t=""})=>{const{resolvedTheme:e,toggleTheme:n}=UC(),r=e==="dark";return C.jsx("button",{onClick:n,className:`
        theme-toggle
        inline-flex items-center justify-center
        rounded-xl p-2
        hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]
        focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20
        transition-colors duration-200
        ${t}
      `,"aria-label":r?"Switch to light mode":"Switch to dark mode",title:r?"Light mode":"Dark mode",children:r?C.jsxs("svg",{className:"theme-toggle-icon w-5 h-5 text-[var(--text-primary)]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("circle",{cx:"12",cy:"12",r:"4"}),C.jsx("path",{d:"M12 2v2"}),C.jsx("path",{d:"M12 20v2"}),C.jsx("path",{d:"M4.93 4.93l1.41 1.41"}),C.jsx("path",{d:"M17.66 17.66l1.41 1.41"}),C.jsx("path",{d:"M2 12h2"}),C.jsx("path",{d:"M20 12h2"}),C.jsx("path",{d:"M6.34 17.66l-1.41 1.41"}),C.jsx("path",{d:"M19.07 4.93l-1.41 1.41"})]}):C.jsx("svg",{className:"theme-toggle-icon w-5 h-5 text-[var(--text-primary)]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})})},OE=U.createContext(!1),_B=()=>U.useContext(OE);/**
 * react-router v7.9.6
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var dS="popstate";function xB(t={}){function e(r,i){let{pathname:s,search:a,hash:l}=r.location;return RE("",{pathname:s,search:a,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:qf(i)}return SB(e,n,null,t)}function Un(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Is(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function TB(){return Math.random().toString(36).substring(2,10)}function fS(t,e){return{usr:t.state,key:t.key,idx:e}}function RE(t,e,n=null,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?_d(e):e,state:n,key:e&&e.key||r||TB()}}function qf({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function _d(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function SB(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,l="POP",u=null,d=h();d==null&&(d=0,a.replaceState({...a.state,idx:d},""));function h(){return(a.state||{idx:null}).idx}function p(){l="POP";let T=h(),S=T==null?null:T-d;d=T,u&&u({action:l,location:E.location,delta:S})}function g(T,S){l="PUSH";let A=RE(E.location,T,S);d=h()+1;let R=fS(A,d),z=E.createHref(A);try{a.pushState(R,"",z)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(z)}s&&u&&u({action:l,location:E.location,delta:1})}function b(T,S){l="REPLACE";let A=RE(E.location,T,S);d=h();let R=fS(A,d),z=E.createHref(A);a.replaceState(R,"",z),s&&u&&u({action:l,location:E.location,delta:0})}function y(T){return wB(T)}let E={get action(){return l},get location(){return t(i,a)},listen(T){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(dS,p),u=T,()=>{i.removeEventListener(dS,p),u=null}},createHref(T){return e(i,T)},createURL:y,encodeLocation(T){let S=y(T);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:g,replace:b,go(T){return a.go(T)}};return E}function wB(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Un(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:qf(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function jC(t,e,n="/"){return kB(t,e,n,!1)}function kB(t,e,n,r){let i=typeof e=="string"?_d(e):e,s=go(i.pathname||"/",n);if(s==null)return null;let a=$C(t);CB(a);let l=null;for(let u=0;l==null&&u<a.length;++u){let d=zB(s);l=PB(a[u],d,r)}return l}function $C(t,e=[],n=[],r="",i=!1){let s=(a,l,u=i,d)=>{let h={relativePath:d===void 0?a.path||"":d,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&u)return;Un(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let p=co([r,h.relativePath]),g=n.concat(h);a.children&&a.children.length>0&&(Un(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),$C(a.children,e,g,p,u)),!(a.path==null&&!a.index)&&e.push({path:p,score:IB(p,a.index),routesMeta:g})};return t.forEach((a,l)=>{var u;if(a.path===""||!((u=a.path)!=null&&u.includes("?")))s(a,l);else for(let d of qC(a.path))s(a,l,!0,d)}),e}function qC(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=qC(r.join("/")),l=[];return l.push(...a.map(u=>u===""?s:[s,u].join("/"))),i&&l.push(...a),l.map(u=>t.startsWith("/")&&u===""?"/":u)}function CB(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:LB(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var AB=/^:[\w-]+$/,NB=3,MB=2,OB=1,RB=10,DB=-2,hS=t=>t==="*";function IB(t,e){let n=t.split("/"),r=n.length;return n.some(hS)&&(r+=DB),e&&(r+=MB),n.filter(i=>!hS(i)).reduce((i,s)=>i+(AB.test(s)?NB:s===""?OB:RB),r)}function LB(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function PB(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",a=[];for(let l=0;l<r.length;++l){let u=r[l],d=l===r.length-1,h=s==="/"?e:e.slice(s.length)||"/",p=hg({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},h),g=u.route;if(!p&&d&&n&&!r[r.length-1].route.index&&(p=hg({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!p)return null;Object.assign(i,p.params),a.push({params:i,pathname:co([s,p.pathname]),pathnameBase:$B(co([s,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(s=co([s,p.pathnameBase]))}return a}function hg(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=BB(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((d,{paramName:h,isOptional:p},g)=>{if(h==="*"){let y=l[g]||"";a=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const b=l[g];return p&&!b?d[h]=void 0:d[h]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:a,pattern:t}}function BB(t,e=!1,n=!0){Is(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function zB(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Is(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function go(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}var FB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,UB=t=>FB.test(t);function HB(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?_d(t):t,s;if(n)if(UB(n))s=n;else{if(n.includes("//")){let a=n;n=n.replace(/\/\/+/g,"/"),Is(!1,`Pathnames cannot have embedded double slashes - normalizing ${a} -> ${n}`)}n.startsWith("/")?s=pS(n.substring(1),"/"):s=pS(n,e)}else s=e;return{pathname:s,search:qB(r),hash:VB(i)}}function pS(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Iy(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function jB(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function w3(t){let e=jB(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function k3(t,e,n,r=!1){let i;typeof t=="string"?i=_d(t):(i={...t},Un(!i.pathname||!i.pathname.includes("?"),Iy("?","pathname","search",i)),Un(!i.pathname||!i.pathname.includes("#"),Iy("#","pathname","hash",i)),Un(!i.search||!i.search.includes("#"),Iy("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,l;if(a==null)l=n;else{let p=e.length-1;if(!r&&a.startsWith("..")){let g=a.split("/");for(;g[0]==="..";)g.shift(),p-=1;i.pathname=g.join("/")}l=p>=0?e[p]:"/"}let u=HB(i,l),d=a&&a!=="/"&&a.endsWith("/"),h=(s||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||h)&&(u.pathname+="/"),u}var co=t=>t.join("/").replace(/\/\/+/g,"/"),$B=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),qB=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,VB=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function GB(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var VC=["POST","PUT","PATCH","DELETE"];new Set(VC);var YB=["GET",...VC];new Set(YB);var xd=U.createContext(null);xd.displayName="DataRouter";var B1=U.createContext(null);B1.displayName="DataRouterState";U.createContext(!1);var GC=U.createContext({isTransitioning:!1});GC.displayName="ViewTransition";var WB=U.createContext(new Map);WB.displayName="Fetchers";var KB=U.createContext(null);KB.displayName="Await";var Zs=U.createContext(null);Zs.displayName="Navigation";var bh=U.createContext(null);bh.displayName="Location";var Sa=U.createContext({outlet:null,matches:[],isDataRoute:!1});Sa.displayName="Route";var C3=U.createContext(null);C3.displayName="RouteError";function XB(t,{relative:e}={}){Un(Td(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=U.useContext(Zs),{hash:i,pathname:s,search:a}=vh(t,{relative:e}),l=s;return n!=="/"&&(l=s==="/"?n:co([n,s])),r.createHref({pathname:l,search:a,hash:i})}function Td(){return U.useContext(bh)!=null}function _o(){return Un(Td(),"useLocation() may be used only in the context of a <Router> component."),U.useContext(bh).location}var YC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function WC(t){U.useContext(Zs).static||U.useLayoutEffect(t)}function KC(){let{isDataRoute:t}=U.useContext(Sa);return t?uz():QB()}function QB(){Un(Td(),"useNavigate() may be used only in the context of a <Router> component.");let t=U.useContext(xd),{basename:e,navigator:n}=U.useContext(Zs),{matches:r}=U.useContext(Sa),{pathname:i}=_o(),s=JSON.stringify(w3(r)),a=U.useRef(!1);return WC(()=>{a.current=!0}),U.useCallback((u,d={})=>{if(Is(a.current,YC),!a.current)return;if(typeof u=="number"){n.go(u);return}let h=k3(u,JSON.parse(s),i,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:co([e,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[e,n,s,i,t])}U.createContext(null);function vh(t,{relative:e}={}){let{matches:n}=U.useContext(Sa),{pathname:r}=_o(),i=JSON.stringify(w3(n));return U.useMemo(()=>k3(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function ZB(t,e){return XC(t,e)}function XC(t,e,n,r,i){var A;Un(Td(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=U.useContext(Zs),{matches:a}=U.useContext(Sa),l=a[a.length-1],u=l?l.params:{},d=l?l.pathname:"/",h=l?l.pathnameBase:"/",p=l&&l.route;{let R=p&&p.path||"";QC(d,!p||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let g=_o(),b;if(e){let R=typeof e=="string"?_d(e):e;Un(h==="/"||((A=R.pathname)==null?void 0:A.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${R.pathname}" was given in the \`location\` prop.`),b=R}else b=g;let y=b.pathname||"/",E=y;if(h!=="/"){let R=h.replace(/^\//,"").split("/");E="/"+y.replace(/^\//,"").split("/").slice(R.length).join("/")}let T=jC(t,{pathname:E});Is(p||T!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Is(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=rz(T&&T.map(R=>Object.assign({},R,{params:Object.assign({},u,R.params),pathname:co([h,s.encodeLocation?s.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?h:co([h,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),a,n,r,i);return e&&S?U.createElement(bh.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},S):S}function JB(){let t=lz(),e=GB(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",t),a=U.createElement(U.Fragment,null,U.createElement("p",null,"💿 Hey developer 👋"),U.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",U.createElement("code",{style:s},"ErrorBoundary")," or"," ",U.createElement("code",{style:s},"errorElement")," prop on your route.")),U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},e),n?U.createElement("pre",{style:i},n):null,a)}var ez=U.createElement(JB,null),tz=class extends U.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){return this.state.error!==void 0?U.createElement(Sa.Provider,{value:this.props.routeContext},U.createElement(C3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function nz({routeContext:t,match:e,children:n}){let r=U.useContext(xd);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),U.createElement(Sa.Provider,{value:t},n)}function rz(t,e=[],n=null,r=null,i=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,a=n==null?void 0:n.errors;if(a!=null){let h=s.findIndex(p=>p.route.id&&(a==null?void 0:a[p.route.id])!==void 0);Un(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),s=s.slice(0,Math.min(s.length,h+1))}let l=!1,u=-1;if(n)for(let h=0;h<s.length;h++){let p=s[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=h),p.route.id){let{loaderData:g,errors:b}=n,y=p.route.loader&&!g.hasOwnProperty(p.route.id)&&(!b||b[p.route.id]===void 0);if(p.route.lazy||y){l=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}let d=n&&r?(h,p)=>{var g,b;r(h,{location:n.location,params:((b=(g=n.matches)==null?void 0:g[0])==null?void 0:b.params)??{},errorInfo:p})}:void 0;return s.reduceRight((h,p,g)=>{let b,y=!1,E=null,T=null;n&&(b=a&&p.route.id?a[p.route.id]:void 0,E=p.route.errorElement||ez,l&&(u<0&&g===0?(QC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,T=null):u===g&&(y=!0,T=p.route.hydrateFallbackElement||null)));let S=e.concat(s.slice(0,g+1)),A=()=>{let R;return b?R=E:y?R=T:p.route.Component?R=U.createElement(p.route.Component,null):p.route.element?R=p.route.element:R=h,U.createElement(nz,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:R})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?U.createElement(tz,{location:n.location,revalidation:n.revalidation,component:E,error:b,children:A(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):A()},null)}function A3(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function iz(t){let e=U.useContext(xd);return Un(e,A3(t)),e}function sz(t){let e=U.useContext(B1);return Un(e,A3(t)),e}function az(t){let e=U.useContext(Sa);return Un(e,A3(t)),e}function N3(t){let e=az(t),n=e.matches[e.matches.length-1];return Un(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function oz(){return N3("useRouteId")}function lz(){var r;let t=U.useContext(C3),e=sz("useRouteError"),n=N3("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function uz(){let{router:t}=iz("useNavigate"),e=N3("useNavigate"),n=U.useRef(!1);return WC(()=>{n.current=!0}),U.useCallback(async(i,s={})=>{Is(n.current,YC),n.current&&(typeof i=="number"?t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var mS={};function QC(t,e,n){!e&&!mS[t]&&(mS[t]=!0,Is(!1,n))}U.memo(cz);function cz({routes:t,future:e,state:n,unstable_onError:r}){return XC(t,void 0,n,r,e)}function ZC({to:t,replace:e,state:n,relative:r}){Un(Td(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=U.useContext(Zs);Is(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=U.useContext(Sa),{pathname:a}=_o(),l=KC(),u=k3(t,w3(s),a,r==="path"),d=JSON.stringify(u);return U.useEffect(()=>{l(JSON.parse(d),{replace:e,state:n,relative:r})},[l,d,r,e,n]),null}function Gm(t){Un(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function dz({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){Un(!Td(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=t.replace(/^\/*/,"/"),l=U.useMemo(()=>({basename:a,navigator:i,static:s,future:{}}),[a,i,s]);typeof n=="string"&&(n=_d(n));let{pathname:u="/",search:d="",hash:h="",state:p=null,key:g="default"}=n,b=U.useMemo(()=>{let y=go(u,a);return y==null?null:{location:{pathname:y,search:d,hash:h,state:p,key:g},navigationType:r}},[a,u,d,h,p,g,r]);return Is(b!=null,`<Router basename="${a}"> is not able to match the URL "${u}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:U.createElement(Zs.Provider,{value:l},U.createElement(bh.Provider,{children:e,value:b}))}function fz({children:t,location:e}){return ZB(DE(t),e)}function DE(t,e=[]){let n=[];return U.Children.forEach(t,(r,i)=>{if(!U.isValidElement(r))return;let s=[...e,i];if(r.type===U.Fragment){n.push.apply(n,DE(r.props.children,s));return}Un(r.type===Gm,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Un(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=DE(r.props.children,s)),n.push(a)}),n}var Ym="get",Wm="application/x-www-form-urlencoded";function z1(t){return t!=null&&typeof t.tagName=="string"}function hz(t){return z1(t)&&t.tagName.toLowerCase()==="button"}function pz(t){return z1(t)&&t.tagName.toLowerCase()==="form"}function mz(t){return z1(t)&&t.tagName.toLowerCase()==="input"}function gz(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function bz(t,e){return t.button===0&&(!e||e==="_self")&&!gz(t)}var em=null;function vz(){if(em===null)try{new FormData(document.createElement("form"),0),em=!1}catch{em=!0}return em}var yz=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ly(t){return t!=null&&!yz.has(t)?(Is(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Wm}"`),null):t}function Ez(t,e){let n,r,i,s,a;if(pz(t)){let l=t.getAttribute("action");r=l?go(l,e):null,n=t.getAttribute("method")||Ym,i=Ly(t.getAttribute("enctype"))||Wm,s=new FormData(t)}else if(hz(t)||mz(t)&&(t.type==="submit"||t.type==="image")){let l=t.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||l.getAttribute("action");if(r=u?go(u,e):null,n=t.getAttribute("formmethod")||l.getAttribute("method")||Ym,i=Ly(t.getAttribute("formenctype"))||Ly(l.getAttribute("enctype"))||Wm,s=new FormData(l,t),!vz()){let{name:d,type:h,value:p}=t;if(h==="image"){let g=d?`${d}.`:"";s.append(`${g}x`,"0"),s.append(`${g}y`,"0")}else d&&s.append(d,p)}}else{if(z1(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ym,r=null,i=Wm,a=t}return s&&i==="text/plain"&&(a=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function M3(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function _z(t,e,n){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r.pathname==="/"?r.pathname=`_root.${n}`:e&&go(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function xz(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Tz(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function Sz(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let a=await xz(s,n);return a.links?a.links():[]}return[]}));return Az(r.flat(1).filter(Tz).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function gS(t,e,n,r,i,s){let a=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,l=(u,d)=>{var h;return n[d].pathname!==u.pathname||((h=n[d].route.path)==null?void 0:h.endsWith("*"))&&n[d].params["*"]!==u.params["*"]};return s==="assets"?e.filter((u,d)=>a(u,d)||l(u,d)):s==="data"?e.filter((u,d)=>{var p;let h=r.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(a(u,d)||l(u,d))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function wz(t,e,{includeHydrateFallback:n}={}){return kz(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function kz(t){return[...new Set(t)]}function Cz(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function Az(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(Cz(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function JC(){let t=U.useContext(xd);return M3(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Nz(){let t=U.useContext(B1);return M3(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var O3=U.createContext(void 0);O3.displayName="FrameworkContext";function eA(){let t=U.useContext(O3);return M3(t,"You must render this element inside a <HydratedRouter> element"),t}function Mz(t,e){let n=U.useContext(O3),[r,i]=U.useState(!1),[s,a]=U.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:d,onMouseLeave:h,onTouchStart:p}=e,g=U.useRef(null);U.useEffect(()=>{if(t==="render"&&a(!0),t==="viewport"){let E=S=>{S.forEach(A=>{a(A.isIntersecting)})},T=new IntersectionObserver(E,{threshold:.5});return g.current&&T.observe(g.current),()=>{T.disconnect()}}},[t]),U.useEffect(()=>{if(r){let E=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(E)}}},[r]);let b=()=>{i(!0)},y=()=>{i(!1),a(!1)};return n?t!=="intent"?[s,g,{}]:[s,g,{onFocus:L0(l,b),onBlur:L0(u,y),onMouseEnter:L0(d,b),onMouseLeave:L0(h,y),onTouchStart:L0(p,b)}]:[!1,g,{}]}function L0(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function Oz({page:t,...e}){let{router:n}=JC(),r=U.useMemo(()=>jC(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?U.createElement(Dz,{page:t,matches:r,...e}):null}function Rz(t){let{manifest:e,routeModules:n}=eA(),[r,i]=U.useState([]);return U.useEffect(()=>{let s=!1;return Sz(t,e,n).then(a=>{s||i(a)}),()=>{s=!0}},[t,e,n]),r}function Dz({page:t,matches:e,...n}){let r=_o(),{manifest:i,routeModules:s}=eA(),{basename:a}=JC(),{loaderData:l,matches:u}=Nz(),d=U.useMemo(()=>gS(t,e,u,i,r,"data"),[t,e,u,i,r]),h=U.useMemo(()=>gS(t,e,u,i,r,"assets"),[t,e,u,i,r]),p=U.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let y=new Set,E=!1;if(e.forEach(S=>{var R;let A=i.routes[S.route.id];!A||!A.hasLoader||(!d.some(z=>z.route.id===S.route.id)&&S.route.id in l&&((R=s[S.route.id])!=null&&R.shouldRevalidate)||A.hasClientLoader?E=!0:y.add(S.route.id))}),y.size===0)return[];let T=_z(t,a,"data");return E&&y.size>0&&T.searchParams.set("_routes",e.filter(S=>y.has(S.route.id)).map(S=>S.route.id).join(",")),[T.pathname+T.search]},[a,l,r,i,d,e,t,s]),g=U.useMemo(()=>wz(h,i),[h,i]),b=Rz(h);return U.createElement(U.Fragment,null,p.map(y=>U.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),g.map(y=>U.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),b.map(({key:y,link:E})=>U.createElement("link",{key:y,nonce:n.nonce,...E})))}function Iz(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var tA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{tA&&(window.__reactRouterVersion="7.9.6")}catch{}function Lz({basename:t,children:e,window:n}){let r=U.useRef();r.current==null&&(r.current=xB({window:n,v5Compat:!0}));let i=r.current,[s,a]=U.useState({action:i.action,location:i.location}),l=U.useCallback(u=>{U.startTransition(()=>a(u))},[a]);return U.useLayoutEffect(()=>i.listen(l),[i,l]),U.createElement(dz,{basename:t,children:e,location:s.location,navigationType:s.action,navigator:i})}var nA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rA=U.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:a,state:l,target:u,to:d,preventScrollReset:h,viewTransition:p,...g},b){let{basename:y}=U.useContext(Zs),E=typeof d=="string"&&nA.test(d),T,S=!1;if(typeof d=="string"&&E&&(T=d,tA))try{let Z=new URL(window.location.href),W=d.startsWith("//")?new URL(Z.protocol+d):new URL(d),re=go(W.pathname,y);W.origin===Z.origin&&re!=null?d=re+W.search+W.hash:S=!0}catch{Is(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let A=XB(d,{relative:i}),[R,z,I]=Mz(r,g),P=Fz(d,{replace:a,state:l,target:u,preventScrollReset:h,relative:i,viewTransition:p});function $(Z){e&&e(Z),Z.defaultPrevented||P(Z)}let K=U.createElement("a",{...g,...I,href:T||A,onClick:S||s?e:$,ref:Iz(b,z),target:u,"data-discover":!E&&n==="render"?"true":void 0});return R&&!E?U.createElement(U.Fragment,null,K,U.createElement(Oz,{page:A})):K});rA.displayName="Link";var Pz=U.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:a,viewTransition:l,children:u,...d},h){let p=vh(a,{relative:d.relative}),g=_o(),b=U.useContext(B1),{navigator:y,basename:E}=U.useContext(Zs),T=b!=null&&qz(p)&&l===!0,S=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,A=g.pathname,R=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(A=A.toLowerCase(),R=R?R.toLowerCase():null,S=S.toLowerCase()),R&&E&&(R=go(R,E)||R);const z=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let I=A===S||!i&&A.startsWith(S)&&A.charAt(z)==="/",P=R!=null&&(R===S||!i&&R.startsWith(S)&&R.charAt(S.length)==="/"),$={isActive:I,isPending:P,isTransitioning:T},K=I?e:void 0,Z;typeof r=="function"?Z=r($):Z=[r,I?"active":null,P?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let W=typeof s=="function"?s($):s;return U.createElement(rA,{...d,"aria-current":K,className:Z,ref:h,style:W,to:a,viewTransition:l},typeof u=="function"?u($):u)});Pz.displayName="NavLink";var Bz=U.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:a=Ym,action:l,onSubmit:u,relative:d,preventScrollReset:h,viewTransition:p,...g},b)=>{let y=jz(),E=$z(l,{relative:d}),T=a.toLowerCase()==="get"?"get":"post",S=typeof l=="string"&&nA.test(l),A=R=>{if(u&&u(R),R.defaultPrevented)return;R.preventDefault();let z=R.nativeEvent.submitter,I=(z==null?void 0:z.getAttribute("formmethod"))||a;y(z||R.currentTarget,{fetcherKey:e,method:I,navigate:n,replace:i,state:s,relative:d,preventScrollReset:h,viewTransition:p})};return U.createElement("form",{ref:b,method:T,action:E,onSubmit:r?u:A,...g,"data-discover":!S&&t==="render"?"true":void 0})});Bz.displayName="Form";function zz(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function iA(t){let e=U.useContext(xd);return Un(e,zz(t)),e}function Fz(t,{target:e,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:a}={}){let l=KC(),u=_o(),d=vh(t,{relative:s});return U.useCallback(h=>{if(bz(h,e)){h.preventDefault();let p=n!==void 0?n:qf(u)===qf(d);l(t,{replace:p,state:r,preventScrollReset:i,relative:s,viewTransition:a})}},[u,l,d,n,r,e,t,i,s,a])}var Uz=0,Hz=()=>`__${String(++Uz)}__`;function jz(){let{router:t}=iA("useSubmit"),{basename:e}=U.useContext(Zs),n=oz();return U.useCallback(async(r,i={})=>{let{action:s,method:a,encType:l,formData:u,body:d}=Ez(r,e);if(i.navigate===!1){let h=i.fetcherKey||Hz();await t.fetch(h,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:u,body:d,formMethod:i.method||a,formEncType:i.encType||l,flushSync:i.flushSync})}else await t.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:u,body:d,formMethod:i.method||a,formEncType:i.encType||l,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[t,e,n])}function $z(t,{relative:e}={}){let{basename:n}=U.useContext(Zs),r=U.useContext(Sa);Un(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...vh(t||".",{relative:e})},a=_o();if(t==null){s.search=a.search;let l=new URLSearchParams(s.search),u=l.getAll("index");if(u.some(h=>h==="")){l.delete("index"),u.filter(p=>p).forEach(p=>l.append("index",p));let h=l.toString();s.search=h?`?${h}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:co([n,s.pathname])),qf(s)}function qz(t,{relative:e}={}){let n=U.useContext(GC);Un(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=iA("useViewTransitionState"),i=vh(t,{relative:e});if(!n.isTransitioning)return!1;let s=go(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=go(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hg(i.pathname,a)!=null||hg(i.pathname,s)!=null}var ku,Vz=(ku=class extends Error{constructor(n){super(new.target.formatMessage(new.target.kind,n.message,n.code,n.docsUrl),{cause:n.cause});Wa(this,"clerkError",!0);Wa(this,"code");Wa(this,"longMessage");Wa(this,"docsUrl");Wa(this,"cause");Object.setPrototypeOf(this,ku.prototype),this.code=n.code,this.docsUrl=n.docsUrl,this.longMessage=n.longMessage,this.cause=n.cause}get name(){return this.constructor.name}toString(){return`[${this.name}]
Message:${this.message}`}static formatMessage(n,r,i,s){const a="Clerk:",l=new RegExp(a.replace(" ","\\s*"),"i");return r=r.replace(l,""),r=`${a} ${r.trim()}

(code="${i}")

`,s&&(r+=`

Docs: ${s}`),r}},Wa(ku,"kind","ClerkError"),ku);const Gz=Object.freeze({InvalidProxyUrlErrorMessage:"The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})",InvalidPublishableKeyErrorMessage:"The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.com/last-active?path=api-keys. (key={{key}})",MissingPublishableKeyErrorMessage:"Missing publishableKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.",MissingSecretKeyErrorMessage:"Missing secretKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.",MissingClerkProvider:"{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider"});function sA({packageName:t,customMessages:e}){let n=t;function r(s,a){if(!a)return`${n}: ${s}`;let l=s;const u=s.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);for(const d of u){const h=(a[d[1]]||"").toString();l=l.replace(`{{${d[1]}}}`,h)}return`${n}: ${l}`}const i={...Gz,...e};return{setPackageName({packageName:s}){return typeof s=="string"&&(n=s),this},setMessages({customMessages:s}){return Object.assign(i,s||{}),this},throwInvalidPublishableKeyError(s){throw new Error(r(i.InvalidPublishableKeyErrorMessage,s))},throwInvalidProxyUrl(s){throw new Error(r(i.InvalidProxyUrlErrorMessage,s))},throwMissingPublishableKeyError(){throw new Error(r(i.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw new Error(r(i.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(s){throw new Error(r(i.MissingClerkProvider,s))},throw(s){throw new Error(r(s))}}}var Cu,IE=(Cu=class extends Vz{constructor(n,r){super({...r,message:n});Wa(this,"clerkRuntimeError",!0);Object.setPrototypeOf(this,Cu.prototype)}},Wa(Cu,"kind","ClerkRuntimeError"),Cu);const Yz={strict_mfa:{afterMinutes:10,level:"multi_factor"},strict:{afterMinutes:10,level:"second_factor"},moderate:{afterMinutes:60,level:"second_factor"},lax:{afterMinutes:1440,level:"second_factor"}},Wz=new Set(["first_factor","second_factor","multi_factor"]),Kz=new Set(["strict_mfa","strict","moderate","lax"]),Xz=t=>typeof t=="number"&&t>0,Qz=t=>Wz.has(t),Zz=t=>Kz.has(t),Py=t=>t.replace(/^(org:)*/,"org:"),Jz=(t,e)=>{const{orgId:n,orgRole:r,orgPermissions:i}=e;return!t.role&&!t.permission||!n||!r||!i?null:t.permission?i.includes(Py(t.permission)):t.role?Py(r)===Py(t.role):null},bS=(t,e)=>{const{org:n,user:r}=tF(t),[i,s]=e.split(":"),a=s||i;return i==="org"?n.includes(a):i==="user"?r.includes(a):[...n,...r].includes(a)},eF=(t,e)=>{const{features:n,plans:r}=e;return t.feature&&n?bS(n,t.feature):t.plan&&r?bS(r,t.plan):null},tF=t=>{const e=t?t.split(",").map(n=>n.trim()):[];return{org:e.filter(n=>n.split(":")[0].includes("o")).map(n=>n.split(":")[1]),user:e.filter(n=>n.split(":")[0].includes("u")).map(n=>n.split(":")[1])}},nF=t=>{if(!t)return!1;const e=i=>typeof i=="string"?Yz[i]:i,n=typeof t=="string"&&Zz(t),r=typeof t=="object"&&Qz(t.level)&&Xz(t.afterMinutes);return n||r?e.bind(null,t):!1},rF=(t,{factorVerificationAge:e})=>{if(!t.reverification||!e)return null;const n=nF(t.reverification);if(!n)return null;const{level:r,afterMinutes:i}=n(),[s,a]=e,l=s!==-1?i>s:null,u=a!==-1?i>a:null;switch(r){case"first_factor":return l;case"second_factor":return a!==-1?u:l;case"multi_factor":return a===-1?l:l&&u}},iF=t=>e=>{if(!t.userId)return!1;const n=eF(e,t),r=Jz(e,t),i=rF(e,t);return[n||r,i].some(s=>s===null)?[n||r,i].some(s=>s===!0):[n||r,i].every(s=>s===!0)},sF=({authObject:{sessionId:t,sessionStatus:e,userId:n,actor:r,orgId:i,orgRole:s,orgSlug:a,signOut:l,getToken:u,has:d,sessionClaims:h},options:{treatPendingAsSignedOut:p=!0}})=>{if(t===void 0&&n===void 0)return{isLoaded:!1,isSignedIn:void 0,sessionId:t,sessionClaims:void 0,userId:n,actor:void 0,orgId:void 0,orgRole:void 0,orgSlug:void 0,has:void 0,signOut:l,getToken:u};if(t===null&&n===null)return{isLoaded:!0,isSignedIn:!1,sessionId:t,userId:n,sessionClaims:null,actor:null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:l,getToken:u};if(p&&e==="pending")return{isLoaded:!0,isSignedIn:!1,sessionId:null,userId:null,sessionClaims:null,actor:null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:l,getToken:u};if(t&&h&&n&&i&&s)return{isLoaded:!0,isSignedIn:!0,sessionId:t,sessionClaims:h,userId:n,actor:r||null,orgId:i,orgRole:s,orgSlug:a||null,has:d,signOut:l,getToken:u};if(t&&h&&n&&!i)return{isLoaded:!0,isSignedIn:!0,sessionId:t,sessionClaims:h,userId:n,actor:r||null,orgId:null,orgRole:null,orgSlug:null,has:d,signOut:l,getToken:u}},aF=[".lcl.dev",".stg.dev",".lclstage.dev",".stgstage.dev",".dev.lclclerk.com",".stg.lclclerk.com",".accounts.lclclerk.com","accountsstage.dev","accounts.dev"],aA=t=>typeof atob<"u"&&typeof atob=="function"?atob(t):typeof global<"u"&&global.Buffer?new global.Buffer(t,"base64").toString():t,oA="pk_live_",oF="pk_test_";function lA(t){if(!t.endsWith("$"))return!1;const e=t.slice(0,-1);return e.includes("$")?!1:e.includes(".")}function vS(t,e={}){if(t=t||"",!t||!LE(t)){if(e.fatal&&!t)throw new Error("Publishable key is missing. Ensure that your publishable key is correctly configured. Double-check your environment configuration for your keys, or access them here: https://dashboard.clerk.com/last-active?path=api-keys");if(e.fatal&&!LE(t))throw new Error("Publishable key not valid.");return null}const n=t.startsWith(oA)?"production":"development";let r;try{r=aA(t.split("_")[2])}catch{if(e.fatal)throw new Error("Publishable key not valid: Failed to decode key.");return null}if(!lA(r)){if(e.fatal)throw new Error("Publishable key not valid: Decoded key has invalid format.");return null}let i=r.slice(0,-1);return e.proxyUrl?i=e.proxyUrl:n!=="development"&&e.domain&&e.isSatellite&&(i=`clerk.${e.domain}`),{instanceType:n,frontendApi:i}}function LE(t=""){try{if(!(t.startsWith(oA)||t.startsWith(oF)))return!1;const e=t.split("_");if(e.length!==3)return!1;const n=e[2];return n?lA(aA(n)):!1}catch{return!1}}function lF(){const t=new Map;return{isDevOrStagingUrl:e=>{if(!e)return!1;const n=typeof e=="string"?e:e.hostname;let r=t.get(n);return r===void 0&&(r=aF.some(i=>n.endsWith(i)),t.set(n,r)),r}}}const uF="METHOD_CALLED",cF=.1;function R3(t,e){return{event:uF,eventSamplingRate:cF,payload:{method:t,...e}}}var By={exports:{}},zy={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var yS;function dF(){if(yS)return zy;yS=1;var t=gh();function e(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue;function l(p,g){var b=g(),y=r({inst:{value:b,getSnapshot:g}}),E=y[0].inst,T=y[1];return s(function(){E.value=b,E.getSnapshot=g,u(E)&&T({inst:E})},[p,b,g]),i(function(){return u(E)&&T({inst:E}),p(function(){u(E)&&T({inst:E})})},[p]),a(b),b}function u(p){var g=p.getSnapshot;p=p.value;try{var b=g();return!n(p,b)}catch{return!0}}function d(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return zy.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,zy}var ES;function uA(){return ES||(ES=1,By.exports=dF()),By.exports}var D3=uA();const cA=0,dA=1,fA=2,_S=3;var xS=Object.prototype.hasOwnProperty;function PE(t,e){var n,r;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&PE(t[r],e[r]););return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(xS.call(t,n)&&++r&&!xS.call(e,n)||!(n in e)||!PE(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}const so=new WeakMap,bl=()=>{},ui=bl(),pg=Object,Kt=t=>t===ui,Gs=t=>typeof t=="function",bo=(t,e)=>({...t,...e}),hA=t=>Gs(t.then),Fy={},tm={},I3="undefined",yh=typeof window!=I3,BE=typeof document!=I3,fF=yh&&"Deno"in window,hF=()=>yh&&typeof window.requestAnimationFrame!=I3,pA=(t,e)=>{const n=so.get(t);return[()=>!Kt(e)&&t.get(e)||Fy,r=>{if(!Kt(e)){const i=t.get(e);e in tm||(tm[e]=i),n[5](e,bo(i,r),i||Fy)}},n[6],()=>!Kt(e)&&e in tm?tm[e]:!Kt(e)&&t.get(e)||Fy]};let zE=!0;const pF=()=>zE,[FE,UE]=yh&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[bl,bl],mF=()=>{const t=BE&&document.visibilityState;return Kt(t)||t!=="hidden"},gF=t=>(BE&&document.addEventListener("visibilitychange",t),FE("focus",t),()=>{BE&&document.removeEventListener("visibilitychange",t),UE("focus",t)}),bF=t=>{const e=()=>{zE=!0,t()},n=()=>{zE=!1};return FE("online",e),FE("offline",n),()=>{UE("online",e),UE("offline",n)}},vF={isOnline:pF,isVisible:mF},yF={initFocus:gF,initReconnect:bF},TS=!le.useId,Vf=!yh||fF,EF=t=>hF()?window.requestAnimationFrame(t):setTimeout(t,1),Km=Vf?U.useEffect:U.useLayoutEffect,Uy=typeof navigator<"u"&&navigator.connection,SS=!Vf&&Uy&&(["slow-2g","2g"].includes(Uy.effectiveType)||Uy.saveData),nm=new WeakMap,_F=t=>pg.prototype.toString.call(t),Hy=(t,e)=>t===`[object ${e}]`;let xF=0;const HE=t=>{const e=typeof t,n=_F(t),r=Hy(n,"Date"),i=Hy(n,"RegExp"),s=Hy(n,"Object");let a,l;if(pg(t)===t&&!r&&!i){if(a=nm.get(t),a)return a;if(a=++xF+"~",nm.set(t,a),Array.isArray(t)){for(a="@",l=0;l<t.length;l++)a+=HE(t[l])+",";nm.set(t,a)}if(s){a="#";const u=pg.keys(t).sort();for(;!Kt(l=u.pop());)Kt(t[l])||(a+=l+":"+HE(t[l])+",");nm.set(t,a)}}else a=r?t.toJSON():e=="symbol"?t.toString():e=="string"?JSON.stringify(t):""+t;return a},L3=t=>{if(Gs(t))try{t=t()}catch{t=""}const e=t;return t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?HE(t):"",[t,e]};let TF=0;const jE=()=>++TF;async function mA(...t){const[e,n,r,i]=t,s=bo({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let a=s.populateCache;const l=s.rollbackOnError;let u=s.optimisticData;const d=g=>typeof l=="function"?l(g):l!==!1,h=s.throwOnError;if(Gs(n)){const g=n,b=[],y=e.keys();for(const E of y)!/^\$(inf|sub)\$/.test(E)&&g(e.get(E)._k)&&b.push(E);return Promise.all(b.map(p))}return p(n);async function p(g){const[b]=L3(g);if(!b)return;const[y,E]=pA(e,b),[T,S,A,R]=so.get(e),z=()=>{const ae=T[b];return(Gs(s.revalidate)?s.revalidate(y().data,g):s.revalidate!==!1)&&(delete A[b],delete R[b],ae&&ae[0])?ae[0](fA).then(()=>y().data):y().data};if(t.length<3)return z();let I=r,P,$=!1;const K=jE();S[b]=[K,0];const Z=!Kt(u),W=y(),re=W.data,ie=W._c,ye=Kt(ie)?re:ie;if(Z&&(u=Gs(u)?u(ye,re):u,E({data:u,_c:ye})),Gs(I))try{I=I(ye)}catch(ae){P=ae,$=!0}if(I&&hA(I))if(I=await I.catch(ae=>{P=ae,$=!0}),K!==S[b][0]){if($)throw P;return I}else $&&Z&&d(P)&&(a=!0,E({data:ye,_c:ui}));if(a&&!$)if(Gs(a)){const ae=a(I,ye);E({data:ae,error:ui,_c:ui})}else E({data:I,error:ui,_c:ui});if(S[b][1]=jE(),Promise.resolve(z()).then(()=>{E({_c:ui})}),$){if(h)throw P;return}return I}}const wS=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},gA=(t,e)=>{if(!so.has(t)){const n=bo(yF,e),r=Object.create(null),i=mA.bind(ui,t);let s=bl;const a=Object.create(null),l=(h,p)=>{const g=a[h]||[];return a[h]=g,g.push(p),()=>g.splice(g.indexOf(p),1)},u=(h,p,g)=>{t.set(h,p);const b=a[h];if(b)for(const y of b)y(p,g)},d=()=>{if(!so.has(t)&&(so.set(t,[r,Object.create(null),Object.create(null),Object.create(null),i,u,l]),!Vf)){const h=n.initFocus(setTimeout.bind(ui,wS.bind(ui,r,cA))),p=n.initReconnect(setTimeout.bind(ui,wS.bind(ui,r,dA)));s=()=>{h&&h(),p&&p(),so.delete(t)}}};return d(),[t,i,d,s]}return[t,so.get(t)[4]]},SF=(t,e,n,r,i)=>{const s=n.errorRetryCount,a=i.retryCount,l=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!Kt(s)&&a>s||setTimeout(r,l,i)},wF=PE,[P3,kF]=gA(new Map),bA=bo({onLoadingSlow:bl,onSuccess:bl,onError:bl,onErrorRetry:SF,onDiscarded:bl,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:SS?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:SS?5e3:3e3,compare:wF,isPaused:()=>!1,cache:P3,mutate:kF,fallback:{}},vF),vA=(t,e)=>{const n=bo(t,e);if(e){const{use:r,fallback:i}=t,{use:s,fallback:a}=e;r&&s&&(n.use=r.concat(s)),i&&a&&(n.fallback=bo(i,a))}return n},$E=U.createContext({}),CF=t=>{const{value:e}=t,n=U.useContext($E),r=Gs(e),i=U.useMemo(()=>r?e(n):e,[r,n,e]),s=U.useMemo(()=>r?i:vA(n,i),[r,n,i]),a=i&&i.provider,l=U.useRef(ui);a&&!l.current&&(l.current=gA(a(s.cache||P3),i));const u=l.current;return u&&(s.cache=u[0],s.mutate=u[1]),Km(()=>{if(u)return u[2]&&u[2](),u[3]},[]),U.createElement($E.Provider,bo(t,{value:s}))},AF="$inf$",yA=yh&&window.__SWR_DEVTOOLS_USE__,NF=yA?window.__SWR_DEVTOOLS_USE__:[],MF=()=>{yA&&(window.__SWR_DEVTOOLS_REACT__=le)},OF=t=>Gs(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}],RF=()=>bo(bA,U.useContext($E)),DF=t=>(e,n,r)=>t(e,n&&((...s)=>{const[a]=L3(e),[,,,l]=so.get(P3);if(a.startsWith(AF))return n(...s);const u=l[a];return Kt(u)?n(...s):(delete l[a],u)}),r),IF=NF.concat(DF),LF=t=>function(...n){const r=RF(),[i,s,a]=OF(n),l=vA(r,a);let u=t;const{use:d}=l,h=(d||[]).concat(IF);for(let p=h.length;p--;)u=h[p](u);return u(i,s||l.fetcher||null,l)},PF=(t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};MF();const jy=le.use||(t=>{switch(t.status){case"pending":throw t;case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t}}),$y={dedupe:!0},BF=(t,e,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:a,revalidateOnMount:l,revalidateIfStale:u,refreshInterval:d,refreshWhenHidden:h,refreshWhenOffline:p,keepPreviousData:g}=n,[b,y,E,T]=so.get(r),[S,A]=L3(t),R=U.useRef(!1),z=U.useRef(!1),I=U.useRef(S),P=U.useRef(e),$=U.useRef(n),K=()=>$.current,Z=()=>K().isVisible()&&K().isOnline(),[W,re,ie,ye]=pA(r,S),ae=U.useRef({}).current,de=Kt(a)?Kt(n.fallback)?ui:n.fallback[S]:a,J=(gt,St)=>{for(const Gt in ae){const tt=Gt;if(tt==="data"){if(!i(gt[tt],St[tt])&&(!Kt(gt[tt])||!i(Qe,St[tt])))return!1}else if(St[tt]!==gt[tt])return!1}return!0},ne=U.useMemo(()=>{const gt=!S||!e?!1:Kt(l)?K().isPaused()||s?!1:u!==!1:l,St=hn=>{const fr=bo(hn);return delete fr._k,gt?{isValidating:!0,isLoading:!0,...fr}:fr},Gt=W(),tt=ye(),kt=St(Gt),fn=Gt===tt?kt:St(tt);let qt=kt;return[()=>{const hn=St(W());return J(hn,qt)?(qt.data=hn.data,qt.isLoading=hn.isLoading,qt.isValidating=hn.isValidating,qt.error=hn.error,qt):(qt=hn,hn)},()=>fn]},[r,S]),he=D3.useSyncExternalStore(U.useCallback(gt=>ie(S,(St,Gt)=>{J(Gt,St)||gt()}),[r,S]),ne[0],ne[1]),Oe=!R.current,N=b[S]&&b[S].length>0,X=he.data,me=Kt(X)?de&&hA(de)?jy(de):de:X,B=he.error,Ee=U.useRef(me),Qe=g?Kt(X)?Kt(Ee.current)?me:Ee.current:X:me,Fe=N&&!Kt(B)?!1:Oe&&!Kt(l)?l:K().isPaused()?!1:s?Kt(me)?!1:u:Kt(me)||u,Ft=!!(S&&e&&Oe&&Fe),ut=Kt(he.isValidating)?Ft:he.isValidating,en=Kt(he.isLoading)?Ft:he.isLoading,Nt=U.useCallback(async gt=>{const St=P.current;if(!S||!St||z.current||K().isPaused())return!1;let Gt,tt,kt=!0;const fn=gt||{},qt=!E[S]||!fn.dedupe,hn=()=>TS?!z.current&&S===I.current&&R.current:S===I.current,fr={isValidating:!1,isLoading:!1},ea=()=>{re(fr)},fs=()=>{const ir=E[S];ir&&ir[1]===tt&&delete E[S]},ri={isValidating:!0};Kt(W().data)&&(ri.isLoading=!0);try{if(qt&&(re(ri),n.loadingTimeout&&Kt(W().data)&&setTimeout(()=>{kt&&hn()&&K().onLoadingSlow(S,n)},n.loadingTimeout),E[S]=[St(A),jE()]),[Gt,tt]=E[S],Gt=await Gt,qt&&setTimeout(fs,n.dedupingInterval),!E[S]||E[S][1]!==tt)return qt&&hn()&&K().onDiscarded(S),!1;fr.error=ui;const ir=y[S];if(!Kt(ir)&&(tt<=ir[0]||tt<=ir[1]||ir[1]===0))return ea(),qt&&hn()&&K().onDiscarded(S),!1;const ge=W().data;fr.data=i(ge,Gt)?ge:Gt,qt&&hn()&&K().onSuccess(Gt,S,n)}catch(ir){fs();const ge=K(),{shouldRetryOnError:we}=ge;ge.isPaused()||(fr.error=ir,qt&&hn()&&(ge.onError(ir,S,ge),(we===!0||Gs(we)&&we(ir))&&(!K().revalidateOnFocus||!K().revalidateOnReconnect||Z())&&ge.onErrorRetry(ir,S,ge,rt=>{const st=b[S];st&&st[0]&&st[0](_S,rt)},{retryCount:(fn.retryCount||0)+1,dedupe:!0})))}return kt=!1,ea(),!0},[S,r]),Mn=U.useCallback((...gt)=>mA(r,I.current,...gt),[]);if(Km(()=>{P.current=e,$.current=n,Kt(X)||(Ee.current=X)}),Km(()=>{if(!S)return;const gt=Nt.bind(ui,$y);let St=0;K().revalidateOnFocus&&(St=Date.now()+K().focusThrottleInterval);const tt=PF(S,b,(kt,fn={})=>{if(kt==cA){const qt=Date.now();K().revalidateOnFocus&&qt>St&&Z()&&(St=qt+K().focusThrottleInterval,gt())}else if(kt==dA)K().revalidateOnReconnect&&Z()&&gt();else{if(kt==fA)return Nt();if(kt==_S)return Nt(fn)}});return z.current=!1,I.current=S,R.current=!0,re({_k:A}),Fe&&(E[S]||(Kt(me)||Vf?gt():EF(gt))),()=>{z.current=!0,tt()}},[S]),Km(()=>{let gt;function St(){const tt=Gs(d)?d(W().data):d;tt&&gt!==-1&&(gt=setTimeout(Gt,tt))}function Gt(){!W().error&&(h||K().isVisible())&&(p||K().isOnline())?Nt($y).then(St):St()}return St(),()=>{gt&&(clearTimeout(gt),gt=-1)}},[d,h,p,S]),U.useDebugValue(Qe),s&&Kt(me)&&S){if(!TS&&Vf)throw new Error("Fallback data is required when using Suspense in SSR.");P.current=e,$.current=n,z.current=!1;const gt=T[S];if(!Kt(gt)){const St=Mn(gt);jy(St)}if(Kt(B)){const St=Nt($y);Kt(Qe)||(St.status="fulfilled",St.value=!0),jy(St)}else throw B}return{mutate:Mn,get data(){return ae.data=!0,Qe},get error(){return ae.error=!0,B},get isValidating(){return ae.isValidating=!0,ut},get isLoading(){return ae.isLoading=!0,en}}},zF=pg.defineProperty(CF,"defaultValue",{value:bA}),FF=LF(BF);var kS=Object.prototype.hasOwnProperty;function CS(t,e,n){for(n of t.keys())if(bf(n,e))return n}function bf(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&bf(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(i=r,i&&typeof i=="object"&&(i=CS(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(i=r[0],i&&typeof i=="object"&&(i=CS(e,i),!i)||!bf(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(kS.call(t,n)&&++r&&!kS.call(e,n)||!(n in e)||!bf(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}function UF(t,e){if(!t)throw typeof e=="string"?new Error(e):new Error(`${e.displayName} not found`)}const xo=(t,e)=>{const{assertCtxFn:n=UF}={},r=le.createContext(void 0);return r.displayName=t,[r,()=>{const a=le.useContext(r);return n(a,`${t} not found`),a.value},()=>{const a=le.useContext(r);return a?a.value:{}}]};function HF({swrConfig:t,children:e}){return le.createElement(zF,{value:t},e)}const[EA,F1]=xo("ClerkInstanceContext"),[jF,_A]=xo("UserContext"),[$F,Kfe]=xo("ClientContext"),[qF,Xfe]=xo("SessionContext");le.createContext({});const[VF,Qfe]=xo("CheckoutContext"),GF=({children:t,...e})=>le.createElement(VF.Provider,{value:{value:e}},t),[YF,WF]=xo("OrganizationContext"),KF=({children:t,organization:e,swrConfig:n})=>le.createElement(HF,{swrConfig:n},le.createElement(YF.Provider,{value:{value:{organization:e}}},t));function U1(t){if(!le.useContext(EA)){if(typeof t=="function"){t();return}throw new Error(`${t} can only be used within the <ClerkProvider /> component.

Possible fixes:
1. Ensure that the <ClerkProvider /> is correctly wrapping your application where this component is used.
2. Check for multiple versions of the \`@clerk/shared\` package in your project. Use a tool like \`npm ls @clerk/shared\` to identify multiple versions, and update your dependencies to only rely on one.

Learn more: https://clerk.com/docs/components/clerk-provider`.trim())}}const XF="billing-subscription",QF={SUBSCRIPTION_KEY:XF};function ZF(t){return{queryKey:[t.stablePrefix,t.authenticated,t.tracked,t.untracked],invalidationKey:[t.stablePrefix,t.authenticated,t.tracked],stableKey:t.stablePrefix,authenticated:t.authenticated}}const JF=()=>(U1("useClerk"),F1());typeof window<"u"?le.useLayoutEffect:le.useEffect;const AS="useUser";function eU(){var e;U1(AS);const t=_A();return(e=F1().telemetry)==null||e.record(R3(AS)),t===void 0?{isLoaded:!1,isSignedIn:void 0,user:void 0}:t===null?{isLoaded:!0,isSignedIn:!1,user:null}:{isLoaded:!0,isSignedIn:!0,user:t}}const NS=bf;function tU(t){const{userId:e,orgId:n,for:r}=t;return U.useMemo(()=>{const i=r==="organization"?n:void 0;return ZF({stablePrefix:QF.SUBSCRIPTION_KEY,authenticated:!0,tracked:{userId:e,orgId:i},untracked:{args:{orgId:i}}})},[e,n,r])}const MS="useSubscription";function nU(t){var h;U1(MS);const e=F1(),n=_A(),{organization:r}=WF(),i=e.__unstable__environment;(h=e.telemetry)==null||h.record(R3(MS));const s=(t==null?void 0:t.for)==="organization"?i==null?void 0:i.commerceSettings.billing.organization.enabled:i==null?void 0:i.commerceSettings.billing.user.enabled,a=((t==null?void 0:t.enabled)??!0)&&s,{queryKey:l}=tU({userId:n==null?void 0:n.id,orgId:r==null?void 0:r.id,for:t==null?void 0:t.for}),u=FF(a?{queryKey:l}:null,({queryKey:p})=>{const g=p[3].args;return p[2].userId?e.billing.getSubscription(g):null},{dedupingInterval:1e3*60,keepPreviousData:t==null?void 0:t.keepPreviousData}),d=U.useCallback(()=>{u.mutate()},[u]);return{data:u.data,error:u.error,isLoading:u.isLoading,isFetching:u.isValidating,revalidate:d}}const rU=t=>{const e=U.useRef(t);return U.useEffect(()=>{e.current=t},[t]),e.current},es=(t,e,n)=>{const r=!!n,i=U.useRef(n);U.useEffect(()=>{i.current=n},[n]),U.useEffect(()=>{if(!r||!t)return()=>{};const s=(...a)=>{i.current&&i.current(...a)};return t.on(e,s),()=>{t.off(e,s)}},[r,e,t,i])},xA=le.createContext(null);xA.displayName="ElementsContext";const iU=(t,e)=>{if(!t)throw new Error(`Could not find Elements context; You need to wrap the part of your app that ${e} in an <Elements> provider.`);return t},mg=t=>t!==null&&typeof t=="object",sU=(t,e,n)=>mg(t)?Object.keys(t).reduce((r,i)=>{const s=!mg(e)||!TA(t[i],e[i]);return n.includes(i)?(s&&console.warn(`Unsupported prop change: options.${i} is not a mutable property.`),r):s?{...r||{},[i]:t[i]}:r},null):null,OS="[object Object]",TA=(t,e)=>{if(!mg(t)||!mg(e))return t===e;const n=Array.isArray(t);if(n!==Array.isArray(e))return!1;const r=Object.prototype.toString.call(t)===OS;if(r!==(Object.prototype.toString.call(e)===OS))return!1;if(!r&&!n)return t===e;const i=Object.keys(t),s=Object.keys(e);if(i.length!==s.length)return!1;const a={};for(let p=0;p<i.length;p+=1)a[i[p]]=!0;for(let p=0;p<s.length;p+=1)a[s[p]]=!0;const l=Object.keys(a);if(l.length!==i.length)return!1;const u=t,d=e,h=p=>TA(u[p],d[p]);return l.every(h)},RS=t=>iU(le.useContext(xA),t),aU=t=>t.charAt(0).toUpperCase()+t.slice(1),oU=(t,e)=>{const n=`${aU(t)}Element`,s=e?a=>{RS(`mounts <${n}>`);const{id:l,className:u}=a;return le.createElement("div",{id:l,className:u})}:({id:a,className:l,fallback:u,options:d={},onBlur:h,onFocus:p,onReady:g,onChange:b,onEscape:y,onClick:E,onLoadError:T,onLoaderStart:S,onNetworksChange:A,onConfirm:R,onCancel:z,onShippingAddressChange:I,onShippingRateChange:P})=>{const $=RS(`mounts <${n}>`),K="elements"in $?$.elements:null,[Z,W]=le.useState(null),re=le.useRef(null),ie=le.useRef(null),[ye,ae]=U.useState(!1);es(Z,"blur",h),es(Z,"focus",p),es(Z,"escape",y),es(Z,"click",E),es(Z,"loaderror",T),es(Z,"loaderstart",S),es(Z,"networkschange",A),es(Z,"confirm",R),es(Z,"cancel",z),es(Z,"shippingaddresschange",I),es(Z,"shippingratechange",P),es(Z,"change",b);let de;g&&(de=()=>{ae(!0),g(Z)}),es(Z,"ready",de),le.useLayoutEffect(()=>{if(re.current===null&&ie.current!==null&&K){let ne=null;K&&(ne=K.create(t,d)),re.current=ne,W(ne),ne&&ne.mount(ie.current)}},[K,d]);const J=rU(d);return le.useEffect(()=>{if(!re.current)return;const ne=sU(d,J,["paymentRequest"]);ne&&"update"in re.current&&re.current.update(ne)},[d,J]),le.useLayoutEffect(()=>()=>{if(re.current&&typeof re.current.destroy=="function")try{re.current.destroy(),re.current=null}catch{}},[]),le.createElement(le.Fragment,null,!ye&&u,le.createElement("div",{id:a,style:{height:ye?"unset":"0px",visibility:ye?"visible":"hidden"},className:l,ref:ie}))};return s.displayName=n,s.__elementType=t,s};oU("payment",typeof window>"u");xo("PaymentElementContext");xo("StripeUtilsContext");var Ks=sA({packageName:"@clerk/clerk-react"});function lU(t){Ks.setMessages(t).setPackageName(t)}var[uU,cU]=xo("AuthContext"),dU=EA,SA=F1,fU="You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.",hU=t=>`You've passed multiple children components to <${t}/>. You can only pass a single child component or text.`,pU="Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support",qy="Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.",mU="<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",gU="<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",bU="<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",vU="<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",yU=t=>`<${t} /> can only accept <${t}.Page /> and <${t}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`,EU=t=>`Missing props. <${t}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`,_U=t=>`Missing props. <${t}.Link /> component requires the following props: url, label and labelIcon.`,xU="<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.",TU="<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.",SU="<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.",wU="<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.",kU="<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.",CU="Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.",AU="Missing props. <UserButton.Action /> component requires the following props: label.",H1=t=>{U1(()=>{Ks.throwMissingClerkProviderError({source:t})})},wA=t=>new Promise(e=>{const n=r=>{["ready","degraded"].includes(r)&&(e(),t.off("status",n))};t.on("status",n,{notify:!0})}),NU=t=>async e=>(await wA(t),t.session?t.session.getToken(e):null),MU=t=>async(...e)=>(await wA(t),t.signOut(...e)),Eh=(t={})=>{var e;H1("useAuth");const{treatPendingAsSignedOut:n,...r}=t??{},i=r;let a=cU();a.sessionId===void 0&&a.userId===void 0&&(a=i??{});const l=SA(),u=U.useCallback(NU(l),[l]),d=U.useCallback(MU(l),[l]);return(e=l.telemetry)==null||e.record(R3("useAuth",{treatPendingAsSignedOut:n})),OU({...a,getToken:u,signOut:d},{treatPendingAsSignedOut:n})};function OU(t,{treatPendingAsSignedOut:e=!0}={}){const{userId:n,orgId:r,orgRole:i,has:s,signOut:a,getToken:l,orgPermissions:u,factorVerificationAge:d,sessionClaims:h}=t??{},p=U.useCallback(b=>s?s(b):iF({userId:n,orgId:r,orgRole:i,orgPermissions:u,factorVerificationAge:d,features:(h==null?void 0:h.fea)||"",plans:(h==null?void 0:h.pla)||""})(b),[s,n,r,i,u,d,h]),g=sF({authObject:{...t,getToken:l,signOut:a,has:p},options:{treatPendingAsSignedOut:e}});return g||Ks.throw(pU)}var dn=(t,e)=>{const r=(typeof e=="string"?e:e==null?void 0:e.component)||t.displayName||t.name||"Component";t.displayName=r;const i=typeof e=="string"?void 0:e,s=a=>{H1(r||"withClerk");const l=SA();return!l.loaded&&!(i!=null&&i.renderWhileLoading)?null:le.createElement(t,{...a,component:r,clerk:l})};return s.displayName=`withClerk(${r})`,s};const RU=()=>{try{return!1}catch{}return!1},DU=()=>{try{return!1}catch{}return!1},IU=()=>{try{return!0}catch{}return!1},DS=new Set,B3=(t,e,n)=>{const r=DU()||IU(),i=t;DS.has(i)||r||(DS.add(i),console.warn(`Clerk - DEPRECATION WARNING: "${t}" is deprecated and will be removed in the next major release.
${e}`))};var LU=({children:t,treatPendingAsSignedOut:e})=>{H1("SignedIn");const{userId:n}=Eh({treatPendingAsSignedOut:e});return n?t:null},PU=({children:t,treatPendingAsSignedOut:e})=>{H1("SignedOut");const{userId:n}=Eh({treatPendingAsSignedOut:e});return n===null?t:null};dn(({clerk:t,...e})=>{const{client:n,session:r}=t,i=n.signedInSessions?n.signedInSessions.length>0:n.activeSessions&&n.activeSessions.length>0;return le.useEffect(()=>{r===null&&i?t.redirectToAfterSignOut():t.redirectToSignIn(e)},[]),null},"RedirectToSignIn");dn(({clerk:t,...e})=>(le.useEffect(()=>{t.redirectToSignUp(e)},[]),null),"RedirectToSignUp");dn(({clerk:t,...e})=>(le.useEffect(()=>{t.redirectToTasks(e)},[]),null),"RedirectToTasks");dn(({clerk:t})=>(le.useEffect(()=>{B3("RedirectToUserProfile","Use the `redirectToUserProfile()` method instead."),t.redirectToUserProfile()},[]),null),"RedirectToUserProfile");dn(({clerk:t})=>(le.useEffect(()=>{B3("RedirectToOrganizationProfile","Use the `redirectToOrganizationProfile()` method instead."),t.redirectToOrganizationProfile()},[]),null),"RedirectToOrganizationProfile");dn(({clerk:t})=>(le.useEffect(()=>{B3("RedirectToCreateOrganization","Use the `redirectToCreateOrganization()` method instead."),t.redirectToCreateOrganization()},[]),null),"RedirectToCreateOrganization");dn(({clerk:t,...e})=>(le.useEffect(()=>{t.handleRedirectCallback(e)},[]),null),"AuthenticateWithRedirectCallback");function Vy(t,e,n){if(typeof t=="function")return t(e);if(typeof t<"u")return t;if(typeof n<"u")return n}const _i=t=>{RU()&&console.error(`Clerk: ${t}`)};var kA=zC();const BU=mh(kA),IS=(t,...e)=>{const n={...t};for(const r of e)delete n[r];return n};var $u=t=>e=>{try{return le.Children.only(t)}catch{return Ks.throw(hU(e))}},qu=(t,e)=>(t||(t=e),typeof t=="string"&&(t=le.createElement("button",null,t)),t),Vu=t=>(...e)=>{if(t&&typeof t=="function")return t(...e)};function zU(t){return typeof t=="function"}var rm=new Map;function FU(t,e,n=1){le.useEffect(()=>{const r=rm.get(t)||0;return r==n?Ks.throw(e):(rm.set(t,r+1),()=>{rm.set(t,(rm.get(t)||1)-1)})},[])}function UU(t,e,n){const r=t.displayName||t.name||e||"Component",i=s=>(FU(e,n),le.createElement(t,{...s}));return i.displayName=`withMaxAllowedInstancesGuard(${r})`,i}var vf=t=>{const[e,n]=U.useState(new Map);return t.map(r=>({id:r.id,mount:i=>n(s=>new Map(s).set(String(r.id),i)),unmount:()=>n(i=>{const s=new Map(i);return s.set(String(r.id),null),s}),portal:()=>{const i=e.get(String(r.id));return i?kA.createPortal(r.component,i):null}}))},Ei=(t,e)=>!!t&&le.isValidElement(t)&&(t==null?void 0:t.type)===e,CA=(t,e)=>MA({children:t,reorderItemsLabels:["account","security","billing","apiKeys"],LinkComponent:xh,PageComponent:_h,MenuItemsComponent:$1,componentName:"UserProfile"},e),AA=(t,e)=>MA({children:t,reorderItemsLabels:["general","members","billing","apiKeys"],LinkComponent:V1,PageComponent:q1,componentName:"OrganizationProfile"},e),NA=t=>{const e=[],n=[V1,q1,$1,_h,xh];return le.Children.forEach(t,r=>{n.some(i=>Ei(r,i))||e.push(r)}),e},MA=(t,e)=>{const{children:n,LinkComponent:r,PageComponent:i,MenuItemsComponent:s,reorderItemsLabels:a,componentName:l}=t,{allowForAnyChildren:u=!1}=e||{},d=[];le.Children.forEach(n,A=>{if(!Ei(A,i)&&!Ei(A,r)&&!Ei(A,s)){A&&!u&&_i(yU(l));return}const{props:R}=A,{children:z,label:I,url:P,labelIcon:$}=R;if(Ei(A,i))if(LS(R,a))d.push({label:I});else if(Gy(R))d.push({label:I,labelIcon:$,children:z,url:P});else{_i(EU(l));return}if(Ei(A,r))if(Yy(R))d.push({label:I,labelIcon:$,url:P});else{_i(_U(l));return}});const h=[],p=[],g=[];d.forEach((A,R)=>{if(Gy(A)){h.push({component:A.children,id:R}),p.push({component:A.labelIcon,id:R});return}Yy(A)&&g.push({component:A.labelIcon,id:R})});const b=vf(h),y=vf(p),E=vf(g),T=[],S=[];return d.forEach((A,R)=>{if(LS(A,a)){T.push({label:A.label});return}if(Gy(A)){const{portal:z,mount:I,unmount:P}=b.find(W=>W.id===R),{portal:$,mount:K,unmount:Z}=y.find(W=>W.id===R);T.push({label:A.label,url:A.url,mount:I,unmount:P,mountIcon:K,unmountIcon:Z}),S.push(z),S.push($);return}if(Yy(A)){const{portal:z,mount:I,unmount:P}=E.find($=>$.id===R);T.push({label:A.label,url:A.url,mountIcon:I,unmountIcon:P}),S.push(z);return}}),{customPages:T,customPagesPortals:S}},LS=(t,e)=>{const{children:n,label:r,url:i,labelIcon:s}=t;return!n&&!i&&!s&&e.some(a=>a===r)},Gy=t=>{const{children:e,label:n,url:r,labelIcon:i}=t;return!!e&&!!r&&!!i&&!!n},Yy=t=>{const{children:e,label:n,url:r,labelIcon:i}=t;return!e&&!!r&&!!i&&!!n},HU=(t,e)=>{var n;return jU({children:t,reorderItemsLabels:["manageAccount","signOut"],MenuItemsComponent:$1,MenuActionComponent:RA,MenuLinkComponent:DA,UserProfileLinkComponent:xh,UserProfilePageComponent:_h,allowForAnyChildren:(n=e==null?void 0:e.allowForAnyChildren)!=null?n:!1})},jU=({children:t,MenuItemsComponent:e,MenuActionComponent:n,MenuLinkComponent:r,UserProfileLinkComponent:i,UserProfilePageComponent:s,reorderItemsLabels:a,allowForAnyChildren:l=!1})=>{const u=[],d=[],h=[];le.Children.forEach(t,E=>{if(!Ei(E,e)&&!Ei(E,i)&&!Ei(E,s)){E&&!l&&_i(xU);return}if(Ei(E,i)||Ei(E,s))return;const{props:T}=E;le.Children.forEach(T.children,S=>{if(!Ei(S,n)&&!Ei(S,r)){S&&_i(TU);return}const{props:A}=S,{label:R,labelIcon:z,href:I,onClick:P,open:$}=A;if(Ei(S,n))if(PS(A,a))u.push({label:R});else if(Wy(A)){const K={label:R,labelIcon:z};if(P!==void 0)u.push({...K,onClick:P});else if($!==void 0)u.push({...K,open:$.startsWith("/")?$:`/${$}`});else{_i("Custom menu item must have either onClick or open property");return}}else{_i(AU);return}if(Ei(S,r))if(Ky(A))u.push({label:R,labelIcon:z,href:I});else{_i(CU);return}})});const p=[],g=[];u.forEach((E,T)=>{Wy(E)&&p.push({component:E.labelIcon,id:T}),Ky(E)&&g.push({component:E.labelIcon,id:T})});const b=vf(p),y=vf(g);return u.forEach((E,T)=>{if(PS(E,a)&&d.push({label:E.label}),Wy(E)){const{portal:S,mount:A,unmount:R}=b.find(I=>I.id===T),z={label:E.label,mountIcon:A,unmountIcon:R};"onClick"in E?z.onClick=E.onClick:"open"in E&&(z.open=E.open),d.push(z),h.push(S)}if(Ky(E)){const{portal:S,mount:A,unmount:R}=y.find(z=>z.id===T);d.push({label:E.label,href:E.href,mountIcon:A,unmountIcon:R}),h.push(S)}}),{customMenuItems:d,customMenuItemsPortals:h}},PS=(t,e)=>{const{children:n,label:r,onClick:i,labelIcon:s}=t;return!n&&!i&&!s&&e.some(a=>a===r)},Wy=t=>{const{label:e,labelIcon:n,onClick:r,open:i}=t;return!!n&&!!e&&(typeof r=="function"||typeof i=="string")},Ky=t=>{const{label:e,href:n,labelIcon:r}=t;return!!n&&!!r&&!!e},$U=t=>{const e=t==null?void 0:t.isReady;return n=>new Promise((r,i)=>{const{root:s=document==null?void 0:document.body,selector:a,timeout:l=0}=n;if(!s){i(new Error("No root element provided"));return}let u=s;if(a&&(u=s==null?void 0:s.querySelector(a)),e(u,a)){r();return}const d=new MutationObserver(h=>{for(const p of h)if(!u&&a&&(u=s==null?void 0:s.querySelector(a)),(t.childList&&p.type==="childList"||t.attributes&&p.type==="attributes")&&e(u,a)){d.disconnect(),r();return}});d.observe(s,t),l>0&&setTimeout(()=>{d.disconnect(),i(new Error(`Timeout waiting for ${a}`))},l)})},qU=$U({childList:!0,subtree:!0,isReady:(t,e)=>{var n;return!!(t!=null&&t.childElementCount)&&((n=t==null?void 0:t.matches)==null?void 0:n.call(t,e))&&t.childElementCount>0}});function Ci(t,e){const n=U.useRef(),[r,i]=U.useState("rendering");return U.useEffect(()=>{if(!t)throw new Error("Clerk: no component name provided, unable to detect mount.");if(typeof window<"u"&&!n.current){const s=`[data-clerk-component="${t}"]`,a=e==null?void 0:e.selector;n.current=qU({selector:a?s+a:s}).then(()=>{i("rendered")}).catch(()=>{i("error")})}},[t,e==null?void 0:e.selector]),r}var im=t=>"mount"in t,BS=t=>"open"in t,zS=t=>t==null?void 0:t.map(({mountIcon:e,unmountIcon:n,...r})=>r),ni=class extends le.PureComponent{constructor(){super(...arguments),this.rootRef=le.createRef()}componentDidUpdate(t){var e,n,r,i;if(!im(t)||!im(this.props))return;const s=IS(t.props,"customPages","customMenuItems","children"),a=IS(this.props.props,"customPages","customMenuItems","children"),l=((e=s.customPages)==null?void 0:e.length)!==((n=a.customPages)==null?void 0:n.length),u=((r=s.customMenuItems)==null?void 0:r.length)!==((i=a.customMenuItems)==null?void 0:i.length),d=zS(t.props.customMenuItems),h=zS(this.props.props.customMenuItems);(!NS(s,a)||!NS(d,h)||l||u)&&this.rootRef.current&&this.props.updateProps({node:this.rootRef.current,props:this.props.props})}componentDidMount(){this.rootRef.current&&(im(this.props)&&this.props.mount(this.rootRef.current,this.props.props),BS(this.props)&&this.props.open(this.props.props))}componentWillUnmount(){this.rootRef.current&&(im(this.props)&&this.props.unmount(this.rootRef.current),BS(this.props)&&this.props.close())}render(){const{hideRootHtmlElement:t=!1}=this.props,e={ref:this.rootRef,...this.props.rootProps,...this.props.component&&{"data-clerk-component":this.props.component}};return le.createElement(le.Fragment,null,!t&&le.createElement("div",{...e}),this.props.children)}},j1=t=>{var e,n;return le.createElement(le.Fragment,null,(e=t==null?void 0:t.customPagesPortals)==null?void 0:e.map((r,i)=>U.createElement(r,{key:i})),(n=t==null?void 0:t.customMenuItemsPortals)==null?void 0:n.map((r,i)=>U.createElement(r,{key:i})))},VU=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountSignIn,unmount:t.unmountSignIn,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"SignIn",renderWhileLoading:!0}),GU=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountSignUp,unmount:t.unmountSignUp,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"SignUp",renderWhileLoading:!0});function _h({children:t}){return _i(mU),le.createElement(le.Fragment,null,t)}function xh({children:t}){return _i(gU),le.createElement(le.Fragment,null,t)}var YU=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}},{customPages:l,customPagesPortals:u}=CA(r.children);return le.createElement(le.Fragment,null,s&&n,le.createElement(ni,{component:e,mount:t.mountUserProfile,unmount:t.unmountUserProfile,updateProps:t.__unstable__updateProps,props:{...r,customPages:l},rootProps:a},le.createElement(j1,{customPagesPortals:u})))},{component:"UserProfile",renderWhileLoading:!0});Object.assign(YU,{Page:_h,Link:xh});var OA=U.createContext({mount:()=>{},unmount:()=>{},updateProps:()=>{}}),WU=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}},{customPages:l,customPagesPortals:u}=CA(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),d={...r.userProfileProps,customPages:l},{customMenuItems:h,customMenuItemsPortals:p}=HU(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),g=NA(r.children),b={mount:t.mountUserButton,unmount:t.unmountUserButton,updateProps:t.__unstable__updateProps,props:{...r,userProfileProps:d,customMenuItems:h}},y={customPagesPortals:u,customMenuItemsPortals:p};return le.createElement(OA.Provider,{value:b},s&&n,t.loaded&&le.createElement(ni,{component:e,...b,hideRootHtmlElement:!!r.__experimental_asProvider,rootProps:a},r.__experimental_asProvider?g:null,le.createElement(j1,{...y})))},{component:"UserButton",renderWhileLoading:!0});function $1({children:t}){return _i(SU),le.createElement(le.Fragment,null,t)}function RA({children:t}){return _i(wU),le.createElement(le.Fragment,null,t)}function DA({children:t}){return _i(kU),le.createElement(le.Fragment,null,t)}function KU(t){const e=U.useContext(OA),n={...e,props:{...e.props,...t}};return le.createElement(ni,{...n})}var XU=Object.assign(WU,{UserProfilePage:_h,UserProfileLink:xh,MenuItems:$1,Action:RA,Link:DA,__experimental_Outlet:KU});function q1({children:t}){return _i(bU),le.createElement(le.Fragment,null,t)}function V1({children:t}){return _i(vU),le.createElement(le.Fragment,null,t)}var QU=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}},{customPages:l,customPagesPortals:u}=AA(r.children);return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountOrganizationProfile,unmount:t.unmountOrganizationProfile,updateProps:t.__unstable__updateProps,props:{...r,customPages:l},rootProps:a},le.createElement(j1,{customPagesPortals:u})))},{component:"OrganizationProfile",renderWhileLoading:!0});Object.assign(QU,{Page:q1,Link:V1});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountCreateOrganization,unmount:t.unmountCreateOrganization,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"CreateOrganization",renderWhileLoading:!0});var IA=U.createContext({mount:()=>{},unmount:()=>{},updateProps:()=>{}}),ZU=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}},{customPages:l,customPagesPortals:u}=AA(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),d={...r.organizationProfileProps,customPages:l},h=NA(r.children),p={mount:t.mountOrganizationSwitcher,unmount:t.unmountOrganizationSwitcher,updateProps:t.__unstable__updateProps,props:{...r,organizationProfileProps:d},rootProps:a,component:e};return t.__experimental_prefetchOrganizationSwitcher(),le.createElement(IA.Provider,{value:p},le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{...p,hideRootHtmlElement:!!r.__experimental_asProvider},r.__experimental_asProvider?h:null,le.createElement(j1,{customPagesPortals:u}))))},{component:"OrganizationSwitcher",renderWhileLoading:!0});function JU(t){const e=U.useContext(IA),n={...e,props:{...e.props,...t}};return le.createElement(ni,{...n})}Object.assign(ZU,{OrganizationProfilePage:q1,OrganizationProfileLink:V1,__experimental_Outlet:JU});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountOrganizationList,unmount:t.unmountOrganizationList,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"OrganizationList",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,open:t.openGoogleOneTap,close:t.closeGoogleOneTap,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"GoogleOneTap",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountWaitlist,unmount:t.unmountWaitlist,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"Waitlist",renderWhileLoading:!0});var eH=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e,{selector:'[data-component-status="ready"]'})==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountPricingTable,unmount:t.unmountPricingTable,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"PricingTable",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountAPIKeys,unmount:t.unmountAPIKeys,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"ApiKeys",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountUserAvatar,unmount:t.unmountUserAvatar,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"UserAvatar",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountTaskChooseOrganization,unmount:t.unmountTaskChooseOrganization,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"TaskChooseOrganization",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ni,{component:e,mount:t.mountTaskResetPassword,unmount:t.unmountTaskResetPassword,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"TaskResetPassword",renderWhileLoading:!0});var LA=t=>{throw TypeError(t)},z3=(t,e,n)=>e.has(t)||LA("Cannot "+n),Dn=(t,e,n)=>(z3(t,e,"read from private field"),n?n.call(t):e.get(t)),sl=(t,e,n)=>e.has(t)?LA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),du=(t,e,n,r)=>(z3(t,e,"write to private field"),e.set(t,n),n),Xy=(t,e,n)=>(z3(t,e,"access private method"),n);const tH={initialDelay:125,maxDelayBetweenRetries:0,factor:2,shouldRetry:(t,e)=>e<5,retryImmediately:!1,jitter:!0},nH=100,PA=async t=>new Promise(e=>setTimeout(e,t)),BA=(t,e)=>e?t*(1+Math.random()):t,rH=t=>{let e=0;const n=()=>{const r=t.initialDelay,i=t.factor;let s=r*Math.pow(i,e);return s=BA(s,t.jitter),Math.min(t.maxDelayBetweenRetries||s,s)};return async()=>{await PA(n()),e++}},iH=async(t,e={})=>{let n=0;const{shouldRetry:r,initialDelay:i,maxDelayBetweenRetries:s,factor:a,retryImmediately:l,jitter:u,onBeforeRetry:d}={...tH,...e},h=rH({initialDelay:i,maxDelayBetweenRetries:s,factor:a,jitter:u});for(;;)try{return await t()}catch(p){if(n++,!r(p,n))throw p;d&&await d(n),l&&n===1?await PA(BA(nH,u)):await h()}},sH="loadScript cannot be called when document does not exist",aH="loadScript cannot be called without a src";async function oH(t="",e){const{async:n,defer:r,beforeLoad:i,crossOrigin:s,nonce:a}=e||{};return iH(()=>new Promise((u,d)=>{t||d(new Error(aH)),(!document||!document.body)&&d(new Error(sH));const h=document.createElement("script");s&&h.setAttribute("crossorigin",s),h.async=n||!1,h.defer=r||!1,h.addEventListener("load",()=>{h.remove(),u(h)}),h.addEventListener("error",p=>{h.remove(),d(p.error??new Error(`failed to load script: ${t}`))}),h.src=t,h.nonce=a,i==null||i(h),document.body.appendChild(h)}),{shouldRetry:(u,d)=>d<=5})}function lH(t){return t?uH(t)||zA(t):!0}function uH(t){return/^http(s)?:\/\//.test(t||"")}function zA(t){return t.startsWith("/")}function cH(t){return t?zA(t)?new URL(t,window.location.origin).toString():t:""}function dH(t){if(!t)return"";let e;if(t.match(/^(clerk\.)+\w*$/))e=/(clerk\.)*(?=clerk\.)/;else{if(t.match(/\.clerk.accounts/))return t;e=/^(clerk\.)*/gi}return`clerk.${t.replace(e,"")}`}const fH=(t,e="5.114.0")=>{if(t)return t;const n=hH(e);return n?n==="snapshot"?"5.114.0":n:pH(e)},hH=t=>{var e;return(e=t.trim().replace(/^v/,"").match(/-(.+?)(\.|$)/))==null?void 0:e[1]},pH=t=>t.trim().replace(/^v/,"").split(".")[0],FA="failed_to_load_clerk_js",mH="failed_to_load_clerk_js_timeout",qE="Failed to load Clerk",{isDevOrStagingUrl:gH}=lF(),UA=sA({packageName:"@clerk/shared"});function bH(t){UA.setPackageName({packageName:t})}function VE(){if(typeof window>"u"||!window.Clerk)return!1;const t=window.Clerk;return typeof t=="object"&&typeof t.load=="function"}function vH(t){if(typeof window>"u"||!window.performance)return!1;const e=performance.getEntriesByName(t,"resource");if(e.length===0)return!1;const n=e[e.length-1];return n.transferSize===0&&n.decodedBodySize===0&&(n.responseEnd===0||n.responseEnd>0&&n.responseStart>0||"responseStatus"in n&&(n.responseStatus>=400||n.responseStatus===0))}function FS(t,e){return new Promise((n,r)=>{let i=!1;const s=(h,p)=>{clearTimeout(h),clearInterval(p)};e==null||e.addEventListener("error",()=>{s(u,d),r(new IE(qE,{code:FA}))});const a=()=>{i||VE()&&(i=!0,s(u,d),n(null))},u=setTimeout(()=>{i||(i=!0,s(u,d),VE()?n(null):r(new IE(qE,{code:mH})))},t);a();const d=setInterval(()=>{if(i){clearInterval(d);return}a()},100)})}const yH=async t=>{const e=(t==null?void 0:t.scriptLoadTimeout)??15e3;if(VE())return null;if(!(t!=null&&t.publishableKey))return UA.throwMissingPublishableKeyError(),null;const n=EH(t),r=document.querySelector("script[data-clerk-js-script]");if(r)if(vH(n))r.remove();else try{return await FS(e,r),null}catch{r.remove()}const i=FS(e);return oH(n,{async:!0,crossOrigin:"anonymous",nonce:t.nonce,beforeLoad:xH(t)}).catch(s=>{throw new IE(qE+(s.message?`, ${s.message}`:""),{code:FA,cause:s})}),i},EH=t=>{var h,p;const{clerkJSUrl:e,clerkJSVariant:n,clerkJSVersion:r,proxyUrl:i,domain:s,publishableKey:a}=t;if(e)return e;let l="";i&&lH(i)?l=cH(i).replace(/http(s)?:\/\//,""):s&&!gH(((h=vS(a))==null?void 0:h.frontendApi)||"")?l=dH(s):l=((p=vS(a))==null?void 0:p.frontendApi)||"";const u=n?`${n.replace(/\.+$/,"")}.`:"",d=fH(r);return`https://${l}/npm/@clerk/clerk-js@${d}/dist/clerk.${u}browser.js`},_H=t=>{const e={};return t.publishableKey&&(e["data-clerk-publishable-key"]=t.publishableKey),t.proxyUrl&&(e["data-clerk-proxy-url"]=t.proxyUrl),t.domain&&(e["data-clerk-domain"]=t.domain),t.nonce&&(e.nonce=t.nonce),e},xH=t=>e=>{const n=_H(t);for(const r in n)e.setAttribute(r,n[r])},TH=(t,e,n)=>!t&&n?SH(n):wH(e),SH=t=>{const e=t.userId,n=t.user,r=t.sessionId,i=t.sessionStatus,s=t.sessionClaims;return{userId:e,user:n,sessionId:r,session:t.session,sessionStatus:i,sessionClaims:s,organization:t.organization,orgId:t.orgId,orgRole:t.orgRole,orgPermissions:t.orgPermissions,orgSlug:t.orgSlug,actor:t.actor,factorVerificationAge:t.factorVerificationAge}},wH=t=>{var y,E,T,S;const e=t.user?t.user.id:t.user,n=t.user,r=t.session?t.session.id:t.session,i=t.session,s=(y=t.session)==null?void 0:y.status,a=t.session?(T=(E=t.session.lastActiveToken)==null?void 0:E.jwt)==null?void 0:T.claims:null,l=t.session?t.session.factorVerificationAge:null,u=i==null?void 0:i.actor,d=t.organization,h=t.organization?t.organization.id:t.organization,p=d==null?void 0:d.slug,g=d&&((S=n==null?void 0:n.organizationMemberships)==null?void 0:S.find(A=>A.organization.id===h)),b=g&&g.permissions;return{userId:e,user:n,sessionId:r,session:i,sessionStatus:s,sessionClaims:a,organization:d,orgId:h,orgRole:g&&g.role,orgSlug:p,orgPermissions:b,actor:u,factorVerificationAge:l}};function gg(){return typeof window<"u"}const US=(t,e,n,r,i)=>{const{notify:s}=i||{};let a=t.get(n);a||(a=[],t.set(n,a)),a.push(r),s&&e.has(n)&&r(e.get(n))},HS=(t,e,n)=>(t.get(e)||[]).map(r=>r(n)),jS=(t,e,n)=>{const r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},kH=()=>{const t=new Map,e=new Map,n=new Map;return{on:(...i)=>US(t,e,...i),prioritizedOn:(...i)=>US(n,e,...i),emit:(i,s)=>{e.set(i,s),HS(n,i,s),HS(t,i,s)},off:(...i)=>jS(t,...i),prioritizedOff:(...i)=>jS(n,...i),internal:{retrieveListeners:i=>t.get(i)||[]}}},sm={Status:"status"},CH=()=>kH();typeof window<"u"&&!window.global&&(window.global=typeof global>"u"?window:global);dn(({clerk:t,children:e,...n})=>{const{signUpFallbackRedirectUrl:r,forceRedirectUrl:i,fallbackRedirectUrl:s,signUpForceRedirectUrl:a,mode:l,initialValues:u,withSignUp:d,oauthFlow:h,...p}=n;e=qu(e,"Sign in");const g=$u(e)("SignInButton"),b=()=>{const T={forceRedirectUrl:i,fallbackRedirectUrl:s,signUpFallbackRedirectUrl:r,signUpForceRedirectUrl:a,initialValues:u,withSignUp:d,oauthFlow:h};return l==="modal"?t.openSignIn({...T,appearance:n.appearance}):t.redirectToSignIn({...T,signInFallbackRedirectUrl:s,signInForceRedirectUrl:i})},E={...p,onClick:async T=>(g&&typeof g=="object"&&"props"in g&&await Vu(g.props.onClick)(T),b())};return le.cloneElement(g,E)},{component:"SignInButton",renderWhileLoading:!0});dn(({clerk:t,children:e,...n})=>{const{redirectUrl:r,...i}=n;e=qu(e,"Sign in with Metamask");const s=$u(e)("SignInWithMetamaskButton"),a=async()=>{async function d(){await t.authenticateWithMetamask({redirectUrl:r||void 0})}d()},u={...i,onClick:async d=>(await Vu(s.props.onClick)(d),a())};return le.cloneElement(s,u)},{component:"SignInWithMetamask",renderWhileLoading:!0});dn(({clerk:t,children:e,...n})=>{const{redirectUrl:r="/",signOutOptions:i,...s}=n;e=qu(e,"Sign out");const a=$u(e)("SignOutButton"),l=()=>t.signOut({redirectUrl:r,...i}),d={...s,onClick:async h=>(await Vu(a.props.onClick)(h),l())};return le.cloneElement(a,d)},{component:"SignOutButton",renderWhileLoading:!0});dn(({clerk:t,children:e,...n})=>{const{fallbackRedirectUrl:r,forceRedirectUrl:i,signInFallbackRedirectUrl:s,signInForceRedirectUrl:a,mode:l,initialValues:u,oauthFlow:d,...h}=n;e=qu(e,"Sign up");const p=$u(e)("SignUpButton"),g=()=>{const E={fallbackRedirectUrl:r,forceRedirectUrl:i,signInFallbackRedirectUrl:s,signInForceRedirectUrl:a,initialValues:u,oauthFlow:d};return l==="modal"?t.openSignUp({...E,appearance:n.appearance,unsafeMetadata:n.unsafeMetadata}):t.redirectToSignUp({...E,signUpFallbackRedirectUrl:r,signUpForceRedirectUrl:i})},y={...h,onClick:async E=>(p&&typeof p=="object"&&"props"in p&&await Vu(p.props.onClick)(E),g())};return le.cloneElement(p,y)},{component:"SignUpButton",renderWhileLoading:!0});var AH=()=>({fields:{identifier:null,password:null,code:null},raw:null,global:null}),NH=()=>({fields:{firstName:null,lastName:null,emailAddress:null,phoneNumber:null,password:null,username:null,code:null,captcha:null,legalAccepted:null},raw:null,global:null}),MH=class{constructor(t){this.isomorphicClerk=t,this.signInSignalProxy=this.buildSignInProxy(),this.signUpSignalProxy=this.buildSignUpProxy()}signInSignal(){return this.signInSignalProxy}signUpSignal(){return this.signUpSignalProxy}buildSignInProxy(){const t=this.gateProperty.bind(this),e=()=>this.client.signIn.__internal_future;return{errors:AH(),fetchStatus:"idle",signIn:{status:"needs_identifier",availableStrategies:[],isTransferable:!1,get id(){return t(e,"id",void 0)},get supportedFirstFactors(){return t(e,"supportedFirstFactors",[])},get supportedSecondFactors(){return t(e,"supportedSecondFactors",[])},get secondFactorVerification(){return t(e,"secondFactorVerification",{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw new Error("__internal_toSnapshot called before Clerk is loaded")},pathRoot:"",reload:()=>{throw new Error("__internal_toSnapshot called before Clerk is loaded")}})},get identifier(){return t(e,"identifier",null)},get createdSessionId(){return t(e,"createdSessionId",null)},get userData(){return t(e,"userData",{})},get firstFactorVerification(){return t(e,"firstFactorVerification",{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw new Error("__internal_toSnapshot called before Clerk is loaded")},pathRoot:"",reload:()=>{throw new Error("__internal_toSnapshot called before Clerk is loaded")}})},create:this.gateMethod(e,"create"),password:this.gateMethod(e,"password"),sso:this.gateMethod(e,"sso"),finalize:this.gateMethod(e,"finalize"),emailCode:this.wrapMethods(()=>e().emailCode,["sendCode","verifyCode"]),emailLink:this.wrapStruct(()=>e().emailLink,["sendLink","waitForVerification"],["verification"],{verification:null}),resetPasswordEmailCode:this.wrapMethods(()=>e().resetPasswordEmailCode,["sendCode","verifyCode","submitPassword"]),phoneCode:this.wrapMethods(()=>e().phoneCode,["sendCode","verifyCode"]),mfa:this.wrapMethods(()=>e().mfa,["sendPhoneCode","verifyPhoneCode","verifyTOTP","verifyBackupCode"]),ticket:this.gateMethod(e,"ticket"),passkey:this.gateMethod(e,"passkey"),web3:this.gateMethod(e,"web3")}}}buildSignUpProxy(){const t=this.gateProperty.bind(this),e=this.gateMethod.bind(this),n=this.wrapMethods.bind(this),r=()=>this.client.signUp.__internal_future;return{errors:NH(),fetchStatus:"idle",signUp:{get id(){return t(r,"id",void 0)},get requiredFields(){return t(r,"requiredFields",[])},get optionalFields(){return t(r,"optionalFields",[])},get missingFields(){return t(r,"missingFields",[])},get username(){return t(r,"username",null)},get firstName(){return t(r,"firstName",null)},get lastName(){return t(r,"lastName",null)},get emailAddress(){return t(r,"emailAddress",null)},get phoneNumber(){return t(r,"phoneNumber",null)},get web3Wallet(){return t(r,"web3Wallet",null)},get hasPassword(){return t(r,"hasPassword",!1)},get unsafeMetadata(){return t(r,"unsafeMetadata",{})},get createdSessionId(){return t(r,"createdSessionId",null)},get createdUserId(){return t(r,"createdUserId",null)},get abandonAt(){return t(r,"abandonAt",null)},get legalAcceptedAt(){return t(r,"legalAcceptedAt",null)},get locale(){return t(r,"locale",null)},get status(){return t(r,"status","missing_requirements")},get unverifiedFields(){return t(r,"unverifiedFields",[])},get isTransferable(){return t(r,"isTransferable",!1)},create:e(r,"create"),update:e(r,"update"),sso:e(r,"sso"),password:e(r,"password"),ticket:e(r,"ticket"),web3:e(r,"web3"),finalize:e(r,"finalize"),verifications:n(()=>r().verifications,["sendEmailCode","verifyEmailCode","sendPhoneCode","verifyPhoneCode"])}}}__internal_effect(t){throw new Error("__internal_effect called before Clerk is loaded")}__internal_computed(t){throw new Error("__internal_computed called before Clerk is loaded")}get client(){const t=this.isomorphicClerk.client;if(!t)throw new Error("Clerk client not ready");return t}gateProperty(t,e,n){return!gg()||!this.isomorphicClerk.loaded?n:t()[e]}gateMethod(t,e){return async(...n)=>{if(!gg())return Ks.throw(`Attempted to call a method (${e}) that is not supported on the server.`);this.isomorphicClerk.loaded||await new Promise(i=>this.isomorphicClerk.addOnLoaded(i));const r=t();return r[e].apply(r,n)}}wrapMethods(t,e){return Object.fromEntries(e.map(n=>[n,this.gateMethod(t,n)]))}wrapStruct(t,e,n,r){const i={};for(const s of e)i[s]=this.gateMethod(t,s);for(const s of n)Object.defineProperty(i,s,{get:()=>this.gateProperty(t,s,r[s]),enumerable:!0});return i}};typeof globalThis.__BUILD_DISABLE_RHC__>"u"&&(globalThis.__BUILD_DISABLE_RHC__=!1);var OH={name:"@clerk/clerk-react",version:"5.58.1",environment:"production"},Xm,Uc,Hc,al,oa,Qm,dl,tf,Zm,HA=class jA{constructor(e){sl(this,tf),this.clerkjs=null,this.preopenOneTap=null,this.preopenUserVerification=null,this.preopenEnableOrganizationsPrompt=null,this.preopenSignIn=null,this.preopenCheckout=null,this.preopenPlanDetails=null,this.preopenSubscriptionDetails=null,this.preopenSignUp=null,this.preopenUserProfile=null,this.preopenOrganizationProfile=null,this.preopenCreateOrganization=null,this.preOpenWaitlist=null,this.premountSignInNodes=new Map,this.premountSignUpNodes=new Map,this.premountUserAvatarNodes=new Map,this.premountUserProfileNodes=new Map,this.premountUserButtonNodes=new Map,this.premountOrganizationProfileNodes=new Map,this.premountCreateOrganizationNodes=new Map,this.premountOrganizationSwitcherNodes=new Map,this.premountOrganizationListNodes=new Map,this.premountMethodCalls=new Map,this.premountWaitlistNodes=new Map,this.premountPricingTableNodes=new Map,this.premountAPIKeysNodes=new Map,this.premountOAuthConsentNodes=new Map,this.premountTaskChooseOrganizationNodes=new Map,this.premountTaskResetPasswordNodes=new Map,this.premountAddListenerCalls=new Map,this.loadedListeners=[],sl(this,Xm,"loading"),sl(this,Uc),sl(this,Hc),sl(this,al),sl(this,oa,CH()),sl(this,Qm),this.buildSignInUrl=i=>{const s=()=>{var a;return((a=this.clerkjs)==null?void 0:a.buildSignInUrl(i))||""};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("buildSignInUrl",s)},this.buildSignUpUrl=i=>{const s=()=>{var a;return((a=this.clerkjs)==null?void 0:a.buildSignUpUrl(i))||""};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("buildSignUpUrl",s)},this.buildAfterSignInUrl=(...i)=>{const s=()=>{var a;return((a=this.clerkjs)==null?void 0:a.buildAfterSignInUrl(...i))||""};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("buildAfterSignInUrl",s)},this.buildAfterSignUpUrl=(...i)=>{const s=()=>{var a;return((a=this.clerkjs)==null?void 0:a.buildAfterSignUpUrl(...i))||""};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("buildAfterSignUpUrl",s)},this.buildAfterSignOutUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildAfterSignOutUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildAfterSignOutUrl",i)},this.buildNewSubscriptionRedirectUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildNewSubscriptionRedirectUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildNewSubscriptionRedirectUrl",i)},this.buildAfterMultiSessionSingleSignOutUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildAfterMultiSessionSingleSignOutUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildAfterMultiSessionSingleSignOutUrl",i)},this.buildUserProfileUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildUserProfileUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildUserProfileUrl",i)},this.buildCreateOrganizationUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildCreateOrganizationUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildCreateOrganizationUrl",i)},this.buildOrganizationProfileUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildOrganizationProfileUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildOrganizationProfileUrl",i)},this.buildWaitlistUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildWaitlistUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildWaitlistUrl",i)},this.buildTasksUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildTasksUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildTasksUrl",i)},this.buildUrlWithAuth=i=>{const s=()=>{var a;return((a=this.clerkjs)==null?void 0:a.buildUrlWithAuth(i))||""};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("buildUrlWithAuth",s)},this.handleUnauthenticated=async()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.handleUnauthenticated()};this.clerkjs&&this.loaded?i():this.premountMethodCalls.set("handleUnauthenticated",i)},this.on=(...i)=>{var s;if((s=this.clerkjs)!=null&&s.on)return this.clerkjs.on(...i);Dn(this,oa).on(...i)},this.off=(...i)=>{var s;if((s=this.clerkjs)!=null&&s.off)return this.clerkjs.off(...i);Dn(this,oa).off(...i)},this.addOnLoaded=i=>{this.loadedListeners.push(i),this.loaded&&this.emitLoaded()},this.emitLoaded=()=>{this.loadedListeners.forEach(i=>i()),this.loadedListeners=[]},this.beforeLoad=i=>{if(!i)throw new Error("Failed to hydrate latest Clerk JS")},this.hydrateClerkJS=i=>{var s,a;if(!i)throw new Error("Failed to hydrate latest Clerk JS");return this.clerkjs=i,this.premountMethodCalls.forEach(l=>l()),this.premountAddListenerCalls.forEach((l,u)=>{l.nativeUnsubscribe=i.addListener(u)}),(s=Dn(this,oa).internal.retrieveListeners("status"))==null||s.forEach(l=>{this.on("status",l,{notify:!0})}),(a=Dn(this,oa).internal.retrieveListeners("queryClientStatus"))==null||a.forEach(l=>{this.on("queryClientStatus",l,{notify:!0})}),this.preopenSignIn!==null&&i.openSignIn(this.preopenSignIn),this.preopenCheckout!==null&&i.__internal_openCheckout(this.preopenCheckout),this.preopenPlanDetails!==null&&i.__internal_openPlanDetails(this.preopenPlanDetails),this.preopenSubscriptionDetails!==null&&i.__internal_openSubscriptionDetails(this.preopenSubscriptionDetails),this.preopenSignUp!==null&&i.openSignUp(this.preopenSignUp),this.preopenUserProfile!==null&&i.openUserProfile(this.preopenUserProfile),this.preopenUserVerification!==null&&i.__internal_openReverification(this.preopenUserVerification),this.preopenOneTap!==null&&i.openGoogleOneTap(this.preopenOneTap),this.preopenOrganizationProfile!==null&&i.openOrganizationProfile(this.preopenOrganizationProfile),this.preopenCreateOrganization!==null&&i.openCreateOrganization(this.preopenCreateOrganization),this.preOpenWaitlist!==null&&i.openWaitlist(this.preOpenWaitlist),this.preopenEnableOrganizationsPrompt&&i.__internal_openEnableOrganizationsPrompt(this.preopenEnableOrganizationsPrompt),this.premountSignInNodes.forEach((l,u)=>{i.mountSignIn(u,l)}),this.premountSignUpNodes.forEach((l,u)=>{i.mountSignUp(u,l)}),this.premountUserProfileNodes.forEach((l,u)=>{i.mountUserProfile(u,l)}),this.premountUserAvatarNodes.forEach((l,u)=>{i.mountUserAvatar(u,l)}),this.premountUserButtonNodes.forEach((l,u)=>{i.mountUserButton(u,l)}),this.premountOrganizationListNodes.forEach((l,u)=>{i.mountOrganizationList(u,l)}),this.premountWaitlistNodes.forEach((l,u)=>{i.mountWaitlist(u,l)}),this.premountPricingTableNodes.forEach((l,u)=>{i.mountPricingTable(u,l)}),this.premountAPIKeysNodes.forEach((l,u)=>{i.mountAPIKeys(u,l)}),this.premountOAuthConsentNodes.forEach((l,u)=>{i.__internal_mountOAuthConsent(u,l)}),this.premountTaskChooseOrganizationNodes.forEach((l,u)=>{i.mountTaskChooseOrganization(u,l)}),this.premountTaskResetPasswordNodes.forEach((l,u)=>{i.mountTaskResetPassword(u,l)}),typeof this.clerkjs.status>"u"&&Dn(this,oa).emit(sm.Status,"ready"),this.emitLoaded(),this.clerkjs},this.__experimental_checkout=(...i)=>{var s;return(s=this.clerkjs)==null?void 0:s.__experimental_checkout(...i)},this.__unstable__updateProps=async i=>{const s=await Xy(this,tf,Zm).call(this);if(s&&"__unstable__updateProps"in s)return s.__unstable__updateProps(i)},this.setActive=i=>this.clerkjs?this.clerkjs.setActive(i):Promise.reject(),this.openSignIn=i=>{this.clerkjs&&this.loaded?this.clerkjs.openSignIn(i):this.preopenSignIn=i},this.closeSignIn=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignIn():this.preopenSignIn=null},this.__internal_openCheckout=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openCheckout(i):this.preopenCheckout=i},this.__internal_closeCheckout=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeCheckout():this.preopenCheckout=null},this.__internal_openPlanDetails=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openPlanDetails(i):this.preopenPlanDetails=i},this.__internal_closePlanDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closePlanDetails():this.preopenPlanDetails=null},this.__internal_openSubscriptionDetails=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openSubscriptionDetails(i):this.preopenSubscriptionDetails=i??null},this.__internal_closeSubscriptionDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeSubscriptionDetails():this.preopenSubscriptionDetails=null},this.__internal_openReverification=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openReverification(i):this.preopenUserVerification=i},this.__internal_closeReverification=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeReverification():this.preopenUserVerification=null},this.__internal_openEnableOrganizationsPrompt=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openEnableOrganizationsPrompt(i):this.preopenEnableOrganizationsPrompt=i},this.__internal_closeEnableOrganizationsPrompt=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeEnableOrganizationsPrompt():this.preopenEnableOrganizationsPrompt=null},this.openGoogleOneTap=i=>{this.clerkjs&&this.loaded?this.clerkjs.openGoogleOneTap(i):this.preopenOneTap=i},this.closeGoogleOneTap=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeGoogleOneTap():this.preopenOneTap=null},this.openUserProfile=i=>{this.clerkjs&&this.loaded?this.clerkjs.openUserProfile(i):this.preopenUserProfile=i},this.closeUserProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeUserProfile():this.preopenUserProfile=null},this.openOrganizationProfile=i=>{this.clerkjs&&this.loaded?this.clerkjs.openOrganizationProfile(i):this.preopenOrganizationProfile=i},this.closeOrganizationProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeOrganizationProfile():this.preopenOrganizationProfile=null},this.openCreateOrganization=i=>{this.clerkjs&&this.loaded?this.clerkjs.openCreateOrganization(i):this.preopenCreateOrganization=i},this.closeCreateOrganization=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeCreateOrganization():this.preopenCreateOrganization=null},this.openWaitlist=i=>{this.clerkjs&&this.loaded?this.clerkjs.openWaitlist(i):this.preOpenWaitlist=i},this.closeWaitlist=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeWaitlist():this.preOpenWaitlist=null},this.openSignUp=i=>{this.clerkjs&&this.loaded?this.clerkjs.openSignUp(i):this.preopenSignUp=i},this.closeSignUp=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignUp():this.preopenSignUp=null},this.mountSignIn=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignIn(i,s):this.premountSignInNodes.set(i,s)},this.unmountSignIn=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignIn(i):this.premountSignInNodes.delete(i)},this.mountSignUp=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignUp(i,s):this.premountSignUpNodes.set(i,s)},this.unmountSignUp=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignUp(i):this.premountSignUpNodes.delete(i)},this.mountUserAvatar=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserAvatar(i,s):this.premountUserAvatarNodes.set(i,s)},this.unmountUserAvatar=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserAvatar(i):this.premountUserAvatarNodes.delete(i)},this.mountUserProfile=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserProfile(i,s):this.premountUserProfileNodes.set(i,s)},this.unmountUserProfile=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserProfile(i):this.premountUserProfileNodes.delete(i)},this.mountOrganizationProfile=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationProfile(i,s):this.premountOrganizationProfileNodes.set(i,s)},this.unmountOrganizationProfile=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationProfile(i):this.premountOrganizationProfileNodes.delete(i)},this.mountCreateOrganization=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountCreateOrganization(i,s):this.premountCreateOrganizationNodes.set(i,s)},this.unmountCreateOrganization=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountCreateOrganization(i):this.premountCreateOrganizationNodes.delete(i)},this.mountOrganizationSwitcher=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationSwitcher(i,s):this.premountOrganizationSwitcherNodes.set(i,s)},this.unmountOrganizationSwitcher=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationSwitcher(i):this.premountOrganizationSwitcherNodes.delete(i)},this.__experimental_prefetchOrganizationSwitcher=()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.__experimental_prefetchOrganizationSwitcher()};this.clerkjs&&this.loaded?i():this.premountMethodCalls.set("__experimental_prefetchOrganizationSwitcher",i)},this.mountOrganizationList=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationList(i,s):this.premountOrganizationListNodes.set(i,s)},this.unmountOrganizationList=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationList(i):this.premountOrganizationListNodes.delete(i)},this.mountUserButton=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserButton(i,s):this.premountUserButtonNodes.set(i,s)},this.unmountUserButton=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserButton(i):this.premountUserButtonNodes.delete(i)},this.mountWaitlist=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountWaitlist(i,s):this.premountWaitlistNodes.set(i,s)},this.unmountWaitlist=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountWaitlist(i):this.premountWaitlistNodes.delete(i)},this.mountPricingTable=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountPricingTable(i,s):this.premountPricingTableNodes.set(i,s)},this.unmountPricingTable=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountPricingTable(i):this.premountPricingTableNodes.delete(i)},this.mountAPIKeys=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountAPIKeys(i,s):this.premountAPIKeysNodes.set(i,s)},this.unmountAPIKeys=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountAPIKeys(i):this.premountAPIKeysNodes.delete(i)},this.__internal_mountOAuthConsent=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_mountOAuthConsent(i,s):this.premountOAuthConsentNodes.set(i,s)},this.__internal_unmountOAuthConsent=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_unmountOAuthConsent(i):this.premountOAuthConsentNodes.delete(i)},this.mountTaskChooseOrganization=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskChooseOrganization(i,s):this.premountTaskChooseOrganizationNodes.set(i,s)},this.unmountTaskChooseOrganization=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskChooseOrganization(i):this.premountTaskChooseOrganizationNodes.delete(i)},this.mountTaskResetPassword=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskResetPassword(i,s):this.premountTaskResetPasswordNodes.set(i,s)},this.unmountTaskResetPassword=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskResetPassword(i):this.premountTaskResetPasswordNodes.delete(i)},this.addListener=i=>{if(this.clerkjs)return this.clerkjs.addListener(i);{const s=()=>{var a;const l=this.premountAddListenerCalls.get(i);l&&((a=l.nativeUnsubscribe)==null||a.call(l),this.premountAddListenerCalls.delete(i))};return this.premountAddListenerCalls.set(i,{unsubscribe:s,nativeUnsubscribe:void 0}),s}},this.navigate=i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.navigate(i)};this.clerkjs&&this.loaded?s():this.premountMethodCalls.set("navigate",s)},this.redirectWithAuth=async(...i)=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.redirectWithAuth(...i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("redirectWithAuth",s)},this.redirectToSignIn=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.redirectToSignIn(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("redirectToSignIn",s)},this.redirectToSignUp=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.redirectToSignUp(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("redirectToSignUp",s)},this.redirectToUserProfile=async()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToUserProfile()};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("redirectToUserProfile",i)},this.redirectToAfterSignUp=()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToAfterSignUp()};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("redirectToAfterSignUp",i)},this.redirectToAfterSignIn=()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToAfterSignIn()};this.clerkjs&&this.loaded?i():this.premountMethodCalls.set("redirectToAfterSignIn",i)},this.redirectToAfterSignOut=()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToAfterSignOut()};this.clerkjs&&this.loaded?i():this.premountMethodCalls.set("redirectToAfterSignOut",i)},this.redirectToOrganizationProfile=async()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToOrganizationProfile()};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("redirectToOrganizationProfile",i)},this.redirectToCreateOrganization=async()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToCreateOrganization()};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("redirectToCreateOrganization",i)},this.redirectToWaitlist=async()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToWaitlist()};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("redirectToWaitlist",i)},this.redirectToTasks=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.redirectToTasks(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("redirectToTasks",s)},this.handleRedirectCallback=async i=>{var s;const a=()=>{var l;return(l=this.clerkjs)==null?void 0:l.handleRedirectCallback(i)};this.clerkjs&&this.loaded?(s=a())==null||s.catch(()=>{}):this.premountMethodCalls.set("handleRedirectCallback",a)},this.handleGoogleOneTapCallback=async(i,s)=>{var a;const l=()=>{var u;return(u=this.clerkjs)==null?void 0:u.handleGoogleOneTapCallback(i,s)};this.clerkjs&&this.loaded?(a=l())==null||a.catch(()=>{}):this.premountMethodCalls.set("handleGoogleOneTapCallback",l)},this.handleEmailLinkVerification=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.handleEmailLinkVerification(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("handleEmailLinkVerification",s)},this.authenticateWithMetamask=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithMetamask(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithMetamask",s)},this.authenticateWithCoinbaseWallet=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithCoinbaseWallet(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithCoinbaseWallet",s)},this.authenticateWithBase=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithBase(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithBase",s)},this.authenticateWithOKXWallet=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithOKXWallet(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithOKXWallet",s)},this.authenticateWithWeb3=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithWeb3(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithWeb3",s)},this.authenticateWithGoogleOneTap=async i=>(await Xy(this,tf,Zm).call(this)).authenticateWithGoogleOneTap(i),this.__internal_loadStripeJs=async()=>(await Xy(this,tf,Zm).call(this)).__internal_loadStripeJs(),this.createOrganization=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.createOrganization(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("createOrganization",s)},this.getOrganization=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.getOrganization(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("getOrganization",s)},this.joinWaitlist=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.joinWaitlist(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("joinWaitlist",s)},this.signOut=async(...i)=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.signOut(...i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("signOut",s)},this.__internal_attemptToEnableEnvironmentSetting=i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.__internal_attemptToEnableEnvironmentSetting(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("__internal_attemptToEnableEnvironmentSetting",s)};const{Clerk:n=null,publishableKey:r}=e||{};du(this,al,r),du(this,Hc,e==null?void 0:e.proxyUrl),du(this,Uc,e==null?void 0:e.domain),this.options=e,this.Clerk=n,this.mode=gg()?"browser":"server",du(this,Qm,new MH(this)),this.options.sdkMetadata||(this.options.sdkMetadata=OH),Dn(this,oa).emit(sm.Status,"loading"),Dn(this,oa).prioritizedOn(sm.Status,i=>du(this,Xm,i)),Dn(this,al)&&this.loadClerkJS()}get publishableKey(){return Dn(this,al)}get loaded(){var e;return((e=this.clerkjs)==null?void 0:e.loaded)||!1}get status(){var e;return this.clerkjs?((e=this.clerkjs)==null?void 0:e.status)||(this.clerkjs.loaded?"ready":"loading"):Dn(this,Xm)}static getOrCreateInstance(e){return(!gg()||!Dn(this,dl)||e.Clerk&&Dn(this,dl).Clerk!==e.Clerk||Dn(this,dl).publishableKey!==e.publishableKey)&&du(this,dl,new jA(e)),Dn(this,dl)}static clearInstance(){du(this,dl,null)}get domain(){return typeof window<"u"&&window.location?Vy(Dn(this,Uc),new URL(window.location.href),""):typeof Dn(this,Uc)=="function"?Ks.throw(qy):Dn(this,Uc)||""}get proxyUrl(){return typeof window<"u"&&window.location?Vy(Dn(this,Hc),new URL(window.location.href),""):typeof Dn(this,Hc)=="function"?Ks.throw(qy):Dn(this,Hc)||""}__internal_getOption(e){var n,r;return(n=this.clerkjs)!=null&&n.__internal_getOption?(r=this.clerkjs)==null?void 0:r.__internal_getOption(e):this.options[e]}get sdkMetadata(){var e;return((e=this.clerkjs)==null?void 0:e.sdkMetadata)||this.options.sdkMetadata||void 0}get instanceType(){var e;return(e=this.clerkjs)==null?void 0:e.instanceType}get frontendApi(){var e;return((e=this.clerkjs)==null?void 0:e.frontendApi)||""}get isStandardBrowser(){var e;return((e=this.clerkjs)==null?void 0:e.isStandardBrowser)||this.options.standardBrowser||!1}get __internal_queryClient(){var e;return(e=this.clerkjs)==null?void 0:e.__internal_queryClient}get isSatellite(){return typeof window<"u"&&window.location?Vy(this.options.isSatellite,new URL(window.location.href),!1):typeof this.options.isSatellite=="function"?Ks.throw(qy):!1}async loadClerkJS(){var e;if(!(this.mode!=="browser"||this.loaded)){typeof window<"u"&&(window.__clerk_publishable_key=Dn(this,al),window.__clerk_proxy_url=this.proxyUrl,window.__clerk_domain=this.domain);try{if(this.Clerk){let n;zU(this.Clerk)?(n=new this.Clerk(Dn(this,al),{proxyUrl:this.proxyUrl,domain:this.domain}),this.beforeLoad(n),await n.load(this.options)):(n=this.Clerk,n.loaded||(this.beforeLoad(n),await n.load(this.options))),global.Clerk=n}else if(!__BUILD_DISABLE_RHC__){if(global.Clerk||await yH({...this.options,publishableKey:Dn(this,al),proxyUrl:this.proxyUrl,domain:this.domain,nonce:this.options.nonce}),!global.Clerk)throw new Error("Failed to download latest ClerkJS. Contact support@clerk.com.");this.beforeLoad(global.Clerk),await global.Clerk.load(this.options)}return(e=global.Clerk)!=null&&e.loaded?this.hydrateClerkJS(global.Clerk):void 0}catch(n){const r=n;Dn(this,oa).emit(sm.Status,"error"),console.error(r.stack||r.message||r);return}}}get version(){var e;return(e=this.clerkjs)==null?void 0:e.version}get client(){if(this.clerkjs)return this.clerkjs.client}get session(){if(this.clerkjs)return this.clerkjs.session}get user(){if(this.clerkjs)return this.clerkjs.user}get organization(){if(this.clerkjs)return this.clerkjs.organization}get telemetry(){if(this.clerkjs)return this.clerkjs.telemetry}get __unstable__environment(){if(this.clerkjs)return this.clerkjs.__unstable__environment}get isSignedIn(){return this.clerkjs?this.clerkjs.isSignedIn:!1}get billing(){var e;return(e=this.clerkjs)==null?void 0:e.billing}get __internal_state(){return this.loaded&&this.clerkjs?this.clerkjs.__internal_state:Dn(this,Qm)}get apiKeys(){var e;return(e=this.clerkjs)==null?void 0:e.apiKeys}__unstable__setEnvironment(...e){if(this.clerkjs&&"__unstable__setEnvironment"in this.clerkjs)this.clerkjs.__unstable__setEnvironment(e);else return}};Xm=new WeakMap;Uc=new WeakMap;Hc=new WeakMap;al=new WeakMap;oa=new WeakMap;Qm=new WeakMap;dl=new WeakMap;tf=new WeakSet;Zm=function(){return new Promise(t=>{this.addOnLoaded(()=>t(this.clerkjs))})};sl(HA,dl);var $S=HA;function RH(t){const{isomorphicClerkOptions:e,initialState:n,children:r}=t,{isomorphicClerk:i,clerkStatus:s}=DH(e),[a,l]=le.useState({client:i.client,session:i.session,user:i.user,organization:i.organization});le.useEffect(()=>i.addListener(ie=>l({...ie})),[]);const u=TH(i.loaded,a,n),d=le.useMemo(()=>({value:i}),[s]),h=le.useMemo(()=>({value:a.client}),[a.client]),{sessionId:p,sessionStatus:g,sessionClaims:b,session:y,userId:E,user:T,orgId:S,actor:A,organization:R,orgRole:z,orgSlug:I,orgPermissions:P,factorVerificationAge:$}=u,K=le.useMemo(()=>({value:{sessionId:p,sessionStatus:g,sessionClaims:b,userId:E,actor:A,orgId:S,orgRole:z,orgSlug:I,orgPermissions:P,factorVerificationAge:$}}),[p,g,E,A,S,z,I,$,b==null?void 0:b.__raw]),Z=le.useMemo(()=>({value:y}),[p,y]),W=le.useMemo(()=>({value:T}),[E,T]),re=le.useMemo(()=>({value:{organization:R}}),[S,R]);return le.createElement(dU.Provider,{value:d},le.createElement($F.Provider,{value:h},le.createElement(qF.Provider,{value:Z},le.createElement(KF,{...re.value},le.createElement(uU.Provider,{value:K},le.createElement(jF.Provider,{value:W},le.createElement(GF,{value:void 0},r)))))))}var DH=t=>{const e=le.useRef($S.getOrCreateInstance(t)),[n,r]=le.useState(e.current.status);return le.useEffect(()=>{e.current.__unstable__updateProps({appearance:t.appearance})},[t.appearance]),le.useEffect(()=>{e.current.__unstable__updateProps({options:t})},[t.localization]),le.useEffect(()=>(e.current.on("status",r),()=>{e.current&&e.current.off("status",r),$S.clearInstance()}),[]),{isomorphicClerk:e.current,clerkStatus:n}};function IH(t){const{initialState:e,children:n,__internal_bypassMissingPublishableKey:r,...i}=t,{publishableKey:s="",Clerk:a}=i;return!a&&!r&&(s?s&&!LE(s)&&Ks.throwInvalidPublishableKeyError({key:s}):Ks.throwMissingPublishableKeyError()),le.createElement(RH,{initialState:e,isomorphicClerkOptions:i},n)}var $A=UU(IH,"ClerkProvider",fU);$A.displayName="ClerkProvider";lU({packageName:"@clerk/clerk-react"});bH("@clerk/clerk-react");function qS(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&e.push(a),i=r+1,r=n.indexOf(",",i)}return e}function qA(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const LH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,BH={};function VS(t,e){return(BH.jsx?PH:LH).test(t)}const zH=/[ \t\n\f\r]/g;function FH(t){return typeof t=="object"?t.type==="text"?GS(t.value):!1:GS(t)}function GS(t){return t.replace(zH,"")===""}let Th=class{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}};Th.prototype.normal={};Th.prototype.property={};Th.prototype.space=void 0;function VA(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Th(n,r,e)}function Gf(t){return t.toLowerCase()}let $i=class{constructor(e,n){this.attribute=n,this.property=e}};$i.prototype.attribute="";$i.prototype.booleanish=!1;$i.prototype.boolean=!1;$i.prototype.commaOrSpaceSeparated=!1;$i.prototype.commaSeparated=!1;$i.prototype.defined=!1;$i.prototype.mustUseProperty=!1;$i.prototype.number=!1;$i.prototype.overloadedBoolean=!1;$i.prototype.property="";$i.prototype.spaceSeparated=!1;$i.prototype.space=void 0;let UH=0;const Ot=Gu(),vr=Gu(),GE=Gu(),Le=Gu(),kn=Gu(),Jc=Gu(),ts=Gu();function Gu(){return 2**++UH}const YE=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ot,booleanish:vr,commaOrSpaceSeparated:ts,commaSeparated:Jc,number:Le,overloadedBoolean:GE,spaceSeparated:kn},Symbol.toStringTag,{value:"Module"})),Qy=Object.keys(YE);let F3=class extends $i{constructor(e,n,r,i){let s=-1;if(super(e,n),YS(this,"space",i),typeof r=="number")for(;++s<Qy.length;){const a=Qy[s];YS(this,Qy[s],(r&YE[a])===YE[a])}}};F3.prototype.defined=!0;function YS(t,e,n){n&&(t[e]=n)}function Sd(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new F3(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[Gf(r)]=r,n[Gf(s.attribute)]=r}return new Th(e,n,t.space)}const GA=Sd({properties:{ariaActiveDescendant:null,ariaAtomic:vr,ariaAutoComplete:null,ariaBusy:vr,ariaChecked:vr,ariaColCount:Le,ariaColIndex:Le,ariaColSpan:Le,ariaControls:kn,ariaCurrent:null,ariaDescribedBy:kn,ariaDetails:null,ariaDisabled:vr,ariaDropEffect:kn,ariaErrorMessage:null,ariaExpanded:vr,ariaFlowTo:kn,ariaGrabbed:vr,ariaHasPopup:null,ariaHidden:vr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kn,ariaLevel:Le,ariaLive:null,ariaModal:vr,ariaMultiLine:vr,ariaMultiSelectable:vr,ariaOrientation:null,ariaOwns:kn,ariaPlaceholder:null,ariaPosInSet:Le,ariaPressed:vr,ariaReadOnly:vr,ariaRelevant:null,ariaRequired:vr,ariaRoleDescription:kn,ariaRowCount:Le,ariaRowIndex:Le,ariaRowSpan:Le,ariaSelected:vr,ariaSetSize:Le,ariaSort:null,ariaValueMax:Le,ariaValueMin:Le,ariaValueNow:Le,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function YA(t,e){return e in t?t[e]:e}function WA(t,e){return YA(t,e.toLowerCase())}const HH=Sd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jc,acceptCharset:kn,accessKey:kn,action:null,allow:null,allowFullScreen:Ot,allowPaymentRequest:Ot,allowUserMedia:Ot,alt:null,as:null,async:Ot,autoCapitalize:null,autoComplete:kn,autoFocus:Ot,autoPlay:Ot,blocking:kn,capture:null,charSet:null,checked:Ot,cite:null,className:kn,cols:Le,colSpan:null,content:null,contentEditable:vr,controls:Ot,controlsList:kn,coords:Le|Jc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ot,defer:Ot,dir:null,dirName:null,disabled:Ot,download:GE,draggable:vr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ot,formTarget:null,headers:kn,height:Le,hidden:GE,high:Le,href:null,hrefLang:null,htmlFor:kn,httpEquiv:kn,id:null,imageSizes:null,imageSrcSet:null,inert:Ot,inputMode:null,integrity:null,is:null,isMap:Ot,itemId:null,itemProp:kn,itemRef:kn,itemScope:Ot,itemType:kn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ot,low:Le,manifest:null,max:null,maxLength:Le,media:null,method:null,min:null,minLength:Le,multiple:Ot,muted:Ot,name:null,nonce:null,noModule:Ot,noValidate:Ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ot,optimum:Le,pattern:null,ping:kn,placeholder:null,playsInline:Ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ot,referrerPolicy:null,rel:kn,required:Ot,reversed:Ot,rows:Le,rowSpan:Le,sandbox:kn,scope:null,scoped:Ot,seamless:Ot,selected:Ot,shadowRootClonable:Ot,shadowRootDelegatesFocus:Ot,shadowRootMode:null,shape:null,size:Le,sizes:null,slot:null,span:Le,spellCheck:vr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Le,step:null,style:null,tabIndex:Le,target:null,title:null,translate:null,type:null,typeMustMatch:Ot,useMap:null,value:vr,width:Le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kn,axis:null,background:null,bgColor:null,border:Le,borderColor:null,bottomMargin:Le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ot,declare:Ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Le,leftMargin:Le,link:null,longDesc:null,lowSrc:null,marginHeight:Le,marginWidth:Le,noResize:Ot,noHref:Ot,noShade:Ot,noWrap:Ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Le,rules:null,scheme:null,scrolling:vr,standby:null,summary:null,text:null,topMargin:Le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Le,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ot,disableRemotePlayback:Ot,prefix:null,property:null,results:Le,security:null,unselectable:null},space:"html",transform:WA}),jH=Sd({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ts,accentHeight:Le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Le,amplitude:Le,arabicForm:null,ascent:Le,attributeName:null,attributeType:null,azimuth:Le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Le,by:null,calcMode:null,capHeight:Le,className:kn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Le,diffuseConstant:Le,direction:null,display:null,dur:null,divisor:Le,dominantBaseline:null,download:Ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Le,enableBackground:null,end:null,event:null,exponent:Le,externalResourcesRequired:null,fill:null,fillOpacity:Le,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jc,g2:Jc,glyphName:Jc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Le,horizOriginX:Le,horizOriginY:Le,id:null,ideographic:Le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Le,k:Le,k1:Le,k2:Le,k3:Le,k4:Le,kernelMatrix:ts,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Le,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Le,overlineThickness:Le,paintOrder:null,panose1:null,path:null,pathLength:Le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Le,pointsAtY:Le,pointsAtZ:Le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ts,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ts,rev:ts,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ts,requiredFeatures:ts,requiredFonts:ts,requiredFormats:ts,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Le,specularExponent:Le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Le,strikethroughThickness:Le,string:null,stroke:null,strokeDashArray:ts,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Le,strokeOpacity:Le,strokeWidth:null,style:null,surfaceScale:Le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ts,tabIndex:Le,tableValues:null,target:null,targetX:Le,targetY:Le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ts,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Le,underlineThickness:Le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Le,values:null,vAlphabetic:Le,vMathematical:Le,vectorEffect:null,vHanging:Le,vIdeographic:Le,version:null,vertAdvY:Le,vertOriginX:Le,vertOriginY:Le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:YA}),KA=Sd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),XA=Sd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:WA}),QA=Sd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),$H={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},qH=/[A-Z]/g,WS=/-[a-z]/g,VH=/^data[-\w.:]+$/i;function U3(t,e){const n=Gf(e);let r=e,i=$i;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&VH.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(WS,YH);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!WS.test(s)){let a=s.replace(qH,GH);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=F3}return new i(r,e)}function GH(t){return"-"+t.toLowerCase()}function YH(t){return t.charAt(1).toUpperCase()}const G1=VA([GA,HH,KA,XA,QA],"html"),wd=VA([GA,jH,KA,XA,QA],"svg");function KS(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function ZA(t){return t.join(" ").trim()}var Rc={},Zy,XS;function WH(){if(XS)return Zy;XS=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
`,d="/",h="*",p="",g="comment",b="declaration";Zy=function(E,T){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];T=T||{};var S=1,A=1;function R(ye){var ae=ye.match(e);ae&&(S+=ae.length);var de=ye.lastIndexOf(u);A=~de?ye.length-de:A+ye.length}function z(){var ye={line:S,column:A};return function(ae){return ae.position=new I(ye),K(),ae}}function I(ye){this.start=ye,this.end={line:S,column:A},this.source=T.source}I.prototype.content=E;function P(ye){var ae=new Error(T.source+":"+S+":"+A+": "+ye);if(ae.reason=ye,ae.filename=T.source,ae.line=S,ae.column=A,ae.source=E,!T.silent)throw ae}function $(ye){var ae=ye.exec(E);if(ae){var de=ae[0];return R(de),E=E.slice(de.length),ae}}function K(){$(n)}function Z(ye){var ae;for(ye=ye||[];ae=W();)ae!==!1&&ye.push(ae);return ye}function W(){var ye=z();if(!(d!=E.charAt(0)||h!=E.charAt(1))){for(var ae=2;p!=E.charAt(ae)&&(h!=E.charAt(ae)||d!=E.charAt(ae+1));)++ae;if(ae+=2,p===E.charAt(ae-1))return P("End of comment missing");var de=E.slice(2,ae-2);return A+=2,R(de),E=E.slice(ae),A+=2,ye({type:g,comment:de})}}function re(){var ye=z(),ae=$(r);if(ae){if(W(),!$(i))return P("property missing ':'");var de=$(s),J=ye({type:b,property:y(ae[0].replace(t,p)),value:de?y(de[0].replace(t,p)):p});return $(a),J}}function ie(){var ye=[];Z(ye);for(var ae;ae=re();)ae!==!1&&(ye.push(ae),Z(ye));return ye}return K(),ie()};function y(E){return E?E.replace(l,p):p}return Zy}var QS;function KH(){if(QS)return Rc;QS=1;var t=Rc&&Rc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.default=n;var e=t(WH());function n(r,i){var s=null;if(!r||typeof r!="string")return s;var a=(0,e.default)(r),l=typeof i=="function";return a.forEach(function(u){if(u.type==="declaration"){var d=u.property,h=u.value;l?i(d,h,u):h&&(s=s||{},s[d]=h)}}),s}return Rc}var P0={},ZS;function XH(){if(ZS)return P0;ZS=1,Object.defineProperty(P0,"__esModule",{value:!0}),P0.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(d){return!d||n.test(d)||t.test(d)},a=function(d,h){return h.toUpperCase()},l=function(d,h){return"".concat(h,"-")},u=function(d,h){return h===void 0&&(h={}),s(d)?d:(d=d.toLowerCase(),h.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(e,a))};return P0.camelCase=u,P0}var B0,JS;function QH(){if(JS)return B0;JS=1;var t=B0&&B0.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(KH()),n=XH();function r(i,s){var a={};return!i||typeof i!="string"||(0,e.default)(i,function(l,u){l&&u&&(a[(0,n.camelCase)(l,s)]=u)}),a}return r.default=r,B0=r,B0}var ZH=QH();const JH=mh(ZH),Y1=JA("end"),wa=JA("start");function JA(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ej(t){const e=wa(t),n=Y1(t);if(e&&n)return{start:e,end:n}}function yf(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?ew(t.position):"start"in t||"end"in t?ew(t):"line"in t||"column"in t?WE(t):""}function WE(t){return tw(t&&t.line)+":"+tw(t&&t.column)}function ew(t){return WE(t&&t.start)+"-"+WE(t&&t.end)}function tw(t){return t&&typeof t=="number"?t:1}class di extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(a=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const l=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=l?l.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=l?l.line:void 0,this.name=yf(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=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}di.prototype.file="";di.prototype.name="";di.prototype.reason="";di.prototype.message="";di.prototype.stack="";di.prototype.column=void 0;di.prototype.line=void 0;di.prototype.ancestors=void 0;di.prototype.cause=void 0;di.prototype.fatal=void 0;di.prototype.place=void 0;di.prototype.ruleId=void 0;di.prototype.source=void 0;const H3={}.hasOwnProperty,tj=new Map,nj=/[A-Z]/g,rj=new Set(["table","tbody","thead","tfoot","tr"]),ij=new Set(["td","th"]),e9="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sj(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=hj(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=fj(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?wd:G1,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=t9(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function t9(t,e,n){if(e.type==="element")return aj(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return oj(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return uj(t,e,n);if(e.type==="mdxjsEsm")return lj(t,e);if(e.type==="root")return cj(t,e,n);if(e.type==="text")return dj(t,e)}function aj(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=wd,t.schema=i),t.ancestors.push(e);const s=r9(t,e.tagName,!1),a=pj(t,e);let l=$3(t,e);return rj.has(e.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!FH(u):!0})),n9(t,a,s,e),j3(a,l),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function oj(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Yf(t,e.position)}function lj(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Yf(t,e.position)}function uj(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=wd,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:r9(t,e.name,!0),a=mj(t,e),l=$3(t,e);return n9(t,a,s,e),j3(a,l),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function cj(t,e,n){const r={};return j3(r,$3(t,e)),t.create(e,t.Fragment,r,n)}function dj(t,e){return e.value}function n9(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function j3(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function fj(t,e,n){return r;function r(i,s,a,l){const d=Array.isArray(a.children)?n:e;return l?d(s,a,l):d(s,a)}}function hj(t,e){return n;function n(r,i,s,a){const l=Array.isArray(s.children),u=wa(r);return e(i,s,a,l,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function pj(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&H3.call(e.properties,i)){const s=gj(t,i,e.properties[i]);if(s){const[a,l]=s;t.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&ij.has(e.tagName)?r=l:n[a]=l}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function mj(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,t.evaluater.evaluateExpression(l.argument))}else Yf(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const l=r.value.data.estree.body[0];l.type,s=t.evaluater.evaluateExpression(l.expression)}else Yf(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function $3(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:tj;for(;++r<e.children.length;){const s=e.children[r];let a;if(t.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const d=i.get(u)||0;a=u+"-"+d,i.set(u,d+1)}}const l=t9(t,s,a);l!==void 0&&n.push(l)}return n}function gj(t,e,n){const r=U3(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qA(n):ZA(n)),r.property==="style"){let i=typeof n=="object"?n:bj(t,String(n));return t.stylePropertyNameCase==="css"&&(i=vj(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?$H[r.property]||r.property:r.attribute,n]}}function bj(t,e){try{return JH(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new di("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=e9+"#cannot-parse-style-attribute",i}}function r9(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,a;for(;++s<i.length;){const l=VS(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=a}else r=VS(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return H3.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);Yf(t)}function Yf(t,e){const n=new di("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=e9+"#cannot-handle-mdx-estrees-without-createevaluater",n}function vj(t){const e={};let n;for(n in t)H3.call(t,n)&&(e[yj(n)]=t[n]);return e}function yj(t){let e=t.replace(nj,Ej);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Ej(t){return"-"+t.toLowerCase()}const Jy={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},_j={};function q3(t,e){const n=_j,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return i9(t,r,i)}function i9(t,e,n){if(xj(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return nw(t.children,e,n)}return Array.isArray(t)?nw(t,e,n):""}function nw(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=i9(t[i],e,n);return r.join("")}function xj(t){return!!(t&&typeof t=="object")}const rw=document.createElement("i");function V3(t){const e="&"+t+";";rw.innerHTML=e;const n=rw.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function ls(t,e,n,r){const i=t.length;let s=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function ws(t,e){return t.length>0?(ls(t,t.length,0,e),t):e}const iw={}.hasOwnProperty;function s9(t){const e={};let n=-1;for(;++n<t.length;)Tj(e,t[n]);return e}function Tj(t,e){let n;for(n in e){const i=(iw.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){iw.call(i,a)||(i[a]=[]);const l=s[a];Sj(i[a],Array.isArray(l)?l:l?[l]:[])}}}function Sj(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);ls(t,0,0,r)}function a9(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Xs(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xi=Pl(/[A-Za-z]/),ci=Pl(/[\dA-Za-z]/),wj=Pl(/[#-'*+\--9=?A-Z^-~]/);function bg(t){return t!==null&&(t<32||t===127)}const KE=Pl(/\d/),kj=Pl(/[\dA-Fa-f]/),Cj=Pl(/[!-/:-@[-`{-~]/);function it(t){return t!==null&&t<-2}function _n(t){return t!==null&&(t<0||t===32)}function $t(t){return t===-2||t===-1||t===32}const W1=Pl(new RegExp("\\p{P}|\\p{S}","u")),Iu=Pl(/\s/);function Pl(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function kd(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&ci(t.charCodeAt(n+1))&&ci(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const l=t.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(a=String.fromCharCode(s,l),i=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function zt(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(u){return $t(u)?(t.enter(n),l(u)):e(u)}function l(u){return $t(u)&&s++<i?(t.consume(u),l):(t.exit(n),e(u))}}const Aj={tokenize:Nj};function Nj(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),zt(t,e,"linePrefix")}function i(l){return t.enter("paragraph"),s(l)}function s(l){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(l)}function a(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return it(l)?(t.consume(l),t.exit("chunkText"),s):(t.consume(l),a)}}const Mj={tokenize:Oj},sw={tokenize:Rj};function Oj(t){const e=this,n=[];let r=0,i,s,a;return l;function l(R){if(r<n.length){const z=n[r];return e.containerState=z[1],t.attempt(z[0].continuation,u,d)(R)}return d(R)}function u(R){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&A();const z=e.events.length;let I=z,P;for(;I--;)if(e.events[I][0]==="exit"&&e.events[I][1].type==="chunkFlow"){P=e.events[I][1].end;break}S(r);let $=z;for(;$<e.events.length;)e.events[$][1].end={...P},$++;return ls(e.events,I+1,0,e.events.slice(z)),e.events.length=$,d(R)}return l(R)}function d(R){if(r===n.length){if(!i)return g(R);if(i.currentConstruct&&i.currentConstruct.concrete)return y(R);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(sw,h,p)(R)}function h(R){return i&&A(),S(r),g(R)}function p(R){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,y(R)}function g(R){return e.containerState={},t.attempt(sw,b,y)(R)}function b(R){return r++,n.push([e.currentConstruct,e.containerState]),g(R)}function y(R){if(R===null){i&&A(),S(0),t.consume(R);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),E(R)}function E(R){if(R===null){T(t.exit("chunkFlow"),!0),S(0),t.consume(R);return}return it(R)?(t.consume(R),T(t.exit("chunkFlow")),r=0,e.interrupt=void 0,l):(t.consume(R),E)}function T(R,z){const I=e.sliceStream(R);if(z&&I.push(null),R.previous=s,s&&(s.next=R),s=R,i.defineSkip(R.start),i.write(I),e.parser.lazy[R.start.line]){let P=i.events.length;for(;P--;)if(i.events[P][1].start.offset<a&&(!i.events[P][1].end||i.events[P][1].end.offset>a))return;const $=e.events.length;let K=$,Z,W;for(;K--;)if(e.events[K][0]==="exit"&&e.events[K][1].type==="chunkFlow"){if(Z){W=e.events[K][1].end;break}Z=!0}for(S(r),P=$;P<e.events.length;)e.events[P][1].end={...W},P++;ls(e.events,K+1,0,e.events.slice($)),e.events.length=P}}function S(R){let z=n.length;for(;z-- >R;){const I=n[z];e.containerState=I[1],I[0].exit.call(e,t)}n.length=R}function A(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Rj(t,e,n){return zt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ad(t){if(t===null||_n(t)||Iu(t))return 1;if(W1(t))return 2}function K1(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const XE={name:"attention",resolveAll:Dj,tokenize:Ij};function Dj(t,e){let n=-1,r,i,s,a,l,u,d,h;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const p={...t[r][1].end},g={...t[n][1].start};aw(p,-u),aw(g,u),a={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...t[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},t[r][1].end={...a.start},t[n][1].start={...l.end},d=[],t[r][1].end.offset-t[r][1].start.offset&&(d=ws(d,[["enter",t[r][1],e],["exit",t[r][1],e]])),d=ws(d,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",s,e]]),d=ws(d,K1(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),d=ws(d,[["exit",s,e],["enter",l,e],["exit",l,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,d=ws(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,ls(t,r-1,n-r+3,d),n=r+d.length-h-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function Ij(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ad(r);let s;return a;function a(u){return s=u,t.enter("attentionSequence"),l(u)}function l(u){if(u===s)return t.consume(u),l;const d=t.exit("attentionSequence"),h=ad(u),p=!h||h===2&&i||n.includes(u),g=!i||i===2&&h||n.includes(r);return d._open=!!(s===42?p:p&&(i||!g)),d._close=!!(s===42?g:g&&(h||!p)),e(u)}}function aw(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Lj={name:"autolink",tokenize:Pj};function Pj(t,e,n){let r=0;return i;function i(b){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(b){return xi(b)?(t.consume(b),a):b===64?n(b):d(b)}function a(b){return b===43||b===45||b===46||ci(b)?(r=1,l(b)):d(b)}function l(b){return b===58?(t.consume(b),r=0,u):(b===43||b===45||b===46||ci(b))&&r++<32?(t.consume(b),l):(r=0,d(b))}function u(b){return b===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):b===null||b===32||b===60||bg(b)?n(b):(t.consume(b),u)}function d(b){return b===64?(t.consume(b),h):wj(b)?(t.consume(b),d):n(b)}function h(b){return ci(b)?p(b):n(b)}function p(b){return b===46?(t.consume(b),r=0,h):b===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):g(b)}function g(b){if((b===45||ci(b))&&r++<63){const y=b===45?g:p;return t.consume(b),y}return n(b)}}const Sh={partial:!0,tokenize:Bj};function Bj(t,e,n){return r;function r(s){return $t(s)?zt(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||it(s)?e(s):n(s)}}const o9={continuation:{tokenize:Fj},exit:Uj,name:"blockQuote",tokenize:zj};function zj(t,e,n){const r=this;return i;function i(a){if(a===62){const l=r.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return $t(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function Fj(t,e,n){const r=this;return i;function i(a){return $t(a)?zt(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(o9,e,n)(a)}}function Uj(t){t.exit("blockQuote")}const l9={name:"characterEscape",tokenize:Hj};function Hj(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return Cj(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const u9={name:"characterReference",tokenize:jj};function jj(t,e,n){const r=this;let i=0,s,a;return l;function l(p){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),u}function u(p){return p===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(p),t.exit("characterReferenceMarkerNumeric"),d):(t.enter("characterReferenceValue"),s=31,a=ci,h(p))}function d(p){return p===88||p===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(p),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=kj,h):(t.enter("characterReferenceValue"),s=7,a=KE,h(p))}function h(p){if(p===59&&i){const g=t.exit("characterReferenceValue");return a===ci&&!V3(r.sliceSerialize(g))?n(p):(t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(p)&&i++<s?(t.consume(p),h):n(p)}}const ow={partial:!0,tokenize:qj},lw={concrete:!0,name:"codeFenced",tokenize:$j};function $j(t,e,n){const r=this,i={partial:!0,tokenize:I};let s=0,a=0,l;return u;function u(P){return d(P)}function d(P){const $=r.events[r.events.length-1];return s=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,l=P,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),h(P)}function h(P){return P===l?(a++,t.consume(P),h):a<3?n(P):(t.exit("codeFencedFenceSequence"),$t(P)?zt(t,p,"whitespace")(P):p(P))}function p(P){return P===null||it(P)?(t.exit("codeFencedFence"),r.interrupt?e(P):t.check(ow,E,z)(P)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(P))}function g(P){return P===null||it(P)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),p(P)):$t(P)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),zt(t,b,"whitespace")(P)):P===96&&P===l?n(P):(t.consume(P),g)}function b(P){return P===null||it(P)?p(P):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),y(P))}function y(P){return P===null||it(P)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),p(P)):P===96&&P===l?n(P):(t.consume(P),y)}function E(P){return t.attempt(i,z,T)(P)}function T(P){return t.enter("lineEnding"),t.consume(P),t.exit("lineEnding"),S}function S(P){return s>0&&$t(P)?zt(t,A,"linePrefix",s+1)(P):A(P)}function A(P){return P===null||it(P)?t.check(ow,E,z)(P):(t.enter("codeFlowValue"),R(P))}function R(P){return P===null||it(P)?(t.exit("codeFlowValue"),A(P)):(t.consume(P),R)}function z(P){return t.exit("codeFenced"),e(P)}function I(P,$,K){let Z=0;return W;function W(de){return P.enter("lineEnding"),P.consume(de),P.exit("lineEnding"),re}function re(de){return P.enter("codeFencedFence"),$t(de)?zt(P,ie,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(de):ie(de)}function ie(de){return de===l?(P.enter("codeFencedFenceSequence"),ye(de)):K(de)}function ye(de){return de===l?(Z++,P.consume(de),ye):Z>=a?(P.exit("codeFencedFenceSequence"),$t(de)?zt(P,ae,"whitespace")(de):ae(de)):K(de)}function ae(de){return de===null||it(de)?(P.exit("codeFencedFence"),$(de)):K(de)}}}function qj(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const e2={name:"codeIndented",tokenize:Gj},Vj={partial:!0,tokenize:Yj};function Gj(t,e,n){const r=this;return i;function i(d){return t.enter("codeIndented"),zt(t,s,"linePrefix",5)(d)}function s(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?u(d):it(d)?t.attempt(Vj,a,u)(d):(t.enter("codeFlowValue"),l(d))}function l(d){return d===null||it(d)?(t.exit("codeFlowValue"),a(d)):(t.consume(d),l)}function u(d){return t.exit("codeIndented"),e(d)}}function Yj(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):it(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):zt(t,s,"linePrefix",5)(a)}function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(a):it(a)?i(a):n(a)}}const Wj={name:"codeText",previous:Xj,resolve:Kj,tokenize:Qj};function Kj(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function Xj(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Qj(t,e,n){let r=0,i,s;return a;function a(p){return t.enter("codeText"),t.enter("codeTextSequence"),l(p)}function l(p){return p===96?(t.consume(p),r++,l):(t.exit("codeTextSequence"),u(p))}function u(p){return p===null?n(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),u):p===96?(s=t.enter("codeTextSequence"),i=0,h(p)):it(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),u):(t.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||it(p)?(t.exit("codeTextData"),u(p)):(t.consume(p),d)}function h(p){return p===96?(t.consume(p),i++,h):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(s.type="codeTextData",d(p))}}class Zj{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&z0(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),z0(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),z0(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);z0(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);z0(this.left,n.reverse())}}}function z0(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function c9(t){const e={};let n=-1,r,i,s,a,l,u,d;const h=new Zj(t);for(;++n<h.length;){for(;n in e;)n=e[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Jj(h,n)),n=e[n],d=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=h.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},l=h.slice(i,n),l.unshift(r),h.splice(i,n-i+1,l))}}return ls(t,0,Number.POSITIVE_INFINITY,h.slice(0)),!d}function Jj(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const l=a.events,u=[],d={};let h,p,g=-1,b=n,y=0,E=0;const T=[E];for(;b;){for(;t.get(++i)[1]!==b;);s.push(i),b._tokenizer||(h=r.sliceStream(b),b.next||h.push(null),p&&a.defineSkip(b.start),b._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),b._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),p=b,b=b.next}for(b=n;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(E=g+1,T.push(E),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(a.events=[],b?(b._tokenizer=void 0,b.previous=void 0):T.pop(),g=T.length;g--;){const S=l.slice(T[g],T[g+1]),A=s.pop();u.push([A,A+S.length-1]),t.splice(A,2,S)}for(u.reverse(),g=-1;++g<u.length;)d[y+u[g][0]]=y+u[g][1],y+=u[g][1]-u[g][0]-1;return d}const e$={resolve:n$,tokenize:r$},t$={partial:!0,tokenize:i$};function n$(t){return c9(t),t}function r$(t,e){let n;return r;function r(l){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):it(l)?t.check(t$,a,s)(l):(t.consume(l),i)}function s(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function a(l){return t.consume(l),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function i$(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),zt(t,s,"linePrefix")}function s(a){if(a===null||it(a))return n(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function d9(t,e,n,r,i,s,a,l,u){const d=u||Number.POSITIVE_INFINITY;let h=0;return p;function p(S){return S===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(S),t.exit(s),g):S===null||S===32||S===41||bg(S)?n(S):(t.enter(r),t.enter(a),t.enter(l),t.enter("chunkString",{contentType:"string"}),E(S))}function g(S){return S===62?(t.enter(s),t.consume(S),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===62?(t.exit("chunkString"),t.exit(l),g(S)):S===null||S===60||it(S)?n(S):(t.consume(S),S===92?y:b)}function y(S){return S===60||S===62||S===92?(t.consume(S),b):b(S)}function E(S){return!h&&(S===null||S===41||_n(S))?(t.exit("chunkString"),t.exit(l),t.exit(a),t.exit(r),e(S)):h<d&&S===40?(t.consume(S),h++,E):S===41?(t.consume(S),h--,E):S===null||S===32||S===40||bg(S)?n(S):(t.consume(S),S===92?T:E)}function T(S){return S===40||S===41||S===92?(t.consume(S),E):E(S)}}function f9(t,e,n,r,i,s){const a=this;let l=0,u;return d;function d(b){return t.enter(r),t.enter(i),t.consume(b),t.exit(i),t.enter(s),h}function h(b){return l>999||b===null||b===91||b===93&&!u||b===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(b):b===93?(t.exit(s),t.enter(i),t.consume(b),t.exit(i),t.exit(r),e):it(b)?(t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||b===91||b===93||it(b)||l++>999?(t.exit("chunkString"),h(b)):(t.consume(b),u||(u=!$t(b)),b===92?g:p)}function g(b){return b===91||b===92||b===93?(t.consume(b),l++,p):p(b)}}function h9(t,e,n,r,i,s){let a;return l;function l(g){return g===34||g===39||g===40?(t.enter(r),t.enter(i),t.consume(g),t.exit(i),a=g===40?41:g,u):n(g)}function u(g){return g===a?(t.enter(i),t.consume(g),t.exit(i),t.exit(r),e):(t.enter(s),d(g))}function d(g){return g===a?(t.exit(s),u(a)):g===null?n(g):it(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),zt(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===a||g===null||it(g)?(t.exit("chunkString"),d(g)):(t.consume(g),g===92?p:h)}function p(g){return g===a||g===92?(t.consume(g),h):h(g)}}function Ef(t,e){let n;return r;function r(i){return it(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):$t(i)?zt(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const s$={name:"definition",tokenize:o$},a$={partial:!0,tokenize:l$};function o$(t,e,n){const r=this;let i;return s;function s(b){return t.enter("definition"),a(b)}function a(b){return f9.call(r,t,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function l(b){return i=Xs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(t.enter("definitionMarker"),t.consume(b),t.exit("definitionMarker"),u):n(b)}function u(b){return _n(b)?Ef(t,d)(b):d(b)}function d(b){return d9(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function h(b){return t.attempt(a$,p,p)(b)}function p(b){return $t(b)?zt(t,g,"whitespace")(b):g(b)}function g(b){return b===null||it(b)?(t.exit("definition"),r.parser.defined.push(i),e(b)):n(b)}}function l$(t,e,n){return r;function r(l){return _n(l)?Ef(t,i)(l):n(l)}function i(l){return h9(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return $t(l)?zt(t,a,"whitespace")(l):a(l)}function a(l){return l===null||it(l)?e(l):n(l)}}const u$={name:"hardBreakEscape",tokenize:c$};function c$(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return it(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const d$={name:"headingAtx",resolve:f$,tokenize:h$};function f$(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ls(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function h$(t,e,n){let r=0;return i;function i(h){return t.enter("atxHeading"),s(h)}function s(h){return t.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(t.consume(h),a):h===null||_n(h)?(t.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(t.enter("atxHeadingSequence"),u(h)):h===null||it(h)?(t.exit("atxHeading"),e(h)):$t(h)?zt(t,l,"whitespace")(h):(t.enter("atxHeadingText"),d(h))}function u(h){return h===35?(t.consume(h),u):(t.exit("atxHeadingSequence"),l(h))}function d(h){return h===null||h===35||_n(h)?(t.exit("atxHeadingText"),l(h)):(t.consume(h),d)}}const p$=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],uw=["pre","script","style","textarea"],m$={concrete:!0,name:"htmlFlow",resolveTo:v$,tokenize:y$},g$={partial:!0,tokenize:_$},b$={partial:!0,tokenize:E$};function v$(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function y$(t,e,n){const r=this;let i,s,a,l,u;return d;function d(B){return h(B)}function h(B){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(B),p}function p(B){return B===33?(t.consume(B),g):B===47?(t.consume(B),s=!0,E):B===63?(t.consume(B),i=3,r.interrupt?e:N):xi(B)?(t.consume(B),a=String.fromCharCode(B),T):n(B)}function g(B){return B===45?(t.consume(B),i=2,b):B===91?(t.consume(B),i=5,l=0,y):xi(B)?(t.consume(B),i=4,r.interrupt?e:N):n(B)}function b(B){return B===45?(t.consume(B),r.interrupt?e:N):n(B)}function y(B){const Ee="CDATA[";return B===Ee.charCodeAt(l++)?(t.consume(B),l===Ee.length?r.interrupt?e:ie:y):n(B)}function E(B){return xi(B)?(t.consume(B),a=String.fromCharCode(B),T):n(B)}function T(B){if(B===null||B===47||B===62||_n(B)){const Ee=B===47,Qe=a.toLowerCase();return!Ee&&!s&&uw.includes(Qe)?(i=1,r.interrupt?e(B):ie(B)):p$.includes(a.toLowerCase())?(i=6,Ee?(t.consume(B),S):r.interrupt?e(B):ie(B)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):s?A(B):R(B))}return B===45||ci(B)?(t.consume(B),a+=String.fromCharCode(B),T):n(B)}function S(B){return B===62?(t.consume(B),r.interrupt?e:ie):n(B)}function A(B){return $t(B)?(t.consume(B),A):W(B)}function R(B){return B===47?(t.consume(B),W):B===58||B===95||xi(B)?(t.consume(B),z):$t(B)?(t.consume(B),R):W(B)}function z(B){return B===45||B===46||B===58||B===95||ci(B)?(t.consume(B),z):I(B)}function I(B){return B===61?(t.consume(B),P):$t(B)?(t.consume(B),I):R(B)}function P(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(t.consume(B),u=B,$):$t(B)?(t.consume(B),P):K(B)}function $(B){return B===u?(t.consume(B),u=null,Z):B===null||it(B)?n(B):(t.consume(B),$)}function K(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||_n(B)?I(B):(t.consume(B),K)}function Z(B){return B===47||B===62||$t(B)?R(B):n(B)}function W(B){return B===62?(t.consume(B),re):n(B)}function re(B){return B===null||it(B)?ie(B):$t(B)?(t.consume(B),re):n(B)}function ie(B){return B===45&&i===2?(t.consume(B),J):B===60&&i===1?(t.consume(B),ne):B===62&&i===4?(t.consume(B),X):B===63&&i===3?(t.consume(B),N):B===93&&i===5?(t.consume(B),Oe):it(B)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(g$,me,ye)(B)):B===null||it(B)?(t.exit("htmlFlowData"),ye(B)):(t.consume(B),ie)}function ye(B){return t.check(b$,ae,me)(B)}function ae(B){return t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),de}function de(B){return B===null||it(B)?ye(B):(t.enter("htmlFlowData"),ie(B))}function J(B){return B===45?(t.consume(B),N):ie(B)}function ne(B){return B===47?(t.consume(B),a="",he):ie(B)}function he(B){if(B===62){const Ee=a.toLowerCase();return uw.includes(Ee)?(t.consume(B),X):ie(B)}return xi(B)&&a.length<8?(t.consume(B),a+=String.fromCharCode(B),he):ie(B)}function Oe(B){return B===93?(t.consume(B),N):ie(B)}function N(B){return B===62?(t.consume(B),X):B===45&&i===2?(t.consume(B),N):ie(B)}function X(B){return B===null||it(B)?(t.exit("htmlFlowData"),me(B)):(t.consume(B),X)}function me(B){return t.exit("htmlFlow"),e(B)}}function E$(t,e,n){const r=this;return i;function i(a){return it(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function _$(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Sh,e,n)}}const x$={name:"htmlText",tokenize:T$};function T$(t,e,n){const r=this;let i,s,a;return l;function l(N){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(N),u}function u(N){return N===33?(t.consume(N),d):N===47?(t.consume(N),I):N===63?(t.consume(N),R):xi(N)?(t.consume(N),K):n(N)}function d(N){return N===45?(t.consume(N),h):N===91?(t.consume(N),s=0,y):xi(N)?(t.consume(N),A):n(N)}function h(N){return N===45?(t.consume(N),b):n(N)}function p(N){return N===null?n(N):N===45?(t.consume(N),g):it(N)?(a=p,ne(N)):(t.consume(N),p)}function g(N){return N===45?(t.consume(N),b):p(N)}function b(N){return N===62?J(N):N===45?g(N):p(N)}function y(N){const X="CDATA[";return N===X.charCodeAt(s++)?(t.consume(N),s===X.length?E:y):n(N)}function E(N){return N===null?n(N):N===93?(t.consume(N),T):it(N)?(a=E,ne(N)):(t.consume(N),E)}function T(N){return N===93?(t.consume(N),S):E(N)}function S(N){return N===62?J(N):N===93?(t.consume(N),S):E(N)}function A(N){return N===null||N===62?J(N):it(N)?(a=A,ne(N)):(t.consume(N),A)}function R(N){return N===null?n(N):N===63?(t.consume(N),z):it(N)?(a=R,ne(N)):(t.consume(N),R)}function z(N){return N===62?J(N):R(N)}function I(N){return xi(N)?(t.consume(N),P):n(N)}function P(N){return N===45||ci(N)?(t.consume(N),P):$(N)}function $(N){return it(N)?(a=$,ne(N)):$t(N)?(t.consume(N),$):J(N)}function K(N){return N===45||ci(N)?(t.consume(N),K):N===47||N===62||_n(N)?Z(N):n(N)}function Z(N){return N===47?(t.consume(N),J):N===58||N===95||xi(N)?(t.consume(N),W):it(N)?(a=Z,ne(N)):$t(N)?(t.consume(N),Z):J(N)}function W(N){return N===45||N===46||N===58||N===95||ci(N)?(t.consume(N),W):re(N)}function re(N){return N===61?(t.consume(N),ie):it(N)?(a=re,ne(N)):$t(N)?(t.consume(N),re):Z(N)}function ie(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),i=N,ye):it(N)?(a=ie,ne(N)):$t(N)?(t.consume(N),ie):(t.consume(N),ae)}function ye(N){return N===i?(t.consume(N),i=void 0,de):N===null?n(N):it(N)?(a=ye,ne(N)):(t.consume(N),ye)}function ae(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||_n(N)?Z(N):(t.consume(N),ae)}function de(N){return N===47||N===62||_n(N)?Z(N):n(N)}function J(N){return N===62?(t.consume(N),t.exit("htmlTextData"),t.exit("htmlText"),e):n(N)}function ne(N){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),he}function he(N){return $t(N)?zt(t,Oe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):Oe(N)}function Oe(N){return t.enter("htmlTextData"),a(N)}}const G3={name:"labelEnd",resolveAll:C$,resolveTo:A$,tokenize:N$},S$={tokenize:M$},w$={tokenize:O$},k$={tokenize:R$};function C$(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&ls(t,0,t.length,n),t}function A$(t,e){let n=t.length,r=0,i,s,a,l;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const u={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},d={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},h={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[a-2][1].start}};return l=[["enter",u,e],["enter",d,e]],l=ws(l,t.slice(s+1,s+r+3)),l=ws(l,[["enter",h,e]]),l=ws(l,K1(e.parser.constructs.insideSpan.null,t.slice(s+r+4,a-3),e)),l=ws(l,[["exit",h,e],t[a-2],t[a-1],["exit",d,e]]),l=ws(l,t.slice(a+1)),l=ws(l,[["exit",u,e]]),ls(t,s,t.length,l),t}function N$(t,e,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return l;function l(g){return s?s._inactive?p(g):(a=r.parser.defined.includes(Xs(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),u):n(g)}function u(g){return g===40?t.attempt(S$,h,a?h:p)(g):g===91?t.attempt(w$,h,a?d:p)(g):a?h(g):p(g)}function d(g){return t.attempt(k$,h,p)(g)}function h(g){return e(g)}function p(g){return s._balanced=!0,n(g)}}function M$(t,e,n){return r;function r(p){return t.enter("resource"),t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),i}function i(p){return _n(p)?Ef(t,s)(p):s(p)}function s(p){return p===41?h(p):d9(t,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function a(p){return _n(p)?Ef(t,u)(p):h(p)}function l(p){return n(p)}function u(p){return p===34||p===39||p===40?h9(t,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):h(p)}function d(p){return _n(p)?Ef(t,h)(p):h(p)}function h(p){return p===41?(t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),t.exit("resource"),e):n(p)}}function O$(t,e,n){const r=this;return i;function i(l){return f9.call(r,t,s,a,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Xs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(l):n(l)}function a(l){return n(l)}}function R$(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const D$={name:"labelStartImage",resolveAll:G3.resolveAll,tokenize:I$};function I$(t,e,n){const r=this;return i;function i(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),s}function s(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelImage"),a):n(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):e(l)}}const L$={name:"labelStartLink",resolveAll:G3.resolveAll,tokenize:P$};function P$(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const t2={name:"lineEnding",tokenize:B$};function B$(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),zt(t,e,"linePrefix")}}const Jm={name:"thematicBreak",tokenize:z$};function z$(t,e,n){let r=0,i;return s;function s(d){return t.enter("thematicBreak"),a(d)}function a(d){return i=d,l(d)}function l(d){return d===i?(t.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||it(d))?(t.exit("thematicBreak"),e(d)):n(d)}function u(d){return d===i?(t.consume(d),r++,u):(t.exit("thematicBreakSequence"),$t(d)?zt(t,l,"whitespace")(d):l(d))}}const Li={continuation:{tokenize:j$},exit:q$,name:"list",tokenize:H$},F$={partial:!0,tokenize:V$},U$={partial:!0,tokenize:$$};function H$(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(b){const y=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:KE(b)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),b===42||b===45?t.check(Jm,n,d)(b):d(b);if(!r.interrupt||b===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(b)}return n(b)}function u(b){return KE(b)&&++a<10?(t.consume(b),u):(!r.interrupt||a<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(t.exit("listItemValue"),d(b)):n(b)}function d(b){return t.enter("listItemMarker"),t.consume(b),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,t.check(Sh,r.interrupt?n:h,t.attempt(F$,g,p))}function h(b){return r.containerState.initialBlankLine=!0,s++,g(b)}function p(b){return $t(b)?(t.enter("listItemPrefixWhitespace"),t.consume(b),t.exit("listItemPrefixWhitespace"),g):n(b)}function g(b){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(b)}}function j$(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Sh,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zt(t,e,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!$t(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(U$,e,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,zt(t,t.attempt(Li,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function $$(t,e,n){const r=this;return zt(t,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(s):n(s)}}function q$(t){t.exit(this.containerState.type)}function V$(t,e,n){const r=this;return zt(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!$t(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const cw={name:"setextUnderline",resolveTo:G$,tokenize:Y$};function G$(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",a,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function Y$(t,e,n){const r=this;let i;return s;function s(d){let h=r.events.length,p;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){p=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(t.enter("setextHeadingLine"),i=d,a(d)):n(d)}function a(d){return t.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(t.consume(d),l):(t.exit("setextHeadingLineSequence"),$t(d)?zt(t,u,"lineSuffix")(d):u(d))}function u(d){return d===null||it(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const W$={tokenize:K$};function K$(t){const e=this,n=t.attempt(Sh,r,t.attempt(this.parser.constructs.flowInitial,i,zt(t,t.attempt(this.parser.constructs.flow,i,t.attempt(e$,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const X$={resolveAll:m9()},Q$=p9("string"),Z$=p9("text");function p9(t){return{resolveAll:m9(t==="text"?J$:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,a,l);return a;function a(h){return d(h)?s(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return d(h)?(n.exit("data"),s(h)):(n.consume(h),u)}function d(h){if(h===null)return!0;const p=i[h];let g=-1;if(p)for(;++g<p.length;){const b=p[g];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function m9(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function J$(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,a=-1,l=0,u;for(;s--;){const d=i[s];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(d===-2)u=!0,l++;else if(d!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(l=0),l){const d={type:n===t.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(t.splice(n,0,["enter",d,e],["exit",d,e]),n+=2)}n++}return t}const eq={42:Li,43:Li,45:Li,48:Li,49:Li,50:Li,51:Li,52:Li,53:Li,54:Li,55:Li,56:Li,57:Li,62:o9},tq={91:s$},nq={[-2]:e2,[-1]:e2,32:e2},rq={35:d$,42:Jm,45:[cw,Jm],60:m$,61:cw,95:Jm,96:lw,126:lw},iq={38:u9,92:l9},sq={[-5]:t2,[-4]:t2,[-3]:t2,33:D$,38:u9,42:XE,60:[Lj,x$],91:L$,92:[u$,l9],93:G3,95:XE,96:Wj},aq={null:[XE,X$]},oq={null:[42,95]},lq={null:[]},uq=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:oq,contentInitial:tq,disable:lq,document:eq,flow:rq,flowInitial:nq,insideSpan:aq,string:iq,text:sq},Symbol.toStringTag,{value:"Module"}));function cq(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],l=[];const u={attempt:$(I),check:$(P),consume:A,enter:R,exit:z,interrupt:$(P,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:y,parser:t,previous:null,sliceSerialize:g,sliceStream:b,write:p};let h=e.tokenize.call(d,u);return e.resolveAll&&s.push(e),d;function p(re){return a=ws(a,re),T(),a[a.length-1]!==null?[]:(K(e,0),d.events=K1(s,d.events,d),d.events)}function g(re,ie){return fq(b(re),ie)}function b(re){return dq(a,re)}function y(){const{_bufferIndex:re,_index:ie,line:ye,column:ae,offset:de}=r;return{_bufferIndex:re,_index:ie,line:ye,column:ae,offset:de}}function E(re){i[re.line]=re.column,W()}function T(){let re;for(;r._index<a.length;){const ie=a[r._index];if(typeof ie=="string")for(re=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===re&&r._bufferIndex<ie.length;)S(ie.charCodeAt(r._bufferIndex));else S(ie)}}function S(re){h=h(re)}function A(re){it(re)?(r.line++,r.column=1,r.offset+=re===-3?2:1,W()):re!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=re}function R(re,ie){const ye=ie||{};return ye.type=re,ye.start=y(),d.events.push(["enter",ye,d]),l.push(ye),ye}function z(re){const ie=l.pop();return ie.end=y(),d.events.push(["exit",ie,d]),ie}function I(re,ie){K(re,ie.from)}function P(re,ie){ie.restore()}function $(re,ie){return ye;function ye(ae,de,J){let ne,he,Oe,N;return Array.isArray(ae)?me(ae):"tokenize"in ae?me([ae]):X(ae);function X(Fe){return Ft;function Ft(ut){const en=ut!==null&&Fe[ut],Nt=ut!==null&&Fe.null,Mn=[...Array.isArray(en)?en:en?[en]:[],...Array.isArray(Nt)?Nt:Nt?[Nt]:[]];return me(Mn)(ut)}}function me(Fe){return ne=Fe,he=0,Fe.length===0?J:B(Fe[he])}function B(Fe){return Ft;function Ft(ut){return N=Z(),Oe=Fe,Fe.partial||(d.currentConstruct=Fe),Fe.name&&d.parser.constructs.disable.null.includes(Fe.name)?Qe():Fe.tokenize.call(ie?Object.assign(Object.create(d),ie):d,u,Ee,Qe)(ut)}}function Ee(Fe){return re(Oe,N),de}function Qe(Fe){return N.restore(),++he<ne.length?B(ne[he]):J}}}function K(re,ie){re.resolveAll&&!s.includes(re)&&s.push(re),re.resolve&&ls(d.events,ie,d.events.length-ie,re.resolve(d.events.slice(ie),d)),re.resolveTo&&(d.events=re.resolveTo(d.events,d))}function Z(){const re=y(),ie=d.previous,ye=d.currentConstruct,ae=d.events.length,de=Array.from(l);return{from:ae,restore:J};function J(){r=re,d.previous=ie,d.currentConstruct=ye,d.events.length=ae,l=de,W()}}function W(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function dq(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,s)];else{if(a=t.slice(n,i),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}s>0&&a.push(t[i].slice(0,s))}return a}function fq(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a=e?" ":"	";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function hq(t){const r={constructs:s9([uq,...(t||{}).extensions||[]]),content:i(Aj),defined:[],document:i(Mj),flow:i(W$),lazy:{},string:i(Q$),text:i(Z$)};return r;function i(s){return a;function a(l){return cq(r,s,l)}}}function pq(t){for(;!c9(t););return t}const dw=/[\0\t\n\r]/g;function mq(){let t=1,e="",n=!0,r;return i;function i(s,a,l){const u=[];let d,h,p,g,b;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),p=0,e="",n&&(s.charCodeAt(0)===65279&&p++,n=void 0);p<s.length;){if(dw.lastIndex=p,d=dw.exec(s),g=d&&d.index!==void 0?d.index:s.length,b=s.charCodeAt(g),!d){e=s.slice(p);break}if(b===10&&p===g&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<g&&(u.push(s.slice(p,g)),t+=g-p),b){case 0:{u.push(65533),t++;break}case 9:{for(h=Math.ceil(t/4)*4,u.push(-2);t++<h;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}p=g+1}return l&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const gq=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bq(t){return t.replace(gq,vq)}function vq(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return a9(n.slice(s?2:1),s?16:10)}return V3(n)||t}const g9={}.hasOwnProperty;function yq(t,e,n){return typeof e!="string"&&(n=e,e=void 0),Eq(n)(pq(hq(n).document().write(mq()(t,e,!0))))}function Eq(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(qt),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:s(Gt),blockQuote:s(Nt),characterEscape:Z,characterReference:Z,codeFenced:s(Mn),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Mn,a),codeText:s(Vr,a),codeTextData:Z,data:Z,codeFlowValue:Z,definition:s(gt),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(St),hardBreakEscape:s(tt),hardBreakTrailing:s(tt),htmlFlow:s(kt,a),htmlFlowData:Z,htmlText:s(kt,a),htmlTextData:Z,image:s(fn),label:a,link:s(qt),listItem:s(fr),listItemValue:g,listOrdered:s(hn,p),listUnordered:s(hn),paragraph:s(ea),reference:B,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Gt),strong:s(fs),thematicBreak:s(ir)},exit:{atxHeading:u(),atxHeadingSequence:I,autolink:u(),autolinkEmail:en,autolinkProtocol:ut,blockQuote:u(),characterEscapeValue:W,characterReferenceMarkerHexadecimal:Qe,characterReferenceMarkerNumeric:Qe,characterReferenceValue:Fe,characterReference:Ft,codeFenced:u(T),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:y,codeFlowValue:W,codeIndented:u(S),codeText:u(de),codeTextData:W,data:W,definition:u(),definitionDestinationString:z,definitionLabelString:A,definitionTitleString:R,emphasis:u(),hardBreakEscape:u(ie),hardBreakTrailing:u(ie),htmlFlow:u(ye),htmlFlowData:W,htmlText:u(ae),htmlTextData:W,image:u(ne),label:Oe,labelText:he,lineEnding:re,link:u(J),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Ee,resourceDestinationString:N,resourceTitleString:X,resource:me,setextHeading:u(K),setextHeadingLineSequence:$,setextHeadingText:P,strong:u(),thematicBreak:u()}};b9(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ge){let we={type:"root",children:[]};const rt={stack:[we],tokenStack:[],config:e,enter:l,exit:d,buffer:a,resume:h,data:n},st=[];let Be=-1;for(;++Be<ge.length;)if(ge[Be][1].type==="listOrdered"||ge[Be][1].type==="listUnordered")if(ge[Be][0]==="enter")st.push(Be);else{const Yt=st.pop();Be=i(ge,Yt,Be)}for(Be=-1;++Be<ge.length;){const Yt=e[ge[Be][0]];g9.call(Yt,ge[Be][1].type)&&Yt[ge[Be][1].type].call(Object.assign({sliceSerialize:ge[Be][2].sliceSerialize},rt),ge[Be][1])}if(rt.tokenStack.length>0){const Yt=rt.tokenStack[rt.tokenStack.length-1];(Yt[1]||fw).call(rt,void 0,Yt[0])}for(we.position={start:Jo(ge.length>0?ge[0][1].start:{line:1,column:1,offset:0}),end:Jo(ge.length>0?ge[ge.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<e.transforms.length;)we=e.transforms[Be](we)||we;return we}function i(ge,we,rt){let st=we-1,Be=-1,Yt=!1,On,hr,Cr,sr;for(;++st<=rt;){const Tn=ge[st];switch(Tn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Tn[0]==="enter"?Be++:Be--,sr=void 0;break}case"lineEndingBlank":{Tn[0]==="enter"&&(On&&!sr&&!Be&&!Cr&&(Cr=st),sr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sr=void 0}if(!Be&&Tn[0]==="enter"&&Tn[1].type==="listItemPrefix"||Be===-1&&Tn[0]==="exit"&&(Tn[1].type==="listUnordered"||Tn[1].type==="listOrdered")){if(On){let tn=st;for(hr=void 0;tn--;){const ar=ge[tn];if(ar[1].type==="lineEnding"||ar[1].type==="lineEndingBlank"){if(ar[0]==="exit")continue;hr&&(ge[hr][1].type="lineEndingBlank",Yt=!0),ar[1].type="lineEnding",hr=tn}else if(!(ar[1].type==="linePrefix"||ar[1].type==="blockQuotePrefix"||ar[1].type==="blockQuotePrefixWhitespace"||ar[1].type==="blockQuoteMarker"||ar[1].type==="listItemIndent"))break}Cr&&(!hr||Cr<hr)&&(On._spread=!0),On.end=Object.assign({},hr?ge[hr][1].start:Tn[1].end),ge.splice(hr||st,0,["exit",On,Tn[2]]),st++,rt++}if(Tn[1].type==="listItemPrefix"){const tn={type:"listItem",_spread:!1,start:Object.assign({},Tn[1].start),end:void 0};On=tn,ge.splice(st,0,["enter",tn,Tn[2]]),st++,rt++,Cr=void 0,sr=!0}}}return ge[we][1]._spread=Yt,rt}function s(ge,we){return rt;function rt(st){l.call(this,ge(st),st),we&&we.call(this,st)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(ge,we,rt){this.stack[this.stack.length-1].children.push(ge),this.stack.push(ge),this.tokenStack.push([we,rt||void 0]),ge.position={start:Jo(we.start),end:void 0}}function u(ge){return we;function we(rt){ge&&ge.call(this,rt),d.call(this,rt)}}function d(ge,we){const rt=this.stack.pop(),st=this.tokenStack.pop();if(st)st[0].type!==ge.type&&(we?we.call(this,ge,st[0]):(st[1]||fw).call(this,ge,st[0]));else throw new Error("Cannot close `"+ge.type+"` ("+yf({start:ge.start,end:ge.end})+"): it’s not open");rt.position.end=Jo(ge.end)}function h(){return q3(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(ge){if(this.data.expectingFirstListItemValue){const we=this.stack[this.stack.length-2];we.start=Number.parseInt(this.sliceSerialize(ge),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.lang=ge}function y(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.meta=ge}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.value=ge.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.value=ge.replace(/(\r?\n|\r)$/g,"")}function A(ge){const we=this.resume(),rt=this.stack[this.stack.length-1];rt.label=we,rt.identifier=Xs(this.sliceSerialize(ge)).toLowerCase()}function R(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.title=ge}function z(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.url=ge}function I(ge){const we=this.stack[this.stack.length-1];if(!we.depth){const rt=this.sliceSerialize(ge).length;we.depth=rt}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function $(ge){const we=this.stack[this.stack.length-1];we.depth=this.sliceSerialize(ge).codePointAt(0)===61?1:2}function K(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(ge){const rt=this.stack[this.stack.length-1].children;let st=rt[rt.length-1];(!st||st.type!=="text")&&(st=ri(),st.position={start:Jo(ge.start),end:void 0},rt.push(st)),this.stack.push(st)}function W(ge){const we=this.stack.pop();we.value+=this.sliceSerialize(ge),we.position.end=Jo(ge.end)}function re(ge){const we=this.stack[this.stack.length-1];if(this.data.atHardBreak){const rt=we.children[we.children.length-1];rt.position.end=Jo(ge.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(we.type)&&(Z.call(this,ge),W.call(this,ge))}function ie(){this.data.atHardBreak=!0}function ye(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.value=ge}function ae(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.value=ge}function de(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.value=ge}function J(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const we=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=we,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function ne(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const we=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=we,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function he(ge){const we=this.sliceSerialize(ge),rt=this.stack[this.stack.length-2];rt.label=bq(we),rt.identifier=Xs(we).toLowerCase()}function Oe(){const ge=this.stack[this.stack.length-1],we=this.resume(),rt=this.stack[this.stack.length-1];if(this.data.inReference=!0,rt.type==="link"){const st=ge.children;rt.children=st}else rt.alt=we}function N(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.url=ge}function X(){const ge=this.resume(),we=this.stack[this.stack.length-1];we.title=ge}function me(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function Ee(ge){const we=this.resume(),rt=this.stack[this.stack.length-1];rt.label=we,rt.identifier=Xs(this.sliceSerialize(ge)).toLowerCase(),this.data.referenceType="full"}function Qe(ge){this.data.characterReferenceType=ge.type}function Fe(ge){const we=this.sliceSerialize(ge),rt=this.data.characterReferenceType;let st;rt?(st=a9(we,rt==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):st=V3(we);const Be=this.stack[this.stack.length-1];Be.value+=st}function Ft(ge){const we=this.stack.pop();we.position.end=Jo(ge.end)}function ut(ge){W.call(this,ge);const we=this.stack[this.stack.length-1];we.url=this.sliceSerialize(ge)}function en(ge){W.call(this,ge);const we=this.stack[this.stack.length-1];we.url="mailto:"+this.sliceSerialize(ge)}function Nt(){return{type:"blockquote",children:[]}}function Mn(){return{type:"code",lang:null,meta:null,value:""}}function Vr(){return{type:"inlineCode",value:""}}function gt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function St(){return{type:"emphasis",children:[]}}function Gt(){return{type:"heading",depth:0,children:[]}}function tt(){return{type:"break"}}function kt(){return{type:"html",value:""}}function fn(){return{type:"image",title:null,url:"",alt:null}}function qt(){return{type:"link",title:null,url:"",children:[]}}function hn(ge){return{type:"list",ordered:ge.type==="listOrdered",start:null,spread:ge._spread,children:[]}}function fr(ge){return{type:"listItem",spread:ge._spread,checked:null,children:[]}}function ea(){return{type:"paragraph",children:[]}}function fs(){return{type:"strong",children:[]}}function ri(){return{type:"text",value:""}}function ir(){return{type:"thematicBreak"}}}function Jo(t){return{line:t.line,column:t.column,offset:t.offset}}function b9(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?b9(t,r):_q(t,r)}}function _q(t,e){let n;for(n in e)if(g9.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function fw(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+yf({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+yf({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+yf({start:e.start,end:e.end})+") is still open")}function xq(t){const e=this;e.parser=n;function n(r){return yq(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Tq(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function Sq(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
`}]}function wq(t,e){const n=e.value?e.value+`
`:"",r={};e.lang&&(r.className=["language-"+e.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(i.data={meta:e.meta}),t.patch(e,i),i=t.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},t.patch(e,i),i}function kq(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Cq(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Aq(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=kd(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let a,l=t.footnoteCounts.get(r);l===void 0?(l=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=s+1,l+=1,t.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,d),t.applyData(e,d)}function Nq(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Mq(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function v9(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Oq(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return v9(t,e);const i={src:kd(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function Rq(t,e){const n={src:kd(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Dq(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Iq(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return v9(t,e);const i={href:kd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function Lq(t,e){const n={href:kd(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Pq(t,e,n){const r=t.all(e),i=n?Bq(n):y9(e),s={},a=[];if(typeof e.checked=="boolean"){const h=r[0];let p;h&&h.type==="element"&&h.tagName==="p"?p=h:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const h=r[l];(i||l!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
`}),h.type==="element"&&h.tagName==="p"&&!i?a.push(...h.children):a.push(h)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
`});const d={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,d),t.applyData(e,d)}function Bq(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=y9(n[r])}return e}function y9(t){const e=t.spread;return e??t.children.length>1}function zq(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function Fq(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Uq(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function Hq(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function jq(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},l=wa(e.children[1]),u=Y1(e.children[e.children.length-1]);l&&u&&(a.position={start:l,end:u}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function $q(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:e.children.length;let u=-1;const d=[];for(;++u<l;){const p=e.children[u],g={},b=a?a[u]:void 0;b&&(g.align=b);let y={type:"element",tagName:s,properties:g,children:[]};p&&(y.children=t.all(p),t.patch(p,y),y=t.applyData(p,y)),d.push(y)}const h={type:"element",tagName:"tr",properties:{},children:t.wrap(d,!0)};return t.patch(e,h),t.applyData(e,h)}function qq(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const hw=9,pw=32;function Vq(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(mw(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(mw(e.slice(i),i>0,!1)),s.join("")}function mw(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===hw||s===pw;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===hw||s===pw;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Gq(t,e){const n={type:"text",value:Vq(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Yq(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Wq={blockquote:Tq,break:Sq,code:wq,delete:kq,emphasis:Cq,footnoteReference:Aq,heading:Nq,html:Mq,imageReference:Oq,image:Rq,inlineCode:Dq,linkReference:Iq,link:Lq,listItem:Pq,list:zq,paragraph:Fq,root:Uq,strong:Hq,table:jq,tableCell:qq,tableRow:$q,text:Gq,thematicBreak:Yq,toml:am,yaml:am,definition:am,footnoteDefinition:am};function am(){}const E9=-1,X1=0,_f=1,vg=2,Y3=3,W3=4,K3=5,X3=6,_9=7,x9=8,gw=typeof self=="object"?self:globalThis,Kq=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,a]=e[i];switch(s){case X1:case E9:return n(a,i);case _f:{const l=n([],i);for(const u of a)l.push(r(u));return l}case vg:{const l=n({},i);for(const[u,d]of a)l[r(u)]=r(d);return l}case Y3:return n(new Date(a),i);case W3:{const{source:l,flags:u}=a;return n(new RegExp(l,u),i)}case K3:{const l=n(new Map,i);for(const[u,d]of a)l.set(r(u),r(d));return l}case X3:{const l=n(new Set,i);for(const u of a)l.add(r(u));return l}case _9:{const{name:l,message:u}=a;return n(new gw[l](u),i)}case x9:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(new gw[s](a),i)};return r},bw=t=>Kq(new Map,t)(0),Dc="",{toString:Xq}={},{keys:Qq}=Object,F0=t=>{const e=typeof t;if(e!=="object"||!t)return[X1,e];const n=Xq.call(t).slice(8,-1);switch(n){case"Array":return[_f,Dc];case"Object":return[vg,Dc];case"Date":return[Y3,Dc];case"RegExp":return[W3,Dc];case"Map":return[K3,Dc];case"Set":return[X3,Dc];case"DataView":return[_f,n]}return n.includes("Array")?[_f,n]:n.includes("Error")?[_9,n]:[vg,n]},om=([t,e])=>t===X1&&(e==="function"||e==="symbol"),Zq=(t,e,n,r)=>{const i=(a,l)=>{const u=r.push(a)-1;return n.set(l,u),u},s=a=>{if(n.has(a))return n.get(a);let[l,u]=F0(a);switch(l){case X1:{let h=a;switch(u){case"bigint":l=x9,h=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([E9],a)}return i([l,h],a)}case _f:{if(u){let g=a;return u==="DataView"?g=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(a)),i([u,[...g]],a)}const h=[],p=i([l,h],a);for(const g of a)h.push(s(g));return p}case vg:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const h=[],p=i([l,h],a);for(const g of Qq(a))(t||!om(F0(a[g])))&&h.push([s(g),s(a[g])]);return p}case Y3:return i([l,a.toISOString()],a);case W3:{const{source:h,flags:p}=a;return i([l,{source:h,flags:p}],a)}case K3:{const h=[],p=i([l,h],a);for(const[g,b]of a)(t||!(om(F0(g))||om(F0(b))))&&h.push([s(g),s(b)]);return p}case X3:{const h=[],p=i([l,h],a);for(const g of a)(t||!om(F0(g)))&&h.push(s(g));return p}}const{message:d}=a;return i([l,{name:u,message:d}],a)};return s},vw=(t,{json:e,lossy:n}={})=>{const r=[];return Zq(!(e||n),!!e,new Map,r)(t),r},od=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?bw(vw(t,e)):structuredClone(t):(t,e)=>bw(vw(t,e));function Jq(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function eV(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function tV(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Jq,r=t.options.footnoteBackLabel||eV,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<t.footnoteOrder.length;){const d=t.footnoteById.get(t.footnoteOrder[u]);if(!d)continue;const h=t.all(d),p=String(d.identifier).toUpperCase(),g=kd(p.toLowerCase());let b=0;const y=[],E=t.footnoteCounts.get(p);for(;E!==void 0&&++b<=E;){y.length>0&&y.push({type:"text",value:" "});let A=typeof n=="string"?n:n(u,b);typeof A=="string"&&(A={type:"text",value:A}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,b),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const T=h[h.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const A=T.children[T.children.length-1];A&&A.type==="text"?A.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...y)}else h.push(...y);const S={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(h,!0)};t.patch(d,S),l.push(S)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...od(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(l,!0)},{type:"text",value:`
`}]}}const wh=function(t){if(t==null)return sV;if(typeof t=="function")return Q1(t);if(typeof t=="object")return Array.isArray(t)?nV(t):rV(t);if(typeof t=="string")return iV(t);throw new Error("Expected function, string, or object as test")};function nV(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=wh(t[n]);return Q1(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function rV(t){const e=t;return Q1(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function iV(t){return Q1(e);function e(n){return n&&n.type===t}}function Q1(t){return e;function e(n,r,i){return!!(aV(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function sV(){return!0}function aV(t){return t!==null&&typeof t=="object"&&"type"in t}const T9=[],oV=!0,QE=!1,S9="skip";function Q3(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=wh(i),a=r?-1:1;l(t,void 0,[])();function l(u,d,h){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const b=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(u.type+(b?"<"+b+">":""))+")"})}return g;function g(){let b=T9,y,E,T;if((!e||s(u,d,h[h.length-1]||void 0))&&(b=lV(n(u,h)),b[0]===QE))return b;if("children"in u&&u.children){const S=u;if(S.children&&b[0]!==S9)for(E=(r?S.children.length:-1)+a,T=h.concat(S);E>-1&&E<S.children.length;){const A=S.children[E];if(y=l(A,E,T)(),y[0]===QE)return y;E=typeof y[1]=="number"?y[1]:E+a}}return b}}}function lV(t){return Array.isArray(t)?t:typeof t=="number"?[oV,t]:t==null?T9:[t]}function kh(t,e,n,r){let i,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,i=n):(s=e,a=n,i=r),Q3(t,s,l,i);function l(u,d){const h=d[d.length-1],p=h?h.children.indexOf(u):void 0;return a(u,p,h)}}const ZE={}.hasOwnProperty,uV={};function cV(t,e){const n=e||uV,r=new Map,i=new Map,s=new Map,a={...Wq,...n.handlers},l={all:d,applyData:fV,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:u,options:n,patch:dV,wrap:pV};return kh(t,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const p=h.type==="definition"?r:i,g=String(h.identifier).toUpperCase();p.has(g)||p.set(g,h)}}),l;function u(h,p){const g=h.type,b=l.handlers[g];if(ZE.call(l.handlers,g)&&b)return b(l,h,p);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in h){const{children:E,...T}=h,S=od(T);return S.children=l.all(h),S}return od(h)}return(l.options.unknownHandler||hV)(l,h,p)}function d(h){const p=[];if("children"in h){const g=h.children;let b=-1;for(;++b<g.length;){const y=l.one(g[b],h);if(y){if(b&&g[b-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=yw(y.value)),!Array.isArray(y)&&y.type==="element")){const E=y.children[0];E&&E.type==="text"&&(E.value=yw(E.value))}Array.isArray(y)?p.push(...y):p.push(y)}}}return p}}function dV(t,e){t.position&&(e.position=ej(t))}function fV(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,od(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function hV(t,e){const n=e.data||{},r="value"in e&&!(ZE.call(n,"hProperties")||ZE.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function pV(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
`});++r<t.length;)r&&n.push({type:"text",value:`
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
`}),n}function yw(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Ew(t,e){const n=cV(t,e),r=n.one(t,void 0),i=tV(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function mV(t,e){return t&&"run"in t?async function(n,r){const i=Ew(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Ew(n,{file:r,...t||e})}}function _w(t){if(t)throw t}var n2,xw;function gV(){if(xw)return n2;xw=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):e.call(d)==="[object Array]"},s=function(d){if(!d||e.call(d)!=="[object Object]")return!1;var h=t.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&t.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!h&&!p)return!1;var g;for(g in d);return typeof g>"u"||t.call(d,g)},a=function(d,h){n&&h.name==="__proto__"?n(d,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):d[h.name]=h.newValue},l=function(d,h){if(h==="__proto__")if(t.call(d,h)){if(r)return r(d,h).value}else return;return d[h]};return n2=function u(){var d,h,p,g,b,y,E=arguments[0],T=1,S=arguments.length,A=!1;for(typeof E=="boolean"&&(A=E,E=arguments[1]||{},T=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});T<S;++T)if(d=arguments[T],d!=null)for(h in d)p=l(E,h),g=l(d,h),E!==g&&(A&&g&&(s(g)||(b=i(g)))?(b?(b=!1,y=p&&i(p)?p:[]):y=p&&s(p)?p:{},a(E,{name:h,newValue:u(A,y,g)})):typeof g<"u"&&a(E,{name:h,newValue:g}));return E},n2}var bV=gV();const r2=mh(bV);function JE(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function vV(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...i);function l(u,...d){const h=t[++s];let p=-1;if(u){a(u);return}for(;++p<i.length;)(d[p]===null||d[p]===void 0)&&(d[p]=i[p]);i=d,h?yV(h,l)(...d):a(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function yV(t,e){let n;return r;function r(...a){const l=t.length>a.length;let u;l&&a.push(i);try{u=t.apply(this,a)}catch(d){const h=d;if(l&&n)throw h;return i(h)}l||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(a,...l){n||(n=!0,e(a,...l))}function s(a){i(null,a)}}const ua={basename:EV,dirname:_V,extname:xV,join:TV,sep:"/"};function EV(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Ch(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,l=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),l>-1&&(t.codePointAt(i)===e.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function _V(t){if(Ch(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function xV(t){Ch(t);let e=t.length,n=-1,r=0,i=-1,s=0,a;for(;e--;){const l=t.codePointAt(e);if(l===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),l===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function TV(...t){let e=-1,n;for(;++e<t.length;)Ch(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":SV(n)}function SV(t){Ch(t);const e=t.codePointAt(0)===47;let n=wV(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function wV(t,e){let n="",r=0,i=-1,s=0,a=-1,l,u;for(;++a<=t.length;){if(a<t.length)l=t.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,s=0}else l===46&&s>-1?s++:s=-1}return n}function Ch(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const kV={cwd:CV};function CV(){return"/"}function e4(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function AV(t){if(typeof t=="string")t=new URL(t);else if(!e4(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return NV(t)}function NV(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const i2=["history","path","basename","stem","extname","dirname"];class w9{constructor(e){let n;e?e4(e)?n={path:e}:typeof e=="string"||MV(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":kV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<i2.length;){const s=i2[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)i2.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ua.basename(this.path):void 0}set basename(e){a2(e,"basename"),s2(e,"basename"),this.path=ua.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ua.dirname(this.path):void 0}set dirname(e){Tw(this.basename,"dirname"),this.path=ua.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ua.extname(this.path):void 0}set extname(e){if(s2(e,"extname"),Tw(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ua.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){e4(e)&&(e=AV(e)),a2(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ua.basename(this.path,this.extname):void 0}set stem(e){a2(e,"stem"),s2(e,"stem"),this.path=ua.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new di(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function s2(t,e){if(t&&t.includes(ua.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ua.sep+"`")}function a2(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function Tw(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function MV(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const OV=function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},RV={}.hasOwnProperty;class Z3 extends OV{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vV()}copy(){const e=new Z3;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(r2(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(u2("data",this.frozen),this.namespace[e]=n,this):RV.call(this.namespace,e)&&this.namespace[e]||void 0:e?(u2("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=lm(e),r=this.parser||this.Parser;return o2("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),o2("process",this.parser||this.Parser),l2("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const l=lm(e),u=r.parse(l);r.run(u,l,function(h,p,g){if(h||!p||!g)return d(h);const b=p,y=r.stringify(b,g);LV(y)?g.value=y:g.result=y,d(h,g)});function d(h,p){h||!p?a(h):s?s(p):n(void 0,p)}}}processSync(e){let n=!1,r;return this.freeze(),o2("processSync",this.parser||this.Parser),l2("processSync",this.compiler||this.Compiler),this.process(e,i),ww("processSync","process",n),r;function i(s,a){n=!0,_w(s),r=a}}run(e,n,r){Sw(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,l){const u=lm(n);i.run(e,u,d);function d(h,p,g){const b=p||e;h?l(h):a?a(b):r(void 0,b,g)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),ww("runSync","run",r),i;function s(a,l){_w(a),i=l,r=!0}}stringify(e,n){this.freeze();const r=lm(n),i=this.compiler||this.Compiler;return l2("stringify",i),Sw(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(u2("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?l(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[h,...p]=d;u(h,p)}else a(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function a(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(d.plugins),d.settings&&(i.settings=r2(!0,i.settings,d.settings))}function l(d){let h=-1;if(d!=null)if(Array.isArray(d))for(;++h<d.length;){const p=d[h];s(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,h){let p=-1,g=-1;for(;++p<r.length;)if(r[p][0]===d){g=p;break}if(g===-1)r.push([d,...h]);else if(h.length>0){let[b,...y]=h;const E=r[g][1];JE(E)&&JE(b)&&(b=r2(!0,E,b)),r[g]=[d,b,...y]}}}}const DV=new Z3().freeze();function o2(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function l2(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function u2(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sw(t){if(!JE(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function ww(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function lm(t){return IV(t)?t:new w9(t)}function IV(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function LV(t){return typeof t=="string"||PV(t)}function PV(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const BV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kw=[],Cw={allowDangerousHtml:!0},zV=/^(https?|ircs?|mailto|xmpp)$/i,FV=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function UV(t){const e=HV(t),n=jV(t);return $V(e.runSync(e.parse(n),n),t)}function HV(t){const e=t.rehypePlugins||kw,n=t.remarkPlugins||kw,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Cw}:Cw;return DV().use(xq).use(n).use(mV,r).use(e)}function jV(t){const e=t.children||"",n=new w9;return typeof e=="string"&&(n.value=e),n}function $V(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,a=e.skipHtml,l=e.unwrapDisallowed,u=e.urlTransform||qV;for(const h of FV)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+BV+h.id,void 0);return kh(t,d),sj(t,{Fragment:C.Fragment,components:i,ignoreInvalidStyle:!0,jsx:C.jsx,jsxs:C.jsxs,passKeys:!0,passNode:!0});function d(h,p,g){if(h.type==="raw"&&g&&typeof p=="number")return a?g.children.splice(p,1):g.children[p]={type:"text",value:h.value},p;if(h.type==="element"){let b;for(b in Jy)if(Object.hasOwn(Jy,b)&&Object.hasOwn(h.properties,b)){const y=h.properties[b],E=Jy[b];(E===null||E.includes(h.tagName))&&(h.properties[b]=u(String(y||""),b,h))}}if(h.type==="element"){let b=n?!n.includes(h.tagName):s?s.includes(h.tagName):!1;if(!b&&r&&typeof p=="number"&&(b=!r(h,p,g)),b&&g&&typeof p=="number")return l&&h.children?g.children.splice(p,1,...h.children):g.children.splice(p,1),p}}}function qV(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||zV.test(t.slice(0,e))?t:""}function Aw(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function VV(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function GV(t,e,n){const i=wh((n||{}).ignore||[]),s=YV(e);let a=-1;for(;++a<s.length;)Q3(t,"text",l);function l(d,h){let p=-1,g;for(;++p<h.length;){const b=h[p],y=g?g.children:void 0;if(i(b,y?y.indexOf(b):void 0,g))return;g=b}if(g)return u(d,h)}function u(d,h){const p=h[h.length-1],g=s[a][0],b=s[a][1];let y=0;const T=p.children.indexOf(d);let S=!1,A=[];g.lastIndex=0;let R=g.exec(d.value);for(;R;){const z=R.index,I={index:R.index,input:R.input,stack:[...h,d]};let P=b(...R,I);if(typeof P=="string"&&(P=P.length>0?{type:"text",value:P}:void 0),P===!1?g.lastIndex=z+1:(y!==z&&A.push({type:"text",value:d.value.slice(y,z)}),Array.isArray(P)?A.push(...P):P&&A.push(P),y=z+R[0].length,S=!0),!g.global)break;R=g.exec(d.value)}return S?(y<d.value.length&&A.push({type:"text",value:d.value.slice(y)}),p.children.splice(T,1,...A)):A=[d],T+A.length}}function YV(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([WV(i[0]),KV(i[1])])}return e}function WV(t){return typeof t=="string"?new RegExp(VV(t),"g"):t}function KV(t){return typeof t=="function"?t:function(){return t}}const c2="phrasing",d2=["autolink","link","image","label"];function XV(){return{transforms:[rG],enter:{literalAutolink:ZV,literalAutolinkEmail:f2,literalAutolinkHttp:f2,literalAutolinkWww:f2},exit:{literalAutolink:nG,literalAutolinkEmail:tG,literalAutolinkHttp:JV,literalAutolinkWww:eG}}}function QV(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:c2,notInConstruct:d2},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:c2,notInConstruct:d2},{character:":",before:"[ps]",after:"\\/",inConstruct:c2,notInConstruct:d2}]}}function ZV(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function f2(t){this.config.enter.autolinkProtocol.call(this,t)}function JV(t){this.config.exit.autolinkProtocol.call(this,t)}function eG(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function tG(t){this.config.exit.autolinkEmail.call(this,t)}function nG(t){this.exit(t)}function rG(t){GV(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,iG],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),sG]],{ignore:["link","linkReference"]})}function iG(t,e,n,r,i){let s="";if(!k9(i)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!aG(n)))return!1;const a=oG(n+r);if(!a[0])return!1;const l={type:"link",title:null,url:s+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[l,{type:"text",value:a[1]}]:l}function sG(t,e,n,r){return!k9(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function aG(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function oG(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=Aw(t,"(");let s=Aw(t,")");for(;r!==-1&&i>s;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[t,n]}function k9(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||Iu(n)||W1(n))&&(!e||n!==47)}C9.peek=gG;function lG(){this.buffer()}function uG(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function cG(){this.buffer()}function dG(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function fG(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xs(this.sliceSerialize(t)).toLowerCase(),n.label=e}function hG(t){this.exit(t)}function pG(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xs(this.sliceSerialize(t)).toLowerCase(),n.label=e}function mG(t){this.exit(t)}function gG(){return"["}function C9(t,e,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return s+=i.move(n.safe(n.associationId(t),{after:"]",before:s})),l(),a(),s+=i.move("]"),s}function bG(){return{enter:{gfmFootnoteCallString:lG,gfmFootnoteCall:uG,gfmFootnoteDefinitionLabelString:cG,gfmFootnoteDefinition:dG},exit:{gfmFootnoteCallString:fG,gfmFootnoteCall:hG,gfmFootnoteDefinitionLabelString:pG,gfmFootnoteDefinition:mG}}}function vG(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:C9},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const l=s.createTracker(a);let u=l.move("[^");const d=s.enter("footnoteDefinition"),h=s.enter("label");return u+=l.move(s.safe(s.associationId(r),{before:u,after:"]"})),h(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((e?`
`:" ")+s.indentLines(s.containerFlow(r,l.current()),e?A9:yG))),d(),u}}function yG(t,e,n){return e===0?t:A9(t,e,n)}function A9(t,e,n){return(n?"":"    ")+t}const EG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];N9.peek=wG;function _G(){return{canContainEols:["delete"],enter:{strikethrough:TG},exit:{strikethrough:SG}}}function xG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:EG}],handlers:{delete:N9}}}function TG(t){this.enter({type:"delete",children:[]},t)}function SG(t){this.exit(t)}function N9(t,e,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(t,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function wG(){return"~"}function kG(t){return t.length}function CG(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||kG,s=[],a=[],l=[],u=[];let d=0,h=-1;for(;++h<t.length;){const E=[],T=[];let S=-1;for(t[h].length>d&&(d=t[h].length);++S<t[h].length;){const A=AG(t[h][S]);if(n.alignDelimiters!==!1){const R=i(A);T[S]=R,(u[S]===void 0||R>u[S])&&(u[S]=R)}E.push(A)}a[h]=E,l[h]=T}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)s[p]=Nw(r[p]);else{const E=Nw(r);for(;++p<d;)s[p]=E}p=-1;const g=[],b=[];for(;++p<d;){const E=s[p];let T="",S="";E===99?(T=":",S=":"):E===108?T=":":E===114&&(S=":");let A=n.alignDelimiters===!1?1:Math.max(1,u[p]-T.length-S.length);const R=T+"-".repeat(A)+S;n.alignDelimiters!==!1&&(A=T.length+A+S.length,A>u[p]&&(u[p]=A),b[p]=A),g[p]=R}a.splice(1,0,g),l.splice(1,0,b),h=-1;const y=[];for(;++h<a.length;){const E=a[h],T=l[h];p=-1;const S=[];for(;++p<d;){const A=E[p]||"";let R="",z="";if(n.alignDelimiters!==!1){const I=u[p]-(T[p]||0),P=s[p];P===114?R=" ".repeat(I):P===99?I%2?(R=" ".repeat(I/2+.5),z=" ".repeat(I/2-.5)):(R=" ".repeat(I/2),z=R):z=" ".repeat(I)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(R),S.push(A),n.alignDelimiters!==!1&&S.push(z),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&S.push("|")}y.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return y.join(`
`)}function AG(t){return t==null?"":String(t)}function Nw(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}const Mw={}.hasOwnProperty;function M9(t,e){const n=e||{};function r(i,...s){let a=r.invalid;const l=r.handlers;if(i&&Mw.call(i,t)){const u=String(i[t]);a=Mw.call(l,u)?l[u]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function NG(t,e,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(t,s.current()),MG);return i(),a}function MG(t,e,n){return">"+(n?"":" ")+t}function OG(t,e){return Ow(t,e.inConstruct,!0)&&!Ow(t,e.notInConstruct,!1)}function Ow(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function Rw(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&OG(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function O9(t,e){const n=String(t);let r=n.indexOf(e),i=r,s=0,a=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+e.length,r=n.indexOf(e,i);return a}function RG(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function DG(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function IG(t,e,n,r){const i=DG(n),s=t.value||"",a=i==="`"?"GraveAccent":"Tilde";if(RG(t,n)){const p=n.enter("codeIndented"),g=n.indentLines(s,LG);return p(),g}const l=n.createTracker(r),u=i.repeat(Math.max(O9(s,i)+1,3)),d=n.enter("codeFenced");let h=l.move(u);if(t.lang){const p=n.enter(`codeFencedLang${a}`);h+=l.move(n.safe(t.lang,{before:h,after:" ",encode:["`"],...l.current()})),p()}if(t.lang&&t.meta){const p=n.enter(`codeFencedMeta${a}`);h+=l.move(" "),h+=l.move(n.safe(t.meta,{before:h,after:`
`,encode:["`"],...l.current()})),p()}return h+=l.move(`
`),s&&(h+=l.move(s+`
`)),h+=l.move(u),d(),h}function LG(t,e,n){return(n?"":"    ")+t}function J3(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function PG(t,e,n,r){const i=J3(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(t),{before:d,after:"]",...u.current()})),d+=u.move("]: "),l(),!t.url||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":`
`,...u.current()}))),l(),t.title&&(l=n.enter(`title${s}`),d+=u.move(" "+i),d+=u.move(n.safe(t.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),a(),d}function BG(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Wf(t){return"&#x"+t.toString(16).toUpperCase()+";"}function yg(t,e,n){const r=ad(t),i=ad(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}R9.peek=zG;function R9(t,e,n,r){const i=BG(n),s=n.enter("emphasis"),a=n.createTracker(r),l=a.move(i);let u=a.move(n.containerPhrasing(t,{after:i,before:l,...a.current()}));const d=u.charCodeAt(0),h=yg(r.before.charCodeAt(r.before.length-1),d,i);h.inside&&(u=Wf(d)+u.slice(1));const p=u.charCodeAt(u.length-1),g=yg(r.after.charCodeAt(0),p,i);g.inside&&(u=u.slice(0,-1)+Wf(p));const b=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+u+b}function zG(t,e,n){return n.options.emphasis||"*"}function FG(t,e){let n=!1;return kh(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,QE}),!!((!t.depth||t.depth<3)&&q3(t)&&(e.options.setext||n))}function UG(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(r);if(FG(t,n)){const h=n.enter("headingSetext"),p=n.enter("phrasing"),g=n.containerPhrasing(t,{...s.current(),before:`
`,after:`
`});return p(),h(),g+`
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
`))+1))}const a="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");s.move(a+" ");let d=n.containerPhrasing(t,{before:"# ",after:`
`,...s.current()});return/^[\t ]/.test(d)&&(d=Wf(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),u(),l(),d}D9.peek=HG;function D9(t){return t.value||""}function HG(){return"<"}I9.peek=jG;function I9(t,e,n,r){const i=J3(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(t.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":")",...u.current()}))),l(),t.title&&(l=n.enter(`title${s}`),d+=u.move(" "+i),d+=u.move(n.safe(t.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),d+=u.move(")"),a(),d}function jG(){return"!"}L9.peek=$G;function L9(t,e,n,r){const i=t.referenceType,s=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const d=n.safe(t.alt,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(t),{before:u,after:"]",...l.current()});return a(),n.stack=h,s(),i==="full"||!d||d!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function $G(){return"!"}P9.peek=qG;function P9(t,e,n){let r=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],l=n.compilePattern(a);let u;if(a.atBreak)for(;u=l.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return i+r+i}function qG(){return"`"}function B9(t,e){const n=q3(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}z9.peek=VG;function z9(t,e,n,r){const i=J3(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,u;if(B9(t,n)){const h=n.stack;n.stack=[],l=n.enter("autolink");let p=a.move("<");return p+=a.move(n.containerPhrasing(t,{before:p,after:">",...a.current()})),p+=a.move(">"),l(),n.stack=h,p}l=n.enter("link"),u=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(t,{before:d,after:"](",...a.current()})),d+=a.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(t.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(u=n.enter("destinationRaw"),d+=a.move(n.safe(t.url,{before:d,after:t.title?" ":")",...a.current()}))),u(),t.title&&(u=n.enter(`title${s}`),d+=a.move(" "+i),d+=a.move(n.safe(t.title,{before:d,after:i,...a.current()})),d+=a.move(i),u()),d+=a.move(")"),l(),d}function VG(t,e,n){return B9(t,n)?"<":"["}F9.peek=GG;function F9(t,e,n,r){const i=t.referenceType,s=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const d=n.containerPhrasing(t,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(t),{before:u,after:"]",...l.current()});return a(),n.stack=h,s(),i==="full"||!d||d!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function GG(){return"["}function e_(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function YG(t){const e=e_(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function WG(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function U9(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function KG(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=t.ordered?WG(n):e_(n);const l=t.ordered?a==="."?")":".":YG(n);let u=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),U9(n)===a&&h){let p=-1;for(;++p<t.children.length;){const g=t.children[p];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=l),n.bulletCurrent=a;const d=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),d}function XG(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function QG(t,e,n,r){const i=XG(n);let s=n.bulletCurrent||e_(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(r);l.move(s+" ".repeat(a-s.length)),l.shift(a);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(t,l.current()),h);return u(),d;function h(p,g,b){return g?(b?"":" ".repeat(a))+p:(b?s:s+" ".repeat(a-s.length))+p}}function ZG(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(t,r);return s(),i(),a}const JG=wh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function eY(t,e,n,r){return(t.children.some(function(a){return JG(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function tY(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}H9.peek=nY;function H9(t,e,n,r){const i=tY(n),s=n.enter("strong"),a=n.createTracker(r),l=a.move(i+i);let u=a.move(n.containerPhrasing(t,{after:i,before:l,...a.current()}));const d=u.charCodeAt(0),h=yg(r.before.charCodeAt(r.before.length-1),d,i);h.inside&&(u=Wf(d)+u.slice(1));const p=u.charCodeAt(u.length-1),g=yg(r.after.charCodeAt(0),p,i);g.inside&&(u=u.slice(0,-1)+Wf(p));const b=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+u+b}function nY(t,e,n){return n.options.strong||"*"}function rY(t,e,n,r){return n.safe(t.value,r)}function iY(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function sY(t,e,n){const r=(U9(n)+(n.options.ruleSpaces?" ":"")).repeat(iY(n));return n.options.ruleSpaces?r.slice(0,-1):r}const j9={blockquote:NG,break:Rw,code:IG,definition:PG,emphasis:R9,hardBreak:Rw,heading:UG,html:D9,image:I9,imageReference:L9,inlineCode:P9,link:z9,linkReference:F9,list:KG,listItem:QG,paragraph:ZG,root:eY,strong:H9,text:rY,thematicBreak:sY};function aY(){return{enter:{table:oY,tableData:Dw,tableHeader:Dw,tableRow:uY},exit:{codeText:cY,table:lY,tableData:h2,tableHeader:h2,tableRow:h2}}}function oY(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function lY(t){this.exit(t),this.data.inTable=void 0}function uY(t){this.enter({type:"tableRow",children:[]},t)}function h2(t){this.exit(t)}function Dw(t){this.enter({type:"tableCell",children:[]},t)}function cY(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,dY));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function dY(t,e){return e==="|"?e:t}function fY(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:a,tableCell:u,tableRow:l}};function a(b,y,E,T){return d(h(b,E,T),b.align)}function l(b,y,E,T){const S=p(b,E,T),A=d([S]);return A.slice(0,A.indexOf(`
`))}function u(b,y,E,T){const S=E.enter("tableCell"),A=E.enter("phrasing"),R=E.containerPhrasing(b,{...T,before:s,after:s});return A(),S(),R}function d(b,y){return CG(b,{align:y,alignDelimiters:r,padding:n,stringLength:i})}function h(b,y,E){const T=b.children;let S=-1;const A=[],R=y.enter("table");for(;++S<T.length;)A[S]=p(T[S],y,E);return R(),A}function p(b,y,E){const T=b.children;let S=-1;const A=[],R=y.enter("tableRow");for(;++S<T.length;)A[S]=u(T[S],b,y,E);return R(),A}function g(b,y,E){let T=j9.inlineCode(b,y,E);return E.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function hY(){return{exit:{taskListCheckValueChecked:Iw,taskListCheckValueUnchecked:Iw,paragraph:mY}}}function pY(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:gY}}}function Iw(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function mY(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,a;for(;++s<i.length;){const l=i[s];if(l.type==="paragraph"){a=l;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function gY(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);s&&l.move(a);let u=j9.listItem(t,e,n,{...r,...l.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(h){return h+a}}function bY(){return[XV(),bG(),_G(),aY(),hY()]}function vY(t){return{extensions:[QV(),vG(t),xG(),fY(t),pY()]}}const yY={tokenize:wY,partial:!0},$9={tokenize:kY,partial:!0},q9={tokenize:CY,partial:!0},V9={tokenize:AY,partial:!0},EY={tokenize:NY,partial:!0},G9={name:"wwwAutolink",tokenize:TY,previous:W9},Y9={name:"protocolAutolink",tokenize:SY,previous:K9},To={name:"emailAutolink",tokenize:xY,previous:X9},ka={};function _Y(){return{text:ka}}let fu=48;for(;fu<123;)ka[fu]=To,fu++,fu===58?fu=65:fu===91&&(fu=97);ka[43]=To;ka[45]=To;ka[46]=To;ka[95]=To;ka[72]=[To,Y9];ka[104]=[To,Y9];ka[87]=[To,G9];ka[119]=[To,G9];function xY(t,e,n){const r=this;let i,s;return a;function a(p){return!t4(p)||!X9.call(r,r.previous)||t_(r.events)?n(p):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),l(p))}function l(p){return t4(p)?(t.consume(p),l):p===64?(t.consume(p),u):n(p)}function u(p){return p===46?t.check(EY,h,d)(p):p===45||p===95||ci(p)?(s=!0,t.consume(p),u):h(p)}function d(p){return t.consume(p),i=!0,u}function h(p){return s&&i&&xi(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(p)):n(p)}}function TY(t,e,n){const r=this;return i;function i(a){return a!==87&&a!==119||!W9.call(r,r.previous)||t_(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(yY,t.attempt($9,t.attempt(q9,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function SY(t,e,n){const r=this;let i="",s=!1;return a;function a(p){return(p===72||p===104)&&K9.call(r,r.previous)&&!t_(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),t.consume(p),l):n(p)}function l(p){if(xi(p)&&i.length<5)return i+=String.fromCodePoint(p),t.consume(p),l;if(p===58){const g=i.toLowerCase();if(g==="http"||g==="https")return t.consume(p),u}return n(p)}function u(p){return p===47?(t.consume(p),s?d:(s=!0,u)):n(p)}function d(p){return p===null||bg(p)||_n(p)||Iu(p)||W1(p)?n(p):t.attempt($9,t.attempt(q9,h),n)(p)}function h(p){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(p)}}function wY(t,e,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),i):a===46&&r===3?(t.consume(a),s):n(a)}function s(a){return a===null?n(a):e(a)}}function kY(t,e,n){let r,i,s;return a;function a(d){return d===46||d===95?t.check(V9,u,l)(d):d===null||_n(d)||Iu(d)||d!==45&&W1(d)?u(d):(s=!0,t.consume(d),a)}function l(d){return d===95?r=!0:(i=r,r=void 0),t.consume(d),a}function u(d){return i||r||!s?n(d):e(d)}}function CY(t,e){let n=0,r=0;return i;function i(a){return a===40?(n++,t.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(V9,e,s)(a):a===null||_n(a)||Iu(a)?e(a):(t.consume(a),i)}function s(a){return a===41&&r++,t.consume(a),i}}function AY(t,e,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(t.consume(l),r):l===38?(t.consume(l),s):l===93?(t.consume(l),i):l===60||l===null||_n(l)||Iu(l)?e(l):n(l)}function i(l){return l===null||l===40||l===91||_n(l)||Iu(l)?e(l):r(l)}function s(l){return xi(l)?a(l):n(l)}function a(l){return l===59?(t.consume(l),r):xi(l)?(t.consume(l),a):n(l)}}function NY(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return ci(s)?n(s):e(s)}}function W9(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||_n(t)}function K9(t){return!xi(t)}function X9(t){return!(t===47||t4(t))}function t4(t){return t===43||t===45||t===46||t===95||ci(t)}function t_(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const MY={tokenize:zY,partial:!0};function OY(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:LY,continuation:{tokenize:PY},exit:BY}},text:{91:{name:"gfmFootnoteCall",tokenize:IY},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:RY,resolveTo:DY}}}}function RY(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!a||!a._balanced)return n(u);const d=Xs(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!s.includes(d.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function DY(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...l),t}function IY(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return l;function l(p){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(t.enter("gfmFootnoteCallMarker"),t.consume(p),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(p){if(s>999||p===93&&!a||p===null||p===91||_n(p))return n(p);if(p===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return i.includes(Xs(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(p)}return _n(p)||(a=!0),s++,t.consume(p),p===92?h:d}function h(p){return p===91||p===92||p===93?(t.consume(p),s++,d):d(p)}}function LY(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,l;return u;function u(y){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(y){return y===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):n(y)}function h(y){if(a>999||y===93&&!l||y===null||y===91||_n(y))return n(y);if(y===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return s=Xs(r.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return _n(y)||(l=!0),a++,t.consume(y),y===92?p:h}function p(y){return y===91||y===92||y===93?(t.consume(y),a++,h):h(y)}function g(y){return y===58?(t.enter("definitionMarker"),t.consume(y),t.exit("definitionMarker"),i.includes(s)||i.push(s),zt(t,b,"gfmFootnoteDefinitionWhitespace")):n(y)}function b(y){return e(y)}}function PY(t,e,n){return t.check(Sh,e,t.attempt(MY,e,n))}function BY(t){t.exit("gfmFootnoteDefinition")}function zY(t,e,n){const r=this;return zt(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(s):n(s)}}function FY(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,l){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let d=u;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[u][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[u][1].end)},p={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[u][1].start)},g=[["enter",h,l],["enter",a[d][1],l],["exit",a[d][1],l],["enter",p,l]],b=l.parser.constructs.insideSpan.null;b&&ls(g,g.length,0,K1(b,a.slice(d+1,u),l)),ls(g,g.length,0,[["exit",p,l],["enter",a[u][1],l],["exit",a[u][1],l],["exit",h,l]]),ls(a,d-1,u-d+3,g),u=d+g.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function s(a,l,u){const d=this.previous,h=this.events;let p=0;return g;function g(y){return d===126&&h[h.length-1][1].type!=="characterEscape"?u(y):(a.enter("strikethroughSequenceTemporary"),b(y))}function b(y){const E=ad(d);if(y===126)return p>1?u(y):(a.consume(y),p++,b);if(p<2&&!n)return u(y);const T=a.exit("strikethroughSequenceTemporary"),S=ad(y);return T._open=!S||S===2&&!!E,T._close=!E||E===2&&!!S,l(y)}}}class UY{constructor(){this.map=[]}add(e,n,r){HY(this,e,n,r)}consume(e){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function HY(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function jY(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function $Y(){return{flow:{null:{name:"table",tokenize:qY,resolveAll:VY}}}}function qY(t,e,n){const r=this;let i=0,s=0,a;return l;function l(W){let re=r.events.length-1;for(;re>-1;){const ae=r.events[re][1].type;if(ae==="lineEnding"||ae==="linePrefix")re--;else break}const ie=re>-1?r.events[re][1].type:null,ye=ie==="tableHead"||ie==="tableRow"?P:u;return ye===P&&r.parser.lazy[r.now().line]?n(W):ye(W)}function u(W){return t.enter("tableHead"),t.enter("tableRow"),d(W)}function d(W){return W===124||(a=!0,s+=1),h(W)}function h(W){return W===null?n(W):it(W)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(W),t.exit("lineEnding"),b):n(W):$t(W)?zt(t,h,"whitespace")(W):(s+=1,a&&(a=!1,i+=1),W===124?(t.enter("tableCellDivider"),t.consume(W),t.exit("tableCellDivider"),a=!0,h):(t.enter("data"),p(W)))}function p(W){return W===null||W===124||_n(W)?(t.exit("data"),h(W)):(t.consume(W),W===92?g:p)}function g(W){return W===92||W===124?(t.consume(W),p):p(W)}function b(W){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(W):(t.enter("tableDelimiterRow"),a=!1,$t(W)?zt(t,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):y(W))}function y(W){return W===45||W===58?T(W):W===124?(a=!0,t.enter("tableCellDivider"),t.consume(W),t.exit("tableCellDivider"),E):I(W)}function E(W){return $t(W)?zt(t,T,"whitespace")(W):T(W)}function T(W){return W===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(W),t.exit("tableDelimiterMarker"),S):W===45?(s+=1,S(W)):W===null||it(W)?z(W):I(W)}function S(W){return W===45?(t.enter("tableDelimiterFiller"),A(W)):I(W)}function A(W){return W===45?(t.consume(W),A):W===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(W),t.exit("tableDelimiterMarker"),R):(t.exit("tableDelimiterFiller"),R(W))}function R(W){return $t(W)?zt(t,z,"whitespace")(W):z(W)}function z(W){return W===124?y(W):W===null||it(W)?!a||i!==s?I(W):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(W)):I(W)}function I(W){return n(W)}function P(W){return t.enter("tableRow"),$(W)}function $(W){return W===124?(t.enter("tableCellDivider"),t.consume(W),t.exit("tableCellDivider"),$):W===null||it(W)?(t.exit("tableRow"),e(W)):$t(W)?zt(t,$,"whitespace")(W):(t.enter("data"),K(W))}function K(W){return W===null||W===124||_n(W)?(t.exit("data"),$(W)):(t.consume(W),W===92?Z:K)}function Z(W){return W===92||W===124?(t.consume(W),K):K(W)}}function VY(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],l=!1,u=0,d,h,p;const g=new UY;for(;++n<t.length;){const b=t[n],y=b[1];b[0]==="enter"?y.type==="tableHead"?(l=!1,u!==0&&(Lw(g,e,u,d,h),h=void 0,u=0),d={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},g.add(n,0,[["enter",d,e]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,p=void 0,s=[0,0,0,0],a=[0,n+1,0,0],l&&(l=!1,h={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},g.add(n,0,[["enter",h,e]])),i=y.type==="tableDelimiterRow"?2:h?3:1):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],p=um(g,e,s,i,void 0,p),s=[0,0,0,0]),a[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],p=um(g,e,s,i,void 0,p)),s=a,a=[s[1],n,0,0])):y.type==="tableHead"?(l=!0,u=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(u=n,s[1]!==0?(a[0]=a[1],p=um(g,e,s,i,n,p)):a[1]!==0&&(p=um(g,e,a,i,n,p)),i=0):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&Lw(g,e,u,d,h),g.consume(e.events),n=-1;++n<e.events.length;){const b=e.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=jY(e.events,n))}return t}function um(t,e,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(s.end=Object.assign({},jc(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const u=jc(e.events,n[1]);if(s={type:a,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const d=jc(e.events,n[2]),h=jc(e.events,n[3]),p={type:l,start:Object.assign({},d),end:Object.assign({},h)};if(t.add(n[2],0,[["enter",p,e]]),r!==2){const g=e.events[n[2]],b=e.events[n[3]];if(g[1].end=Object.assign({},b[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,E=n[3]-n[2]-1;t.add(y,E,[])}}t.add(n[3]+1,0,[["exit",p,e]])}return i!==void 0&&(s.end=Object.assign({},jc(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function Lw(t,e,n,r,i){const s=[],a=jc(e.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,e])),r.end=Object.assign({},a),s.push(["exit",r,e]),t.add(n+1,0,s)}function jc(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const GY={name:"tasklistCheck",tokenize:WY};function YY(){return{text:{91:GY}}}function WY(t,e,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),s)}function s(u){return _n(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):n(u)}function l(u){return it(u)?e(u):$t(u)?t.check({tokenize:KY},e,n)(u):n(u)}}function KY(t,e,n){return zt(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function XY(t){return s9([_Y(),OY(),FY(t),$Y(),YY()])}const QY={};function ZY(t){const e=this,n=t||QY,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(XY(n)),s.push(bY()),a.push(vY(n))}const Pw=/[#.]/g;function JY(t,e){const n=t||"",r={};let i=0,s,a;for(;i<n.length;){Pw.lastIndex=i;const l=Pw.exec(n),u=n.slice(i,l?l.index:n.length);u&&(s?s==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:a=u,i+=u.length),l&&(s=l[0],i++)}return{type:"element",tagName:a||e||"div",properties:r,children:[]}}function Q9(t,e,n){const r=n?rW(n):void 0;function i(s,a,...l){let u;if(s==null){u={type:"root",children:[]};const d=a;l.unshift(d)}else{u=JY(s,e);const d=u.tagName.toLowerCase(),h=r?r.get(d):void 0;if(u.tagName=h||d,eW(a))l.unshift(a);else for(const[p,g]of Object.entries(a))tW(t,u.properties,p,g)}for(const d of l)n4(u.children,d);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return i}function eW(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const i=e[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function tW(t,e,n,r){const i=U3(t,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=KS(r):i.commaSeparated?s=qS(r):i.commaOrSpaceSeparated?s=KS(qS(r).join(" ")):s=Bw(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?nW(r):String(r);if(Array.isArray(s)){const a=[];for(const l of s)a.push(Bw(i,i.property,l));s=a}i.property==="className"&&Array.isArray(e.className)&&(s=e.className.concat(s)),e[i.property]=s}}function n4(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)n4(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?n4(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function Bw(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||Gf(n)===Gf(e)))return!0}return n}function nW(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function rW(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const iW=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Z9=Q9(G1,"div"),J9=Q9(wd,"g",iW);function sW(t){const e=String(t),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=e.length){let a=0;for(;;){let l=n[a];if(l===void 0){const u=zw(e,n[a-1]);l=u===-1?e.length+1:u+1,n[a]=l}if(l>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const l=n[n.length-1],u=zw(e,l),d=u===-1?e.length+1:u+1;if(l===d)break;n.push(d)}const a=(s.line>1?n[s.line-2]:0)+s.column-1;if(a<n[s.line-1])return a}}}function zw(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
`,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const ma={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},eN={}.hasOwnProperty,aW=Object.prototype;function oW(t,e){const n=e||{};return n_({file:n.file||void 0,location:!1,schema:n.space==="svg"?wd:G1,verbose:n.verbose||!1},t)}function n_(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},eg(t,r,n),n}case"#document":case"#document-fragment":{const r=e,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:tN(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const s=String(t.file),a=sW(s),l=a.toPoint(0),u=a.toPoint(s.length);n.position={start:l,end:u}}return n}case"#documentType":{const r=e;return n={type:"doctype"},eg(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},eg(t,r,n),n}default:return n=lW(t,e),n}}function tN(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=n_(t,e[n]);r.push(i)}return r}function lW(t,e){const n=t.schema;t.schema=e.namespaceURI===ma.svg?wd:G1;let r=-1;const i={};for(;++r<e.attrs.length;){const l=e.attrs[r],u=(l.prefix?l.prefix+":":"")+l.name;eN.call(aW,u)||(i[u]=l.value)}const a=(t.schema.space==="svg"?J9:Z9)(e.tagName,i,tN(t,e.childNodes));if(eg(t,e,a),a.tagName==="template"){const l=e,u=l.sourceCodeLocation,d=u&&u.startTag&&Kc(u.startTag),h=u&&u.endTag&&Kc(u.endTag),p=n_(t,l.content);d&&h&&t.file&&(p.position={start:d.end,end:h.start}),a.content=p}return t.schema=n,a}function eg(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=uW(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function uW(t,e,n){const r=Kc(n);if(e.type==="element"){const i=e.children[e.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),t.verbose){const s={};let a;if(n.attrs)for(a in n.attrs)eN.call(n.attrs,a)&&(s[U3(t.schema,a).property]=Kc(n.attrs[a]));n.startTag;const l=Kc(n.startTag),u=n.endTag?Kc(n.endTag):void 0,d={opening:l};u&&(d.closing=u),d.properties=s,e.data={position:d}}}return r}function Kc(t){const e=Fw({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=Fw({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function Fw(t){return t.line&&t.column?t:void 0}let Ah=class{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}};Ah.prototype.property={};Ah.prototype.normal={};Ah.prototype.space=null;function nN(t,e){const n={},r={};let i=-1;for(;++i<t.length;)Object.assign(n,t[i].property),Object.assign(r,t[i].normal);return new Ah(n,r,e)}function r4(t){return t.toLowerCase()}class Bs{constructor(e,n){this.property=e,this.attribute=n}}Bs.prototype.space=null;Bs.prototype.boolean=!1;Bs.prototype.booleanish=!1;Bs.prototype.overloadedBoolean=!1;Bs.prototype.number=!1;Bs.prototype.commaSeparated=!1;Bs.prototype.spaceSeparated=!1;Bs.prototype.commaOrSpaceSeparated=!1;Bs.prototype.mustUseProperty=!1;Bs.prototype.defined=!1;let cW=0;const At=Yu(),yr=Yu(),rN=Yu(),Pe=Yu(),Cn=Yu(),ed=Yu(),ns=Yu();function Yu(){return 2**++cW}const i4=Object.freeze(Object.defineProperty({__proto__:null,boolean:At,booleanish:yr,commaOrSpaceSeparated:ns,commaSeparated:ed,number:Pe,overloadedBoolean:rN,spaceSeparated:Cn},Symbol.toStringTag,{value:"Module"})),p2=Object.keys(i4);class r_ extends Bs{constructor(e,n,r,i){let s=-1;if(super(e,n),Uw(this,"space",i),typeof r=="number")for(;++s<p2.length;){const a=p2[s];Uw(this,p2[s],(r&i4[a])===i4[a])}}}r_.prototype.defined=!0;function Uw(t,e,n){n&&(t[e]=n)}const dW={}.hasOwnProperty;function Cd(t){const e={},n={};let r;for(r in t.properties)if(dW.call(t.properties,r)){const i=t.properties[r],s=new r_(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[r4(r)]=r,n[r4(s.attribute)]=r}return new Ah(e,n,t.space)}const iN=Cd({space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),sN=Cd({space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function aN(t,e){return e in t?t[e]:e}function oN(t,e){return aN(t,e.toLowerCase())}const lN=Cd({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:oN,properties:{xmlns:null,xmlnsXLink:null}}),uN=Cd({transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:yr,ariaAutoComplete:null,ariaBusy:yr,ariaChecked:yr,ariaColCount:Pe,ariaColIndex:Pe,ariaColSpan:Pe,ariaControls:Cn,ariaCurrent:null,ariaDescribedBy:Cn,ariaDetails:null,ariaDisabled:yr,ariaDropEffect:Cn,ariaErrorMessage:null,ariaExpanded:yr,ariaFlowTo:Cn,ariaGrabbed:yr,ariaHasPopup:null,ariaHidden:yr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Cn,ariaLevel:Pe,ariaLive:null,ariaModal:yr,ariaMultiLine:yr,ariaMultiSelectable:yr,ariaOrientation:null,ariaOwns:Cn,ariaPlaceholder:null,ariaPosInSet:Pe,ariaPressed:yr,ariaReadOnly:yr,ariaRelevant:null,ariaRequired:yr,ariaRoleDescription:Cn,ariaRowCount:Pe,ariaRowIndex:Pe,ariaRowSpan:Pe,ariaSelected:yr,ariaSetSize:Pe,ariaSort:null,ariaValueMax:Pe,ariaValueMin:Pe,ariaValueNow:Pe,ariaValueText:null,role:null}}),fW=Cd({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:oN,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ed,acceptCharset:Cn,accessKey:Cn,action:null,allow:null,allowFullScreen:At,allowPaymentRequest:At,allowUserMedia:At,alt:null,as:null,async:At,autoCapitalize:null,autoComplete:Cn,autoFocus:At,autoPlay:At,blocking:Cn,capture:null,charSet:null,checked:At,cite:null,className:Cn,cols:Pe,colSpan:null,content:null,contentEditable:yr,controls:At,controlsList:Cn,coords:Pe|ed,crossOrigin:null,data:null,dateTime:null,decoding:null,default:At,defer:At,dir:null,dirName:null,disabled:At,download:rN,draggable:yr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:At,formTarget:null,headers:Cn,height:Pe,hidden:At,high:Pe,href:null,hrefLang:null,htmlFor:Cn,httpEquiv:Cn,id:null,imageSizes:null,imageSrcSet:null,inert:At,inputMode:null,integrity:null,is:null,isMap:At,itemId:null,itemProp:Cn,itemRef:Cn,itemScope:At,itemType:Cn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:At,low:Pe,manifest:null,max:null,maxLength:Pe,media:null,method:null,min:null,minLength:Pe,multiple:At,muted:At,name:null,nonce:null,noModule:At,noValidate:At,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:At,optimum:Pe,pattern:null,ping:Cn,placeholder:null,playsInline:At,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:At,referrerPolicy:null,rel:Cn,required:At,reversed:At,rows:Pe,rowSpan:Pe,sandbox:Cn,scope:null,scoped:At,seamless:At,selected:At,shadowRootClonable:At,shadowRootDelegatesFocus:At,shadowRootMode:null,shape:null,size:Pe,sizes:null,slot:null,span:Pe,spellCheck:yr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Pe,step:null,style:null,tabIndex:Pe,target:null,title:null,translate:null,type:null,typeMustMatch:At,useMap:null,value:yr,width:Pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Cn,axis:null,background:null,bgColor:null,border:Pe,borderColor:null,bottomMargin:Pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:At,declare:At,event:null,face:null,frame:null,frameBorder:null,hSpace:Pe,leftMargin:Pe,link:null,longDesc:null,lowSrc:null,marginHeight:Pe,marginWidth:Pe,noResize:At,noHref:At,noShade:At,noWrap:At,object:null,profile:null,prompt:null,rev:null,rightMargin:Pe,rules:null,scheme:null,scrolling:yr,standby:null,summary:null,text:null,topMargin:Pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:At,disableRemotePlayback:At,prefix:null,property:null,results:Pe,security:null,unselectable:null}}),hW=Cd({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:aN,properties:{about:ns,accentHeight:Pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Pe,amplitude:Pe,arabicForm:null,ascent:Pe,attributeName:null,attributeType:null,azimuth:Pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Pe,by:null,calcMode:null,capHeight:Pe,className:Cn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Pe,diffuseConstant:Pe,direction:null,display:null,dur:null,divisor:Pe,dominantBaseline:null,download:At,dx:null,dy:null,edgeMode:null,editable:null,elevation:Pe,enableBackground:null,end:null,event:null,exponent:Pe,externalResourcesRequired:null,fill:null,fillOpacity:Pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ed,g2:ed,glyphName:ed,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Pe,horizOriginX:Pe,horizOriginY:Pe,id:null,ideographic:Pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Pe,k:Pe,k1:Pe,k2:Pe,k3:Pe,k4:Pe,kernelMatrix:ns,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Pe,overlineThickness:Pe,paintOrder:null,panose1:null,path:null,pathLength:Pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Cn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Pe,pointsAtY:Pe,pointsAtZ:Pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ns,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ns,rev:ns,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ns,requiredFeatures:ns,requiredFonts:ns,requiredFormats:ns,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Pe,specularExponent:Pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Pe,strikethroughThickness:Pe,string:null,stroke:null,strokeDashArray:ns,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Pe,strokeOpacity:Pe,strokeWidth:null,style:null,surfaceScale:Pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ns,tabIndex:Pe,tableValues:null,target:null,targetX:Pe,targetY:Pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ns,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Pe,underlineThickness:Pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Pe,values:null,vAlphabetic:Pe,vMathematical:Pe,vectorEffect:null,vHanging:Pe,vIdeographic:Pe,version:null,vertAdvY:Pe,vertOriginX:Pe,vertOriginY:Pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),pW=/^data[-\w.:]+$/i,Hw=/-[a-z]/g,mW=/[A-Z]/g;function gW(t,e){const n=r4(e);let r=e,i=Bs;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&pW.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Hw,vW);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Hw.test(s)){let a=s.replace(mW,bW);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=r_}return new i(r,e)}function bW(t){return"-"+t.toLowerCase()}function vW(t){return t.charAt(1).toUpperCase()}const yW=nN([sN,iN,lN,uN,fW],"html"),cN=nN([sN,iN,lN,uN,hW],"svg"),EW={},_W={}.hasOwnProperty,dN=M9("type",{handlers:{root:TW,element:AW,text:kW,comment:CW,doctype:wW}});function xW(t,e){const r=(e||EW).space;return dN(t,r==="svg"?cN:yW)}function TW(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=i_(t.children,n,e),Ad(t,n),n}function SW(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=i_(t.children,n,e),Ad(t,n),n}function wW(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ad(t,e),e}function kW(t){const e={nodeName:"#text",value:t.value,parentNode:null};return Ad(t,e),e}function CW(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return Ad(t,e),e}function AW(t,e){const n=e;let r=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=cN);const i=[];let s;if(t.properties){for(s in t.properties)if(s!=="children"&&_W.call(t.properties,s)){const u=NW(r,s,t.properties[s]);u&&i.push(u)}}const a=r.space,l={nodeName:t.tagName,tagName:t.tagName,attrs:i,namespaceURI:ma[a],childNodes:[],parentNode:null};return l.childNodes=i_(t.children,l,r),Ad(t,l),t.tagName==="template"&&t.content&&(l.content=SW(t.content,r)),l}function NW(t,e,n){const r=gW(t,e);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?qA(n):ZA(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=ma[r.space]}return i}function i_(t,e,n){let r=-1;const i=[];if(t)for(;++r<t.length;){const s=dN(t[r],n);s.parentNode=e,i.push(s)}return i}function Ad(t,e){const n=t.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,e.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const MW=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],OW=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Fn="�";var F;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(F||(F={}));const Ii={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function fN(t){return t>=55296&&t<=57343}function RW(t){return t>=56320&&t<=57343}function DW(t,e){return(t-55296)*1024+9216+e}function hN(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function pN(t){return t>=64976&&t<=65007||OW.has(t)}var ve;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ve||(ve={}));const IW=65536;class LW{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=IW,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:i,offset:s}=this,a=i+n,l=s+n;return{code:e,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:l,endOffset:l}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(RW(n))return this.pos++,this._addGap(),DW(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,F.EOF;return this._err(ve.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;const r=this.html.charCodeAt(n);return r===F.CARRIAGE_RETURN?F.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;let e=this.html.charCodeAt(this.pos);return e===F.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,F.LINE_FEED):e===F.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,fN(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===F.LINE_FEED||e===F.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){hN(e)?this._err(ve.controlCharacterInInputStream):pN(e)&&this._err(ve.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Bt;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(Bt||(Bt={}));function mN(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const PW=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),BW=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function zW(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=BW.get(t))!==null&&e!==void 0?e:t}var Hr;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Hr||(Hr={}));const FW=32;var vl;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(vl||(vl={}));function s4(t){return t>=Hr.ZERO&&t<=Hr.NINE}function UW(t){return t>=Hr.UPPER_A&&t<=Hr.UPPER_F||t>=Hr.LOWER_A&&t<=Hr.LOWER_F}function HW(t){return t>=Hr.UPPER_A&&t<=Hr.UPPER_Z||t>=Hr.LOWER_A&&t<=Hr.LOWER_Z||s4(t)}function jW(t){return t===Hr.EQUALS||HW(t)}var Br;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Br||(Br={}));var ao;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(ao||(ao={}));class $W{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Br.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ao.Strict}startEntity(e){this.decodeMode=e,this.state=Br.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Br.EntityStart:return e.charCodeAt(n)===Hr.NUM?(this.state=Br.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Br.NamedEntity,this.stateNamedEntity(e,n));case Br.NumericStart:return this.stateNumericStart(e,n);case Br.NumericDecimal:return this.stateNumericDecimal(e,n);case Br.NumericHex:return this.stateNumericHex(e,n);case Br.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|FW)===Hr.LOWER_X?(this.state=Br.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Br.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(s4(i)||UW(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(s4(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Hr.SEMI)this.consumed+=1;else if(this.decodeMode===ao.Strict)return 0;return this.emitCodePoint(zW(this.result),this.consumed),this.errors&&(e!==Hr.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&vl.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=qW(r,i,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===ao.Attribute&&(s===0||jW(a))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&vl.VALUE_LENGTH)>>14,s!==0){if(a===Hr.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==ao.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&vl.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~vl.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case Br.NamedEntity:return this.result!==0&&(this.decodeMode!==ao.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Br.NumericDecimal:return this.emitNumericEntity(0,2);case Br.NumericHex:return this.emitNumericEntity(0,3);case Br.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Br.EntityStart:return 0}}}function qW(t,e,n,r){const i=(e&vl.BRANCH_LENGTH)>>7,s=e&vl.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=i?-1:t[n+u]-1}let a=n,l=a+i-1;for(;a<=l;){const u=a+l>>>1,d=t[u];if(d<r)a=u+1;else if(d>r)l=u-1;else return t[u+i]}return-1}var Ce;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(Ce||(Ce={}));var Au;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Au||(Au={}));var ks;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(ks||(ks={}));var oe;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(oe||(oe={}));var x;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(x||(x={}));const VW=new Map([[oe.A,x.A],[oe.ADDRESS,x.ADDRESS],[oe.ANNOTATION_XML,x.ANNOTATION_XML],[oe.APPLET,x.APPLET],[oe.AREA,x.AREA],[oe.ARTICLE,x.ARTICLE],[oe.ASIDE,x.ASIDE],[oe.B,x.B],[oe.BASE,x.BASE],[oe.BASEFONT,x.BASEFONT],[oe.BGSOUND,x.BGSOUND],[oe.BIG,x.BIG],[oe.BLOCKQUOTE,x.BLOCKQUOTE],[oe.BODY,x.BODY],[oe.BR,x.BR],[oe.BUTTON,x.BUTTON],[oe.CAPTION,x.CAPTION],[oe.CENTER,x.CENTER],[oe.CODE,x.CODE],[oe.COL,x.COL],[oe.COLGROUP,x.COLGROUP],[oe.DD,x.DD],[oe.DESC,x.DESC],[oe.DETAILS,x.DETAILS],[oe.DIALOG,x.DIALOG],[oe.DIR,x.DIR],[oe.DIV,x.DIV],[oe.DL,x.DL],[oe.DT,x.DT],[oe.EM,x.EM],[oe.EMBED,x.EMBED],[oe.FIELDSET,x.FIELDSET],[oe.FIGCAPTION,x.FIGCAPTION],[oe.FIGURE,x.FIGURE],[oe.FONT,x.FONT],[oe.FOOTER,x.FOOTER],[oe.FOREIGN_OBJECT,x.FOREIGN_OBJECT],[oe.FORM,x.FORM],[oe.FRAME,x.FRAME],[oe.FRAMESET,x.FRAMESET],[oe.H1,x.H1],[oe.H2,x.H2],[oe.H3,x.H3],[oe.H4,x.H4],[oe.H5,x.H5],[oe.H6,x.H6],[oe.HEAD,x.HEAD],[oe.HEADER,x.HEADER],[oe.HGROUP,x.HGROUP],[oe.HR,x.HR],[oe.HTML,x.HTML],[oe.I,x.I],[oe.IMG,x.IMG],[oe.IMAGE,x.IMAGE],[oe.INPUT,x.INPUT],[oe.IFRAME,x.IFRAME],[oe.KEYGEN,x.KEYGEN],[oe.LABEL,x.LABEL],[oe.LI,x.LI],[oe.LINK,x.LINK],[oe.LISTING,x.LISTING],[oe.MAIN,x.MAIN],[oe.MALIGNMARK,x.MALIGNMARK],[oe.MARQUEE,x.MARQUEE],[oe.MATH,x.MATH],[oe.MENU,x.MENU],[oe.META,x.META],[oe.MGLYPH,x.MGLYPH],[oe.MI,x.MI],[oe.MO,x.MO],[oe.MN,x.MN],[oe.MS,x.MS],[oe.MTEXT,x.MTEXT],[oe.NAV,x.NAV],[oe.NOBR,x.NOBR],[oe.NOFRAMES,x.NOFRAMES],[oe.NOEMBED,x.NOEMBED],[oe.NOSCRIPT,x.NOSCRIPT],[oe.OBJECT,x.OBJECT],[oe.OL,x.OL],[oe.OPTGROUP,x.OPTGROUP],[oe.OPTION,x.OPTION],[oe.P,x.P],[oe.PARAM,x.PARAM],[oe.PLAINTEXT,x.PLAINTEXT],[oe.PRE,x.PRE],[oe.RB,x.RB],[oe.RP,x.RP],[oe.RT,x.RT],[oe.RTC,x.RTC],[oe.RUBY,x.RUBY],[oe.S,x.S],[oe.SCRIPT,x.SCRIPT],[oe.SEARCH,x.SEARCH],[oe.SECTION,x.SECTION],[oe.SELECT,x.SELECT],[oe.SOURCE,x.SOURCE],[oe.SMALL,x.SMALL],[oe.SPAN,x.SPAN],[oe.STRIKE,x.STRIKE],[oe.STRONG,x.STRONG],[oe.STYLE,x.STYLE],[oe.SUB,x.SUB],[oe.SUMMARY,x.SUMMARY],[oe.SUP,x.SUP],[oe.TABLE,x.TABLE],[oe.TBODY,x.TBODY],[oe.TEMPLATE,x.TEMPLATE],[oe.TEXTAREA,x.TEXTAREA],[oe.TFOOT,x.TFOOT],[oe.TD,x.TD],[oe.TH,x.TH],[oe.THEAD,x.THEAD],[oe.TITLE,x.TITLE],[oe.TR,x.TR],[oe.TRACK,x.TRACK],[oe.TT,x.TT],[oe.U,x.U],[oe.UL,x.UL],[oe.SVG,x.SVG],[oe.VAR,x.VAR],[oe.WBR,x.WBR],[oe.XMP,x.XMP]]);function Nd(t){var e;return(e=VW.get(t))!==null&&e!==void 0?e:x.UNKNOWN}const Ne=x,GW={[Ce.HTML]:new Set([Ne.ADDRESS,Ne.APPLET,Ne.AREA,Ne.ARTICLE,Ne.ASIDE,Ne.BASE,Ne.BASEFONT,Ne.BGSOUND,Ne.BLOCKQUOTE,Ne.BODY,Ne.BR,Ne.BUTTON,Ne.CAPTION,Ne.CENTER,Ne.COL,Ne.COLGROUP,Ne.DD,Ne.DETAILS,Ne.DIR,Ne.DIV,Ne.DL,Ne.DT,Ne.EMBED,Ne.FIELDSET,Ne.FIGCAPTION,Ne.FIGURE,Ne.FOOTER,Ne.FORM,Ne.FRAME,Ne.FRAMESET,Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6,Ne.HEAD,Ne.HEADER,Ne.HGROUP,Ne.HR,Ne.HTML,Ne.IFRAME,Ne.IMG,Ne.INPUT,Ne.LI,Ne.LINK,Ne.LISTING,Ne.MAIN,Ne.MARQUEE,Ne.MENU,Ne.META,Ne.NAV,Ne.NOEMBED,Ne.NOFRAMES,Ne.NOSCRIPT,Ne.OBJECT,Ne.OL,Ne.P,Ne.PARAM,Ne.PLAINTEXT,Ne.PRE,Ne.SCRIPT,Ne.SECTION,Ne.SELECT,Ne.SOURCE,Ne.STYLE,Ne.SUMMARY,Ne.TABLE,Ne.TBODY,Ne.TD,Ne.TEMPLATE,Ne.TEXTAREA,Ne.TFOOT,Ne.TH,Ne.THEAD,Ne.TITLE,Ne.TR,Ne.TRACK,Ne.UL,Ne.WBR,Ne.XMP]),[Ce.MATHML]:new Set([Ne.MI,Ne.MO,Ne.MN,Ne.MS,Ne.MTEXT,Ne.ANNOTATION_XML]),[Ce.SVG]:new Set([Ne.TITLE,Ne.FOREIGN_OBJECT,Ne.DESC]),[Ce.XLINK]:new Set,[Ce.XML]:new Set,[Ce.XMLNS]:new Set},a4=new Set([Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6]);oe.STYLE,oe.SCRIPT,oe.XMP,oe.IFRAME,oe.NOEMBED,oe.NOFRAMES,oe.PLAINTEXT;var H;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(H||(H={}));const cr={DATA:H.DATA,RCDATA:H.RCDATA,RAWTEXT:H.RAWTEXT,SCRIPT_DATA:H.SCRIPT_DATA,PLAINTEXT:H.PLAINTEXT,CDATA_SECTION:H.CDATA_SECTION};function YW(t){return t>=F.DIGIT_0&&t<=F.DIGIT_9}function nf(t){return t>=F.LATIN_CAPITAL_A&&t<=F.LATIN_CAPITAL_Z}function WW(t){return t>=F.LATIN_SMALL_A&&t<=F.LATIN_SMALL_Z}function ol(t){return WW(t)||nf(t)}function jw(t){return ol(t)||YW(t)}function cm(t){return t+32}function gN(t){return t===F.SPACE||t===F.LINE_FEED||t===F.TABULATION||t===F.FORM_FEED}function $w(t){return gN(t)||t===F.SOLIDUS||t===F.GREATER_THAN_SIGN}function KW(t){return t===F.NULL?ve.nullCharacterReference:t>1114111?ve.characterReferenceOutsideUnicodeRange:fN(t)?ve.surrogateCharacterReference:pN(t)?ve.noncharacterCharacterReference:hN(t)||t===F.CARRIAGE_RETURN?ve.controlCharacterReference:null}class XW{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=H.DATA,this.returnState=H.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new LW(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new $W(PW,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ve.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ve.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=KW(r);i&&this._err(i,1)}}:void 0)}_err(e,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Bt.START_TAG,tagName:"",tagID:x.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Bt.END_TAG,tagName:"",tagID:x.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:Bt.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:Bt.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(mN(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ve.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=Nd(e.tagName),e.type===Bt.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(ve.endTagWithAttributes),e.selfClosing&&this._err(ve.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case Bt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Bt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Bt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:Bt.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=gN(e)?Bt.WHITESPACE_CHARACTER:e===F.NULL?Bt.NULL_CHARACTER:Bt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(Bt.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=H.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ao.Attribute:ao.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===H.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===H.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===H.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case H.DATA:{this._stateData(e);break}case H.RCDATA:{this._stateRcdata(e);break}case H.RAWTEXT:{this._stateRawtext(e);break}case H.SCRIPT_DATA:{this._stateScriptData(e);break}case H.PLAINTEXT:{this._statePlaintext(e);break}case H.TAG_OPEN:{this._stateTagOpen(e);break}case H.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case H.TAG_NAME:{this._stateTagName(e);break}case H.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case H.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case H.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case H.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case H.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case H.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case H.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case H.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case H.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case H.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case H.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case H.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case H.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case H.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case H.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case H.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case H.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case H.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case H.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case H.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case H.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case H.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case H.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case H.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case H.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case H.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case H.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case H.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case H.BOGUS_COMMENT:{this._stateBogusComment(e);break}case H.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case H.COMMENT_START:{this._stateCommentStart(e);break}case H.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case H.COMMENT:{this._stateComment(e);break}case H.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case H.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case H.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case H.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case H.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case H.COMMENT_END:{this._stateCommentEnd(e);break}case H.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case H.DOCTYPE:{this._stateDoctype(e);break}case H.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case H.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case H.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case H.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case H.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case H.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case H.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case H.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case H.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case H.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case H.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case H.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case H.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case H.CDATA_SECTION:{this._stateCdataSection(e);break}case H.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case H.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case H.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case H.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case F.LESS_THAN_SIGN:{this.state=H.TAG_OPEN;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this._emitCodePoint(e);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case F.AMPERSAND:{this._startCharacterReference();break}case F.LESS_THAN_SIGN:{this.state=H.RCDATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(Fn);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case F.LESS_THAN_SIGN:{this.state=H.RAWTEXT_LESS_THAN_SIGN;break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(Fn);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case F.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(Fn);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case F.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(Fn);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(ol(e))this._createStartTagToken(),this.state=H.TAG_NAME,this._stateTagName(e);else switch(e){case F.EXCLAMATION_MARK:{this.state=H.MARKUP_DECLARATION_OPEN;break}case F.SOLIDUS:{this.state=H.END_TAG_OPEN;break}case F.QUESTION_MARK:{this._err(ve.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=H.BOGUS_COMMENT,this._stateBogusComment(e);break}case F.EOF:{this._err(ve.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ve.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=H.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(ol(e))this._createEndTagToken(),this.state=H.TAG_NAME,this._stateTagName(e);else switch(e){case F.GREATER_THAN_SIGN:{this._err(ve.missingEndTagName),this.state=H.DATA;break}case F.EOF:{this._err(ve.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ve.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=H.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=H.BEFORE_ATTRIBUTE_NAME;break}case F.SOLIDUS:{this.state=H.SELF_CLOSING_START_TAG;break}case F.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentTagToken();break}case F.NULL:{this._err(ve.unexpectedNullCharacter),n.tagName+=Fn;break}case F.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(nf(e)?cm(e):e)}}_stateRcdataLessThanSign(e){e===F.SOLIDUS?this.state=H.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=H.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){ol(e)?(this.state=H.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=H.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=H.BEFORE_ATTRIBUTE_NAME,!1;case F.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=H.SELF_CLOSING_START_TAG,!1;case F.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=H.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=H.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===F.SOLIDUS?this.state=H.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=H.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){ol(e)?(this.state=H.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=H.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=H.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case F.SOLIDUS:{this.state=H.SCRIPT_DATA_END_TAG_OPEN;break}case F.EXCLAMATION_MARK:{this.state=H.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=H.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){ol(e)?(this.state=H.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=H.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=H.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===F.HYPHEN_MINUS?(this.state=H.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=H.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===F.HYPHEN_MINUS?(this.state=H.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=H.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case F.HYPHEN_MINUS:{this.state=H.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(Fn);break}case F.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case F.HYPHEN_MINUS:{this.state=H.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_ESCAPED,this._emitChars(Fn);break}case F.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=H.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case F.HYPHEN_MINUS:{this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case F.GREATER_THAN_SIGN:{this.state=H.SCRIPT_DATA,this._emitChars(">");break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_ESCAPED,this._emitChars(Fn);break}case F.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=H.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===F.SOLIDUS?this.state=H.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ol(e)?(this._emitChars("<"),this.state=H.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){ol(e)?(this.state=H.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Ii.SCRIPT,!1)&&$w(this.preprocessor.peek(Ii.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Ii.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case F.HYPHEN_MINUS:{this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(Fn);break}case F.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case F.HYPHEN_MINUS:{this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Fn);break}case F.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case F.HYPHEN_MINUS:{this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case F.GREATER_THAN_SIGN:{this.state=H.SCRIPT_DATA,this._emitChars(">");break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Fn);break}case F.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===F.SOLIDUS?(this.state=H.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ii.SCRIPT,!1)&&$w(this.preprocessor.peek(Ii.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Ii.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=H.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.SOLIDUS:case F.GREATER_THAN_SIGN:case F.EOF:{this.state=H.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case F.EQUALS_SIGN:{this._err(ve.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=H.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=H.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:case F.SOLIDUS:case F.GREATER_THAN_SIGN:case F.EOF:{this._leaveAttrName(),this.state=H.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case F.EQUALS_SIGN:{this._leaveAttrName(),this.state=H.BEFORE_ATTRIBUTE_VALUE;break}case F.QUOTATION_MARK:case F.APOSTROPHE:case F.LESS_THAN_SIGN:{this._err(ve.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.name+=Fn;break}default:this.currentAttr.name+=String.fromCodePoint(nf(e)?cm(e):e)}}_stateAfterAttributeName(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.SOLIDUS:{this.state=H.SELF_CLOSING_START_TAG;break}case F.EQUALS_SIGN:{this.state=H.BEFORE_ATTRIBUTE_VALUE;break}case F.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentTagToken();break}case F.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=H.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:{this.state=H.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this.state=H.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(ve.missingAttributeValue),this.state=H.DATA,this.emitCurrentTagToken();break}default:this.state=H.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case F.QUOTATION_MARK:{this.state=H.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.value+=Fn;break}case F.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case F.APOSTROPHE:{this.state=H.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.value+=Fn;break}case F.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this._leaveAttrValue(),this.state=H.BEFORE_ATTRIBUTE_NAME;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=H.DATA,this.emitCurrentTagToken();break}case F.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.value+=Fn;break}case F.QUOTATION_MARK:case F.APOSTROPHE:case F.LESS_THAN_SIGN:case F.EQUALS_SIGN:case F.GRAVE_ACCENT:{this._err(ve.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case F.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this._leaveAttrValue(),this.state=H.BEFORE_ATTRIBUTE_NAME;break}case F.SOLIDUS:{this._leaveAttrValue(),this.state=H.SELF_CLOSING_START_TAG;break}case F.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=H.DATA,this.emitCurrentTagToken();break}case F.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this._err(ve.missingWhitespaceBetweenAttributes),this.state=H.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case F.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=H.DATA,this.emitCurrentTagToken();break}case F.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this._err(ve.unexpectedSolidusInTag),this.state=H.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case F.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentComment(n);break}case F.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case F.NULL:{this._err(ve.unexpectedNullCharacter),n.data+=Fn;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Ii.DASH_DASH,!0)?(this._createCommentToken(Ii.DASH_DASH.length+1),this.state=H.COMMENT_START):this._consumeSequenceIfMatch(Ii.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ii.DOCTYPE.length+1),this.state=H.DOCTYPE):this._consumeSequenceIfMatch(Ii.CDATA_START,!0)?this.inForeignNode?this.state=H.CDATA_SECTION:(this._err(ve.cdataInHtmlContent),this._createCommentToken(Ii.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=H.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ve.incorrectlyOpenedComment),this._createCommentToken(2),this.state=H.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case F.HYPHEN_MINUS:{this.state=H.COMMENT_START_DASH;break}case F.GREATER_THAN_SIGN:{this._err(ve.abruptClosingOfEmptyComment),this.state=H.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=H.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case F.HYPHEN_MINUS:{this.state=H.COMMENT_END;break}case F.GREATER_THAN_SIGN:{this._err(ve.abruptClosingOfEmptyComment),this.state=H.DATA,this.emitCurrentComment(n);break}case F.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=H.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case F.HYPHEN_MINUS:{this.state=H.COMMENT_END_DASH;break}case F.LESS_THAN_SIGN:{n.data+="<",this.state=H.COMMENT_LESS_THAN_SIGN;break}case F.NULL:{this._err(ve.unexpectedNullCharacter),n.data+=Fn;break}case F.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case F.EXCLAMATION_MARK:{n.data+="!",this.state=H.COMMENT_LESS_THAN_SIGN_BANG;break}case F.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=H.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===F.HYPHEN_MINUS?this.state=H.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=H.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===F.HYPHEN_MINUS?this.state=H.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=H.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==F.GREATER_THAN_SIGN&&e!==F.EOF&&this._err(ve.nestedComment),this.state=H.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case F.HYPHEN_MINUS:{this.state=H.COMMENT_END;break}case F.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=H.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case F.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentComment(n);break}case F.EXCLAMATION_MARK:{this.state=H.COMMENT_END_BANG;break}case F.HYPHEN_MINUS:{n.data+="-";break}case F.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=H.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case F.HYPHEN_MINUS:{n.data+="--!",this.state=H.COMMENT_END_DASH;break}case F.GREATER_THAN_SIGN:{this._err(ve.incorrectlyClosedComment),this.state=H.DATA,this.emitCurrentComment(n);break}case F.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=H.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=H.BEFORE_DOCTYPE_NAME;break}case F.GREATER_THAN_SIGN:{this.state=H.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case F.EOF:{this._err(ve.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingWhitespaceBeforeDoctypeName),this.state=H.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(nf(e))this._createDoctypeToken(String.fromCharCode(cm(e))),this.state=H.DOCTYPE_NAME;else switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.NULL:{this._err(ve.unexpectedNullCharacter),this._createDoctypeToken(Fn),this.state=H.DOCTYPE_NAME;break}case F.GREATER_THAN_SIGN:{this._err(ve.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=H.DATA;break}case F.EOF:{this._err(ve.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=H.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=H.AFTER_DOCTYPE_NAME;break}case F.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentDoctype(n);break}case F.NULL:{this._err(ve.unexpectedNullCharacter),n.name+=Fn;break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(nf(e)?cm(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ii.PUBLIC,!1)?this.state=H.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ii.SYSTEM,!1)?this.state=H.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ve.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=H.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case F.QUOTATION_MARK:{this._err(ve.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this._err(ve.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(ve.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:{n.publicId="",this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{n.publicId="",this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(ve.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case F.QUOTATION_MARK:{this.state=H.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case F.NULL:{this._err(ve.unexpectedNullCharacter),n.publicId+=Fn;break}case F.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=H.DATA;break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case F.APOSTROPHE:{this.state=H.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case F.NULL:{this._err(ve.unexpectedNullCharacter),n.publicId+=Fn;break}case F.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=H.DATA;break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=H.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case F.GREATER_THAN_SIGN:{this.state=H.DATA,this.emitCurrentDoctype(n);break}case F.QUOTATION_MARK:{this._err(ve.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this._err(ve.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=H.DATA;break}case F.QUOTATION_MARK:{n.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{n.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=H.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case F.QUOTATION_MARK:{this._err(ve.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this._err(ve.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(ve.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:{n.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{n.systemId="",this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(ve.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case F.QUOTATION_MARK:{this.state=H.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case F.NULL:{this._err(ve.unexpectedNullCharacter),n.systemId+=Fn;break}case F.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=H.DATA;break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case F.APOSTROPHE:{this.state=H.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case F.NULL:{this._err(ve.unexpectedNullCharacter),n.systemId+=Fn;break}case F.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=H.DATA;break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=H.DATA;break}case F.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case F.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=H.DATA;break}case F.NULL:{this._err(ve.unexpectedNullCharacter);break}case F.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case F.RIGHT_SQUARE_BRACKET:{this.state=H.CDATA_SECTION_BRACKET;break}case F.EOF:{this._err(ve.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===F.RIGHT_SQUARE_BRACKET?this.state=H.CDATA_SECTION_END:(this._emitChars("]"),this.state=H.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case F.GREATER_THAN_SIGN:{this.state=H.DATA;break}case F.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=H.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(F.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&jw(this.preprocessor.peek(1))?H.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){jw(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===F.SEMICOLON&&this._err(ve.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const bN=new Set([x.DD,x.DT,x.LI,x.OPTGROUP,x.OPTION,x.P,x.RB,x.RP,x.RT,x.RTC]),qw=new Set([...bN,x.CAPTION,x.COLGROUP,x.TBODY,x.TD,x.TFOOT,x.TH,x.THEAD,x.TR]),Eg=new Set([x.APPLET,x.CAPTION,x.HTML,x.MARQUEE,x.OBJECT,x.TABLE,x.TD,x.TEMPLATE,x.TH]),QW=new Set([...Eg,x.OL,x.UL]),ZW=new Set([...Eg,x.BUTTON]),Vw=new Set([x.ANNOTATION_XML,x.MI,x.MN,x.MO,x.MS,x.MTEXT]),Gw=new Set([x.DESC,x.FOREIGN_OBJECT,x.TITLE]),JW=new Set([x.TR,x.TEMPLATE,x.HTML]),eK=new Set([x.TBODY,x.TFOOT,x.THEAD,x.TEMPLATE,x.HTML]),tK=new Set([x.TABLE,x.TEMPLATE,x.HTML]),nK=new Set([x.TD,x.TH]);class rK{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=x.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===x.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ce.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const i=this._indexOf(e)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ce.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(a4,Ce.HTML)}popUntilTableCellPopped(){this.popUntilPopped(nK,Ce.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(tK,Ce.HTML)}clearBackToTableBodyContext(){this.clearBackTo(eK,Ce.HTML)}clearBackToTableRowContext(){this.clearBackTo(JW,Ce.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===x.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===x.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Ce.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case Ce.SVG:{if(Gw.has(i))return!1;break}case Ce.MATHML:{if(Vw.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Eg)}hasInListItemScope(e){return this.hasInDynamicScope(e,QW)}hasInButtonScope(e){return this.hasInDynamicScope(e,ZW)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case Ce.HTML:{if(a4.has(n))return!0;if(Eg.has(n))return!1;break}case Ce.SVG:{if(Gw.has(n))return!1;break}case Ce.MATHML:{if(Vw.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ce.HTML)switch(this.tagIDs[n]){case e:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===Ce.HTML)switch(this.tagIDs[e]){case x.TBODY:case x.THEAD:case x.TFOOT:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ce.HTML)switch(this.tagIDs[n]){case e:return!0;case x.OPTION:case x.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&bN.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&qw.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&qw.has(this.currentTagId);)this.pop()}}const m2=3;var ha;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(ha||(ha={}));const Yw={type:ha.Marker};class iK{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let l=0;l<this.entries.length;l++){const u=this.entries[l];if(u.type===ha.Marker)break;const{element:d}=u;if(this.treeAdapter.getTagName(d)===s&&this.treeAdapter.getNamespaceURI(d)===a){const h=this.treeAdapter.getAttrList(d);h.length===i&&r.push({idx:l,attrs:h})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<m2)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<m2)return;const i=new Map(n.map(a=>[a.name,a.value]));let s=0;for(let a=0;a<r.length;a++){const l=r[a];l.attrs.every(u=>i.get(u.name)===u.value)&&(s+=1,s>=m2&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(Yw)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:ha.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ha.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(Yw);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===ha.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===ha.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===ha.Element&&n.element===e)}}const ll={createDocument(){return{nodeName:"#document",mode:ks.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const i=t.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};ll.appendChild(t,s)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(ll.isTextNode(n)){n.value+=e;return}}ll.appendChild(t,ll.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&ll.isTextNode(r)?r.value+=e:ll.insertBefore(t,ll.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},vN="html",sK="about:legacy-compat",aK="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",yN=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],oK=[...yN,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],lK=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),EN=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],uK=[...EN,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Ww(t,e){return e.some(n=>t.startsWith(n))}function cK(t){return t.name===vN&&t.publicId===null&&(t.systemId===null||t.systemId===sK)}function dK(t){if(t.name!==vN)return ks.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===aK)return ks.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),lK.has(n))return ks.QUIRKS;let r=e===null?oK:yN;if(Ww(n,r))return ks.QUIRKS;if(r=e===null?EN:uK,Ww(n,r))return ks.LIMITED_QUIRKS}return ks.NO_QUIRKS}const Kw={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},fK="definitionurl",hK="definitionURL",pK=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),mK=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ce.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ce.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ce.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ce.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ce.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ce.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ce.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ce.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ce.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ce.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ce.XMLNS}]]),gK=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),bK=new Set([x.B,x.BIG,x.BLOCKQUOTE,x.BODY,x.BR,x.CENTER,x.CODE,x.DD,x.DIV,x.DL,x.DT,x.EM,x.EMBED,x.H1,x.H2,x.H3,x.H4,x.H5,x.H6,x.HEAD,x.HR,x.I,x.IMG,x.LI,x.LISTING,x.MENU,x.META,x.NOBR,x.OL,x.P,x.PRE,x.RUBY,x.S,x.SMALL,x.SPAN,x.STRONG,x.STRIKE,x.SUB,x.SUP,x.TABLE,x.TT,x.U,x.UL,x.VAR]);function vK(t){const e=t.tagID;return e===x.FONT&&t.attrs.some(({name:r})=>r===Au.COLOR||r===Au.SIZE||r===Au.FACE)||bK.has(e)}function _N(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===fK){t.attrs[e].name=hK;break}}function xN(t){for(let e=0;e<t.attrs.length;e++){const n=pK.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function s_(t){for(let e=0;e<t.attrs.length;e++){const n=mK.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function yK(t){const e=gK.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Nd(t.tagName))}function EK(t,e){return e===Ce.MATHML&&(t===x.MI||t===x.MO||t===x.MN||t===x.MS||t===x.MTEXT)}function _K(t,e,n){if(e===Ce.MATHML&&t===x.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Au.ENCODING){const i=n[r].value.toLowerCase();return i===Kw.TEXT_HTML||i===Kw.APPLICATION_XML}}return e===Ce.SVG&&(t===x.FOREIGN_OBJECT||t===x.DESC||t===x.TITLE)}function xK(t,e,n,r){return(!r||r===Ce.HTML)&&_K(t,e,n)||(!r||r===Ce.MATHML)&&EK(t,e)}const TK="hidden",SK=8,wK=3;var G;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(G||(G={}));const kK={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},TN=new Set([x.TABLE,x.TBODY,x.TFOOT,x.THEAD,x.TR]),Xw={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ll,onParseError:null};let Qw=class{constructor(e,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=G.INITIAL,this.originalInsertionMode=G.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Xw,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new XW(this.options,this),this.activeFormattingElements=new iK(this.treeAdapter),this.fragmentContextID=r?Nd(this.treeAdapter.getTagName(r)):x.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new rK(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...Xw,...n};e??(e=r.treeAdapter.createElement(oe.TEMPLATE,Ce.HTML,[]));const i=r.treeAdapter.createElement("documentmock",Ce.HTML,[]),s=new this(r,i,e);return s.fragmentContextID===x.TEMPLATE&&s.tmplInsertionModeStack.unshift(G.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var i;if(!this.onParseError)return;const s=(i=e.location)!==null&&i!==void 0?i:kK,a={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(a)}onItemPush(e,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,e,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===Ce.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,Ce.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=G.TEXT}switchToPlaintextParsing(){this.insertionMode=G.TEXT,this.originalInsertionMode=G.IN_BODY,this.tokenizer.state=cr.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===oe.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ce.HTML))switch(this.fragmentContextID){case x.TITLE:case x.TEXTAREA:{this.tokenizer.state=cr.RCDATA;break}case x.STYLE:case x.XMP:case x.IFRAME:case x.NOEMBED:case x.NOFRAMES:case x.NOSCRIPT:{this.tokenizer.state=cr.RAWTEXT;break}case x.SCRIPT:{this.tokenizer.state=cr.SCRIPT_DATA;break}case x.PLAINTEXT:{this.tokenizer.state=cr.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),e.location){const a=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));a&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,Ce.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,Ce.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(oe.HTML,Ce.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,x.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,a=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:u,endCol:d,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:u,endCol:d,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(e),s=n.type===Bt.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===x.SVG&&this.treeAdapter.getTagName(n)===oe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ce.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===x.MGLYPH||e.tagID===x.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Ce.HTML)}_processToken(e){switch(e.type){case Bt.CHARACTER:{this.onCharacter(e);break}case Bt.NULL_CHARACTER:{this.onNullCharacter(e);break}case Bt.COMMENT:{this.onComment(e);break}case Bt.DOCTYPE:{this.onDoctype(e);break}case Bt.START_TAG:{this._processStartTag(e);break}case Bt.END_TAG:{this.onEndTag(e);break}case Bt.EOF:{this.onEof(e);break}case Bt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return xK(e,i,s,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ha.Marker||this.openElements.contains(i.element)),r=n===-1?e-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=G.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(x.P),this.openElements.popUntilTagNamePopped(x.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case x.TR:{this.insertionMode=G.IN_ROW;return}case x.TBODY:case x.THEAD:case x.TFOOT:{this.insertionMode=G.IN_TABLE_BODY;return}case x.CAPTION:{this.insertionMode=G.IN_CAPTION;return}case x.COLGROUP:{this.insertionMode=G.IN_COLUMN_GROUP;return}case x.TABLE:{this.insertionMode=G.IN_TABLE;return}case x.BODY:{this.insertionMode=G.IN_BODY;return}case x.FRAMESET:{this.insertionMode=G.IN_FRAMESET;return}case x.SELECT:{this._resetInsertionModeForSelect(e);return}case x.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case x.HTML:{this.insertionMode=this.headElement?G.AFTER_HEAD:G.BEFORE_HEAD;return}case x.TD:case x.TH:{if(e>0){this.insertionMode=G.IN_CELL;return}break}case x.HEAD:{if(e>0){this.insertionMode=G.IN_HEAD;return}break}}this.insertionMode=G.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===x.TEMPLATE)break;if(r===x.TABLE){this.insertionMode=G.IN_SELECT_IN_TABLE;return}}this.insertionMode=G.IN_SELECT}_isElementCausesFosterParenting(e){return TN.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case x.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ce.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case x.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return GW[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){nQ(this,e);return}switch(this.insertionMode){case G.INITIAL:{U0(this,e);break}case G.BEFORE_HTML:{xf(this,e);break}case G.BEFORE_HEAD:{Tf(this,e);break}case G.IN_HEAD:{Sf(this,e);break}case G.IN_HEAD_NO_SCRIPT:{wf(this,e);break}case G.AFTER_HEAD:{kf(this,e);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:{wN(this,e);break}case G.TEXT:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{g2(this,e);break}case G.IN_TABLE_TEXT:{ON(this,e);break}case G.IN_COLUMN_GROUP:{_g(this,e);break}case G.AFTER_BODY:{xg(this,e);break}case G.AFTER_AFTER_BODY:{tg(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){tQ(this,e);return}switch(this.insertionMode){case G.INITIAL:{U0(this,e);break}case G.BEFORE_HTML:{xf(this,e);break}case G.BEFORE_HEAD:{Tf(this,e);break}case G.IN_HEAD:{Sf(this,e);break}case G.IN_HEAD_NO_SCRIPT:{wf(this,e);break}case G.AFTER_HEAD:{kf(this,e);break}case G.TEXT:{this._insertCharacters(e);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{g2(this,e);break}case G.IN_COLUMN_GROUP:{_g(this,e);break}case G.AFTER_BODY:{xg(this,e);break}case G.AFTER_AFTER_BODY:{tg(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){o4(this,e);return}switch(this.insertionMode){case G.INITIAL:case G.BEFORE_HTML:case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_TEMPLATE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{o4(this,e);break}case G.IN_TABLE_TEXT:{H0(this,e);break}case G.AFTER_BODY:{DK(this,e);break}case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{IK(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case G.INITIAL:{LK(this,e);break}case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:{this._err(e,ve.misplacedDoctype);break}case G.IN_TABLE_TEXT:{H0(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,ve.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?rQ(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case G.INITIAL:{U0(this,e);break}case G.BEFORE_HTML:{PK(this,e);break}case G.BEFORE_HEAD:{zK(this,e);break}case G.IN_HEAD:{Js(this,e);break}case G.IN_HEAD_NO_SCRIPT:{HK(this,e);break}case G.AFTER_HEAD:{$K(this,e);break}case G.IN_BODY:{fi(this,e);break}case G.IN_TABLE:{ld(this,e);break}case G.IN_TABLE_TEXT:{H0(this,e);break}case G.IN_CAPTION:{FX(this,e);break}case G.IN_COLUMN_GROUP:{l_(this,e);break}case G.IN_TABLE_BODY:{eb(this,e);break}case G.IN_ROW:{tb(this,e);break}case G.IN_CELL:{jX(this,e);break}case G.IN_SELECT:{IN(this,e);break}case G.IN_SELECT_IN_TABLE:{qX(this,e);break}case G.IN_TEMPLATE:{GX(this,e);break}case G.AFTER_BODY:{WX(this,e);break}case G.IN_FRAMESET:{KX(this,e);break}case G.AFTER_FRAMESET:{QX(this,e);break}case G.AFTER_AFTER_BODY:{JX(this,e);break}case G.AFTER_AFTER_FRAMESET:{eQ(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?iQ(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case G.INITIAL:{U0(this,e);break}case G.BEFORE_HTML:{BK(this,e);break}case G.BEFORE_HEAD:{FK(this,e);break}case G.IN_HEAD:{UK(this,e);break}case G.IN_HEAD_NO_SCRIPT:{jK(this,e);break}case G.AFTER_HEAD:{qK(this,e);break}case G.IN_BODY:{J1(this,e);break}case G.TEXT:{NX(this,e);break}case G.IN_TABLE:{Kf(this,e);break}case G.IN_TABLE_TEXT:{H0(this,e);break}case G.IN_CAPTION:{UX(this,e);break}case G.IN_COLUMN_GROUP:{HX(this,e);break}case G.IN_TABLE_BODY:{l4(this,e);break}case G.IN_ROW:{DN(this,e);break}case G.IN_CELL:{$X(this,e);break}case G.IN_SELECT:{LN(this,e);break}case G.IN_SELECT_IN_TABLE:{VX(this,e);break}case G.IN_TEMPLATE:{YX(this,e);break}case G.AFTER_BODY:{BN(this,e);break}case G.IN_FRAMESET:{XX(this,e);break}case G.AFTER_FRAMESET:{ZX(this,e);break}case G.AFTER_AFTER_BODY:{tg(this,e);break}}}onEof(e){switch(this.insertionMode){case G.INITIAL:{U0(this,e);break}case G.BEFORE_HTML:{xf(this,e);break}case G.BEFORE_HEAD:{Tf(this,e);break}case G.IN_HEAD:{Sf(this,e);break}case G.IN_HEAD_NO_SCRIPT:{wf(this,e);break}case G.AFTER_HEAD:{kf(this,e);break}case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{NN(this,e);break}case G.TEXT:{MX(this,e);break}case G.IN_TABLE_TEXT:{H0(this,e);break}case G.IN_TEMPLATE:{PN(this,e);break}case G.AFTER_BODY:case G.IN_FRAMESET:case G.AFTER_FRAMESET:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{o_(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===F.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.TEXT:case G.IN_COLUMN_GROUP:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{this._insertCharacters(e);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:case G.AFTER_BODY:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{SN(this,e);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{g2(this,e);break}case G.IN_TABLE_TEXT:{MN(this,e);break}}}};function CK(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):AN(t,e),n}function AK(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function NK(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let s=0,a=i;a!==n;s++,a=i){i=t.openElements.getCommonAncestor(a);const l=t.activeFormattingElements.getElementEntry(a),u=l&&s>=wK;!l||u?(u&&t.activeFormattingElements.removeEntry(l),t.openElements.remove(a)):(a=MK(t,l),r===e&&(t.activeFormattingElements.bookmark=l),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(a,r),r=a)}return r}function MK(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function OK(t,e,n){const r=t.treeAdapter.getTagName(e),i=Nd(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const s=t.treeAdapter.getNamespaceURI(e);i===x.TEMPLATE&&s===Ce.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function RK(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,s),t.treeAdapter.appendChild(e,s),t.activeFormattingElements.insertElementAfterBookmark(s,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,s,i.tagID)}function a_(t,e){for(let n=0;n<SK;n++){const r=CK(t,e);if(!r)break;const i=AK(t,r);if(!i)break;t.activeFormattingElements.bookmark=r;const s=NK(t,i,r.element),a=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(s),a&&OK(t,a,s),RK(t,i,r)}}function o4(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function DK(t,e){t._appendCommentNode(e,t.openElements.items[0])}function IK(t,e){t._appendCommentNode(e,t.document)}function o_(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],i=t.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const s=t.openElements.items[1],a=t.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&t._setEndLocation(s,e)}}}}function LK(t,e){t._setDocumentType(e);const n=e.forceQuirks?ks.QUIRKS:dK(e);cK(e)||t._err(e,ve.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=G.BEFORE_HTML}function U0(t,e){t._err(e,ve.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,ks.QUIRKS),t.insertionMode=G.BEFORE_HTML,t._processToken(e)}function PK(t,e){e.tagID===x.HTML?(t._insertElement(e,Ce.HTML),t.insertionMode=G.BEFORE_HEAD):xf(t,e)}function BK(t,e){const n=e.tagID;(n===x.HTML||n===x.HEAD||n===x.BODY||n===x.BR)&&xf(t,e)}function xf(t,e){t._insertFakeRootElement(),t.insertionMode=G.BEFORE_HEAD,t._processToken(e)}function zK(t,e){switch(e.tagID){case x.HTML:{fi(t,e);break}case x.HEAD:{t._insertElement(e,Ce.HTML),t.headElement=t.openElements.current,t.insertionMode=G.IN_HEAD;break}default:Tf(t,e)}}function FK(t,e){const n=e.tagID;n===x.HEAD||n===x.BODY||n===x.HTML||n===x.BR?Tf(t,e):t._err(e,ve.endTagWithoutMatchingOpenElement)}function Tf(t,e){t._insertFakeElement(oe.HEAD,x.HEAD),t.headElement=t.openElements.current,t.insertionMode=G.IN_HEAD,t._processToken(e)}function Js(t,e){switch(e.tagID){case x.HTML:{fi(t,e);break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:{t._appendElement(e,Ce.HTML),e.ackSelfClosing=!0;break}case x.TITLE:{t._switchToTextParsing(e,cr.RCDATA);break}case x.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,cr.RAWTEXT):(t._insertElement(e,Ce.HTML),t.insertionMode=G.IN_HEAD_NO_SCRIPT);break}case x.NOFRAMES:case x.STYLE:{t._switchToTextParsing(e,cr.RAWTEXT);break}case x.SCRIPT:{t._switchToTextParsing(e,cr.SCRIPT_DATA);break}case x.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=G.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(G.IN_TEMPLATE);break}case x.HEAD:{t._err(e,ve.misplacedStartTagForHeadElement);break}default:Sf(t,e)}}function UK(t,e){switch(e.tagID){case x.HEAD:{t.openElements.pop(),t.insertionMode=G.AFTER_HEAD;break}case x.BODY:case x.BR:case x.HTML:{Sf(t,e);break}case x.TEMPLATE:{Wu(t,e);break}default:t._err(e,ve.endTagWithoutMatchingOpenElement)}}function Wu(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==x.TEMPLATE&&t._err(e,ve.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(x.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,ve.endTagWithoutMatchingOpenElement)}function Sf(t,e){t.openElements.pop(),t.insertionMode=G.AFTER_HEAD,t._processToken(e)}function HK(t,e){switch(e.tagID){case x.HTML:{fi(t,e);break}case x.BASEFONT:case x.BGSOUND:case x.HEAD:case x.LINK:case x.META:case x.NOFRAMES:case x.STYLE:{Js(t,e);break}case x.NOSCRIPT:{t._err(e,ve.nestedNoscriptInHead);break}default:wf(t,e)}}function jK(t,e){switch(e.tagID){case x.NOSCRIPT:{t.openElements.pop(),t.insertionMode=G.IN_HEAD;break}case x.BR:{wf(t,e);break}default:t._err(e,ve.endTagWithoutMatchingOpenElement)}}function wf(t,e){const n=e.type===Bt.EOF?ve.openElementsLeftAfterEof:ve.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=G.IN_HEAD,t._processToken(e)}function $K(t,e){switch(e.tagID){case x.HTML:{fi(t,e);break}case x.BODY:{t._insertElement(e,Ce.HTML),t.framesetOk=!1,t.insertionMode=G.IN_BODY;break}case x.FRAMESET:{t._insertElement(e,Ce.HTML),t.insertionMode=G.IN_FRAMESET;break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{t._err(e,ve.abandonedHeadElementChild),t.openElements.push(t.headElement,x.HEAD),Js(t,e),t.openElements.remove(t.headElement);break}case x.HEAD:{t._err(e,ve.misplacedStartTagForHeadElement);break}default:kf(t,e)}}function qK(t,e){switch(e.tagID){case x.BODY:case x.HTML:case x.BR:{kf(t,e);break}case x.TEMPLATE:{Wu(t,e);break}default:t._err(e,ve.endTagWithoutMatchingOpenElement)}}function kf(t,e){t._insertFakeElement(oe.BODY,x.BODY),t.insertionMode=G.IN_BODY,Z1(t,e)}function Z1(t,e){switch(e.type){case Bt.CHARACTER:{wN(t,e);break}case Bt.WHITESPACE_CHARACTER:{SN(t,e);break}case Bt.COMMENT:{o4(t,e);break}case Bt.START_TAG:{fi(t,e);break}case Bt.END_TAG:{J1(t,e);break}case Bt.EOF:{NN(t,e);break}}}function SN(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function wN(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function VK(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function GK(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function YK(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,Ce.HTML),t.insertionMode=G.IN_FRAMESET)}function WK(t,e){t.openElements.hasInButtonScope(x.P)&&t._closePElement(),t._insertElement(e,Ce.HTML)}function KK(t,e){t.openElements.hasInButtonScope(x.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&a4.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Ce.HTML)}function XK(t,e){t.openElements.hasInButtonScope(x.P)&&t._closePElement(),t._insertElement(e,Ce.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function QK(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(x.P)&&t._closePElement(),t._insertElement(e,Ce.HTML),n||(t.formElement=t.openElements.current))}function ZK(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const i=t.openElements.tagIDs[r];if(n===x.LI&&i===x.LI||(n===x.DD||n===x.DT)&&(i===x.DD||i===x.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==x.ADDRESS&&i!==x.DIV&&i!==x.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(x.P)&&t._closePElement(),t._insertElement(e,Ce.HTML)}function JK(t,e){t.openElements.hasInButtonScope(x.P)&&t._closePElement(),t._insertElement(e,Ce.HTML),t.tokenizer.state=cr.PLAINTEXT}function eX(t,e){t.openElements.hasInScope(x.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(x.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ce.HTML),t.framesetOk=!1}function tX(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(oe.A);n&&(a_(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ce.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function nX(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ce.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function rX(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(x.NOBR)&&(a_(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ce.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function iX(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ce.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function sX(t,e){t.treeAdapter.getDocumentMode(t.document)!==ks.QUIRKS&&t.openElements.hasInButtonScope(x.P)&&t._closePElement(),t._insertElement(e,Ce.HTML),t.framesetOk=!1,t.insertionMode=G.IN_TABLE}function kN(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ce.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function CN(t){const e=mN(t,Au.TYPE);return e!=null&&e.toLowerCase()===TK}function aX(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ce.HTML),CN(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function oX(t,e){t._appendElement(e,Ce.HTML),e.ackSelfClosing=!0}function lX(t,e){t.openElements.hasInButtonScope(x.P)&&t._closePElement(),t._appendElement(e,Ce.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function uX(t,e){e.tagName=oe.IMG,e.tagID=x.IMG,kN(t,e)}function cX(t,e){t._insertElement(e,Ce.HTML),t.skipNextNewLine=!0,t.tokenizer.state=cr.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=G.TEXT}function dX(t,e){t.openElements.hasInButtonScope(x.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,cr.RAWTEXT)}function fX(t,e){t.framesetOk=!1,t._switchToTextParsing(e,cr.RAWTEXT)}function Zw(t,e){t._switchToTextParsing(e,cr.RAWTEXT)}function hX(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ce.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===G.IN_TABLE||t.insertionMode===G.IN_CAPTION||t.insertionMode===G.IN_TABLE_BODY||t.insertionMode===G.IN_ROW||t.insertionMode===G.IN_CELL?G.IN_SELECT_IN_TABLE:G.IN_SELECT}function pX(t,e){t.openElements.currentTagId===x.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ce.HTML)}function mX(t,e){t.openElements.hasInScope(x.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ce.HTML)}function gX(t,e){t.openElements.hasInScope(x.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(x.RTC),t._insertElement(e,Ce.HTML)}function bX(t,e){t._reconstructActiveFormattingElements(),_N(e),s_(e),e.selfClosing?t._appendElement(e,Ce.MATHML):t._insertElement(e,Ce.MATHML),e.ackSelfClosing=!0}function vX(t,e){t._reconstructActiveFormattingElements(),xN(e),s_(e),e.selfClosing?t._appendElement(e,Ce.SVG):t._insertElement(e,Ce.SVG),e.ackSelfClosing=!0}function Jw(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ce.HTML)}function fi(t,e){switch(e.tagID){case x.I:case x.S:case x.B:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.SMALL:case x.STRIKE:case x.STRONG:{nX(t,e);break}case x.A:{tX(t,e);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{KK(t,e);break}case x.P:case x.DL:case x.OL:case x.UL:case x.DIV:case x.DIR:case x.NAV:case x.MAIN:case x.MENU:case x.ASIDE:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.DETAILS:case x.ADDRESS:case x.ARTICLE:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{WK(t,e);break}case x.LI:case x.DD:case x.DT:{ZK(t,e);break}case x.BR:case x.IMG:case x.WBR:case x.AREA:case x.EMBED:case x.KEYGEN:{kN(t,e);break}case x.HR:{lX(t,e);break}case x.RB:case x.RTC:{mX(t,e);break}case x.RT:case x.RP:{gX(t,e);break}case x.PRE:case x.LISTING:{XK(t,e);break}case x.XMP:{dX(t,e);break}case x.SVG:{vX(t,e);break}case x.HTML:{VK(t,e);break}case x.BASE:case x.LINK:case x.META:case x.STYLE:case x.TITLE:case x.SCRIPT:case x.BGSOUND:case x.BASEFONT:case x.TEMPLATE:{Js(t,e);break}case x.BODY:{GK(t,e);break}case x.FORM:{QK(t,e);break}case x.NOBR:{rX(t,e);break}case x.MATH:{bX(t,e);break}case x.TABLE:{sX(t,e);break}case x.INPUT:{aX(t,e);break}case x.PARAM:case x.TRACK:case x.SOURCE:{oX(t,e);break}case x.IMAGE:{uX(t,e);break}case x.BUTTON:{eX(t,e);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{iX(t,e);break}case x.IFRAME:{fX(t,e);break}case x.SELECT:{hX(t,e);break}case x.OPTION:case x.OPTGROUP:{pX(t,e);break}case x.NOEMBED:case x.NOFRAMES:{Zw(t,e);break}case x.FRAMESET:{YK(t,e);break}case x.TEXTAREA:{cX(t,e);break}case x.NOSCRIPT:{t.options.scriptingEnabled?Zw(t,e):Jw(t,e);break}case x.PLAINTEXT:{JK(t,e);break}case x.COL:case x.TH:case x.TD:case x.TR:case x.HEAD:case x.FRAME:case x.TBODY:case x.TFOOT:case x.THEAD:case x.CAPTION:case x.COLGROUP:break;default:Jw(t,e)}}function yX(t,e){if(t.openElements.hasInScope(x.BODY)&&(t.insertionMode=G.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function EX(t,e){t.openElements.hasInScope(x.BODY)&&(t.insertionMode=G.AFTER_BODY,BN(t,e))}function _X(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function xX(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(x.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(x.FORM):n&&t.openElements.remove(n))}function TX(t){t.openElements.hasInButtonScope(x.P)||t._insertFakeElement(oe.P,x.P),t._closePElement()}function SX(t){t.openElements.hasInListItemScope(x.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(x.LI),t.openElements.popUntilTagNamePopped(x.LI))}function wX(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function kX(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function CX(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function AX(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(oe.BR,x.BR),t.openElements.pop(),t.framesetOk=!1}function AN(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const s=t.openElements.items[i],a=t.openElements.tagIDs[i];if(r===a&&(r!==x.UNKNOWN||t.treeAdapter.getTagName(s)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(s,a))break}}function J1(t,e){switch(e.tagID){case x.A:case x.B:case x.I:case x.S:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.NOBR:case x.SMALL:case x.STRIKE:case x.STRONG:{a_(t,e);break}case x.P:{TX(t);break}case x.DL:case x.UL:case x.OL:case x.DIR:case x.DIV:case x.NAV:case x.PRE:case x.MAIN:case x.MENU:case x.ASIDE:case x.BUTTON:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.ADDRESS:case x.ARTICLE:case x.DETAILS:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.LISTING:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{_X(t,e);break}case x.LI:{SX(t);break}case x.DD:case x.DT:{wX(t,e);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{kX(t);break}case x.BR:{AX(t);break}case x.BODY:{yX(t,e);break}case x.HTML:{EX(t,e);break}case x.FORM:{xX(t);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{CX(t,e);break}case x.TEMPLATE:{Wu(t,e);break}default:AN(t,e)}}function NN(t,e){t.tmplInsertionModeStack.length>0?PN(t,e):o_(t,e)}function NX(t,e){var n;e.tagID===x.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function MX(t,e){t._err(e,ve.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function g2(t,e){if(t.openElements.currentTagId!==void 0&&TN.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=G.IN_TABLE_TEXT,e.type){case Bt.CHARACTER:{ON(t,e);break}case Bt.WHITESPACE_CHARACTER:{MN(t,e);break}}else Nh(t,e)}function OX(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ce.HTML),t.insertionMode=G.IN_CAPTION}function RX(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ce.HTML),t.insertionMode=G.IN_COLUMN_GROUP}function DX(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(oe.COLGROUP,x.COLGROUP),t.insertionMode=G.IN_COLUMN_GROUP,l_(t,e)}function IX(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ce.HTML),t.insertionMode=G.IN_TABLE_BODY}function LX(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(oe.TBODY,x.TBODY),t.insertionMode=G.IN_TABLE_BODY,eb(t,e)}function PX(t,e){t.openElements.hasInTableScope(x.TABLE)&&(t.openElements.popUntilTagNamePopped(x.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function BX(t,e){CN(e)?t._appendElement(e,Ce.HTML):Nh(t,e),e.ackSelfClosing=!0}function zX(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ce.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function ld(t,e){switch(e.tagID){case x.TD:case x.TH:case x.TR:{LX(t,e);break}case x.STYLE:case x.SCRIPT:case x.TEMPLATE:{Js(t,e);break}case x.COL:{DX(t,e);break}case x.FORM:{zX(t,e);break}case x.TABLE:{PX(t,e);break}case x.TBODY:case x.TFOOT:case x.THEAD:{IX(t,e);break}case x.INPUT:{BX(t,e);break}case x.CAPTION:{OX(t,e);break}case x.COLGROUP:{RX(t,e);break}default:Nh(t,e)}}function Kf(t,e){switch(e.tagID){case x.TABLE:{t.openElements.hasInTableScope(x.TABLE)&&(t.openElements.popUntilTagNamePopped(x.TABLE),t._resetInsertionMode());break}case x.TEMPLATE:{Wu(t,e);break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TBODY:case x.TD:case x.TFOOT:case x.TH:case x.THEAD:case x.TR:break;default:Nh(t,e)}}function Nh(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Z1(t,e),t.fosterParentingEnabled=n}function MN(t,e){t.pendingCharacterTokens.push(e)}function ON(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function H0(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)Nh(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const RN=new Set([x.CAPTION,x.COL,x.COLGROUP,x.TBODY,x.TD,x.TFOOT,x.TH,x.THEAD,x.TR]);function FX(t,e){const n=e.tagID;RN.has(n)?t.openElements.hasInTableScope(x.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(x.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=G.IN_TABLE,ld(t,e)):fi(t,e)}function UX(t,e){const n=e.tagID;switch(n){case x.CAPTION:case x.TABLE:{t.openElements.hasInTableScope(x.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(x.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=G.IN_TABLE,n===x.TABLE&&Kf(t,e));break}case x.BODY:case x.COL:case x.COLGROUP:case x.HTML:case x.TBODY:case x.TD:case x.TFOOT:case x.TH:case x.THEAD:case x.TR:break;default:J1(t,e)}}function l_(t,e){switch(e.tagID){case x.HTML:{fi(t,e);break}case x.COL:{t._appendElement(e,Ce.HTML),e.ackSelfClosing=!0;break}case x.TEMPLATE:{Js(t,e);break}default:_g(t,e)}}function HX(t,e){switch(e.tagID){case x.COLGROUP:{t.openElements.currentTagId===x.COLGROUP&&(t.openElements.pop(),t.insertionMode=G.IN_TABLE);break}case x.TEMPLATE:{Wu(t,e);break}case x.COL:break;default:_g(t,e)}}function _g(t,e){t.openElements.currentTagId===x.COLGROUP&&(t.openElements.pop(),t.insertionMode=G.IN_TABLE,t._processToken(e))}function eb(t,e){switch(e.tagID){case x.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,Ce.HTML),t.insertionMode=G.IN_ROW;break}case x.TH:case x.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(oe.TR,x.TR),t.insertionMode=G.IN_ROW,tb(t,e);break}case x.CAPTION:case x.COL:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=G.IN_TABLE,ld(t,e));break}default:ld(t,e)}}function l4(t,e){const n=e.tagID;switch(e.tagID){case x.TBODY:case x.TFOOT:case x.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=G.IN_TABLE);break}case x.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=G.IN_TABLE,Kf(t,e));break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TD:case x.TH:case x.TR:break;default:Kf(t,e)}}function tb(t,e){switch(e.tagID){case x.TH:case x.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,Ce.HTML),t.insertionMode=G.IN_CELL,t.activeFormattingElements.insertMarker();break}case x.CAPTION:case x.COL:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:case x.TR:{t.openElements.hasInTableScope(x.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=G.IN_TABLE_BODY,eb(t,e));break}default:ld(t,e)}}function DN(t,e){switch(e.tagID){case x.TR:{t.openElements.hasInTableScope(x.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=G.IN_TABLE_BODY);break}case x.TABLE:{t.openElements.hasInTableScope(x.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=G.IN_TABLE_BODY,l4(t,e));break}case x.TBODY:case x.TFOOT:case x.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(x.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=G.IN_TABLE_BODY,l4(t,e));break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TD:case x.TH:break;default:Kf(t,e)}}function jX(t,e){const n=e.tagID;RN.has(n)?(t.openElements.hasInTableScope(x.TD)||t.openElements.hasInTableScope(x.TH))&&(t._closeTableCell(),tb(t,e)):fi(t,e)}function $X(t,e){const n=e.tagID;switch(n){case x.TD:case x.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=G.IN_ROW);break}case x.TABLE:case x.TBODY:case x.TFOOT:case x.THEAD:case x.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),DN(t,e));break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:break;default:J1(t,e)}}function IN(t,e){switch(e.tagID){case x.HTML:{fi(t,e);break}case x.OPTION:{t.openElements.currentTagId===x.OPTION&&t.openElements.pop(),t._insertElement(e,Ce.HTML);break}case x.OPTGROUP:{t.openElements.currentTagId===x.OPTION&&t.openElements.pop(),t.openElements.currentTagId===x.OPTGROUP&&t.openElements.pop(),t._insertElement(e,Ce.HTML);break}case x.HR:{t.openElements.currentTagId===x.OPTION&&t.openElements.pop(),t.openElements.currentTagId===x.OPTGROUP&&t.openElements.pop(),t._appendElement(e,Ce.HTML),e.ackSelfClosing=!0;break}case x.INPUT:case x.KEYGEN:case x.TEXTAREA:case x.SELECT:{t.openElements.hasInSelectScope(x.SELECT)&&(t.openElements.popUntilTagNamePopped(x.SELECT),t._resetInsertionMode(),e.tagID!==x.SELECT&&t._processStartTag(e));break}case x.SCRIPT:case x.TEMPLATE:{Js(t,e);break}}}function LN(t,e){switch(e.tagID){case x.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===x.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===x.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===x.OPTGROUP&&t.openElements.pop();break}case x.OPTION:{t.openElements.currentTagId===x.OPTION&&t.openElements.pop();break}case x.SELECT:{t.openElements.hasInSelectScope(x.SELECT)&&(t.openElements.popUntilTagNamePopped(x.SELECT),t._resetInsertionMode());break}case x.TEMPLATE:{Wu(t,e);break}}}function qX(t,e){const n=e.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?(t.openElements.popUntilTagNamePopped(x.SELECT),t._resetInsertionMode(),t._processStartTag(e)):IN(t,e)}function VX(t,e){const n=e.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(x.SELECT),t._resetInsertionMode(),t.onEndTag(e)):LN(t,e)}function GX(t,e){switch(e.tagID){case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{Js(t,e);break}case x.CAPTION:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:{t.tmplInsertionModeStack[0]=G.IN_TABLE,t.insertionMode=G.IN_TABLE,ld(t,e);break}case x.COL:{t.tmplInsertionModeStack[0]=G.IN_COLUMN_GROUP,t.insertionMode=G.IN_COLUMN_GROUP,l_(t,e);break}case x.TR:{t.tmplInsertionModeStack[0]=G.IN_TABLE_BODY,t.insertionMode=G.IN_TABLE_BODY,eb(t,e);break}case x.TD:case x.TH:{t.tmplInsertionModeStack[0]=G.IN_ROW,t.insertionMode=G.IN_ROW,tb(t,e);break}default:t.tmplInsertionModeStack[0]=G.IN_BODY,t.insertionMode=G.IN_BODY,fi(t,e)}}function YX(t,e){e.tagID===x.TEMPLATE&&Wu(t,e)}function PN(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(x.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):o_(t,e)}function WX(t,e){e.tagID===x.HTML?fi(t,e):xg(t,e)}function BN(t,e){var n;if(e.tagID===x.HTML){if(t.fragmentContext||(t.insertionMode=G.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===x.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else xg(t,e)}function xg(t,e){t.insertionMode=G.IN_BODY,Z1(t,e)}function KX(t,e){switch(e.tagID){case x.HTML:{fi(t,e);break}case x.FRAMESET:{t._insertElement(e,Ce.HTML);break}case x.FRAME:{t._appendElement(e,Ce.HTML),e.ackSelfClosing=!0;break}case x.NOFRAMES:{Js(t,e);break}}}function XX(t,e){e.tagID===x.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==x.FRAMESET&&(t.insertionMode=G.AFTER_FRAMESET))}function QX(t,e){switch(e.tagID){case x.HTML:{fi(t,e);break}case x.NOFRAMES:{Js(t,e);break}}}function ZX(t,e){e.tagID===x.HTML&&(t.insertionMode=G.AFTER_AFTER_FRAMESET)}function JX(t,e){e.tagID===x.HTML?fi(t,e):tg(t,e)}function tg(t,e){t.insertionMode=G.IN_BODY,Z1(t,e)}function eQ(t,e){switch(e.tagID){case x.HTML:{fi(t,e);break}case x.NOFRAMES:{Js(t,e);break}}}function tQ(t,e){e.chars=Fn,t._insertCharacters(e)}function nQ(t,e){t._insertCharacters(e),t.framesetOk=!1}function zN(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==Ce.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function rQ(t,e){if(vK(e))zN(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===Ce.MATHML?_N(e):r===Ce.SVG&&(yK(e),xN(e)),s_(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function iQ(t,e){if(e.tagID===x.P||e.tagID===x.BR){zN(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===Ce.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}oe.AREA,oe.BASE,oe.BASEFONT,oe.BGSOUND,oe.BR,oe.COL,oe.EMBED,oe.FRAME,oe.HR,oe.IMG,oe.INPUT,oe.KEYGEN,oe.LINK,oe.META,oe.PARAM,oe.SOURCE,oe.TRACK,oe.WBR;const sQ=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,aQ=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),ek={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function FN(t,e){const n=gQ(t),r=M9("type",{handlers:{root:oQ,element:lQ,text:uQ,comment:HN,doctype:cQ,raw:fQ},unknown:hQ}),i={parser:n?new Qw(ek):Qw.getFragmentParser(void 0,ek),handle(l){r(l,i)},stitches:!1,options:e||{}};r(t,i),Md(i,wa());const s=n?i.parser.document:i.parser.getFragment(),a=oW(s,{file:i.options.file});return i.stitches&&kh(a,"comment",function(l,u,d){const h=l;if(h.value.stitch&&d&&u!==void 0){const p=d.children;return p[u]=h.value.stitch,u}}),a.type==="root"&&a.children.length===1&&a.children[0].type===t.type?a.children[0]:a}function UN(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function oQ(t,e){UN(t.children,e)}function lQ(t,e){pQ(t,e),UN(t.children,e),mQ(t,e)}function uQ(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:Bt.CHARACTER,chars:t.value,location:Mh(t)};Md(e,wa(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function cQ(t,e){const n={type:Bt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Mh(t)};Md(e,wa(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function dQ(t,e){e.stitches=!0;const n=bQ(t);if("children"in t&&"children"in n){const r=FN({type:"root",children:t.children},e.options);n.children=r.children}HN({type:"comment",value:{stitch:n}},e)}function HN(t,e){const n=t.value,r={type:Bt.COMMENT,data:n,location:Mh(t)};Md(e,wa(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function fQ(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,jN(e,wa(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(sQ,"&lt;$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=e.parser.tokenizer._consume();e.parser.tokenizer._callState(n)}}function hQ(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))dQ(n,e);else{let r="";throw aQ.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Md(t,e){jN(t,e);const n=t.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=t.parser.tokenizer.preprocessor.line,n.location.endCol=t.parser.tokenizer.preprocessor.col+1,n.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=cr.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function jN(t,e){if(e&&e.offset!==void 0){const n={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=n}}function pQ(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===cr.PLAINTEXT)return;Md(e,wa(t));const r=e.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:ma.html;i===ma.html&&n==="svg"&&(i=ma.svg);const s=xW({...t,children:[]},{space:i===ma.svg?"svg":"html"}),a={type:Bt.START_TAG,tagName:n,tagID:Nd(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Mh(t)};e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function mQ(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&MW.includes(n)||e.parser.tokenizer.state===cr.PLAINTEXT)return;Md(e,Y1(t));const r={type:Bt.END_TAG,tagName:n,tagID:Nd(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Mh(t)};e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===cr.RCDATA||e.parser.tokenizer.state===cr.RAWTEXT||e.parser.tokenizer.state===cr.SCRIPT_DATA)&&(e.parser.tokenizer.state=cr.DATA)}function gQ(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Mh(t){const e=wa(t)||{line:void 0,column:void 0,offset:void 0},n=Y1(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function bQ(t){return"children"in t?od({...t,children:[]}):od(t)}function vQ(t){return function(e,n){return FN(e,{...t,file:n})}}const tk=function(t,e,n){const r=wh(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(r(t.children[e],e,t))return t.children[e]},Ku=function(t){if(t==null)return _Q;if(typeof t=="string")return EQ(t);if(typeof t=="object")return yQ(t);if(typeof t=="function")return u_(t);throw new Error("Expected function, string, or array as `test`")};function yQ(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Ku(t[n]);return u_(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function EQ(t){return u_(e);function e(n){return n.tagName===t}}function u_(t){return e;function e(n,r,i){return!!(xQ(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function _Q(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function xQ(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const nk=/\n/g,rk=/[\t ]+/g,u4=Ku("br"),ik=Ku(NQ),TQ=Ku("p"),sk=Ku("tr"),SQ=Ku(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",AQ,MQ]),$N=Ku(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function qN(t,e){const n=e||{},r="children"in t?t.children:[],i=$N(t),s=YN(t,{whitespace:n.whitespace||"normal"}),a=[];(t.type==="text"||t.type==="comment")&&a.push(...GN(t,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)a.push(...VN(r[l],t,{whitespace:s,breakBefore:l?void 0:i,breakAfter:l<r.length-1?u4(r[l+1]):i}));const u=[];let d;for(l=-1;++l<a.length;){const h=a[l];typeof h=="number"?d!==void 0&&h>d&&(d=h):h&&(d!==void 0&&d>-1&&u.push(`
`.repeat(d)||" "),d=-1,u.push(h))}return u.join("")}function VN(t,e,n){return t.type==="element"?wQ(t,e,n):t.type==="text"?n.whitespace==="normal"?GN(t,n):kQ(t):[]}function wQ(t,e,n){const r=YN(t,n),i=t.children||[];let s=-1,a=[];if(SQ(t))return a;let l,u;for(u4(t)||sk(t)&&tk(e,t,sk)?u=`
`:TQ(t)?(l=2,u=2):$N(t)&&(l=1,u=1);++s<i.length;)a=a.concat(VN(i[s],t,{whitespace:r,breakBefore:s?void 0:l,breakAfter:s<i.length-1?u4(i[s+1]):u}));return ik(t)&&tk(e,t,ik)&&a.push("	"),l&&a.unshift(l),u&&a.push(u),a}function GN(t,e){const n=String(t.value),r=[],i=[];let s=0;for(;s<=n.length;){nk.lastIndex=s;const u=nk.exec(n),d=u&&"index"in u?u.index:n.length;r.push(CQ(n.slice(s,d).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?e.breakBefore:!0,d===n.length?e.breakAfter:!0)),s=d+1}let a=-1,l;for(;++a<r.length;)r[a].charCodeAt(r[a].length-1)===8203||a<r.length-1&&r[a+1].charCodeAt(0)===8203?(i.push(r[a]),l=void 0):r[a]?(typeof l=="number"&&i.push(l),i.push(r[a]),l=0):(a===0||a===r.length-1)&&i.push(0);return i}function kQ(t){return[String(t.value)]}function CQ(t,e,n){const r=[];let i=0,s;for(;i<t.length;){rk.lastIndex=i;const a=rk.exec(t);s=a?a.index:t.length,!i&&!s&&a&&!e&&r.push(""),i!==s&&r.push(t.slice(i,s)),i=a?s+a[0].length:s}return i!==s&&!n&&r.push(""),r.join(" ")}function YN(t,e){if(t.type==="element"){const n=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function AQ(t){return!!(t.properties||{}).hidden}function NQ(t){return t.tagName==="td"||t.tagName==="th"}function MQ(t){return t.tagName==="dialog"&&!(t.properties||{}).open}function OQ(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],T=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],z={type:E,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},I={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},P=[I,p,l,n,t.C_BLOCK_COMMENT_MODE,h,d],$={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:P.concat([{begin:/\(/,end:/\)/,keywords:z,contains:P.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+a+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:z,relevance:0},{begin:b,returnBegin:!0,contains:[g],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,h,l,{begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,h,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat($,K,I,P,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:z,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function RQ(t){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=OQ(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function DQ(t){const e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const u={match:/\\"/},d={className:"string",begin:/'/,end:/'/},h={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},g=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=t.SHEBANG({binary:`(${g.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],T=["true","false"],S={match:/(\/[a-z._-]+)+/},A=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],z=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],I=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:E,literal:T,built_in:[...A,...R,"set","shopt",...z,...I]},contains:[b,t.SHEBANG(),y,p,s,a,S,l,u,d,h,n]}}function IQ(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",T={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},S=[p,l,n,t.C_BLOCK_COMMENT_MODE,h,d],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:S.concat([{begin:/\(/,end:/\)/,keywords:T,contains:S.concat(["self"]),relevance:0}]),relevance:0},R={begin:"("+a+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:b,returnBegin:!0,contains:[t.inherit(g,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,h,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,h,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:T,disableAutodetect:!0,illegal:"</",contains:[].concat(A,R,S,[p,{begin:t.IDENT_RE+"::",keywords:T},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:p,strings:d,keywords:T}}}function LQ(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],T=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],z={type:E,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},I={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},P=[I,p,l,n,t.C_BLOCK_COMMENT_MODE,h,d],$={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:P.concat([{begin:/\(/,end:/\)/,keywords:z,contains:P.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+a+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:z,relevance:0},{begin:b,returnBegin:!0,contains:[g],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,h,l,{begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,h,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat($,K,I,P,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:z,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function PQ(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:i.concat(s),built_in:e,literal:r},l=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},h={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=t.inherit(h,{illegal:/\n/}),g={className:"subst",begin:/\{/,end:/\}/,keywords:a},b=t.inherit(g,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,b]},E={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]},T=t.inherit(E,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]});g.contains=[E,y,h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.C_BLOCK_COMMENT_MODE],b.contains=[T,y,p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const S={variants:[d,E,y,h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},A={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},R=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",z={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},S,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,A,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,A,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+R+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,A],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[S,u,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},z]}}const BQ=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),zQ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],FQ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],UQ=[...zQ,...FQ],HQ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),jQ=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),$Q=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),qQ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function VQ(t){const e=t.regex,n=BQ(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",l=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+jQ.join("|")+")"},{begin:":(:)?("+$Q.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+qQ.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:HQ.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+UQ.join("|")+")\\b"}]}}function GQ(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function YQ(t){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function WQ(t){const e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function KQ(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},a={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[r,s,i,a,n,"self"],relevance:0},u=/[A-Za-z0-9_-]+/,d=/"(\\"|[^"])*"/,h=/'[^']*'/,p=e.either(u,d,h),g=e.concat(p,"(\\s*\\.\\s*",p,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:g,className:"attr",starts:{end:/$/,contains:[r,l,s,i,a,n]}}]}}var $c="[0-9](_*[0-9])*",dm=`\\.(${$c})`,fm="[0-9a-fA-F](_*[0-9a-fA-F])*",ak={className:"number",variants:[{begin:`(\\b(${$c})((${dm})|\\.)?|(${dm}))[eE][+-]?(${$c})[fFdD]?\\b`},{begin:`\\b(${$c})((${dm})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${dm})[fFdD]?\\b`},{begin:`\\b(${$c})[fFdD]\\b`},{begin:`\\b0[xX]((${fm})\\.?|(${fm})?\\.(${fm}))[pP][+-]?(${$c})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${fm})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function WN(t,e,n){return n===-1?"":t.replace(e,r=>WN(t,e,n-1))}function XQ(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+WN("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,ak,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},ak,d]}}const ok="[A-Za-z$_][0-9A-Za-z$_]*",QQ=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ZQ=["true","false","null","undefined","NaN","Infinity"],KN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],XN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],QN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],JQ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],eZ=[].concat(QN,KN,XN);function tZ(t){const e=t.regex,n=(he,{after:Oe})=>{const N="</"+he[0].slice(1);return he.input.indexOf(N,Oe)!==-1},r=ok,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(he,Oe)=>{const N=he[0].length+he.index,X=he.input[N];if(X==="<"||X===","){Oe.ignoreMatch();return}X===">"&&(n(he,{after:N})||Oe.ignoreMatch());let me;const B=he.input.substring(N);if(me=B.match(/^\s*=/)){Oe.ignoreMatch();return}if((me=B.match(/^\s+extends\s+/))&&me.index===0){Oe.ignoreMatch();return}}},l={$pattern:ok,keyword:QQ,literal:ZQ,built_in:eZ,"variable.language":JQ},u="[0-9](_?[0-9])*",d=`\\.(${u})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${h})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${h})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,g]},A={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},R=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,y,E,T,{match:/\$\d+/},p];g.contains=R.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(R)});const z=[].concat(A,g.contains),I=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(z)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:I},$={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...KN,...XN]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(he){return e.concat("(?!",he.join("|"),")")}const ye={match:e.concat(/\b/,ie([...QN,"super","import"].map(he=>`${he}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},de={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},J="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",ne={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(J)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,y,E,T,A,{match:/\$\d+/},p,K,{scope:"attr",match:r+e.lookahead(":"),relevance:0},ne,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,t.REGEXP_MODE,{className:"function",begin:J,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},ye,re,$,de,{match:/\$[(.]/}]}}function nZ(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var qc="[0-9](_*[0-9])*",hm=`\\.(${qc})`,pm="[0-9a-fA-F](_*[0-9a-fA-F])*",rZ={className:"number",variants:[{begin:`(\\b(${qc})((${hm})|\\.)?|(${hm}))[eE][+-]?(${qc})[fFdD]?\\b`},{begin:`\\b(${qc})((${hm})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${hm})[fFdD]?\\b`},{begin:`\\b(${qc})[fFdD]\\b`},{begin:`\\b0[xX]((${pm})\\.?|(${pm})?\\.(${pm}))[pP][+-]?(${qc})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${pm})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function iZ(t){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(a);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(a,{className:"string"}),"self"]}]},d=rZ,h=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},g=p;return g.variants[1].contains=[p],p.variants[1].contains=[g],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,h,n,r,l,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,t.C_LINE_COMMENT_MODE,h],relevance:0},t.C_LINE_COMMENT_MODE,h,l,u,a,t.C_NUMBER_MODE]},h]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,u]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
`},d]}}const sZ=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),aZ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],oZ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],lZ=[...aZ,...oZ],uZ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),ZN=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),JN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),cZ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),dZ=ZN.concat(JN).sort().reverse();function fZ(t){const e=sZ(t),n=dZ,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",a=[],l=[],u=function(R){return{className:"string",begin:"~?"+R+".*?"+R}},d=function(R,z,I){return{className:R,begin:z,relevance:I}},h={$pattern:/[a-z-]+/,keyword:r,attribute:uZ.join(" ")},p={begin:"\\(",end:"\\)",contains:l,keywords:h,relevance:0};l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,u("'"),u('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,p,d("variable","@@?"+i,10),d("variable","@\\{"+i+"\\}"),d("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const g=l.concat({begin:/\{/,end:/\}/,contains:a}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},y={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+cZ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},E={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:h,returnEnd:!0,contains:l,relevance:0}},T={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:g}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,b,d("keyword","all\\b"),d("variable","@\\{"+i+"\\}"),{begin:"\\b("+lZ.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,d("selector-tag",s,0),d("selector-id","#"+s),d("selector-class","\\."+s,0),d("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+ZN.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+JN.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:g},{begin:"!important"},e.FUNCTION_DISPATCH]},A={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[S]};return a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,E,T,A,y,S,b,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function hZ(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function pZ(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},a={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,r,i,s,a]}}function mZ(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ 	]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=t.inherit(d,{contains:[]}),g=t.inherit(h,{contains:[]});d.contains.push(g),h.contains.push(p);let b=[n,u];return[d,h,p,g].forEach(S=>{S.contains=S.contains.concat(b)}),b=b.concat(d,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,s,d,h,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},i,r,u,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function gZ(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function bZ(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},a={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},u={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},d={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},h=[t.BACKSLASH_ESCAPE,s,u],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],g=(E,T,S="\\1")=>{const A=S==="\\1"?S:e.concat(S,T);return e.concat(e.concat("(?:",E,")"),T,/(?:\\.|[^\\\/])*?/,A,/(?:\\.|[^\\\/])*?/,S,r)},b=(E,T,S)=>e.concat(e.concat("(?:",E,")"),T,/(?:\\.|[^\\\/])*?/,S,r),y=[u,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:h,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},d,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:g("s|tr|y",e.either(...p,{capture:!0}))},{begin:g("s|tr|y","\\(","\\)")},{begin:g("s|tr|y","\\[","\\]")},{begin:g("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:b("(?:m|qr)?",/\//,/\//)},{begin:b("m|qr",e.either(...p,{capture:!0}),/\1/)},{begin:b("m|qr",/\(/,/\)/)},{begin:b("m|qr",/\[/,/\]/)},{begin:b("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,l,d]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=y,a.contains=y,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:y}}function vZ(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=e.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},u={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},d=t.inherit(t.APOS_STRING_MODE,{illegal:null}),h=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(u)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(u),"on:begin":(ae,de)=>{de.data._beginMatch=ae[1]||ae[2]},"on:end":(ae,de)=>{de.data._beginMatch!==ae[1]&&de.ignoreMatch()}},g=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),b=`[ 	
]`,y={scope:"string",variants:[h,d,p,g]},E={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},T=["false","null","true"],S=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],A=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],z={keyword:S,literal:(ae=>{const de=[];return ae.forEach(J=>{de.push(J),J.toLowerCase()===J?de.push(J.toUpperCase()):de.push(J.toLowerCase())}),de})(T),built_in:A},I=ae=>ae.map(de=>de.replace(/\|\d+$/,"")),P={variants:[{match:[/new/,e.concat(b,"+"),e.concat("(?!",I(A).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},$=e.concat(r,"\\b(?!\\()"),K={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),$],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),$],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Z={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},W={relevance:0,begin:/\(/,end:/\)/,keywords:z,contains:[Z,a,K,t.C_BLOCK_COMMENT_MODE,y,E,P]},re={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",I(S).join("\\b|"),"|",I(A).join("\\b|"),"\\b)"),r,e.concat(b,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[W]};W.contains.push(re);const ie=[Z,K,t.C_BLOCK_COMMENT_MODE,y,E,P],ye={begin:e.concat(/#\[\s*\\?/,e.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:T,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:T,keyword:["new","array"]},contains:["self",...ie]},...ie,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:z,contains:[ye,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,re,K,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},P,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",ye,a,K,t.C_BLOCK_COMMENT_MODE,y,E]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},y,E]}}function yZ(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function EZ(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function _Z(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},h={begin:/\{\{/,relevance:0},p={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,h,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,h,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},g="[0-9](_?[0-9])*",b=`(\\b(${g}))?\\.(${g})|\\b(${g})\\.`,y=`\\b|${r.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${g})|(${b}))[eE][+-]?(${g})[jJ]?(?=${y})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${g})[jJ](?=${y})`}]},T={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,E,p,t.HASH_COMMENT_MODE]}]};return d.contains=[p,E,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,T,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,S,p]}]}}function xZ(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function TZ(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function SZ(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},d=[t.COMMENT("#","$",{contains:[l]}),t.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],h={className:"subst",begin:/#\{/,end:/\}/,keywords:a},p={className:"string",contains:[t.BACKSLASH_ESCAPE,h],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,h]})]}]},g="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${g})(\\.(${b}))?([eE][+-]?(${b})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},P=[p,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,h],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,d),relevance:0}].concat(u,d);h.contains=P,E.contains=P;const W=[{begin:/^\s*=>/,starts:{end:"$",contains:P}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:P}}];return d.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(W).concat(d).concat(P)}}function wZ(t){const e=t.regex,n=/(r#)?/,r=e.concat(n,t.UNDERSCORE_IDENT_RE),i=e.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],d=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,keyword:l,literal:u,built_in:d},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:d,type:h}},{className:"punctuation",begin:"->"},s]}}const kZ=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),CZ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],AZ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],NZ=[...CZ,...AZ],MZ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),OZ=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),RZ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),DZ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function IZ(t){const e=kZ(t),n=RZ,r=OZ,i="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+NZ.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+DZ.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,l,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:MZ.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function LZ(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function PZ(t){const e=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],g=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],b=h,y=[...d,...u].filter(I=>!h.includes(I)),E={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},T={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={match:e.concat(/\b/,e.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function A(I){return e.concat(/\b/,e.either(...I.map(P=>P.replace(/\s+/,"\\s+"))),/\b/)}const R={scope:"keyword",match:A(g),relevance:0};function z(I,{exceptions:P,when:$}={}){const K=$;return P=P||[],I.map(Z=>Z.match(/\|\d+$/)||P.includes(Z)?Z:K(Z)?`${Z}|0`:Z)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:z(y,{when:I=>I.length<3}),literal:s,type:l,built_in:p},contains:[{scope:"type",match:A(a)},R,S,E,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,T]}}function eM(t){return t?typeof t=="string"?t:t.source:null}function j0(t){return vn("(?=",t,")")}function vn(...t){return t.map(n=>eM(n)).join("")}function BZ(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function yi(...t){return"("+(BZ(t).capture?"":"?:")+t.map(r=>eM(r)).join("|")+")"}const c_=t=>vn(/\b/,t,/\w$/.test(t)?/\b/:/\B/),zZ=["Protocol","Type"].map(c_),lk=["init","self"].map(c_),FZ=["Any","Self"],b2=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],uk=["false","nil","true"],UZ=["assignment","associativity","higherThan","left","lowerThan","none","right"],HZ=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ck=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],tM=yi(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),nM=yi(tM,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),v2=vn(tM,nM,"*"),rM=yi(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Tg=yi(rM,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),la=vn(rM,Tg,"*"),mm=vn(/[A-Z]/,Tg,"*"),jZ=["attached","autoclosure",vn(/convention\(/,yi("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",vn(/objc\(/,la,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],$Z=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function qZ(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,yi(...zZ,...lk)],className:{2:"keyword"}},s={match:vn(/\./,yi(...b2)),relevance:0},a=b2.filter(tt=>typeof tt=="string").concat(["_|0"]),l=b2.filter(tt=>typeof tt!="string").concat(FZ).map(c_),u={variants:[{className:"keyword",match:yi(...l,...lk)}]},d={$pattern:yi(/\b\w+/,/#\w+/),keyword:a.concat(HZ),literal:uk},h=[i,s,u],p={match:vn(/\./,yi(...ck)),relevance:0},g={className:"built_in",match:vn(/\b/,yi(...ck),/(?=\()/)},b=[p,g],y={match:/->/,relevance:0},E={className:"operator",relevance:0,variants:[{match:v2},{match:`\\.(\\.|${nM})+`}]},T=[y,E],S="([0-9]_*)+",A="([0-9a-fA-F]_*)+",R={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${A})(\\.(${A}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},z=(tt="")=>({className:"subst",variants:[{match:vn(/\\/,tt,/[0\\tnr"']/)},{match:vn(/\\/,tt,/u\{[0-9a-fA-F]{1,8}\}/)}]}),I=(tt="")=>({className:"subst",match:vn(/\\/,tt,/[\t ]*(?:[\r\n]|\r\n)/)}),P=(tt="")=>({className:"subst",label:"interpol",begin:vn(/\\/,tt,/\(/),end:/\)/}),$=(tt="")=>({begin:vn(tt,/"""/),end:vn(/"""/,tt),contains:[z(tt),I(tt),P(tt)]}),K=(tt="")=>({begin:vn(tt,/"/),end:vn(/"/,tt),contains:[z(tt),P(tt)]}),Z={className:"string",variants:[$(),$("#"),$("##"),$("###"),K(),K("#"),K("##"),K("###")]},W=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],re={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:W},ie=tt=>{const kt=vn(tt,/\//),fn=vn(/\//,tt);return{begin:kt,end:fn,contains:[...W,{scope:"comment",begin:`#(?!.*${fn})`,end:/$/}]}},ye={scope:"regexp",variants:[ie("###"),ie("##"),ie("#"),re]},ae={match:vn(/`/,la,/`/)},de={className:"variable",match:/\$\d+/},J={className:"variable",match:`\\$${Tg}+`},ne=[ae,de,J],he={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:$Z,contains:[...T,R,Z]}]}},Oe={scope:"keyword",match:vn(/@/,yi(...jZ),j0(yi(/\(/,/\s+/)))},N={scope:"meta",match:vn(/@/,la)},X=[he,Oe,N],me={match:j0(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:vn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Tg,"+")},{className:"type",match:mm,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:vn(/\s+&\s+/,j0(mm)),relevance:0}]},B={begin:/</,end:/>/,keywords:d,contains:[...r,...h,...X,y,me]};me.contains.push(B);const Ee={match:vn(la,/\s*:/),keywords:"_|0",relevance:0},Qe={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",Ee,...r,ye,...h,...b,...T,R,Z,...ne,...X,me]},Fe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,me]},Ft={begin:yi(j0(vn(la,/\s*:/)),j0(vn(la,/\s+/,la,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:la}]},ut={begin:/\(/,end:/\)/,keywords:d,contains:[Ft,...r,...h,...T,R,Z,...X,me,Qe],endsParent:!0,illegal:/["']/},en={match:[/(func|macro)/,/\s+/,yi(ae.match,la,v2)],className:{1:"keyword",3:"title.function"},contains:[Fe,ut,e],illegal:[/\[/,/%/]},Nt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Fe,ut,e],illegal:/\[|%/},Mn={match:[/operator/,/\s+/,v2],className:{1:"keyword",3:"title"}},Vr={begin:[/precedencegroup/,/\s+/,mm],className:{1:"keyword",3:"title"},contains:[me],keywords:[...UZ,...uk],end:/}/},gt={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},St={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Gt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,la,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:d,contains:[Fe,...h,{begin:/:/,end:/\{/,keywords:d,contains:[{scope:"title.class.inherited",match:mm},...h],relevance:0}]};for(const tt of Z.variants){const kt=tt.contains.find(qt=>qt.label==="interpol");kt.keywords=d;const fn=[...h,...b,...T,R,Z,...ne];kt.contains=[...fn,{begin:/\(/,end:/\)/,contains:["self",...fn]}]}return{name:"Swift",keywords:d,contains:[...r,en,Nt,gt,St,Gt,Mn,Vr,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},ye,...h,...b,...T,R,Z,...ne,...X,me,Qe]}}const Sg="[A-Za-z$_][0-9A-Za-z$_]*",iM=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],sM=["true","false","null","undefined","NaN","Infinity"],aM=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],oM=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],lM=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],uM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],cM=[].concat(lM,aM,oM);function VZ(t){const e=t.regex,n=(he,{after:Oe})=>{const N="</"+he[0].slice(1);return he.input.indexOf(N,Oe)!==-1},r=Sg,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(he,Oe)=>{const N=he[0].length+he.index,X=he.input[N];if(X==="<"||X===","){Oe.ignoreMatch();return}X===">"&&(n(he,{after:N})||Oe.ignoreMatch());let me;const B=he.input.substring(N);if(me=B.match(/^\s*=/)){Oe.ignoreMatch();return}if((me=B.match(/^\s+extends\s+/))&&me.index===0){Oe.ignoreMatch();return}}},l={$pattern:Sg,keyword:iM,literal:sM,built_in:cM,"variable.language":uM},u="[0-9](_?[0-9])*",d=`\\.(${u})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${h})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${h})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,g]},A={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},R=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,y,E,T,{match:/\$\d+/},p];g.contains=R.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(R)});const z=[].concat(A,g.contains),I=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(z)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:I},$={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...aM,...oM]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(he){return e.concat("(?!",he.join("|"),")")}const ye={match:e.concat(/\b/,ie([...lM,"super","import"].map(he=>`${he}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},de={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},J="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",ne={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(J)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,y,E,T,A,{match:/\$\d+/},p,K,{scope:"attr",match:r+e.lookahead(":"),relevance:0},ne,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,t.REGEXP_MODE,{className:"function",begin:J,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},ye,re,$,de,{match:/\$[(.]/}]}}function GZ(t){const e=t.regex,n=VZ(t),r=Sg,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:Sg,keyword:iM.concat(u),literal:sM,built_in:cM.concat(i),"variable.language":uM},h={className:"meta",begin:"@"+r},p=(E,T,S)=>{const A=E.contains.findIndex(R=>R.label===T);if(A===-1)throw new Error("can not find mode to replace");E.contains.splice(A,1,S)};Object.assign(n.keywords,d),n.exports.PARAMS_CONTAINS.push(h);const g=n.contains.find(E=>E.scope==="attr"),b=Object.assign({},g,{match:e.concat(r,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,g,b]),n.contains=n.contains.concat([h,s,a,b]),p(n,"shebang",t.SHEBANG()),p(n,"use_strict",l);const y=n.contains.find(E=>E.label==="func.def");return y.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function YZ(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:e.concat(/# */,e.either(s,i),/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,e.either(s,i),/ +/,e.either(a,l),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},h={className:"label",begin:/^\w+:/},p=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),g=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,u,d,h,p,g,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[g]}]}}function WZ(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,i,t.QUOTE_STRING_MODE,u,d,l]}}function KZ(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=t.inherit(s,{begin:/\(/,end:/\)/}),l=t.inherit(t.APOS_STRING_MODE,{className:"string"}),u=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,u,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,a,u,l]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function XZ(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},l=t.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),g={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},y={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},E={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},T=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},g,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},y,E,s,a],S=[...T];return S.pop(),S.push(l),b.contains=S,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:T}}const QZ={arduino:RQ,bash:DQ,c:IQ,cpp:LQ,csharp:PQ,css:VQ,diff:GQ,go:YQ,graphql:WQ,ini:KQ,java:XQ,javascript:tZ,json:nZ,kotlin:iZ,less:fZ,lua:hZ,makefile:pZ,markdown:mZ,objectivec:gZ,perl:bZ,php:vZ,"php-template":yZ,plaintext:EZ,python:_Z,"python-repl":xZ,r:TZ,ruby:SZ,rust:wZ,scss:IZ,shell:LZ,sql:PZ,swift:qZ,typescript:GZ,vbnet:YZ,wasm:WZ,xml:KZ,yaml:XZ};var y2,dk;function ZZ(){if(dk)return y2;dk=1;function t(q){return q instanceof Map?q.clear=q.delete=q.set=function(){throw new Error("map is read-only")}:q instanceof Set&&(q.add=q.clear=q.delete=function(){throw new Error("set is read-only")}),Object.freeze(q),Object.getOwnPropertyNames(q).forEach(xe=>{const je=q[xe],yt=typeof je;(yt==="object"||yt==="function")&&!Object.isFrozen(je)&&t(je)}),q}class e{constructor(xe){xe.data===void 0&&(xe.data={}),this.data=xe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(q){return q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(q,...xe){const je=Object.create(null);for(const yt in q)je[yt]=q[yt];return xe.forEach(function(yt){for(const Pn in yt)je[Pn]=yt[Pn]}),je}const i="</span>",s=q=>!!q.scope,a=(q,{prefix:xe})=>{if(q.startsWith("language:"))return q.replace("language:","language-");if(q.includes(".")){const je=q.split(".");return[`${xe}${je.shift()}`,...je.map((yt,Pn)=>`${yt}${"_".repeat(Pn+1)}`)].join(" ")}return`${xe}${q}`};class l{constructor(xe,je){this.buffer="",this.classPrefix=je.classPrefix,xe.walk(this)}addText(xe){this.buffer+=n(xe)}openNode(xe){if(!s(xe))return;const je=a(xe.scope,{prefix:this.classPrefix});this.span(je)}closeNode(xe){s(xe)&&(this.buffer+=i)}value(){return this.buffer}span(xe){this.buffer+=`<span class="${xe}">`}}const u=(q={})=>{const xe={children:[]};return Object.assign(xe,q),xe};class d{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(xe){this.top.children.push(xe)}openNode(xe){const je=u({scope:xe});this.add(je),this.stack.push(je)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(xe){return this.constructor._walk(xe,this.rootNode)}static _walk(xe,je){return typeof je=="string"?xe.addText(je):je.children&&(xe.openNode(je),je.children.forEach(yt=>this._walk(xe,yt)),xe.closeNode(je)),xe}static _collapse(xe){typeof xe!="string"&&xe.children&&(xe.children.every(je=>typeof je=="string")?xe.children=[xe.children.join("")]:xe.children.forEach(je=>{d._collapse(je)}))}}class h extends d{constructor(xe){super(),this.options=xe}addText(xe){xe!==""&&this.add(xe)}startScope(xe){this.openNode(xe)}endScope(){this.closeNode()}__addSublanguage(xe,je){const yt=xe.root;je&&(yt.scope=`language:${je}`),this.add(yt)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(q){return q?typeof q=="string"?q:q.source:null}function g(q){return E("(?=",q,")")}function b(q){return E("(?:",q,")*")}function y(q){return E("(?:",q,")?")}function E(...q){return q.map(je=>p(je)).join("")}function T(q){const xe=q[q.length-1];return typeof xe=="object"&&xe.constructor===Object?(q.splice(q.length-1,1),xe):{}}function S(...q){return"("+(T(q).capture?"":"?:")+q.map(yt=>p(yt)).join("|")+")"}function A(q){return new RegExp(q.toString()+"|").exec("").length-1}function R(q,xe){const je=q&&q.exec(xe);return je&&je.index===0}const z=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function I(q,{joinWith:xe}){let je=0;return q.map(yt=>{je+=1;const Pn=je;let jn=p(yt),Ke="";for(;jn.length>0;){const He=z.exec(jn);if(!He){Ke+=jn;break}Ke+=jn.substring(0,He.index),jn=jn.substring(He.index+He[0].length),He[0][0]==="\\"&&He[1]?Ke+="\\"+String(Number(He[1])+Pn):(Ke+=He[0],He[0]==="("&&je++)}return Ke}).map(yt=>`(${yt})`).join(xe)}const P=/\b\B/,$="[a-zA-Z]\\w*",K="[a-zA-Z_]\\w*",Z="\\b\\d+(\\.\\d+)?",W="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",re="\\b(0b[01]+)",ie="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ye=(q={})=>{const xe=/^#![ ]*\//;return q.binary&&(q.begin=E(xe,/.*\b/,q.binary,/\b.*/)),r({scope:"meta",begin:xe,end:/$/,relevance:0,"on:begin":(je,yt)=>{je.index!==0&&yt.ignoreMatch()}},q)},ae={begin:"\\\\[\\s\\S]",relevance:0},de={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ae]},J={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ae]},ne={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},he=function(q,xe,je={}){const yt=r({scope:"comment",begin:q,end:xe,contains:[]},je);yt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Pn=S("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return yt.contains.push({begin:E(/[ ]+/,"(",Pn,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),yt},Oe=he("//","$"),N=he("/\\*","\\*/"),X=he("#","$"),me={scope:"number",begin:Z,relevance:0},B={scope:"number",begin:W,relevance:0},Ee={scope:"number",begin:re,relevance:0},Qe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ae,{begin:/\[/,end:/\]/,relevance:0,contains:[ae]}]},Fe={scope:"title",begin:$,relevance:0},Ft={scope:"title",begin:K,relevance:0},ut={begin:"\\.\\s*"+K,relevance:0};var Nt=Object.freeze({__proto__:null,APOS_STRING_MODE:de,BACKSLASH_ESCAPE:ae,BINARY_NUMBER_MODE:Ee,BINARY_NUMBER_RE:re,COMMENT:he,C_BLOCK_COMMENT_MODE:N,C_LINE_COMMENT_MODE:Oe,C_NUMBER_MODE:B,C_NUMBER_RE:W,END_SAME_AS_BEGIN:function(q){return Object.assign(q,{"on:begin":(xe,je)=>{je.data._beginMatch=xe[1]},"on:end":(xe,je)=>{je.data._beginMatch!==xe[1]&&je.ignoreMatch()}})},HASH_COMMENT_MODE:X,IDENT_RE:$,MATCH_NOTHING_RE:P,METHOD_GUARD:ut,NUMBER_MODE:me,NUMBER_RE:Z,PHRASAL_WORDS_MODE:ne,QUOTE_STRING_MODE:J,REGEXP_MODE:Qe,RE_STARTERS_RE:ie,SHEBANG:ye,TITLE_MODE:Fe,UNDERSCORE_IDENT_RE:K,UNDERSCORE_TITLE_MODE:Ft});function Mn(q,xe){q.input[q.index-1]==="."&&xe.ignoreMatch()}function Vr(q,xe){q.className!==void 0&&(q.scope=q.className,delete q.className)}function gt(q,xe){xe&&q.beginKeywords&&(q.begin="\\b("+q.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",q.__beforeBegin=Mn,q.keywords=q.keywords||q.beginKeywords,delete q.beginKeywords,q.relevance===void 0&&(q.relevance=0))}function St(q,xe){Array.isArray(q.illegal)&&(q.illegal=S(...q.illegal))}function Gt(q,xe){if(q.match){if(q.begin||q.end)throw new Error("begin & end are not supported with match");q.begin=q.match,delete q.match}}function tt(q,xe){q.relevance===void 0&&(q.relevance=1)}const kt=(q,xe)=>{if(!q.beforeMatch)return;if(q.starts)throw new Error("beforeMatch cannot be used with starts");const je=Object.assign({},q);Object.keys(q).forEach(yt=>{delete q[yt]}),q.keywords=je.keywords,q.begin=E(je.beforeMatch,g(je.begin)),q.starts={relevance:0,contains:[Object.assign(je,{endsParent:!0})]},q.relevance=0,delete je.beforeMatch},fn=["of","and","for","in","not","or","if","then","parent","list","value"],qt="keyword";function hn(q,xe,je=qt){const yt=Object.create(null);return typeof q=="string"?Pn(je,q.split(" ")):Array.isArray(q)?Pn(je,q):Object.keys(q).forEach(function(jn){Object.assign(yt,hn(q[jn],xe,jn))}),yt;function Pn(jn,Ke){xe&&(Ke=Ke.map(He=>He.toLowerCase())),Ke.forEach(function(He){const nt=He.split("|");yt[nt[0]]=[jn,fr(nt[0],nt[1])]})}}function fr(q,xe){return xe?Number(xe):ea(q)?0:1}function ea(q){return fn.includes(q.toLowerCase())}const fs={},ri=q=>{console.error(q)},ir=(q,...xe)=>{console.log(`WARN: ${q}`,...xe)},ge=(q,xe)=>{fs[`${q}/${xe}`]||(console.log(`Deprecated as of ${q}. ${xe}`),fs[`${q}/${xe}`]=!0)},we=new Error;function rt(q,xe,{key:je}){let yt=0;const Pn=q[je],jn={},Ke={};for(let He=1;He<=xe.length;He++)Ke[He+yt]=Pn[He],jn[He+yt]=!0,yt+=A(xe[He-1]);q[je]=Ke,q[je]._emit=jn,q[je]._multi=!0}function st(q){if(Array.isArray(q.begin)){if(q.skip||q.excludeBegin||q.returnBegin)throw ri("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),we;if(typeof q.beginScope!="object"||q.beginScope===null)throw ri("beginScope must be object"),we;rt(q,q.begin,{key:"beginScope"}),q.begin=I(q.begin,{joinWith:""})}}function Be(q){if(Array.isArray(q.end)){if(q.skip||q.excludeEnd||q.returnEnd)throw ri("skip, excludeEnd, returnEnd not compatible with endScope: {}"),we;if(typeof q.endScope!="object"||q.endScope===null)throw ri("endScope must be object"),we;rt(q,q.end,{key:"endScope"}),q.end=I(q.end,{joinWith:""})}}function Yt(q){q.scope&&typeof q.scope=="object"&&q.scope!==null&&(q.beginScope=q.scope,delete q.scope)}function On(q){Yt(q),typeof q.beginScope=="string"&&(q.beginScope={_wrap:q.beginScope}),typeof q.endScope=="string"&&(q.endScope={_wrap:q.endScope}),st(q),Be(q)}function hr(q){function xe(Ke,He){return new RegExp(p(Ke),"m"+(q.case_insensitive?"i":"")+(q.unicodeRegex?"u":"")+(He?"g":""))}class je{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(He,nt){nt.position=this.position++,this.matchIndexes[this.matchAt]=nt,this.regexes.push([nt,He]),this.matchAt+=A(He)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const He=this.regexes.map(nt=>nt[1]);this.matcherRe=xe(I(He,{joinWith:"|"}),!0),this.lastIndex=0}exec(He){this.matcherRe.lastIndex=this.lastIndex;const nt=this.matcherRe.exec(He);if(!nt)return null;const Rn=nt.findIndex((Hl,Bd)=>Bd>0&&Hl!==void 0),Bn=this.matchIndexes[Rn];return nt.splice(0,Rn),Object.assign(nt,Bn)}}class yt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(He){if(this.multiRegexes[He])return this.multiRegexes[He];const nt=new je;return this.rules.slice(He).forEach(([Rn,Bn])=>nt.addRule(Rn,Bn)),nt.compile(),this.multiRegexes[He]=nt,nt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(He,nt){this.rules.push([He,nt]),nt.type==="begin"&&this.count++}exec(He){const nt=this.getMatcher(this.regexIndex);nt.lastIndex=this.lastIndex;let Rn=nt.exec(He);if(this.resumingScanAtSamePosition()&&!(Rn&&Rn.index===this.lastIndex)){const Bn=this.getMatcher(0);Bn.lastIndex=this.lastIndex+1,Rn=Bn.exec(He)}return Rn&&(this.regexIndex+=Rn.position+1,this.regexIndex===this.count&&this.considerAll()),Rn}}function Pn(Ke){const He=new yt;return Ke.contains.forEach(nt=>He.addRule(nt.begin,{rule:nt,type:"begin"})),Ke.terminatorEnd&&He.addRule(Ke.terminatorEnd,{type:"end"}),Ke.illegal&&He.addRule(Ke.illegal,{type:"illegal"}),He}function jn(Ke,He){const nt=Ke;if(Ke.isCompiled)return nt;[Vr,Gt,On,kt].forEach(Bn=>Bn(Ke,He)),q.compilerExtensions.forEach(Bn=>Bn(Ke,He)),Ke.__beforeBegin=null,[gt,St,tt].forEach(Bn=>Bn(Ke,He)),Ke.isCompiled=!0;let Rn=null;return typeof Ke.keywords=="object"&&Ke.keywords.$pattern&&(Ke.keywords=Object.assign({},Ke.keywords),Rn=Ke.keywords.$pattern,delete Ke.keywords.$pattern),Rn=Rn||/\w+/,Ke.keywords&&(Ke.keywords=hn(Ke.keywords,q.case_insensitive)),nt.keywordPatternRe=xe(Rn,!0),He&&(Ke.begin||(Ke.begin=/\B|\b/),nt.beginRe=xe(nt.begin),!Ke.end&&!Ke.endsWithParent&&(Ke.end=/\B|\b/),Ke.end&&(nt.endRe=xe(nt.end)),nt.terminatorEnd=p(nt.end)||"",Ke.endsWithParent&&He.terminatorEnd&&(nt.terminatorEnd+=(Ke.end?"|":"")+He.terminatorEnd)),Ke.illegal&&(nt.illegalRe=xe(Ke.illegal)),Ke.contains||(Ke.contains=[]),Ke.contains=[].concat(...Ke.contains.map(function(Bn){return sr(Bn==="self"?Ke:Bn)})),Ke.contains.forEach(function(Bn){jn(Bn,nt)}),Ke.starts&&jn(Ke.starts,He),nt.matcher=Pn(nt),nt}if(q.compilerExtensions||(q.compilerExtensions=[]),q.contains&&q.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return q.classNameAliases=r(q.classNameAliases||{}),jn(q)}function Cr(q){return q?q.endsWithParent||Cr(q.starts):!1}function sr(q){return q.variants&&!q.cachedVariants&&(q.cachedVariants=q.variants.map(function(xe){return r(q,{variants:null},xe)})),q.cachedVariants?q.cachedVariants:Cr(q)?r(q,{starts:q.starts?r(q.starts):null}):Object.isFrozen(q)?r(q):q}var Tn="11.11.1";class tn extends Error{constructor(xe,je){super(xe),this.name="HTMLInjectionError",this.html=je}}const ar=n,ft=r,Wt=Symbol("nomatch"),ze=7,pn=function(q){const xe=Object.create(null),je=Object.create(null),yt=[];let Pn=!0;const jn="Could not find the language '{}', did you forget to load/include a language module?",Ke={disableAutodetect:!0,name:"Plain text",contains:[]};let He={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:h};function nt(Ie){return He.noHighlightRe.test(Ie)}function Rn(Ie){let at=Ie.className+" ";at+=Ie.parentNode?Ie.parentNode.className:"";const Ct=He.languageDetectRe.exec(at);if(Ct){const nn=pi(Ct[1]);return nn||(ir(jn.replace("{}",Ct[1])),ir("Falling back to no-highlight mode for this block.",Ie)),nn?Ct[1]:"no-highlight"}return at.split(/\s+/).find(nn=>nt(nn)||pi(nn))}function Bn(Ie,at,Ct){let nn="",qn="";typeof at=="object"?(nn=Ie,Ct=at.ignoreIllegals,qn=at.language):(ge("10.7.0","highlight(lang, code, ...args) has been deprecated."),ge("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),qn=Ie,nn=at),Ct===void 0&&(Ct=!0);const Vi={code:nn,language:qn};Ra("before:highlight",Vi);const Fs=Vi.result?Vi.result:Hl(Vi.language,Vi.code,Ct);return Fs.code=Vi.code,Ra("after:highlight",Fs),Fs}function Hl(Ie,at,Ct,nn){const qn=Object.create(null);function Vi($e,Je){return $e.keywords[Je]}function Fs(){if(!wt.keywords){pr.addText(rn);return}let $e=0;wt.keywordPatternRe.lastIndex=0;let Je=wt.keywordPatternRe.exec(rn),xt="";for(;Je;){xt+=rn.substring($e,Je.index);const Qt=Gi.case_insensitive?Je[0].toLowerCase():Je[0],mr=Vi(wt,Qt);if(mr){const[ps,Wl]=mr;if(pr.addText(xt),xt="",qn[Qt]=(qn[Qt]||0)+1,qn[Qt]<=ze&&(nc+=Wl),ps.startsWith("_"))xt+=Je[0];else{const Us=Gi.classNameAliases[ps]||ps;hs(Je[0],Us)}}else xt+=Je[0];$e=wt.keywordPatternRe.lastIndex,Je=wt.keywordPatternRe.exec(rn)}xt+=rn.substring($e),pr.addText(xt)}function Gr(){if(rn==="")return;let $e=null;if(typeof wt.subLanguage=="string"){if(!xe[wt.subLanguage]){pr.addText(rn);return}$e=Hl(wt.subLanguage,rn,!0,Hd[wt.subLanguage]),Hd[wt.subLanguage]=$e._top}else $e=ec(rn,wt.subLanguage.length?wt.subLanguage:null);wt.relevance>0&&(nc+=$e.relevance),pr.__addSublanguage($e._emitter,$e.language)}function ii(){wt.subLanguage!=null?Gr():Fs(),rn=""}function hs($e,Je){$e!==""&&(pr.startScope(Je),pr.addText($e),pr.endScope())}function Vl($e,Je){let xt=1;const Qt=Je.length-1;for(;xt<=Qt;){if(!$e._emit[xt]){xt++;continue}const mr=Gi.classNameAliases[$e[xt]]||$e[xt],ps=Je[xt];mr?hs(ps,mr):(rn=ps,Fs(),rn=""),xt++}}function Fd($e,Je){return $e.scope&&typeof $e.scope=="string"&&pr.openNode(Gi.classNameAliases[$e.scope]||$e.scope),$e.beginScope&&($e.beginScope._wrap?(hs(rn,Gi.classNameAliases[$e.beginScope._wrap]||$e.beginScope._wrap),rn=""):$e.beginScope._multi&&(Vl($e.beginScope,Je),rn="")),wt=Object.create($e,{parent:{value:wt}}),wt}function Gl($e,Je,xt){let Qt=R($e.endRe,xt);if(Qt){if($e["on:end"]){const mr=new e($e);$e["on:end"](Je,mr),mr.isMatchIgnored&&(Qt=!1)}if(Qt){for(;$e.endsParent&&$e.parent;)$e=$e.parent;return $e}}if($e.endsWithParent)return Gl($e.parent,Je,xt)}function Nb($e){return wt.matcher.regexIndex===0?(rn+=$e[0],1):(Yl=!0,0)}function Ni($e){const Je=$e[0],xt=$e.rule,Qt=new e(xt),mr=[xt.__beforeBegin,xt["on:begin"]];for(const ps of mr)if(ps&&(ps($e,Qt),Qt.isMatchIgnored))return Nb(Je);return xt.skip?rn+=Je:(xt.excludeBegin&&(rn+=Je),ii(),!xt.returnBegin&&!xt.excludeBegin&&(rn=Je)),Fd(xt,$e),xt.returnBegin?0:Je.length}function Ud($e){const Je=$e[0],xt=at.substring($e.index),Qt=Gl(wt,$e,xt);if(!Qt)return Wt;const mr=wt;wt.endScope&&wt.endScope._wrap?(ii(),hs(Je,wt.endScope._wrap)):wt.endScope&&wt.endScope._multi?(ii(),Vl(wt.endScope,$e)):mr.skip?rn+=Je:(mr.returnEnd||mr.excludeEnd||(rn+=Je),ii(),mr.excludeEnd&&(rn=Je));do wt.scope&&pr.closeNode(),!wt.skip&&!wt.subLanguage&&(nc+=wt.relevance),wt=wt.parent;while(wt!==Qt.parent);return Qt.starts&&Fd(Qt.starts,$e),mr.returnEnd?0:Je.length}function Yh(){const $e=[];for(let Je=wt;Je!==Gi;Je=Je.parent)Je.scope&&$e.unshift(Je.scope);$e.forEach(Je=>pr.openNode(Je))}let No={};function Da($e,Je){const xt=Je&&Je[0];if(rn+=$e,xt==null)return ii(),0;if(No.type==="begin"&&Je.type==="end"&&No.index===Je.index&&xt===""){if(rn+=at.slice(Je.index,Je.index+1),!Pn){const Qt=new Error(`0 width match regex (${Ie})`);throw Qt.languageName=Ie,Qt.badRule=No.rule,Qt}return 1}if(No=Je,Je.type==="begin")return Ni(Je);if(Je.type==="illegal"&&!Ct){const Qt=new Error('Illegal lexeme "'+xt+'" for mode "'+(wt.scope||"<unnamed>")+'"');throw Qt.mode=wt,Qt}else if(Je.type==="end"){const Qt=Ud(Je);if(Qt!==Wt)return Qt}if(Je.type==="illegal"&&xt==="")return rn+=`
`,1;if(Mo>1e5&&Mo>Je.index*3)throw new Error("potential infinite loop, way more iterations than matches");return rn+=xt,xt.length}const Gi=pi(Ie);if(!Gi)throw ri(jn.replace("{}",Ie)),new Error('Unknown language: "'+Ie+'"');const Wh=hr(Gi);let ta="",wt=nn||Wh;const Hd={},pr=new He.__emitter(He);Yh();let rn="",nc=0,Ia=0,Mo=0,Yl=!1;try{if(Gi.__emitTokens)Gi.__emitTokens(at,pr);else{for(wt.matcher.considerAll();;){Mo++,Yl?Yl=!1:wt.matcher.considerAll(),wt.matcher.lastIndex=Ia;const $e=wt.matcher.exec(at);if(!$e)break;const Je=at.substring(Ia,$e.index),xt=Da(Je,$e);Ia=$e.index+xt}Da(at.substring(Ia))}return pr.finalize(),ta=pr.toHTML(),{language:Ie,value:ta,relevance:nc,illegal:!1,_emitter:pr,_top:wt}}catch($e){if($e.message&&$e.message.includes("Illegal"))return{language:Ie,value:ar(at),illegal:!0,relevance:0,_illegalBy:{message:$e.message,index:Ia,context:at.slice(Ia-100,Ia+100),mode:$e.mode,resultSoFar:ta},_emitter:pr};if(Pn)return{language:Ie,value:ar(at),illegal:!1,relevance:0,errorRaised:$e,_emitter:pr,_top:wt};throw $e}}function Bd(Ie){const at={value:ar(Ie),illegal:!1,relevance:0,_top:Ke,_emitter:new He.__emitter(He)};return at._emitter.addText(Ie),at}function ec(Ie,at){at=at||He.languages||Object.keys(xe);const Ct=Bd(Ie),nn=at.filter(pi).filter(zd).map(ii=>Hl(ii,Ie,!1));nn.unshift(Ct);const qn=nn.sort((ii,hs)=>{if(ii.relevance!==hs.relevance)return hs.relevance-ii.relevance;if(ii.language&&hs.language){if(pi(ii.language).supersetOf===hs.language)return 1;if(pi(hs.language).supersetOf===ii.language)return-1}return 0}),[Vi,Fs]=qn,Gr=Vi;return Gr.secondBest=Fs,Gr}function jl(Ie,at,Ct){const nn=at&&je[at]||Ct;Ie.classList.add("hljs"),Ie.classList.add(`language-${nn}`)}function $l(Ie){let at=null;const Ct=Rn(Ie);if(nt(Ct))return;if(Ra("before:highlightElement",{el:Ie,language:Ct}),Ie.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Ie);return}if(Ie.children.length>0&&(He.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Ie)),He.throwUnescapedHTML))throw new tn("One of your code blocks includes unescaped HTML.",Ie.innerHTML);at=Ie;const nn=at.textContent,qn=Ct?Bn(nn,{language:Ct,ignoreIllegals:!0}):ec(nn);Ie.innerHTML=qn.value,Ie.dataset.highlighted="yes",jl(Ie,Ct,qn.language),Ie.result={language:qn.language,re:qn.relevance,relevance:qn.relevance},qn.secondBest&&(Ie.secondBest={language:qn.secondBest.language,relevance:qn.secondBest.relevance}),Ra("after:highlightElement",{el:Ie,result:qn,text:nn})}function Co(Ie){He=ft(He,Ie)}const Ao=()=>{$n(),ge("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")};function ql(){$n(),ge("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")}let Ma=!1;function $n(){function Ie(){$n()}if(document.readyState==="loading"){Ma||window.addEventListener("DOMContentLoaded",Ie,!1),Ma=!0;return}document.querySelectorAll(He.cssSelector).forEach($l)}function $h(Ie,at){let Ct=null;try{Ct=at(q)}catch(nn){if(ri("Language definition for '{}' could not be registered.".replace("{}",Ie)),Pn)ri(nn);else throw nn;Ct=Ke}Ct.name||(Ct.name=Ie),xe[Ie]=Ct,Ct.rawDefinition=at.bind(null,q),Ct.aliases&&Vh(Ct.aliases,{languageName:Ie})}function qh(Ie){delete xe[Ie];for(const at of Object.keys(je))je[at]===Ie&&delete je[at]}function Oa(){return Object.keys(xe)}function pi(Ie){return Ie=(Ie||"").toLowerCase(),xe[Ie]||xe[je[Ie]]}function Vh(Ie,{languageName:at}){typeof Ie=="string"&&(Ie=[Ie]),Ie.forEach(Ct=>{je[Ct.toLowerCase()]=at})}function zd(Ie){const at=pi(Ie);return at&&!at.disableAutodetect}function Gh(Ie){Ie["before:highlightBlock"]&&!Ie["before:highlightElement"]&&(Ie["before:highlightElement"]=at=>{Ie["before:highlightBlock"](Object.assign({block:at.el},at))}),Ie["after:highlightBlock"]&&!Ie["after:highlightElement"]&&(Ie["after:highlightElement"]=at=>{Ie["after:highlightBlock"](Object.assign({block:at.el},at))})}function Ab(Ie){Gh(Ie),yt.push(Ie)}function tc(Ie){const at=yt.indexOf(Ie);at!==-1&&yt.splice(at,1)}function Ra(Ie,at){const Ct=Ie;yt.forEach(function(nn){nn[Ct]&&nn[Ct](at)})}function zs(Ie){return ge("10.7.0","highlightBlock will be removed entirely in v12.0"),ge("10.7.0","Please use highlightElement now."),$l(Ie)}Object.assign(q,{highlight:Bn,highlightAuto:ec,highlightAll:$n,highlightElement:$l,highlightBlock:zs,configure:Co,initHighlighting:Ao,initHighlightingOnLoad:ql,registerLanguage:$h,unregisterLanguage:qh,listLanguages:Oa,getLanguage:pi,registerAliases:Vh,autoDetection:zd,inherit:ft,addPlugin:Ab,removePlugin:tc}),q.debugMode=function(){Pn=!1},q.safeMode=function(){Pn=!0},q.versionString=Tn,q.regex={concat:E,lookahead:g,either:S,optional:y,anyNumberOfTimes:b};for(const Ie in Nt)typeof Nt[Ie]=="object"&&t(Nt[Ie]);return Object.assign(q,Nt),q},Sn=pn({});return Sn.newInstance=()=>pn({}),y2=Sn,Sn.HighlightJS=Sn,Sn.default=Sn,y2}var JZ=ZZ();const eJ=mh(JZ),fk={},tJ="hljs-";function nJ(t){const e=eJ.newInstance();return t&&s(t),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:a,registered:l};function n(u,d,h){const p=h||fk,g=typeof p.prefix=="string"?p.prefix:tJ;if(!e.getLanguage(u))throw new Error("Unknown language: `"+u+"` is not registered");e.configure({__emitter:rJ,classPrefix:g});const b=e.highlight(d,{ignoreIllegals:!0,language:u});if(b.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:b.errorRaised});const y=b._emitter.root,E=y.data;return E.language=b.language,E.relevance=b.relevance,y}function r(u,d){const p=(d||fk).subset||i();let g=-1,b=0,y;for(;++g<p.length;){const E=p[g];if(!e.getLanguage(E))continue;const T=n(E,u,d);T.data&&T.data.relevance!==void 0&&T.data.relevance>b&&(b=T.data.relevance,y=T)}return y||{type:"root",children:[],data:{language:void 0,relevance:b}}}function i(){return e.listLanguages()}function s(u,d){if(typeof u=="string")e.registerLanguage(u,d);else{let h;for(h in u)Object.hasOwn(u,h)&&e.registerLanguage(h,u[h])}}function a(u,d){if(typeof u=="string")e.registerAliases(typeof d=="string"?d:[...d],{languageName:u});else{let h;for(h in u)if(Object.hasOwn(u,h)){const p=u[h];e.registerAliases(typeof p=="string"?p:[...p],{languageName:h})}}}function l(u){return!!e.getLanguage(u)}}class rJ{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){const n=this,r=e.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const iJ={};function sJ(t){const e=t||iJ,n=e.aliases,r=e.detect||!1,i=e.languages||QZ,s=e.plainText,a=e.prefix,l=e.subset;let u="hljs";const d=nJ(i);if(n&&d.registerAlias(n),a){const h=a.indexOf("-");u=h===-1?a:a.slice(0,h)}return function(h,p){kh(h,"element",function(g,b,y){if(g.tagName!=="code"||!y||y.type!=="element"||y.tagName!=="pre")return;const E=aJ(g);if(E===!1||!E&&!r||E&&s&&s.includes(E))return;Array.isArray(g.properties.className)||(g.properties.className=[]),g.properties.className.includes(u)||g.properties.className.unshift(u);const T=qN(g,{whitespace:"pre"});let S;try{S=E?d.highlight(E,T,{prefix:a}):d.highlightAuto(T,{prefix:a,subset:l})}catch(A){const R=A;if(E&&/Unknown language/.test(R.message)){p.message("Cannot highlight as `"+E+"`, it’s not registered",{ancestors:[y,g],cause:R,place:g.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw R}!E&&S.data&&S.data.language&&g.properties.className.push("language-"+S.data.language),S.children.length>0&&(g.children=S.children)})}}function aJ(t){const e=t.properties.className;let n=-1;if(!Array.isArray(e))return;let r;for(;++n<e.length;){const i=String(e[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}function oJ(t,e){return dM(t,{})||{type:"root",children:[]}}function dM(t,e){const n=lJ(t,e);return n&&e.afterTransform&&e.afterTransform(t,n),n}function lJ(t,e){switch(t.nodeType){case 1:return fJ(t,e);case 3:return cJ(t);case 8:return dJ(t);case 9:return hk(t,e);case 10:return uJ();case 11:return hk(t,e);default:return}}function hk(t,e){return{type:"root",children:fM(t,e)}}function uJ(){return{type:"doctype"}}function cJ(t){return{type:"text",value:t.nodeValue||""}}function dJ(t){return{type:"comment",value:t.nodeValue||""}}function fJ(t,e){const n=t.namespaceURI,r=n===ma.svg?J9:Z9,i=n===ma.html?t.tagName.toLowerCase():t.tagName,s=n===ma.html&&i==="template"?t.content:t,a=t.getAttributeNames(),l={};let u=-1;for(;++u<a.length;)l[a[u]]=t.getAttribute(a[u])||"";return r(i,l,fM(s,e))}function fM(t,e){const n=t.childNodes,r=[];let i=-1;for(;++i<n.length;){const s=dM(n[i],e);s!==void 0&&r.push(s)}return r}new DOMParser;function hJ(t,e){const n=pJ(t);return oJ(n)}function pJ(t){const e=document.createElement("template");return e.innerHTML=t,e.content}class rs{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new rs(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class Ns{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new Ns(n,rs.range(this,e))}}class De{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,i,s,a=n&&n.loc;if(a&&a.start<=a.end){var l=a.lexer.input;i=a.start,s=a.end,i===l.length?r+=" at end of input: ":r+=" at position "+(i+1)+": ";var u=l.slice(i,s).replace(/[^]/g,"$&̲"),d;i>15?d="…"+l.slice(i-15,i):d=l.slice(0,i);var h;s+15<l.length?h=l.slice(s,s+15)+"…":h=l.slice(s),r+=d+u+h}var p=new Error(r);return p.name="ParseError",p.__proto__=De.prototype,p.position=i,i!=null&&s!=null&&(p.length=s-i),p.rawMessage=e,p}}De.prototype.__proto__=Error.prototype;var mJ=function(e,n){return e.indexOf(n)!==-1},gJ=function(e,n){return e===void 0?n:e},bJ=/([A-Z])/g,vJ=function(e){return e.replace(bJ,"-$1").toLowerCase()},yJ={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},EJ=/[&><"']/g;function _J(t){return String(t).replace(EJ,e=>yJ[e])}var hM=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},xJ=function(e){var n=hM(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},TJ=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},SJ=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},ct={contains:mJ,deflt:gJ,escape:_J,hyphenate:vJ,getBaseElem:hM,isCharacterBox:xJ,protocolFromUrl:SJ},ng={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function wJ(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class d_{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var n in ng)if(ng.hasOwnProperty(n)){var r=ng[n];this[n]=e[n]!==void 0?r.processor?r.processor(e[n]):e[n]:wJ(r)}}reportNonstrict(e,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(e,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new De("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var i=this.strict;if(typeof i=="function")try{i=i(e,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var n=ct.protocolFromUrl(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class el{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return pa[kJ[this.id]]}sub(){return pa[CJ[this.id]]}fracNum(){return pa[AJ[this.id]]}fracDen(){return pa[NJ[this.id]]}cramp(){return pa[MJ[this.id]]}text(){return pa[OJ[this.id]]}isTight(){return this.size>=2}}var f_=0,wg=1,td=2,fo=3,Xf=4,As=5,ud=6,Ti=7,pa=[new el(f_,0,!1),new el(wg,0,!0),new el(td,1,!1),new el(fo,1,!0),new el(Xf,2,!1),new el(As,2,!0),new el(ud,3,!1),new el(Ti,3,!0)],kJ=[Xf,As,Xf,As,ud,Ti,ud,Ti],CJ=[As,As,As,As,Ti,Ti,Ti,Ti],AJ=[td,fo,Xf,As,ud,Ti,ud,Ti],NJ=[fo,fo,As,As,Ti,Ti,Ti,Ti],MJ=[wg,wg,fo,fo,As,As,Ti,Ti],OJ=[f_,wg,td,fo,td,fo,td,fo],pt={DISPLAY:pa[f_],TEXT:pa[td],SCRIPT:pa[Xf],SCRIPTSCRIPT:pa[ud]},c4=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function RJ(t){for(var e=0;e<c4.length;e++)for(var n=c4[e],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(t>=i[0]&&t<=i[1])return n.name}return null}var rg=[];c4.forEach(t=>t.blocks.forEach(e=>rg.push(...e)));function pM(t){for(var e=0;e<rg.length;e+=2)if(t>=rg[e]&&t<=rg[e+1])return!0;return!1}var Ic=80,DJ=function(e,n){return"M95,"+(622+e+n)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+e/2.075+" -"+e+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+e)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},IJ=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+e/2.084+" -"+e+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+e)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},LJ=function(e,n){return"M983 "+(10+e+n)+`
l`+e/3.13+" -"+e+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},PJ=function(e,n){return"M424,"+(2398+e+n)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+e)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+`
h400000v`+(40+e)+"h-400000z"},BJ=function(e,n){return"M473,"+(2713+e+n)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},zJ=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},FJ=function(e,n,r){var i=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+`
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},UJ=function(e,n,r){n=1e3*n;var i="";switch(e){case"sqrtMain":i=DJ(n,Ic);break;case"sqrtSize1":i=IJ(n,Ic);break;case"sqrtSize2":i=LJ(n,Ic);break;case"sqrtSize3":i=PJ(n,Ic);break;case"sqrtSize4":i=BJ(n,Ic);break;case"sqrtTall":i=FJ(n,Ic,r)}return i},HJ=function(e,n){switch(e){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},pk={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
 l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
 435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
 -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
 -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},jJ=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
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
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-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 Oh{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 ct.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){for(var e="",n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e}toText(){var e=n=>n.toText();return this.children.map(e).join("")}}var ga={"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]}},gm={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]},mk={Å:"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 $J(t,e){ga[t]=e}function h_(t,e,n){if(!ga[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),i=ga[e][r];if(!i&&t[0]in mk&&(r=mk[t[0]].charCodeAt(0),i=ga[e][r]),!i&&n==="text"&&pM(r)&&(i=ga[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var E2={};function qJ(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!E2[e]){var n=E2[e]={cssEmPerMu:gm.quad[e]/18};for(var r in gm)gm.hasOwnProperty(r)&&(n[r]=gm[r][e])}return E2[e]}var VJ=[[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]],gk=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],bk=function(e,n){return n.size<2?e:VJ[e-1][n.size-1]};let mM=class yu{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||yu.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=gk[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var n={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 r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return new yu(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:bk(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:gk[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=bk(yu.BASESIZE,e);return this.size===n&&this.textSize===yu.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==yu.BASESIZE?["sizing","reset-size"+this.size,"size"+yu.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=qJ(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};mM.BASESIZE=6;var d4={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},GJ={ex:!0,em:!0,mu:!0},gM=function(e){return typeof e!="string"&&(e=e.unit),e in d4||e in GJ||e==="ex"},Kn=function(e,n){var r;if(e.unit in d4)r=d4[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,e.unit==="ex")r=i.fontMetrics().xHeight;else if(e.unit==="em")r=i.fontMetrics().quad;else throw new De("Invalid unit: '"+e.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},Ue=function(e){return+e.toFixed(4)+"em"},Ol=function(e){return e.filter(n=>n).join(" ")},bM=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},vM=function(e){var n=document.createElement(e);n.className=Ol(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&n.setAttribute(i,this.attributes[i]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n},YJ=/[\s"'>/=\x00-\x1f]/,yM=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+ct.escape(Ol(this.classes))+'"');var r="";for(var i in this.style)this.style.hasOwnProperty(i)&&(r+=ct.hyphenate(i)+":"+this.style[i]+";");r&&(n+=' style="'+ct.escape(r)+'"');for(var s in this.attributes)if(this.attributes.hasOwnProperty(s)){if(YJ.test(s))throw new De("Invalid attribute name '"+s+"'");n+=" "+s+'="'+ct.escape(this.attributes[s])+'"'}n+=">";for(var a=0;a<this.children.length;a++)n+=this.children[a].toMarkup();return n+="</"+e+">",n};class Rh{constructor(e,n,r,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,bM.call(this,e,r,i),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return ct.contains(this.classes,e)}toNode(){return vM.call(this,"span")}toMarkup(){return yM.call(this,"span")}}class p_{constructor(e,n,r,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,bM.call(this,n,i),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return ct.contains(this.classes,e)}toNode(){return vM.call(this,"a")}toMarkup(){return yM.call(this,"a")}}class WJ{constructor(e,n,r){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=n,this.src=e,this.classes=["mord"],this.style=r}hasClass(e){return ct.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);return e}toMarkup(){var e='<img src="'+ct.escape(this.src)+'"'+(' alt="'+ct.escape(this.alt)+'"'),n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=ct.hyphenate(r)+":"+this.style[r]+";");return n&&(e+=' style="'+ct.escape(n)+'"'),e+="'/>",e}}var KJ={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Ls{constructor(e,n,r,i,s,a,l,u){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=n||0,this.depth=r||0,this.italic=i||0,this.skew=s||0,this.width=a||0,this.classes=l||[],this.style=u||{},this.maxFontSize=0;var d=RJ(this.text.charCodeAt(0));d&&this.classes.push(d+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=KJ[this.text])}hasClass(e){return ct.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),n=null;this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Ue(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Ol(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="<span";this.classes.length&&(e=!0,n+=' class="',n+=ct.escape(Ol(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(r+=ct.hyphenate(i)+":"+this.style[i]+";");r&&(e=!0,n+=' style="'+ct.escape(r)+'"');var s=ct.escape(this.text);return e?(n+=">",n+=s,n+="</span>",n):s}}class vo{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="'+ct.escape(this.attributes[n])+'"');e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</svg>",e}}class Rl{constructor(e,n){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=n}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",pk[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+ct.escape(this.alternate)+'"/>':'<path d="'+ct.escape(pk[this.pathName])+'"/>'}}class f4{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e="<line";for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="'+ct.escape(this.attributes[n])+'"');return e+="/>",e}}function vk(t){if(t instanceof Ls)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function XJ(t){if(t instanceof Rh)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var QJ={bin:1,close:1,inner:1,open:1,punct:1,rel:1},ZJ={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Nn={math:{},text:{}};function w(t,e,n,r,i,s){Nn[t][i]={font:e,group:n,replace:r},s&&r&&(Nn[t][r]=Nn[t][i])}var k="math",ke="text",O="main",j="ams",Hn="accent-token",Xe="bin",Ai="close",Od="inner",ht="mathord",Sr="op-token",cs="open",nb="punct",V="rel",So="spacing",ee="textord";w(k,O,V,"≡","\\equiv",!0);w(k,O,V,"≺","\\prec",!0);w(k,O,V,"≻","\\succ",!0);w(k,O,V,"∼","\\sim",!0);w(k,O,V,"⊥","\\perp");w(k,O,V,"⪯","\\preceq",!0);w(k,O,V,"⪰","\\succeq",!0);w(k,O,V,"≃","\\simeq",!0);w(k,O,V,"∣","\\mid",!0);w(k,O,V,"≪","\\ll",!0);w(k,O,V,"≫","\\gg",!0);w(k,O,V,"≍","\\asymp",!0);w(k,O,V,"∥","\\parallel");w(k,O,V,"⋈","\\bowtie",!0);w(k,O,V,"⌣","\\smile",!0);w(k,O,V,"⊑","\\sqsubseteq",!0);w(k,O,V,"⊒","\\sqsupseteq",!0);w(k,O,V,"≐","\\doteq",!0);w(k,O,V,"⌢","\\frown",!0);w(k,O,V,"∋","\\ni",!0);w(k,O,V,"∝","\\propto",!0);w(k,O,V,"⊢","\\vdash",!0);w(k,O,V,"⊣","\\dashv",!0);w(k,O,V,"∋","\\owns");w(k,O,nb,".","\\ldotp");w(k,O,nb,"⋅","\\cdotp");w(k,O,ee,"#","\\#");w(ke,O,ee,"#","\\#");w(k,O,ee,"&","\\&");w(ke,O,ee,"&","\\&");w(k,O,ee,"ℵ","\\aleph",!0);w(k,O,ee,"∀","\\forall",!0);w(k,O,ee,"ℏ","\\hbar",!0);w(k,O,ee,"∃","\\exists",!0);w(k,O,ee,"∇","\\nabla",!0);w(k,O,ee,"♭","\\flat",!0);w(k,O,ee,"ℓ","\\ell",!0);w(k,O,ee,"♮","\\natural",!0);w(k,O,ee,"♣","\\clubsuit",!0);w(k,O,ee,"℘","\\wp",!0);w(k,O,ee,"♯","\\sharp",!0);w(k,O,ee,"♢","\\diamondsuit",!0);w(k,O,ee,"ℜ","\\Re",!0);w(k,O,ee,"♡","\\heartsuit",!0);w(k,O,ee,"ℑ","\\Im",!0);w(k,O,ee,"♠","\\spadesuit",!0);w(k,O,ee,"§","\\S",!0);w(ke,O,ee,"§","\\S");w(k,O,ee,"¶","\\P",!0);w(ke,O,ee,"¶","\\P");w(k,O,ee,"†","\\dag");w(ke,O,ee,"†","\\dag");w(ke,O,ee,"†","\\textdagger");w(k,O,ee,"‡","\\ddag");w(ke,O,ee,"‡","\\ddag");w(ke,O,ee,"‡","\\textdaggerdbl");w(k,O,Ai,"⎱","\\rmoustache",!0);w(k,O,cs,"⎰","\\lmoustache",!0);w(k,O,Ai,"⟯","\\rgroup",!0);w(k,O,cs,"⟮","\\lgroup",!0);w(k,O,Xe,"∓","\\mp",!0);w(k,O,Xe,"⊖","\\ominus",!0);w(k,O,Xe,"⊎","\\uplus",!0);w(k,O,Xe,"⊓","\\sqcap",!0);w(k,O,Xe,"∗","\\ast");w(k,O,Xe,"⊔","\\sqcup",!0);w(k,O,Xe,"◯","\\bigcirc",!0);w(k,O,Xe,"∙","\\bullet",!0);w(k,O,Xe,"‡","\\ddagger");w(k,O,Xe,"≀","\\wr",!0);w(k,O,Xe,"⨿","\\amalg");w(k,O,Xe,"&","\\And");w(k,O,V,"⟵","\\longleftarrow",!0);w(k,O,V,"⇐","\\Leftarrow",!0);w(k,O,V,"⟸","\\Longleftarrow",!0);w(k,O,V,"⟶","\\longrightarrow",!0);w(k,O,V,"⇒","\\Rightarrow",!0);w(k,O,V,"⟹","\\Longrightarrow",!0);w(k,O,V,"↔","\\leftrightarrow",!0);w(k,O,V,"⟷","\\longleftrightarrow",!0);w(k,O,V,"⇔","\\Leftrightarrow",!0);w(k,O,V,"⟺","\\Longleftrightarrow",!0);w(k,O,V,"↦","\\mapsto",!0);w(k,O,V,"⟼","\\longmapsto",!0);w(k,O,V,"↗","\\nearrow",!0);w(k,O,V,"↩","\\hookleftarrow",!0);w(k,O,V,"↪","\\hookrightarrow",!0);w(k,O,V,"↘","\\searrow",!0);w(k,O,V,"↼","\\leftharpoonup",!0);w(k,O,V,"⇀","\\rightharpoonup",!0);w(k,O,V,"↙","\\swarrow",!0);w(k,O,V,"↽","\\leftharpoondown",!0);w(k,O,V,"⇁","\\rightharpoondown",!0);w(k,O,V,"↖","\\nwarrow",!0);w(k,O,V,"⇌","\\rightleftharpoons",!0);w(k,j,V,"≮","\\nless",!0);w(k,j,V,"","\\@nleqslant");w(k,j,V,"","\\@nleqq");w(k,j,V,"⪇","\\lneq",!0);w(k,j,V,"≨","\\lneqq",!0);w(k,j,V,"","\\@lvertneqq");w(k,j,V,"⋦","\\lnsim",!0);w(k,j,V,"⪉","\\lnapprox",!0);w(k,j,V,"⊀","\\nprec",!0);w(k,j,V,"⋠","\\npreceq",!0);w(k,j,V,"⋨","\\precnsim",!0);w(k,j,V,"⪹","\\precnapprox",!0);w(k,j,V,"≁","\\nsim",!0);w(k,j,V,"","\\@nshortmid");w(k,j,V,"∤","\\nmid",!0);w(k,j,V,"⊬","\\nvdash",!0);w(k,j,V,"⊭","\\nvDash",!0);w(k,j,V,"⋪","\\ntriangleleft");w(k,j,V,"⋬","\\ntrianglelefteq",!0);w(k,j,V,"⊊","\\subsetneq",!0);w(k,j,V,"","\\@varsubsetneq");w(k,j,V,"⫋","\\subsetneqq",!0);w(k,j,V,"","\\@varsubsetneqq");w(k,j,V,"≯","\\ngtr",!0);w(k,j,V,"","\\@ngeqslant");w(k,j,V,"","\\@ngeqq");w(k,j,V,"⪈","\\gneq",!0);w(k,j,V,"≩","\\gneqq",!0);w(k,j,V,"","\\@gvertneqq");w(k,j,V,"⋧","\\gnsim",!0);w(k,j,V,"⪊","\\gnapprox",!0);w(k,j,V,"⊁","\\nsucc",!0);w(k,j,V,"⋡","\\nsucceq",!0);w(k,j,V,"⋩","\\succnsim",!0);w(k,j,V,"⪺","\\succnapprox",!0);w(k,j,V,"≆","\\ncong",!0);w(k,j,V,"","\\@nshortparallel");w(k,j,V,"∦","\\nparallel",!0);w(k,j,V,"⊯","\\nVDash",!0);w(k,j,V,"⋫","\\ntriangleright");w(k,j,V,"⋭","\\ntrianglerighteq",!0);w(k,j,V,"","\\@nsupseteqq");w(k,j,V,"⊋","\\supsetneq",!0);w(k,j,V,"","\\@varsupsetneq");w(k,j,V,"⫌","\\supsetneqq",!0);w(k,j,V,"","\\@varsupsetneqq");w(k,j,V,"⊮","\\nVdash",!0);w(k,j,V,"⪵","\\precneqq",!0);w(k,j,V,"⪶","\\succneqq",!0);w(k,j,V,"","\\@nsubseteqq");w(k,j,Xe,"⊴","\\unlhd");w(k,j,Xe,"⊵","\\unrhd");w(k,j,V,"↚","\\nleftarrow",!0);w(k,j,V,"↛","\\nrightarrow",!0);w(k,j,V,"⇍","\\nLeftarrow",!0);w(k,j,V,"⇏","\\nRightarrow",!0);w(k,j,V,"↮","\\nleftrightarrow",!0);w(k,j,V,"⇎","\\nLeftrightarrow",!0);w(k,j,V,"△","\\vartriangle");w(k,j,ee,"ℏ","\\hslash");w(k,j,ee,"▽","\\triangledown");w(k,j,ee,"◊","\\lozenge");w(k,j,ee,"Ⓢ","\\circledS");w(k,j,ee,"®","\\circledR");w(ke,j,ee,"®","\\circledR");w(k,j,ee,"∡","\\measuredangle",!0);w(k,j,ee,"∄","\\nexists");w(k,j,ee,"℧","\\mho");w(k,j,ee,"Ⅎ","\\Finv",!0);w(k,j,ee,"⅁","\\Game",!0);w(k,j,ee,"‵","\\backprime");w(k,j,ee,"▲","\\blacktriangle");w(k,j,ee,"▼","\\blacktriangledown");w(k,j,ee,"■","\\blacksquare");w(k,j,ee,"⧫","\\blacklozenge");w(k,j,ee,"★","\\bigstar");w(k,j,ee,"∢","\\sphericalangle",!0);w(k,j,ee,"∁","\\complement",!0);w(k,j,ee,"ð","\\eth",!0);w(ke,O,ee,"ð","ð");w(k,j,ee,"╱","\\diagup");w(k,j,ee,"╲","\\diagdown");w(k,j,ee,"□","\\square");w(k,j,ee,"□","\\Box");w(k,j,ee,"◊","\\Diamond");w(k,j,ee,"¥","\\yen",!0);w(ke,j,ee,"¥","\\yen",!0);w(k,j,ee,"✓","\\checkmark",!0);w(ke,j,ee,"✓","\\checkmark");w(k,j,ee,"ℶ","\\beth",!0);w(k,j,ee,"ℸ","\\daleth",!0);w(k,j,ee,"ℷ","\\gimel",!0);w(k,j,ee,"ϝ","\\digamma",!0);w(k,j,ee,"ϰ","\\varkappa");w(k,j,cs,"┌","\\@ulcorner",!0);w(k,j,Ai,"┐","\\@urcorner",!0);w(k,j,cs,"└","\\@llcorner",!0);w(k,j,Ai,"┘","\\@lrcorner",!0);w(k,j,V,"≦","\\leqq",!0);w(k,j,V,"⩽","\\leqslant",!0);w(k,j,V,"⪕","\\eqslantless",!0);w(k,j,V,"≲","\\lesssim",!0);w(k,j,V,"⪅","\\lessapprox",!0);w(k,j,V,"≊","\\approxeq",!0);w(k,j,Xe,"⋖","\\lessdot");w(k,j,V,"⋘","\\lll",!0);w(k,j,V,"≶","\\lessgtr",!0);w(k,j,V,"⋚","\\lesseqgtr",!0);w(k,j,V,"⪋","\\lesseqqgtr",!0);w(k,j,V,"≑","\\doteqdot");w(k,j,V,"≓","\\risingdotseq",!0);w(k,j,V,"≒","\\fallingdotseq",!0);w(k,j,V,"∽","\\backsim",!0);w(k,j,V,"⋍","\\backsimeq",!0);w(k,j,V,"⫅","\\subseteqq",!0);w(k,j,V,"⋐","\\Subset",!0);w(k,j,V,"⊏","\\sqsubset",!0);w(k,j,V,"≼","\\preccurlyeq",!0);w(k,j,V,"⋞","\\curlyeqprec",!0);w(k,j,V,"≾","\\precsim",!0);w(k,j,V,"⪷","\\precapprox",!0);w(k,j,V,"⊲","\\vartriangleleft");w(k,j,V,"⊴","\\trianglelefteq");w(k,j,V,"⊨","\\vDash",!0);w(k,j,V,"⊪","\\Vvdash",!0);w(k,j,V,"⌣","\\smallsmile");w(k,j,V,"⌢","\\smallfrown");w(k,j,V,"≏","\\bumpeq",!0);w(k,j,V,"≎","\\Bumpeq",!0);w(k,j,V,"≧","\\geqq",!0);w(k,j,V,"⩾","\\geqslant",!0);w(k,j,V,"⪖","\\eqslantgtr",!0);w(k,j,V,"≳","\\gtrsim",!0);w(k,j,V,"⪆","\\gtrapprox",!0);w(k,j,Xe,"⋗","\\gtrdot");w(k,j,V,"⋙","\\ggg",!0);w(k,j,V,"≷","\\gtrless",!0);w(k,j,V,"⋛","\\gtreqless",!0);w(k,j,V,"⪌","\\gtreqqless",!0);w(k,j,V,"≖","\\eqcirc",!0);w(k,j,V,"≗","\\circeq",!0);w(k,j,V,"≜","\\triangleq",!0);w(k,j,V,"∼","\\thicksim");w(k,j,V,"≈","\\thickapprox");w(k,j,V,"⫆","\\supseteqq",!0);w(k,j,V,"⋑","\\Supset",!0);w(k,j,V,"⊐","\\sqsupset",!0);w(k,j,V,"≽","\\succcurlyeq",!0);w(k,j,V,"⋟","\\curlyeqsucc",!0);w(k,j,V,"≿","\\succsim",!0);w(k,j,V,"⪸","\\succapprox",!0);w(k,j,V,"⊳","\\vartriangleright");w(k,j,V,"⊵","\\trianglerighteq");w(k,j,V,"⊩","\\Vdash",!0);w(k,j,V,"∣","\\shortmid");w(k,j,V,"∥","\\shortparallel");w(k,j,V,"≬","\\between",!0);w(k,j,V,"⋔","\\pitchfork",!0);w(k,j,V,"∝","\\varpropto");w(k,j,V,"◀","\\blacktriangleleft");w(k,j,V,"∴","\\therefore",!0);w(k,j,V,"∍","\\backepsilon");w(k,j,V,"▶","\\blacktriangleright");w(k,j,V,"∵","\\because",!0);w(k,j,V,"⋘","\\llless");w(k,j,V,"⋙","\\gggtr");w(k,j,Xe,"⊲","\\lhd");w(k,j,Xe,"⊳","\\rhd");w(k,j,V,"≂","\\eqsim",!0);w(k,O,V,"⋈","\\Join");w(k,j,V,"≑","\\Doteq",!0);w(k,j,Xe,"∔","\\dotplus",!0);w(k,j,Xe,"∖","\\smallsetminus");w(k,j,Xe,"⋒","\\Cap",!0);w(k,j,Xe,"⋓","\\Cup",!0);w(k,j,Xe,"⩞","\\doublebarwedge",!0);w(k,j,Xe,"⊟","\\boxminus",!0);w(k,j,Xe,"⊞","\\boxplus",!0);w(k,j,Xe,"⋇","\\divideontimes",!0);w(k,j,Xe,"⋉","\\ltimes",!0);w(k,j,Xe,"⋊","\\rtimes",!0);w(k,j,Xe,"⋋","\\leftthreetimes",!0);w(k,j,Xe,"⋌","\\rightthreetimes",!0);w(k,j,Xe,"⋏","\\curlywedge",!0);w(k,j,Xe,"⋎","\\curlyvee",!0);w(k,j,Xe,"⊝","\\circleddash",!0);w(k,j,Xe,"⊛","\\circledast",!0);w(k,j,Xe,"⋅","\\centerdot");w(k,j,Xe,"⊺","\\intercal",!0);w(k,j,Xe,"⋒","\\doublecap");w(k,j,Xe,"⋓","\\doublecup");w(k,j,Xe,"⊠","\\boxtimes",!0);w(k,j,V,"⇢","\\dashrightarrow",!0);w(k,j,V,"⇠","\\dashleftarrow",!0);w(k,j,V,"⇇","\\leftleftarrows",!0);w(k,j,V,"⇆","\\leftrightarrows",!0);w(k,j,V,"⇚","\\Lleftarrow",!0);w(k,j,V,"↞","\\twoheadleftarrow",!0);w(k,j,V,"↢","\\leftarrowtail",!0);w(k,j,V,"↫","\\looparrowleft",!0);w(k,j,V,"⇋","\\leftrightharpoons",!0);w(k,j,V,"↶","\\curvearrowleft",!0);w(k,j,V,"↺","\\circlearrowleft",!0);w(k,j,V,"↰","\\Lsh",!0);w(k,j,V,"⇈","\\upuparrows",!0);w(k,j,V,"↿","\\upharpoonleft",!0);w(k,j,V,"⇃","\\downharpoonleft",!0);w(k,O,V,"⊶","\\origof",!0);w(k,O,V,"⊷","\\imageof",!0);w(k,j,V,"⊸","\\multimap",!0);w(k,j,V,"↭","\\leftrightsquigarrow",!0);w(k,j,V,"⇉","\\rightrightarrows",!0);w(k,j,V,"⇄","\\rightleftarrows",!0);w(k,j,V,"↠","\\twoheadrightarrow",!0);w(k,j,V,"↣","\\rightarrowtail",!0);w(k,j,V,"↬","\\looparrowright",!0);w(k,j,V,"↷","\\curvearrowright",!0);w(k,j,V,"↻","\\circlearrowright",!0);w(k,j,V,"↱","\\Rsh",!0);w(k,j,V,"⇊","\\downdownarrows",!0);w(k,j,V,"↾","\\upharpoonright",!0);w(k,j,V,"⇂","\\downharpoonright",!0);w(k,j,V,"⇝","\\rightsquigarrow",!0);w(k,j,V,"⇝","\\leadsto");w(k,j,V,"⇛","\\Rrightarrow",!0);w(k,j,V,"↾","\\restriction");w(k,O,ee,"‘","`");w(k,O,ee,"$","\\$");w(ke,O,ee,"$","\\$");w(ke,O,ee,"$","\\textdollar");w(k,O,ee,"%","\\%");w(ke,O,ee,"%","\\%");w(k,O,ee,"_","\\_");w(ke,O,ee,"_","\\_");w(ke,O,ee,"_","\\textunderscore");w(k,O,ee,"∠","\\angle",!0);w(k,O,ee,"∞","\\infty",!0);w(k,O,ee,"′","\\prime");w(k,O,ee,"△","\\triangle");w(k,O,ee,"Γ","\\Gamma",!0);w(k,O,ee,"Δ","\\Delta",!0);w(k,O,ee,"Θ","\\Theta",!0);w(k,O,ee,"Λ","\\Lambda",!0);w(k,O,ee,"Ξ","\\Xi",!0);w(k,O,ee,"Π","\\Pi",!0);w(k,O,ee,"Σ","\\Sigma",!0);w(k,O,ee,"Υ","\\Upsilon",!0);w(k,O,ee,"Φ","\\Phi",!0);w(k,O,ee,"Ψ","\\Psi",!0);w(k,O,ee,"Ω","\\Omega",!0);w(k,O,ee,"A","Α");w(k,O,ee,"B","Β");w(k,O,ee,"E","Ε");w(k,O,ee,"Z","Ζ");w(k,O,ee,"H","Η");w(k,O,ee,"I","Ι");w(k,O,ee,"K","Κ");w(k,O,ee,"M","Μ");w(k,O,ee,"N","Ν");w(k,O,ee,"O","Ο");w(k,O,ee,"P","Ρ");w(k,O,ee,"T","Τ");w(k,O,ee,"X","Χ");w(k,O,ee,"¬","\\neg",!0);w(k,O,ee,"¬","\\lnot");w(k,O,ee,"⊤","\\top");w(k,O,ee,"⊥","\\bot");w(k,O,ee,"∅","\\emptyset");w(k,j,ee,"∅","\\varnothing");w(k,O,ht,"α","\\alpha",!0);w(k,O,ht,"β","\\beta",!0);w(k,O,ht,"γ","\\gamma",!0);w(k,O,ht,"δ","\\delta",!0);w(k,O,ht,"ϵ","\\epsilon",!0);w(k,O,ht,"ζ","\\zeta",!0);w(k,O,ht,"η","\\eta",!0);w(k,O,ht,"θ","\\theta",!0);w(k,O,ht,"ι","\\iota",!0);w(k,O,ht,"κ","\\kappa",!0);w(k,O,ht,"λ","\\lambda",!0);w(k,O,ht,"μ","\\mu",!0);w(k,O,ht,"ν","\\nu",!0);w(k,O,ht,"ξ","\\xi",!0);w(k,O,ht,"ο","\\omicron",!0);w(k,O,ht,"π","\\pi",!0);w(k,O,ht,"ρ","\\rho",!0);w(k,O,ht,"σ","\\sigma",!0);w(k,O,ht,"τ","\\tau",!0);w(k,O,ht,"υ","\\upsilon",!0);w(k,O,ht,"ϕ","\\phi",!0);w(k,O,ht,"χ","\\chi",!0);w(k,O,ht,"ψ","\\psi",!0);w(k,O,ht,"ω","\\omega",!0);w(k,O,ht,"ε","\\varepsilon",!0);w(k,O,ht,"ϑ","\\vartheta",!0);w(k,O,ht,"ϖ","\\varpi",!0);w(k,O,ht,"ϱ","\\varrho",!0);w(k,O,ht,"ς","\\varsigma",!0);w(k,O,ht,"φ","\\varphi",!0);w(k,O,Xe,"∗","*",!0);w(k,O,Xe,"+","+");w(k,O,Xe,"−","-",!0);w(k,O,Xe,"⋅","\\cdot",!0);w(k,O,Xe,"∘","\\circ",!0);w(k,O,Xe,"÷","\\div",!0);w(k,O,Xe,"±","\\pm",!0);w(k,O,Xe,"×","\\times",!0);w(k,O,Xe,"∩","\\cap",!0);w(k,O,Xe,"∪","\\cup",!0);w(k,O,Xe,"∖","\\setminus",!0);w(k,O,Xe,"∧","\\land");w(k,O,Xe,"∨","\\lor");w(k,O,Xe,"∧","\\wedge",!0);w(k,O,Xe,"∨","\\vee",!0);w(k,O,ee,"√","\\surd");w(k,O,cs,"⟨","\\langle",!0);w(k,O,cs,"∣","\\lvert");w(k,O,cs,"∥","\\lVert");w(k,O,Ai,"?","?");w(k,O,Ai,"!","!");w(k,O,Ai,"⟩","\\rangle",!0);w(k,O,Ai,"∣","\\rvert");w(k,O,Ai,"∥","\\rVert");w(k,O,V,"=","=");w(k,O,V,":",":");w(k,O,V,"≈","\\approx",!0);w(k,O,V,"≅","\\cong",!0);w(k,O,V,"≥","\\ge");w(k,O,V,"≥","\\geq",!0);w(k,O,V,"←","\\gets");w(k,O,V,">","\\gt",!0);w(k,O,V,"∈","\\in",!0);w(k,O,V,"","\\@not");w(k,O,V,"⊂","\\subset",!0);w(k,O,V,"⊃","\\supset",!0);w(k,O,V,"⊆","\\subseteq",!0);w(k,O,V,"⊇","\\supseteq",!0);w(k,j,V,"⊈","\\nsubseteq",!0);w(k,j,V,"⊉","\\nsupseteq",!0);w(k,O,V,"⊨","\\models");w(k,O,V,"←","\\leftarrow",!0);w(k,O,V,"≤","\\le");w(k,O,V,"≤","\\leq",!0);w(k,O,V,"<","\\lt",!0);w(k,O,V,"→","\\rightarrow",!0);w(k,O,V,"→","\\to");w(k,j,V,"≱","\\ngeq",!0);w(k,j,V,"≰","\\nleq",!0);w(k,O,So," ","\\ ");w(k,O,So," ","\\space");w(k,O,So," ","\\nobreakspace");w(ke,O,So," ","\\ ");w(ke,O,So," "," ");w(ke,O,So," ","\\space");w(ke,O,So," ","\\nobreakspace");w(k,O,So,null,"\\nobreak");w(k,O,So,null,"\\allowbreak");w(k,O,nb,",",",");w(k,O,nb,";",";");w(k,j,Xe,"⊼","\\barwedge",!0);w(k,j,Xe,"⊻","\\veebar",!0);w(k,O,Xe,"⊙","\\odot",!0);w(k,O,Xe,"⊕","\\oplus",!0);w(k,O,Xe,"⊗","\\otimes",!0);w(k,O,ee,"∂","\\partial",!0);w(k,O,Xe,"⊘","\\oslash",!0);w(k,j,Xe,"⊚","\\circledcirc",!0);w(k,j,Xe,"⊡","\\boxdot",!0);w(k,O,Xe,"△","\\bigtriangleup");w(k,O,Xe,"▽","\\bigtriangledown");w(k,O,Xe,"†","\\dagger");w(k,O,Xe,"⋄","\\diamond");w(k,O,Xe,"⋆","\\star");w(k,O,Xe,"◃","\\triangleleft");w(k,O,Xe,"▹","\\triangleright");w(k,O,cs,"{","\\{");w(ke,O,ee,"{","\\{");w(ke,O,ee,"{","\\textbraceleft");w(k,O,Ai,"}","\\}");w(ke,O,ee,"}","\\}");w(ke,O,ee,"}","\\textbraceright");w(k,O,cs,"{","\\lbrace");w(k,O,Ai,"}","\\rbrace");w(k,O,cs,"[","\\lbrack",!0);w(ke,O,ee,"[","\\lbrack",!0);w(k,O,Ai,"]","\\rbrack",!0);w(ke,O,ee,"]","\\rbrack",!0);w(k,O,cs,"(","\\lparen",!0);w(k,O,Ai,")","\\rparen",!0);w(ke,O,ee,"<","\\textless",!0);w(ke,O,ee,">","\\textgreater",!0);w(k,O,cs,"⌊","\\lfloor",!0);w(k,O,Ai,"⌋","\\rfloor",!0);w(k,O,cs,"⌈","\\lceil",!0);w(k,O,Ai,"⌉","\\rceil",!0);w(k,O,ee,"\\","\\backslash");w(k,O,ee,"∣","|");w(k,O,ee,"∣","\\vert");w(ke,O,ee,"|","\\textbar",!0);w(k,O,ee,"∥","\\|");w(k,O,ee,"∥","\\Vert");w(ke,O,ee,"∥","\\textbardbl");w(ke,O,ee,"~","\\textasciitilde");w(ke,O,ee,"\\","\\textbackslash");w(ke,O,ee,"^","\\textasciicircum");w(k,O,V,"↑","\\uparrow",!0);w(k,O,V,"⇑","\\Uparrow",!0);w(k,O,V,"↓","\\downarrow",!0);w(k,O,V,"⇓","\\Downarrow",!0);w(k,O,V,"↕","\\updownarrow",!0);w(k,O,V,"⇕","\\Updownarrow",!0);w(k,O,Sr,"∐","\\coprod");w(k,O,Sr,"⋁","\\bigvee");w(k,O,Sr,"⋀","\\bigwedge");w(k,O,Sr,"⨄","\\biguplus");w(k,O,Sr,"⋂","\\bigcap");w(k,O,Sr,"⋃","\\bigcup");w(k,O,Sr,"∫","\\int");w(k,O,Sr,"∫","\\intop");w(k,O,Sr,"∬","\\iint");w(k,O,Sr,"∭","\\iiint");w(k,O,Sr,"∏","\\prod");w(k,O,Sr,"∑","\\sum");w(k,O,Sr,"⨂","\\bigotimes");w(k,O,Sr,"⨁","\\bigoplus");w(k,O,Sr,"⨀","\\bigodot");w(k,O,Sr,"∮","\\oint");w(k,O,Sr,"∯","\\oiint");w(k,O,Sr,"∰","\\oiiint");w(k,O,Sr,"⨆","\\bigsqcup");w(k,O,Sr,"∫","\\smallint");w(ke,O,Od,"…","\\textellipsis");w(k,O,Od,"…","\\mathellipsis");w(ke,O,Od,"…","\\ldots",!0);w(k,O,Od,"…","\\ldots",!0);w(k,O,Od,"⋯","\\@cdots",!0);w(k,O,Od,"⋱","\\ddots",!0);w(k,O,ee,"⋮","\\varvdots");w(ke,O,ee,"⋮","\\varvdots");w(k,O,Hn,"ˊ","\\acute");w(k,O,Hn,"ˋ","\\grave");w(k,O,Hn,"¨","\\ddot");w(k,O,Hn,"~","\\tilde");w(k,O,Hn,"ˉ","\\bar");w(k,O,Hn,"˘","\\breve");w(k,O,Hn,"ˇ","\\check");w(k,O,Hn,"^","\\hat");w(k,O,Hn,"⃗","\\vec");w(k,O,Hn,"˙","\\dot");w(k,O,Hn,"˚","\\mathring");w(k,O,ht,"","\\@imath");w(k,O,ht,"","\\@jmath");w(k,O,ee,"ı","ı");w(k,O,ee,"ȷ","ȷ");w(ke,O,ee,"ı","\\i",!0);w(ke,O,ee,"ȷ","\\j",!0);w(ke,O,ee,"ß","\\ss",!0);w(ke,O,ee,"æ","\\ae",!0);w(ke,O,ee,"œ","\\oe",!0);w(ke,O,ee,"ø","\\o",!0);w(ke,O,ee,"Æ","\\AE",!0);w(ke,O,ee,"Œ","\\OE",!0);w(ke,O,ee,"Ø","\\O",!0);w(ke,O,Hn,"ˊ","\\'");w(ke,O,Hn,"ˋ","\\`");w(ke,O,Hn,"ˆ","\\^");w(ke,O,Hn,"˜","\\~");w(ke,O,Hn,"ˉ","\\=");w(ke,O,Hn,"˘","\\u");w(ke,O,Hn,"˙","\\.");w(ke,O,Hn,"¸","\\c");w(ke,O,Hn,"˚","\\r");w(ke,O,Hn,"ˇ","\\v");w(ke,O,Hn,"¨",'\\"');w(ke,O,Hn,"˝","\\H");w(ke,O,Hn,"◯","\\textcircled");var EM={"--":!0,"---":!0,"``":!0,"''":!0};w(ke,O,ee,"–","--",!0);w(ke,O,ee,"–","\\textendash");w(ke,O,ee,"—","---",!0);w(ke,O,ee,"—","\\textemdash");w(ke,O,ee,"‘","`",!0);w(ke,O,ee,"‘","\\textquoteleft");w(ke,O,ee,"’","'",!0);w(ke,O,ee,"’","\\textquoteright");w(ke,O,ee,"“","``",!0);w(ke,O,ee,"“","\\textquotedblleft");w(ke,O,ee,"”","''",!0);w(ke,O,ee,"”","\\textquotedblright");w(k,O,ee,"°","\\degree",!0);w(ke,O,ee,"°","\\degree");w(ke,O,ee,"°","\\textdegree",!0);w(k,O,ee,"£","\\pounds");w(k,O,ee,"£","\\mathsterling",!0);w(ke,O,ee,"£","\\pounds");w(ke,O,ee,"£","\\textsterling",!0);w(k,j,ee,"✠","\\maltese");w(ke,j,ee,"✠","\\maltese");var yk='0123456789/@."';for(var _2=0;_2<yk.length;_2++){var Ek=yk.charAt(_2);w(k,O,ee,Ek,Ek)}var _k='0123456789!@*()-=+";:?/.,';for(var x2=0;x2<_k.length;x2++){var xk=_k.charAt(x2);w(ke,O,ee,xk,xk)}var kg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var T2=0;T2<kg.length;T2++){var bm=kg.charAt(T2);w(k,O,ht,bm,bm),w(ke,O,ee,bm,bm)}w(k,j,ee,"C","ℂ");w(ke,j,ee,"C","ℂ");w(k,j,ee,"H","ℍ");w(ke,j,ee,"H","ℍ");w(k,j,ee,"N","ℕ");w(ke,j,ee,"N","ℕ");w(k,j,ee,"P","ℙ");w(ke,j,ee,"P","ℙ");w(k,j,ee,"Q","ℚ");w(ke,j,ee,"Q","ℚ");w(k,j,ee,"R","ℝ");w(ke,j,ee,"R","ℝ");w(k,j,ee,"Z","ℤ");w(ke,j,ee,"Z","ℤ");w(k,O,ht,"h","ℎ");w(ke,O,ht,"h","ℎ");var _t="";for(var gi=0;gi<kg.length;gi++){var Jn=kg.charAt(gi);_t=String.fromCharCode(55349,56320+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t),_t=String.fromCharCode(55349,56372+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t),_t=String.fromCharCode(55349,56424+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t),_t=String.fromCharCode(55349,56580+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t),_t=String.fromCharCode(55349,56684+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t),_t=String.fromCharCode(55349,56736+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t),_t=String.fromCharCode(55349,56788+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t),_t=String.fromCharCode(55349,56840+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t),_t=String.fromCharCode(55349,56944+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t),gi<26&&(_t=String.fromCharCode(55349,56632+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t),_t=String.fromCharCode(55349,56476+gi),w(k,O,ht,Jn,_t),w(ke,O,ee,Jn,_t))}_t="𝕜";w(k,O,ht,"k",_t);w(ke,O,ee,"k",_t);for(var hu=0;hu<10;hu++){var tl=hu.toString();_t=String.fromCharCode(55349,57294+hu),w(k,O,ht,tl,_t),w(ke,O,ee,tl,_t),_t=String.fromCharCode(55349,57314+hu),w(k,O,ht,tl,_t),w(ke,O,ee,tl,_t),_t=String.fromCharCode(55349,57324+hu),w(k,O,ht,tl,_t),w(ke,O,ee,tl,_t),_t=String.fromCharCode(55349,57334+hu),w(k,O,ht,tl,_t),w(ke,O,ee,tl,_t)}var h4="ÐÞþ";for(var S2=0;S2<h4.length;S2++){var vm=h4.charAt(S2);w(k,O,ht,vm,vm),w(ke,O,ee,vm,vm)}var ym=[["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"]],Tk=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],JJ=function(e,n){var r=e.charCodeAt(0),i=e.charCodeAt(1),s=(r-55296)*1024+(i-56320)+65536,a=n==="math"?0:1;if(119808<=s&&s<120484){var l=Math.floor((s-119808)/26);return[ym[l][2],ym[l][a]]}else if(120782<=s&&s<=120831){var u=Math.floor((s-120782)/10);return[Tk[u][2],Tk[u][a]]}else{if(s===120485||s===120486)return[ym[0][2],ym[0][a]];if(120486<s&&s<120782)return["",""];throw new De("Unsupported character: "+e)}},rb=function(e,n,r){return Nn[r][e]&&Nn[r][e].replace&&(e=Nn[r][e].replace),{value:e,metrics:h_(e,n,r)}},Vs=function(e,n,r,i,s){var a=rb(e,n,r),l=a.metrics;e=a.value;var u;if(l){var d=l.italic;(r==="text"||i&&i.font==="mathit")&&(d=0),u=new Ls(e,l.height,l.depth,d,l.skew,l.width,s)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+n+"' and mode '"+r+"'")),u=new Ls(e,0,0,0,0,0,s);if(i){u.maxFontSize=i.sizeMultiplier,i.style.isTight()&&u.classes.push("mtight");var h=i.getColor();h&&(u.style.color=h)}return u},eee=function(e,n,r,i){return i===void 0&&(i=[]),r.font==="boldsymbol"&&rb(e,"Main-Bold",n).metrics?Vs(e,"Main-Bold",n,r,i.concat(["mathbf"])):e==="\\"||Nn[n][e].font==="main"?Vs(e,"Main-Regular",n,r,i):Vs(e,"AMS-Regular",n,r,i.concat(["amsrm"]))},tee=function(e,n,r,i,s){return s!=="textord"&&rb(e,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},nee=function(e,n,r){var i=e.mode,s=e.text,a=["mord"],l=i==="math"||i==="text"&&n.font,u=l?n.font:n.fontFamily,d="",h="";if(s.charCodeAt(0)===55349&&([d,h]=JJ(s,i)),d.length>0)return Vs(s,d,i,n,a.concat(h));if(u){var p,g;if(u==="boldsymbol"){var b=tee(s,i,n,a,r);p=b.fontName,g=[b.fontClass]}else l?(p=TM[u].fontName,g=[u]):(p=Em(u,n.fontWeight,n.fontShape),g=[u,n.fontWeight,n.fontShape]);if(rb(s,p,i).metrics)return Vs(s,p,i,n,a.concat(g));if(EM.hasOwnProperty(s)&&p.slice(0,10)==="Typewriter"){for(var y=[],E=0;E<s.length;E++)y.push(Vs(s[E],p,i,n,a.concat(g)));return xM(y)}}if(r==="mathord")return Vs(s,"Math-Italic",i,n,a.concat(["mathnormal"]));if(r==="textord"){var T=Nn[i][s]&&Nn[i][s].font;if(T==="ams"){var S=Em("amsrm",n.fontWeight,n.fontShape);return Vs(s,S,i,n,a.concat("amsrm",n.fontWeight,n.fontShape))}else if(T==="main"||!T){var A=Em("textrm",n.fontWeight,n.fontShape);return Vs(s,A,i,n,a.concat(n.fontWeight,n.fontShape))}else{var R=Em(T,n.fontWeight,n.fontShape);return Vs(s,R,i,n,a.concat(R,n.fontWeight,n.fontShape))}}else throw new Error("unexpected type: "+r+" in makeOrd")},ree=(t,e)=>{if(Ol(t.classes)!==Ol(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},iee=t=>{for(var e=0;e<t.length-1;e++){var n=t[e],r=t[e+1];n instanceof Ls&&r instanceof Ls&&ree(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,t.splice(e+1,1),e--)}return t},m_=function(e){for(var n=0,r=0,i=0,s=0;s<e.children.length;s++){var a=e.children[s];a.height>n&&(n=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>i&&(i=a.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=i},Pi=function(e,n,r,i){var s=new Rh(e,n,r,i);return m_(s),s},_M=(t,e,n,r)=>new Rh(t,e,n,r),see=function(e,n,r){var i=Pi([e],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=Ue(i.height),i.maxFontSize=1,i},aee=function(e,n,r,i){var s=new p_(e,n,r,i);return m_(s),s},xM=function(e){var n=new Oh(e);return m_(n),n},oee=function(e,n){return e instanceof Oh?Pi([],[e],n):e},lee=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,s=i,a=1;a<n.length;a++){var l=-n[a].shift-s-n[a].elem.depth,u=l-(n[a-1].elem.height+n[a-1].elem.depth);s=s+l,r.push({type:"kern",size:u}),r.push(n[a])}return{children:r,depth:i}}var d;if(e.positionType==="top"){for(var h=e.positionData,p=0;p<e.children.length;p++){var g=e.children[p];h-=g.type==="kern"?g.size:g.elem.height+g.elem.depth}d=h}else if(e.positionType==="bottom")d=-e.positionData;else{var b=e.children[0];if(b.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")d=-b.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")d=-b.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:d}},uee=function(e,n){for(var{children:r,depth:i}=lee(e),s=0,a=0;a<r.length;a++){var l=r[a];if(l.type==="elem"){var u=l.elem;s=Math.max(s,u.maxFontSize,u.height)}}s+=2;var d=Pi(["pstrut"],[]);d.style.height=Ue(s);for(var h=[],p=i,g=i,b=i,y=0;y<r.length;y++){var E=r[y];if(E.type==="kern")b+=E.size;else{var T=E.elem,S=E.wrapperClasses||[],A=E.wrapperStyle||{},R=Pi(S,[d,T],void 0,A);R.style.top=Ue(-s-b-T.depth),E.marginLeft&&(R.style.marginLeft=E.marginLeft),E.marginRight&&(R.style.marginRight=E.marginRight),h.push(R),b+=T.height+T.depth}p=Math.min(p,b),g=Math.max(g,b)}var z=Pi(["vlist"],h);z.style.height=Ue(g);var I;if(p<0){var P=Pi([],[]),$=Pi(["vlist"],[P]);$.style.height=Ue(-p);var K=Pi(["vlist-s"],[new Ls("​")]);I=[Pi(["vlist-r"],[z,K]),Pi(["vlist-r"],[$])]}else I=[Pi(["vlist-r"],[z])];var Z=Pi(["vlist-t"],I);return I.length===2&&Z.classes.push("vlist-t2"),Z.height=g,Z.depth=-p,Z},cee=(t,e)=>{var n=Pi(["mspace"],[],e),r=Kn(t,e);return n.style.marginRight=Ue(r),n},Em=function(e,n,r){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 n==="textbf"&&r==="textit"?s="BoldItalic":n==="textbf"?s="Bold":n==="textit"?s="Italic":s="Regular",i+"-"+s},TM={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"}},SM={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},dee=function(e,n){var[r,i,s]=SM[e],a=new Rl(r),l=new vo([a],{width:Ue(i),height:Ue(s),style:"width:"+Ue(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),u=_M(["overlay"],[l],n);return u.height=s,u.style.height=Ue(s),u.style.width=Ue(i),u},ce={fontMap:TM,makeSymbol:Vs,mathsym:eee,makeSpan:Pi,makeSvgSpan:_M,makeLineSpan:see,makeAnchor:aee,makeFragment:xM,wrapFragment:oee,makeVList:uee,makeOrd:nee,makeGlue:cee,staticSvg:dee,svgData:SM,tryCombineChars:iee},Gn={number:3,unit:"mu"},pu={number:4,unit:"mu"},Ka={number:5,unit:"mu"},fee={mord:{mop:Gn,mbin:pu,mrel:Ka,minner:Gn},mop:{mord:Gn,mop:Gn,mrel:Ka,minner:Gn},mbin:{mord:pu,mop:pu,mopen:pu,minner:pu},mrel:{mord:Ka,mop:Ka,mopen:Ka,minner:Ka},mopen:{},mclose:{mop:Gn,mbin:pu,mrel:Ka,minner:Gn},mpunct:{mord:Gn,mop:Gn,mrel:Ka,mopen:Gn,mclose:Gn,mpunct:Gn,minner:Gn},minner:{mord:Gn,mop:Gn,mbin:pu,mrel:Ka,mopen:Gn,mpunct:Gn,minner:Gn}},hee={mord:{mop:Gn},mop:{mord:Gn,mop:Gn},mbin:{},mrel:{},mopen:{},mclose:{mop:Gn},mpunct:{},minner:{mop:Gn}},wM={},Cg={},Ag={};function Ge(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,l={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},u=0;u<n.length;++u)wM[n[u]]=l;e&&(s&&(Cg[e]=s),a&&(Ag[e]=a))}function Xu(t){var{type:e,htmlBuilder:n,mathmlBuilder:r}=t;Ge({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Ng=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},dr=function(e){return e.type==="ordgroup"?e.body:[e]},yo=ce.makeSpan,pee=["leftmost","mbin","mopen","mrel","mop","mpunct"],mee=["rightmost","mrel","mclose","mpunct"],gee={display:pt.DISPLAY,text:pt.TEXT,script:pt.SCRIPT,scriptscript:pt.SCRIPTSCRIPT},bee={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Rr=function(e,n,r,i){i===void 0&&(i=[null,null]);for(var s=[],a=0;a<e.length;a++){var l=Xt(e[a],n);if(l instanceof Oh){var u=l.children;s.push(...u)}else s.push(l)}if(ce.tryCombineChars(s),!r)return s;var d=n;if(e.length===1){var h=e[0];h.type==="sizing"?d=n.havingSize(h.size):h.type==="styling"&&(d=n.havingStyle(gee[h.style]))}var p=yo([i[0]||"leftmost"],[],n),g=yo([i[1]||"rightmost"],[],n),b=r==="root";return Sk(s,(y,E)=>{var T=E.classes[0],S=y.classes[0];T==="mbin"&&ct.contains(mee,S)?E.classes[0]="mord":S==="mbin"&&ct.contains(pee,T)&&(y.classes[0]="mord")},{node:p},g,b),Sk(s,(y,E)=>{var T=p4(E),S=p4(y),A=T&&S?y.hasClass("mtight")?hee[T][S]:fee[T][S]:null;if(A)return ce.makeGlue(A,d)},{node:p},g,b),s},Sk=function t(e,n,r,i,s){i&&e.push(i);for(var a=0;a<e.length;a++){var l=e[a],u=kM(l);if(u){t(u.children,n,r,null,s);continue}var d=!l.hasClass("mspace");if(d){var h=n(l,r.node);h&&(r.insertAfter?r.insertAfter(h):(e.unshift(h),a++))}d?r.node=l:s&&l.hasClass("newline")&&(r.node=yo(["leftmost"])),r.insertAfter=(p=>g=>{e.splice(p+1,0,g),a++})(a)}i&&e.pop()},kM=function(e){return e instanceof Oh||e instanceof p_||e instanceof Rh&&e.hasClass("enclosing")?e:null},vee=function t(e,n){var r=kM(e);if(r){var i=r.children;if(i.length){if(n==="right")return t(i[i.length-1],"right");if(n==="left")return t(i[0],"left")}}return e},p4=function(e,n){return e?(n&&(e=vee(e,n)),bee[e.classes[0]]||null):null},Qf=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return yo(n.concat(r))},Xt=function(e,n,r){if(!e)return yo();if(Cg[e.type]){var i=Cg[e.type](e,n);if(r&&n.size!==r.size){i=yo(n.sizingClasses(r),[i],n);var s=n.sizeMultiplier/r.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new De("Got group of unknown type: '"+e.type+"'")};function _m(t,e){var n=yo(["base"],t,e),r=yo(["strut"]);return r.style.height=Ue(n.height+n.depth),n.depth&&(r.style.verticalAlign=Ue(-n.depth)),n.children.unshift(r),n}function m4(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=Rr(t,e,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var s=[],a=[],l=0;l<r.length;l++)if(a.push(r[l]),r[l].hasClass("mbin")||r[l].hasClass("mrel")||r[l].hasClass("allowbreak")){for(var u=!1;l<r.length-1&&r[l+1].hasClass("mspace")&&!r[l+1].hasClass("newline");)l++,a.push(r[l]),r[l].hasClass("nobreak")&&(u=!0);u||(s.push(_m(a,e)),a=[])}else r[l].hasClass("newline")&&(a.pop(),a.length>0&&(s.push(_m(a,e)),a=[]),s.push(r[l]));a.length>0&&s.push(_m(a,e));var d;n?(d=_m(Rr(n,e,!0)),d.classes=["tag"],s.push(d)):i&&s.push(i);var h=yo(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),d){var p=d.children[0];p.style.height=Ue(h.height+h.depth),h.depth&&(p.style.verticalAlign=Ue(-h.depth))}return h}function CM(t){return new Oh(t)}class is{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);this.classes.length>0&&(e.className=Ol(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof ba&&this.children[r+1]instanceof ba){for(var i=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof ba;)i+=this.children[++r].toText();e.appendChild(new ba(i).toNode())}else e.appendChild(this.children[r].toNode());return e}toMarkup(){var e="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="',e+=ct.escape(this.attributes[n]),e+='"');this.classes.length>0&&(e+=' class ="'+ct.escape(Ol(this.classes))+'"'),e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}let ba=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return ct.escape(this.toText())}toText(){return this.text}};class yee{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",Ue(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Ue(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Me={MathNode:is,TextNode:ba,SpaceNode:yee,newDocumentFragment:CM},Ps=function(e,n,r){return Nn[n][e]&&Nn[n][e].replace&&e.charCodeAt(0)!==55349&&!(EM.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=Nn[n][e].replace),new Me.TextNode(e)},g_=function(e){return e.length===1?e[0]:new Me.MathNode("mrow",e)},b_=function(e,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var r=n.font;if(!r||r==="mathnormal")return null;var i=e.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathsfit")return"sans-serif-italic";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var s=e.text;if(ct.contains(["\\imath","\\jmath"],s))return null;Nn[i][s]&&Nn[i][s].replace&&(s=Nn[i][s].replace);var a=ce.fontMap[r].fontName;return h_(s,a,i)?ce.fontMap[r].variant:null};function w2(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof ba&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var n=t.children[0];return n instanceof ba&&n.text===","}else return!1}var qi=function(e,n,r){if(e.length===1){var i=xn(e[0],n);return r&&i instanceof is&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,l=0;l<e.length;l++){var u=xn(e[l],n);if(u instanceof is&&a instanceof is){if(u.type==="mtext"&&a.type==="mtext"&&u.getAttribute("mathvariant")===a.getAttribute("mathvariant")){a.children.push(...u.children);continue}else if(u.type==="mn"&&a.type==="mn"){a.children.push(...u.children);continue}else if(w2(u)&&a.type==="mn"){a.children.push(...u.children);continue}else if(u.type==="mn"&&w2(a))u.children=[...a.children,...u.children],s.pop();else if((u.type==="msup"||u.type==="msub")&&u.children.length>=1&&(a.type==="mn"||w2(a))){var d=u.children[0];d instanceof is&&d.type==="mn"&&(d.children=[...a.children,...d.children],s.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof ba&&h.text==="̸"&&(u.type==="mo"||u.type==="mi"||u.type==="mn")){var p=u.children[0];p instanceof ba&&p.text.length>0&&(p.text=p.text.slice(0,1)+"̸"+p.text.slice(1),s.pop())}}}s.push(u),a=u}return s},Dl=function(e,n,r){return g_(qi(e,n,r))},xn=function(e,n){if(!e)return new Me.MathNode("mrow");if(Ag[e.type]){var r=Ag[e.type](e,n);return r}else throw new De("Got group of unknown type: '"+e.type+"'")};function wk(t,e,n,r,i){var s=qi(t,n),a;s.length===1&&s[0]instanceof is&&ct.contains(["mrow","mtable"],s[0].type)?a=s[0]:a=new Me.MathNode("mrow",s);var l=new Me.MathNode("annotation",[new Me.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var u=new Me.MathNode("semantics",[a,l]),d=new Me.MathNode("math",[u]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var h=i?"katex":"katex-mathml";return ce.makeSpan([h],[d])}var AM=function(e){return new mM({style:e.displayMode?pt.DISPLAY:pt.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},NM=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=ce.makeSpan(r,[e])}return e},Eee=function(e,n,r){var i=AM(r),s;if(r.output==="mathml")return wk(e,n,i,r.displayMode,!0);if(r.output==="html"){var a=m4(e,i);s=ce.makeSpan(["katex"],[a])}else{var l=wk(e,n,i,r.displayMode,!1),u=m4(e,i);s=ce.makeSpan(["katex"],[l,u])}return NM(s,r)},_ee=function(e,n,r){var i=AM(r),s=m4(e,i),a=ce.makeSpan(["katex"],[s]);return NM(a,r)},xee={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":"="},Tee=function(e){var n=new Me.MathNode("mo",[new Me.TextNode(xee[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},See={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]},wee=function(e){return e.type==="ordgroup"?e.body.length:1},kee=function(e,n){function r(){var l=4e5,u=e.label.slice(1);if(ct.contains(["widehat","widecheck","widetilde","utilde"],u)){var d=e,h=wee(d.base),p,g,b;if(h>5)u==="widehat"||u==="widecheck"?(p=420,l=2364,b=.42,g=u+"4"):(p=312,l=2340,b=.34,g="tilde4");else{var y=[1,1,2,2,3,3][h];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][y],p=[0,239,300,360,420][y],b=[0,.24,.3,.3,.36,.42][y],g=u+y):(l=[0,600,1033,2339,2340][y],p=[0,260,286,306,312][y],b=[0,.26,.286,.3,.306,.34][y],g="tilde"+y)}var E=new Rl(g),T=new vo([E],{width:"100%",height:Ue(b),viewBox:"0 0 "+l+" "+p,preserveAspectRatio:"none"});return{span:ce.makeSvgSpan([],[T],n),minWidth:0,height:b}}else{var S=[],A=See[u],[R,z,I]=A,P=I/1e3,$=R.length,K,Z;if($===1){var W=A[3];K=["hide-tail"],Z=[W]}else if($===2)K=["halfarrow-left","halfarrow-right"],Z=["xMinYMin","xMaxYMin"];else if($===3)K=["brace-left","brace-center","brace-right"],Z=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
                    `+$+" children.");for(var re=0;re<$;re++){var ie=new Rl(R[re]),ye=new vo([ie],{width:"400em",height:Ue(P),viewBox:"0 0 "+l+" "+I,preserveAspectRatio:Z[re]+" slice"}),ae=ce.makeSvgSpan([K[re]],[ye],n);if($===1)return{span:ae,minWidth:z,height:P};ae.style.height=Ue(P),S.push(ae)}return{span:ce.makeSpan(["stretchy"],S,n),minWidth:z,height:P}}}var{span:i,minWidth:s,height:a}=r();return i.height=a,i.style.height=Ue(a),s>0&&(i.style.minWidth=Ue(s)),i},Cee=function(e,n,r,i,s){var a,l=e.height+e.depth+r+i;if(/fbox|color|angl/.test(n)){if(a=ce.makeSpan(["stretchy",n],[],s),n==="fbox"){var u=s.color&&s.getColor();u&&(a.style.borderColor=u)}}else{var d=[];/^[bx]cancel$/.test(n)&&d.push(new f4({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&d.push(new f4({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new vo(d,{width:"100%",height:Ue(l)});a=ce.makeSvgSpan([],[h],s)}return a.height=l,a.style.height=Ue(l),a},Eo={encloseSpan:Cee,mathMLnode:Tee,svgSpan:kee};function Rt(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function v_(t){var e=ib(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function ib(t){return t&&(t.type==="atom"||ZJ.hasOwnProperty(t.type))?t:null}var y_=(t,e)=>{var n,r,i;t&&t.type==="supsub"?(r=Rt(t.base,"accent"),n=r.base,t.base=n,i=XJ(Xt(t,e)),t.base=r):(r=Rt(t,"accent"),n=r.base);var s=Xt(n,e.havingCrampedStyle()),a=r.isShifty&&ct.isCharacterBox(n),l=0;if(a){var u=ct.getBaseElem(n),d=Xt(u,e.havingCrampedStyle());l=vk(d).skew}var h=r.label==="\\c",p=h?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),g;if(r.isStretchy)g=Eo.svgSpan(r,e),g=ce.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Ue(2*l)+")",marginLeft:Ue(2*l)}:void 0}]},e);else{var b,y;r.label==="\\vec"?(b=ce.staticSvg("vec",e),y=ce.svgData.vec[1]):(b=ce.makeOrd({mode:r.mode,text:r.label},e,"textord"),b=vk(b),b.italic=0,y=b.width,h&&(p+=b.depth)),g=ce.makeSpan(["accent-body"],[b]);var E=r.label==="\\textcircled";E&&(g.classes.push("accent-full"),p=s.height);var T=l;E||(T-=y/2),g.style.left=Ue(T),r.label==="\\textcircled"&&(g.style.top=".2em"),g=ce.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-p},{type:"elem",elem:g}]},e)}var S=ce.makeSpan(["mord","accent"],[g],e);return i?(i.children[0]=S,i.height=Math.max(S.height,i.height),i.classes[0]="mord",i):S},MM=(t,e)=>{var n=t.isStretchy?Eo.mathMLnode(t.label):new Me.MathNode("mo",[Ps(t.label,t.mode)]),r=new Me.MathNode("mover",[xn(t.base,e),n]);return r.setAttribute("accent","true"),r},Aee=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Ge({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:(t,e)=>{var n=Ng(e[0]),r=!Aee.test(t.funcName),i=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:y_,mathmlBuilder:MM});Ge({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:y_,mathmlBuilder:MM});Ge({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(t,e)=>{var n=Xt(t.base,e),r=Eo.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,s=ce.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},e);return ce.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var n=Eo.mathMLnode(t.label),r=new Me.MathNode("munder",[xn(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var xm=t=>{var e=new Me.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Ge({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(t,e,n){var{parser:r,funcName:i}=t;return{type:"xArrow",mode:r.mode,label:i,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),i=ce.wrapFragment(Xt(t.body,r,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var a;t.below&&(r=e.havingStyle(n.sub()),a=ce.wrapFragment(Xt(t.below,r,e),e),a.classes.push(s+"-arrow-pad"));var l=Eo.svgSpan(t,e),u=-e.fontMetrics().axisHeight+.5*l.height,d=-e.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(d-=i.depth);var h;if(a){var p=-e.fontMetrics().axisHeight+a.height+.5*l.height+.111;h=ce.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:u},{type:"elem",elem:a,shift:p}]},e)}else h=ce.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:u}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),ce.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var n=Eo.mathMLnode(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var i=xm(xn(t.body,e));if(t.below){var s=xm(xn(t.below,e));r=new Me.MathNode("munderover",[n,s,i])}else r=new Me.MathNode("mover",[n,i])}else if(t.below){var a=xm(xn(t.below,e));r=new Me.MathNode("munder",[n,a])}else r=xm(),r=new Me.MathNode("mover",[n,r]);return r}});var Nee=ce.makeSpan;function OM(t,e){var n=Rr(t.body,e,!0);return Nee([t.mclass],n,e)}function RM(t,e){var n,r=qi(t.body,e);return t.mclass==="minner"?n=new Me.MathNode("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new Me.MathNode("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new Me.MathNode("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):t.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ge({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:dr(i),isCharacterBox:ct.isCharacterBox(i)}},htmlBuilder:OM,mathmlBuilder:RM});var sb=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Ge({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:sb(e[0]),body:dr(e[1]),isCharacterBox:ct.isCharacterBox(e[1])}}});Ge({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:r}=t,i=e[1],s=e[0],a;r!=="\\stackrel"?a=sb(i):a="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:dr(i)},u={type:"supsub",mode:s.mode,base:l,sup:r==="\\underset"?null:s,sub:r==="\\underset"?s:null};return{type:"mclass",mode:n.mode,mclass:a,body:[u],isCharacterBox:ct.isCharacterBox(u)}},htmlBuilder:OM,mathmlBuilder:RM});Ge({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:sb(e[0]),body:dr(e[0])}},htmlBuilder(t,e){var n=Rr(t.body,e,!0),r=ce.makeSpan([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=qi(t.body,e),r=new Me.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Mee={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},kk=()=>({type:"styling",body:[],mode:"math",style:"display"}),Ck=t=>t.type==="textord"&&t.text==="@",Oee=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function Ree(t,e,n){var r=Mee[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[s],[]),l=n.callFunction("\\\\cdright",[e[1]],[]),u={type:"ordgroup",mode:"math",body:[i,a,l]};return n.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Dee(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if(n==="&"||n==="\\\\")t.consume();else if(n==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new De("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],i=[r],s=0;s<e.length;s++){for(var a=e[s],l=kk(),u=0;u<a.length;u++)if(!Ck(a[u]))l.body.push(a[u]);else{r.push(l),u+=1;var d=v_(a[u]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(d)>-1))if("<>AV".indexOf(d)>-1)for(var p=0;p<2;p++){for(var g=!0,b=u+1;b<a.length;b++){if(Oee(a[b],d)){g=!1,u=b;break}if(Ck(a[b]))throw new De("Missing a "+d+" character to complete a CD arrow.",a[b]);h[p].body.push(a[b])}if(g)throw new De("Missing a "+d+" character to complete a CD arrow.",a[u])}else throw new De('Expected one of "<>AV=|." after @',a[u]);var y=Ree(d,h,t),E={type:"styling",body:[y],mode:"math",style:"display"};r.push(E),l=kk()}s%2===0?r.push(l):r.shift(),r=[],i.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var T=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:T,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Ge({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=ce.wrapFragment(Xt(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=Ue(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new Me.MathNode("mrow",[xn(t.label,e)]);return n=new Me.MathNode("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Me.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ge({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:n}=t;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=ce.wrapFragment(Xt(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new Me.MathNode("mrow",[xn(t.fragment,e)])}});Ge({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=Rt(e[0],"ordgroup"),i=r.body,s="",a=0;a<i.length;a++){var l=Rt(i[a],"textord");s+=l.text}var u=parseInt(s),d;if(isNaN(u))throw new De("\\@char has non-numeric argument "+s);if(u<0||u>=1114111)throw new De("\\@char with invalid code point "+s);return u<=65535?d=String.fromCharCode(u):(u-=65536,d=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:n.mode,text:d}}});var DM=(t,e)=>{var n=Rr(t.body,e.withColor(t.color),!1);return ce.makeFragment(n)},IM=(t,e)=>{var n=qi(t.body,e.withColor(t.color)),r=new Me.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r};Ge({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=Rt(e[0],"color-token").color,i=e[1];return{type:"color",mode:n.mode,color:r,body:dr(i)}},htmlBuilder:DM,mathmlBuilder:IM});Ge({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,i=Rt(e[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var s=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:s}},htmlBuilder:DM,mathmlBuilder:IM});Ge({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,s=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:s,size:i&&Rt(i,"size").value}},htmlBuilder(t,e){var n=ce.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=Ue(Kn(t.size,e)))),n},mathmlBuilder(t,e){var n=new Me.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",Ue(Kn(t.size,e)))),n}});var g4={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},LM=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new De("Expected a control sequence",t);return e},Iee=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},PM=(t,e,n,r)=>{var i=t.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,i,r)};Ge({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(g4[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=g4[r.text]),Rt(e.parseFunction(),"internal");throw new De("Invalid token after macro prefix",r)}});Ge({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new De("Expected a control sequence",r);for(var s=0,a,l=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),l[s].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new De('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==s+1)throw new De('Argument number "'+r.text+'" out of order');s++,l.push([])}else{if(r.text==="EOF")throw new De("Expected a macro definition");l[s].push(r.text)}var{tokens:u}=e.gullet.consumeArg();return a&&u.unshift(a),(n==="\\edef"||n==="\\xdef")&&(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(i,{tokens:u,numArgs:s,delimiters:l},n===g4[n]),{type:"internal",mode:e.mode}}});Ge({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=LM(e.gullet.popToken());e.gullet.consumeSpaces();var i=Iee(e);return PM(e,r,i,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});Ge({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=LM(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return PM(e,r,s,n==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var rf=function(e,n,r){var i=Nn.math[e]&&Nn.math[e].replace,s=h_(i||e,n,r);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return s},E_=function(e,n,r,i){var s=r.havingBaseStyle(n),a=ce.makeSpan(i.concat(s.sizingClasses(r)),[e],r),l=s.sizeMultiplier/r.sizeMultiplier;return a.height*=l,a.depth*=l,a.maxFontSize=s.sizeMultiplier,a},BM=function(e,n,r){var i=n.havingBaseStyle(r),s=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Ue(s),e.height-=s,e.depth+=s},Lee=function(e,n,r,i,s,a){var l=ce.makeSymbol(e,"Main-Regular",s,i),u=E_(l,n,i,a);return r&&BM(u,i,n),u},Pee=function(e,n,r,i){return ce.makeSymbol(e,"Size"+n+"-Regular",r,i)},zM=function(e,n,r,i,s,a){var l=Pee(e,n,s,i),u=E_(ce.makeSpan(["delimsizing","size"+n],[l],i),pt.TEXT,i,a);return r&&BM(u,i,pt.TEXT),u},k2=function(e,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=ce.makeSpan(["delimsizinginner",i],[ce.makeSpan([],[ce.makeSymbol(e,n,r)])]);return{type:"elem",elem:s}},C2=function(e,n,r){var i=ga["Size4-Regular"][e.charCodeAt(0)]?ga["Size4-Regular"][e.charCodeAt(0)][4]:ga["Size1-Regular"][e.charCodeAt(0)][4],s=new Rl("inner",HJ(e,Math.round(1e3*n))),a=new vo([s],{width:Ue(i),height:Ue(n),style:"width:"+Ue(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=ce.makeSvgSpan([],[a],r);return l.height=n,l.style.height=Ue(n),l.style.width=Ue(i),{type:"elem",elem:l}},b4=.008,Tm={type:"kern",size:-1*b4},Bee=["|","\\lvert","\\rvert","\\vert"],zee=["\\|","\\lVert","\\rVert","\\Vert"],FM=function(e,n,r,i,s,a){var l,u,d,h,p="",g=0;l=d=h=e,u=null;var b="Size1-Regular";e==="\\uparrow"?d=h="⏐":e==="\\Uparrow"?d=h="‖":e==="\\downarrow"?l=d="⏐":e==="\\Downarrow"?l=d="‖":e==="\\updownarrow"?(l="\\uparrow",d="⏐",h="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",d="‖",h="\\Downarrow"):ct.contains(Bee,e)?(d="∣",p="vert",g=333):ct.contains(zee,e)?(d="∥",p="doublevert",g=556):e==="["||e==="\\lbrack"?(l="⎡",d="⎢",h="⎣",b="Size4-Regular",p="lbrack",g=667):e==="]"||e==="\\rbrack"?(l="⎤",d="⎥",h="⎦",b="Size4-Regular",p="rbrack",g=667):e==="\\lfloor"||e==="⌊"?(d=l="⎢",h="⎣",b="Size4-Regular",p="lfloor",g=667):e==="\\lceil"||e==="⌈"?(l="⎡",d=h="⎢",b="Size4-Regular",p="lceil",g=667):e==="\\rfloor"||e==="⌋"?(d=l="⎥",h="⎦",b="Size4-Regular",p="rfloor",g=667):e==="\\rceil"||e==="⌉"?(l="⎤",d=h="⎥",b="Size4-Regular",p="rceil",g=667):e==="("||e==="\\lparen"?(l="⎛",d="⎜",h="⎝",b="Size4-Regular",p="lparen",g=875):e===")"||e==="\\rparen"?(l="⎞",d="⎟",h="⎠",b="Size4-Regular",p="rparen",g=875):e==="\\{"||e==="\\lbrace"?(l="⎧",u="⎨",h="⎩",d="⎪",b="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="⎫",u="⎬",h="⎭",d="⎪",b="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(l="⎧",h="⎩",d="⎪",b="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(l="⎫",h="⎭",d="⎪",b="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(l="⎧",h="⎭",d="⎪",b="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(l="⎫",h="⎩",d="⎪",b="Size4-Regular");var y=rf(l,b,s),E=y.height+y.depth,T=rf(d,b,s),S=T.height+T.depth,A=rf(h,b,s),R=A.height+A.depth,z=0,I=1;if(u!==null){var P=rf(u,b,s);z=P.height+P.depth,I=2}var $=E+R+z,K=Math.max(0,Math.ceil((n-$)/(I*S))),Z=$+K*I*S,W=i.fontMetrics().axisHeight;r&&(W*=i.sizeMultiplier);var re=Z/2-W,ie=[];if(p.length>0){var ye=Z-E-R,ae=Math.round(Z*1e3),de=jJ(p,Math.round(ye*1e3)),J=new Rl(p,de),ne=(g/1e3).toFixed(3)+"em",he=(ae/1e3).toFixed(3)+"em",Oe=new vo([J],{width:ne,height:he,viewBox:"0 0 "+g+" "+ae}),N=ce.makeSvgSpan([],[Oe],i);N.height=ae/1e3,N.style.width=ne,N.style.height=he,ie.push({type:"elem",elem:N})}else{if(ie.push(k2(h,b,s)),ie.push(Tm),u===null){var X=Z-E-R+2*b4;ie.push(C2(d,X,i))}else{var me=(Z-E-R-z)/2+2*b4;ie.push(C2(d,me,i)),ie.push(Tm),ie.push(k2(u,b,s)),ie.push(Tm),ie.push(C2(d,me,i))}ie.push(Tm),ie.push(k2(l,b,s))}var B=i.havingBaseStyle(pt.TEXT),Ee=ce.makeVList({positionType:"bottom",positionData:re,children:ie},B);return E_(ce.makeSpan(["delimsizing","mult"],[Ee],B),pt.TEXT,i,a)},A2=80,N2=.08,M2=function(e,n,r,i,s){var a=UJ(e,i,r),l=new Rl(e,a),u=new vo([l],{width:"400em",height:Ue(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return ce.makeSvgSpan(["hide-tail"],[u],s)},Fee=function(e,n){var r=n.havingBaseSizing(),i=$M("\\surd",e*r.sizeMultiplier,jM,r),s=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,u=0,d=0,h=0,p;return i.type==="small"?(h=1e3+1e3*a+A2,e<1?s=1:e<1.4&&(s=.7),u=(1+a+N2)/s,d=(1+a)/s,l=M2("sqrtMain",u,h,a,n),l.style.minWidth="0.853em",p=.833/s):i.type==="large"?(h=(1e3+A2)*Cf[i.size],d=(Cf[i.size]+a)/s,u=(Cf[i.size]+a+N2)/s,l=M2("sqrtSize"+i.size,u,h,a,n),l.style.minWidth="1.02em",p=1/s):(u=e+a+N2,d=e+a,h=Math.floor(1e3*e+a)+A2,l=M2("sqrtTall",u,h,a,n),l.style.minWidth="0.742em",p=1.056),l.height=d,l.style.height=Ue(u),{span:l,advanceWidth:p,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*s}},UM=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Uee=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],HM=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Cf=[0,1.2,1.8,2.4,3],Hee=function(e,n,r,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),ct.contains(UM,e)||ct.contains(HM,e))return zM(e,n,!1,r,i,s);if(ct.contains(Uee,e))return FM(e,Cf[n],!1,r,i,s);throw new De("Illegal delimiter: '"+e+"'")},jee=[{type:"small",style:pt.SCRIPTSCRIPT},{type:"small",style:pt.SCRIPT},{type:"small",style:pt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],$ee=[{type:"small",style:pt.SCRIPTSCRIPT},{type:"small",style:pt.SCRIPT},{type:"small",style:pt.TEXT},{type:"stack"}],jM=[{type:"small",style:pt.SCRIPTSCRIPT},{type:"small",style:pt.SCRIPT},{type:"small",style:pt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],qee=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.")},$M=function(e,n,r,i){for(var s=Math.min(2,3-i.style.size),a=s;a<r.length&&r[a].type!=="stack";a++){var l=rf(e,qee(r[a]),"math"),u=l.height+l.depth;if(r[a].type==="small"){var d=i.havingBaseStyle(r[a].style);u*=d.sizeMultiplier}if(u>n)return r[a]}return r[r.length-1]},qM=function(e,n,r,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var l;ct.contains(HM,e)?l=jee:ct.contains(UM,e)?l=jM:l=$ee;var u=$M(e,n,l,i);return u.type==="small"?Lee(e,u.style,r,i,s,a):u.type==="large"?zM(e,u.size,r,i,s,a):FM(e,n,r,i,s,a)},Vee=function(e,n,r,i,s,a){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,u=901,d=5/i.fontMetrics().ptPerEm,h=Math.max(n-l,r+l),p=Math.max(h/500*u,2*h-d);return qM(e,p,!0,i,s,a)},ho={sqrtImage:Fee,sizedDelim:Hee,sizeToMaxHeight:Cf,customSizedDelim:qM,leftRightDelim:Vee},Ak={"\\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}},Gee=["(","\\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 ab(t,e){var n=ib(t);if(n&&ct.contains(Gee,n.text))return n;throw n?new De("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new De("Invalid delimiter type '"+t.type+"'",t)}Ge({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:(t,e)=>{var n=ab(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:Ak[t.funcName].size,mclass:Ak[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?ce.makeSpan([t.mclass]):ho.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Ps(t.delim,t.mode));var n=new Me.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Ue(ho.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function Nk(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ge({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new De("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:ab(e[0],t).text,color:n}}});Ge({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=ab(e[0],t),r=t.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var s=Rt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{Nk(t);for(var n=Rr(t.body,e,!0,["mopen","mclose"]),r=0,i=0,s=!1,a=0;a<n.length;a++)n[a].isMiddle?s=!0:(r=Math.max(n[a].height,r),i=Math.max(n[a].depth,i));r*=e.sizeMultiplier,i*=e.sizeMultiplier;var l;if(t.left==="."?l=Qf(e,["mopen"]):l=ho.leftRightDelim(t.left,r,i,e,t.mode,["mopen"]),n.unshift(l),s)for(var u=1;u<n.length;u++){var d=n[u],h=d.isMiddle;h&&(n[u]=ho.leftRightDelim(h.delim,r,i,h.options,t.mode,[]))}var p;if(t.right===".")p=Qf(e,["mclose"]);else{var g=t.rightColor?e.withColor(t.rightColor):e;p=ho.leftRightDelim(t.right,r,i,g,t.mode,["mclose"])}return n.push(p),ce.makeSpan(["minner"],n,e)},mathmlBuilder:(t,e)=>{Nk(t);var n=qi(t.body,e);if(t.left!=="."){var r=new Me.MathNode("mo",[Ps(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var i=new Me.MathNode("mo",[Ps(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),n.push(i)}return g_(n)}});Ge({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=ab(e[0],t);if(!t.parser.leftrightDepth)throw new De("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;if(t.delim===".")n=Qf(e,[]);else{n=ho.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?Ps("|","text"):Ps(t.delim,t.mode),r=new Me.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var __=(t,e)=>{var n=ce.wrapFragment(Xt(t.body,e),e),r=t.label.slice(1),i=e.sizeMultiplier,s,a=0,l=ct.isCharacterBox(t.body);if(r==="sout")s=ce.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,a=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var u=Kn({number:.6,unit:"pt"},e),d=Kn({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var p=n.height+n.depth+u+d;n.style.paddingLeft=Ue(p/2+u);var g=Math.floor(1e3*p*i),b=zJ(g),y=new vo([new Rl("phase",b)],{width:"400em",height:Ue(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});s=ce.makeSvgSpan(["hide-tail"],[y],e),s.style.height=Ue(p),a=n.depth+u+d}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var E=0,T=0,S=0;/box/.test(r)?(S=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),E=e.fontMetrics().fboxsep+(r==="colorbox"?0:S),T=E):r==="angl"?(S=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),E=4*S,T=Math.max(0,.25-n.depth)):(E=l?.2:0,T=E),s=Eo.encloseSpan(n,r,E,T,e),/fbox|boxed|fcolorbox/.test(r)?(s.style.borderStyle="solid",s.style.borderWidth=Ue(S)):r==="angl"&&S!==.049&&(s.style.borderTopWidth=Ue(S),s.style.borderRightWidth=Ue(S)),a=n.depth+T,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var A;if(t.backgroundColor)A=ce.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:a},{type:"elem",elem:n,shift:0}]},e);else{var R=/cancel|phase/.test(r)?["svg-align"]:[];A=ce.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:s,shift:a,wrapperClasses:R}]},e)}return/cancel/.test(r)&&(A.height=n.height,A.depth=n.depth),/cancel/.test(r)&&!l?ce.makeSpan(["mord","cancel-lap"],[A],e):ce.makeSpan(["mord"],[A],e)},x_=(t,e)=>{var n=0,r=new Me.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[xn(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};Ge({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:i}=t,s=Rt(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,body:a}},htmlBuilder:__,mathmlBuilder:x_});Ge({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:i}=t,s=Rt(e[0],"color-token").color,a=Rt(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,borderColor:s,body:l}},htmlBuilder:__,mathmlBuilder:x_});Ge({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}});Ge({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:__,mathmlBuilder:x_});Ge({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var VM={};function Ca(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,l={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},u=0;u<n.length;++u)VM[n[u]]=l;s&&(Cg[e]=s),a&&(Ag[e]=a)}var GM={};function L(t,e){GM[t]=e}function Mk(t){var e=[];t.consumeSpaces();var n=t.fetch().text;for(n==="\\relax"&&(t.consume(),t.consumeSpaces(),n=t.fetch().text);n==="\\hline"||n==="\\hdashline";)t.consume(),e.push(n==="\\hdashline"),t.consumeSpaces(),n=t.fetch().text;return e}var ob=t=>{var e=t.parser.settings;if(!e.displayMode)throw new De("{"+t.envName+"} can be used only in display mode.")};function T_(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function Bl(t,e,n){var{hskipBeforeAndAfter:r,addJot:i,cols:s,arraystretch:a,colSeparationType:l,autoTag:u,singleRow:d,emptySingleRow:h,maxNumCols:p,leqno:g}=e;if(t.gullet.beginGroup(),d||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var b=t.gullet.expandMacroAsText("\\arraystretch");if(b==null)a=1;else if(a=parseFloat(b),!a||a<0)throw new De("Invalid \\arraystretch: "+b)}t.gullet.beginGroup();var y=[],E=[y],T=[],S=[],A=u!=null?[]:void 0;function R(){u&&t.gullet.macros.set("\\@eqnsw","1",!0)}function z(){A&&(t.gullet.macros.get("\\df@tag")?(A.push(t.subparse([new Ns("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):A.push(!!u&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(R(),S.push(Mk(t));;){var I=t.parseExpression(!1,d?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),I={type:"ordgroup",mode:t.mode,body:I},n&&(I={type:"styling",mode:t.mode,style:n,body:[I]}),y.push(I);var P=t.fetch().text;if(P==="&"){if(p&&y.length===p){if(d||l)throw new De("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(P==="\\end"){z(),y.length===1&&I.type==="styling"&&I.body[0].body.length===0&&(E.length>1||!h)&&E.pop(),S.length<E.length+1&&S.push([]);break}else if(P==="\\\\"){t.consume();var $=void 0;t.gullet.future().text!==" "&&($=t.parseSizeGroup(!0)),T.push($?$.value:null),z(),S.push(Mk(t)),y=[],E.push(y),R()}else throw new De("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:i,arraystretch:a,body:E,cols:s,rowGaps:T,hskipBeforeAndAfter:r,hLinesBeforeRow:S,colSeparationType:l,tags:A,leqno:g}}function S_(t){return t.slice(0,1)==="d"?"display":"text"}var Aa=function(e,n){var r,i,s=e.body.length,a=e.hLinesBeforeRow,l=0,u=new Array(s),d=[],h=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),p=1/n.fontMetrics().ptPerEm,g=5*p;if(e.colSeparationType&&e.colSeparationType==="small"){var b=n.havingStyle(pt.SCRIPT).sizeMultiplier;g=.2778*(b/n.sizeMultiplier)}var y=e.colSeparationType==="CD"?Kn({number:3,unit:"ex"},n):12*p,E=3*p,T=e.arraystretch*y,S=.7*T,A=.3*T,R=0;function z(fn){for(var qt=0;qt<fn.length;++qt)qt>0&&(R+=.25),d.push({pos:R,isDashed:fn[qt]})}for(z(a[0]),r=0;r<e.body.length;++r){var I=e.body[r],P=S,$=A;l<I.length&&(l=I.length);var K=new Array(I.length);for(i=0;i<I.length;++i){var Z=Xt(I[i],n);$<Z.depth&&($=Z.depth),P<Z.height&&(P=Z.height),K[i]=Z}var W=e.rowGaps[r],re=0;W&&(re=Kn(W,n),re>0&&(re+=A,$<re&&($=re),re=0)),e.addJot&&($+=E),K.height=P,K.depth=$,R+=P,K.pos=R,R+=$+re,u[r]=K,z(a[r+1])}var ie=R/2+n.fontMetrics().axisHeight,ye=e.cols||[],ae=[],de,J,ne=[];if(e.tags&&e.tags.some(fn=>fn))for(r=0;r<s;++r){var he=u[r],Oe=he.pos-ie,N=e.tags[r],X=void 0;N===!0?X=ce.makeSpan(["eqn-num"],[],n):N===!1?X=ce.makeSpan([],[],n):X=ce.makeSpan([],Rr(N,n,!0),n),X.depth=he.depth,X.height=he.height,ne.push({type:"elem",elem:X,shift:Oe})}for(i=0,J=0;i<l||J<ye.length;++i,++J){for(var me=ye[J]||{},B=!0;me.type==="separator";){if(B||(de=ce.makeSpan(["arraycolsep"],[]),de.style.width=Ue(n.fontMetrics().doubleRuleSep),ae.push(de)),me.separator==="|"||me.separator===":"){var Ee=me.separator==="|"?"solid":"dashed",Qe=ce.makeSpan(["vertical-separator"],[],n);Qe.style.height=Ue(R),Qe.style.borderRightWidth=Ue(h),Qe.style.borderRightStyle=Ee,Qe.style.margin="0 "+Ue(-h/2);var Fe=R-ie;Fe&&(Qe.style.verticalAlign=Ue(-Fe)),ae.push(Qe)}else throw new De("Invalid separator type: "+me.separator);J++,me=ye[J]||{},B=!1}if(!(i>=l)){var Ft=void 0;(i>0||e.hskipBeforeAndAfter)&&(Ft=ct.deflt(me.pregap,g),Ft!==0&&(de=ce.makeSpan(["arraycolsep"],[]),de.style.width=Ue(Ft),ae.push(de)));var ut=[];for(r=0;r<s;++r){var en=u[r],Nt=en[i];if(Nt){var Mn=en.pos-ie;Nt.depth=en.depth,Nt.height=en.height,ut.push({type:"elem",elem:Nt,shift:Mn})}}ut=ce.makeVList({positionType:"individualShift",children:ut},n),ut=ce.makeSpan(["col-align-"+(me.align||"c")],[ut]),ae.push(ut),(i<l-1||e.hskipBeforeAndAfter)&&(Ft=ct.deflt(me.postgap,g),Ft!==0&&(de=ce.makeSpan(["arraycolsep"],[]),de.style.width=Ue(Ft),ae.push(de)))}}if(u=ce.makeSpan(["mtable"],ae),d.length>0){for(var Vr=ce.makeLineSpan("hline",n,h),gt=ce.makeLineSpan("hdashline",n,h),St=[{type:"elem",elem:u,shift:0}];d.length>0;){var Gt=d.pop(),tt=Gt.pos-ie;Gt.isDashed?St.push({type:"elem",elem:gt,shift:tt}):St.push({type:"elem",elem:Vr,shift:tt})}u=ce.makeVList({positionType:"individualShift",children:St},n)}if(ne.length===0)return ce.makeSpan(["mord"],[u],n);var kt=ce.makeVList({positionType:"individualShift",children:ne},n);return kt=ce.makeSpan(["tag"],[kt],n),ce.makeFragment([u,kt])},Yee={c:"center ",l:"left ",r:"right "},Na=function(e,n){for(var r=[],i=new Me.MathNode("mtd",[],["mtr-glue"]),s=new Me.MathNode("mtd",[],["mml-eqn-num"]),a=0;a<e.body.length;a++){for(var l=e.body[a],u=[],d=0;d<l.length;d++)u.push(new Me.MathNode("mtd",[xn(l[d],n)]));e.tags&&e.tags[a]&&(u.unshift(i),u.push(i),e.leqno?u.unshift(s):u.push(s)),r.push(new Me.MathNode("mtr",u))}var h=new Me.MathNode("mtable",r),p=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);h.setAttribute("rowspacing",Ue(p));var g="",b="";if(e.cols&&e.cols.length>0){var y=e.cols,E="",T=!1,S=0,A=y.length;y[0].type==="separator"&&(g+="top ",S=1),y[y.length-1].type==="separator"&&(g+="bottom ",A-=1);for(var R=S;R<A;R++)y[R].type==="align"?(b+=Yee[y[R].align],T&&(E+="none "),T=!0):y[R].type==="separator"&&T&&(E+=y[R].separator==="|"?"solid ":"dashed ",T=!1);h.setAttribute("columnalign",b.trim()),/[sd]/.test(E)&&h.setAttribute("columnlines",E.trim())}if(e.colSeparationType==="align"){for(var z=e.cols||[],I="",P=1;P<z.length;P++)I+=P%2?"0em ":"1em ";h.setAttribute("columnspacing",I.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?h.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?h.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?h.setAttribute("columnspacing","0.5em"):h.setAttribute("columnspacing","1em");var $="",K=e.hLinesBeforeRow;g+=K[0].length>0?"left ":"",g+=K[K.length-1].length>0?"right ":"";for(var Z=1;Z<K.length-1;Z++)$+=K[Z].length===0?"none ":K[Z][0]?"dashed ":"solid ";return/[sd]/.test($)&&h.setAttribute("rowlines",$.trim()),g!==""&&(h=new Me.MathNode("menclose",[h]),h.setAttribute("notation",g.trim())),e.arraystretch&&e.arraystretch<1&&(h=new Me.MathNode("mstyle",[h]),h.setAttribute("scriptlevel","1")),h},YM=function(e,n){e.envName.indexOf("ed")===-1&&ob(e);var r=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s=e.envName==="split",a=Bl(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:T_(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),l,u=0,d={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var h="",p=0;p<n[0].body.length;p++){var g=Rt(n[0].body[p],"textord");h+=g.text}l=Number(h),u=l*2}var b=!u;a.body.forEach(function(S){for(var A=1;A<S.length;A+=2){var R=Rt(S[A],"styling"),z=Rt(R.body[0],"ordgroup");z.body.unshift(d)}if(b)u<S.length&&(u=S.length);else{var I=S.length/2;if(l<I)throw new De("Too many math in a row: "+("expected "+l+", but got "+I),S[0])}});for(var y=0;y<u;++y){var E="r",T=0;y%2===1?E="l":y>0&&b&&(T=1),r[y]={type:"align",align:E,pregap:T,postgap:0}}return a.colSeparationType=b?"align":"alignat",a};Ca({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=ib(e[0]),r=n?[e[0]]:Rt(e[0],"ordgroup").body,i=r.map(function(a){var l=v_(a),u=l.text;if("lcr".indexOf(u)!==-1)return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new De("Unknown column alignment: "+u,a)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Bl(t.parser,s,S_(t.envName))},htmlBuilder:Aa,mathmlBuilder:Na});Ca({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,"lcr".indexOf(n)===-1)throw new De("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var s=Bl(t.parser,r,S_(t.envName)),a=Math.max(0,...s.body.map(l=>l.length));return s.cols=new Array(a).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Aa,mathmlBuilder:Na});Ca({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=Bl(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Aa,mathmlBuilder:Na});Ca({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=ib(e[0]),r=n?[e[0]]:Rt(e[0],"ordgroup").body,i=r.map(function(a){var l=v_(a),u=l.text;if("lc".indexOf(u)!==-1)return{type:"align",align:u};throw new De("Unknown column alignment: "+u,a)});if(i.length>1)throw new De("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=Bl(t.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new De("{subarray} can contain only one column");return s},htmlBuilder:Aa,mathmlBuilder:Na});Ca({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Bl(t.parser,e,S_(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Aa,mathmlBuilder:Na});Ca({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:YM,htmlBuilder:Aa,mathmlBuilder:Na});Ca({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){ct.contains(["gather","gather*"],t.envName)&&ob(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:T_(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Bl(t.parser,e,"display")},htmlBuilder:Aa,mathmlBuilder:Na});Ca({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:YM,htmlBuilder:Aa,mathmlBuilder:Na});Ca({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){ob(t);var e={autoTag:T_(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Bl(t.parser,e,"display")},htmlBuilder:Aa,mathmlBuilder:Na});Ca({type:"array",names:["CD"],props:{numArgs:0},handler(t){return ob(t),Dee(t.parser)},htmlBuilder:Aa,mathmlBuilder:Na});L("\\nonumber","\\gdef\\@eqnsw{0}");L("\\notag","\\nonumber");Ge({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new De(t.funcName+" valid only within array environment")}});var Ok=VM;Ge({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];if(i.type!=="ordgroup")throw new De("Invalid environment name",i);for(var s="",a=0;a<i.body.length;++a)s+=Rt(i.body[a],"textord").text;if(r==="\\begin"){if(!Ok.hasOwnProperty(s))throw new De("No such environment: "+s,i);var l=Ok[s],{args:u,optArgs:d}=n.parseArguments("\\begin{"+s+"}",l),h={mode:n.mode,envName:s,parser:n},p=l.handler(h,u,d);n.expect("\\end",!1);var g=n.nextToken,b=Rt(n.parseFunction(),"environment");if(b.name!==s)throw new De("Mismatch: \\begin{"+s+"} matched by \\end{"+b.name+"}",g);return p}return{type:"environment",mode:n.mode,name:s,nameGroup:i}}});var WM=(t,e)=>{var n=t.font,r=e.withFont(n);return Xt(t.body,r)},KM=(t,e)=>{var n=t.font,r=e.withFont(n);return xn(t.body,r)},Rk={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Ge({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=Ng(e[0]),s=r;return s in Rk&&(s=Rk[s]),{type:"font",mode:n.mode,font:s.slice(1),body:i}},htmlBuilder:WM,mathmlBuilder:KM});Ge({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0],i=ct.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:sb(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}});Ge({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,breakOnTokenText:i}=t,{mode:s}=n,a=n.parseExpression(!0,i),l="math"+r.slice(1);return{type:"font",mode:s,font:l,body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:WM,mathmlBuilder:KM});var XM=(t,e)=>{var n=e;return t==="display"?n=n.id>=pt.SCRIPT.id?n.text():pt.DISPLAY:t==="text"&&n.size===pt.DISPLAY.size?n=pt.TEXT:t==="script"?n=pt.SCRIPT:t==="scriptscript"&&(n=pt.SCRIPTSCRIPT),n},w_=(t,e)=>{var n=XM(t.size,e.style),r=n.fracNum(),i=n.fracDen(),s;s=e.havingStyle(r);var a=Xt(t.numer,s,e);if(t.continued){var l=8.5/e.fontMetrics().ptPerEm,u=3.5/e.fontMetrics().ptPerEm;a.height=a.height<l?l:a.height,a.depth=a.depth<u?u:a.depth}s=e.havingStyle(i);var d=Xt(t.denom,s,e),h,p,g;t.hasBarLine?(t.barSize?(p=Kn(t.barSize,e),h=ce.makeLineSpan("frac-line",e,p)):h=ce.makeLineSpan("frac-line",e),p=h.height,g=h.height):(h=null,p=0,g=e.fontMetrics().defaultRuleThickness);var b,y,E;n.size===pt.DISPLAY.size||t.size==="display"?(b=e.fontMetrics().num1,p>0?y=3*g:y=7*g,E=e.fontMetrics().denom1):(p>0?(b=e.fontMetrics().num2,y=g):(b=e.fontMetrics().num3,y=3*g),E=e.fontMetrics().denom2);var T;if(h){var A=e.fontMetrics().axisHeight;b-a.depth-(A+.5*p)<y&&(b+=y-(b-a.depth-(A+.5*p))),A-.5*p-(d.height-E)<y&&(E+=y-(A-.5*p-(d.height-E)));var R=-(A-.5*p);T=ce.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:E},{type:"elem",elem:h,shift:R},{type:"elem",elem:a,shift:-b}]},e)}else{var S=b-a.depth-(d.height-E);S<y&&(b+=.5*(y-S),E+=.5*(y-S)),T=ce.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:E},{type:"elem",elem:a,shift:-b}]},e)}s=e.havingStyle(n),T.height*=s.sizeMultiplier/e.sizeMultiplier,T.depth*=s.sizeMultiplier/e.sizeMultiplier;var z;n.size===pt.DISPLAY.size?z=e.fontMetrics().delim1:n.size===pt.SCRIPTSCRIPT.size?z=e.havingStyle(pt.SCRIPT).fontMetrics().delim2:z=e.fontMetrics().delim2;var I,P;return t.leftDelim==null?I=Qf(e,["mopen"]):I=ho.customSizedDelim(t.leftDelim,z,!0,e.havingStyle(n),t.mode,["mopen"]),t.continued?P=ce.makeSpan([]):t.rightDelim==null?P=Qf(e,["mclose"]):P=ho.customSizedDelim(t.rightDelim,z,!0,e.havingStyle(n),t.mode,["mclose"]),ce.makeSpan(["mord"].concat(s.sizingClasses(e)),[I,ce.makeSpan(["mfrac"],[T]),P],e)},k_=(t,e)=>{var n=new Me.MathNode("mfrac",[xn(t.numer,e),xn(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Kn(t.barSize,e);n.setAttribute("linethickness",Ue(r))}var i=XM(t.size,e.style);if(i.size!==e.style.size){n=new Me.MathNode("mstyle",[n]);var s=i.size===pt.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",s),n.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var a=[];if(t.leftDelim!=null){var l=new Me.MathNode("mo",[new Me.TextNode(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}if(a.push(n),t.rightDelim!=null){var u=new Me.MathNode("mo",[new Me.TextNode(t.rightDelim.replace("\\",""))]);u.setAttribute("fence","true"),a.push(u)}return g_(a)}return n};Ge({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=e[1],a,l=null,u=null,d="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,l="(",u=")";break;case"\\\\bracefrac":a=!1,l="\\{",u="\\}";break;case"\\\\brackfrac":a=!1,l="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":d="display";break;case"\\tfrac":case"\\tbinom":d="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:i,denom:s,hasBarLine:a,leftDelim:l,rightDelim:u,size:d,barSize:null}},htmlBuilder:w_,mathmlBuilder:k_});Ge({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});Ge({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:r}=t,i;switch(n){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:r}}});var Dk=["display","text","script","scriptscript"],Ik=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};Ge({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,r=e[4],i=e[5],s=Ng(e[0]),a=s.type==="atom"&&s.family==="open"?Ik(s.text):null,l=Ng(e[1]),u=l.type==="atom"&&l.family==="close"?Ik(l.text):null,d=Rt(e[2],"size"),h,p=null;d.isBlank?h=!0:(p=d.value,h=p.number>0);var g="auto",b=e[3];if(b.type==="ordgroup"){if(b.body.length>0){var y=Rt(b.body[0],"textord");g=Dk[Number(y.text)]}}else b=Rt(b,"textord"),g=Dk[Number(b.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:h,barSize:p,leftDelim:a,rightDelim:u,size:g}},htmlBuilder:w_,mathmlBuilder:k_});Ge({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:i}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Rt(e[0],"size").value,token:i}}});Ge({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=TJ(Rt(e[1],"infix").size),a=e[2],l=s.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:a,continued:!1,hasBarLine:l,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:w_,mathmlBuilder:k_});var QM=(t,e)=>{var n=e.style,r,i;t.type==="supsub"?(r=t.sup?Xt(t.sup,e.havingStyle(n.sup()),e):Xt(t.sub,e.havingStyle(n.sub()),e),i=Rt(t.base,"horizBrace")):i=Rt(t,"horizBrace");var s=Xt(i.base,e.havingBaseStyle(pt.DISPLAY)),a=Eo.svgSpan(i,e),l;if(i.isOver?(l=ce.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=ce.makeVList({positionType:"bottom",positionData:s.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),r){var u=ce.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e);i.isOver?l=ce.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:r}]},e):l=ce.makeVList({positionType:"bottom",positionData:u.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:u}]},e)}return ce.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e)},Wee=(t,e)=>{var n=Eo.mathMLnode(t.label);return new Me.MathNode(t.isOver?"mover":"munder",[xn(t.base,e),n])};Ge({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:QM,mathmlBuilder:Wee});Ge({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],i=Rt(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:dr(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=Rr(t.body,e,!1);return ce.makeAnchor(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=Dl(t.body,e);return n instanceof is||(n=new is("mrow",[n])),n.setAttribute("href",t.href),n}});Ge({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=Rt(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<r.length;s++){var a=r[s];a==="~"&&(a="\\textasciitilde"),i.push({type:"textord",mode:"text",text:a})}var l={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:dr(l)}}});Ge({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(t,e){var{parser:n}=t;return{type:"hbox",mode:n.mode,body:dr(e[0])}},htmlBuilder(t,e){var n=Rr(t.body,e,!1);return ce.makeFragment(n)},mathmlBuilder(t,e){return new Me.MathNode("mrow",qi(t.body,e))}});Ge({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,token:i}=t,s=Rt(e[0],"raw").string,a=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,u={};switch(r){case"\\htmlClass":u.class=s,l={command:"\\htmlClass",class:s};break;case"\\htmlId":u.id=s,l={command:"\\htmlId",id:s};break;case"\\htmlStyle":u.style=s,l={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var d=s.split(","),h=0;h<d.length;h++){var p=d[h].split("=");if(p.length!==2)throw new De("Error parsing key-value for \\htmlData");u["data-"+p[0].trim()]=p[1].trim()}l={command:"\\htmlData",attributes:u};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(l)?{type:"html",mode:n.mode,attributes:u,body:dr(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(t,e)=>{var n=Rr(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var i=ce.makeSpan(r,n,e);for(var s in t.attributes)s!=="class"&&t.attributes.hasOwnProperty(s)&&i.setAttribute(s,t.attributes[s]);return i},mathmlBuilder:(t,e)=>Dl(t.body,e)});Ge({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:dr(e[0]),mathml:dr(e[1])}},htmlBuilder:(t,e)=>{var n=Rr(t.html,e,!1);return ce.makeFragment(n)},mathmlBuilder:(t,e)=>Dl(t.mathml,e)});var O2=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!n)throw new De("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!gM(r))throw new De("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ge({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:r}=t,i={number:0,unit:"em"},s={number:.9,unit:"em"},a={number:0,unit:"em"},l="";if(n[0])for(var u=Rt(n[0],"raw").string,d=u.split(","),h=0;h<d.length;h++){var p=d[h].split("=");if(p.length===2){var g=p[1].trim();switch(p[0].trim()){case"alt":l=g;break;case"width":i=O2(g);break;case"height":s=O2(g);break;case"totalheight":a=O2(g);break;default:throw new De("Invalid key: '"+p[0]+"' in \\includegraphics.")}}}var b=Rt(e[0],"url").url;return l===""&&(l=b,l=l.replace(/^.*[\\/]/,""),l=l.substring(0,l.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:b})?{type:"includegraphics",mode:r.mode,alt:l,width:i,height:s,totalheight:a,src:b}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var n=Kn(t.height,e),r=0;t.totalheight.number>0&&(r=Kn(t.totalheight,e)-n);var i=0;t.width.number>0&&(i=Kn(t.width,e));var s={height:Ue(n+r)};i>0&&(s.width=Ue(i)),r>0&&(s.verticalAlign=Ue(-r));var a=new WJ(t.src,t.alt,s);return a.height=n,a.depth=r,a},mathmlBuilder:(t,e)=>{var n=new Me.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=Kn(t.height,e),i=0;if(t.totalheight.number>0&&(i=Kn(t.totalheight,e)-r,n.setAttribute("valign",Ue(-i))),n.setAttribute("height",Ue(r+i)),t.width.number>0){var s=Kn(t.width,e);n.setAttribute("width",Ue(s))}return n.setAttribute("src",t.src),n}});Ge({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=Rt(e[0],"size");if(n.settings.strict){var s=r[1]==="m",a=i.value.unit==="mu";s?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(t,e){return ce.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var n=Kn(t.dimension,e);return new Me.SpaceNode(n)}});Ge({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=ce.makeSpan([],[Xt(t.body,e)]),n=ce.makeSpan(["inner"],[n],e)):n=ce.makeSpan(["inner"],[Xt(t.body,e)]);var r=ce.makeSpan(["fix"],[]),i=ce.makeSpan([t.alignment],[n,r],e),s=ce.makeSpan(["strut"]);return s.style.height=Ue(i.height+i.depth),i.depth&&(s.style.verticalAlign=Ue(-i.depth)),i.children.unshift(s),i=ce.makeSpan(["thinbox"],[i],e),ce.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var n=new Me.MathNode("mpadded",[xn(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Ge({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,i=r.mode;r.switchMode("math");var s=n==="\\("?"\\)":"$",a=r.parseExpression(!1,s);return r.expect(s),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:a}}});Ge({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new De("Mismatched "+t.funcName)}});var Lk=(t,e)=>{switch(e.style.size){case pt.DISPLAY.size:return t.display;case pt.TEXT.size:return t.text;case pt.SCRIPT.size:return t.script;case pt.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Ge({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:dr(e[0]),text:dr(e[1]),script:dr(e[2]),scriptscript:dr(e[3])}},htmlBuilder:(t,e)=>{var n=Lk(t,e),r=Rr(n,e,!1);return ce.makeFragment(r)},mathmlBuilder:(t,e)=>{var n=Lk(t,e);return Dl(n,e)}});var ZM=(t,e,n,r,i,s,a)=>{t=ce.makeSpan([],[t]);var l=n&&ct.isCharacterBox(n),u,d;if(e){var h=Xt(e,r.havingStyle(i.sup()),r);d={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var p=Xt(n,r.havingStyle(i.sub()),r);u={elem:p,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-p.height)}}var g;if(d&&u){var b=r.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+t.depth+a;g=ce.makeVList({positionType:"bottom",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Ue(-s)},{type:"kern",size:u.kern},{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Ue(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(u){var y=t.height-a;g=ce.makeVList({positionType:"top",positionData:y,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Ue(-s)},{type:"kern",size:u.kern},{type:"elem",elem:t}]},r)}else if(d){var E=t.depth+a;g=ce.makeVList({positionType:"bottom",positionData:E,children:[{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Ue(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return t;var T=[g];if(u&&s!==0&&!l){var S=ce.makeSpan(["mspace"],[],r);S.style.marginRight=Ue(s),T.unshift(S)}return ce.makeSpan(["mop","op-limits"],T,r)},JM=["\\smallint"],Rd=(t,e)=>{var n,r,i=!1,s;t.type==="supsub"?(n=t.sup,r=t.sub,s=Rt(t.base,"op"),i=!0):s=Rt(t,"op");var a=e.style,l=!1;a.size===pt.DISPLAY.size&&s.symbol&&!ct.contains(JM,s.name)&&(l=!0);var u;if(s.symbol){var d=l?"Size2-Regular":"Size1-Regular",h="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(h=s.name.slice(1),s.name=h==="oiint"?"\\iint":"\\iiint"),u=ce.makeSymbol(s.name,d,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),h.length>0){var p=u.italic,g=ce.staticSvg(h+"Size"+(l?"2":"1"),e);u=ce.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:g,shift:l?.08:0}]},e),s.name="\\"+h,u.classes.unshift("mop"),u.italic=p}}else if(s.body){var b=Rr(s.body,e,!0);b.length===1&&b[0]instanceof Ls?(u=b[0],u.classes[0]="mop"):u=ce.makeSpan(["mop"],b,e)}else{for(var y=[],E=1;E<s.name.length;E++)y.push(ce.mathsym(s.name[E],s.mode,e));u=ce.makeSpan(["mop"],y,e)}var T=0,S=0;return(u instanceof Ls||s.name==="\\oiint"||s.name==="\\oiiint")&&!s.suppressBaseShift&&(T=(u.height-u.depth)/2-e.fontMetrics().axisHeight,S=u.italic),i?ZM(u,n,r,e,a,S,T):(T&&(u.style.position="relative",u.style.top=Ue(T)),u)},Dh=(t,e)=>{var n;if(t.symbol)n=new is("mo",[Ps(t.name,t.mode)]),ct.contains(JM,t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new is("mo",qi(t.body,e));else{n=new is("mi",[new ba(t.name.slice(1))]);var r=new is("mo",[Ps("⁡","text")]);t.parentIsSupSub?n=new is("mrow",[n,r]):n=CM([n,r])}return n},Kee={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ge({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=r;return i.length===1&&(i=Kee[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Rd,mathmlBuilder:Dh});Ge({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:dr(r)}},htmlBuilder:Rd,mathmlBuilder:Dh});var Xee={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ge({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(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Rd,mathmlBuilder:Dh});Ge({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Rd,mathmlBuilder:Dh});Ge({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t,r=n;return r.length===1&&(r=Xee[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Rd,mathmlBuilder:Dh});var eO=(t,e)=>{var n,r,i=!1,s;t.type==="supsub"?(n=t.sup,r=t.sub,s=Rt(t.base,"operatorname"),i=!0):s=Rt(t,"operatorname");var a;if(s.body.length>0){for(var l=s.body.map(p=>{var g=p.text;return typeof g=="string"?{type:"textord",mode:p.mode,text:g}:p}),u=Rr(l,e.withFont("mathrm"),!0),d=0;d<u.length;d++){var h=u[d];h instanceof Ls&&(h.text=h.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=ce.makeSpan(["mop"],u,e)}else a=ce.makeSpan(["mop"],[],e);return i?ZM(a,n,r,e,e.style,0,0):a},Qee=(t,e)=>{for(var n=qi(t.body,e.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var s=n[i];if(!(s instanceof Me.SpaceNode))if(s instanceof Me.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var a=s.children[0];s.children.length===1&&a instanceof Me.TextNode?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var l=n.map(h=>h.toText()).join("");n=[new Me.TextNode(l)]}var u=new Me.MathNode("mi",n);u.setAttribute("mathvariant","normal");var d=new Me.MathNode("mo",[Ps("⁡","text")]);return t.parentIsSupSub?new Me.MathNode("mrow",[u,d]):Me.newDocumentFragment([u,d])};Ge({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"operatorname",mode:n.mode,body:dr(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:eO,mathmlBuilder:Qee});L("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Xu({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?ce.makeFragment(Rr(t.body,e,!1)):ce.makeSpan(["mord"],Rr(t.body,e,!0),e)},mathmlBuilder(t,e){return Dl(t.body,e,!0)}});Ge({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=Xt(t.body,e.havingCrampedStyle()),r=ce.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=ce.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},e);return ce.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(t,e){var n=new Me.MathNode("mo",[new Me.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Me.MathNode("mover",[xn(t.body,e),n]);return r.setAttribute("accent","true"),r}});Ge({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:dr(r)}},htmlBuilder:(t,e)=>{var n=Rr(t.body,e.withPhantom(),!1);return ce.makeFragment(n)},mathmlBuilder:(t,e)=>{var n=qi(t.body,e);return new Me.MathNode("mphantom",n)}});Ge({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=ce.makeSpan([],[Xt(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=ce.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e),ce.makeSpan(["mord"],[n],e)},mathmlBuilder:(t,e)=>{var n=qi(dr(t.body),e),r=new Me.MathNode("mphantom",n),i=new Me.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});Ge({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=ce.makeSpan(["inner"],[Xt(t.body,e.withPhantom())]),r=ce.makeSpan(["fix"],[]);return ce.makeSpan(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=qi(dr(t.body),e),r=new Me.MathNode("mphantom",n),i=new Me.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}});Ge({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=Rt(e[0],"size").value,i=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(t,e){var n=Xt(t.body,e),r=Kn(t.dy,e);return ce.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new Me.MathNode("mpadded",[xn(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});Ge({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});Ge({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,i=n[0],s=Rt(e[0],"size"),a=Rt(e[1],"size");return{type:"rule",mode:r.mode,shift:i&&Rt(i,"size").value,width:s.value,height:a.value}},htmlBuilder(t,e){var n=ce.makeSpan(["mord","rule"],[],e),r=Kn(t.width,e),i=Kn(t.height,e),s=t.shift?Kn(t.shift,e):0;return n.style.borderRightWidth=Ue(r),n.style.borderTopWidth=Ue(i),n.style.bottom=Ue(s),n.width=r,n.height=i+s,n.depth=-s,n.maxFontSize=i*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Kn(t.width,e),r=Kn(t.height,e),i=t.shift?Kn(t.shift,e):0,s=e.color&&e.getColor()||"black",a=new Me.MathNode("mspace");a.setAttribute("mathbackground",s),a.setAttribute("width",Ue(n)),a.setAttribute("height",Ue(r));var l=new Me.MathNode("mpadded",[a]);return i>=0?l.setAttribute("height",Ue(i)):(l.setAttribute("height",Ue(i)),l.setAttribute("depth",Ue(-i))),l.setAttribute("voffset",Ue(i)),l}});function tO(t,e,n){for(var r=Rr(t,e,!1),i=e.sizeMultiplier/n.sizeMultiplier,s=0;s<r.length;s++){var a=r[s].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[s].classes,e.sizingClasses(n)):r[s].classes[a+1]==="reset-size"+e.size&&(r[s].classes[a+1]="reset-size"+n.size),r[s].height*=i,r[s].depth*=i}return ce.makeFragment(r)}var Pk=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],Zee=(t,e)=>{var n=e.havingSize(t.size);return tO(t.body,n,e)};Ge({type:"sizing",names:Pk,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:r,parser:i}=t,s=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:Pk.indexOf(r)+1,body:s}},htmlBuilder:Zee,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=qi(t.body,n),i=new Me.MathNode("mstyle",r);return i.setAttribute("mathsize",Ue(n.sizeMultiplier)),i}});Ge({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:r}=t,i=!1,s=!1,a=n[0]&&Rt(n[0],"ordgroup");if(a)for(var l="",u=0;u<a.body.length;++u){var d=a.body[u];if(l=d.text,l==="t")i=!0;else if(l==="b")s=!0;else{i=!1,s=!1;break}}else i=!0,s=!0;var h=e[0];return{type:"smash",mode:r.mode,body:h,smashHeight:i,smashDepth:s}},htmlBuilder:(t,e)=>{var n=ce.makeSpan([],[Xt(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(t.smashDepth&&(n.depth=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].depth=0;var s=ce.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e);return ce.makeSpan(["mord"],[s],e)},mathmlBuilder:(t,e)=>{var n=new Me.MathNode("mpadded",[xn(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});Ge({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,i=n[0],s=e[0];return{type:"sqrt",mode:r.mode,body:s,index:i}},htmlBuilder(t,e){var n=Xt(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=ce.wrapFragment(n,e);var r=e.fontMetrics(),i=r.defaultRuleThickness,s=i;e.style.id<pt.TEXT.id&&(s=e.fontMetrics().xHeight);var a=i+s/4,l=n.height+n.depth+a+i,{span:u,ruleWidth:d,advanceWidth:h}=ho.sqrtImage(l,e),p=u.height-d;p>n.height+n.depth+a&&(a=(a+p-n.height-n.depth)/2);var g=u.height-n.height-a-d;n.style.paddingLeft=Ue(h);var b=ce.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:u},{type:"kern",size:d}]},e);if(t.index){var y=e.havingStyle(pt.SCRIPTSCRIPT),E=Xt(t.index,y,e),T=.6*(b.height-b.depth),S=ce.makeVList({positionType:"shift",positionData:-T,children:[{type:"elem",elem:E}]},e),A=ce.makeSpan(["root"],[S]);return ce.makeSpan(["mord","sqrt"],[A,b],e)}else return ce.makeSpan(["mord","sqrt"],[b],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new Me.MathNode("mroot",[xn(n,e),xn(r,e)]):new Me.MathNode("msqrt",[xn(n,e)])}});var Bk={display:pt.DISPLAY,text:pt.TEXT,script:pt.SCRIPT,scriptscript:pt.SCRIPTSCRIPT};Ge({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:i}=t,s=i.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:a,body:s}},htmlBuilder(t,e){var n=Bk[t.style],r=e.havingStyle(n).withFont("");return tO(t.body,r,e)},mathmlBuilder(t,e){var n=Bk[t.style],r=e.havingStyle(n),i=qi(t.body,r),s=new Me.MathNode("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=a[t.style];return s.setAttribute("scriptlevel",l[0]),s.setAttribute("displaystyle",l[1]),s}});var Jee=function(e,n){var r=e.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===pt.DISPLAY.size||r.alwaysHandleSupSub);return i?Rd:null}else if(r.type==="operatorname"){var s=r.alwaysHandleSupSub&&(n.style.size===pt.DISPLAY.size||r.limits);return s?eO:null}else{if(r.type==="accent")return ct.isCharacterBox(r.base)?y_:null;if(r.type==="horizBrace"){var a=!e.sub;return a===r.isOver?QM:null}else return null}else return null};Xu({type:"supsub",htmlBuilder(t,e){var n=Jee(t,e);if(n)return n(t,e);var{base:r,sup:i,sub:s}=t,a=Xt(r,e),l,u,d=e.fontMetrics(),h=0,p=0,g=r&&ct.isCharacterBox(r);if(i){var b=e.havingStyle(e.style.sup());l=Xt(i,b,e),g||(h=a.height-b.fontMetrics().supDrop*b.sizeMultiplier/e.sizeMultiplier)}if(s){var y=e.havingStyle(e.style.sub());u=Xt(s,y,e),g||(p=a.depth+y.fontMetrics().subDrop*y.sizeMultiplier/e.sizeMultiplier)}var E;e.style===pt.DISPLAY?E=d.sup1:e.style.cramped?E=d.sup3:E=d.sup2;var T=e.sizeMultiplier,S=Ue(.5/d.ptPerEm/T),A=null;if(u){var R=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(a instanceof Ls||R)&&(A=Ue(-a.italic))}var z;if(l&&u){h=Math.max(h,E,l.depth+.25*d.xHeight),p=Math.max(p,d.sub2);var I=d.defaultRuleThickness,P=4*I;if(h-l.depth-(u.height-p)<P){p=P-(h-l.depth)+u.height;var $=.8*d.xHeight-(h-l.depth);$>0&&(h+=$,p-=$)}var K=[{type:"elem",elem:u,shift:p,marginRight:S,marginLeft:A},{type:"elem",elem:l,shift:-h,marginRight:S}];z=ce.makeVList({positionType:"individualShift",children:K},e)}else if(u){p=Math.max(p,d.sub1,u.height-.8*d.xHeight);var Z=[{type:"elem",elem:u,marginLeft:A,marginRight:S}];z=ce.makeVList({positionType:"shift",positionData:p,children:Z},e)}else if(l)h=Math.max(h,E,l.depth+.25*d.xHeight),z=ce.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:l,marginRight:S}]},e);else throw new Error("supsub must have either sup or sub.");var W=p4(a,"right")||"mord";return ce.makeSpan([W],[a,ce.makeSpan(["msupsub"],[z])],e)},mathmlBuilder(t,e){var n=!1,r,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[xn(t.base,e)];t.sub&&s.push(xn(t.sub,e)),t.sup&&s.push(xn(t.sup,e));var a;if(n)a=r?"mover":"munder";else if(t.sub)if(t.sup){var d=t.base;d&&d.type==="op"&&d.limits&&e.style===pt.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(e.style===pt.DISPLAY||d.limits)?a="munderover":a="msubsup"}else{var u=t.base;u&&u.type==="op"&&u.limits&&(e.style===pt.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||e.style===pt.DISPLAY)?a="munder":a="msub"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===pt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===pt.DISPLAY)?a="mover":a="msup"}return new Me.MathNode(a,s)}});Xu({type:"atom",htmlBuilder(t,e){return ce.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new Me.MathNode("mo",[Ps(t.text,t.mode)]);if(t.family==="bin"){var r=b_(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var nO={mi:"italic",mn:"normal",mtext:"normal"};Xu({type:"mathord",htmlBuilder(t,e){return ce.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var n=new Me.MathNode("mi",[Ps(t.text,t.mode,e)]),r=b_(t,e)||"italic";return r!==nO[n.type]&&n.setAttribute("mathvariant",r),n}});Xu({type:"textord",htmlBuilder(t,e){return ce.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var n=Ps(t.text,t.mode,e),r=b_(t,e)||"normal",i;return t.mode==="text"?i=new Me.MathNode("mtext",[n]):/[0-9]/.test(t.text)?i=new Me.MathNode("mn",[n]):t.text==="\\prime"?i=new Me.MathNode("mo",[n]):i=new Me.MathNode("mi",[n]),r!==nO[i.type]&&i.setAttribute("mathvariant",r),i}});var R2={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},D2={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Xu({type:"spacing",htmlBuilder(t,e){if(D2.hasOwnProperty(t.text)){var n=D2[t.text].className||"";if(t.mode==="text"){var r=ce.makeOrd(t,e,"textord");return r.classes.push(n),r}else return ce.makeSpan(["mspace",n],[ce.mathsym(t.text,t.mode,e)],e)}else{if(R2.hasOwnProperty(t.text))return ce.makeSpan(["mspace",R2[t.text]],[],e);throw new De('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(D2.hasOwnProperty(t.text))n=new Me.MathNode("mtext",[new Me.TextNode(" ")]);else{if(R2.hasOwnProperty(t.text))return new Me.MathNode("mspace");throw new De('Unknown type of space "'+t.text+'"')}return n}});var zk=()=>{var t=new Me.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Xu({type:"tag",mathmlBuilder(t,e){var n=new Me.MathNode("mtable",[new Me.MathNode("mtr",[zk(),new Me.MathNode("mtd",[Dl(t.body,e)]),zk(),new Me.MathNode("mtd",[Dl(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var Fk={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Uk={"\\textbf":"textbf","\\textmd":"textmd"},ete={"\\textit":"textit","\\textup":"textup"},Hk=(t,e)=>{var n=t.font;if(n){if(Fk[n])return e.withTextFontFamily(Fk[n]);if(Uk[n])return e.withTextFontWeight(Uk[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(ete[n])};Ge({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"text",mode:n.mode,body:dr(i),font:r}},htmlBuilder(t,e){var n=Hk(t,e),r=Rr(t.body,n,!0);return ce.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=Hk(t,e);return Dl(t.body,n)}});Ge({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Xt(t.body,e),r=ce.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=ce.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},e);return ce.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(t,e){var n=new Me.MathNode("mo",[new Me.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Me.MathNode("munder",[xn(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});Ge({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Xt(t.body,e),r=e.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return ce.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){return new Me.MathNode("mpadded",[xn(t.body,e)],["vcenter"])}});Ge({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new De("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=jk(t),r=[],i=e.havingStyle(e.style.text()),s=0;s<n.length;s++){var a=n[s];a==="~"&&(a="\\textasciitilde"),r.push(ce.makeSymbol(a,"Typewriter-Regular",t.mode,i,["mord","texttt"]))}return ce.makeSpan(["mord","text"].concat(i.sizingClasses(e)),ce.tryCombineChars(r),i)},mathmlBuilder(t,e){var n=new Me.TextNode(jk(t)),r=new Me.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var jk=t=>t.body.replace(/ /g,t.star?"␣":" "),yl=wM,rO=`[ \r
	]`,tte="\\\\[a-zA-Z@]+",nte="\\\\[^\uD800-\uDFFF]",rte="("+tte+")"+rO+"*",ite=`\\\\(
|[ \r	]+
?)[ \r	]*`,v4="[̀-ͯ]",ste=new RegExp(v4+"+$"),ate="("+rO+"+)|"+(ite+"|")+"([!-\\[\\]-‧‪-퟿豈-]"+(v4+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(v4+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+rte)+("|"+nte+")");class $k{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(ate,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new Ns("EOF",new rs(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new De("Unexpected character: '"+e[n]+"'",new Ns(e[n],new rs(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(`
`,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 Ns(i,new rs(this,n,this.tokenRegex.lastIndex))}}class ote{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new De("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}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,n,r){if(r===void 0&&(r=!1),r){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]=n)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var lte=GM;L("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});L("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});L("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});L("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});L("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});L("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");L("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var qk={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};L("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new De("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=qk[e.text],r==null||r>=n)throw new De("Invalid base-"+n+" digit "+e.text);for(var i;(i=qk[t.future().text])!=null&&i<n;)r*=n,r+=i,t.popToken()}return"\\@char{"+r+"}"});var C_=(t,e,n,r)=>{var i=t.consumeArg().tokens;if(i.length!==1)throw new De("\\newcommand's first argument must be a macro name");var s=i[0].text,a=t.isDefined(s);if(a&&!e)throw new De("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!a&&!n)throw new De("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var l=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var u="",d=t.expandNextToken();d.text!=="]"&&d.text!=="EOF";)u+=d.text,d=t.expandNextToken();if(!u.match(/^\s*[0-9]+\s*$/))throw new De("Invalid number of arguments: "+u);l=parseInt(u),i=t.consumeArg().tokens}return a&&r||t.macros.set(s,{tokens:i,numArgs:l}),""};L("\\newcommand",t=>C_(t,!1,!0,!1));L("\\renewcommand",t=>C_(t,!0,!1,!1));L("\\providecommand",t=>C_(t,!0,!0,!0));L("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});L("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});L("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),yl[n],Nn.math[n],Nn.text[n]),""});L("\\bgroup","{");L("\\egroup","}");L("~","\\nobreakspace");L("\\lq","`");L("\\rq","'");L("\\aa","\\r a");L("\\AA","\\r A");L("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");L("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");L("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");L("ℬ","\\mathscr{B}");L("ℰ","\\mathscr{E}");L("ℱ","\\mathscr{F}");L("ℋ","\\mathscr{H}");L("ℐ","\\mathscr{I}");L("ℒ","\\mathscr{L}");L("ℳ","\\mathscr{M}");L("ℛ","\\mathscr{R}");L("ℭ","\\mathfrak{C}");L("ℌ","\\mathfrak{H}");L("ℨ","\\mathfrak{Z}");L("\\Bbbk","\\Bbb{k}");L("·","\\cdotp");L("\\llap","\\mathllap{\\textrm{#1}}");L("\\rlap","\\mathrlap{\\textrm{#1}}");L("\\clap","\\mathclap{\\textrm{#1}}");L("\\mathstrut","\\vphantom{(}");L("\\underbar","\\underline{\\text{#1}}");L("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');L("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");L("\\ne","\\neq");L("≠","\\neq");L("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");L("∉","\\notin");L("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");L("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");L("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");L("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");L("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");L("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");L("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");L("⟂","\\perp");L("‼","\\mathclose{!\\mkern-0.8mu!}");L("∌","\\notni");L("⌜","\\ulcorner");L("⌝","\\urcorner");L("⌞","\\llcorner");L("⌟","\\lrcorner");L("©","\\copyright");L("®","\\textregistered");L("️","\\textregistered");L("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');L("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');L("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');L("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');L("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");L("⋮","\\vdots");L("\\varGamma","\\mathit{\\Gamma}");L("\\varDelta","\\mathit{\\Delta}");L("\\varTheta","\\mathit{\\Theta}");L("\\varLambda","\\mathit{\\Lambda}");L("\\varXi","\\mathit{\\Xi}");L("\\varPi","\\mathit{\\Pi}");L("\\varSigma","\\mathit{\\Sigma}");L("\\varUpsilon","\\mathit{\\Upsilon}");L("\\varPhi","\\mathit{\\Phi}");L("\\varPsi","\\mathit{\\Psi}");L("\\varOmega","\\mathit{\\Omega}");L("\\substack","\\begin{subarray}{c}#1\\end{subarray}");L("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");L("\\boxed","\\fbox{$\\displaystyle{#1}$}");L("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");L("\\implies","\\DOTSB\\;\\Longrightarrow\\;");L("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");L("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");L("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Vk={",":"\\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"};L("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in Vk?e=Vk[n]:(n.slice(0,4)==="\\not"||n in Nn.math&&ct.contains(["bin","rel"],Nn.math[n].group))&&(e="\\dotsb"),e});var A_={")":!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};L("\\dotso",function(t){var e=t.future().text;return e in A_?"\\ldots\\,":"\\ldots"});L("\\dotsc",function(t){var e=t.future().text;return e in A_&&e!==","?"\\ldots\\,":"\\ldots"});L("\\cdots",function(t){var e=t.future().text;return e in A_?"\\@cdots\\,":"\\@cdots"});L("\\dotsb","\\cdots");L("\\dotsm","\\cdots");L("\\dotsi","\\!\\cdots");L("\\dotsx","\\ldots\\,");L("\\DOTSI","\\relax");L("\\DOTSB","\\relax");L("\\DOTSX","\\relax");L("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");L("\\,","\\tmspace+{3mu}{.1667em}");L("\\thinspace","\\,");L("\\>","\\mskip{4mu}");L("\\:","\\tmspace+{4mu}{.2222em}");L("\\medspace","\\:");L("\\;","\\tmspace+{5mu}{.2777em}");L("\\thickspace","\\;");L("\\!","\\tmspace-{3mu}{.1667em}");L("\\negthinspace","\\!");L("\\negmedspace","\\tmspace-{4mu}{.2222em}");L("\\negthickspace","\\tmspace-{5mu}{.277em}");L("\\enspace","\\kern.5em ");L("\\enskip","\\hskip.5em\\relax");L("\\quad","\\hskip1em\\relax");L("\\qquad","\\hskip2em\\relax");L("\\tag","\\@ifstar\\tag@literal\\tag@paren");L("\\tag@paren","\\tag@literal{({#1})}");L("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new De("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});L("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");L("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");L("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");L("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");L("\\newline","\\\\\\relax");L("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var iO=Ue(ga["Main-Regular"][84][1]-.7*ga["Main-Regular"][65][1]);L("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+iO+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");L("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+iO+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");L("\\hspace","\\@ifstar\\@hspacer\\@hspace");L("\\@hspace","\\hskip #1\\relax");L("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");L("\\ordinarycolon",":");L("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");L("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');L("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');L("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');L("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');L("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');L("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');L("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');L("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');L("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');L("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');L("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');L("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');L("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');L("∷","\\dblcolon");L("∹","\\eqcolon");L("≔","\\coloneqq");L("≕","\\eqqcolon");L("⩴","\\Coloneqq");L("\\ratio","\\vcentcolon");L("\\coloncolon","\\dblcolon");L("\\colonequals","\\coloneqq");L("\\coloncolonequals","\\Coloneqq");L("\\equalscolon","\\eqqcolon");L("\\equalscoloncolon","\\Eqqcolon");L("\\colonminus","\\coloneq");L("\\coloncolonminus","\\Coloneq");L("\\minuscolon","\\eqcolon");L("\\minuscoloncolon","\\Eqcolon");L("\\coloncolonapprox","\\Colonapprox");L("\\coloncolonsim","\\Colonsim");L("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");L("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");L("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");L("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");L("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");L("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");L("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");L("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");L("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");L("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");L("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");L("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");L("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");L("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");L("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");L("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");L("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");L("\\nleqq","\\html@mathml{\\@nleqq}{≰}");L("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");L("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");L("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");L("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");L("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");L("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");L("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");L("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");L("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");L("\\imath","\\html@mathml{\\@imath}{ı}");L("\\jmath","\\html@mathml{\\@jmath}{ȷ}");L("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");L("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");L("⟦","\\llbracket");L("⟧","\\rrbracket");L("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");L("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");L("⦃","\\lBrace");L("⦄","\\rBrace");L("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");L("⦵","\\minuso");L("\\darr","\\downarrow");L("\\dArr","\\Downarrow");L("\\Darr","\\Downarrow");L("\\lang","\\langle");L("\\rang","\\rangle");L("\\uarr","\\uparrow");L("\\uArr","\\Uparrow");L("\\Uarr","\\Uparrow");L("\\N","\\mathbb{N}");L("\\R","\\mathbb{R}");L("\\Z","\\mathbb{Z}");L("\\alef","\\aleph");L("\\alefsym","\\aleph");L("\\Alpha","\\mathrm{A}");L("\\Beta","\\mathrm{B}");L("\\bull","\\bullet");L("\\Chi","\\mathrm{X}");L("\\clubs","\\clubsuit");L("\\cnums","\\mathbb{C}");L("\\Complex","\\mathbb{C}");L("\\Dagger","\\ddagger");L("\\diamonds","\\diamondsuit");L("\\empty","\\emptyset");L("\\Epsilon","\\mathrm{E}");L("\\Eta","\\mathrm{H}");L("\\exist","\\exists");L("\\harr","\\leftrightarrow");L("\\hArr","\\Leftrightarrow");L("\\Harr","\\Leftrightarrow");L("\\hearts","\\heartsuit");L("\\image","\\Im");L("\\infin","\\infty");L("\\Iota","\\mathrm{I}");L("\\isin","\\in");L("\\Kappa","\\mathrm{K}");L("\\larr","\\leftarrow");L("\\lArr","\\Leftarrow");L("\\Larr","\\Leftarrow");L("\\lrarr","\\leftrightarrow");L("\\lrArr","\\Leftrightarrow");L("\\Lrarr","\\Leftrightarrow");L("\\Mu","\\mathrm{M}");L("\\natnums","\\mathbb{N}");L("\\Nu","\\mathrm{N}");L("\\Omicron","\\mathrm{O}");L("\\plusmn","\\pm");L("\\rarr","\\rightarrow");L("\\rArr","\\Rightarrow");L("\\Rarr","\\Rightarrow");L("\\real","\\Re");L("\\reals","\\mathbb{R}");L("\\Reals","\\mathbb{R}");L("\\Rho","\\mathrm{P}");L("\\sdot","\\cdot");L("\\sect","\\S");L("\\spades","\\spadesuit");L("\\sub","\\subset");L("\\sube","\\subseteq");L("\\supe","\\supseteq");L("\\Tau","\\mathrm{T}");L("\\thetasym","\\vartheta");L("\\weierp","\\wp");L("\\Zeta","\\mathrm{Z}");L("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");L("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");L("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");L("\\bra","\\mathinner{\\langle{#1}|}");L("\\ket","\\mathinner{|{#1}\\rangle}");L("\\braket","\\mathinner{\\langle{#1}\\rangle}");L("\\Bra","\\left\\langle#1\\right|");L("\\Ket","\\left|#1\\right\\rangle");var sO=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,a=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var u=p=>g=>{t&&(g.macros.set("|",a),i.length&&g.macros.set("\\|",l));var b=p;if(!p&&i.length){var y=g.future();y.text==="|"&&(g.popToken(),b=!0)}return{tokens:b?i:r,numArgs:0}};e.macros.set("|",u(!1)),i.length&&e.macros.set("\\|",u(!0));var d=e.consumeArg().tokens,h=e.expandTokens([...s,...d,...n]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};L("\\bra@ket",sO(!1));L("\\bra@set",sO(!0));L("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");L("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");L("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");L("\\angln","{\\angl n}");L("\\blue","\\textcolor{##6495ed}{#1}");L("\\orange","\\textcolor{##ffa500}{#1}");L("\\pink","\\textcolor{##ff00af}{#1}");L("\\red","\\textcolor{##df0030}{#1}");L("\\green","\\textcolor{##28ae7b}{#1}");L("\\gray","\\textcolor{gray}{#1}");L("\\purple","\\textcolor{##9d38bd}{#1}");L("\\blueA","\\textcolor{##ccfaff}{#1}");L("\\blueB","\\textcolor{##80f6ff}{#1}");L("\\blueC","\\textcolor{##63d9ea}{#1}");L("\\blueD","\\textcolor{##11accd}{#1}");L("\\blueE","\\textcolor{##0c7f99}{#1}");L("\\tealA","\\textcolor{##94fff5}{#1}");L("\\tealB","\\textcolor{##26edd5}{#1}");L("\\tealC","\\textcolor{##01d1c1}{#1}");L("\\tealD","\\textcolor{##01a995}{#1}");L("\\tealE","\\textcolor{##208170}{#1}");L("\\greenA","\\textcolor{##b6ffb0}{#1}");L("\\greenB","\\textcolor{##8af281}{#1}");L("\\greenC","\\textcolor{##74cf70}{#1}");L("\\greenD","\\textcolor{##1fab54}{#1}");L("\\greenE","\\textcolor{##0d923f}{#1}");L("\\goldA","\\textcolor{##ffd0a9}{#1}");L("\\goldB","\\textcolor{##ffbb71}{#1}");L("\\goldC","\\textcolor{##ff9c39}{#1}");L("\\goldD","\\textcolor{##e07d10}{#1}");L("\\goldE","\\textcolor{##a75a05}{#1}");L("\\redA","\\textcolor{##fca9a9}{#1}");L("\\redB","\\textcolor{##ff8482}{#1}");L("\\redC","\\textcolor{##f9685d}{#1}");L("\\redD","\\textcolor{##e84d39}{#1}");L("\\redE","\\textcolor{##bc2612}{#1}");L("\\maroonA","\\textcolor{##ffbde0}{#1}");L("\\maroonB","\\textcolor{##ff92c6}{#1}");L("\\maroonC","\\textcolor{##ed5fa6}{#1}");L("\\maroonD","\\textcolor{##ca337c}{#1}");L("\\maroonE","\\textcolor{##9e034e}{#1}");L("\\purpleA","\\textcolor{##ddd7ff}{#1}");L("\\purpleB","\\textcolor{##c6b9fc}{#1}");L("\\purpleC","\\textcolor{##aa87ff}{#1}");L("\\purpleD","\\textcolor{##7854ab}{#1}");L("\\purpleE","\\textcolor{##543b78}{#1}");L("\\mintA","\\textcolor{##f5f9e8}{#1}");L("\\mintB","\\textcolor{##edf2df}{#1}");L("\\mintC","\\textcolor{##e0e5cc}{#1}");L("\\grayA","\\textcolor{##f6f7f7}{#1}");L("\\grayB","\\textcolor{##f0f1f2}{#1}");L("\\grayC","\\textcolor{##e3e5e6}{#1}");L("\\grayD","\\textcolor{##d6d8da}{#1}");L("\\grayE","\\textcolor{##babec2}{#1}");L("\\grayF","\\textcolor{##888d93}{#1}");L("\\grayG","\\textcolor{##626569}{#1}");L("\\grayH","\\textcolor{##3b3e40}{#1}");L("\\grayI","\\textcolor{##21242c}{#1}");L("\\kaBlue","\\textcolor{##314453}{#1}");L("\\kaGreen","\\textcolor{##71B307}{#1}");var aO={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class ute{constructor(e,n,r){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=n,this.expansionCount=0,this.feed(e),this.macros=new ote(lte,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new $k(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 n,r,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new Ns("EOF",r.loc)),this.pushTokens(i),n.range(r,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var i=this.future(),s,a=0,l=0;do{if(s=this.popToken(),n.push(s),s.text==="{")++a;else if(s.text==="}"){if(--a,a===-1)throw new De("Extra }",s)}else if(s.text==="EOF")throw new De("Unexpected end of input in a macro argument, expected '"+(e&&r?e[l]:"}")+"'",s);if(e&&r)if((a===0||a===1&&e[l]==="{")&&s.text===e[l]){if(++l,l===e.length){n.splice(-l,l);break}}else l=0}while(a!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:s}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new De("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;i<r.length;i++){var s=this.popToken();if(r[i]!==s.text)throw new De("Use of the macro doesn't match its definition",s)}}for(var a=[],l=0;l<e;l++)a.push(this.consumeArg(n&&n[l+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new De("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||e&&i.unexpandable){if(e&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new De("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var s=i.tokens,a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var l=s.length-1;l>=0;--l){var u=s[l];if(u.text==="#"){if(l===0)throw new De("Incomplete placeholder at end of macro body",u);if(u=s[--l],u.text==="#")s.splice(l+1,1);else if(/^[1-9]$/.test(u.text))s.splice(l,2,...a[+u.text-1]);else throw new De("Not a valid argument number",u)}}}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 Ns(e)]):void 0}expandTokens(e){var n=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var a=i.replace(/##/g,"");a.indexOf("#"+(s+1))!==-1;)++s;for(var l=new $k(i,this.settings),u=[],d=l.lex();d.text!=="EOF";)u.push(d),d=l.lex();u.reverse();var h={tokens:u,numArgs:s};return h}return i}isDefined(e){return this.macros.has(e)||yl.hasOwnProperty(e)||Nn.math.hasOwnProperty(e)||Nn.text.hasOwnProperty(e)||aO.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:yl.hasOwnProperty(e)&&!yl[e].primitive}}var Gk=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Sm=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),I2={"́":{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"}},Yk={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class lb{constructor(e,n){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 ute(e,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new De("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());n&&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 n=this.nextToken;this.consume(),this.gullet.pushToken(new Ns("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(lb.endOfExpression.indexOf(i.text)!==-1||n&&i.text===n||e&&yl[i.text]&&yl[i.text].infix)break;var s=this.parseAtom(n);if(s){if(s.type==="internal")continue}else break;r.push(s)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var n=-1,r,i=0;i<e.length;i++)if(e[i].type==="infix"){if(n!==-1)throw new De("only one infix operator per group",e[i].token);n=i,r=e[i].replaceWith}if(n!==-1&&r){var s,a,l=e.slice(0,n),u=e.slice(n+1);l.length===1&&l[0].type==="ordgroup"?s=l[0]:s={type:"ordgroup",mode:this.mode,body:l},u.length===1&&u[0].type==="ordgroup"?a=u[0]:a={type:"ordgroup",mode:this.mode,body:u};var d;return r==="\\\\abovefrac"?d=this.callFunction(r,[s,e[n],a],[]):d=this.callFunction(r,[s,a],[]),[d]}else return e}handleSupSubscript(e){var n=this.fetch(),r=n.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 De("Expected group after '"+r+"'",n);return i}formatUnsupportedCmd(e){for(var n=[],r=0;r<e.length;r++)n.push({type:"textord",mode:"text",text:e[r]});var i={type:"text",mode:this.mode,body:n},s={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return s}parseAtom(e){var n=this.parseGroup("atom",e);if((n==null?void 0:n.type)==="internal"||this.mode==="text")return n;for(var r,i;;){this.consumeSpaces();var s=this.fetch();if(s.text==="\\limits"||s.text==="\\nolimits"){if(n&&n.type==="op"){var a=s.text==="\\limits";n.limits=a,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=s.text==="\\limits");else throw new De("Limit controls must follow a math operator",s);this.consume()}else if(s.text==="^"){if(r)throw new De("Double superscript",s);r=this.handleSupSubscript("superscript")}else if(s.text==="_"){if(i)throw new De("Double subscript",s);i=this.handleSupSubscript("subscript")}else if(s.text==="'"){if(r)throw new De("Double superscript",s);var l={type:"textord",mode:this.mode,text:"\\prime"},u=[l];for(this.consume();this.fetch().text==="'";)u.push(l),this.consume();this.fetch().text==="^"&&u.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:u}}else if(Sm[s.text]){var d=Gk.test(s.text),h=[];for(h.push(new Ns(Sm[s.text])),this.consume();;){var p=this.fetch().text;if(!Sm[p]||Gk.test(p)!==d)break;h.unshift(new Ns(Sm[p])),this.consume()}var g=this.subparse(h);d?i={type:"ordgroup",mode:"math",body:g}:r={type:"ordgroup",mode:"math",body:g}}else break}return r||i?{type:"supsub",mode:this.mode,base:n,sup:r,sub:i}:n}parseFunction(e,n){var r=this.fetch(),i=r.text,s=yl[i];if(!s)return null;if(this.consume(),n&&n!=="atom"&&!s.allowedInArgument)throw new De("Got function '"+i+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!s.allowedInText)throw new De("Can't use function '"+i+"' in text mode",r);if(this.mode==="math"&&s.allowedInMath===!1)throw new De("Can't use function '"+i+"' in math mode",r);var{args:a,optArgs:l}=this.parseArguments(i,s);return this.callFunction(i,a,l,r,e)}callFunction(e,n,r,i,s){var a={funcName:e,parser:this,token:i,breakOnTokenText:s},l=yl[e];if(l&&l.handler)return l.handler(a,n,r);throw new De("No function handler for "+e)}parseArguments(e,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var i=[],s=[],a=0;a<r;a++){var l=n.argTypes&&n.argTypes[a],u=a<n.numOptionalArgs;(n.primitive&&l==null||n.type==="sqrt"&&a===1&&s[0]==null)&&(l="primitive");var d=this.parseGroupOfType("argument to '"+e+"'",l,u);if(u)s.push(d);else if(d!=null)i.push(d);else throw new De("Null argument, please report this as a bug")}return{args:i,optArgs:s}}parseGroupOfType(e,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var i=this.parseArgumentGroup(r,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var s=this.parseStringGroup("raw",r);return s!=null?{type:"raw",mode:"text",string:s.text}:null}case"primitive":{if(r)throw new De("A primitive argument cannot be optional");var a=this.parseGroup(e);if(a==null)throw new De("Expected group as "+e,this.fetch());return a}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new De("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var i="",s;(s=this.fetch()).text!=="EOF";)i+=s.text,this.consume();return this.consume(),r.text=i,r}parseRegexGroup(e,n){for(var r=this.fetch(),i=r,s="",a;(a=this.fetch()).text!=="EOF"&&e.test(s+a.text);)i=a,s+=i.text,this.consume();if(s==="")throw new De("Invalid "+n+": '"+r.text+"'",r);return r.range(i,s)}parseColorGroup(e){var n=this.parseStringGroup("color",e);if(n==null)return null;var r=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new De("Invalid color: '"+n.text+"'",n);var i=r[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var n,r=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",e),!n)return null;!e&&n.text.length===0&&(n.text="0pt",r=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!i)throw new De("Invalid size: '"+n.text+"'",n);var s={number:+(i[1]+i[2]),unit:i[3]};if(!gM(s))throw new De("Invalid unit: '"+s.unit+"'",n);return{type:"size",mode:this.mode,value:s,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,n){var r=this.gullet.scanArgument(e);if(r==null)return null;var i=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var s=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var a={type:"ordgroup",mode:this.mode,loc:r.loc,body:s};return n&&this.switchMode(i),a}parseGroup(e,n){var r=this.fetch(),i=r.text,s;if(i==="{"||i==="\\begingroup"){this.consume();var a=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var l=this.parseExpression(!1,a),u=this.fetch();this.expect(a),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:rs.range(r,u),body:l,semisimple:i==="\\begingroup"||void 0}}else if(s=this.parseFunction(n,e)||this.parseSymbol(),s==null&&i[0]==="\\"&&!aO.hasOwnProperty(i)){if(this.settings.throwOnError)throw new De("Undefined control sequence: "+i,r);s=this.formatUnsupportedCmd(i),this.consume()}return s}formLigatures(e){for(var n=e.length-1,r=0;r<n;++r){var i=e[r],s=i.text;s==="-"&&e[r+1].text==="-"&&(r+1<n&&e[r+2].text==="-"?(e.splice(r,3,{type:"textord",mode:"text",loc:rs.range(i,e[r+2]),text:"---"}),n-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:rs.range(i,e[r+1]),text:"--"}),n-=1)),(s==="'"||s==="`")&&e[r+1].text===s&&(e.splice(r,2,{type:"textord",mode:"text",loc:rs.range(i,e[r+1]),text:s+s}),n-=1)}}parseSymbol(){var e=this.fetch(),n=e.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),i=r.charAt(0)==="*";if(i&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new De(`\\verb assertion failed --
                    please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:i}}Yk.hasOwnProperty(n[0])&&!Nn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=Yk[n[0]]+n.slice(1));var s=ste.exec(n);s&&(n=n.substring(0,s.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var a;if(Nn[this.mode][n]){this.settings.strict&&this.mode==="math"&&h4.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var l=Nn[this.mode][n].group,u=rs.range(e),d;if(QJ.hasOwnProperty(l)){var h=l;d={type:"atom",mode:this.mode,family:h,loc:u,text:n}}else d={type:l,mode:this.mode,loc:u,text:n};a=d}else if(n.charCodeAt(0)>=128)this.settings.strict&&(pM(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:rs.range(e),text:n};else return null;if(this.consume(),s)for(var p=0;p<s[0].length;p++){var g=s[0][p];if(!I2[g])throw new De("Unknown accent ' "+g+"'",e);var b=I2[g][this.mode]||I2[g].text;if(!b)throw new De("Accent "+g+" unsupported in "+this.mode+" mode",e);a={type:"accent",mode:this.mode,loc:rs.range(e),label:b,isStretchy:!1,isShifty:!0,base:a}}return a}}lb.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var N_=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new lb(e,n);delete r.gullet.macros.current["\\df@tag"];var i=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new De("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:r.subparse([new Ns("\\df@tag")])}]}return i},oO=function(e,n,r){n.textContent="";var i=M_(e,r).toNode();n.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."),oO=function(){throw new De("KaTeX doesn't work in quirks mode.")});var cte=function(e,n){var r=M_(e,n).toMarkup();return r},dte=function(e,n){var r=new d_(n);return N_(e,r)},lO=function(e,n,r){if(r.throwOnError||!(e instanceof De))throw e;var i=ce.makeSpan(["katex-error"],[new Ls(n)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+r.errorColor),i},M_=function(e,n){var r=new d_(n);try{var i=N_(e,r);return Eee(i,e,r)}catch(s){return lO(s,e,r)}},fte=function(e,n){var r=new d_(n);try{var i=N_(e,r);return _ee(i,e,r)}catch(s){return lO(s,e,r)}},hte="0.16.22",pte={Span:Rh,Anchor:p_,SymbolNode:Ls,SvgNode:vo,PathNode:Rl,LineNode:f4},Wk={version:hte,render:oO,renderToString:cte,ParseError:De,SETTINGS_SCHEMA:ng,__parse:dte,__renderToDomTree:M_,__renderToHTMLTree:fte,__setFontMetrics:$J,__defineSymbol:w,__defineFunction:Ge,__defineMacro:L,__domTree:pte};const mte={},gte=[];function bte(t){const e=t||mte;return function(n,r){Q3(n,"element",function(i,s){const a=Array.isArray(i.properties.className)?i.properties.className:gte,l=a.includes("language-math"),u=a.includes("math-display"),d=a.includes("math-inline");let h=u;if(!l&&!u&&!d)return;let p=s[s.length-1],g=i;if(i.tagName==="code"&&l&&p&&p.type==="element"&&p.tagName==="pre"&&(g=p,p=s[s.length-2],h=!0),!p)return;const b=qN(g,{whitespace:"pre"});let y;try{y=Wk.renderToString(b,{...e,displayMode:h,throwOnError:!0})}catch(T){const S=T,A=S.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...s,i],cause:S,place:i.position,ruleId:A,source:"rehype-katex"});try{y=Wk.renderToString(b,{...e,displayMode:h,strict:"ignore",throwOnError:!1})}catch{y=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(T)},children:[{type:"text",value:b}]}]}}typeof y=="string"&&(y=hJ(y).children);const E=p.children.indexOf(g);return p.children.splice(E,1,...y),S9})}}function vte(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:s},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:a,mathTextData:l}};function t(u){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},u)}function e(){this.buffer()}function n(){const u=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=u}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(u){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(u),h.value=d;const p=h.data.hChildren[0];p.type,p.tagName,p.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function s(u){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},u),this.buffer()}function a(u){const d=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(u),h.value=d,h.data.hChildren.push({type:"text",value:d})}function l(u){this.config.enter.data.call(this,u),this.config.exit.data.call(this,u)}}function yte(t){let e=(t||{}).singleDollarTextMath;return e==null&&(e=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(s,a,l,u){const d=s.value||"",h=l.createTracker(u),p="$".repeat(Math.max(O9(d,"$")+1,2)),g=l.enter("mathFlow");let b=h.move(p);if(s.meta){const y=l.enter("mathFlowMeta");b+=h.move(l.safe(s.meta,{after:`
`,before:b,encode:["$"],...h.current()})),y()}return b+=h.move(`
`),d&&(b+=h.move(d+`
`)),b+=h.move(p),g(),b}function r(s,a,l){let u=s.value||"",d=1;for(e||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(u);)d++;const h="$".repeat(d);/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^\$|\$$/.test(u))&&(u=" "+u+" ");let p=-1;for(;++p<l.unsafe.length;){const g=l.unsafe[p];if(!g.atBreak)continue;const b=l.compilePattern(g);let y;for(;y=b.exec(u);){let E=y.index;u.codePointAt(E)===10&&u.codePointAt(E-1)===13&&E--,u=u.slice(0,E)+" "+u.slice(y.index+1)}}return h+u+h}function i(){return"$"}}const Ete={tokenize:_te,concrete:!0,name:"mathFlow"},Kk={tokenize:xte,partial:!0};function _te(t,e,n){const r=this,i=r.events[r.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let a=0;return l;function l(A){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),u(A)}function u(A){return A===36?(t.consume(A),a++,u):a<2?n(A):(t.exit("mathFlowFenceSequence"),zt(t,d,"whitespace")(A))}function d(A){return A===null||it(A)?p(A):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),h(A))}function h(A){return A===null||it(A)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),p(A)):A===36?n(A):(t.consume(A),h)}function p(A){return t.exit("mathFlowFence"),r.interrupt?e(A):t.attempt(Kk,g,T)(A)}function g(A){return t.attempt({tokenize:S,partial:!0},T,b)(A)}function b(A){return(s?zt(t,y,"linePrefix",s+1):y)(A)}function y(A){return A===null?T(A):it(A)?t.attempt(Kk,g,T)(A):(t.enter("mathFlowValue"),E(A))}function E(A){return A===null||it(A)?(t.exit("mathFlowValue"),y(A)):(t.consume(A),E)}function T(A){return t.exit("mathFlow"),e(A)}function S(A,R,z){let I=0;return zt(A,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function P(Z){return A.enter("mathFlowFence"),A.enter("mathFlowFenceSequence"),$(Z)}function $(Z){return Z===36?(I++,A.consume(Z),$):I<a?z(Z):(A.exit("mathFlowFenceSequence"),zt(A,K,"whitespace")(Z))}function K(Z){return Z===null||it(Z)?(A.exit("mathFlowFence"),R(Z)):z(Z)}}}function xte(t,e,n){const r=this;return i;function i(a){return a===null?e(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function Tte(t){let n=(t||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:Ste,previous:wte,name:"mathText"};function r(i,s,a){let l=0,u,d;return h;function h(E){return i.enter("mathText"),i.enter("mathTextSequence"),p(E)}function p(E){return E===36?(i.consume(E),l++,p):l<2&&!n?a(E):(i.exit("mathTextSequence"),g(E))}function g(E){return E===null?a(E):E===36?(d=i.enter("mathTextSequence"),u=0,y(E)):E===32?(i.enter("space"),i.consume(E),i.exit("space"),g):it(E)?(i.enter("lineEnding"),i.consume(E),i.exit("lineEnding"),g):(i.enter("mathTextData"),b(E))}function b(E){return E===null||E===32||E===36||it(E)?(i.exit("mathTextData"),g(E)):(i.consume(E),b)}function y(E){return E===36?(i.consume(E),u++,y):u===l?(i.exit("mathTextSequence"),i.exit("mathText"),s(E)):(d.type="mathTextData",b(E))}}}function Ste(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[n][1].type="mathTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="mathTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function wte(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function kte(t){return{flow:{36:Ete},text:{36:Tte(t)}}}const Cte={};function Ate(t){const e=this,n=t||Cte,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kte(n)),s.push(vte()),a.push(yte(n))}const Nte=({children:t,className:e,node:n,inline:r,...i})=>{const[s,a]=U.useState(!1),l=U.useRef(null),u=async()=>{var g;try{const b=((g=l.current)==null?void 0:g.textContent)||"";await navigator.clipboard.writeText(b),a(!0),setTimeout(()=>a(!1),2e3)}catch(b){console.error("Failed to copy code:",b)}},d=g=>{var b;return typeof g=="string"?g:Array.isArray(g)?g.map(d).join(""):(b=g==null?void 0:g.props)!=null&&b.children?d(g.props.children):""},h=d(t);return r||!h.includes(`
`)?C.jsx("code",{className:e,...i,children:t}):C.jsxs("div",{className:"relative group",children:[C.jsx("button",{onClick:u,className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium text-gray-600 hover:text-gray-900 bg-white hover:bg-gray-50 border border-gray-200 rounded-md shadow-sm z-10",title:"Copy code",children:s?C.jsxs(C.Fragment,{children:[C.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("polyline",{points:"20 6 9 17 4 12"})}),C.jsx("span",{children:"Copied!"})]}):C.jsx(C.Fragment,{children:C.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),C.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}),C.jsx("code",{ref:l,className:e,...i,children:t})]})},Mte=({children:t})=>C.jsx("div",{className:"not-prose",children:t}),Ote=({href:t,onSend:e,...n})=>{const r=U.useCallback(i=>{e(decodeURIComponent(t.slice(23))),i.preventDefault()},[t,e]);return t.startsWith("https://cycls.com/send/")?C.jsx("a",{...n,className:n.className||"underline decoration-[var(--text-tertiary)]/40 decoration-2 hover:decoration-[var(--text-tertiary)]/60",href:"#",onClick:r}):C.jsx("a",{...n,href:t,target:"_blank",rel:"noreferrer"})},Rte=({children:t,...e})=>{const n=U.useRef(null),[r,i]=U.useState(!1),s=U.useCallback(()=>{try{if(!n.current)return;const l=[],u=n.current,d=Array.from(u.querySelectorAll("thead th")).map(T=>{var S;return((S=T.textContent)==null?void 0:S.trim())||""});d.length>0&&l.push(d),Array.from(u.querySelectorAll("tbody tr")).forEach(T=>{const S=Array.from(T.querySelectorAll("td")).map(A=>{var R;return((R=A.textContent)==null?void 0:R.trim())||""});S.length>0&&l.push(S)});const p=l.map(T=>T.map(S=>{const A=String(S);return A.includes(",")||A.includes('"')||A.includes(`
`)?`"${A.replace(/"/g,'""')}"`:A}).join(",")).join(`
`),g="\uFEFF",b=new Blob([g+p],{type:"text/csv;charset=utf-8;"}),y=window.URL.createObjectURL(b),E=document.createElement("a");E.href=y,E.download=`table-export-${Date.now()}.csv`,document.body.appendChild(E),E.click(),document.body.removeChild(E),window.URL.revokeObjectURL(y)}catch(l){console.error("Failed to export table as CSV:",l)}},[]),a=U.useCallback(async()=>{try{if(!n.current)return;const l=[],u=n.current,d=Array.from(u.querySelectorAll("thead th")).map(p=>{var g;return((g=p.textContent)==null?void 0:g.trim())||""});d.length>0&&l.push(d.join("	")),Array.from(u.querySelectorAll("tbody tr")).forEach(p=>{const g=Array.from(p.querySelectorAll("td")).map(b=>{var y;return((y=b.textContent)==null?void 0:y.trim())||""});g.length>0&&l.push(g.join("	"))}),await navigator.clipboard.writeText(l.join(`
`)),i(!0),setTimeout(()=>i(!1),2e3)}catch(l){console.error("Failed to copy table:",l)}},[]);return C.jsxs("div",{className:"table-wrapper",children:[C.jsx("table",{ref:n,...e,children:t}),C.jsxs("div",{className:"!-mt-2",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",marginTop:"8px",borderRadius:"8px",backgroundColor:"var(--bg-secondary)",border:"1px solid var(--border-primary)"},children:[C.jsxs("button",{onClick:s,style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer",padding:"0"},"aria-label":"Export table as CSV",children:[C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),C.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),C.jsx("line",{x1:"3",y1:"15",x2:"21",y2:"15"}),C.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),C.jsx("line",{x1:"15",y1:"3",x2:"15",y2:"21"})]}),C.jsx("span",{children:"Export as CSV"})]}),C.jsx("button",{onClick:a,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px",borderRadius:"4px",background:"none",border:"none",cursor:"pointer",color:r?"var(--text-success, #22c55e)":"var(--text-tertiary)"},title:r?"Copied!":"Copy table","aria-label":"Copy table",children:r?C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("polyline",{points:"20 6 9 17 4 12"})}):C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),C.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},Lu=le.memo(({markdown:t,onSend:e})=>{const n=U.useMemo(()=>({raw:Mte,a:r=>C.jsx(Ote,{...r,onSend:e}),code:Nte,table:Rte}),[e]);return C.jsx("div",{dir:"auto",children:C.jsx(UV,{components:n,remarkPlugins:[ZY,Ate],rehypePlugins:[vQ,bte,[sJ,{ignoreMissing:!0,detect:!0}]],children:(t==null?void 0:t.replace(/[\u200B-\u200D\uFEFF]/g,""))??""})})});Lu.displayName="MarkdownRenderer";const lo={MAX_FILE_BYTES:10*1024*1024,ALLOWED_MIME:new Set(["image/jpeg","image/png","image/webp","application/pdf","text/plain","text/markdown","text/csv","video/mp4","video/webm","video/ogg","video/quicktime"]),MAX_CHATS:15};function Zf(t){const e=/<!--\s*cycls:attachments\s*([\s\S]*?)\s*cycls:attachments\s*-->/m,n=t.match(e);if(!n)return{clean:t,attachments:[]};let r=[];try{r=JSON.parse(n[1])}catch{r=[]}return{clean:t.replace(e,"").trimEnd(),attachments:r}}function Dte(t){return t?t.startsWith("image/")?"image":t.startsWith("video/")?"video":t==="application/pdf"?"pdf":t==="text/csv"?"csv":t==="text/markdown"?"md":t==="text/plain"?"txt":"file":"file"}async function Ite(t,e){if(t.size>lo.MAX_FILE_BYTES)throw new Error("File too large (max 10MB)");if(!lo.ALLOWED_MIME.has(t.type))throw new Error(`Type not allowed: ${t.type}`);const n=new FormData;n.append("file",t);const r={};if(e){const a=await e({template:"template"});a&&(r.Authorization=`Bearer ${a}`)}const i=await fetch("/attachments",{method:"POST",headers:r,body:n});if(!i.ok)throw new Error(`Upload failed (${i.status})`);const s=await i.json();return{name:t.name,url:s.url,mime:t.type,size:t.size}}async function uO(t,e){const n={};if(e){const s=await e({template:"template"});s&&(n.Authorization=`Bearer ${s}`)}const r=await fetch(t,{headers:n});if(!r.ok)throw new Error(`Download failed (${r.status})`);const i=await r.blob();return URL.createObjectURL(i)}const Mg=t=>t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(2)}kB`:`${(t/(1024*1024)).toFixed(2)}MB`,Lte=t=>{if(t.size>lo.MAX_FILE_BYTES)return{valid:!1,error:`File "${t.name}" is too large (${Mg(t.size)}). Maximum size is ${Mg(lo.MAX_FILE_BYTES)}.`};if(!lo.ALLOWED_MIME.has(t.type)){const e=Array.from(lo.ALLOWED_MIME).map(n=>n.split("/")[1]).join(", ");return{valid:!1,error:`File type "${t.type}" is not supported. Allowed types: ${e}`}}return{valid:!0}},cO=U.createContext(null),dO=()=>U.useContext(cO),Af=new Map,Nf=new Map;function Pte(t){Nf.set(t,(Nf.get(t)||0)+1)}function Bte(t){const e=(Nf.get(t)||1)-1;if(e<=0){Nf.delete(t);const n=Af.get(t);n&&(URL.revokeObjectURL(n),Af.delete(t))}else Nf.set(t,e)}function zte(t,e){const[n,r]=U.useState(null),[i,s]=U.useState(!1),[a,l]=U.useState(null),u=U.useRef(t);return U.useEffect(()=>{if(!t){r(null);return}if(u.current=t,Pte(t),Af.has(t)){r(Af.get(t));return}let d=!1;return s(!0),l(null),uO(t,e).then(h=>{if(d){URL.revokeObjectURL(h);return}Af.set(t,h),r(h),s(!1)}).catch(h=>{d||(l(h.message),s(!1))}),()=>{d=!0,Bte(u.current)}},[t,e]),{blobUrl:n,loading:i,error:a}}const Fte=({url:t,alt:e=""})=>{const n=dO(),{blobUrl:r,loading:i,error:s}=zte(t,n);return i?C.jsx("div",{className:"w-40 h-28 rounded-md bg-[var(--bg-secondary)] animate-pulse flex items-center justify-center",children:C.jsx("span",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:"Loading..."})}):s||!r?C.jsx("div",{className:"w-40 h-28 rounded-md bg-[var(--bg-secondary)] flex items-center justify-center",children:C.jsx("span",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:"Failed to load"})}):C.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"group relative overflow-hidden rounded-lg shadow-sm transition-all duration-200 theme-transition",style:{border:"1px solid var(--border-primary)"},children:C.jsx("img",{src:r,alt:e,loading:"lazy",className:"mb-1 w-40 rounded-md"})})},Ute=({url:t,kind:e})=>{const n=dO(),r=async s=>{s.preventDefault();try{const a=await uO(t,n);window.open(a,"_blank")}catch(a){console.error("Failed to download file:",a)}},i={pdf:"📄",csv:"📊",md:"📝",txt:"📝",video:"🎬"}[e]||"📎";return C.jsxs("button",{onClick:r,className:"inline-flex items-center gap-2.5 rounded-xl backdrop-blur-sm px-4 py-2.5 text-sm transition-all shadow-sm hover:bg-[var(--bg-hover)] theme-transition cursor-pointer",style:{border:"1px solid var(--border-primary)",backgroundColor:"var(--bg-primary)"},children:[C.jsx("span",{className:"text-xl",children:i}),C.jsx("span",{className:"text-xs uppercase font-semibold tracking-wide",style:{color:"var(--text-tertiary)"},children:e||"file"})]})},Hte=({attachments:t=[]})=>t.length?C.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:t.map((e,n)=>{const r=Dte(e.mime);return r==="image"?C.jsx(Fte,{url:e.url,alt:e.name||""},n):C.jsx(Ute,{url:e.url,kind:r},n)})}):null,jte=({error:t,onRetry:e,isRetrying:n})=>{const r=i=>i?i.type==="network"?"Network error. Please check your connection and try again.":i.type==="timeout"?"Request timed out. The server took too long to respond.":i.type==="rate_limit"?i.message||"Too many requests. Please wait a moment and try again.":i.type==="server"?`Server error (${i.status||"unknown"}). Please try again later.`:i.type==="abort"?"Request was cancelled.":i.message||"An error occurred while processing your request.":"An unexpected error occurred";return C.jsx("div",{className:"rounded-lg p-4 my-2 theme-transition",style:{backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)"},children:C.jsxs("div",{className:"flex items-start gap-3",children:[C.jsx("div",{className:"flex-shrink-0 mt-0.5",children:C.jsxs("svg",{className:"h-5 w-5 text-red-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[C.jsx("circle",{cx:"12",cy:"12",r:"10"}),C.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),C.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"text-sm font-medium text-red-500",children:"Error"}),C.jsx("p",{className:"text-sm mt-1",style:{color:"var(--text-secondary)"},children:r(t)}),e&&t.type!=="abort"&&C.jsx("button",{onClick:e,disabled:n,className:"mt-3 inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-red-500 hover:text-red-400 border border-red-500/30 hover:border-red-500/50 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed theme-transition",style:{backgroundColor:"var(--bg-primary)"},children:n?C.jsxs(C.Fragment,{children:[C.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[C.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),C.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),C.jsx("span",{children:"Retrying..."})]}):C.jsxs(C.Fragment,{children:[C.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("polyline",{points:"23 4 23 10 17 10"}),C.jsx("polyline",{points:"1 20 1 14 7 14"}),C.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]}),C.jsx("span",{children:"Retry"})]})})]})]})})},$te=({message:t,onCopy:e,onRegenerate:n,isLastAssistant:r})=>{const[i,s]=U.useState(!1),a=async()=>{try{const{clean:l}=Zf(t.content);await navigator.clipboard.writeText(l),s(!0),setTimeout(()=>s(!1),2e3)}catch(l){console.error("Failed to copy:",l)}};return C.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:[C.jsx("button",{onClick:a,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-lg transition-colors hover:bg-[var(--bg-hover)] theme-transition",style:{color:"var(--text-tertiary)"},title:"Copy message",children:i?C.jsxs(C.Fragment,{children:[C.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("polyline",{points:"20 6 9 17 4 12"})}),C.jsx("span",{children:"Copied!"})]}):C.jsxs(C.Fragment,{children:[C.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),C.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),C.jsx("span",{children:"Copy"})]})}),r&&C.jsxs("button",{onClick:n,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-lg transition-colors hover:bg-[var(--bg-hover)] theme-transition",style:{color:"var(--text-tertiary)"},title:"Regenerate response",children:[C.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("polyline",{points:"23 4 23 10 17 10"}),C.jsx("polyline",{points:"1 20 1 14 7 14"}),C.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]}),C.jsx("span",{children:"Regenerate"})]})]})},Mf={isOpen:!1,title:"",content:"",isStreaming:!1,isDone:!1,canvasType:"document"},zi={OPEN:"OPEN",OPEN_EXISTING:"OPEN_EXISTING",CLOSE:"CLOSE",APPEND_CONTENT:"APPEND_CONTENT",UPDATE_CONTENT:"UPDATE_CONTENT",DONE:"DONE",RESET:"RESET"};function qte(t,e){var n,r,i,s,a,l;switch(e.type){case zi.OPEN:return{...Mf,isOpen:!0,title:((n=e.payload)==null?void 0:n.title)||"Untitled",content:((r=e.payload)==null?void 0:r.content)||"",isStreaming:!0,isDone:!1,canvasType:((i=e.payload)==null?void 0:i.canvasType)||"document"};case zi.OPEN_EXISTING:return{...Mf,isOpen:!0,title:((s=e.payload)==null?void 0:s.title)||"Untitled",content:((a=e.payload)==null?void 0:a.content)||"",isStreaming:!1,isDone:!0,canvasType:((l=e.payload)==null?void 0:l.canvasType)||"document"};case zi.CLOSE:return{...t,isOpen:!1};case zi.APPEND_CONTENT:return{...t,content:t.content+(e.payload||"")};case zi.UPDATE_CONTENT:return{...t,content:e.payload||""};case zi.DONE:return{...t,isStreaming:!1,isDone:!0};case zi.RESET:return Mf;default:return t}}const fO=U.createContext({state:Mf,dispatch:()=>{},openCanvas:()=>{},openExistingCanvas:()=>{},closeCanvas:()=>{},appendContent:()=>{},updateContent:()=>{},markDone:()=>{},resetCanvas:()=>{}}),Dd=()=>U.useContext(fO),Vte=({children:t})=>{const[e,n]=U.useReducer(qte,Mf),r=U.useCallback(p=>{n({type:zi.OPEN,payload:p})},[]),i=U.useCallback(p=>{n({type:zi.OPEN_EXISTING,payload:p})},[]),s=U.useCallback(()=>{n({type:zi.CLOSE})},[]),a=U.useCallback(p=>{n({type:zi.APPEND_CONTENT,payload:p})},[]),l=U.useCallback(p=>{n({type:zi.UPDATE_CONTENT,payload:p})},[]),u=U.useCallback(()=>{n({type:zi.DONE})},[]),d=U.useCallback(()=>{n({type:zi.RESET})},[]),h=U.useMemo(()=>({state:e,dispatch:n,openCanvas:r,openExistingCanvas:i,closeCanvas:s,appendContent:a,updateContent:l,markDone:u,resetCanvas:d}),[e,r,i,s,a,l,u,d]);return C.jsx(fO.Provider,{value:h,children:t})},O_=(...t)=>t.filter(Boolean).join(" ");function y4({isOpen:t}){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:O_("transition-transform duration-200",t?"rotate-180":"rotate-0"),children:C.jsx("path",{d:"M6 9l6 6 6-6"})})}function Gte(){return C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-tertiary)"},children:[C.jsx("circle",{cx:"12",cy:"12",r:"10"}),C.jsx("path",{d:"M2 12h20"}),C.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}function Yte(){return C.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:"var(--text-tertiary)"}})}function Wte(){return C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),C.jsx("polyline",{points:"14 2 14 8 20 8"}),C.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),C.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),C.jsx("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]})}function Kte(){return C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),C.jsx("polyline",{points:"15 3 21 3 21 9"}),C.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}function Xte({title:t,content:e,isComplete:n}){const{openExistingCanvas:r}=Dd(),i=le.useCallback(()=>{r({title:t||"Untitled",content:e||""})},[t,e,r]);return C.jsx("div",{className:"my-3 rounded-lg border",style:{borderColor:"var(--border-primary)"},children:C.jsxs("button",{type:"button",onClick:i,className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-left rounded-lg transition-colors hover:bg-[var(--bg-hover)]",children:[C.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[C.jsx("div",{className:"flex-shrink-0",style:{color:"var(--text-secondary)"},children:C.jsx(Wte,{})}),C.jsxs("div",{className:"min-w-0",children:[C.jsx("span",{className:"text-sm font-medium truncate block",style:{color:"var(--text-primary)"},children:t||"Untitled Document"}),C.jsx("span",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:n?"Click to view document":"Generating..."})]})]}),C.jsxs("div",{className:"flex-shrink-0 flex items-center gap-1",style:{color:"var(--text-tertiary)"},children:[C.jsx("span",{className:"text-xs",children:"Open"}),C.jsx(Kte,{})]})]})})}function Qte({src:t,alt:e}){const[n,r]=le.useState(!1),i=le.useCallback(async()=>{try{const a=await(await fetch(t)).blob(),l=window.URL.createObjectURL(a),u=document.createElement("a");u.href=l,u.download=e||"image",document.body.appendChild(u),u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(l)}catch(s){console.error("Failed to download image:",s)}},[t,e]);return C.jsxs("div",{className:"relative md:w-[60%] inline-block group",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[C.jsx("img",{src:t,alt:e||""}),n&&C.jsx("button",{onClick:i,className:"absolute top-6 right-2 p-2 rounded-lg transition-all duration-200",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)",color:"var(--text-primary)",boxShadow:"var(--shadow-md)"},title:"Download image","aria-label":"Download image",children:C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),C.jsx("polyline",{points:"7 10 12 15 17 10"}),C.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}function Zte(t){if(t<60)return`${t}s`;const e=Math.floor(t/60),n=t%60;return`${e}m ${n}s`}function Jte({thinking:t,onSend:e,isActive:n,startTime:r,duration:i}){const[s,a]=le.useState(!1),[l,u]=le.useState(()=>i??(r&&!n?Math.round((Date.now()-r)/1e3):0));return le.useEffect(()=>{if(i!=null){u(i);return}if(!n)return;r&&u(Math.round((Date.now()-r)/1e3));const d=setInterval(()=>{r&&u(Math.round((Date.now()-r)/1e3))},1e3);return()=>clearInterval(d)},[n,r,i]),C.jsxs("div",{className:"my-3 rounded-lg border",style:{borderColor:"var(--border-primary)"},children:[C.jsxs("button",{type:"button",onClick:()=>a(d=>!d),className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-left rounded-2xl transition-colors",style:{color:"var(--text-secondary)"},children:[C.jsx("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Thinking"}),C.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(l>0||n)&&C.jsx("span",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:Zte(l)}),C.jsx("span",{style:{color:"var(--text-tertiary)"},children:C.jsx(y4,{isOpen:s})})]})]}),s&&C.jsx("div",{className:"px-4 pb-0",style:{borderTop:"1px solid var(--border-primary)"},children:C.jsx("div",{className:"mt-3 prose prose-sm max-w-none",style:{color:"var(--text-tertiary)"},children:C.jsx(Lu,{markdown:t,onSend:e})})})]})}function ene({steps:t,onSend:e}){const[n,r]=le.useState(!1),[i,s]=le.useState({});if(!t||t.length===0)return null;const a=2,l=n?0:Math.max(0,t.length-a),u=n?t:t.slice(-a),d=p=>{s(g=>({...g,[p]:!g[p]}))},h=p=>p.result||p.type==="search"||p.step&&(p.step.toLowerCase().includes("search")||p.step.toLowerCase().includes("fetch"));return C.jsxs("div",{className:"my-3 rounded-lg border",style:{borderColor:"var(--border-primary)"},children:[C.jsxs("button",{type:"button",onClick:()=>r(p=>!p),className:"w-full flex items-center gap-2 px-4 py-3 text-left rounded-2xl transition-colors",style:{color:"var(--text-secondary)"},children:[C.jsx("span",{className:"flex-shrink-0",style:{color:"var(--text-tertiary)"},children:C.jsx(y4,{isOpen:n})}),C.jsxs("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:[t.length," step",t.length!==1?"s":""]})]}),C.jsxs("div",{className:"px-4 pb-4",children:[l>0&&C.jsxs("button",{type:"button",onClick:()=>r(!0),className:"w-full text-left py-2 pl-5 text-sm transition-opacity hover:opacity-70",style:{color:"var(--text-tertiary)"},children:["+",l," more step",l!==1?"s":""]}),C.jsx("div",{className:"relative",children:u.map((p,g)=>{const b=n?g:t.length-a+g,y=p.data!=null,E=i[b],T=g===u.length-1,S=h(p);return C.jsxs("div",{className:"relative",children:[!T&&C.jsx("div",{className:"absolute left-[7px] top-5 w-px -mt-0.5",style:{backgroundColor:"var(--border-primary)",height:"calc(100% + 1px)"}}),C.jsxs("div",{className:"flex items-start gap-3 py-1.5",children:[C.jsx("div",{className:"flex-shrink-0 mt-0.5 flex items-center justify-center w-4 h-4",children:S?C.jsx(Gte,{}):C.jsx(Yte,{})}),C.jsxs("div",{className:"flex-1 min-w-0 flex items-start justify-between gap-2",children:[C.jsx("button",{type:"button",onClick:y?()=>d(b):void 0,disabled:!y,className:O_("flex-1 text-left text-sm leading-relaxed",y&&"cursor-pointer hover:opacity-80"),style:{color:"var(--text-secondary)"},children:p.step}),C.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[p.result&&C.jsx("span",{className:"text-sm",style:{color:"var(--text-tertiary)"},children:p.result}),y&&C.jsx("button",{type:"button",onClick:()=>d(b),className:"p-1 -m-1 hover:opacity-70",style:{color:"var(--text-tertiary)"},children:C.jsx(y4,{isOpen:E})})]})]})]}),y&&E&&C.jsx("div",{className:"ml-7 mt-1 mb-2",children:C.jsx("div",{className:"rounded-lg border px-2 prose prose-sm max-w-none overflow-x-auto",style:{borderColor:"var(--border-primary)",color:"var(--text-tertiary)"},children:C.jsx(Lu,{markdown:typeof p.data=="string"?p.data:"```json\n"+JSON.stringify(p.data,null,2)+"\n```",onSend:e})})})]},b)})})]})]})}const tne=le.memo(function({part:e,onSend:n,isGenerating:r}){if(!e||!e.type)return null;if(e.type==="canvas")return C.jsx(Xte,{title:e.title,content:e.content,isComplete:e._complete});if(e.type==="thinking")return C.jsx(Jte,{thinking:e.thinking||"",onSend:n,isActive:r&&!e._complete,startTime:e._startTime,duration:e._duration});if(e.type==="steps")return C.jsx(ene,{steps:e.steps||[],onSend:n});if(e.type==="image"&&e.image)return C.jsx(Qte,{src:e.image,alt:e.alt});let i="";switch(e.type){case"text":i=e.text||"";break;case"code":i="```"+(e.language||"")+`
`+(e.code||"")+"\n```";break;case"table":e.headers&&e.headers.length>0&&(i+="| "+e.headers.join(" | ")+` |
`,i+="| "+e.headers.map(()=>"---").join(" | ")+` |
`),e.rows&&e.rows.length>0&&e.rows.forEach(l=>{i+="| "+l.join(" | ")+` |
`});break;case"callout":i=`> ${{info:"ℹ️",success:"✅",warning:"⚠️",error:"❌"}[e.style||"info"]||"ℹ️"} **${e.title||e.style||"Info"}**
>
> ${e.callout||""}`;break;case"image":i=`![${e.alt||""}](${e.src})`,e.caption&&(i+=`

*${e.caption}*`);break;default:return null}return C.jsx("div",{className:O_("prose prose-sm max-w-none","prose-headings:scroll-mt-24","prose-pre:p-0","theme-transition"),style:{color:"var(--text-primary)"},children:C.jsx(Lu,{markdown:i,onSend:n})})});function Xk({className:t=""}){return C.jsxs("div",{className:`py-1 ${t}`,role:"status","aria-label":"Loading",children:[C.jsx("svg",{width:"30",height:"30",viewBox:"0 0 100 100",className:"animate-pulse-star motion-reduce:animate-none",children:C.jsx("path",{d:`M50 0
             C50 27.6, 27.6 50, 0 50
             C27.6 50, 50 72.4, 50 100
             C50 72.4, 72.4 50, 100 50
             C72.4 50, 50 27.6, 50 0Z`,fill:"#D4A574"})}),C.jsx("style",{children:`
        @keyframes pulse-star {
          0%, 100% {
            opacity: 1;
            transform: scale(1);
          }
          50% {
            opacity: 0.5;
            transform: scale(0.88);
          }
        }

        .animate-pulse-star {
          animation: pulse-star 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
        }
      `})]})}const hO=le.memo(({messages:t,onSend:e,onRegenerate:n,isGenerating:r,onRetry:i,retryingIndex:s})=>{const a=U.useMemo(()=>t.map((l,u)=>{if(l.type==="request"||l.role==="user"){const E=l.content||"",{clean:T,attachments:S}=Zf(E),A=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(T);return C.jsx("div",{className:`flex mb-4 ${A?"justify-start":"justify-end"}`,children:C.jsxs("div",{className:"max-w-[85%] md:max-w-[75%]",children:[S.length>0&&C.jsx("div",{className:"mb-1",children:C.jsx(Hte,{attachments:S})}),T&&C.jsx("div",{className:"px-4 py-2 rounded-3xl shadow-sm theme-transition",style:{backgroundColor:"var(--msg-user-bg)",color:"var(--text-primary)"},children:C.jsx("div",{dir:"auto",className:"text-[15px] leading-relaxed whitespace-pre-wrap",children:T})})]})},u)}const h=(l.type==="response"||l.role==="assistant")&&u===t.length-1,p=h&&r,g=l.parts&&Array.isArray(l.parts),b=!g&&(l.content||l.content===""),y=g&&l.parts.length>0&&l.parts.some(E=>E.type==="text"&&E.text||E.type==="code"&&E.code||E.type==="table"&&E.headers)||b&&l.content&&l.content!=="";return C.jsx("div",{className:"flex mb-4 justify-start group",children:C.jsx("div",{className:"w-full",children:l.error?C.jsx(jte,{error:l.error,onRetry:()=>i(u),isRetrying:s===u}):C.jsxs(C.Fragment,{children:[g&&C.jsxs("div",{className:"space-y-2",children:[l.parts.map((E,T)=>C.jsx(tne,{part:E,onSend:e,isGenerating:p},T)),p&&C.jsx(Xk,{})]}),b&&C.jsxs("div",{className:"prose prose-sm max-w-none",children:[C.jsx(Lu,{markdown:l.content,onSend:e}),p&&C.jsx(Xk,{})]}),y&&!p&&C.jsx($te,{message:l,onRegenerate:()=>n(u),isLastAssistant:h&&!r})]})})},u)}),[t,e,n,r,i,s]);return C.jsx("div",{className:"space-y-1",children:a})});hO.displayName="MessageList";const nne=({file:t,onRemove:e})=>{const[n,r]=U.useState(null),i=t.type.startsWith("image/");return U.useEffect(()=>{if(!i)return;const s=new FileReader;s.onloadend=()=>r(String(s.result)),s.readAsDataURL(t)},[t,i]),C.jsxs("div",{className:"group inline-flex items-start gap-2 rounded-xl shadow-sm px-2.5 py-1 theme-transition",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)"},title:t.name,children:[C.jsx("div",{className:"w-10 h-10 rounded-md overflow-hidden flex items-center justify-center",style:{backgroundColor:"var(--bg-tertiary)"},children:i&&n?C.jsx("img",{src:n,alt:t.name,className:"w-full h-full object-cover"}):C.jsx("span",{className:"text-xs",children:"📄"})}),C.jsxs("div",{className:"min-w-0 leading-tight",children:[C.jsx("div",{className:"text-xs font-medium truncate max-w-[100px]",style:{color:"var(--text-primary)"},children:t.name}),C.jsx("div",{className:"text-xs text-left",style:{color:"var(--text-tertiary)"},children:Mg(t.size)})]}),C.jsx("button",{onClick:e,className:"ml-1 h-5 w-5 rounded-full grid place-items-center hover:bg-[var(--bg-hover)] theme-transition",style:{backgroundColor:"var(--bg-tertiary)",color:"var(--text-secondary)"},"aria-label":"Remove attachment",children:C.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:C.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})},rne=({error:t,onDismiss:e})=>(U.useEffect(()=>{const n=setTimeout(e,5e3);return()=>clearTimeout(n)},[e]),C.jsx("div",{className:"fixed bottom-40 left-1/2 transform -translate-x-1/2 bg-red-50 border border-red-200 rounded-xl shadow-lg px-4 py-3 min-w-[320px] max-w-[90vw] z-50 animate-in slide-in-from-bottom-2 duration-300",children:C.jsxs("div",{className:"flex items-start gap-3",children:[C.jsx("div",{className:"flex-shrink-0 mt-0.5",children:C.jsxs("svg",{className:"h-5 w-5 text-red-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[C.jsx("circle",{cx:"12",cy:"12",r:"10"}),C.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),C.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"text-sm font-medium text-red-900",children:"Upload Error"}),C.jsx("p",{className:"text-sm text-red-700 mt-1",children:t})]}),C.jsx("button",{onClick:e,className:"flex-shrink-0 text-red-400 hover:text-red-600 transition-colors","aria-label":"Dismiss",children:C.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",children:C.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]})})),ine=({onSend:t,isLoading:e=!1,onStop:n,disabled:r=!1,onUpgradeClick:i,sidebarWidth:s=0,canvasOpen:a=!1,canvasWidthPercent:l=0})=>{const[u,d]=U.useState(""),[h,p]=U.useState([]),[g,b]=U.useState(!1),[y,E]=U.useState(null),[T,S]=U.useState(!1),A=U.useRef(null),R=U.useRef(null),z=U.useRef(0);U.useEffect(()=>{const re=()=>b(window.innerWidth<=768);return re(),window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[]);const I=U.useCallback(re=>{if(r)return;const ie=[];for(const ye of re){const ae=Lte(ye);if(ae.valid)ie.push(ye);else{E(ae.error);break}}ie.length>0&&p(ye=>[...ye,...ie])},[r]);U.useEffect(()=>{const re=de=>{de.preventDefault(),de.stopPropagation(),!r&&(z.current++,de.dataTransfer.types.includes("Files")&&S(!0))},ie=de=>{de.preventDefault(),de.stopPropagation(),z.current--,z.current===0&&S(!1)},ye=de=>{de.preventDefault(),de.stopPropagation()},ae=de=>{if(de.preventDefault(),de.stopPropagation(),S(!1),z.current=0,r)return;const J=Array.from(de.dataTransfer.files||[]);J.length>0&&I(J)};return document.addEventListener("dragenter",re),document.addEventListener("dragleave",ie),document.addEventListener("dragover",ye),document.addEventListener("drop",ae),()=>{document.removeEventListener("dragenter",re),document.removeEventListener("dragleave",ie),document.removeEventListener("dragover",ye),document.removeEventListener("drop",ae)}},[I,r]),U.useEffect(()=>{const re=ie=>{var J;if(r||!(document.activeElement===R.current))return;const de=Array.from(((J=ie.clipboardData)==null?void 0:J.items)||[]).filter(ne=>ne.type.startsWith("image/"));if(de.length>0){ie.preventDefault();const ne=de.map(he=>he.getAsFile()).filter(he=>he!==null);ne.length>0&&I(ne)}};return document.addEventListener("paste",re),()=>document.removeEventListener("paste",re)},[I,r]);const P=()=>{var re;r||(re=A.current)==null||re.click()},$=re=>{if(r)return;const ie=Array.from(re.target.files||[]);I(ie),re.target.value=""},K=re=>p(ie=>ie.filter((ye,ae)=>ae!==re)),Z=async()=>{e||r||(t({text:u,files:h}),d(""),p([]))},W=re=>{re.key==="Enter"&&!re.shiftKey&&!g&&!e&&!r&&(re.preventDefault(),Z())};return C.jsxs(C.Fragment,{children:[y&&C.jsx(rne,{error:y,onDismiss:()=>E(null)}),T&&!r&&C.jsx("div",{className:"fixed inset-0 z-50 backdrop-blur-sm flex items-center justify-center pointer-events-none",style:{backgroundColor:"var(--bg-overlay)"},children:C.jsx("div",{className:"rounded-2xl shadow-2xl p-8 max-w-md mx-4 border-2 border-dashed theme-transition",style:{backgroundColor:"var(--bg-primary)",borderColor:"var(--text-primary)"},children:C.jsxs("div",{className:"text-center",children:[C.jsx("div",{className:"mx-auto w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:"var(--bg-tertiary)"},children:C.jsx("svg",{className:"w-8 h-8",style:{color:"var(--text-primary)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})})}),C.jsx("h3",{className:"text-lg font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Drop files to upload"}),C.jsx("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Images, PDFs, and text files supported"}),C.jsxs("p",{className:"text-xs mt-2",style:{color:"var(--text-tertiary)"},children:["Max ",Mg(lo.MAX_FILE_BYTES)," per file"]})]})})}),C.jsx("div",{className:"fixed z-40 transition-all duration-300 ease-in-out bottom-[max(0.75rem,env(safe-area-inset-bottom))] md:bottom-[max(1rem,env(safe-area-inset-bottom))]",style:{left:g?"0px":`${s}px`,right:a&&!g?`${l}%`:"0px"},children:C.jsxs("div",{className:"mx-auto max-w-3xl px-3 md:px-4",children:[C.jsxs("div",{className:`cursor-text rounded-3xl relative p-0 pt-1 backdrop-blur-xl w-full theme-transition ${r?"opacity-75":""}`,style:{backgroundColor:"var(--input-bg)",border:"1px solid var(--border-primary)"},children:[h.length>0&&C.jsx("div",{className:"px-3 pt-3",children:C.jsx("div",{className:"flex flex-wrap gap-2",children:h.map((re,ie)=>C.jsx(nne,{file:re,onRemove:()=>K(ie)},ie))})}),C.jsxs("div",{className:"px-3 pb-3 pt-2",children:[C.jsx("textarea",{ref:R,className:`w-full resize-none border-0 bg-transparent focus:ring-0 focus:outline-none text-base leading-6 max-h-40 mb-2 disabled:opacity-50 disabled:cursor-not-allowed ${r?"cursor-not-allowed":""}`,style:{color:"var(--text-primary)",caretColor:"var(--accent-primary)"},dir:"auto",autoFocus:!r,tabIndex:0,rows:Math.max(1,Math.min(6,u.split(`
`).length)),placeholder:r?"Upgrade to continue chatting...":e?"Waiting for response...":"What's on your mind?",onChange:re=>d(re.target.value),onKeyDown:W,value:u,disabled:e||r}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("button",{onClick:P,disabled:r,className:`rounded-full w-8 h-8 inline-flex items-center justify-center p-1 theme-transition ${r?"opacity-50 cursor-not-allowed":"hover:bg-[var(--bg-hover)] active:scale-[0.98]"}`,style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)",color:"var(--text-primary)"},"aria-label":"Attach file",title:r?"Upgrade to attach files":"Attach files",children:C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})})}),C.jsx("input",{ref:A,type:"file",multiple:!0,className:"hidden",onChange:$,accept:".jpg,.jpeg,.png,.webp,.pdf,.txt,.md,.csv",disabled:r}),C.jsx("div",{className:"flex-1"}),e&&!r&&C.jsx("button",{onClick:n,className:"rounded-full hover:bg-[var(--bg-hover)] active:scale-95 transition-all inline-flex items-center justify-center w-8 h-8 flex-shrink-0 theme-transition",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)",color:"var(--text-primary)",boxShadow:"var(--shadow-sm)"},"aria-label":"Stop generating",title:"Stop",children:C.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:C.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}),r&&C.jsxs("button",{onClick:i,className:"rounded-full bg-gradient-to-r from-blue-600 to-indigo-600 text-white hover:from-blue-700 hover:to-indigo-700 active:scale-[0.98] transition-all inline-flex items-center justify-center gap-1.5 px-4 h-9 flex-shrink-0 shadow-md font-medium text-sm","aria-label":"Upgrade to continue",title:"Upgrade",children:[C.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:C.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),"Upgrade"]}),!e&&!r&&C.jsx("button",{onClick:Z,disabled:e,className:"rounded-full hover:opacity-90 active:scale-[0.98] inline-flex items-center justify-center w-9 h-9 flex-shrink-0 disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100 theme-transition",style:{backgroundColor:"var(--btn-primary-bg)",color:"var(--btn-primary-text)"},"aria-label":"Send message",title:"Send",children:C.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:C.jsx("path",{d:"M8.99992 16V6.41407L5.70696 9.70704C5.31643 10.0976 4.68342 10.0976 4.29289 9.70704C3.90237 9.31652 3.90237 8.6835 4.29289 8.29298L9.29289 3.29298L9.36907 3.22462C9.76184 2.90427 10.3408 2.92686 10.707 3.29298L15.707 8.29298L15.7753 8.36915C16.0957 8.76192 16.0731 9.34092 15.707 9.70704C15.3408 10.0732 14.7618 10.0958 14.3691 9.7754L14.2929 9.70704L10.9999 6.41407V16C10.9999 16.5523 10.5522 17 9.99992 17C9.44764 17 8.99992 16.5523 8.99992 16Z"})})})]})]})]}),r&&C.jsx("p",{className:"text-xs text-center mt-2",style:{color:"var(--text-tertiary)"},children:"You've reached your free message limit"})]})}),C.jsx("style",{children:`
        textarea::placeholder {
          color: var(--text-muted);
        }
      `})]})},sne=({fileName:t,progress:e})=>C.jsx("div",{className:"fixed bottom-40 left-1/2 transform -translate-x-1/2 rounded-xl shadow-lg px-4 py-3 min-w-[280px] theme-transition",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)",boxShadow:"var(--shadow-lg)"},children:C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("div",{className:"flex-shrink-0",children:C.jsxs("svg",{className:"animate-spin h-5 w-5",style:{color:"var(--text-secondary)"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[C.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),C.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"text-sm font-medium truncate",style:{color:"var(--text-primary)"},children:t}),C.jsx("div",{className:"mt-1 w-full rounded-full h-1.5",style:{backgroundColor:"var(--bg-tertiary)"},children:C.jsx("div",{className:"h-1.5 rounded-full transition-all duration-300",style:{width:`${e}%`,backgroundColor:"var(--text-primary)"}})})]})]})}),Og={collapsed:56,expanded:275},zr=(...t)=>t.filter(Boolean).join(" "),Qk=({children:t})=>C.jsx("span",{className:"grid place-items-center w-5 h-5",children:t}),Zk=t=>C.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:zr("w-5 h-5",t==null?void 0:t.className),fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M12 3a9 9 0 1 1-6.22 15.5"}),C.jsx("path",{d:"M12 8v8"}),C.jsx("path",{d:"M16 12H8"})]}),Jk=t=>C.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:zr("w-[18px] h-[18px]",t==null?void 0:t.className),fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),C.jsx("path",{d:"M9 3v18"})]}),ane=t=>C.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:zr("w-5 h-5",t==null?void 0:t.className),fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("path",{d:"M10 7l5 5-5 5"})}),one=t=>C.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:zr("w-4 h-4",t==null?void 0:t.className),fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M3 6h18"}),C.jsx("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),C.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),C.jsx("path",{d:"M10 11v6"}),C.jsx("path",{d:"M14 11v6"})]}),lne=t=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:zr("lucide lucide-ellipsis-icon lucide-ellipsis",t==null?void 0:t.className),children:[C.jsx("circle",{cx:"12",cy:"12",r:"1"}),C.jsx("circle",{cx:"19",cy:"12",r:"1"}),C.jsx("circle",{cx:"5",cy:"12",r:"1"})]});function une(t,e,n=!0){U.useEffect(()=>{if(!n)return;const r=i=>{(Array.isArray(t)?t:[t]).some(l=>(l==null?void 0:l.current)&&l.current.contains(i.target))||e(i)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r,{passive:!0}),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[t,e,n])}const cne=({icon:t,children:e,isCollapsed:n,...r})=>C.jsxs("button",{...r,className:zr("group w-full flex items-center gap-3 rounded-xl px-2.5 py-2 text-left","hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition",n&&"justify-center px-2"),style:{color:"var(--text-primary)"},children:[C.jsx("span",{className:"shrink-0",style:{color:"var(--text-primary)"},children:t}),!n&&C.jsx("span",{className:"text-sm font-medium leading-5",children:e})]}),dne=({children:t})=>C.jsx("div",{className:"px-2.5 py-1.5 text-[11px] font-semibold tracking-wide uppercase",style:{color:"var(--text-tertiary)"},children:t}),fne=({chat:t,isActive:e,onSelect:n,onDelete:r})=>{const[i,s]=U.useState(!1),a=U.useRef(null),l=U.useRef(null),u=U.useId();return une([a,l],()=>s(!1),i),C.jsxs("div",{className:"relative",children:[C.jsxs("button",{onClick:()=>n(t.id),className:zr("group w-full flex items-center gap-2 rounded-xl px-2.5 py-2 text-left","hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition"),style:{backgroundColor:e?"var(--bg-active)":"transparent"},"aria-current":e?"page":void 0,children:[C.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",style:{color:"var(--text-primary)"},children:t.title||"Untitled"}),C.jsx("button",{ref:l,type:"button",onClick:d=>{d.stopPropagation(),s(h=>!h)},className:zr("shrink-0 rounded-lg p-1.5","hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","opacity-0 group-hover:opacity-100 focus:opacity-100","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition"),style:{color:"var(--text-tertiary)"},"aria-label":"Chat options","aria-haspopup":"menu","aria-expanded":i,"aria-controls":u,children:C.jsx(lne,{})})]}),i&&C.jsx("div",{id:u,ref:a,role:"menu",className:zr("absolute right-2 top-[calc(100%+6px)] z-50 min-w-[170px]","rounded-xl shadow-lg","overflow-hidden dropdown-menu"),style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)"},children:C.jsxs("button",{role:"menuitem",onClick:d=>{d.stopPropagation(),r(t.id),s(!1)},className:zr("w-full flex items-center gap-2 px-3 py-2.5 text-sm","text-red-500 hover:bg-red-500/10 focus:bg-red-500/10","focus:outline-none theme-transition"),children:[C.jsx(one,{}),"Delete"]})})]})},hne=({user:t,isOnPaidPlan:e,tierName:n,UserButtonComponent:r})=>{var a,l;const i=(t==null?void 0:t.fullName)||(t==null?void 0:t.firstName)||((l=(a=t==null?void 0:t.emailAddresses)==null?void 0:a[0])==null?void 0:l.emailAddress)||"User",s=e?n||"Pro":"Free plan";return C.jsxs("div",{className:"flex items-center gap-3 rounded-xl p-2 hover:bg-[var(--bg-hover)] transition-colors theme-transition",children:[C.jsx("div",{className:"shrink-0",children:r}),C.jsxs("div",{className:"min-w-0 flex-1",children:[C.jsx("div",{className:"truncate text-sm font-semibold",style:{color:"var(--text-primary)"},children:i}),C.jsx("div",{className:"truncate text-xs",style:{color:"var(--text-tertiary)"},children:s})]})]})},pne=({UserButtonComponent:t})=>C.jsx("div",{className:"grid place-items-center p-1",children:t}),mne=({isOpen:t,onClose:e,onToggle:n,chats:r,activeChat:i,onSelectChat:s,onNewChat:a,onDeleteChat:l,user:u,isOnPaidPlan:d,tierName:h,UserButtonComponent:p,isAuthenticated:g})=>{const b=U.useMemo(()=>[...r||[]].sort((T,S)=>new Date(S.updatedAt)-new Date(T.updatedAt)),[r]),y=U.useMemo(()=>{const T={today:[],yesterday:[],previous7Days:[],previous30Days:[],older:[]},S=new Date,A=new Date(S.getFullYear(),S.getMonth(),S.getDate()),R=new Date(A);R.setDate(R.getDate()-1);const z=new Date(A);z.setDate(z.getDate()-7);const I=new Date(A);return I.setDate(I.getDate()-30),b.forEach(P=>{const $=new Date(P.updatedAt);$>=A?T.today.push(P):$>=R?T.yesterday.push(P):$>=z?T.previous7Days.push(P):$>=I?T.previous30Days.push(P):T.older.push(P)}),T},[b]),E=(T,S)=>S!=null&&S.length?C.jsxs("div",{className:"mb-4",children:[C.jsx(dne,{children:T}),C.jsx("div",{className:"space-y-1",children:S.map(A=>C.jsx(fne,{chat:A,isActive:i===A.id,onSelect:s,onDelete:l},A.id))})]}):null;return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:zr("fixed inset-0 z-40 md:hidden transition-opacity duration-300 ease-in-out",t?"opacity-100":"opacity-0 pointer-events-none"),style:{backgroundColor:"var(--bg-overlay)"},onClick:e,"aria-hidden":"true"}),C.jsxs("aside",{className:zr("fixed left-0 top-0 z-50 h-full","backdrop-blur supports-[backdrop-filter]:backdrop-blur-xl","transition-all duration-300 ease-in-out","flex flex-col",t?"translate-x-0":"-translate-x-full md:translate-x-0"),style:{width:`${t?Og.expanded:Og.collapsed}px`,backgroundColor:"var(--bg-sidebar)",borderRight:"1px solid var(--border-primary)"},children:[C.jsxs("div",{className:zr("flex h-full w-full flex-col","transition-opacity duration-200",t?"opacity-100":"opacity-0 pointer-events-none absolute inset-0"),children:[C.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[C.jsxs("button",{onClick:a,className:zr("inline-flex items-center gap-2 rounded-xl px-2.5 py-2","hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition"),style:{color:"var(--text-primary)"},"aria-label":"New chat",title:"New chat",children:[C.jsx(Qk,{children:C.jsx(Zk,{})}),C.jsx("span",{className:"text-sm font-semibold",children:"New"})]}),C.jsx("button",{onClick:n,className:zr("rounded-xl p-2 hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition"),style:{color:"var(--text-primary)"},"aria-label":"Collapse sidebar",title:"Collapse",children:C.jsx(Jk,{})})]}),C.jsx("div",{className:"mx-3",style:{borderTop:"1px solid var(--border-primary)"}}),C.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-3 scrollbar-thin",children:b.length===0?C.jsx("div",{className:"px-2 py-10 text-center text-sm",style:{color:"var(--text-tertiary)"},children:"No chats yet"}):C.jsxs(C.Fragment,{children:[E("Today",y.today),E("Yesterday",y.yesterday),E("Previous 7 days",y.previous7Days),E("Previous 30 days",y.previous30Days),E("Older",y.older)]})}),C.jsx("div",{className:"p-2",style:{borderTop:"1px solid var(--border-primary)"},children:g&&u?C.jsx(hne,{user:u,isOnPaidPlan:d,tierName:h,UserButtonComponent:p}):C.jsxs("div",{className:"px-2 py-2 text-center text-xs",style:{color:"var(--text-tertiary)"},children:[r.length," / ",lo.MAX_CHATS," chats"]})})]}),C.jsxs("div",{className:zr("hidden md:flex h-full w-full flex-col","transition-opacity duration-200",t?"opacity-0 pointer-events-none absolute inset-0":"opacity-100"),children:[C.jsx("div",{className:"flex h-14 items-center justify-center",children:C.jsx("button",{onClick:n,className:zr("rounded-xl p-2 hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition"),style:{color:"var(--text-primary)"},"aria-label":"Expand sidebar",title:"Expand",children:C.jsx(Jk,{})})}),C.jsx("div",{className:"px-1 py-2",children:C.jsx(cne,{onClick:a,icon:C.jsx(Qk,{children:C.jsx(Zk,{})}),isCollapsed:!0,"aria-label":"New chat",title:"New chat"})}),C.jsx("div",{className:"flex-1"}),g&&p&&C.jsx("div",{className:"p-2",style:{borderTop:"1px solid var(--border-primary)"},children:C.jsx(pne,{UserButtonComponent:p})})]})]}),C.jsx("button",{onClick:n,className:zr("fixed left-3 top-3 z-30 md:hidden","rounded-xl backdrop-blur","p-2 hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition transition-opacity duration-300 ease-in-out",t?"opacity-0 pointer-events-none":"opacity-100"),style:{backgroundColor:"var(--bg-sidebar)",border:"1px solid var(--border-primary)",color:"var(--text-primary)"},"aria-label":"Open sidebar",title:"Open",children:C.jsx(ane,{})})]})},gne=({open:t,onClose:e,tier:n})=>t?C.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center backdrop-blur-md px-4",style:{backgroundColor:"var(--bg-overlay)"},children:C.jsxs("div",{className:"relative w-full max-w-xl rounded-3xl shadow-2xl overflow-hidden theme-transition",style:{background:"linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary))",border:"1px solid var(--border-primary)"},children:[C.jsx("div",{className:"absolute top-0 left-0 right-0 h-32 pointer-events-none opacity-50",style:{background:"linear-gradient(to bottom right, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.05), transparent)"}}),C.jsx("button",{type:"button",onClick:e,className:"absolute right-4 top-4 z-10 inline-flex h-9 w-9 items-center justify-center rounded-full backdrop-blur-sm transition-all duration-200 shadow-sm theme-transition",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)",color:"var(--text-tertiary)"},"aria-label":"Close",children:C.jsx("span",{className:"text-xl leading-none",children:"×"})}),C.jsxs("div",{className:"relative p-8 md:p-10",children:[C.jsxs("div",{className:"space-y-3 pr-8 mb-6",children:[C.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-blue-500/10 text-blue-500 border border-blue-500/20",children:[C.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 20 20",children:C.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),C.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Upgrade Available"})]}),C.jsxs("h2",{className:"text-2xl md:text-3xl font-bold leading-tight",style:{color:"var(--text-primary)"},children:["Unlock"," ",C.jsx("span",{className:"bg-gradient-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent",children:"Cycls Pass"})," ","features"]}),C.jsxs("p",{className:"text-base leading-relaxed",style:{color:"var(--text-secondary)"},children:["You've reached your free message limit. Upgrade to access the full"," ",C.jsx("span",{className:"font-semibold",style:{color:"var(--text-primary)"},children:"Cycls Pass"})," ","experience, priority AI, and unlimited messages."]})]}),C.jsx("div",{className:"relative -mx-2 mb-6",children:C.jsx("div",{className:"max-h-[420px] overflow-y-auto rounded-2xl backdrop-blur-sm shadow-inner scrollbar-thin",style:{backgroundColor:"var(--bg-tertiary)",border:"1px solid var(--border-primary)"},children:C.jsx(eH,{})})}),C.jsx("div",{className:"flex justify-end",children:C.jsx("button",{type:"button",onClick:e,className:"inline-flex items-center gap-2 rounded-xl px-5 py-2.5 text-sm font-medium transition-all duration-200 hover:bg-[var(--bg-hover)] theme-transition",style:{color:"var(--text-secondary)"},children:"Maybe later"})})]})]})}):null,pO=({isAuthenticated:t,isPublic:e=!1,meta:n={}})=>{const[r,i]=U.useState(window.location.pathname);return U.useEffect(()=>{const s=()=>i(window.location.pathname);window.addEventListener("popstate",s);const a=setInterval(s,100);return()=>{window.removeEventListener("popstate",s),clearInterval(a)}},[]),U.useEffect(()=>{const a=r==="/auth"||r.startsWith("/sign-in")||r.startsWith("/sign-up")||r.includes("clerk")||t&&!e;let l=document.querySelector('meta[name="robots"]');l||(l=document.createElement("meta"),l.setAttribute("name","robots"),document.head.appendChild(l)),a?l.setAttribute("content","noindex, nofollow"):l.setAttribute("content","index, follow");let u=document.querySelector('meta[name="googlebot"]');if(u||(u=document.createElement("meta"),u.setAttribute("name","googlebot"),document.head.appendChild(u)),a?u.setAttribute("content","noindex, nofollow"):u.setAttribute("content","index, follow"),n.title&&(document.title=n.title),n.description){let p=document.querySelector('meta[name="description"]');p||(p=document.createElement("meta"),p.setAttribute("name","description"),document.head.appendChild(p)),p.setAttribute("content",n.description)}let d=document.querySelector('link[rel="canonical"]');d||(d=document.createElement("link"),d.setAttribute("rel","canonical"),document.head.appendChild(d));const h=n.canonical||window.location.origin+r;return d.setAttribute("href",h),()=>{}},[r,t,e,n]),null},bne=({afterUrl:t})=>{const e=_o(),{resolvedTheme:n}=UC(),r=e.hash==="#sign-up/"||e.hash==="#sign-up"?"sign-up":"sign-in",i={elements:{card:"shadow-none border-none",footer:"hidden",formButtonPrimary:"py-2.5 rounded-lg transition-colors",formFieldInput:"border-gray-300 focus:border-blue-500 focus:ring-blue-500 rounded-lg",formFieldLabel:"text-gray-700 font-medium text-sm",dividerLine:"bg-gray-200",dividerText:"text-gray-500 text-sm"}};return C.jsxs("div",{className:"min-h-screen flex items-center justify-center px-4 theme-transition",style:{backgroundColor:"var(--bg-secondary)"},children:[C.jsx(pO,{isAuthenticated:!1,isPublic:!1,meta:{title:"Sign In",description:"Authentication page"}}),C.jsx("div",{className:"fixed top-4 right-4",children:C.jsx(HC,{})}),C.jsx("div",{className:"w-full max-w-md",children:r==="sign-in"?C.jsxs("div",{className:"space-y-4",children:[C.jsx(VU,{routing:"virtual",fallbackRedirectUrl:t,signUpUrl:"#sign-up",appearance:i}),C.jsx("div",{style:{marginLeft:"-30px"},className:"text-center",children:C.jsxs("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:["Don't have an account?"," ",C.jsx("a",{href:"#sign-up/",className:"font-medium hover:underline transition-colors",style:{color:"var(--accent-primary)"},children:"Sign up"})]})})]}):C.jsxs("div",{className:"space-y-4",children:[C.jsx(GU,{routing:"virtual",fallbackRedirectUrl:t,signInUrl:"#sign-in",appearance:i}),C.jsx("div",{style:{marginLeft:"-40px"},className:"text-center",children:C.jsxs("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:["Already have an account?"," ",C.jsx("a",{href:"#sign-in/",className:"font-medium hover:underline transition-colors",style:{color:"var(--accent-primary)"},children:"Sign in"})]})})]})})]})},vne=({children:t})=>C.jsxs(C.Fragment,{children:[C.jsx(LU,{children:t}),C.jsx(PU,{children:C.jsx(ZC,{to:"/auth",replace:!0})})]});dn(({clerk:t,children:e,...n})=>{const{planId:r,planPeriod:i,for:s,onSubscriptionComplete:a,newSubscriptionRedirectUrl:l,checkoutProps:u,...d}=n,{userId:h,orgId:p}=Eh();if(h===null)throw new Error("Clerk: Ensure that `<CheckoutButton />` is rendered inside a `<SignedIn />` component.");if(p===null&&s==="organization")throw new Error('Clerk: Wrap `<CheckoutButton for="organization" />` with a check for an active organization. Retrieve `orgId` from `useAuth()` and confirm it is defined. For SSR, see: https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object');e=qu(e,"Checkout");const g=$u(e)("CheckoutButton"),b=()=>{if(t)return t.__internal_openCheckout({planId:r,planPeriod:i,for:s,onSubscriptionComplete:a,newSubscriptionRedirectUrl:l,...u})},E={...d,onClick:async T=>(g&&typeof g=="object"&&"props"in g&&await Vu(g.props.onClick)(T),b())};return le.cloneElement(g,E)},{component:"CheckoutButton",renderWhileLoading:!0});dn(({clerk:t,children:e,...n})=>{const{plan:r,planId:i,initialPlanPeriod:s,planDetailsProps:a,...l}=n;e=qu(e,"Plan details");const u=$u(e)("PlanDetailsButton"),d=()=>{if(t)return t.__internal_openPlanDetails({plan:r,planId:i,initialPlanPeriod:s,...a})},p={...l,onClick:async g=>(u&&typeof u=="object"&&"props"in u&&await Vu(u.props.onClick)(g),d())};return le.cloneElement(u,p)},{component:"PlanDetailsButton",renderWhileLoading:!0});dn(({clerk:t,children:e,...n})=>{const{for:r,subscriptionDetailsProps:i,onSubscriptionCancel:s,...a}=n;e=qu(e,"Subscription details");const l=$u(e)("SubscriptionDetailsButton"),{userId:u,orgId:d}=Eh();if(u===null)throw new Error("Clerk: Ensure that `<SubscriptionDetailsButton />` is rendered inside a `<SignedIn />` component.");if(d===null&&r==="organization")throw new Error('Clerk: Wrap `<SubscriptionDetailsButton for="organization" />` with a check for an active organization. Retrieve `orgId` from `useAuth()` and confirm it is defined. For SSR, see: https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object');const h=()=>{if(t)return t.__internal_openSubscriptionDetails({for:r,onSubscriptionCancel:s,...i})},g={...a,onClick:async b=>(l&&typeof l=="object"&&"props"in l&&await Vu(l.props.onClick)(b),h())};return le.cloneElement(l,g)},{component:"SubscriptionDetailsButton",renderWhileLoading:!0});const mO=U.createContext({subscription:null,isLoading:!1,error:null,revalidate:()=>{}}),yne=()=>U.useContext(mO),Ene=({tier:t,children:e})=>{const{data:n,isLoading:r,error:i,revalidate:s}=nU({enabled:t==="cycls_pass"}),a=U.useMemo(()=>({subscription:n,isLoading:r,error:i,revalidate:s}),[n,r,i,s]);return C.jsx(mO.Provider,{value:a,children:e})},e8={desktop:60,chat:40},gO=t=>{const[e,n]=U.useState(!1);return U.useEffect(()=>{const r=()=>n(window.innerWidth<768);return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),t?e?{chatWidthPercent:100,canvasWidthPercent:100,isMobile:e}:{chatWidthPercent:e8.chat,canvasWidthPercent:e8.desktop,isMobile:e}:{chatWidthPercent:100,canvasWidthPercent:0,isMobile:e}},_ne="modulepreload",xne=function(t){return"/"+t},t8={},E4=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let a=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=a(n.map(d=>{if(d=xne(d),d in t8)return;t8[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":_ne,h||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),h)return new Promise((b,y)=>{g.addEventListener("load",b),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${d}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return e().catch(s)})};function R_(t){return t&&t.replace(/[<>:"/\\|?*\x00-\x1f]/g,"").replace(/\s+/g,"_").substring(0,100)||"document"}function ub(t){if(!t)return!1;const e=t.replace(/\s/g,"").slice(0,200);return/[\u0600-\u06FF\u0590-\u05FF]/.test(e)}function bO(t){if(!t)return"";let e=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/___(.+?)___/g,"<strong><em>$1</em></strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/_(.+?)_/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>').replace(/^---$/gm,"<hr>").replace(/^[\-\*] (.+)$/gm,"<li>$1</li>").replace(/^\d+\. (.+)$/gm,"<li>$1</li>").replace(/^> (.+)$/gm,"<blockquote>$1</blockquote>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return e="<p>"+e+"</p>",e=e.replace(/<p><\/p>/g,""),e=e.replace(/(<li>[\s\S]*?<\/li>)+/g,n=>`<ul>${n}</ul>`),e}async function Tne(t){try{return await navigator.clipboard.writeText(t),!0}catch(e){console.error("Failed to copy to clipboard:",e);try{const n=document.createElement("textarea");return n.value=t,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),!0}catch(n){return console.error("Fallback copy failed:",n),!1}}}function vO(t,e){const n=R_(e)+".md",r=new Blob([t],{type:"text/markdown;charset=utf-8"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=n,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}function Sne(t){const e=t.split(`
`),n=[];let r=[],i=!1;for(const s of e)s.startsWith("### ")?(i&&r.length>0&&(n.push({type:"list",items:r}),r=[],i=!1),n.push({type:"h3",text:s.substring(4)})):s.startsWith("## ")?(i&&r.length>0&&(n.push({type:"list",items:r}),r=[],i=!1),n.push({type:"h2",text:s.substring(3)})):s.startsWith("# ")?(i&&r.length>0&&(n.push({type:"list",items:r}),r=[],i=!1),n.push({type:"h1",text:s.substring(2)})):s.match(/^[\-\*] /)?(i=!0,r.push(s.substring(2))):s.match(/^\d+\. /)?(i=!0,r.push(s.replace(/^\d+\. /,""))):s.startsWith("> ")?(i&&r.length>0&&(n.push({type:"list",items:r}),r=[],i=!1),n.push({type:"blockquote",text:s.substring(2)})):s.trim()==="---"||s.trim()==="***"?(i&&r.length>0&&(n.push({type:"list",items:r}),r=[],i=!1),n.push({type:"hr"})):s.trim()===""?i&&r.length>0&&(n.push({type:"list",items:r}),r=[],i=!1):(i&&r.length>0&&(n.push({type:"list",items:r}),r=[],i=!1),n.push({type:"paragraph",text:s}));return i&&r.length>0&&n.push({type:"list",items:r}),n}function Lc(t,e){const n=t.replace(/\*\*\*(.+?)\*\*\*/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/___(.+?)___/g,"$1").replace(/__(.+?)__/g,"$1").replace(/_(.+?)_/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1");return[new e.TextRun({text:n})]}async function wne(t,e){try{const n=await E4(()=>import("./index-vX_oGdsN.js"),[]),{saveAs:r}=await E4(async()=>{const{saveAs:h}=await import("./FileSaver.min-D3FSkpuq.js").then(p=>p.F);return{saveAs:h}},[]),i=ub(t),s=Sne(t),a=[];a.push(new n.Paragraph({children:[new n.TextRun({text:e||"Document",bold:!0,size:36})],heading:n.HeadingLevel.TITLE,spacing:{after:400},bidirectional:i}));for(const h of s)switch(h.type){case"h1":a.push(new n.Paragraph({children:Lc(h.text,n),heading:n.HeadingLevel.HEADING_1,spacing:{before:240,after:120},bidirectional:i}));break;case"h2":a.push(new n.Paragraph({children:Lc(h.text,n),heading:n.HeadingLevel.HEADING_2,spacing:{before:200,after:100},bidirectional:i}));break;case"h3":a.push(new n.Paragraph({children:Lc(h.text,n),heading:n.HeadingLevel.HEADING_3,spacing:{before:160,after:80},bidirectional:i}));break;case"paragraph":a.push(new n.Paragraph({children:Lc(h.text,n),spacing:{after:120},bidirectional:i}));break;case"list":for(const p of h.items)a.push(new n.Paragraph({children:Lc(p,n),bullet:{level:0},spacing:{after:60},bidirectional:i}));break;case"blockquote":a.push(new n.Paragraph({children:Lc(h.text,n),indent:{left:720},style:"IntenseQuote",spacing:{after:120},bidirectional:i}));break;case"hr":a.push(new n.Paragraph({children:[],border:{bottom:{style:n.BorderStyle.SINGLE,size:6,color:"CCCCCC"}},spacing:{before:200,after:200}}));break}const l=new n.Document({sections:[{properties:{...i&&{textDirection:n.TextDirection.RIGHT_TO_LEFT}},children:a}]}),u=await n.Packer.toBlob(l),d=R_(e)+".docx";r(u,d)}catch(n){console.error("Failed to generate DOCX:",n),vO(t,e)}}async function kne(t,e){if(ub(t)){n8(t,e);return}try{const{jsPDF:n}=await E4(async()=>{const{jsPDF:g}=await import("./jspdf.es.min-Cx6CH6ND.js").then(b=>b.j);return{jsPDF:g}},[]),r=new n({orientation:"portrait",unit:"mm",format:"a4"});r.setProperties({title:e||"Document",creator:"Canvas Export"}),r.setFontSize(18),r.setFont("helvetica","bold"),r.text(e||"Document",20,20),r.setFontSize(11),r.setFont("helvetica","normal");const i=r.internal.pageSize.getWidth(),s=20,a=i-s*2,l=t.split(`
`);let u=35;const d=6,h=r.internal.pageSize.getHeight();for(const g of l)if(g.startsWith("# ")){r.setFontSize(16),r.setFont("helvetica","bold");const b=g.substring(2),y=r.splitTextToSize(b,a);for(const E of y)u>h-20&&(r.addPage(),u=20),r.text(E,s,u),u+=d+2;r.setFontSize(11),r.setFont("helvetica","normal")}else if(g.startsWith("## ")){r.setFontSize(14),r.setFont("helvetica","bold");const b=g.substring(3),y=r.splitTextToSize(b,a);for(const E of y)u>h-20&&(r.addPage(),u=20),r.text(E,s,u),u+=d+1;r.setFontSize(11),r.setFont("helvetica","normal")}else if(g.startsWith("### ")){r.setFontSize(12),r.setFont("helvetica","bold");const b=g.substring(4),y=r.splitTextToSize(b,a);for(const E of y)u>h-20&&(r.addPage(),u=20),r.text(E,s,u),u+=d;r.setFontSize(11),r.setFont("helvetica","normal")}else if(g.trim()==="")u+=d/2;else{let b=g.replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/`(.+?)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1");const y=r.splitTextToSize(b,a);for(const E of y)u>h-20&&(r.addPage(),u=20),r.text(E,s,u),u+=d}const p=R_(e)+".pdf";r.save(p)}catch(n){console.error("Failed to generate PDF:",n),n8(t,e)}}function n8(t,e){const n=bO(t),r=ub(t),i=window.open("","_blank");if(!i){console.error("Failed to open print window - popup blocked");return}i.document.write(`
    <!DOCTYPE html>
    <html dir="${r?"rtl":"ltr"}" lang="${r?"ar":"en"}">
      <head>
        <meta charset="utf-8">
        <title>${e||"Document"}</title>
        <style>
          @page {
            size: A4;
            margin: 20mm;
          }
          body {
            font-family: ${r?"'Noto Sans Arabic', 'Arial', 'Tahoma', sans-serif":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"};
            font-size: 12pt;
            line-height: 1.8;
            color: #000;
            max-width: 100%;
            margin: 0;
            padding: 0;
            direction: ${r?"rtl":"ltr"};
            text-align: ${r?"right":"left"};
          }
          h1 { font-size: 20pt; margin-top: 0; margin-bottom: 12pt; font-weight: bold; }
          h2 { font-size: 16pt; margin-top: 16pt; margin-bottom: 8pt; font-weight: bold; }
          h3 { font-size: 14pt; margin-top: 14pt; margin-bottom: 6pt; font-weight: bold; }
          p { margin-bottom: 8pt; }
          ul, ol {
            margin-${r?"right":"left"}: 18pt;
            padding-${r?"right":"left"}: 0;
          }
          li { margin-bottom: 4pt; }
          blockquote {
            margin-${r?"right":"left"}: 18pt;
            padding-${r?"right":"left"}: 12pt;
            border-${r?"right":"left"}: 3pt solid #ccc;
            font-style: italic;
            color: #555;
          }
          code { font-family: 'Consolas', 'Courier New', monospace; background-color: #f5f5f5; padding: 2pt 4pt; }
          a { color: #0066cc; text-decoration: underline; }
          hr { border: none; border-top: 1px solid #ccc; margin: 16pt 0; }

          @media print {
            body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
          }
        </style>
      </head>
      <body>
        <h1>${e||"Document"}</h1>
        ${n}
        <script>
          // Auto-trigger print dialog and close window after
          window.onload = function() {
            setTimeout(function() {
              window.print();
              // Don't auto-close - let user save as PDF
            }, 100);
          };
        <\/script>
      </body>
    </html>
  `),i.document.close()}function Cne(t,e){const n=bO(t),r=ub(t),i=window.open("","_blank");if(!i){console.error("Failed to open print window");return}i.document.write(`
    <!DOCTYPE html>
    <html dir="${r?"rtl":"ltr"}" lang="${r?"ar":"en"}">
      <head>
        <meta charset="utf-8">
        <title>${e||"Document"}</title>
        <style>
          @page {
            size: A4;
            margin: 20mm;
          }
          @media print {
            body {
              font-family: ${r?"'Noto Sans Arabic', 'Arial', 'Tahoma', sans-serif":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"};
              font-size: 12pt;
              line-height: 1.8;
              color: #000;
              max-width: 100%;
              margin: 0;
              padding: 0;
              direction: ${r?"rtl":"ltr"};
              text-align: ${r?"right":"left"};
              -webkit-print-color-adjust: exact;
              print-color-adjust: exact;
            }
            h1 { font-size: 20pt; margin-top: 0; margin-bottom: 12pt; font-weight: bold; }
            h2 { font-size: 16pt; margin-top: 16pt; margin-bottom: 8pt; font-weight: bold; }
            h3 { font-size: 14pt; margin-top: 14pt; margin-bottom: 6pt; font-weight: bold; }
            p { margin-bottom: 8pt; }
            ul, ol {
              margin-${r?"right":"left"}: 18pt;
              padding-${r?"right":"left"}: 0;
            }
            li { margin-bottom: 4pt; }
            blockquote {
              margin-${r?"right":"left"}: 18pt;
              padding-${r?"right":"left"}: 12pt;
              border-${r?"right":"left"}: 3pt solid #ccc;
              font-style: italic;
              color: #555;
            }
            code { font-family: 'Consolas', 'Courier New', monospace; background-color: #f5f5f5; padding: 2pt 4pt; }
            a { color: #000; text-decoration: underline; }
            hr { border: none; border-top: 1px solid #ccc; margin: 16pt 0; }
          }
        </style>
      </head>
      <body>
        <h1>${e||"Document"}</h1>
        ${n}
      </body>
    </html>
  `),i.document.close(),i.onload=()=>{i.print(),i.close()}}const Ane=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("circle",{cx:"12",cy:"12",r:"1"}),C.jsx("circle",{cx:"19",cy:"12",r:"1"}),C.jsx("circle",{cx:"5",cy:"12",r:"1"})]}),Nne=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),C.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),Mne=()=>C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("polyline",{points:"20 6 9 17 4 12"})}),L2=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),C.jsx("polyline",{points:"7 10 12 15 17 10"}),C.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),One=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("polyline",{points:"6 9 6 2 18 2 18 9"}),C.jsx("path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}),C.jsx("rect",{x:"6",y:"14",width:"12",height:"8"})]}),Rne=()=>{const{state:t}=Dd(),[e,n]=U.useState(!1),[r,i]=U.useState(!1),s=U.useRef(null),a=U.useRef(null);U.useEffect(()=>{const g=b=>{s.current&&!s.current.contains(b.target)&&!a.current.contains(b.target)&&n(!1)};if(e)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[e]),U.useEffect(()=>{const g=b=>{var y;b.key==="Escape"&&e&&(n(!1),(y=a.current)==null||y.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e]);const l=async()=>{await Tne(t.content)&&(i(!0),setTimeout(()=>i(!1),2e3)),n(!1)},u=()=>{vO(t.content,t.title),n(!1)},d=async()=>{await wne(t.content,t.title),n(!1)},h=async()=>{await kne(t.content,t.title),n(!1)},p=()=>{Cne(t.content,t.title),n(!1)};return t.isDone?C.jsxs("div",{className:"relative",children:[C.jsx("button",{ref:a,onClick:()=>n(!e),className:"p-2 rounded-lg hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20",style:{color:"var(--text-secondary)"},"aria-label":"Export options","aria-haspopup":"true","aria-expanded":e,children:C.jsx(Ane,{})}),e&&C.jsxs("div",{ref:s,className:"absolute right-0 top-full mt-1 w-48 rounded-xl shadow-lg dropdown-menu z-50",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)"},role:"menu",children:[C.jsxs("button",{onClick:l,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm hover:bg-[var(--bg-hover)] transition-colors first:rounded-t-xl",style:{color:r?"var(--text-success, #22c55e)":"var(--text-primary)"},role:"menuitem",children:[r?C.jsx(Mne,{}):C.jsx(Nne,{}),C.jsx("span",{children:r?"Copied!":"Copy to clipboard"})]}),C.jsx("div",{className:"mx-3 my-1",style:{borderTop:"1px solid var(--border-primary)"}}),C.jsxs("button",{onClick:u,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm hover:bg-[var(--bg-hover)] transition-colors",style:{color:"var(--text-primary)"},role:"menuitem",children:[C.jsx(L2,{}),C.jsx("span",{children:"Download as .md"})]}),C.jsxs("button",{onClick:d,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm hover:bg-[var(--bg-hover)] transition-colors",style:{color:"var(--text-primary)"},role:"menuitem",children:[C.jsx(L2,{}),C.jsx("span",{children:"Download as .docx"})]}),C.jsxs("button",{onClick:h,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm hover:bg-[var(--bg-hover)] transition-colors",style:{color:"var(--text-primary)"},role:"menuitem",children:[C.jsx(L2,{}),C.jsx("span",{children:"Download as .pdf"})]}),C.jsx("div",{className:"mx-3 my-1",style:{borderTop:"1px solid var(--border-primary)"}}),C.jsxs("button",{onClick:p,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm hover:bg-[var(--bg-hover)] transition-colors last:rounded-b-xl",style:{color:"var(--text-primary)"},role:"menuitem",children:[C.jsx(One,{}),C.jsx("span",{children:"Print"})]})]})]}):null},Dne=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),C.jsx("polyline",{points:"14 2 14 8 20 8"}),C.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),C.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),C.jsx("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]}),Ine=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),C.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Lne=()=>C.jsxs("div",{className:"flex items-center gap-1","aria-label":"Streaming content",children:[C.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--text-tertiary)] animate-bounce motion-reduce:animate-none [animation-duration:900ms] [animation-delay:0ms] opacity-90"}),C.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--text-tertiary)] animate-bounce motion-reduce:animate-none [animation-duration:900ms] [animation-delay:140ms] opacity-90"}),C.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--text-tertiary)] animate-bounce motion-reduce:animate-none [animation-duration:900ms] [animation-delay:280ms] opacity-90"})]}),Pne=({closeButtonRef:t})=>{const{state:e,closeCanvas:n,updateContent:r}=Dd(),[i,s]=U.useState(!1),[a,l]=U.useState(e.title),u=()=>{e.isDone&&(l(e.title),s(!0))},d=()=>{s(!1)},h=p=>{p.key==="Enter"?(p.preventDefault(),s(!1)):p.key==="Escape"&&(l(e.title),s(!1))};return C.jsxs("div",{className:"flex h-14 items-center justify-between px-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-primary)"},children:[C.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[C.jsx("div",{className:"flex-shrink-0",style:{color:"var(--text-secondary)"},children:C.jsx(Dne,{})}),i?C.jsx("input",{type:"text",value:a,onChange:p=>l(p.target.value),onBlur:d,onKeyDown:h,autoFocus:!0,className:"text-base font-medium bg-transparent border-none focus:outline-none focus:ring-1 focus:ring-[var(--accent-primary)] rounded px-1 min-w-0 flex-1",style:{color:"var(--text-primary)"}}):C.jsx("h2",{onClick:u,className:`text-base font-medium truncate ${e.isDone?"cursor-text hover:bg-[var(--bg-hover)] rounded px-1 -mx-1":""}`,style:{color:"var(--text-primary)"},title:e.title,children:e.title||"Untitled"}),e.isStreaming&&C.jsx("div",{className:"flex-shrink-0 ml-2",children:C.jsx(Lne,{})})]}),C.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[C.jsx(Rne,{}),C.jsx("button",{ref:t,onClick:n,className:"p-2 rounded-lg hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20",style:{color:"var(--text-secondary)"},"aria-label":"Close canvas",children:C.jsx(Ine,{})})]})]})};function Xr(t){this.content=t}Xr.prototype={constructor:Xr,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new Xr(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Xr(n)},addToStart:function(t,e){return new Xr([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Xr(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new Xr(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Xr.from(t),t.size?new Xr(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Xr.from(t),t.size?new Xr(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Xr.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Xr.from=function(t){if(t instanceof Xr)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Xr(e)};function yO(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){let a=yO(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function EO(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let a=t.child(--i),l=e.child(--s),u=a.nodeSize;if(a==l){n-=u,r-=u;continue}if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let d=0,h=Math.min(a.text.length,l.text.length);for(;d<h&&a.text[a.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let d=EO(a.content,l.content,n-1,r-1);if(d)return d}n-=u,r-=u}}class Ae{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let a=0,l=0;l<n;a++){let u=this.content[a],d=l+u.nodeSize;if(d>e&&r(u,i+l,s||null,a)!==!1&&u.content.size){let h=l+1;u.nodesBetween(Math.max(0,e-h),Math.min(u.content.size,n-h),r,i+h)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",a=!0;return this.nodesBetween(e,n,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,n-u):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(a?a=!1:s+=r),s+=d},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new Ae(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;u>e&&((a<e||u>n)&&(l.isText?l=l.cut(Math.max(0,e-a),Math.min(l.text.length,n-a)):l=l.cut(Math.max(0,e-a-1),Math.min(l.content.size,n-a-1))),r.push(l),i+=l.nodeSize),a=u}return new Ae(r,i)}cutByIndex(e,n){return e==n?Ae.empty:e==0&&n==this.content.length?this:new Ae(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Ae(i,s)}addToStart(e){return new Ae([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ae(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return yO(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return EO(this,e,n,r)}findIndex(e){if(e==0)return wm(0,e);if(e==this.size)return wm(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?wm(n+1,s):wm(n,r);r=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,n){if(!n)return Ae.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ae(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ae.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new Ae(n||e,r)}static from(e){if(!e)return Ae.empty;if(e instanceof Ae)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ae([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ae.empty=new Ae([],0);const P2={index:0,offset:0};function wm(t,e){return P2.index=t,P2.offset=e,P2}function Rg(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Rg(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Rg(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let En=class _4{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!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))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Rg(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return _4.none;if(e instanceof _4)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};En.none=[];class Dg extends Error{}class We{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=xO(this.content,e+this.openStart,n);return r&&new We(r,this.openStart,this.openEnd)}removeBetween(e,n){return new We(_O(this.content,e+this.openStart,n+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,n){if(!n)return We.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new We(Ae.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new We(e,r,i)}}We.empty=new We(Ae.empty,0,0);function _O(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:a,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(_O(s.content,e-i-1,n-i-1)))}function xO(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),a=t.maybeChild(i);if(s==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=xO(a.content,e-s-1,n,a);return l&&t.replaceChild(i,a.copy(l))}function Bne(t,e,n){if(n.openStart>t.depth)throw new Dg("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Dg("Inconsistent open depths");return TO(t,e,n,0)}function TO(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let a=TO(t,e,n,r+1);return s.copy(s.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,l=a.content;return Mu(a,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:a,end:l}=zne(n,t);return Mu(s,wO(t,a,l,e,r))}else return Mu(s,Ig(t,e,r))}function SO(t,e){if(!e.type.compatibleContent(t.type))throw new Dg("Cannot join "+e.type.name+" onto "+t.type.name)}function x4(t,e,n){let r=t.node(n);return SO(r,e.node(n)),r}function Nu(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Of(t,e,n,r){let i=(e||t).node(n),s=0,a=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Nu(t.nodeAfter,r),s++));for(let l=s;l<a;l++)Nu(i.child(l),r);e&&e.depth==n&&e.textOffset&&Nu(e.nodeBefore,r)}function Mu(t,e){return t.type.checkContent(e),t.copy(e)}function wO(t,e,n,r,i){let s=t.depth>i&&x4(t,e,i+1),a=r.depth>i&&x4(n,r,i+1),l=[];return Of(null,t,i,l),s&&a&&e.index(i)==n.index(i)?(SO(s,a),Nu(Mu(s,wO(t,e,n,r,i+1)),l)):(s&&Nu(Mu(s,Ig(t,e,i+1)),l),Of(e,n,i,l),a&&Nu(Mu(a,Ig(n,r,i+1)),l)),Of(r,null,i,l),new Ae(l)}function Ig(t,e,n){let r=[];if(Of(null,t,n,r),t.depth>n){let i=x4(t,e,n+1);Nu(Mu(i,Ig(t,e,n+1)),r)}return Of(e,null,n,r),new Ae(r)}function zne(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(Ae.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Jf{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return En.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Lg(this,e,r);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 n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let a=e;;){let{index:l,offset:u}=a.content.findIndex(s),d=s-u;if(r.push(a,l,i+u),!d||(a=a.child(l),a.isText))break;s=d-1,i+=u+1}return new Jf(n,r,s)}static resolveCached(e,n){let r=r8.get(e);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==n)return a}else r8.set(e,r=new Fne);let i=r.elts[r.i]=Jf.resolve(e,n);return r.i=(r.i+1)%Une,i}}class Fne{constructor(){this.elts=[],this.i=0}}const Une=12,r8=new WeakMap;class Lg{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}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 Hne=Object.create(null);class Qs{constructor(e,n,r,i=En.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||Ae.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,n,r,i=0){this.content.nodesBetween(e,n,r,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,n,r,i){return this.content.textBetween(e,n,r,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,n,r){return this.type==e&&Rg(this.attrs,n||e.defaultAttrs||Hne)&&En.sameSet(this.marks,r||En.none)}copy(e=null){return e==this.content?this:new Qs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Qs(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return We.empty;let i=this.resolve(e),s=this.resolve(n),a=r?0:i.sharedDepth(n),l=i.start(a),d=i.node(a).content.cut(i.pos-l,s.pos-l);return new We(d,i.depth-a,s.depth-a)}replace(e,n,r){return Bne(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Jf.resolveCached(this,e)}resolveNoCache(e){return Jf.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.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()+")"),kO(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Ae.empty,i=0,s=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,s),l=a&&a.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=i;u<s;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),a=s&&s.matchFragment(this.content,n);return a?a.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=En.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!En.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=Ae.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}}Qs.prototype.text=void 0;class Pg extends Qs{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):kO(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Pg(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Pg(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function kO(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Pu{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new jne(e,n);if(r.next==null)return Pu.empty;let i=CO(r);r.next&&r.err("Unexpected trailing text");let s=Kne(Wne(i));return Xne(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;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:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(a,l){let u=a.matchFragment(e,r);if(u&&(!n||u.validEnd))return Ae.from(l.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:h,next:p}=a.next[d];if(!(h.isText||h.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let g=s(p,l.concat(h));if(g)return g}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let l=i;l.type;l=l.via)a.push(l.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:l,next:u}=s.next[a];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||u.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.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 n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return s}).join(`
`)}}Pu.empty=new Pu(!0);class jne{constructor(e,n){this.string=e,this.nodeTypes=n,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 CO(t){let e=[];do e.push($ne(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function $ne(t){let e=[];do e.push(qne(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function qne(t){let e=Yne(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Vne(t,e);else break;return e}function i8(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Vne(t,e){let n=i8(t),r=n;return t.eat(",")&&(t.next!="}"?r=i8(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Gne(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let a=n[s];a.isInGroup(e)&&i.push(a)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Yne(t){if(t.eat("(")){let e=CO(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Gne(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Wne(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(a,l,u){let d={term:u,to:l};return e[a].push(d),d}function i(a,l){a.forEach(u=>u.to=l)}function s(a,l){if(a.type=="choice")return a.exprs.reduce((u,d)=>u.concat(s(d,l)),[]);if(a.type=="seq")for(let u=0;;u++){let d=s(a.exprs[u],l);if(u==a.exprs.length-1)return d;i(d,l=n())}else if(a.type=="star"){let u=n();return r(l,u),i(s(a.expr,u),u),[r(u)]}else if(a.type=="plus"){let u=n();return i(s(a.expr,l),u),i(s(a.expr,u),u),[r(u)]}else{if(a.type=="opt")return[r(l)].concat(s(a.expr,l));if(a.type=="range"){let u=l;for(let d=0;d<a.min;d++){let h=n();i(s(a.expr,u),h),u=h}if(a.max==-1)i(s(a.expr,u),u);else for(let d=a.min;d<a.max;d++){let h=n();r(u,h),i(s(a.expr,u),h),u=h}return[r(u)]}else{if(a.type=="name")return[r(l,void 0,a.value)];throw new Error("Unknown expr type")}}}}function AO(t,e){return e-t}function s8(t,e){let n=[];return r(e),n.sort(AO);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let a=0;a<s.length;a++){let{term:l,to:u}=s[a];!l&&n.indexOf(u)==-1&&r(u)}}}function Kne(t){let e=Object.create(null);return n(s8(t,0));function n(r){let i=[];r.forEach(a=>{t[a].forEach(({term:l,to:u})=>{if(!l)return;let d;for(let h=0;h<i.length;h++)i[h][0]==l&&(d=i[h][1]);s8(t,u).forEach(h=>{d||i.push([l,d=[]]),d.indexOf(h)==-1&&d.push(h)})})});let s=e[r.join(",")]=new Pu(r.indexOf(t.length-1)>-1);for(let a=0;a<i.length;a++){let l=i[a][1].sort(AO);s.next.push({type:i[a][0],next:e[l.join(",")]||n(l)})}return s}}function Xne(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,a=[];for(let l=0;l<i.next.length;l++){let{type:u,next:d}=i.next[l];a.push(u.name),s&&!(u.isText||u.hasRequiredAttrs())&&(s=!1),r.indexOf(d)==-1&&r.push(d)}s&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function NO(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function MO(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function OO(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function RO(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Zne(t,r,e[r]);return n}let a8=class DO{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=RO(e,r.attrs),this.defaultAttrs=NO(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Pu.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:MO(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Qs(this,this.computeAttrs(e),Ae.from(n),En.setFrom(r))}createChecked(e=null,n,r){return n=Ae.from(n),this.checkContent(n),new Qs(this,this.computeAttrs(e),n,En.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=Ae.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(Ae.empty,!0);return s?new Qs(this,e,n.append(s),En.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).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){OO(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 n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:En.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,a)=>r[s]=new DO(s,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Qne(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class Zne{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Qne(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class cb{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=RO(e,i.attrs),this.excluded=null;let s=NO(this.attrs);this.instance=s?new En(this,s):null}create(e=null){return!e&&this.instance?this.instance:new En(this,MO(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,a)=>r[s]=new cb(s,i++,n,a)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){OO(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class IO{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Xr.from(e.nodes),n.marks=Xr.from(e.marks||{}),this.nodes=a8.compile(this.spec.nodes,this),this.marks=cb.compile(this.spec.marks,this);let r=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],a=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=Pu.parse(a,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=l=="_"?null:l?o8(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:o8(this,a.split(" "))}this.nodeFromJSON=i=>Qs.fromJSON(this,i),this.markFromJSON=i=>En.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof a8){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(n,r,i)}text(e,n){let r=this.nodes.text;return new Pg(r,r.defaultAttrs,e,En.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function o8(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],a=s;if(s)n.push(s);else for(let l in t.marks){let u=t.marks[l];(i=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Jne(t){return t.tag!=null}function ere(t){return t.style!=null}let Rf=class T4{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Jne(i))this.tags.push(i);else if(ere(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.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,n={}){let r=new u8(this,n,!1);return r.addAll(e,En.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new u8(this,n,!0);return r.addAll(e,En.none,n.from,n.to),We.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(rre(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],l=a.style;if(!(l.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(a.getAttrs){let u=a.getAttrs(n);if(u===!1)continue;a.attrs=u||void 0}return a}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let l=n[a];if((l.priority==null?50:l.priority)<s)break}n.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{r(a=c8(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{r(a=c8(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new T4(e,T4.schemaRules(e)))}};const LO={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},tre={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},PO={ol:!0,ul:!0},eh=1,S4=2,Df=4;function l8(t,e,n){return e!=null?(e?eh:0)|(e==="full"?S4:0):t&&t.whitespace=="pre"?eh|S4:n&~Df}class km{constructor(e,n,r,i,s,a){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=En.none,this.match=s||(a&Df?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Ae.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&eh)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.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 n=Ae.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Ae.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!LO.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class u8{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,a=l8(null,n.preserveWhitespace,0)|(r?Df:0);i?s=new km(i.type,i.attrs,En.none,!0,n.topMatch||i.type.contentMatch,a):r?s=new km(null,null,En.none,!0,null,a):s=new km(e.schema.topNodeType,null,En.none,!0,null,a),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&S4?"full":this.localPreserveWS||(i.options&eh)>0,{schema:a}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
`);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let u=0;u<l.length;u++)u&&this.insertNode(a.linebreakReplacement.create(),n,!0),l[u]&&this.insertNode(a.text(l[u]),n,!/\S/.test(l[u]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],u=e.previousSibling;(!l||u&&u.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),l;PO.hasOwnProperty(a)&&this.parser.normalizeLists&&nre(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(u?u.ignore:tre.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(e=u.skip);let d,h=this.needsBlock;if(LO.hasOwnProperty(a))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),d=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let p=u&&u.skip?n:this.readStyles(e,n);p&&this.addAll(e,p),d&&this.sync(s),this.needsBlock=h}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,u,d,u.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=r.getPropertyValue(s);if(a)for(let l=void 0;;){let u=this.parser.matchStyle(s,a,this,l);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(d=>!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return n}addElementByRule(e,n,r,i){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let u=this.enter(a,n.attrs||null,r,n.preserveWhitespace);u&&(s=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let l=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r,!1));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r),this.findAround(e,u,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let a=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];a!=l;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let a=this.open,l=0;a>=0;a--){let u=this.nodes[a],d=u.findWrapping(e);if(d&&(!i||i.length>d.length+l)&&(i=d,s=u,!d.length))break;if(u.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let a=0;a<i.length;a++)n=this.enterInner(i[a],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let a=En.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):d8(l.type,e.type))&&(a=l.addToSet(a));return s.content.push(e.mark(a)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let l=l8(e,s,a.options);a.options&Df&&a.content.length==0&&(l|=Df);let u=En.none;return r=r.filter(d=>(a.type?a.type.allowsMarkType(d.type):d8(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new km(e,n,u,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=eh)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&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)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),a=(l,u)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;u>=s;u--)if(a(l-1,u))return!0;return!1}else{let h=u>0||u==0&&i?this.nodes[u].type:r&&u>=s?r.node(u-s).type:null;if(!h||h.name!=d&&!h.isInGroup(d))return!1;u--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function nre(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&PO.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function rre(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function c8(t){let e={};for(let n in t)e[n]=t[n];return e}function d8(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],a=l=>{s.push(l);for(let u=0;u<l.edgeCount;u++){let{type:d,next:h}=l.edge(u);if(d==e||s.indexOf(h)<0&&a(h))return!0}};if(a(i.contentMatch))return!0}}class Qu{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=B2(n).createDocumentFragment());let i=r,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let l=0,u=0;for(;l<s.length&&u<a.marks.length;){let d=a.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(s[l][0])||d.type.spec.spanning===!1)break;l++,u++}for(;l<s.length;)i=s.pop()[1];for(;u<a.marks.length;){let d=a.marks[u++],h=this.serializeMark(d,a.isInline,n);h&&(s.push([d,i]),i.appendChild(h.dom),i=h.contentDOM||h.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=ig(B2(n),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,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&ig(B2(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return ig(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Qu(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=f8(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return f8(e.marks)}}function f8(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function B2(t){return t.document||window.document}const h8=new WeakMap;function ire(t){let e=h8.get(t);return e===void 0&&h8.set(t,e=sre(t)),e}function sre(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function ig(t,e,n,r){if(typeof e=="string")return{dom:t.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(r&&(s=ire(r))&&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 a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let l,u=n?t.createElementNS(n,i):t.createElement(i),d=e[1],h=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){h=2;for(let p in d)if(d[p]!=null){let g=p.indexOf(" ");g>0?u.setAttributeNS(p.slice(0,g),p.slice(g+1),d[p]):p=="style"&&u.style?u.style.cssText=d[p]:u.setAttribute(p,d[p])}}for(let p=h;p<e.length;p++){let g=e[p];if(g===0){if(p<e.length-1||p>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:b,contentDOM:y}=ig(t,g,n,r);if(u.appendChild(b),y){if(l)throw new RangeError("Multiple content holes");l=y}}}return{dom:u,contentDOM:l}}const BO=65535,zO=Math.pow(2,16);function are(t,e){return t+e*zO}function p8(t){return t&BO}function ore(t){return(t-(t&BO))/zO}const FO=1,UO=2,sg=4,HO=8;class w4{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&HO)>0}get deletedBefore(){return(this.delInfo&(FO|sg))>0}get deletedAfter(){return(this.delInfo&(UO|sg))>0}get deletedAcross(){return(this.delInfo&sg)>0}}class ss{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ss.empty)return ss.empty}recover(e){let n=0,r=p8(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+ore(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?i:0);if(u>e)break;let d=this.ranges[l+s],h=this.ranges[l+a],p=u+d;if(e<=p){let g=d?e==u?-1:e==p?1:n:n,b=u+i+(g<0?0:h);if(r)return b;let y=e==(n<0?u:p)?null:are(l/3,e-u),E=e==u?UO:e==p?FO:sg;return(n<0?e!=u:e!=p)&&(E|=HO),new w4(b,E,y)}i+=h-d}return r?e+i:new w4(e+i,0,null)}touches(e,n){let r=0,i=p8(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?r:0);if(u>e)break;let d=this.ranges[l+s],h=u+d;if(e<=h&&l==i*3)return!0;r+=this.ranges[l+a]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],l=a-(this.inverted?s:0),u=a+(this.inverted?0:s),d=this.ranges[i+n],h=this.ranges[i+r];e(l,l+d,u,u+h),s+=h-d}}invert(){return new ss(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ss.empty:new ss(e<0?[0,-e,0]:[0,0,e])}}ss.empty=new ss([]);class th{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new th(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new th;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s],l=a.mapResult(e,n);if(l.recover!=null){let u=this.getMirror(s);if(u!=null&&u>s&&u<this.to){s=u,e=this._maps[u].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new w4(e,i,null)}}const z2=Object.create(null);class hi{getMap(){return ss.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=z2[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in z2)throw new RangeError("Duplicate use of step JSON ID "+e);return z2[e]=n,n.prototype.jsonID=e,n}}class _r{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new _r(e,null)}static fail(e){return new _r(null,e)}static fromReplace(e,n,r,i){try{return _r.ok(e.replace(n,r,i))}catch(s){if(s instanceof Dg)return _r.fail(s.message);throw s}}}function D_(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(D_(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return Ae.fromArray(r)}class El extends hi{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new We(D_(n.content,(a,l)=>!a.isAtom||!l.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return _r.fromReplace(e,this.from,this.to,s)}invert(){return new Ws(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new El(n.pos,r.pos,this.mark)}merge(e){return e instanceof El&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new El(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new El(n.from,n.to,e.markFromJSON(n.mark))}}hi.jsonID("addMark",El);class Ws extends hi{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new We(D_(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return _r.fromReplace(e,this.from,this.to,r)}invert(){return new El(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ws(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ws&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ws(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ws(n.from,n.to,e.markFromJSON(n.mark))}}hi.jsonID("removeMark",Ws);class _l extends hi{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return _r.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return _r.fromReplace(e,this.pos,this.pos+1,new We(Ae.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new _l(this.pos,n.marks[i]);return new _l(this.pos,this.mark)}}return new Bu(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new _l(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new _l(n.pos,e.markFromJSON(n.mark))}}hi.jsonID("addNodeMark",_l);class Bu extends hi{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return _r.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return _r.fromReplace(e,this.pos,this.pos+1,new We(Ae.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new _l(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bu(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Bu(n.pos,e.markFromJSON(n.mark))}}hi.jsonID("removeNodeMark",Bu);class Fr extends hi{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&k4(e,this.from,this.to)?_r.fail("Structure replace would overwrite content"):_r.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ss([this.from,this.to-this.from,this.slice.size])}invert(e){return new Fr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Fr(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Fr)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?We.empty:new We(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Fr(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?We.empty:new We(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Fr(e.from,this.to,n,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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Fr(n.from,n.to,We.fromJSON(e,n.slice),!!n.structure)}}hi.jsonID("replace",Fr);class $r extends hi{constructor(e,n,r,i,s,a,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=a,this.structure=l}apply(e){if(this.structure&&(k4(e,this.from,this.gapFrom)||k4(e,this.gapTo,this.to)))return _r.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return _r.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?_r.fromReplace(e,this.from,this.to,r):_r.fail("Content does not fit in gap")}getMap(){return new ss([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new $r(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new $r(n.pos,r.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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new $r(n.from,n.to,n.gapFrom,n.gapTo,We.fromJSON(e,n.slice),n.insert,!!n.structure)}}hi.jsonID("replaceAround",$r);function k4(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function lre(t,e,n,r){let i=[],s=[],a,l;t.doc.nodesBetween(e,n,(u,d,h)=>{if(!u.isInline)return;let p=u.marks;if(!r.isInSet(p)&&h.type.allowsMarkType(r.type)){let g=Math.max(d,e),b=Math.min(d+u.nodeSize,n),y=r.addToSet(p);for(let E=0;E<p.length;E++)p[E].isInSet(y)||(a&&a.to==g&&a.mark.eq(p[E])?a.to=b:i.push(a=new Ws(g,b,p[E])));l&&l.to==g?l.to=b:s.push(l=new El(g,b,r))}}),i.forEach(u=>t.step(u)),s.forEach(u=>t.step(u))}function ure(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(a,l)=>{if(!a.isInline)return;s++;let u=null;if(r instanceof cb){let d=a.marks,h;for(;h=r.isInSet(d);)(u||(u=[])).push(h),d=h.removeFromSet(d)}else r?r.isInSet(a.marks)&&(u=[r]):u=a.marks;if(u&&u.length){let d=Math.min(l+a.nodeSize,n);for(let h=0;h<u.length;h++){let p=u[h],g;for(let b=0;b<i.length;b++){let y=i[b];y.step==s-1&&p.eq(i[b].style)&&(g=y)}g?(g.to=d,g.step=s):i.push({style:p,from:Math.max(l,e),to:d,step:s})}}}),i.forEach(a=>t.step(new Ws(a.from,a.to,a.style)))}function I_(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),a=[],l=e+1;for(let u=0;u<s.childCount;u++){let d=s.child(u),h=l+d.nodeSize,p=r.matchType(d.type);if(!p)a.push(new Fr(l,h,We.empty));else{r=p;for(let g=0;g<d.marks.length;g++)n.allowsMarkType(d.marks[g].type)||t.step(new Ws(l,h,d.marks[g]));if(i&&d.isText&&n.whitespace!="pre"){let g,b=/\r?\n|\r/g,y;for(;g=b.exec(d.text);)y||(y=new We(Ae.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),a.push(new Fr(l+g.index,l+g.index+g[0].length,y))}}l=h}if(!r.validEnd){let u=r.fillBefore(Ae.empty,!0);t.replace(l,l,new We(u,0,0))}for(let u=a.length-1;u>=0;u--)t.step(a[u])}function cre(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Id(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let a=t.$from.node(r),l=t.$from.index(r)+i,u=t.$to.indexAfter(r)-s;if(r<t.depth&&a.canReplace(l,u,n))return r;if(r==0||a.type.spec.isolating||!cre(a,l,u))break;l&&(i=1),u<a.childCount&&(s=1)}return null}function dre(t,e,n){let{$from:r,$to:i,depth:s}=e,a=r.before(s+1),l=i.after(s+1),u=a,d=l,h=Ae.empty,p=0;for(let y=s,E=!1;y>n;y--)E||r.index(y)>0?(E=!0,h=Ae.from(r.node(y).copy(h)),p++):u--;let g=Ae.empty,b=0;for(let y=s,E=!1;y>n;y--)E||i.after(y+1)<i.end(y)?(E=!0,g=Ae.from(i.node(y).copy(g)),b++):d++;t.step(new $r(u,d,a,l,new We(h.append(g),p,b),h.size-p,!0))}function L_(t,e,n=null,r=t){let i=fre(t,e),s=i&&hre(r,e);return s?i.map(m8).concat({type:e,attrs:n}).concat(s.map(m8)):null}function m8(t){return{type:t,attrs:null}}function fre(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return n.canReplaceWith(r,i,a)?s:null}function hre(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let u=(a.length?a[a.length-1]:e).contentMatch;for(let d=r;u&&d<i;d++)u=u.matchType(n.child(d).type);return!u||!u.validEnd?null:a}function pre(t,e,n){let r=Ae.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let l=n[a].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Ae.from(n[a].type.create(n[a].attrs,r))}let i=e.start,s=e.end;t.step(new $r(i,s,i,s,new We(r,0,0),n.length,!0))}function mre(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(a,l)=>{let u=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,u)&&gre(t.doc,t.mapping.slice(s).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",y=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!y?d=!1:!b&&y&&(d=!0)}d===!1&&$O(t,a,l,s),I_(t,t.mapping.slice(s).map(l,1),r,void 0,d===null);let h=t.mapping.slice(s),p=h.map(l,1),g=h.map(l+a.nodeSize,1);return t.step(new $r(p,g,p+1,g-1,new We(Ae.from(r.create(u,null,a.marks)),0,0),1,!0)),d===!0&&jO(t,a,l,s),!1}})}function jO(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let a,l=/\r?\n|\r/g;for(;a=l.exec(i.text);){let u=t.mapping.slice(r).map(n+1+s+a.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function $O(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+s);t.replaceWith(a,a+1,e.type.schema.text(`
`))}})}function gre(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function bre(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new $r(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new We(Ae.from(a),0,0),1,!0))}function po(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,a=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,h=n-2;d>s;d--,h--){let p=i.node(d),g=i.index(d);if(p.type.spec.isolating)return!1;let b=p.content.cutByIndex(g,p.childCount),y=r&&r[h+1];y&&(b=b.replaceChild(0,y.type.create(y.attrs)));let E=r&&r[h]||p;if(!p.canReplace(g+1,p.childCount)||!E.type.validContent(b))return!1}let l=i.indexAfter(s),u=r&&r[0];return i.node(s).canReplaceWith(l,l,u?u.type:i.node(s+1).type)}function vre(t,e,n=1,r){let i=t.doc.resolve(e),s=Ae.empty,a=Ae.empty;for(let l=i.depth,u=i.depth-n,d=n-1;l>u;l--,d--){s=Ae.from(i.node(l).copy(s));let h=r&&r[d];a=Ae.from(h?h.type.create(h.attrs,a):i.node(l).copy(a))}t.step(new Fr(e,e,new We(s.append(a),n,n),!0))}function zl(t,e){let n=t.resolve(e),r=n.index();return qO(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function yre(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),a=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(a),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function qO(t,e){return!!(t&&e&&!t.isLeaf&&yre(t,e))}function db(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,a,l=r.index(i);if(i==r.depth?(s=r.nodeBefore,a=r.nodeAfter):n>0?(s=r.node(i+1),l++,a=r.node(i).maybeChild(l)):(s=r.node(i).maybeChild(l-1),a=r.node(i+1)),s&&!s.isTextblock&&qO(s,a)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function Ere(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),a=s.node().type;if(i&&a.inlineContent){let h=a.whitespace=="pre",p=!!a.contentMatch.matchType(i);h&&!p?r=!1:!h&&p&&(r=!0)}let l=t.steps.length;if(r===!1){let h=t.doc.resolve(e+n);$O(t,h.node(),h.before(),l)}a.inlineContent&&I_(t,e+n-1,a,s.node().contentMatchAt(s.index()),r==null);let u=t.mapping.slice(l),d=u.map(e-n);if(t.step(new Fr(d,u.map(e+n,-1),We.empty,!0)),r===!0){let h=t.doc.resolve(d);jO(t,h.node(),h.before(),t.steps.length)}return t}function _re(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function VO(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let a=r.depth;a>=0;a--){let l=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,u=r.index(a)+(l>0?1:0),d=r.node(a),h=!1;if(s==1)h=d.canReplace(u,u,i);else{let p=d.contentMatchAt(u).findWrapping(i.firstChild.type);h=p&&d.canReplaceWith(u,u,p[0])}if(h)return l==0?r.pos:l<0?r.before(a+1):r.after(a+1)}return null}function fb(t,e,n=e,r=We.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return GO(i,s,r)?new Fr(e,n,r):new xre(i,s,r).fit()}function GO(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class xre{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Ae.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=Ae.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,a=r.depth,l=i.depth;for(;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;let u=new We(s,a,l);return e>-1?new $r(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Fr(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=F2(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:d}=this.frontier[l],h,p=null;if(n==1&&(a?d.matchType(a.type)||(p=d.fillBefore(Ae.from(a),!1)):s&&u.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:p};if(n==2&&a&&(h=d.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:h};if(s&&d.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=F2(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new We(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=F2(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new We(sf(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new We(sf(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let E=0;E<s.length;E++)this.openFrontierNode(s[E]);let a=this.unplaced,l=r?r.content:a.content,u=a.openStart-e,d=0,h=[],{match:p,type:g}=this.frontier[n];if(i){for(let E=0;E<i.childCount;E++)h.push(i.child(E));p=p.matchFragment(i)}let b=l.size+e-(a.content.size-a.openEnd);for(;d<l.childCount;){let E=l.child(d),T=p.matchType(E.type);if(!T)break;d++,(d>1||u==0||E.content.size)&&(p=T,h.push(YO(E.mark(g.allowedMarks(E.marks)),d==1?u:0,d==l.childCount?b:-1)))}let y=d==l.childCount;y||(b=-1),this.placed=af(this.placed,n,Ae.from(h)),this.frontier[n].match=p,y&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,T=l;E<b;E++){let S=T.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),T=S.content}this.unplaced=y?e==0?We.empty:new We(sf(a.content,e-1,1),e-1,b<0?a.openEnd:e-1):new We(sf(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!U2(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=U2(e,n,i,r,s);if(a){for(let l=n-1;l>=0;l--){let{match:u,type:d}=this.frontier[l],h=U2(e,l,d,u,!0);if(!h||h.childCount)continue e}return{depth:n,fit:a,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=af(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=af(this.placed,this.depth,Ae.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Ae.empty,!0);n.childCount&&(this.placed=af(this.placed,this.frontier.length,n))}}function sf(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(sf(t.firstChild.content,e-1,n)))}function af(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(af(t.lastChild.content,e-1,n)))}function F2(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function YO(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,YO(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Ae.empty,!0)))),t.copy(r)}function U2(t,e,n,r,i){let s=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,a);return l&&!Tre(n,s.content,a)?l:null}function Tre(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Sre(t){return t.spec.defining||t.spec.definingForContent}function wre(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(GO(i,s,r))return t.step(new Fr(e,n,r));let a=KO(i,s);a[a.length-1]==0&&a.pop();let l=-(i.depth+1);a.unshift(l);for(let g=i.depth,b=i.pos-1;g>0;g--,b--){let y=i.node(g).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;a.indexOf(g)>-1?l=g:i.before(g)==b&&a.splice(1,0,-g)}let u=a.indexOf(l),d=[],h=r.openStart;for(let g=r.content,b=0;;b++){let y=g.firstChild;if(d.push(y),b==r.openStart)break;g=y.content}for(let g=h-1;g>=0;g--){let b=d[g],y=Sre(b.type);if(y&&!b.sameMarkup(i.node(Math.abs(l)-1)))h=g;else if(y||!b.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let b=(g+h+1)%(r.openStart+1),y=d[b];if(y)for(let E=0;E<a.length;E++){let T=a[(E+u)%a.length],S=!0;T<0&&(S=!1,T=-T);let A=i.node(T-1),R=i.index(T-1);if(A.canReplaceWith(R,R,y.type,y.marks))return t.replace(i.before(T),S?s.after(T):n,new We(WO(r.content,0,r.openStart,b),b,r.openEnd))}}let p=t.steps.length;for(let g=a.length-1;g>=0&&(t.replace(e,n,r),!(t.steps.length>p));g--){let b=a[g];b<0||(e=i.before(b),n=s.after(b))}}function WO(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(WO(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(Ae.empty,!0))}return t}function kre(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=_re(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new We(Ae.from(r),0,0))}function Cre(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=KO(r,i);for(let a=0;a<s.length;a++){let l=s[a],u=a==s.length-1;if(u&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),i.end(l));if(l>0&&(u||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}function KO(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class nd extends hi{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return _r.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return _r.fromReplace(e,this.pos,this.pos+1,new We(Ae.from(i),0,n.isLeaf?0:1))}getMap(){return ss.empty}invert(e){return new nd(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new nd(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new nd(n.pos,n.attr,n.value)}}hi.jsonID("attr",nd);class nh extends hi{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return _r.ok(r)}getMap(){return ss.empty}invert(e){return new nh(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new nh(n.attr,n.value)}}hi.jsonID("docAttr",nh);let cd=class extends Error{};cd=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};cd.prototype=Object.create(Error.prototype);cd.prototype.constructor=cd;cd.prototype.name="TransformError";class XO{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new th}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cd(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((s,a,l,u)=>{e=Math.min(e,l),n=Math.max(n,u)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=We.empty){let i=fb(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new We(Ae.from(r),0,0))}delete(e,n){return this.replace(e,n,We.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return wre(this,e,n,r),this}replaceRangeWith(e,n,r){return kre(this,e,n,r),this}deleteRange(e,n){return Cre(this,e,n),this}lift(e,n){return dre(this,e,n),this}join(e,n=1){return Ere(this,e,n),this}wrap(e,n){return pre(this,e,n),this}setBlockType(e,n=e,r,i=null){return mre(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return bre(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new nd(e,n,r)),this}setDocAttribute(e,n){return this.step(new nh(e,n)),this}addNodeMark(e,n){return this.step(new _l(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof En)n.isInSet(r.marks)&&this.step(new Bu(e,n));else{let i=r.marks,s,a=[];for(;s=n.isInSet(i);)a.push(new Bu(e,s)),i=s.removeFromSet(i);for(let l=a.length-1;l>=0;l--)this.step(a[l])}return this}split(e,n=1,r){return vre(this,e,n,r),this}addMark(e,n,r){return lre(this,e,n,r),this}removeMark(e,n,r){return ure(this,e,n,r),this}clearIncompatible(e,n,r){return I_(this,e,n,r),this}}const H2=Object.create(null);class It{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Are(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=We.empty){let r=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=r,r=r.lastChild;let s=e.steps.length,a=this.ranges;for(let l=0;l<a.length;l++){let{$from:u,$to:d}=a[l],h=e.mapping.slice(s);e.replaceRange(h.map(u.pos),h.map(d.pos),l?We.empty:n),l==0&&v8(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],u=e.mapping.slice(r),d=u.map(a.pos),h=u.map(l.pos);s?e.deleteRange(d,h):(e.replaceRangeWith(d,h,n),v8(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new Tt(e):Vc(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=n<0?Vc(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Vc(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new us(e.node(0))}static atStart(e){return Vc(e,e,0,0,1)||new us(e)}static atEnd(e){return Vc(e,e,e.content.size,e.childCount,-1)||new us(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=H2[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in H2)throw new RangeError("Duplicate use of selection JSON ID "+e);return H2[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Tt.between(this.$anchor,this.$head).getBookmark()}}It.prototype.visible=!0;class Are{constructor(e,n){this.$from=e,this.$to=n}}let g8=!1;function b8(t){!g8&&!t.parent.inlineContent&&(g8=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Tt extends It{constructor(e,n=e){b8(e),b8(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return It.near(r);let i=e.resolve(n.map(this.anchor));return new Tt(i.parent.inlineContent?i:r,r)}replace(e,n=We.empty){if(super.replace(e,n),n==We.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Tt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new hb(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Tt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=It.findFrom(n,r,!0)||It.findFrom(n,-r,!0);if(s)n=s.$head;else return It.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(It.findFrom(e,-r,!0)||It.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new Tt(e,n)}}It.jsonID("text",Tt);class hb{constructor(e,n){this.anchor=e,this.head=n}map(e){return new hb(e.map(this.anchor),e.map(this.head))}resolve(e){return Tt.between(e.resolve(this.anchor),e.resolve(this.head))}}class dt extends It{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?It.near(s):new dt(s)}content(){return new We(Ae.from(this.node),0,0)}eq(e){return e instanceof dt&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new P_(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new dt(e.resolve(n.anchor))}static create(e,n){return new dt(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}dt.prototype.visible=!1;It.jsonID("node",dt);class P_{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new hb(r,r):new P_(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&dt.isSelectable(r)?new dt(n):It.near(n)}}class us extends It{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=We.empty){if(n==We.empty){e.delete(0,e.doc.content.size);let r=It.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new us(e)}map(e){return new us(e)}eq(e){return e instanceof us}getBookmark(){return Nre}}It.jsonID("all",us);const Nre={map(){return this},resolve(t){return new us(t)}};function Vc(t,e,n,r,i,s=!1){if(e.inlineContent)return Tt.create(t,n);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let l=e.child(a);if(l.isAtom){if(!s&&dt.isSelectable(l))return dt.create(t,n-(i<0?l.nodeSize:0))}else{let u=Vc(t,l,n+i,i<0?l.childCount:0,i,s);if(u)return u}n+=l.nodeSize*i}return null}function v8(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Fr||i instanceof $r))return;let s=t.mapping.maps[r],a;s.forEach((l,u,d,h)=>{a==null&&(a=h)}),t.setSelection(It.near(t.doc.resolve(a),n))}const y8=1,Cm=2,E8=4;class Mre extends XO{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|y8)&~Cm,this.storedMarks=null,this}get selectionSet(){return(this.updated&y8)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Cm,this}ensureMarks(e){return En.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Cm)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Cm,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||En.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let a=this.doc.resolve(n);s=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(It.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=E8,this}get scrolledIntoView(){return(this.updated&E8)>0}}function _8(t,e){return!e||!t?t:t.bind(e)}class of{constructor(e,n,r){this.name=e,this.init=_8(n.init,r),this.apply=_8(n.apply,r)}}const Ore=[new of("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new of("selection",{init(t,e){return t.selection||It.atStart(e.doc)},apply(t){return t.selection}}),new of("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new of("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class j2{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ore.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new of(r.key,r.spec.state,r))})}}class Xc{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let a=0;a<this.config.plugins.length;a++){let l=this.config.plugins[a];if(l.spec.appendTransaction){let u=i?i[a].n:0,d=i?i[a].state:this,h=u<n.length&&l.spec.appendTransaction.call(l,u?n.slice(u):n,d,r);if(h&&r.filterTransaction(h,a)){if(h.setMeta("appendedTransaction",e),!i){i=[];for(let p=0;p<this.config.plugins.length;p++)i.push(p<a?{state:r,n:n.length}:{state:this,n:0})}n.push(h),r=r.applyInner(h),s=!0}i&&(i[a]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Xc(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new Mre(this)}static create(e){let n=new j2(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Xc(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new j2(this.schema,e.plugins),r=n.fields,i=new Xc(n);for(let s=0;s<r.length;s++){let a=r[s].name;i[a]=this.hasOwnProperty(a)?this[a]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new j2(e.schema,e.plugins),s=new Xc(i);return i.fields.forEach(a=>{if(a.name=="doc")s.doc=Qs.fromJSON(e.schema,n.doc);else if(a.name=="selection")s.selection=It.fromJSON(s.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],d=u.spec.state;if(u.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[a.name]=d.fromJSON.call(u,e,n[l],s);return}}s[a.name]=a.init(e,s)}}),s}}function QO(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=QO(i,e,{})),n[r]=i}return n}class Xn{constructor(e){this.spec=e,this.props={},e.props&&QO(e.props,this,this.props),this.key=e.key?e.key.key:ZO("plugin")}getState(e){return e[this.key]}}const $2=Object.create(null);function ZO(t){return t in $2?t+"$"+ ++$2[t]:($2[t]=0,t+"$")}class Dr{constructor(e="key"){this.key=ZO(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const B_=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function JO(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const eR=(t,e,n)=>{let r=JO(t,n);if(!r)return!1;let i=z_(r);if(!i){let a=r.blockRange(),l=a&&Id(a);return l==null?!1:(e&&e(t.tr.lift(a,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(uR(t,i,e,-1))return!0;if(r.parent.content.size==0&&(dd(s,"end")||dt.isSelectable(s)))for(let a=r.depth;;a--){let l=fb(t.doc,r.before(a),r.after(a),We.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=t.tr.step(l);u.setSelection(dd(s,"end")?It.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):dt.create(u.doc,i.pos-s.nodeSize)),e(u.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},Rre=(t,e,n)=>{let r=JO(t,n);if(!r)return!1;let i=z_(r);return i?tR(t,i,e):!1},Dre=(t,e,n)=>{let r=rR(t,n);if(!r)return!1;let i=F_(r);return i?tR(t,i,e):!1};function tR(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let h=i.lastChild;if(!h)return!1;i=h}let a=e.nodeAfter,l=a,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let h=l.firstChild;if(!h)return!1;l=h}let d=fb(t.doc,s,u,We.empty);if(!d||d.from!=s||d instanceof Fr&&d.slice.size>=u-s)return!1;if(n){let h=t.tr.step(d);h.setSelection(Tt.create(h.doc,s)),n(h.scrollIntoView())}return!0}function dd(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const nR=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=z_(r)}let a=s&&s.nodeBefore;return!a||!dt.isSelectable(a)?!1:(e&&e(t.tr.setSelection(dt.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function z_(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function rR(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const iR=(t,e,n)=>{let r=rR(t,n);if(!r)return!1;let i=F_(r);if(!i)return!1;let s=i.nodeAfter;if(uR(t,i,e,1))return!0;if(r.parent.content.size==0&&(dd(s,"start")||dt.isSelectable(s))){let a=fb(t.doc,r.before(),r.after(),We.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(dd(s,"start")?It.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):dt.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},sR=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=F_(r)}let a=s&&s.nodeAfter;return!a||!dt.isSelectable(a)?!1:(e&&e(t.tr.setSelection(dt.create(t.doc,s.pos)).scrollIntoView()),!0)};function F_(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Ire=(t,e)=>{let n=t.selection,r=n instanceof dt,i;if(r){if(n.node.isTextblock||!zl(t.doc,n.from))return!1;i=n.from}else if(i=db(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(dt.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},Lre=(t,e)=>{let n=t.selection,r;if(n instanceof dt){if(n.node.isTextblock||!zl(t.doc,n.to))return!1;r=n.to}else if(r=db(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Pre=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&Id(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},aR=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
`).scrollIntoView()),!0)};function U_(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Bre=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),a=U_(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,a.createAndFill());u.setSelection(It.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},oR=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof us||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=U_(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(a,s.createAndFill());l.setSelection(Tt.create(l.doc,a+1)),e(l.scrollIntoView())}return!0},lR=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(po(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Id(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function zre(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof dt&&e.selection.node.isBlock)return!r.parentOffset||!po(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],a,l,u=!1,d=!1;for(let b=r.depth;;b--)if(r.node(b).isBlock){u=r.end(b)==r.pos+(r.depth-b),d=r.start(b)==r.pos-(r.depth-b),l=U_(r.node(b-1).contentMatchAt(r.indexAfter(b-1))),s.unshift(u&&l?{type:l}:null),a=b;break}else{if(b==1)return!1;s.unshift(null)}let h=e.tr;(e.selection instanceof Tt||e.selection instanceof us)&&h.deleteSelection();let p=h.mapping.map(r.pos),g=po(h.doc,p,s.length,s);if(g||(s[0]=l?{type:l}:null,g=po(h.doc,p,s.length,s)),!g)return!1;if(h.split(p,s.length,s),!u&&d&&r.node(a).type!=l){let b=h.mapping.map(r.before(a)),y=h.doc.resolve(b);l&&r.node(a-1).canReplaceWith(y.index(),y.index()+1,l)&&h.setNodeMarkup(h.mapping.map(r.before(a)),l)}return n&&n(h.scrollIntoView()),!0}}const Fre=zre(),Ure=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(dt.create(t.doc,i))),!0)};function Hre(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||zl(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function uR(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,a,l,u=i.type.spec.isolating||s.type.spec.isolating;if(!u&&Hre(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(a=(l=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&l.matchType(a[0]||s.type).validEnd){if(n){let b=e.pos+s.nodeSize,y=Ae.empty;for(let S=a.length-1;S>=0;S--)y=Ae.from(a[S].create(null,y));y=Ae.from(i.copy(y));let E=t.tr.step(new $r(e.pos-1,b,e.pos,b,new We(y,1,0),a.length,!0)),T=E.doc.resolve(b+2*a.length);T.nodeAfter&&T.nodeAfter.type==i.type&&zl(E.doc,T.pos)&&E.join(T.pos),n(E.scrollIntoView())}return!0}let h=s.type.spec.isolating||r>0&&u?null:It.findFrom(e,1),p=h&&h.$from.blockRange(h.$to),g=p&&Id(p);if(g!=null&&g>=e.depth)return n&&n(t.tr.lift(p,g).scrollIntoView()),!0;if(d&&dd(s,"start",!0)&&dd(i,"end")){let b=i,y=[];for(;y.push(b),!b.isTextblock;)b=b.lastChild;let E=s,T=1;for(;!E.isTextblock;E=E.firstChild)T++;if(b.canReplace(b.childCount,b.childCount,E.content)){if(n){let S=Ae.empty;for(let R=y.length-1;R>=0;R--)S=Ae.from(y[R].copy(S));let A=t.tr.step(new $r(e.pos-y.length,e.pos+s.nodeSize,e.pos+T,e.pos+s.nodeSize-T,new We(S,y.length,0),0,!0));n(A.scrollIntoView())}return!0}}return!1}function cR(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(Tt.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const jre=cR(-1),$re=cR(1);function qre(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,a=i.blockRange(s),l=a&&L_(a,t,e);return l?(r&&r(n.tr.wrap(a,l).scrollIntoView()),!0):!1}}function x8(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(a,l,(u,d)=>{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)i=!0;else{let h=n.doc.resolve(d),p=h.index();i=h.parent.canReplaceWith(p,p+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:l},$to:{pos:u}}=n.selection.ranges[a];s.setBlockType(l,u,t,e)}r(s.scrollIntoView())}return!0}}function H_(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}H_(B_,eR,nR);H_(B_,iR,sR);H_(aR,oR,lR,Fre);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Vre(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,a=i.blockRange(s);if(!a)return!1;let l=r?n.tr:null;return Gre(l,a,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function Gre(t,e,n,r=null){let i=!1,s=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let u=a.resolve(e.start-2);s=new Lg(u,u,e.depth),e.endIndex<e.parent.childCount&&(e=new Lg(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=L_(s,n,r,e);return l?(t&&Yre(t,e,l,i,n),!0):!1}function Yre(t,e,n,r,i){let s=Ae.empty;for(let h=n.length-1;h>=0;h--)s=Ae.from(n[h].type.create(n[h].attrs,s));t.step(new $r(e.start-(r?2:0),e.end,e.start,e.end,new We(s,0,0),n.length,!0));let a=0;for(let h=0;h<n.length;h++)n[h].type==i&&(a=h+1);let l=n.length-a,u=e.start+n.length-(r?2:0),d=e.parent;for(let h=e.startIndex,p=e.endIndex,g=!0;h<p;h++,g=!1)!g&&po(t.doc,u,l)&&(t.split(u,l),u+=2*l),u+=d.child(h).nodeSize;return t}function Wre(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?Kre(e,n,t,s):Xre(e,n,s):!0:!1}}function Kre(t,e,n,r){let i=t.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(i.step(new $r(s-1,a,s,a,new We(Ae.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Lg(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const l=Id(r);if(l==null)return!1;i.lift(r,l);let u=i.doc.resolve(i.mapping.map(s,-1)-1);return zl(i.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&i.join(u.pos),e(i.scrollIntoView()),!0}function Xre(t,e,n){let r=t.tr,i=n.parent;for(let b=n.end,y=n.endIndex-1,E=n.startIndex;y>E;y--)b-=i.child(y).nodeSize,r.delete(b-1,b+1);let s=r.doc.resolve(n.start),a=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==i.childCount,d=s.node(-1),h=s.index(-1);if(!d.canReplace(h+(l?0:1),h+1,a.content.append(u?Ae.empty:Ae.from(i))))return!1;let p=s.pos,g=p+a.nodeSize;return r.step(new $r(p-(l?1:0),g+(u?1:0),p+1,g-1,new We((l?Ae.empty:Ae.from(i.copy(Ae.empty))).append(u?Ae.empty:Ae.from(i.copy(Ae.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Qre(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let l=s.parent,u=l.child(a-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==l.type,h=Ae.from(d?t.create():null),p=new We(Ae.from(t.create(null,Ae.from(l.type.create(null,h)))),d?3:1,0),g=s.start,b=s.end;n(e.tr.step(new $r(g-(d?3:1),b,g,b,p,1,!0)).scrollIntoView())}return!0}}const Zr=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},fd=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let C4=null;const to=function(t,e,n){let r=C4||(C4=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Zre=function(){C4=null},zu=function(t,e,n,r){return n&&(T8(t,e,n,r,-1)||T8(t,e,n,r,1))},Jre=/^(img|br|input|textarea|hr)$/i;function T8(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Cs(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Ih(t)||Jre.test(t.nodeName)||t.contentEditable=="false")return!1;e=Zr(t)+(i<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[e+(i<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((s=a.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=a,e=i<0?Cs(t):0}else return!1}}function Cs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function eie(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Cs(t)}else if(t.parentNode&&!Ih(t))e=Zr(t),t=t.parentNode;else return null}}function tie(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Ih(t))e=Zr(t)+1,t=t.parentNode;else return null}}function nie(t,e,n){for(let r=e==0,i=e==Cs(t);r||i;){if(t==n)return!0;let s=Zr(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Cs(t)}}function Ih(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const pb=function(t){return t.focusNode&&zu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function _u(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function rie(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function iie(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Cs(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Cs(r.startContainer),r.startOffset)}}}const _a=typeof navigator<"u"?navigator:null,S8=typeof document<"u"?document:null,Fl=_a&&_a.userAgent||"",A4=/Edge\/(\d+)/.exec(Fl),dR=/MSIE \d/.exec(Fl),N4=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fl),ji=!!(dR||N4||A4),Sl=dR?document.documentMode:N4?+N4[1]:A4?+A4[1]:0,Ms=!ji&&/gecko\/(\d+)/i.test(Fl);Ms&&+(/Firefox\/(\d+)/.exec(Fl)||[0,0])[1];const M4=!ji&&/Chrome\/(\d+)/.exec(Fl),jr=!!M4,fR=M4?+M4[1]:0,ti=!ji&&!!_a&&/Apple Computer/.test(_a.vendor),hd=ti&&(/Mobile\/\w+/.test(Fl)||!!_a&&_a.maxTouchPoints>2),Ss=hd||(_a?/Mac/.test(_a.platform):!1),hR=_a?/Win/.test(_a.platform):!1,uo=/Android \d/.test(Fl),Lh=!!S8&&"webkitFontSmoothing"in S8.documentElement.style,sie=Lh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function aie(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Xa(t,e){return typeof t=="number"?t:t[e]}function oie(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function w8(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=fd(a);continue}let l=a,u=l==s.body,d=u?aie(s):oie(l),h=0,p=0;if(e.top<d.top+Xa(r,"top")?p=-(d.top-e.top+Xa(i,"top")):e.bottom>d.bottom-Xa(r,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+Xa(i,"top")-d.top:e.bottom-d.bottom+Xa(i,"bottom")),e.left<d.left+Xa(r,"left")?h=-(d.left-e.left+Xa(i,"left")):e.right>d.right-Xa(r,"right")&&(h=e.right-d.right+Xa(i,"right")),h||p)if(u)s.defaultView.scrollBy(h,p);else{let b=l.scrollLeft,y=l.scrollTop;p&&(l.scrollTop+=p),h&&(l.scrollLeft+=h);let E=l.scrollLeft-b,T=l.scrollTop-y;e={left:e.left-E,top:e.top-T,right:e.right-E,bottom:e.bottom-T}}let g=u?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(g))break;a=g=="absolute"?a.offsetParent:fd(a)}}function lie(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,a=n+1;a<Math.min(innerHeight,e.bottom);a+=5){let l=t.root.elementFromPoint(s,a);if(!l||l==t.dom||!t.dom.contains(l))continue;let u=l.getBoundingClientRect();if(u.top>=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:pR(t.dom)}}function pR(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=fd(r));return e}function uie({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;mR(n,r==0?0:r-e)}function mR(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Pc=null;function cie(t){if(t.setActive)return t.setActive();if(Pc)return t.focus(Pc);let e=pR(t);t.focus(Pc==null?{get preventScroll(){return Pc={preventScroll:!0},!0}}:void 0),Pc||(Pc=!1,mR(e,0))}function gR(t,e){let n,r=2e8,i,s=0,a=e.top,l=e.top,u,d;for(let h=t.firstChild,p=0;h;h=h.nextSibling,p++){let g;if(h.nodeType==1)g=h.getClientRects();else if(h.nodeType==3)g=to(h).getClientRects();else continue;for(let b=0;b<g.length;b++){let y=g[b];if(y.top<=a&&y.bottom>=l){a=Math.max(y.bottom,a),l=Math.min(y.top,l);let E=y.left>e.left?y.left-e.left:y.right<e.left?e.left-y.right:0;if(E<r){n=h,r=E,i=E&&n.nodeType==3?{left:y.right<e.left?y.right:y.left,top:e.top}:e,h.nodeType==1&&E&&(s=p+(e.left>=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!u&&y.left<=e.left&&y.right>=e.left&&(u=h,d={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!n&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(s=p+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?die(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:gR(n,i)}function die(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let a=ul(r,1);if(a.top!=a.bottom&&j_(e,a)){i={node:t,offset:s+(e.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function j_(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function fie(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function hie(t,e,n){let{node:r,offset:i}=gR(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function pie(t,e,n,r){let i=-1;for(let s=e,a=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!a&&u.left>r.left||u.top>r.top?i=l.posBefore:(!a&&u.right<r.left||u.bottom<r.top)&&(i=l.posAfter),a=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function bR(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let a=t.childNodes[s];if(a.nodeType==1){let l=a.getClientRects();for(let u=0;u<l.length;u++){let d=l[u];if(j_(e,d))return bR(a,e,d)}}if((s=(s+1)%r)==i)break}return t}function mie(t,e){let n=t.dom.ownerDocument,r,i=0,s=iie(n,e.left,e.top);s&&({node:r,offset:i}=s);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let d=t.dom.getBoundingClientRect();if(!j_(e,d)||(a=bR(t.dom,e,d),!a))return null}if(ti)for(let d=a;r&&d;d=fd(d))d.draggable&&(r=void 0);if(a=fie(a,e),r){if(Ms&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let h=r.childNodes[i],p;h.nodeName=="IMG"&&(p=h.getBoundingClientRect()).right<=e.left&&p.bottom>e.top&&i++}let d;Lh&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=pie(t,r,i,e))}l==null&&(l=hie(t,a,e));let u=t.docView.nearestDesc(a,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function k8(t){return t.top<t.bottom||t.left<t.right}function ul(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(k8(r))return r}return Array.prototype.find.call(n,k8)||t.getBoundingClientRect()}const gie=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function vR(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),a=Lh||Ms;if(r.nodeType==3)if(a&&(gie.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let u=ul(to(r,i,i),n);if(Ms&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=ul(to(r,i-1,i-1),-1);if(d.top==u.top){let h=ul(to(r,i,i+1),-1);if(h.top!=u.top)return $0(h,h.left<d.left)}}return u}else{let u=i,d=i,h=n<0?1:-1;return n<0&&!i?(d++,h=-1):n>=0&&i==r.nodeValue.length?(u--,h=1):n<0?u--:d++,$0(ul(to(r,u,d),h),h<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Cs(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return q2(u.getBoundingClientRect(),!1)}if(s==null&&i<Cs(r)){let u=r.childNodes[i];if(u.nodeType==1)return q2(u.getBoundingClientRect(),!0)}return q2(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Cs(r))){let u=r.childNodes[i-1],d=u.nodeType==3?to(u,Cs(u)-(a?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return $0(ul(d,1),!1)}if(s==null&&i<Cs(r)){let u=r.childNodes[i];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let d=u?u.nodeType==3?to(u,0,a?0:1):u.nodeType==1?u:null:null;if(d)return $0(ul(d,-1),!0)}return $0(ul(r.nodeType==3?to(r):r,-n),n>=0)}function $0(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function q2(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function yR(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function bie(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return yR(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let a=vR(t,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=to(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<u.length;d++){let h=u[d];if(h.bottom>h.top+1&&(n=="up"?a.top-h.top>(h.bottom-a.top)*2:h.bottom-a.bottom>(a.bottom-h.top)*2))return!1}}return!0})}const vie=/[\u0590-\u08ac]/;function yie(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,a=i==r.parent.content.size,l=t.domSelection();return l?!vie.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:a:yR(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:h,anchorOffset:p}=t.domSelectionRange(),g=l.caretBidiLevel;l.modify("move",n,"character");let b=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:y,focusOffset:E}=t.domSelectionRange(),T=y&&!b.contains(y.nodeType==1?y:y.parentNode)||u==y&&d==E;try{l.collapse(h,p),u&&(u!=h||d!=p)&&l.extend&&l.extend(u,d)}catch{}return g!=null&&(l.caretBidiLevel=g),T}):r.pos==r.start()||r.pos==r.end()}let C8=null,A8=null,N8=!1;function Eie(t,e,n){return C8==e&&A8==n?N8:(C8=e,A8=n,N8=n=="up"||n=="down"?bie(t,e,n):yie(t,e,n))}const Os=0,M8=1,xu=2,xa=3;class Ph{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Os,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,a;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(a)+a.size:this.posAtStart}else{let s,a;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Zr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),a;if(s&&(!n||s.node))if(r&&(a=s.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let a=0;a<i.children.length;a++){let l=i.children[a];if(l.size){i=l;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let a=this.children[r],l=s+a.size;if(l>e||a instanceof _R){i=e-s;break}s=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof ER&&s.side>=0;r--);if(n<=0){let s,a=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,a=!1);return s&&n&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Zr(s.dom)+1:0}}else{let s,a=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Zr(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let a=r,l=0;;l++){let u=this.children[l],d=a+u.size;if(i==-1&&e<=d){let h=a+u.border;if(e>=h&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,h);e=a;for(let p=l;p>0;p--){let g=this.children[p-1];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(1)){i=Zr(g.dom)+1;break}e-=g.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let h=l+1;h<this.children.length;h++){let p=this.children[h];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){s=Zr(p.dom);break}n+=p.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),a=Math.max(e,n);for(let b=0,y=0;b<this.children.length;b++){let E=this.children[b],T=y+E.size;if(s>y&&a<T)return E.setSelection(e-y-E.border,n-y-E.border,r,i);y=T}let l=this.domFromPos(e,e?-1:1),u=n==e?l:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),h=r.domSelectionRange(),p=!1;if((Ms||ti)&&e==n){let{node:b,offset:y}=l;if(b.nodeType==3){if(p=!!(y&&b.nodeValue[y-1]==`
`),p&&y==b.nodeValue.length)for(let E=b,T;E;E=E.parentNode){if(T=E.nextSibling){T.nodeName=="BR"&&(l=u={node:T.parentNode,offset:Zr(T)+1});break}let S=E.pmViewDesc;if(S&&S.node&&S.node.isBlock)break}}else{let E=b.childNodes[y-1];p=E&&(E.nodeName=="BR"||E.contentEditable=="false")}}if(Ms&&h.focusNode&&h.focusNode!=u.node&&h.focusNode.nodeType==1){let b=h.focusNode.childNodes[h.focusOffset];b&&b.contentEditable=="false"&&(i=!0)}if(!(i||p&&ti)&&zu(l.node,l.offset,h.anchorNode,h.anchorOffset)&&zu(u.node,u.offset,h.focusNode,h.focusOffset))return;let g=!1;if((d.extend||e==n)&&!(p&&Ms)){d.collapse(l.node,l.offset);try{e!=n&&d.extend(u.node,u.offset),g=!0}catch{}}if(!g){if(e>n){let y=l;l=u,u=y}let b=document.createRange();b.setEnd(u.node,u.offset),b.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(b)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],a=r+s.size;if(r==a?e<=a&&n>=r:e<a&&n>r){let l=r+s.border,u=a-s.border;if(e>=l&&n<=u){this.dirty=e==r||n==a?xu:M8,e==l&&n==u&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=xa:s.markDirty(e-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?xu:xa}r=a}this.dirty=xu}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?xu:M8;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class ER extends Ph{constructor(e,n,r,i){let s,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(a.nodeType!=1){let l=document.createElement("span");l.appendChild(a),a=l}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Os&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class _ie extends Ph{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Fu extends Ph{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],a=s&&s(n,i,r);return(!a||!a.dom)&&(a=Qu.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Fu(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&xa||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=xa&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Os){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Os}}slice(e,n,r){let i=Fu.create(this.parent,this.mark,!0,r),s=this.children,a=this.size;n<a&&(s=R4(s,n,a,r)),e>0&&(s=R4(s,0,e,r));for(let l=0;l<s.length;l++)s[l].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class wl extends Ph{constructor(e,n,r,i,s,a,l,u,d){super(e,[],s,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(e,n,r,i,s,a){let l=s.nodeViews[n.type.name],u,d=l&&l(n,s,()=>{if(!u)return a;if(u.parent)return u.parent.posBeforeChild(u)},r,i),h=d&&d.dom,p=d&&d.contentDOM;if(n.isText){if(!h)h=document.createTextNode(n.text);else if(h.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else h||({dom:h,contentDOM:p}=Qu.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!p&&!n.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),n.type.spec.draggable&&(h.draggable=!0));let g=h;return h=SR(h,r,n),d?u=new xie(e,n,r,i,h,p||null,g,d,s,a+1):n.isText?new mb(e,n,r,i,h,g,s):new wl(e,n,r,i,h,p||null,g,s,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Ae.empty)}return e}matchesNode(e,n,r){return this.dirty==Os&&e.eq(this.node)&&Bg(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,a=s&&s.pos>-1?s:null,l=s&&s.pos<0,u=new Sie(this,a&&a.node,e);Cie(this.node,this.innerDeco,(d,h,p)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e,h):d.type.side>=0&&!p&&u.syncToMarks(h==this.node.childCount?En.none:this.node.child(h).marks,r,e,h),u.placeWidget(d,e,i)},(d,h,p,g)=>{u.syncToMarks(d.marks,r,e,g);let b;u.findNodeMatch(d,h,p,g)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(b=u.findIndexWithChild(s.node))>-1&&u.updateNodeAt(d,h,p,b,e)||u.updateNextNode(d,h,p,e,g,i)||u.addNode(d,h,p,e,i),i+=d.nodeSize}),u.syncToMarks([],r,e,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==xu)&&(a&&this.protectLocalComposition(e,a),xR(this.contentDOM,this.children,e),hd&&Aie(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof Tt)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=Nie(this.node.content,a,r-n,i-n);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let a=new _ie(this,s,n,i);e.input.compositionNodes.push(a),this.children=R4(this.children,r,r+i.length,e,a)}update(e,n,r,i){return this.dirty==xa||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Os}updateOuterDeco(e){if(Bg(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=TR(this.dom,this.nodeDOM,O4(this.outerDeco,this.node,n),O4(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function O8(t,e,n,r,i){SR(r,e,t);let s=new wl(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class mb extends wl{constructor(e,n,r,i,s,a,l){super(e,n,r,i,s,null,a,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==xa||this.dirty!=Os&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Os||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Os,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new mb(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=xa)}get domAtom(){return!1}isText(e){return this.node.text==e}}class _R extends Ph{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Os&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class xie extends wl{constructor(e,n,r,i,s,a,l,u,d,h){super(e,n,r,i,s,a,l,d,h),this.spec=u}update(e,n,r,i){if(this.dirty==xa)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function xR(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=a.dom;if(l.parentNode==t){for(;l!=r;)r=R8(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(a instanceof Fu){let u=r?r.previousSibling:t.lastChild;xR(a.contentDOM,a.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=R8(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const If=function(t){t&&(this.nodeName=t)};If.prototype=Object.create(null);const Tu=[new If];function O4(t,e,n){if(t.length==0)return Tu;let r=n?Tu[0]:new If,i=[r];for(let s=0;s<t.length;s++){let a=t[s].type.attrs;if(a){a.nodeName&&i.push(r=new If(a.nodeName));for(let l in a){let u=a[l];u!=null&&(n&&i.length==1&&i.push(r=new If(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+u:l=="style"?r.style=(r.style?r.style+";":"")+u:l!="nodeName"&&(r[l]=u))}}}return i}function TR(t,e,n,r){if(n==Tu&&r==Tu)return e;let i=e;for(let s=0;s<r.length;s++){let a=r[s],l=n[s];if(s){let u;l&&l.nodeName==a.nodeName&&i!=t&&(u=i.parentNode)&&u.nodeName.toLowerCase()==a.nodeName||(u=document.createElement(a.nodeName),u.pmIsDeco=!0,u.appendChild(i),l=Tu[0]),i=u}Tie(i,l||Tu[0],a)}return i}function Tie(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function SR(t,e,n){return TR(t,t,Tu,O4(e,n,t.nodeType!=1))}function Bg(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function R8(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Sie{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=wie(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,i){let s=0,a=this.stack.length>>1,l=Math.min(a,e.length);for(;s<l&&(s==a-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<a;)this.destroyRest(),this.top.dirty=Os,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let u=-1,d=this.top.children.length;i<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let h=this.index;h<d;h++){let p=this.top.children[h];if(p.matchesMark(e[a])&&!this.isLocked(p.dom)){u=h;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let h=Fu.create(this.top,e[a],n,r);this.top.children.splice(this.index,0,h),this.top=h,this.changed=!0}this.index=0,a++}}findNodeMatch(e,n,r,i){let s=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(e,n,r))s=this.top.children.indexOf(a,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l<u;l++){let d=this.top.children[l];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let a=this.top.children[i];return a.dirty==xa&&a.dom==a.contentDOM&&(a.dirty=xu),a.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,a){for(let l=this.index;l<this.top.children.length;l++){let u=this.top.children[l];if(u instanceof wl){let d=this.preMatch.matched.get(u);if(d!=null&&d!=s)return!1;let h=u.dom,p,g=this.isLocked(h)&&!(e.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==e.text&&u.dirty!=xa&&Bg(n,u.outerDeco));if(!g&&u.update(e,n,r,i))return this.destroyBetween(this.index,l),u.dom!=h&&(this.changed=!0),this.index++,!0;if(!g&&(p=this.recreateWrapper(u,e,n,r,i,a)))return this.destroyBetween(this.index,l),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=xu,p.updateChildren(i,a+1),p.dirty=Os),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Bg(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=wl.create(this.top,n,r,i,s,a);if(l.contentDOM){l.children=e.children,e.children=[];for(let u of l.children)u.parent=l}return e.destroy(),l}addNode(e,n,r,i,s){let a=wl.create(this.top,e,n,r,i,s);a.contentDOM&&a.updateChildren(i,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new ER(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Fu;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof mb)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ti||jr)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new _R(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function wie(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,a=[];e:for(;i>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Fu)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(i-1))break;--i,s.set(l,i),a.push(l)}}return{index:i,matched:s,matches:a.reverse()}}function kie(t,e){return t.type.side-e.type.side}function Cie(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let h=t.child(d);r(h,i,e.forChild(s,h),d),s+=h.nodeSize}return}let a=0,l=[],u=null;for(let d=0;;){let h,p;for(;a<i.length&&i[a].to==s;){let T=i[a++];T.widget&&(h?(p||(p=[h])).push(T):h=T)}if(h)if(p){p.sort(kie);for(let T=0;T<p.length;T++)n(p[T],d,!!u)}else n(h,d,!!u);let g,b;if(u)b=-1,g=u,u=null;else if(d<t.childCount)b=d,g=t.child(d++);else break;for(let T=0;T<l.length;T++)l[T].to<=s&&l.splice(T--,1);for(;a<i.length&&i[a].from<=s&&i[a].to>s;)l.push(i[a++]);let y=s+g.nodeSize;if(g.isText){let T=y;a<i.length&&i[a].from<T&&(T=i[a].from);for(let S=0;S<l.length;S++)l[S].to<T&&(T=l[S].to);T<y&&(u=g.cut(T-s),g=g.cut(0,T-s),y=T,b=-1)}else for(;a<i.length&&i[a].to<y;)a++;let E=g.isInline&&!g.isLeaf?l.filter(T=>!T.inline):l.slice();r(g,E,e.forChild(s,g),b),s=y}}function Aie(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Nie(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let a=t.child(i++),l=s;if(s+=a.nodeSize,!a.isText)continue;let u=a.text;for(;i<t.childCount;){let d=t.child(i++);if(s+=d.nodeSize,!d.isText)break;u+=d.text}if(s>=n){if(s>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l<r?u.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=n)return l+d;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function R4(t,e,n,r,i){let s=[];for(let a=0,l=0;a<t.length;a++){let u=t[a],d=l,h=l+=u.size;d>=n||h<=e?s.push(u):(d<e&&s.push(u.slice(0,e-d,r)),i&&(s.push(i),i=void 0),h>n&&s.push(u.slice(n-d,u.size,r)))}return s}function $_(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let l=r.resolve(a),u,d;if(pb(n)){for(u=a;i&&!i.node;)i=i.parent;let p=i.node;if(i&&p.isAtom&&dt.isSelectable(p)&&i.parent&&!(p.isInline&&nie(n.focusNode,n.focusOffset,i.dom))){let g=i.posBefore;d=new dt(a==g?l:r.resolve(g))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let p=a,g=a;for(let b=0;b<n.rangeCount;b++){let y=n.getRangeAt(b);p=Math.min(p,t.docView.posFromDOM(y.startContainer,y.startOffset,1)),g=Math.max(g,t.docView.posFromDOM(y.endContainer,y.endOffset,-1))}if(p<0)return null;[u,a]=g==t.state.selection.anchor?[g,p]:[p,g],l=r.resolve(a)}else u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let h=r.resolve(u);if(!d){let p=e=="pointer"||t.state.selection.head<l.pos&&!s?1:-1;d=q_(t,h,l,p)}return d}function wR(t){return t.editable?t.hasFocus():CR(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function mo(t,e=!1){let n=t.state.selection;if(kR(t,n),!!wR(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&jr){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&zu(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Oie(t);else{let{anchor:r,head:i}=n,s,a;D8&&!(n instanceof Tt)&&(n.$from.parent.inlineContent||(s=I8(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=I8(t,n.to))),t.docView.setSelection(r,i,t,e),D8&&(s&&L8(s),a&&L8(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Mie(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const D8=ti||jr&&fR<63;function I8(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(ti&&i&&i.contentEditable=="false")return V2(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return V2(i);if(s)return V2(s)}}function V2(t){return t.contentEditable="true",ti&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function L8(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Mie(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!wR(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Oie(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Zr(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&ji&&Sl<=11&&(n.disabled=!0,n.disabled=!1)}function kR(t,e){if(e instanceof dt){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(P8(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else P8(t)}function P8(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function q_(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||Tt.between(e,n,r)}function B8(t){return t.editable&&!t.hasFocus()?!1:CR(t)}function CR(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Rie(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return zu(e.node,e.offset,n.anchorNode,n.anchorOffset)}function D4(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&It.findFrom(s,e)}function fl(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function z8(t,e,n){let r=t.state.selection;if(r instanceof Tt)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return fl(t,new Tt(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=D4(t.state,e);return i&&i instanceof dt?fl(t,i):!1}else if(!(Ss&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;let l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=t.docView.descAt(l))&&!a.contentDOM?dt.isSelectable(s)?fl(t,new dt(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Lh?fl(t,new Tt(t.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof dt&&r.node.isInline)return fl(t,new Tt(e>0?r.$to:r.$from));{let i=D4(t.state,e);return i?fl(t,i):!1}}}function zg(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Lf(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Bc(t,e){return e<0?Die(t):Iie(t)}function Die(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,a=!1;for(Ms&&n.nodeType==1&&r<zg(n)&&Lf(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Lf(l,-1))i=n,s=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(AR(n))break;{let l=n.previousSibling;for(;l&&Lf(l,-1);)i=n.parentNode,s=Zr(l),l=l.previousSibling;if(l)n=l,r=zg(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?I4(t,n,r):i&&I4(t,i,s)}function Iie(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=zg(n),s,a;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Lf(l,1))s=n,a=++r;else break}else{if(AR(n))break;{let l=n.nextSibling;for(;l&&Lf(l,1);)s=l.parentNode,a=Zr(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=zg(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&I4(t,s,a)}function AR(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Lie(t,e){for(;t&&e==t.childNodes.length&&!Ih(t);)e=Zr(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Pie(t,e){for(;t&&!e&&!Ih(t);)e=Zr(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function I4(t,e,n){if(e.nodeType!=3){let s,a;(a=Lie(e,n))?(e=a,n=0):(s=Pie(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(pb(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&mo(t)},50)}function F8(t,e){let n=t.state.doc.resolve(e);if(!(jr||hR)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function U8(t,e,n){let r=t.state.selection;if(r instanceof Tt&&!r.empty||n.indexOf("s")>-1||Ss&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=D4(t.state,e);if(a&&a instanceof dt)return fl(t,a)}if(!i.parent.inlineContent){let a=e<0?i:s,l=r instanceof us?It.near(a,e):It.findFrom(a,e);return l?fl(t,l):!1}return!1}function H8(t,e){if(!(t.state.selection instanceof Tt))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let a=t.state.tr;return e<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),t.dispatch(a),!0}return!1}function j8(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Bie(t){if(!ti||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;j8(t,r,"true"),setTimeout(()=>j8(t,r,"false"),20)}return!1}function zie(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Fie(t,e){let n=e.keyCode,r=zie(e);if(n==8||Ss&&n==72&&r=="c")return H8(t,-1)||Bc(t,-1);if(n==46&&!e.shiftKey||Ss&&n==68&&r=="c")return H8(t,1)||Bc(t,1);if(n==13||n==27)return!0;if(n==37||Ss&&n==66&&r=="c"){let i=n==37?F8(t,t.state.selection.from)=="ltr"?-1:1:-1;return z8(t,i,r)||Bc(t,i)}else if(n==39||Ss&&n==70&&r=="c"){let i=n==39?F8(t,t.state.selection.from)=="ltr"?1:-1:1;return z8(t,i,r)||Bc(t,i)}else{if(n==38||Ss&&n==80&&r=="c")return U8(t,-1,r)||Bc(t,-1);if(n==40||Ss&&n==78&&r=="c")return Bie(t)||U8(t,1,r)||Bc(t,1);if(r==(Ss?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function V_(t,e){t.someProp("transformCopied",b=>{e=b(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let b=r.firstChild;n.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let a=t.someProp("clipboardSerializer")||Qu.fromSchema(t.state.schema),l=IR(),u=l.createElement("div");u.appendChild(a.serializeFragment(r,{document:l}));let d=u.firstChild,h,p=0;for(;d&&d.nodeType==1&&(h=DR[d.nodeName.toLowerCase()]);){for(let b=h.length-1;b>=0;b--){let y=l.createElement(h[b]);for(;u.firstChild;)y.appendChild(u.firstChild);u.appendChild(y),p++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`);let g=t.someProp("clipboardTextSerializer",b=>b(e,t))||e.content.textBetween(0,e.content.size,`

`);return{dom:u,text:g,slice:e}}function NR(t,e,n,r,i){let s=i.parent.type.spec.code,a,l;if(!n&&!e)return null;let u=!!e&&(r||s||!n);if(u){if(t.someProp("transformPastedText",g=>{e=g(e,s||r,t)}),s)return l=new We(Ae.from(t.state.schema.text(e.replace(/\r\n?/g,`
`))),0,0),t.someProp("transformPasted",g=>{l=g(l,t,!0)}),l;let p=t.someProp("clipboardTextParser",g=>g(e,i,r,t));if(p)l=p;else{let g=i.marks(),{schema:b}=t.state,y=Qu.fromSchema(b);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let T=a.appendChild(document.createElement("p"));E&&T.appendChild(y.serializeNode(b.text(E,g)))})}}else t.someProp("transformPastedHTML",p=>{n=p(n,t)}),a=$ie(n),Lh&&qie(a);let d=a&&a.querySelector("[data-pm-slice]"),h=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let p=+h[3];p>0;p--){let g=a.firstChild;for(;g&&g.nodeType!=1;)g=g.nextSibling;if(!g)break;a=g}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Rf.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(u||h),context:i,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!Uie.test(g.parentNode.nodeName)?{ignore:!0}:null}})),h)l=Vie($8(l,+h[1],+h[2]),h[4]);else if(l=We.maxOpen(Hie(l.content,i),!0),l.openStart||l.openEnd){let p=0,g=0;for(let b=l.content.firstChild;p<l.openStart&&!b.type.spec.isolating;p++,b=b.firstChild);for(let b=l.content.lastChild;g<l.openEnd&&!b.type.spec.isolating;g++,b=b.lastChild);l=$8(l,p,g)}return t.someProp("transformPasted",p=>{l=p(l,t,u)}),l}const Uie=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Hie(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,a=[];if(t.forEach(l=>{if(!a)return;let u=i.findWrapping(l.type),d;if(!u)return a=null;if(d=a.length&&s.length&&OR(u,s,l,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=RR(a[a.length-1],s.length));let h=MR(l,u);a.push(h),i=i.matchType(h.type),s=u}}),a)return Ae.from(a)}return t}function MR(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Ae.from(t));return t}function OR(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=OR(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(Ae.from(MR(n,t,i+1))))}}function RR(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,RR(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(Ae.empty,!0);return t.copy(n.append(r))}function L4(t,e,n,r,i,s){let a=e<0?t.firstChild:t.lastChild,l=a.content;return t.childCount>1&&(s=0),i<r-1&&(l=L4(l,e,n,r,i+1,s)),i>=n&&(l=e<0?a.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(Ae.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(l))}function $8(t,e,n){return e<t.openStart&&(t=new We(L4(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new We(L4(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const DR={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let q8=null;function IR(){return q8||(q8=document.implementation.createHTMLDocument("title"))}let G2=null;function jie(t){let e=window.trustedTypes;return e?(G2||(G2=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),G2.createHTML(t)):t}function $ie(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=IR().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&DR[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=jie(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function qie(t){let e=t.querySelectorAll(jr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function Vie(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:a}=t;for(let l=r.length-2;l>=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=Ae.from(u.create(r[l+1],i)),s++,a++}return new We(i,s,a)}const wi={},ki={},Gie={touchstart:!0,touchmove:!0};class Yie{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Wie(t){for(let e in wi){let n=wi[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Xie(t,r)&&!G_(t,r)&&(t.editable||!(r.type in ki))&&n(t,r)},Gie[e]?{passive:!0}:void 0)}ti&&t.dom.addEventListener("input",()=>null),P4(t)}function xl(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Kie(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function P4(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>G_(t,r))})}function G_(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Xie(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Qie(t,e){!G_(t,e)&&wi[e.type]&&(t.editable||!(e.type in ki))&&wi[e.type](t,e)}ki.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!PR(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(uo&&jr&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),hd&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,_u(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Fie(t,n)?n.preventDefault():xl(t,"key")};ki.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ki.keypress=(t,e)=>{let n=e;if(PR(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ss&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Tt)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",a=>a(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function gb(t){return{left:t.clientX,top:t.clientY}}function Zie(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Y_(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let a=s.depth+1;a>0;a--)if(t.someProp(e,l=>a>s.depth?l(t,n,s.nodeAfter,s.before(a),i,!0):l(t,n,s.node(a),s.before(a),i,!1)))return!0;return!1}function rd(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Jie(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&dt.isSelectable(r)?(rd(t,new dt(n)),!0):!1}function ese(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof dt&&(r=n.node);let s=t.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let l=a>s.depth?s.nodeAfter:s.node(a);if(dt.isSelectable(l)){r&&n.$from.depth>0&&a>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(a);break}}return i!=null?(rd(t,dt.create(t.state.doc,i)),!0):!1}function tse(t,e,n,r,i){return Y_(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?ese(t,n):Jie(t,n))}function nse(t,e,n,r){return Y_(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function rse(t,e,n,r){return Y_(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||ise(t,n,r)}function ise(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(rd(t,Tt.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(a.inlineContent)rd(t,Tt.create(r,l+1,l+1+a.content.size));else if(dt.isSelectable(a))rd(t,dt.create(r,l));else continue;return!0}}function W_(t){return Fg(t)}const LR=Ss?"metaKey":"ctrlKey";wi.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=W_(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&Zie(n,t.input.lastClick)&&!n[LR]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let a=t.posAtCoords(gb(n));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new sse(t,a,n,!!r)):(s=="doubleClick"?nse:rse)(t,a.pos,a.inside,n)?n.preventDefault():xl(t,"pointer"))};class sse{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[LR],this.allowDefault=r.shiftKey;let s,a;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),a=n.inside;else{let h=e.state.doc.resolve(n.pos);s=h.parent,a=h.depth?h.before():0}const l=i?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u&&u.nodeDOM.nodeType==1?u.nodeDOM:null;let{selection:d}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof dt&&d.from<=a&&d.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ms&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),xl(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>mo(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(gb(e))),this.updateAllowDefault(e),this.allowDefault||!n?xl(this.view,"pointer"):tse(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ti&&this.mightDrag&&!this.mightDrag.node.isAtom||jr&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(rd(this.view,It.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):xl(this.view,"pointer")}move(e){this.updateAllowDefault(e),xl(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}wi.touchstart=t=>{t.input.lastTouch=Date.now(),W_(t),xl(t,"pointer")};wi.touchmove=t=>{t.input.lastTouch=Date.now(),xl(t,"pointer")};wi.contextmenu=t=>W_(t);function PR(t,e){return t.composing?!0:ti&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const ase=uo?5e3:-1;ki.compositionstart=ki.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Tt&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||jr&&hR&&ose(t)))t.markCursor=t.state.storedMarks||n.marks(),Fg(t,!0),t.markCursor=null;else if(Fg(t,!e.selection.empty),Ms&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let l=t.domSelection();l&&l.collapse(a,a.nodeValue.length);break}else i=a,s=-1}}t.input.composing=!0}BR(t,ase)};function ose(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}ki.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,BR(t,20))};function BR(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Fg(t),e))}function zR(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=use());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function lse(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=eie(e.focusNode,e.focusOffset),r=tie(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}function use(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Fg(t,e=!1){if(!(uo&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),zR(t),e||t.docView&&t.docView.dirty){let n=$_(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function cse(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const rh=ji&&Sl<15||hd&&sie<604;wi.copy=ki.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=rh?null:n.clipboardData,a=r.content(),{dom:l,text:u}=V_(t,a);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",u)):cse(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function dse(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function fse(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ih(t,r.value,null,i,e):ih(t,r.textContent,r.innerHTML,i,e)},50)}function ih(t,e,n,r,i){let s=NR(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,i,s||We.empty)))return!0;if(!s)return!1;let a=dse(s),l=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function FR(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ki.paste=(t,e)=>{let n=e;if(t.composing&&!uo)return;let r=rh?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ih(t,FR(r),r.getData("text/html"),i,n)?n.preventDefault():fse(t,n)};class UR{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const hse=Ss?"altKey":"ctrlKey";function HR(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[hse]}wi.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(gb(n)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof dt?i.to-1:i.to))){if(r&&r.mightDrag)a=dt.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let p=t.docView.nearestDesc(n.target,!0);p&&p.node.type.spec.draggable&&p!=t.docView&&(a=dt.create(t.state.doc,p.posBefore))}}let l=(a||t.state.selection).content(),{dom:u,text:d,slice:h}=V_(t,l);(!n.dataTransfer.files.length||!jr||fR>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(rh?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",rh||n.dataTransfer.setData("text/plain",d),t.dragging=new UR(h,HR(t,n),a)};wi.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ki.dragover=ki.dragenter=(t,e)=>e.preventDefault();ki.drop=(t,e)=>{try{pse(t,e,t.dragging)}finally{t.dragging=null}};function pse(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(gb(e));if(!r)return;let i=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",b=>{s=b(s,t,!1)}):s=NR(t,FR(e.dataTransfer),rh?null:e.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&HR(t,e));if(t.someProp("handleDrop",b=>b(t,e,s||We.empty,a))){e.preventDefault();return}if(!s)return;e.preventDefault();let l=s?VO(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let u=t.state.tr;if(a){let{node:b}=n;b?b.replace(u):u.deleteSelection()}let d=u.mapping.map(l),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=u.doc;if(h?u.replaceRangeWith(d,d,s.content.firstChild):u.replaceRange(d,d,s),u.doc.eq(p))return;let g=u.doc.resolve(d);if(h&&dt.isSelectable(s.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new dt(g));else{let b=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((y,E,T,S)=>b=S),u.setSelection(q_(t,g,u.doc.resolve(b)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))}wi.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&mo(t)},20))};wi.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};wi.beforeinput=(t,e)=>{if(jr&&uo&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,_u(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in ki)wi[t]=ki[t];function sh(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Ug{constructor(e,n){this.toDOM=e,this.spec=n||Ou,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:a}=e.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Si(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ug&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&sh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class kl{constructor(e,n){this.attrs=e,this.spec=n||Ou}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=a?null:new Si(s,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof kl&&sh(this.attrs,e.attrs)&&sh(this.spec,e.spec)}static is(e){return e.type instanceof kl}destroy(){}}class K_{constructor(e,n){this.attrs=e,this.spec=n||Ou}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let a=e.mapResult(n.to+i,-1);return a.deleted||a.pos<=s.pos?null:new Si(s.pos-r,a.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof K_&&sh(this.attrs,e.attrs)&&sh(this.spec,e.spec)}destroy(){}}class Si{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Si(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Si(e,e,new Ug(n,r))}static inline(e,n,r,i){return new Si(e,n,new kl(r,i))}static node(e,n,r,i){return new Si(e,n,new K_(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof kl}get widget(){return this.type instanceof Ug}}const Gc=[],Ou={};class Yn{constructor(e,n){this.local=e.length?e:Gc,this.children=n.length?n:Gc}static create(e,n){return n.length?Hg(n,e,0,Ou):li}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let a=0;a<this.local.length;a++){let l=this.local[a];l.from<=n&&l.to>=e&&(!s||s(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let l=this.children[a]+1;this.children[a+2].findInner(e-l,n-l,r,i+l,s)}}map(e,n,r){return this==li||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Ou)}mapInner(e,n,r,i,s){let a;for(let l=0;l<this.local.length;l++){let u=this.local[l].map(e,r,i);u&&u.type.valid(n,u)?(a||(a=[])).push(u):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?mse(this.children,a||[],e,n,r,i,s):a?new Yn(a.sort(Ru),Gc):li}add(e,n){return n.length?this==li?Yn.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((l,u)=>{let d=u+r,h;if(h=$R(n,l,d)){for(i||(i=this.children.slice());s<i.length&&i[s]<u;)s+=3;i[s]==u?i[s+2]=i[s+2].addInner(l,h,d+1):i.splice(s,0,u,u+l.nodeSize,Hg(h,l,d+1,Ou)),s+=3}});let a=jR(s?qR(n):n,-r);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||a.splice(l--,1);return new Yn(a.length?this.local.concat(a).sort(Ru):this.local,i||this.children)}remove(e){return e.length==0||this==li?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let a,l=r[s]+n,u=r[s+1]+n;for(let h=0,p;h<e.length;h++)(p=e[h])&&p.from>l&&p.to<u&&(e[h]=null,(a||(a=[])).push(p));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[s+2].removeInner(a,l+1);d!=li?r[s+2]=d:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,a;s<e.length;s++)if(a=e[s])for(let l=0;l<i.length;l++)i[l].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Yn(i,r):li}forChild(e,n){if(this==li)return this;if(n.isLeaf)return Yn.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,a=s+n.content.size;for(let l=0;l<this.local.length;l++){let u=this.local[l];if(u.from<a&&u.to>s&&u.type instanceof kl){let d=Math.max(s,u.from)-s,h=Math.min(a,u.to)-s;d<h&&(i||(i=[])).push(u.copy(d,h))}}if(i){let l=new Yn(i.sort(Ru),Gc);return r?new ml([l,r]):l}return r||li}eq(e){if(this==e)return!0;if(!(e instanceof Yn)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return X_(this.localsInner(e))}localsInner(e){if(this==li)return Gc;if(e.inlineContent||!this.local.some(kl.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof kl||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Yn.empty=new Yn([],[]);Yn.removeOverlap=X_;const li=Yn.empty;class ml{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Ou));return ml.from(r)}forChild(e,n){if(n.isLeaf)return Yn.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=li&&(s instanceof ml?r=r.concat(s.members):r.push(s))}return ml.from(r)}eq(e){if(!(e instanceof ml)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let a=0;a<s.length;a++)n.push(s[a])}}return n?X_(r?n:n.sort(Ru)):Gc}static from(e){switch(e.length){case 0:return li;case 1:return e[0];default:return new ml(e.every(n=>n instanceof Yn)?e:e.reduce((n,r)=>n.concat(r instanceof Yn?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function mse(t,e,n,r,i,s,a){let l=t.slice();for(let d=0,h=s;d<n.maps.length;d++){let p=0;n.maps[d].forEach((g,b,y,E)=>{let T=E-y-(b-g);for(let S=0;S<l.length;S+=3){let A=l[S+1];if(A<0||g>A+h-p)continue;let R=l[S]+h-p;b>=R?l[S+1]=g<=R?-2:-1:g>=h&&T&&(l[S]+=T,l[S+1]+=T)}p+=T}),h=n.maps[d].map(h,-1)}let u=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){u=!0,l[d+1]=-1;continue}let h=n.map(t[d]+s),p=h-i;if(p<0||p>=r.content.size){u=!0;continue}let g=n.map(t[d+1]+s,-1),b=g-i,{index:y,offset:E}=r.content.findIndex(p),T=r.maybeChild(y);if(T&&E==p&&E+T.nodeSize==b){let S=l[d+2].mapInner(n,T,h+1,t[d]+s+1,a);S!=li?(l[d]=p,l[d+1]=b,l[d+2]=S):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=gse(l,t,e,n,i,s,a),h=Hg(d,r,0,a);e=h.local;for(let p=0;p<l.length;p+=3)l[p+1]<0&&(l.splice(p,3),p-=3);for(let p=0,g=0;p<h.children.length;p+=3){let b=h.children[p];for(;g<l.length&&l[g]<b;)g+=3;l.splice(g,0,h.children[p],h.children[p+1],h.children[p+2])}}return new Yn(e.sort(Ru),l)}function jR(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Si(i.from+e,i.to+e,i.type))}return n}function gse(t,e,n,r,i,s,a){function l(u,d){for(let h=0;h<u.local.length;h++){let p=u.local[h].map(r,i,d);p?n.push(p):a.onRemove&&a.onRemove(u.local[h].spec)}for(let h=0;h<u.children.length;h+=3)l(u.children[h+2],u.children[h]+d+1)}for(let u=0;u<t.length;u+=3)t[u+1]==-1&&l(t[u+2],e[u]+s+1);return n}function $R(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,a;s<t.length;s++)(a=t[s])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),t[s]=null);return i}function qR(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Hg(t,e,n,r){let i=[],s=!1;e.forEach((l,u)=>{let d=$R(t,l,u+n);if(d){s=!0;let h=Hg(d,l,n+u+1,r);h!=li&&i.push(u,u+l.nodeSize,h)}});let a=jR(s?qR(t):t,-n).sort(Ru);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||(r.onRemove&&r.onRemove(a[l].spec),a.splice(l--,1));return a.length||i.length?new Yn(a,i):li}function Ru(t,e){return t.from-e.from||t.to-e.to}function X_(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),V8(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),V8(e,i,r.copy(s.from,r.to)));break}}}return e}function V8(t,e,n){for(;e<t.length&&Ru(n,t[e])>0;)e++;t.splice(e,0,n)}function Y2(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=li&&e.push(r)}),t.cursorWrapper&&e.push(Yn.create(t.state.doc,[t.cursorWrapper.deco])),ml.from(e)}const bse={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},vse=ji&&Sl<=11;class yse{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Ese{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new yse,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);ji&&Sl<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():ti&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),vse&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,bse)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(B8(this.view)){if(this.suppressingSelectionUpdates)return mo(this.view);if(ji&&Sl<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&zu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=fd(s))n.add(s);for(let s=e.anchorNode;s;s=fd(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&B8(e)&&!this.ignoreSelectionChange(r),s=-1,a=-1,l=!1,u=[];if(e.editable)for(let h=0;h<n.length;h++){let p=this.registerMutation(n[h],u);p&&(s=s<0?p.from:Math.min(p.from,s),a=a<0?p.to:Math.max(p.to,a),p.typeOver&&(l=!0))}if(Ms&&u.length){let h=u.filter(p=>p.nodeName=="BR");if(h.length==2){let[p,g]=h;p.parentNode&&p.parentNode.parentNode==g.parentNode?g.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let g of h){let b=g.parentNode;b&&b.nodeName=="LI"&&(!p||Tse(e,p)!=b)&&g.remove()}}}else if((jr||ti)&&u.some(h=>h.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let h of u)if(h.nodeName=="BR"&&h.parentNode){let p=h.nextSibling;p&&p.nodeType==1&&p.contentEditable=="false"&&h.parentNode.removeChild(h)}}let d=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&pb(r)&&(d=$_(e))&&d.eq(It.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,mo(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,a),_se(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Sse(e,u)),this.handleDOMChange(s,a,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||mo(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let h=0;h<e.addedNodes.length;h++){let p=e.addedNodes[h];n.push(p),p.nodeType==3&&(this.lastChangedTextNode=p)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(ji&&Sl<=11&&e.addedNodes.length)for(let h=0;h<e.addedNodes.length;h++){let{previousSibling:p,nextSibling:g}=e.addedNodes[h];(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p),(!g||Array.prototype.indexOf.call(e.addedNodes,g)<0)&&(s=g)}let a=i&&i.parentNode==e.target?Zr(i)+1:0,l=r.localPosFromDOM(e.target,a,-1),u=s&&s.parentNode==e.target?Zr(s):e.target.childNodes.length,d=r.localPosFromDOM(e.target,u,1);return{from:l,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let G8=new WeakMap,Y8=!1;function _se(t){if(!G8.has(t)&&(G8.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Ms,Y8)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Y8=!0}}function W8(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return zu(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function xse(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return W8(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?W8(t,n):null}function Tse(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Sse(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let a=s.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let l=a;for(;;){let u=l.firstChild;if(!u||u.nodeType!=1||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;l=u}l.insertBefore(s,l.firstChild),r==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function wse(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:a,to:l}=t.docView.parseRange(e,n),u=t.domSelectionRange(),d,h=u.anchorNode;if(h&&t.dom.contains(h.nodeType==1?h:h.parentNode)&&(d=[{node:h,offset:u.anchorOffset}],pb(u)||d.push({node:u.focusNode,offset:u.focusOffset})),jr&&t.input.lastKeyCode===8)for(let T=s;T>i;T--){let S=r.childNodes[T-1],A=S.pmViewDesc;if(S.nodeName=="BR"&&!A){s=T;break}if(!A||A.size)break}let p=t.state.doc,g=t.someProp("domParser")||Rf.fromSchema(t.state.schema),b=p.resolve(a),y=null,E=g.parse(r,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:i,to:s,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:kse,context:b});if(d&&d[0].pos!=null){let T=d[0].pos,S=d[1]&&d[1].pos;S==null&&(S=T),y={anchor:T+a,head:S+a}}return{doc:E,sel:y,from:a,to:l}}function kse(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(ti&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||ti&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Cse=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Ase(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let $=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,K=$_(t,$);if(K&&!t.state.selection.eq(K)){if(jr&&uo&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",W=>W(t,_u(13,"Enter"))))return;let Z=t.state.tr.setSelection(K);$=="pointer"?Z.setMeta("pointer",!0):$=="key"&&Z.scrollIntoView(),s&&Z.setMeta("composition",s),t.dispatch(Z)}return}let a=t.state.doc.resolve(e),l=a.sharedDepth(n);e=a.before(l+1),n=t.state.doc.resolve(n).after(l+1);let u=t.state.selection,d=wse(t,e,n),h=t.state.doc,p=h.slice(d.from,d.to),g,b;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(g=t.state.selection.to,b="end"):(g=t.state.selection.from,b="start"),t.input.lastKeyCode=null;let y=Ose(p.content,d.doc.content,d.from,g,b);if(y&&t.input.domChangeCount++,(hd&&t.input.lastIOSEnter>Date.now()-225||uo)&&i.some($=>$.nodeType==1&&!Cse.test($.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",$=>$(t,_u(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(r&&u instanceof Tt&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let $=K8(t,t.state.doc,d.sel);if($&&!$.eq(t.state.selection)){let K=t.state.tr.setSelection($);s&&K.setMeta("composition",s),t.dispatch(K)}}return}t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Tt&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),ji&&Sl<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)=="  "&&(y.start--,y.endA--,y.endB--);let E=d.doc.resolveNoCache(y.start-d.from),T=d.doc.resolveNoCache(y.endB-d.from),S=h.resolve(y.start),A=E.sameParent(T)&&E.parent.inlineContent&&S.end()>=y.endA;if((hd&&t.input.lastIOSEnter>Date.now()-225&&(!A||i.some($=>$.nodeName=="DIV"||$.nodeName=="P"))||!A&&E.pos<d.doc.content.size&&(!E.sameParent(T)||!E.parent.inlineContent)&&E.pos<T.pos&&!/\S/.test(d.doc.textBetween(E.pos,T.pos,"","")))&&t.someProp("handleKeyDown",$=>$(t,_u(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&Mse(h,y.start,y.endA,E,T)&&t.someProp("handleKeyDown",$=>$(t,_u(8,"Backspace")))){uo&&jr&&t.domObserver.suppressSelectionUpdates();return}jr&&y.endB==y.start&&(t.input.lastChromeDelete=Date.now()),uo&&!A&&E.start()!=T.start()&&T.parentOffset==0&&E.depth==T.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,T=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function($){return $(t,_u(13,"Enter"))})},20));let R=y.start,z=y.endA,I=$=>{let K=$||t.state.tr.replace(R,z,d.doc.slice(y.start-d.from,y.endB-d.from));if(d.sel){let Z=K8(t,K.doc,d.sel);Z&&!(jr&&t.composing&&Z.empty&&(y.start!=y.endB||t.input.lastChromeDelete<Date.now()-100)&&(Z.head==R||Z.head==K.mapping.map(z)-1)||ji&&Z.empty&&Z.head==R)&&K.setSelection(Z)}return s&&K.setMeta("composition",s),K.scrollIntoView()},P;if(A)if(E.pos==T.pos){ji&&Sl<=11&&E.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>mo(t),20));let $=I(t.state.tr.delete(R,z)),K=h.resolve(y.start).marksAcross(h.resolve(y.endA));K&&$.ensureMarks(K),t.dispatch($)}else if(y.endA==y.endB&&(P=Nse(E.parent.content.cut(E.parentOffset,T.parentOffset),S.parent.content.cut(S.parentOffset,y.endA-S.start())))){let $=I(t.state.tr);P.type=="add"?$.addMark(R,z,P.mark):$.removeMark(R,z,P.mark),t.dispatch($)}else if(E.parent.child(E.index()).isText&&E.index()==T.index()-(T.textOffset?0:1)){let $=E.parent.textBetween(E.parentOffset,T.parentOffset),K=()=>I(t.state.tr.insertText($,R,z));t.someProp("handleTextInput",Z=>Z(t,R,z,$,K))||t.dispatch(K())}else t.dispatch(I());else t.dispatch(I())}function K8(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:q_(t,e.resolve(n.anchor),e.resolve(n.head))}function Nse(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,a,l,u;for(let h=0;h<r.length;h++)i=r[h].removeFromSet(i);for(let h=0;h<n.length;h++)s=n[h].removeFromSet(s);if(i.length==1&&s.length==0)l=i[0],a="add",u=h=>h.mark(l.addToSet(h.marks));else if(i.length==0&&s.length==1)l=s[0],a="remove",u=h=>h.mark(l.removeFromSet(h.marks));else return null;let d=[];for(let h=0;h<e.childCount;h++)d.push(u(e.child(h)));if(Ae.from(d).eq(t))return{mark:l,type:a}}function Mse(t,e,n,r,i){if(n-e<=i.pos-r.pos||W2(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let l=s.nodeAfter;return l!=null&&n==e+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let a=t.resolve(W2(s,!0,!0));return!a.parent.isTextblock||a.pos>n||W2(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function W2(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function Ose(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let u=Math.max(0,s-Math.min(a,l));r-=a+u-s}if(a<s&&t.size<e.size){let u=r<=s&&r>=a?s-r:0;s-=u,s&&s<e.size&&X8(e.textBetween(s-1,s+1))&&(s+=u?1:-1),l=s+(l-a),a=s}else if(l<s){let u=r<=s&&r>=l?s-r:0;s-=u,s&&s<t.size&&X8(t.textBetween(s-1,s+1))&&(s+=u?1:-1),a=s+(a-l),l=s}return{start:s,endA:a,endB:l}}function X8(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class VR{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Yie,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(t7),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=J8(this),Z8(this),this.nodeViews=e7(this),this.docView=O8(this.state.doc,Q8(this),Y2(this),this.dom,this),this.domObserver=new Ese(this,(r,i,s,a)=>Ase(this,r,i,s,a)),this.domObserver.start(),Wie(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&P4(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(t7),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(zR(this),a=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let b=e7(this);Dse(b,this.nodeViews)&&(this.nodeViews=b,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&P4(this),this.editable=J8(this),Z8(this);let u=Y2(this),d=Q8(this),h=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",p=s||!this.docView.matchesNode(e.doc,d,u);(p||!e.selection.eq(i.selection))&&(a=!0);let g=h=="preserve"&&a&&this.dom.style.overflowAnchor==null&&lie(this);if(a){this.domObserver.stop();let b=p&&(ji||jr)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Rse(i.selection,e.selection);if(p){let y=jr?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=lse(this)),(s||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=O8(e.doc,d,u,this.dom,this)),y&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(b=!0)}b||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Rie(this))?mo(this,b):(kR(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),h=="reset"?this.dom.scrollTop=0:h=="to selection"?this.scrollToSelection():g&&uie(g)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof dt){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&w8(this,n.getBoundingClientRect(),e)}else w8(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new UR(e.slice,e.move,i<0?void 0:dt.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let l=this.directPlugins[a].props[e];if(l!=null&&(i=n?n(l):l))return i}let s=this.state.plugins;if(s)for(let a=0;a<s.length;a++){let l=s[a].props[e];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(ji){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&cie(this.dom),mo(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return mie(this,e)}coordsAtPos(e,n=1){return vR(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return Eie(this,n||this.state,e)}pasteHTML(e,n){return ih(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ih(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return V_(this,e)}destroy(){this.docView&&(Kie(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Y2(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Zre())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Qie(this,e)}domSelectionRange(){let e=this.domSelection();return e?ti&&this.root.nodeType===11&&rie(this.dom.ownerDocument)==this.dom&&xse(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}VR.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Q8(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Si.node(0,t.state.doc.content.size,e)]}function Z8(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Si.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function J8(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Rse(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function e7(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Dse(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function t7(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Il={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},jg={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ise=typeof navigator<"u"&&/Mac/.test(navigator.platform),Lse=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Jr=0;Jr<10;Jr++)Il[48+Jr]=Il[96+Jr]=String(Jr);for(var Jr=1;Jr<=24;Jr++)Il[Jr+111]="F"+Jr;for(var Jr=65;Jr<=90;Jr++)Il[Jr]=String.fromCharCode(Jr+32),jg[Jr]=String.fromCharCode(Jr);for(var K2 in Il)jg.hasOwnProperty(K2)||(jg[K2]=Il[K2]);function Pse(t){var e=Ise&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Lse&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?jg:Il)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Bse=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),zse=typeof navigator<"u"&&/Win/.test(navigator.platform);function Fse(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,a;for(let l=0;l<e.length-1;l++){let u=e[l];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))Bse?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function Use(t){let e=Object.create(null);for(let n in t)e[Fse(n)]=t[n];return e}function X2(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Hse(t){return new Xn({props:{handleKeyDown:GR(t)}})}function GR(t){let e=Use(t);return function(n,r){let i=Pse(r),s,a=e[X2(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[X2(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(zse&&r.ctrlKey&&r.altKey)&&(s=Il[r.keyCode])&&s!=i){let l=e[X2(s,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var jse=Object.defineProperty,Q_=(t,e)=>{for(var n in e)jse(t,n,{get:e[n],enumerable:!0})};function bb(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var vb=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...d)=>{const h=l(...d)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,a=[],l=!!t,u=t||i.tr,d=()=>(!l&&e&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(p=>p===!0)),h={...Object.fromEntries(Object.entries(n).map(([p,g])=>[p,(...y)=>{const E=this.buildProps(u,e),T=g(...y)(E);return a.push(T),h}])),run:d};return h}createCan(t){const{rawCommands:e,state:n}=this,r=!1,i=t||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...d)=>u(...d)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,a={tr:t,editor:r,view:s,state:bb({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...d)=>u(...d)(a)]))}};return a}},YR={};Q_(YR,{blur:()=>$se,clearContent:()=>qse,clearNodes:()=>Vse,command:()=>Gse,createParagraphNear:()=>Yse,cut:()=>Wse,deleteCurrentNode:()=>Kse,deleteNode:()=>Xse,deleteRange:()=>Qse,deleteSelection:()=>Zse,enter:()=>Jse,exitCode:()=>eae,extendMarkRange:()=>tae,first:()=>nae,focus:()=>iae,forEach:()=>sae,insertContent:()=>aae,insertContentAt:()=>uae,joinBackward:()=>fae,joinDown:()=>dae,joinForward:()=>hae,joinItemBackward:()=>pae,joinItemForward:()=>mae,joinTextblockBackward:()=>gae,joinTextblockForward:()=>bae,joinUp:()=>cae,keyboardShortcut:()=>yae,lift:()=>Eae,liftEmptyBlock:()=>_ae,liftListItem:()=>xae,newlineInCode:()=>Tae,resetAttributes:()=>Sae,scrollIntoView:()=>wae,selectAll:()=>kae,selectNodeBackward:()=>Cae,selectNodeForward:()=>Aae,selectParentNode:()=>Nae,selectTextblockEnd:()=>Mae,selectTextblockStart:()=>Oae,setContent:()=>Rae,setMark:()=>Zae,setMeta:()=>Jae,setNode:()=>eoe,setNodeSelection:()=>toe,setTextDirection:()=>noe,setTextSelection:()=>roe,sinkListItem:()=>ioe,splitBlock:()=>soe,splitListItem:()=>aoe,toggleList:()=>ooe,toggleMark:()=>loe,toggleNode:()=>uoe,toggleWrap:()=>coe,undoInputRule:()=>doe,unsetAllMarks:()=>foe,unsetMark:()=>hoe,unsetTextDirection:()=>poe,updateAttributes:()=>moe,wrapIn:()=>goe,wrapInList:()=>boe});var $se=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),qse=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Vse=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:a})=>{t.doc.nodesBetween(s.pos,a.pos,(l,u)=>{if(l.type.isText)return;const{doc:d,mapping:h}=e,p=d.resolve(h.map(u)),g=d.resolve(h.map(u+l.nodeSize)),b=p.blockRange(g);if(!b)return;const y=Id(b);if(l.type.isTextblock){const{defaultType:E}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(b.start,E)}(y||y===0)&&e.lift(b,y)})}),!0},Gse=t=>e=>t(e),Yse=()=>({state:t,dispatch:e})=>oR(t,e),Wse=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const a=r.mapping.map(e);return r.insert(a,s.content),r.setSelection(new Tt(r.doc.resolve(Math.max(a-1,0)))),!0},Kse=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const l=i.before(s),u=i.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1};function xr(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var Xse=t=>({tr:e,state:n,dispatch:r})=>{const i=xr(t,n.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(r){const u=s.before(a),d=s.after(a);e.delete(u,d).scrollIntoView()}return!0}return!1},Qse=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},Zse=()=>({state:t,dispatch:e})=>B_(t,e),Jse=()=>({commands:t})=>t.keyboardShortcut("Enter"),eae=()=>({state:t,dispatch:e})=>Bre(t,e);function Z_(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function $g(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Z_(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function WR(t,e,n={}){return t.find(r=>r.type===e&&$g(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function n7(t,e,n={}){return!!WR(t,e,n)}function J_(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(h=>h.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(h=>h.type===e)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!WR([...i.node.marks],e,n)))return;let a=i.index,l=t.start()+i.offset,u=a+1,d=l+i.node.nodeSize;for(;a>0&&n7([...t.parent.child(a-1).marks],e,n);)a-=1,l-=t.parent.child(a).nodeSize;for(;u<t.parent.childCount&&n7([...t.parent.child(u).marks],e,n);)d+=t.parent.child(u).nodeSize,u+=1;return{from:l,to:d}}function wo(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var tae=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=wo(t,r.schema),{doc:a,selection:l}=n,{$from:u,from:d,to:h}=l;if(i){const p=J_(u,s,e);if(p&&p.from<=d&&p.to>=h){const g=Tt.create(a,p.from,p.to);n.setSelection(g)}}return!0},nae=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function KR(t){return t instanceof Tt}function Su(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function XR(t,e=null){if(!e)return null;const n=It.atStart(t),r=It.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?Tt.create(t,Su(0,i,s),Su(t.content.size,i,s)):Tt.create(t,Su(e,i,s),Su(e,i,s))}function r7(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function qg(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function rae(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var iae=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(qg()||r7())&&r.dom.focus(),rae()&&!qg()&&!r7()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!KR(n.state.selection))return a(),!0;const l=XR(i.doc,t)||n.state.selection,u=n.state.selection.eq(l);return s&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},sae=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),aae=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),QR=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&QR(r)}return t};function Am(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return QR(n)}function ah(t,e,n){if(t instanceof Qs||t instanceof Ae)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return Ae.fromArray(t.map(l=>e.nodeFromJSON(l)));const a=e.nodeFromJSON(t);return n.errorOnInvalidContent&&a.check(),a}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),ah("",e,n)}if(i){if(n.errorOnInvalidContent){let a=!1,l="";const u=new IO({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(a=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Rf.fromSchema(u).parseSlice(Am(t),n.parseOptions):Rf.fromSchema(u).parse(Am(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Rf.fromSchema(e);return n.slice?s.parseSlice(Am(t),n.parseOptions).content:s.parse(Am(t),n.parseOptions)}return ah("",e,n)}function oae(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Fr||i instanceof $r))return;const s=t.mapping.maps[r];let a=0;s.forEach((l,u,d,h)=>{a===0&&(a=h)}),t.setSelection(It.near(t.doc.resolve(a),n))}var lae=t=>!("type"in t),uae=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var a;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const u=T=>{s.emit("contentError",{editor:s,error:T,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{ah(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(T){u(T)}try{l=ah(e,s.schema,{parseOptions:d,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:s.options.enableContentCheck})}catch(T){return u(T),!1}let{from:h,to:p}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},g=!0,b=!0;if((lae(l)?l:[l]).forEach(T=>{T.check(),g=g?T.isText&&T.marks.length===0:!1,b=b?T.isBlock:!1}),h===p&&b){const{parent:T}=r.doc.resolve(h);T.isTextblock&&!T.type.spec.code&&!T.childCount&&(h-=1,p+=1)}let E;if(g){if(Array.isArray(e))E=e.map(T=>T.text||"").join("");else if(e instanceof Ae){let T="";e.forEach(S=>{S.text&&(T+=S.text)}),E=T}else typeof e=="object"&&e&&e.text?E=e.text:E=e;r.insertText(E,h,p)}else{E=l;const T=r.doc.resolve(h),S=T.node(),A=T.parentOffset===0,R=S.isText||S.isTextblock,z=S.content.size>0;A&&R&&z&&(h=Math.max(0,h-1)),r.replaceWith(h,p,E)}n.updateSelection&&oae(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:h,text:E}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:h,text:E})}return!0},cae=()=>({state:t,dispatch:e})=>Ire(t,e),dae=()=>({state:t,dispatch:e})=>Lre(t,e),fae=()=>({state:t,dispatch:e})=>eR(t,e),hae=()=>({state:t,dispatch:e})=>iR(t,e),pae=()=>({state:t,dispatch:e,tr:n})=>{try{const r=db(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},mae=()=>({state:t,dispatch:e,tr:n})=>{try{const r=db(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},gae=()=>({state:t,dispatch:e})=>Rre(t,e),bae=()=>({state:t,dispatch:e})=>Dre(t,e);function ZR(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function vae(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,a;for(let l=0;l<e.length-1;l+=1){const u=e[l];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))qg()||ZR()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var yae=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=vae(t).split(/-(?!$)/),a=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return u==null||u.steps.forEach(d=>{const h=d.map(r.mapping);h&&i&&r.maybeStep(h)}),!0};function Ll(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,a=e?xr(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(p,g)=>{if(p.isText)return;const b=Math.max(r,g),y=Math.min(i,g+p.nodeSize);l.push({node:p,from:b,to:y})});const u=i-r,d=l.filter(p=>a?a.name===p.node.type.name:!0).filter(p=>$g(p.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((p,g)=>p+g.to-g.from,0)>=u}var Eae=(t,e={})=>({state:n,dispatch:r})=>{const i=xr(t,n.schema);return Ll(n,i,e)?Pre(n,r):!1},_ae=()=>({state:t,dispatch:e})=>lR(t,e),xae=t=>({state:e,dispatch:n})=>{const r=xr(t,e.schema);return Wre(r)(e,n)},Tae=()=>({state:t,dispatch:e})=>aR(t,e);function yb(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function i7(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var Sae=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,a=null;const l=yb(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(s=xr(t,r.schema)),l==="mark"&&(a=wo(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(h,p)=>{s&&s===h.type&&(u=!0,i&&n.setNodeMarkup(p,void 0,i7(h.attrs,e))),a&&h.marks.length&&h.marks.forEach(g=>{a===g.type&&(u=!0,i&&n.addMark(p,p+h.nodeSize,a.create(i7(g.attrs,e))))})})}),u},wae=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),kae=()=>({tr:t,dispatch:e})=>{if(e){const n=new us(t.doc);t.setSelection(n)}return!0},Cae=()=>({state:t,dispatch:e})=>nR(t,e),Aae=()=>({state:t,dispatch:e})=>sR(t,e),Nae=()=>({state:t,dispatch:e})=>Ure(t,e),Mae=()=>({state:t,dispatch:e})=>$re(t,e),Oae=()=>({state:t,dispatch:e})=>jre(t,e);function B4(t,e,n={},r={}){return ah(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Rae=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:a,commands:l})=>{const{doc:u}=s;if(r.preserveWhitespace!=="full"){const d=B4(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return a&&s.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!n),!0}return a&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:u.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function JR(t,e){const n=wo(e,t.schema),{from:r,to:i,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,u=>{a.push(...u.marks)});const l=a.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function eD(t,e){const n=new XO(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Dae(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Iae(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function Lae(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Eb(t){return e=>Lae(e.$from,t)}function lt(t,e,n){return t.config[e]===void 0&&t.parent?lt(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?lt(t.parent,e,n):null}):t.config[e]}function ex(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=lt(e,"addExtensions",n);return r?[e,...ex(r())]:e}).flat(10)}function tx(t,e){const n=Qu.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function tD(t){return typeof t=="function"}function cn(t,e=void 0,...n){return tD(t)?e?t.bind(e)(...n):t(...n):t}function Pae(t={}){return Object.keys(t).length===0&&t.constructor===Object}function pd(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function nD(t){const e=[],{nodeExtensions:n,markExtensions:r}=pd(t),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage,extensions:i},u=lt(a,"addGlobalAttributes",l);if(!u)return;u().forEach(h=>{h.types.forEach(p=>{Object.entries(h.attributes).forEach(([g,b])=>{e.push({type:p,name:g,attribute:{...s,...b}})})})})}),i.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage},u=lt(a,"addAttributes",l);if(!u)return;const d=u();Object.entries(d).forEach(([h,p])=>{const g={...s,...p};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:a.name,name:h,attribute:g})})}),e}function Tr(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const l=s?String(s).split(" "):[],u=r[i]?r[i].split(" "):[],d=l.filter(h=>!u.includes(h));r[i]=[...u,...d].join(" ")}else if(i==="style"){const l=s?s.split(";").map(h=>h.trim()).filter(Boolean):[],u=r[i]?r[i].split(";").map(h=>h.trim()).filter(Boolean):[],d=new Map;u.forEach(h=>{const[p,g]=h.split(":").map(b=>b.trim());d.set(p,g)}),l.forEach(h=>{const[p,g]=h.split(":").map(b=>b.trim());d.set(p,g)}),r[i]=Array.from(d.entries()).map(([h,p])=>`${h}: ${p}`).join("; ")}else r[i]=s}),r},{})}function oh(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Tr(n,r),{})}function Bae(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function s7(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,a)=>{const l=a.attribute.parseHTML?a.attribute.parseHTML(n):Bae(n.getAttribute(a.name));return l==null?s:{...s,[a.name]:l}},{});return{...r,...i}}}}function a7(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Pae(n)?!1:n!=null))}function o7(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function zae(t,e){var n;const r=nD(t),{nodeExtensions:i,markExtensions:s}=pd(t),a=(n=i.find(d=>lt(d,"topNode")))==null?void 0:n.name,l=Object.fromEntries(i.map(d=>{const h=r.filter(S=>S.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},g=t.reduce((S,A)=>{const R=lt(A,"extendNodeSchema",p);return{...S,...R?R(d):{}}},{}),b=a7({...g,content:cn(lt(d,"content",p)),marks:cn(lt(d,"marks",p)),group:cn(lt(d,"group",p)),inline:cn(lt(d,"inline",p)),atom:cn(lt(d,"atom",p)),selectable:cn(lt(d,"selectable",p)),draggable:cn(lt(d,"draggable",p)),code:cn(lt(d,"code",p)),whitespace:cn(lt(d,"whitespace",p)),linebreakReplacement:cn(lt(d,"linebreakReplacement",p)),defining:cn(lt(d,"defining",p)),isolating:cn(lt(d,"isolating",p)),attrs:Object.fromEntries(h.map(o7))}),y=cn(lt(d,"parseHTML",p));y&&(b.parseDOM=y.map(S=>s7(S,h)));const E=lt(d,"renderHTML",p);E&&(b.toDOM=S=>E({node:S,HTMLAttributes:oh(S,h)}));const T=lt(d,"renderText",p);return T&&(b.toText=T),[d.name,b]})),u=Object.fromEntries(s.map(d=>{const h=r.filter(T=>T.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},g=t.reduce((T,S)=>{const A=lt(S,"extendMarkSchema",p);return{...T,...A?A(d):{}}},{}),b=a7({...g,inclusive:cn(lt(d,"inclusive",p)),excludes:cn(lt(d,"excludes",p)),group:cn(lt(d,"group",p)),spanning:cn(lt(d,"spanning",p)),code:cn(lt(d,"code",p)),attrs:Object.fromEntries(h.map(o7))}),y=cn(lt(d,"parseHTML",p));y&&(b.parseDOM=y.map(T=>s7(T,h)));const E=lt(d,"renderHTML",p);return E&&(b.toDOM=T=>E({mark:T,HTMLAttributes:oh(T,h)})),[d.name,b]}));return new IO({topNode:a,nodes:l,marks:u})}function Fae(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Vg(t){return t.sort((n,r)=>{const i=lt(n,"priority")||100,s=lt(r,"priority")||100;return i>s?-1:i<s?1:0})}function rD(t){const e=Vg(ex(t)),n=Fae(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function iD(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`

`,textSerializers:a={}}=n||{};let l="";return t.nodesBetween(r,i,(u,d,h,p)=>{var g;u.isBlock&&d>r&&(l+=s);const b=a==null?void 0:a[u.type.name];if(b)return h&&(l+=b({node:u,pos:d,parent:h,index:p,range:e})),!1;u.isText&&(l+=(g=u==null?void 0:u.text)==null?void 0:g.slice(Math.max(r,d)-d,i-d))}),l}function Uae(t,e){const n={from:0,to:t.content.size};return iD(t,n,e)}function sD(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function Hae(t,e){const n=xr(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,l=>{s.push(l)});const a=s.reverse().find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function aD(t,e){const n=yb(typeof e=="string"?e:e.name,t.schema);return n==="node"?Hae(t,e):n==="mark"?JR(t,e):{}}function jae(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function $ae(t){const e=jae(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,a)=>a!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function oD(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((l,u)=>{a.push({from:l,to:u})});else{const{from:l,to:u}=n[s];if(l===void 0||u===void 0)return;a.push({from:l,to:u})}a.forEach(({from:l,to:u})=>{const d=e.slice(s).map(l,-1),h=e.slice(s).map(u),p=e.invert().map(d,-1),g=e.invert().map(h);r.push({oldRange:{from:p,to:g},newRange:{from:d,to:h}})})}),$ae(r)}function nx(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),a=J_(s,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),r}var qae=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let s=r,a=null;for(;s>0&&a===null;){const l=i.node(s);(l==null?void 0:l.type.name)===e?a=l:s-=1}return[a,s]};function Nm(t,e){return e.nodes[t]||e.marks[t]||null}function ag(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var Vae=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,a,l)=>{var u,d;const h=((d=(u=i.type.spec).toText)==null?void 0:d.call(u,{node:i,pos:s,parent:a,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?h:h.slice(0,Math.max(0,r-s))}),n};function z4(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?wo(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(p=>s?s.name===p.type.name:!0).find(p=>$g(p.attrs,n,{strict:!1}));let a=0;const l=[];if(i.forEach(({$from:p,$to:g})=>{const b=p.pos,y=g.pos;t.doc.nodesBetween(b,y,(E,T)=>{if(!E.isText&&!E.marks.length)return;const S=Math.max(b,T),A=Math.min(y,T+E.nodeSize),R=A-S;a+=R,l.push(...E.marks.map(z=>({mark:z,from:S,to:A})))})}),a===0)return!1;const u=l.filter(p=>s?s.name===p.mark.type.name:!0).filter(p=>$g(p.mark.attrs,n,{strict:!1})).reduce((p,g)=>p+g.to-g.from,0),d=l.filter(p=>s?p.mark.type!==s&&p.mark.type.excludes(s):!0).reduce((p,g)=>p+g.to-g.from,0);return(u>0?u+d:u)>=a}function Gae(t,e,n={}){if(!e)return Ll(t,null,n)||z4(t,null,n);const r=yb(e,t.schema);return r==="node"?Ll(t,e,n):r==="mark"?z4(t,e,n):!1}var Yae=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const s=Eb(l=>l.type.name===e)(t.selection);if(!s)return!1;const a=t.doc.resolve(s.pos+1);return i.pos+1===a.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Wae=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function l7(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function u7(t,e){const{nodeExtensions:n}=pd(e),r=n.find(a=>a.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=cn(lt(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function _b(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(_b(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function lD(t){return t instanceof dt}var uD=class cD{constructor(e){this.position=e}static fromJSON(e){return new cD(e.position)}toJSON(){return{position:this.position}}};function Kae(t,e){const n=e.mapping.mapResult(t.position);return{position:new uD(n.pos),mapResult:n}}function Xae(t){return new uD(t)}function Qae(t,e,n){var r;const{selection:i}=e;let s=null;if(KR(i)&&(s=i.$cursor),s){const l=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(d=>d.type.excludes(n)))}const{ranges:a}=i;return a.some(({$from:l,$to:u})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(h,p,g)=>{if(d)return!1;if(h.isInline){const b=!g||g.type.allowsMarkType(n),y=!!n.isInSet(h.marks)||!h.marks.some(E=>E.type.excludes(n));d=b&&y}return!d}),d})}var Zae=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:a,ranges:l}=s,u=wo(t,r.schema);if(i)if(a){const d=JR(r,u);n.addStoredMark(u.create({...d,...e}))}else l.forEach(d=>{const h=d.$from.pos,p=d.$to.pos;r.doc.nodesBetween(h,p,(g,b)=>{const y=Math.max(b,h),E=Math.min(b+g.nodeSize,p);g.marks.find(S=>S.type===u)?g.marks.forEach(S=>{u===S.type&&n.addMark(y,E,u.create({...S.attrs,...e}))}):n.addMark(y,E,u.create(e))})});return Qae(r,n,u)},Jae=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),eoe=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=xr(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>x8(s,{...a,...e})(n)?!0:l.clearNodes()).command(({state:l})=>x8(s,{...a,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},toe=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Su(t,0,r.content.size),s=dt.create(r,i);e.setSelection(s)}return!0},noe=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let a,l;return typeof e=="number"?(a=e,l=e):e&&"from"in e&&"to"in e?(a=e.from,l=e.to):(a=s.from,l=s.to),i&&n.doc.nodesBetween(a,l,(u,d)=>{u.isText||n.setNodeMarkup(d,void 0,{...u.attrs,dir:t})}),!0},roe=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,a=Tt.atStart(r).from,l=Tt.atEnd(r).to,u=Su(i,a,l),d=Su(s,a,l),h=Tt.create(r,u,d);e.setSelection(h)}return!0},ioe=t=>({state:e,dispatch:n})=>{const r=xr(t,e.schema);return Qre(r)(e,n)};function c7(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}var soe=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,d=i.extensionManager.attributes,h=ag(d,l.node().type.name,l.node().attrs);if(s instanceof dt&&s.node.isBlock)return!l.parentOffset||!po(a,l.pos)?!1:(r&&(t&&c7(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const p=u.parentOffset===u.parent.content.size,g=l.depth===0?void 0:Dae(l.node(-1).contentMatchAt(l.indexAfter(-1)));let b=p&&g?[{type:g,attrs:h}]:void 0,y=po(e.doc,e.mapping.map(l.pos),1,b);if(!b&&!y&&po(e.doc,e.mapping.map(l.pos),1,g?[{type:g}]:void 0)&&(y=!0,b=g?[{type:g,attrs:h}]:void 0),r){if(y&&(s instanceof Tt&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,b),g&&!p&&!l.parentOffset&&l.parent.type!==g)){const E=e.mapping.map(l.before()),T=e.doc.resolve(E);l.node(-1).canReplaceWith(T.index(),T.index()+1,g)&&e.setNodeMarkup(e.mapping.map(l.before()),g)}t&&c7(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},aoe=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var a;const l=xr(t,r.schema),{$from:u,$to:d}=r.selection,h=r.selection.node;if(h&&h.isBlock||u.depth<2||!u.sameParent(d))return!1;const p=u.node(-1);if(p.type!==l)return!1;const g=s.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let S=Ae.empty;const A=u.index(-1)?1:u.index(-2)?2:3;for(let K=u.depth-A;K>=u.depth-3;K-=1)S=Ae.from(u.node(K).copy(S));const R=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,z={...ag(g,u.node().type.name,u.node().attrs),...e},I=((a=l.contentMatch.defaultType)==null?void 0:a.createAndFill(z))||void 0;S=S.append(Ae.from(l.createAndFill(null,I)||void 0));const P=u.before(u.depth-(A-1));n.replace(P,u.after(-R),new We(S,4-A,0));let $=-1;n.doc.nodesBetween(P,n.doc.content.size,(K,Z)=>{if($>-1)return!1;K.isTextblock&&K.content.size===0&&($=Z+1)}),$>-1&&n.setSelection(Tt.near(n.doc.resolve($))),n.scrollIntoView()}return!0}const b=d.pos===u.end()?p.contentMatchAt(0).defaultType:null,y={...ag(g,p.type.name,p.attrs),...e},E={...ag(g,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);const T=b?[{type:l,attrs:y},{type:b,attrs:E}]:[{type:l,attrs:y}];if(!po(n.doc,u.pos,2))return!1;if(i){const{selection:S,storedMarks:A}=r,{splittableMarks:R}=s.extensionManager,z=A||S.$to.parentOffset&&S.$from.marks();if(n.split(u.pos,2,T).scrollIntoView(),!z||!i)return!0;const I=z.filter(P=>R.includes(P.type.name));n.ensureMarks(I)}return!0},Q2=(t,e)=>{const n=Eb(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&zl(t.doc,n.pos)&&t.join(n.pos),!0},Z2=(t,e)=>{const n=Eb(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&zl(t.doc,r)&&t.join(r),!0},ooe=(t,e,n,r={})=>({editor:i,tr:s,state:a,dispatch:l,chain:u,commands:d,can:h})=>{const{extensions:p,splittableMarks:g}=i.extensionManager,b=xr(t,a.schema),y=xr(e,a.schema),{selection:E,storedMarks:T}=a,{$from:S,$to:A}=E,R=S.blockRange(A),z=T||E.$to.parentOffset&&E.$from.marks();if(!R)return!1;const I=Eb(P=>u7(P.type.name,p))(E);if(R.depth>=1&&I&&R.depth-I.depth<=1){if(I.node.type===b)return d.liftListItem(y);if(u7(I.node.type.name,p)&&b.validContent(I.node.content)&&l)return u().command(()=>(s.setNodeMarkup(I.pos,b),!0)).command(()=>Q2(s,b)).command(()=>Z2(s,b)).run()}return!n||!z||!l?u().command(()=>h().wrapInList(b,r)?!0:d.clearNodes()).wrapInList(b,r).command(()=>Q2(s,b)).command(()=>Z2(s,b)).run():u().command(()=>{const P=h().wrapInList(b,r),$=z.filter(K=>g.includes(K.type.name));return s.ensureMarks($),P?!0:d.clearNodes()}).wrapInList(b,r).command(()=>Q2(s,b)).command(()=>Z2(s,b)).run()},loe=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,a=wo(t,r.schema);return z4(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},uoe=(t,e,n={})=>({state:r,commands:i})=>{const s=xr(t,r.schema),a=xr(e,r.schema),l=Ll(r,s,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?i.setNode(a,u):i.setNode(s,{...u,...n})},coe=(t,e={})=>({state:n,commands:r})=>{const i=xr(t,n.schema);return Ll(n,i,e)?r.lift(i):r.wrapIn(i,e)},doe=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const a=t.tr,l=s.transform;for(let u=l.steps.length-1;u>=0;u-=1)a.step(l.steps[u].invert(l.docs[u]));if(s.text){const u=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,t.schema.text(s.text,u))}else a.delete(s.from,s.to)}return!0}}return!1},foe=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},hoe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:l}=n,u=wo(t,r.schema),{$from:d,empty:h,ranges:p}=l;if(!i)return!0;if(h&&a){let{from:g,to:b}=l;const y=(s=d.marks().find(T=>T.type===u))==null?void 0:s.attrs,E=J_(d,u,y);E&&(g=E.from,b=E.to),n.removeMark(g,b,u)}else p.forEach(g=>{n.removeMark(g.$from.pos,g.$to.pos,u)});return n.removeStoredMark(u),!0},poe=t=>({tr:e,state:n,dispatch:r})=>{const{selection:i}=n;let s,a;return typeof t=="number"?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=i.from,a=i.to),r&&e.doc.nodesBetween(s,a,(l,u)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,e.setNodeMarkup(u,void 0,d)}),!0},moe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,a=null;const l=yb(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(s=xr(t,r.schema)),l==="mark"&&(a=wo(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{const h=d.$from.pos,p=d.$to.pos;let g,b,y,E;n.selection.empty?r.doc.nodesBetween(h,p,(T,S)=>{s&&s===T.type&&(u=!0,y=Math.max(S,h),E=Math.min(S+T.nodeSize,p),g=S,b=T)}):r.doc.nodesBetween(h,p,(T,S)=>{S<h&&s&&s===T.type&&(u=!0,y=Math.max(S,h),E=Math.min(S+T.nodeSize,p),g=S,b=T),S>=h&&S<=p&&(s&&s===T.type&&(u=!0,i&&n.setNodeMarkup(S,void 0,{...T.attrs,...e})),a&&T.marks.length&&T.marks.forEach(A=>{if(a===A.type&&(u=!0,i)){const R=Math.max(S,h),z=Math.min(S+T.nodeSize,p);n.addMark(R,z,a.create({...A.attrs,...e}))}}))}),b&&(g!==void 0&&i&&n.setNodeMarkup(g,void 0,{...b.attrs,...e}),a&&b.marks.length&&b.marks.forEach(T=>{a===T.type&&i&&n.addMark(y,E,a.create({...T.attrs,...e}))}))}),u},goe=(t,e={})=>({state:n,dispatch:r})=>{const i=xr(t,n.schema);return qre(i,e)(n,r)},boe=(t,e={})=>({state:n,dispatch:r})=>{const i=xr(t,n.schema);return Vre(i,e)(n,r)},voe=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Bh=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},yoe=(t,e)=>{if(Z_(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Mm(t){var e;const{editor:n,from:r,to:i,text:s,rules:a,plugin:l}=t,{view:u}=n;if(u.composing)return!1;const d=u.state.doc.resolve(r);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(g=>g.type.spec.code))return!1;let h=!1;const p=Vae(d)+s;return a.forEach(g=>{if(h)return;const b=yoe(p,g.find);if(!b)return;const y=u.state.tr,E=bb({state:u.state,transaction:y}),T={from:r-(b[0].length-s.length),to:i},{commands:S,chain:A,can:R}=new vb({editor:n,state:E});g.handler({state:E,range:T,match:b,commands:S,chain:A,can:R})===null||!y.steps.length||(g.undoable&&y.setMeta(l,{transform:y,from:r,to:i,text:s}),u.dispatch(y),h=!0)}),h}function Eoe(t){const{editor:e,rules:n}=t,r=new Xn({state:{init(){return null},apply(i,s,a){const l=i.getMeta(r);if(l)return l;const u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:h}=u;typeof h=="string"?h=h:h=tx(Ae.from(h),a.schema);const{from:p}=u,g=p+h.length;Mm({editor:e,from:p,to:g,text:h,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,a,l){return Mm({editor:e,from:s,to:a,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Mm({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Mm({editor:e,from:a.pos,to:a.pos,text:`
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function _oe(t){return Object.prototype.toString.call(t).slice(8,-1)}function Om(t){return _oe(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function dD(t,e){const n={...t};return Om(t)&&Om(e)&&Object.keys(e).forEach(r=>{Om(e[r])&&Om(t[r])?n[r]=dD(t[r],e[r]):n[r]=e[r]}),n}var rx=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...cn(lt(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...cn(lt(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>dD(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Zu=class fD extends rx{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new fD(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const u=a.find(d=>(d==null?void 0:d.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function xoe(t){return typeof t=="number"}var Toe=class{constructor(t){this.find=t.find,this.handler=t.handler}},Soe=(t,e,n)=>{if(Z_(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function woe(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:a,dropEvent:l}=t,{commands:u,chain:d,can:h}=new vb({editor:e,state:n}),p=[];return n.doc.nodesBetween(r,i,(b,y)=>{var E,T,S,A,R;if((T=(E=b.type)==null?void 0:E.spec)!=null&&T.code||!(b.isText||b.isTextblock||b.isInline))return;const z=(R=(A=(S=b.content)==null?void 0:S.size)!=null?A:b.nodeSize)!=null?R:0,I=Math.max(r,y),P=Math.min(i,y+z);if(I>=P)return;const $=b.isText?b.text||"":b.textBetween(I-y,P-y,void 0,"￼");Soe($,s.find,a).forEach(Z=>{if(Z.index===void 0)return;const W=I+Z.index+1,re=W+Z[0].length,ie={from:n.tr.mapping.map(W),to:n.tr.mapping.map(re)},ye=s.handler({state:n,range:ie,match:Z,commands:u,chain:d,can:h,pasteEvent:a,dropEvent:l});p.push(ye)})}),p.every(b=>b!==null)}var Rm=null,koe=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function Coe(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const u=({state:h,from:p,to:g,rule:b,pasteEvt:y})=>{const E=h.tr,T=bb({state:h,transaction:E});if(!(!woe({editor:e,state:T,from:Math.max(p-1,0),to:g.b-1,rule:b,pasteEvent:y,dropEvent:l})||!E.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return n.map(h=>new Xn({view(p){const g=y=>{var E;r=(E=p.dom.parentElement)!=null&&E.contains(y.target)?p.dom.parentElement:null,r&&(Rm=e)},b=()=>{Rm&&(Rm=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",b),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",b)}}},props:{handleDOMEvents:{drop:(p,g)=>{if(s=r===p.dom.parentElement,l=g,!s){const b=Rm;b!=null&&b.isEditable&&setTimeout(()=>{const y=b.state.selection;y&&b.commands.deleteRange({from:y.from,to:y.to})},10)}return!1},paste:(p,g)=>{var b;const y=(b=g.clipboardData)==null?void 0:b.getData("text/html");return a=g,i=!!(y!=null&&y.includes("data-pm-slice")),!1}}},appendTransaction:(p,g,b)=>{const y=p[0],E=y.getMeta("uiEvent")==="paste"&&!i,T=y.getMeta("uiEvent")==="drop"&&!s,S=y.getMeta("applyPasteRules"),A=!!S;if(!E&&!T&&!A)return;if(A){let{text:I}=S;typeof I=="string"?I=I:I=tx(Ae.from(I),b.schema);const{from:P}=S,$=P+I.length,K=koe(I);return u({rule:h,state:b,from:P,to:{b:$},pasteEvt:K})}const R=g.doc.content.findDiffStart(b.doc.content),z=g.doc.content.findDiffEnd(b.doc.content);if(!(!xoe(R)||!z||R===z.b))return u({rule:h,state:b,from:R,to:z,pasteEvt:a})}}))}var xb=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=rD(t),this.schema=zae(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Nm(e.name,this.schema)},r=lt(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Vg([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Nm(r.name,this.schema)},s=[],a=lt(r,"addKeyboardShortcuts",i);let l={};if(r.type==="mark"&&lt(r,"exitable",i)&&(l.ArrowRight=()=>Zu.handleExit({editor:t,mark:r})),a){const g=Object.fromEntries(Object.entries(a()).map(([b,y])=>[b,()=>y({editor:t})]));l={...l,...g}}const u=Hse(l);s.push(u);const d=lt(r,"addInputRules",i);if(l7(r,t.options.enableInputRules)&&d){const g=d();if(g&&g.length){const b=Eoe({editor:t,rules:g}),y=Array.isArray(b)?b:[b];s.push(...y)}}const h=lt(r,"addPasteRules",i);if(l7(r,t.options.enablePasteRules)&&h){const g=h();if(g&&g.length){const b=Coe({editor:t,rules:g});s.push(...b)}}const p=lt(r,"addProseMirrorPlugins",i);if(p){const g=p();s.push(...g)}return s})}get attributes(){return nD(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=pd(this.extensions);return Object.fromEntries(e.filter(n=>!!lt(n,"addNodeView")).map(n=>{const r=this.attributes.filter(u=>u.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:xr(n.name,this.schema)},s=lt(n,"addNodeView",i);if(!s)return[];const a=s();if(!a)return[];const l=(u,d,h,p,g)=>{const b=oh(u,r);return a({node:u,view:d,getPos:h,decorations:p,innerDecorations:g,editor:t,extension:n,HTMLAttributes:b})};return[n.name,l]}))}dispatchTransaction(t){const{editor:e}=this;return Vg([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Nm(i.name,this.schema)},a=lt(i,"dispatchTransaction",s);return a?l=>{a.call(s,{transaction:l,next:r})}:r},t)}get markViews(){const{editor:t}=this,{markExtensions:e}=pd(this.extensions);return Object.fromEntries(e.filter(n=>!!lt(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:wo(n.name,this.schema)},s=lt(n,"addMarkView",i);if(!s)return[];const a=(l,u,d)=>{const h=oh(l,r);return s()({mark:l,view:u,inline:d,editor:t,extension:n,HTMLAttributes:h,updateAttributes:p=>{Hoe(l,t,p)}})};return[n.name,a]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Nm(e.name,this.schema)};e.type==="mark"&&((n=cn(lt(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const i=lt(e,"onBeforeCreate",r),s=lt(e,"onCreate",r),a=lt(e,"onUpdate",r),l=lt(e,"onSelectionUpdate",r),u=lt(e,"onTransaction",r),d=lt(e,"onFocus",r),h=lt(e,"onBlur",r),p=lt(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),h&&this.editor.on("blur",h),p&&this.editor.on("destroy",p)})}};xb.resolve=rD;xb.sort=Vg;xb.flatten=ex;var Aoe={};Q_(Aoe,{ClipboardTextSerializer:()=>pD,Commands:()=>mD,Delete:()=>gD,Drop:()=>bD,Editable:()=>vD,FocusEvents:()=>ED,Keymap:()=>_D,Paste:()=>xD,Tabindex:()=>TD,TextDirection:()=>SD,focusEventsPluginKey:()=>yD});var nr=class hD extends rx{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new hD(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},pD=nr.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Xn({key:new Dr("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map(h=>h.$from.pos)),l=Math.max(...s.map(h=>h.$to.pos)),u=sD(n);return iD(r,{from:a,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),mD=nr.create({name:"commands",addCommands(){return{...YR}}}),gD=nr.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const s=()=>{var a,l,u,d;if((d=(u=(l=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:l.filterTransaction)==null?void 0:u.call(l,t))!=null?d:t.getMeta("y-sync$"))return;const h=eD(t.before,[t,...e]);oD(h).forEach(b=>{h.mapping.mapResult(b.oldRange.from).deletedAfter&&h.mapping.mapResult(b.oldRange.to).deletedBefore&&h.before.nodesBetween(b.oldRange.from,b.oldRange.to,(y,E)=>{const T=E+y.nodeSize-2,S=b.oldRange.from<=E&&T<=b.oldRange.to;this.editor.emit("delete",{type:"node",node:y,from:E,to:T,newFrom:h.mapping.map(E),newTo:h.mapping.map(T),deletedRange:b.oldRange,newRange:b.newRange,partial:!S,editor:this.editor,transaction:t,combinedTransform:h})})});const g=h.mapping;h.steps.forEach((b,y)=>{var E,T;if(b instanceof Ws){const S=g.slice(y).map(b.from,-1),A=g.slice(y).map(b.to),R=g.invert().map(S,-1),z=g.invert().map(A),I=(E=h.doc.nodeAt(S-1))==null?void 0:E.marks.some($=>$.eq(b.mark)),P=(T=h.doc.nodeAt(A))==null?void 0:T.marks.some($=>$.eq(b.mark));this.editor.emit("delete",{type:"mark",mark:b.mark,from:b.from,to:b.to,deletedRange:{from:R,to:z},newRange:{from:S,to:A},partial:!!(P||I),editor:this.editor,transaction:t,combinedTransform:h})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),bD=nr.create({name:"drop",addProseMirrorPlugins(){return[new Xn({key:new Dr("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),vD=nr.create({name:"editable",addProseMirrorPlugins(){return[new Xn({key:new Dr("editable"),props:{editable:()=>this.editor.options.editable}})]}}),yD=new Dr("focusEvents"),ED=nr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Xn({key:yD,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),_D=nr.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:l})=>{const{selection:u,doc:d}=l,{empty:h,$anchor:p}=u,{pos:g,parent:b}=p,y=p.parent.isTextblock&&g>0?l.doc.resolve(g-1):p,E=y.parent.type.spec.isolating,T=p.pos-p.parentOffset,S=E&&y.parent.childCount===1?T===p.pos:It.atStart(d).from===g;return!h||!b.type.isTextblock||b.textContent.length||!S||S&&p.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return qg()||ZR()?s:i},addProseMirrorPlugins(){return[new Xn({key:new Dr("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(E=>E.getMeta("composition")))return;const r=t.some(E=>E.docChanged)&&!e.doc.eq(n.doc),i=t.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:a,to:l}=e.selection,u=It.atStart(e.doc).from,d=It.atEnd(e.doc).to;if(s||!(a===u&&l===d)||!_b(n.doc))return;const g=n.tr,b=bb({state:n,transaction:g}),{commands:y}=new vb({editor:this.editor,state:b});if(y.clearNodes(),!!g.steps.length)return g}})]}}),xD=nr.create({name:"paste",addProseMirrorPlugins(){return[new Xn({key:new Dr("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),TD=nr.create({name:"tabindex",addProseMirrorPlugins(){return[new Xn({key:new Dr("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),SD=nr.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=pd(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Xn({key:new Dr("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),Noe=class lf{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new lf(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new lf(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new lf(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,a=n.isInline,l=this.pos+r+(s?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(l);if(!i&&!a&&u.depth<=this.depth)return;const d=new lf(u,this.editor,i,i||a?n:null);i&&(d.actualDepth=this.depth+1),e.push(d)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,a=Object.keys(n);for(let l=0;l<a.length;l+=1){const u=a[l];if(s[u]!==n[u])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(a=>{r&&i.length>0||(a.node.type.name===e&&s.every(u=>n[u]===a.node.attrs[u])&&i.push(a),!(r&&i.length>0)&&(i=i.concat(a.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},Moe=`.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}`;function Ooe(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var Roe=class extends voe{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Kae,createMappablePosition:Xae},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:s})=>this.options.onDrop(r,i,s)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=XR(e,this.options.autofocus);this.editorState=Xc.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Ooe(Moe,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=tD(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(a=>!a.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const r=[...this.options.enableCoreExtensions?[vD,pD.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),mD,ED,_D,TD,bD,xD,gD,SD.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new xb(r,this)}createCommandManager(){this.commandManager=new vb({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=B4(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=B4(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r;this.editorView=new VR(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:i,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(d=>{var h;return(h=this.capturedTransaction)==null?void 0:h.step(d)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const a=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=a==null?void 0:a.getMeta("focus"),u=a==null?void 0:a.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:a}),u&&this.emit("blur",{editor:this,event:u.event,transaction:a}),!(t.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return aD(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return Gae(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return tx(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`

`,textSerializers:n={}}=t||{};return Uae(this.state.doc,{blockSeparator:e,textSerializers:{...sD(this.schema),...n}})}get isEmpty(){return _b(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new Noe(e,this)}get $doc(){return this.$pos(0)}};function md(t){return new Bh({find:t.find,handler:({state:e,range:n,match:r})=>{const i=cn(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];if(a){const u=l.search(/\S/),d=n.from+l.indexOf(a),h=d+a.length;if(nx(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(E=>E===t.type&&E!==b.mark.type)).filter(b=>b.to>d).length)return null;h<n.to&&s.delete(h,n.to),d>n.from&&s.delete(n.from+u,d);const g=n.from+u+a.length;s.addMark(n.from+u,g,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function Doe(t){return new Bh({find:t.find,handler:({state:e,range:n,match:r})=>{const i=cn(t.getAttributes,void 0,r)||{},{tr:s}=e,a=n.from;let l=n.to;const u=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let h=a+d;h>l?h=l:l=h+r[1].length;const p=r[0][r[0].length-1];s.insertText(p,a+r[0].length-1),s.replaceWith(h,l,u)}else if(r[0]){const d=t.type.isInline?a:a-1;s.insert(d,t.type.create(i)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()},undoable:t.undoable})}function F4(t){return new Bh({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=cn(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function rr(t){return new Bh({find:t.find,handler:({state:e,range:n,match:r})=>{let i=t.replace,s=n.from;const a=n.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);i+=r[0].slice(l+r[1].length),s+=l;const u=s-a;u>0&&(i=r[0].slice(l-u,l)+i,s=a)}e.tr.insertText(i,s,a)},undoable:t.undoable})}function gd(t){return new Bh({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=cn(t.getAttributes,void 0,r)||{},a=e.tr.delete(n.from,n.to),u=a.doc.resolve(n.from).blockRange(),d=u&&L_(u,t.type,s);if(!d)return null;if(a.wrap(u,d),t.keepMarks&&t.editor){const{selection:p,storedMarks:g}=e,{splittableMarks:b}=t.editor.extensionManager,y=g||p.$to.parentOffset&&p.$from.marks();if(y){const E=y.filter(T=>b.includes(T.type.name));a.ensureMarks(E)}}if(t.keepAttributes){const p=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,s).run()}const h=a.doc.resolve(n.from-1).nodeBefore;h&&h.type===t.type&&zl(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,h))&&a.join(n.from-1)},undoable:t.undoable})}function Ioe(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof dt){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}var Loe={};Q_(Loe,{createAtomBlockMarkdownSpec:()=>Poe,createBlockMarkdownSpec:()=>Boe,createInlineMarkdownSpec:()=>Uoe,parseAttributes:()=>ix,parseIndentedBlocks:()=>U4,renderNestedMarkdownContent:()=>ax,serializeAttributes:()=>sx});function ix(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,d=>(n.push(d),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const d=i.map(h=>h.trim().slice(1));e.class=d.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]);const a=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(a)).forEach(([,d,h])=>{var p;const g=parseInt(((p=h.match(/__QUOTED_(\d+)__/))==null?void 0:p[1])||"0",10),b=n[g];b&&(e[d]=b.slice(1,-1))});const u=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return u&&u.split(/\s+/).filter(Boolean).forEach(h=>{h.match(/^[a-zA-Z][\w-]*$/)&&(e[h]=!0)}),e}function sx(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function Poe(t){const{nodeName:e,name:n,parseAttributes:r=ix,serializeAttributes:i=sx,defaultAttributes:s={},requiredAttributes:a=[],allowedAttributes:l}=t,u=n||e,d=h=>{if(!l)return h;const p={};return l.forEach(g=>{g in h&&(p[g]=h[g])}),p};return{parseMarkdown:(h,p)=>{const g={...s,...h.attributes};return p.createNode(e,g,[])},markdownTokenizer:{name:e,level:"block",start(h){var p;const g=new RegExp(`^:::${u}(?:\\s|$)`,"m"),b=(p=h.match(g))==null?void 0:p.index;return b!==void 0?b:-1},tokenize(h,p,g){const b=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),y=h.match(b);if(!y)return;const E=y[1]||"",T=r(E);if(!a.find(A=>!(A in T)))return{type:e,raw:y[0],attributes:T}}},renderMarkdown:h=>{const p=d(h.attrs||{}),g=i(p),b=g?` {${g}}`:"";return`:::${u}${b} :::`}}}function Boe(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=ix,serializeAttributes:s=sx,defaultAttributes:a={},content:l="block",allowedAttributes:u}=t,d=n||e,h=p=>{if(!u)return p;const g={};return u.forEach(b=>{b in p&&(g[b]=p[b])}),g};return{parseMarkdown:(p,g)=>{let b;if(r){const E=r(p);b=typeof E=="string"?[{type:"text",text:E}]:E}else l==="block"?b=g.parseChildren(p.tokens||[]):b=g.parseInline(p.tokens||[]);const y={...a,...p.attributes};return g.createNode(e,y,b)},markdownTokenizer:{name:e,level:"block",start(p){var g;const b=new RegExp(`^:::${d}`,"m"),y=(g=p.match(b))==null?void 0:g.index;return y!==void 0?y:-1},tokenize(p,g,b){var y;const E=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),T=p.match(E);if(!T)return;const[S,A=""]=T,R=i(A);let z=1;const I=S.length;let P="";const $=/^:::([\w-]*)(\s.*)?/gm,K=p.slice(I);for($.lastIndex=0;;){const Z=$.exec(K);if(Z===null)break;const W=Z.index,re=Z[1];if(!((y=Z[2])!=null&&y.endsWith(":::"))){if(re)z+=1;else if(z-=1,z===0){const ie=K.slice(0,W);P=ie.trim();const ye=p.slice(0,I+W+Z[0].length);let ae=[];if(P)if(l==="block")for(ae=b.blockTokens(ie),ae.forEach(de=>{de.text&&(!de.tokens||de.tokens.length===0)&&(de.tokens=b.inlineTokens(de.text))});ae.length>0;){const de=ae[ae.length-1];if(de.type==="paragraph"&&(!de.text||de.text.trim()===""))ae.pop();else break}else ae=b.inlineTokens(P);return{type:e,raw:ye,attributes:R,content:P,tokens:ae}}}}}},renderMarkdown:(p,g)=>{const b=h(p.attrs||{}),y=s(b),E=y?` {${y}}`:"",T=g.renderChildren(p.content||[],`

`);return`:::${d}${E}

${T}

:::`}}}function zoe(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,i,s,a]=r;e[i]=s||a,r=n.exec(t)}return e}function Foe(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function Uoe(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=zoe,serializeAttributes:s=Foe,defaultAttributes:a={},selfClosing:l=!1,allowedAttributes:u}=t,d=n||e,h=g=>{if(!u)return g;const b={};return u.forEach(y=>{const E=typeof y=="string"?y:y.name,T=typeof y=="string"?void 0:y.skipIfDefault;if(E in g){const S=g[E];if(T!==void 0&&S===T)return;b[E]=S}}),b},p=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(g,b)=>{const y={...a,...g.attributes};if(l)return b.createNode(e,y);const E=r?r(g):g.content||"";return E?b.createNode(e,y,[b.createTextNode(E)]):b.createNode(e,y,[])},markdownTokenizer:{name:e,level:"inline",start(g){const b=l?new RegExp(`\\[${p}\\s*[^\\]]*\\]`):new RegExp(`\\[${p}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${p}\\]`),y=g.match(b),E=y==null?void 0:y.index;return E!==void 0?E:-1},tokenize(g,b,y){const E=l?new RegExp(`^\\[${p}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${p}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${p}\\]`),T=g.match(E);if(!T)return;let S="",A="";if(l){const[,z]=T;A=z}else{const[,z,I]=T;A=z,S=I||""}const R=i(A.trim());return{type:e,raw:T[0],content:S.trim(),attributes:R}}},renderMarkdown:g=>{let b="";r?b=r(g):g.content&&g.content.length>0&&(b=g.content.filter(S=>S.type==="text").map(S=>S.text).join(""));const y=h(g.attrs||{}),E=s(y),T=E?` ${E}`:"";return l?`[${d}${T}]`:`[${d}${T}]${b}[/${d}]`}}}function U4(t,e,n){var r,i,s,a;const l=t.split(`
`),u=[];let d="",h=0;const p=e.baseIndentSize||2;for(;h<l.length;){const g=l[h],b=g.match(e.itemPattern);if(!b){if(u.length>0)break;if(g.trim()===""){h+=1,d=`${d}${g}
`;continue}else return}const y=e.extractItemData(b),{indentLevel:E,mainContent:T}=y;d=`${d}${g}
`;const S=[T];for(h+=1;h<l.length;){const I=l[h];if(I.trim()===""){const $=l.slice(h+1).findIndex(W=>W.trim()!=="");if($===-1)break;if((((i=(r=l[h+1+$].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>E){S.push(I),d=`${d}${I}
`,h+=1;continue}else break}if((((a=(s=I.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:a.length)||0)>E)S.push(I),d=`${d}${I}
`,h+=1;else break}let A;const R=S.slice(1);if(R.length>0){const I=R.map(P=>P.slice(E+p)).join(`
`);I.trim()&&(e.customNestedParser?A=e.customNestedParser(I):A=n.blockTokens(I))}const z=e.createToken(y,A);u.push(z)}if(u.length!==0)return{items:u,raw:d}}function ax(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[s,...a]=t.content,l=e.renderChildren([s]),u=[`${i}${l}`];return a&&a.length>0&&a.forEach(d=>{const h=e.renderChildren([d]);if(h){const p=h.split(`
`).map(g=>g?e.indent(g):"").join(`
`);u.push(p)}}),u.join(`
`)}function Hoe(t,e,n={}){const{state:r}=e,{doc:i,tr:s}=r,a=t;i.descendants((l,u)=>{const d=s.mapping.map(u),h=s.mapping.map(u)+l.nodeSize;let p=null;if(l.marks.forEach(b=>{if(b!==a)return!1;p=b}),!p)return;let g=!1;if(Object.keys(n).forEach(b=>{n[b]!==p.attrs[b]&&(g=!0)}),g){const b=t.type.create({...t.attrs,...n});s.removeMark(d,h,t.type),s.addMark(d,h,b)}}),s.docChanged&&e.view.dispatch(s)}var ds=class wD extends rx{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new wD(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Uu(t){return new Toe({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=cn(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=e,l=r[r.length-1],u=r[0];let d=n.to;if(l){const h=u.search(/\S/),p=n.from+u.indexOf(l),g=p+l.length;if(nx(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(T=>T===t.type&&T!==y.mark.type)).filter(y=>y.to>p).length)return null;g<n.to&&a.delete(g,n.to),p>n.from&&a.delete(n.from+h,p),d=n.from+h+l.length,a.addMark(n.from+h,d,t.type.create(s||{})),a.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:joe,getOwnPropertySymbols:$oe}=Object,{hasOwnProperty:qoe}=Object.prototype;function J2(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function Dm(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);const{cache:s}=i,a=s.get(n),l=s.get(r);if(a&&l)return a===r&&l===n;s.set(n,r),s.set(r,n);const u=t(n,r,i);return s.delete(n),s.delete(r),u}}function Voe(t){return t!=null?t[Symbol.toStringTag]:void 0}function d7(t){return joe(t).concat($oe(t))}const Goe=Object.hasOwn||((t,e)=>qoe.call(t,e));function Ju(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const Yoe="__v",Woe="__o",Koe="_owner",{getOwnPropertyDescriptor:f7,keys:h7}=Object;function Xoe(t,e){return t.byteLength===e.byteLength&&Gg(new Uint8Array(t),new Uint8Array(e))}function Qoe(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function Zoe(t,e){return t.byteLength===e.byteLength&&Gg(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Joe(t,e){return Ju(t.getTime(),e.getTime())}function ele(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function tle(t,e){return t===e}function p7(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.entries();let a,l,u=0;for(;(a=s.next())&&!a.done;){const d=e.entries();let h=!1,p=0;for(;(l=d.next())&&!l.done;){if(i[p]){p++;continue}const g=a.value,b=l.value;if(n.equals(g[0],b[0],u,p,t,e,n)&&n.equals(g[1],b[1],g[0],b[0],t,e,n)){h=i[p]=!0;break}p++}if(!h)return!1;u++}return!0}const nle=Ju;function rle(t,e,n){const r=h7(t);let i=r.length;if(h7(e).length!==i)return!1;for(;i-- >0;)if(!kD(t,e,n,r[i]))return!1;return!0}function q0(t,e,n){const r=d7(t);let i=r.length;if(d7(e).length!==i)return!1;let s,a,l;for(;i-- >0;)if(s=r[i],!kD(t,e,n,s)||(a=f7(t,s),l=f7(e,s),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function ile(t,e){return Ju(t.valueOf(),e.valueOf())}function sle(t,e){return t.source===e.source&&t.flags===e.flags}function m7(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.values();let a,l;for(;(a=s.next())&&!a.done;){const u=e.values();let d=!1,h=0;for(;(l=u.next())&&!l.done;){if(!i[h]&&n.equals(a.value,l.value,a.value,l.value,t,e,n)){d=i[h]=!0;break}h++}if(!d)return!1}return!0}function Gg(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function ale(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function kD(t,e,n,r){return(r===Koe||r===Woe||r===Yoe)&&(t.$$typeof||e.$$typeof)?!0:Goe(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const ole="[object ArrayBuffer]",lle="[object Arguments]",ule="[object Boolean]",cle="[object DataView]",dle="[object Date]",fle="[object Error]",hle="[object Map]",ple="[object Number]",mle="[object Object]",gle="[object RegExp]",ble="[object Set]",vle="[object String]",yle={"[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},Ele="[object URL]",_le=Object.prototype.toString;function xle({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:a,areNumbersEqual:l,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:g,areUrlsEqual:b,unknownTagComparators:y}){return function(T,S,A){if(T===S)return!0;if(T==null||S==null)return!1;const R=typeof T;if(R!==typeof S)return!1;if(R!=="object")return R==="number"?l(T,S,A):R==="function"?s(T,S,A):!1;const z=T.constructor;if(z!==S.constructor)return!1;if(z===Object)return u(T,S,A);if(Array.isArray(T))return e(T,S,A);if(z===Date)return r(T,S,A);if(z===RegExp)return h(T,S,A);if(z===Map)return a(T,S,A);if(z===Set)return p(T,S,A);const I=_le.call(T);if(I===dle)return r(T,S,A);if(I===gle)return h(T,S,A);if(I===hle)return a(T,S,A);if(I===ble)return p(T,S,A);if(I===mle)return typeof T.then!="function"&&typeof S.then!="function"&&u(T,S,A);if(I===Ele)return b(T,S,A);if(I===fle)return i(T,S,A);if(I===lle)return u(T,S,A);if(yle[I])return g(T,S,A);if(I===ole)return t(T,S,A);if(I===cle)return n(T,S,A);if(I===ule||I===ple||I===vle)return d(T,S,A);if(y){let P=y[I];if(!P){const $=Voe(T);$&&(P=y[$])}if(P)return P(T,S,A)}return!1}}function Tle({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:Xoe,areArraysEqual:n?q0:Qoe,areDataViewsEqual:Zoe,areDatesEqual:Joe,areErrorsEqual:ele,areFunctionsEqual:tle,areMapsEqual:n?J2(p7,q0):p7,areNumbersEqual:nle,areObjectsEqual:n?q0:rle,arePrimitiveWrappersEqual:ile,areRegExpsEqual:sle,areSetsEqual:n?J2(m7,q0):m7,areTypedArraysEqual:n?J2(Gg,q0):Gg,areUrlsEqual:ale,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const i=Dm(r.areArraysEqual),s=Dm(r.areMapsEqual),a=Dm(r.areObjectsEqual),l=Dm(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:l})}return r}function Sle(t){return function(e,n,r,i,s,a,l){return t(e,n,l)}}function wle({circular:t,comparator:e,createState:n,equals:r,strict:i}){if(n)return function(l,u){const{cache:d=t?new WeakMap:void 0,meta:h}=n();return e(l,u,{cache:d,equals:r,meta:h,strict:i})};if(t)return function(l,u){return e(l,u,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(l,u){return e(l,u,s)}}const kle=Ul();Ul({strict:!0});Ul({circular:!0});Ul({circular:!0,strict:!0});Ul({createInternalComparator:()=>Ju});Ul({strict:!0,createInternalComparator:()=>Ju});Ul({circular:!0,createInternalComparator:()=>Ju});Ul({circular:!0,createInternalComparator:()=>Ju,strict:!0});function Ul(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:i=!1}=t,s=Tle(t),a=xle(s),l=n?n(a):Sle(a);return wle({circular:e,comparator:a,createState:r,equals:l,strict:i})}var eE={exports:{}},tE={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var g7;function Cle(){if(g7)return tE;g7=1;var t=gh(),e=uA();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,a=t.useEffect,l=t.useMemo,u=t.useDebugValue;return tE.useSyncExternalStoreWithSelector=function(d,h,p,g,b){var y=s(null);if(y.current===null){var E={hasValue:!1,value:null};y.current=E}else E=y.current;y=l(function(){function S(P){if(!A){if(A=!0,R=P,P=g(P),b!==void 0&&E.hasValue){var $=E.value;if(b($,P))return z=$}return z=P}if($=z,r(R,P))return $;var K=g(P);return b!==void 0&&b($,K)?(R=P,$):(R=P,z=K)}var A=!1,R,z,I=p===void 0?null:p;return[function(){return S(h())},I===null?void 0:function(){return S(I())}]},[h,p,g,b]);var T=i(d,y[0],y[1]);return a(function(){E.hasValue=!0,E.value=T},[T]),u(T),T},tE}var b7;function Ale(){return b7||(b7=1,eE.exports=Cle()),eE.exports}var Nle=Ale(),Mle=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},Ole=({contentComponent:t})=>{const e=D3.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return C.jsx(C.Fragment,{children:Object.values(e)})};function Rle(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:BU.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}var Dle=class extends le.Component{constructor(t){var e;super(t),this.editorContentRef=le.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=Rle(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;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(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return C.jsxs(C.Fragment,{children:[C.jsx("div",{ref:Mle(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&C.jsx(Ole,{contentComponent:t.contentComponent})]})}},Ile=U.forwardRef((t,e)=>{const n=le.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return le.createElement(Dle,{key:n,innerRef:e,...t})}),Lle=le.memo(Ile),Ple=typeof window<"u"?U.useLayoutEffect:U.useEffect,Ble=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,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(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function zle(t){var e;const[n]=U.useState(()=>new Ble(t.editor)),r=Nle.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:kle);return Ple(()=>n.watch(t.editor),[t.editor,n]),U.useDebugValue(r),r}var Fle=!1,H4=typeof window>"u",Ule=H4||!!(typeof window<"u"&&window.next),Hle=class CD{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(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?H4||Ule?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...r)},onDelete:(...r)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...r)}};return new Roe(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,s)=>{var a;return i===((a=n.extensions)==null?void 0:a[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?CD.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((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function jle(t={},e=[]){const n=U.useRef(t);n.current=t;const[r]=U.useState(()=>new Hle(n)),i=D3.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return U.useDebugValue(i),U.useEffect(r.onRender(e)),zle({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),i}var $le=U.createContext({editor:null});$le.Consumer;var qle=U.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Vle=()=>U.useContext(qle);le.forwardRef((t,e)=>{const{onDragStart:n}=Vle(),r=t.as||"div";return C.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});le.createContext({markViewContentRef:()=>{}});var Yg=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},Gle=/^\s*>\s$/,Yle=ds.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Yg("blockquote",{...Tr(this.options.HTMLAttributes,t),children:Yg("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach(i=>{const l=e.renderChildren([i]).split(`
`).map(u=>u.trim()===""?n:`${n} ${u}`);r.push(l.join(`
`))}),r.join(`
${n}
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[gd({find:Gle,type:this.type})]}}),Wle=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Kle=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Xle=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Qle=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Zle=Zu.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Yg("strong",{...Tr(this.options.HTMLAttributes,t),children:Yg("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[md({find:Wle,type:this.type}),md({find:Xle,type:this.type})]},addPasteRules(){return[Uu({find:Kle,type:this.type}),Uu({find:Qle,type:this.type})]}}),Jle=/(^|[^`])`([^`]+)`(?!`)$/,eue=/(^|[^`])`([^`]+)`(?!`)/g,tue=Zu.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Tr(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[md({find:Jle,type:this.type})]},addPasteRules(){return[Uu({find:eue,type:this.type})]}}),nE=4,nue=/^```([a-z]+)?[\s\n]$/,rue=/^~~~([a-z]+)?[\s\n]$/,iue=ds.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:nE,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Tr(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const i=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
`):r=`\`\`\`${i}

\`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:nE,{state:r}=t,{selection:i}=r,{$from:s,empty:a}=i;if(s.parent.type!==this.type)return!1;const l=" ".repeat(n);return a?t.commands.insertContent(l):t.commands.command(({tr:u})=>{const{from:d,to:h}=i,b=r.doc.textBetween(d,h,`
`,`
`).split(`
`).map(y=>l+y).join(`
`);return u.replaceWith(d,h,r.schema.text(b)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:nE,{state:r}=t,{selection:i}=r,{$from:s,empty:a}=i;return s.parent.type!==this.type?!1:a?t.commands.command(({tr:l})=>{var u;const{pos:d}=s,h=s.start(),p=s.end(),b=r.doc.textBetween(h,p,`
`,`
`).split(`
`);let y=0,E=0;const T=d-h;for(let P=0;P<b.length;P+=1){if(E+b[P].length>=T){y=P;break}E+=b[P].length+1}const A=((u=b[y].match(/^ */))==null?void 0:u[0])||"",R=Math.min(A.length,n);if(R===0)return!0;let z=h;for(let P=0;P<y;P+=1)z+=b[P].length+1;return l.delete(z,z+R),d-z<=R&&l.setSelection(Tt.create(l.doc,z)),!0}):t.commands.command(({tr:l})=>{const{from:u,to:d}=i,g=r.doc.textBetween(u,d,`
`,`
`).split(`
`).map(b=>{var y;const E=((y=b.match(/^ */))==null?void 0:y[0])||"",T=Math.min(E.length,n);return b.slice(T)}).join(`
`);return l.replaceWith(u,d,r.schema.text(g)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`

`);return!s||!a?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:d})=>(d.setSelection(It.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[F4({find:nue,type:this.type,getAttributes:t=>({language:t[1]})}),F4({find:rue,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Xn({key:new Dr("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:a,schema:l}=t.state,u=l.text(n.replace(/\r\n?/g,`
`));return a.replaceSelectionWith(this.type.create({language:s},u)),a.selection.$from.parent.type!==this.type&&a.setSelection(Tt.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),sue=ds.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`

`):""}),aue=ds.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Tr(this.options.HTMLAttributes,t)]},renderText(){return`
`},renderMarkdown:()=>`  
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=r.extensionManager,u=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:h})=>{if(h&&u&&a){const p=u.filter(g=>l.includes(g.type.name));d.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),oue=ds.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Tr(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(r);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>F4({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),lue=ds.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Tr(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Ioe(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,i=t();return lD(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:l})=>{if(l){const{$to:u}=a.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?a.setSelection(Tt.create(a.doc,u.pos+1)):u.nodeAfter.isBlock?a.setSelection(dt.create(a.doc,u.pos)):a.setSelection(Tt.create(a.doc,u.pos));else{const h=s.schema.nodes[this.options.nextNodeType]||u.parent.type.contentMatch.defaultType,p=h==null?void 0:h.create();p&&(a.insert(d,p),a.setSelection(Tt.create(a.doc,d+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Doe({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),uue=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,cue=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,due=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,fue=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,hue=Zu.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Tr(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[md({find:uue,type:this.type}),md({find:due,type:this.type})]},addPasteRules(){return[Uu({find:cue,type:this.type}),Uu({find:fue,type:this.type})]}});const pue=" ögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",mue="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",j4="numeric",$4="ascii",q4="alpha",Pf="asciinumeric",uf="alphanumeric",V4="domain",AD="emoji",gue="scheme",bue="slashscheme",rE="whitespace";function vue(t,e){return t in e||(e[t]=[]),e[t]}function wu(t,e,n){e[j4]&&(e[Pf]=!0,e[uf]=!0),e[$4]&&(e[Pf]=!0,e[q4]=!0),e[Pf]&&(e[uf]=!0),e[q4]&&(e[uf]=!0),e[uf]&&(e[V4]=!0),e[AD]&&(e[V4]=!0);for(const r in e){const i=vue(r,n);i.indexOf(t)<0&&i.push(t)}}function yue(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Fi(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Fi.groups={};Fi.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||Fi.groups;let i;return e&&e.j?i=e:(i=new Fi(e),n&&r&&wu(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(t[a]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||Fi.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let a,l=i.go(t);if(l?(a=new Fi,Object.assign(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new Fi,s){if(r)if(a.t&&typeof a.t=="string"){const u=Object.assign(yue(a.t,r),n);wu(s,u,r)}else n&&wu(s,n,r);a.t=s}return i.j[t]=a,a}};const Dt=(t,e,n,r,i)=>t.ta(e,n,r,i),er=(t,e,n,r,i)=>t.tr(e,n,r,i),v7=(t,e,n,r,i)=>t.ts(e,n,r,i),Re=(t,e,n,r,i)=>t.tt(e,n,r,i),eo="WORD",G4="UWORD",ND="ASCIINUMERICAL",MD="ALPHANUMERICAL",lh="LOCALHOST",Y4="TLD",W4="UTLD",og="SCHEME",Yc="SLASH_SCHEME",ox="NUM",K4="WS",lx="NL",Bf="OPENBRACE",zf="CLOSEBRACE",Wg="OPENBRACKET",Kg="CLOSEBRACKET",Xg="OPENPAREN",Qg="CLOSEPAREN",Zg="OPENANGLEBRACKET",Jg="CLOSEANGLEBRACKET",e1="FULLWIDTHLEFTPAREN",t1="FULLWIDTHRIGHTPAREN",n1="LEFTCORNERBRACKET",r1="RIGHTCORNERBRACKET",i1="LEFTWHITECORNERBRACKET",s1="RIGHTWHITECORNERBRACKET",a1="FULLWIDTHLESSTHAN",o1="FULLWIDTHGREATERTHAN",l1="AMPERSAND",u1="APOSTROPHE",c1="ASTERISK",hl="AT",d1="BACKSLASH",f1="BACKTICK",h1="CARET",gl="COLON",ux="COMMA",p1="DOLLAR",ca="DOT",m1="EQUALS",cx="EXCLAMATION",Ts="HYPHEN",Ff="PERCENT",g1="PIPE",b1="PLUS",v1="POUND",Uf="QUERY",dx="QUOTE",OD="FULLWIDTHMIDDLEDOT",fx="SEMI",da="SLASH",Hf="TILDE",y1="UNDERSCORE",RD="EMOJI",E1="SYM";var DD=Object.freeze({__proto__:null,ALPHANUMERICAL:MD,AMPERSAND:l1,APOSTROPHE:u1,ASCIINUMERICAL:ND,ASTERISK:c1,AT:hl,BACKSLASH:d1,BACKTICK:f1,CARET:h1,CLOSEANGLEBRACKET:Jg,CLOSEBRACE:zf,CLOSEBRACKET:Kg,CLOSEPAREN:Qg,COLON:gl,COMMA:ux,DOLLAR:p1,DOT:ca,EMOJI:RD,EQUALS:m1,EXCLAMATION:cx,FULLWIDTHGREATERTHAN:o1,FULLWIDTHLEFTPAREN:e1,FULLWIDTHLESSTHAN:a1,FULLWIDTHMIDDLEDOT:OD,FULLWIDTHRIGHTPAREN:t1,HYPHEN:Ts,LEFTCORNERBRACKET:n1,LEFTWHITECORNERBRACKET:i1,LOCALHOST:lh,NL:lx,NUM:ox,OPENANGLEBRACKET:Zg,OPENBRACE:Bf,OPENBRACKET:Wg,OPENPAREN:Xg,PERCENT:Ff,PIPE:g1,PLUS:b1,POUND:v1,QUERY:Uf,QUOTE:dx,RIGHTCORNERBRACKET:r1,RIGHTWHITECORNERBRACKET:s1,SCHEME:og,SEMI:fx,SLASH:da,SLASH_SCHEME:Yc,SYM:E1,TILDE:Hf,TLD:Y4,UNDERSCORE:y1,UTLD:W4,UWORD:G4,WORD:eo,WS:K4});const Qa=/[a-z]/,V0=new RegExp("\\p{L}","u"),iE=new RegExp("\\p{Emoji}","u"),Za=/\d/,sE=/\s/,y7="\r",aE=`
`,Eue="️",_ue="‍",oE="￼";let Im=null,Lm=null;function xue(t=[]){const e={};Fi.groups=e;const n=new Fi;Im==null&&(Im=E7(pue)),Lm==null&&(Lm=E7(mue)),Re(n,"'",u1),Re(n,"{",Bf),Re(n,"}",zf),Re(n,"[",Wg),Re(n,"]",Kg),Re(n,"(",Xg),Re(n,")",Qg),Re(n,"<",Zg),Re(n,">",Jg),Re(n,"（",e1),Re(n,"）",t1),Re(n,"「",n1),Re(n,"」",r1),Re(n,"『",i1),Re(n,"』",s1),Re(n,"＜",a1),Re(n,"＞",o1),Re(n,"&",l1),Re(n,"*",c1),Re(n,"@",hl),Re(n,"`",f1),Re(n,"^",h1),Re(n,":",gl),Re(n,",",ux),Re(n,"$",p1),Re(n,".",ca),Re(n,"=",m1),Re(n,"!",cx),Re(n,"-",Ts),Re(n,"%",Ff),Re(n,"|",g1),Re(n,"+",b1),Re(n,"#",v1),Re(n,"?",Uf),Re(n,'"',dx),Re(n,"/",da),Re(n,";",fx),Re(n,"~",Hf),Re(n,"_",y1),Re(n,"\\",d1),Re(n,"・",OD);const r=er(n,Za,ox,{[j4]:!0});er(r,Za,r);const i=er(r,Qa,ND,{[Pf]:!0}),s=er(r,V0,MD,{[uf]:!0}),a=er(n,Qa,eo,{[$4]:!0});er(a,Za,i),er(a,Qa,a),er(i,Za,i),er(i,Qa,i);const l=er(n,V0,G4,{[q4]:!0});er(l,Qa),er(l,Za,s),er(l,V0,l),er(s,Za,s),er(s,Qa),er(s,V0,s);const u=Re(n,aE,lx,{[rE]:!0}),d=Re(n,y7,K4,{[rE]:!0}),h=er(n,sE,K4,{[rE]:!0});Re(n,oE,h),Re(d,aE,u),Re(d,oE,h),er(d,sE,h),Re(h,y7),Re(h,aE),er(h,sE,h),Re(h,oE,h);const p=er(n,iE,RD,{[AD]:!0});Re(p,"#"),er(p,iE,p),Re(p,Eue,p);const g=Re(p,_ue);Re(g,"#"),er(g,iE,p);const b=[[Qa,a],[Za,i]],y=[[Qa,null],[V0,l],[Za,s]];for(let E=0;E<Im.length;E++)nl(n,Im[E],Y4,eo,b);for(let E=0;E<Lm.length;E++)nl(n,Lm[E],W4,G4,y);wu(Y4,{tld:!0,ascii:!0},e),wu(W4,{utld:!0,alpha:!0},e),nl(n,"file",og,eo,b),nl(n,"mailto",og,eo,b),nl(n,"http",Yc,eo,b),nl(n,"https",Yc,eo,b),nl(n,"ftp",Yc,eo,b),nl(n,"ftps",Yc,eo,b),wu(og,{scheme:!0,ascii:!0},e),wu(Yc,{slashscheme:!0,ascii:!0},e),t=t.sort((E,T)=>E[0]>T[0]?1:-1);for(let E=0;E<t.length;E++){const T=t[E][0],A=t[E][1]?{[gue]:!0}:{[bue]:!0};T.indexOf("-")>=0?A[V4]=!0:Qa.test(T)?Za.test(T)?A[Pf]=!0:A[$4]=!0:A[j4]=!0,v7(n,T,T,A)}return v7(n,"localhost",lh,{ascii:!0}),n.jd=new Fi(E1),{start:n,tokens:Object.assign({groups:e},DD)}}function ID(t,e){const n=Tue(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let s=0,a=0;for(;a<r;){let l=t,u=null,d=0,h=null,p=-1,g=-1;for(;a<r&&(u=l.go(n[a]));)l=u,l.accepts()?(p=0,g=0,h=l):p>=0&&(p+=n[a].length,g++),d+=n[a].length,s+=n[a].length,a++;s-=p,a-=g,d-=p,i.push({t:h.t,v:e.slice(s-d,s),s:s-d,e:s})}return i}function Tue(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,a=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(a),r+=a.length}return e}function nl(t,e,n,r,i){let s;const a=e.length;for(let l=0;l<a-1;l++){const u=e[l];t.j[u]?s=t.j[u]:(s=new Fi(r),s.jr=i.slice(),t.j[u]=s),t=s}return s=new Fi(n),s.jr=i.slice(),t.j[e[a-1]]=s,s}function E7(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let a=parseInt(t.substring(r,r+s),10);a>0;a--)n.pop();r+=s}else n.push(t[r]),r++}return e}const uh={defaultProtocol:"http",events:null,format:_7,formatHref:_7,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function hx(t,e=null){let n=Object.assign({},uh);t&&(n=Object.assign(n,t instanceof hx?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}hx.prototype={o:uh,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:uh[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function _7(t){return t}function LD(t,e){this.t="token",this.v=t,this.tk=e}LD.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=uh.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),a={},l=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),h=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return a.href=r,l&&(a.class=l),u&&(a.target=u),d&&(a.rel=d),h&&Object.assign(a,h),{tagName:i,attributes:a,content:s,eventListeners:p}}};function Tb(t,e){class n extends LD{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const x7=Tb("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),T7=Tb("text"),Sue=Tb("nl"),Pm=Tb("url",{isLink:!0,toHref(t=uh.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==lh&&t[1].t===gl}}),xs=t=>new Fi(t);function wue({groups:t}){const e=t.domain.concat([l1,c1,hl,d1,f1,h1,p1,m1,Ts,ox,Ff,g1,b1,v1,da,E1,Hf,y1]),n=[u1,gl,ux,ca,cx,Ff,Uf,dx,fx,Zg,Jg,Bf,zf,Kg,Wg,Xg,Qg,e1,t1,n1,r1,i1,s1,a1,o1],r=[l1,u1,c1,d1,f1,h1,p1,m1,Ts,Bf,zf,Ff,g1,b1,v1,Uf,da,E1,Hf,y1],i=xs(),s=Re(i,Hf);Dt(s,r,s),Dt(s,t.domain,s);const a=xs(),l=xs(),u=xs();Dt(i,t.domain,a),Dt(i,t.scheme,l),Dt(i,t.slashscheme,u),Dt(a,r,s),Dt(a,t.domain,a);const d=Re(a,hl);Re(s,hl,d),Re(l,hl,d),Re(u,hl,d);const h=Re(s,ca);Dt(h,r,s),Dt(h,t.domain,s);const p=xs();Dt(d,t.domain,p),Dt(p,t.domain,p);const g=Re(p,ca);Dt(g,t.domain,p);const b=xs(x7);Dt(g,t.tld,b),Dt(g,t.utld,b),Re(d,lh,b);const y=Re(p,Ts);Re(y,Ts,y),Dt(y,t.domain,p),Dt(b,t.domain,p),Re(b,ca,g),Re(b,Ts,y);const E=Re(b,gl);Dt(E,t.numeric,x7);const T=Re(a,Ts),S=Re(a,ca);Re(T,Ts,T),Dt(T,t.domain,a),Dt(S,r,s),Dt(S,t.domain,a);const A=xs(Pm);Dt(S,t.tld,A),Dt(S,t.utld,A),Dt(A,t.domain,a),Dt(A,r,s),Re(A,ca,S),Re(A,Ts,T),Re(A,hl,d);const R=Re(A,gl),z=xs(Pm);Dt(R,t.numeric,z);const I=xs(Pm),P=xs();Dt(I,e,I),Dt(I,n,P),Dt(P,e,I),Dt(P,n,P),Re(A,da,I),Re(z,da,I);const $=Re(l,gl),K=Re(u,gl),Z=Re(K,da),W=Re(Z,da);Dt(l,t.domain,a),Re(l,ca,S),Re(l,Ts,T),Dt(u,t.domain,a),Re(u,ca,S),Re(u,Ts,T),Dt($,t.domain,I),Re($,da,I),Re($,Uf,I),Dt(W,t.domain,I),Dt(W,e,I),Re(W,da,I);const re=[[Bf,zf],[Wg,Kg],[Xg,Qg],[Zg,Jg],[e1,t1],[n1,r1],[i1,s1],[a1,o1]];for(let ie=0;ie<re.length;ie++){const[ye,ae]=re[ie],de=Re(I,ye);Re(P,ye,de),Re(de,ae,I);const J=xs(Pm);Dt(de,e,J);const ne=xs();Dt(de,n),Dt(J,e,J),Dt(J,n,ne),Dt(ne,e,J),Dt(ne,n,ne),Re(J,ae,I),Re(ne,ae,I)}return Re(i,lh,A),Re(i,lx,Sue),{start:i,tokens:DD}}function kue(t,e,n){let r=n.length,i=0,s=[],a=[];for(;i<r;){let l=t,u=null,d=null,h=0,p=null,g=-1;for(;i<r&&!(u=l.go(n[i].t));)a.push(n[i++]);for(;i<r&&(d=u||l.go(n[i].t));)u=null,l=d,l.accepts()?(g=0,p=l):g>=0&&g++,i++,h++;if(g<0)i-=h,i<r&&(a.push(n[i]),i++);else{a.length>0&&(s.push(lE(T7,e,a)),a=[]),i-=g,h-=g;const b=p.t,y=n.slice(i-h,i);s.push(lE(b,e,y))}}return a.length>0&&s.push(lE(T7,e,a)),s}function lE(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const Cue=typeof console<"u"&&console&&console.warn||(()=>{}),Aue="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",In={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Nue(){return Fi.groups={},In.scanner=null,In.parser=null,In.tokenQueue=[],In.pluginQueue=[],In.customSchemes=[],In.initialized=!1,In}function S7(t,e=!1){if(In.initialized&&Cue(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Aue}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);In.customSchemes.push([t,e])}function Mue(){In.scanner=xue(In.customSchemes);for(let t=0;t<In.tokenQueue.length;t++)In.tokenQueue[t][1]({scanner:In.scanner});In.parser=wue(In.scanner.tokens);for(let t=0;t<In.pluginQueue.length;t++)In.pluginQueue[t][1]({scanner:In.scanner,parser:In.parser});return In.initialized=!0,In}function px(t){return In.initialized||Mue(),kue(In.parser.start,t,ID(In.scanner.start,t))}px.scan=ID;function PD(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new hx(n),i=px(t),s=[];for(let a=0;a<i.length;a++){const l=i[a];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}var mx="[\0-   ᠎ -\u2029 　]",Oue=new RegExp(mx),Rue=new RegExp(`${mx}$`),Due=new RegExp(mx,"g");function Iue(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function Lue(t){return new Xn({key:new Dr("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(d=>d.docChanged)&&!n.doc.eq(r.doc),s=e.some(d=>d.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=r,l=eD(n.doc,[...e]);if(oD(l).forEach(({newRange:d})=>{const h=Iae(r.doc,d,b=>b.isTextblock);let p,g;if(h.length>1)p=h[0],g=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ");else if(h.length){const b=r.doc.textBetween(d.from,d.to," "," ");if(!Rue.test(b))return;p=h[0],g=r.doc.textBetween(p.pos,d.to,void 0," ")}if(p&&g){const b=g.split(Oue).filter(Boolean);if(b.length<=0)return!1;const y=b[b.length-1],E=p.pos+g.lastIndexOf(y);if(!y)return!1;const T=px(y).map(S=>S.toObject(t.defaultProtocol));if(!Iue(T))return!1;T.filter(S=>S.isLink).map(S=>({...S,from:E+S.start+1,to:E+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>t.validate(S.value)).filter(S=>t.shouldAutoLink(S.value)).forEach(S=>{nx(S.from,S.to,r.doc).some(A=>A.mark.type===t.type)||a.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!a.steps.length)return a}})}function Pue(t){return new Xn({key:new Dr("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let a=null;if(r.target instanceof HTMLAnchorElement)a=r.target;else{const u=r.target;if(!u)return!1;const d=t.editor.view.dom;a=u.closest("a"),a&&!d.contains(a)&&(a=null)}if(!a)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const u=aD(e.state,t.type.name),d=(i=a.href)!=null?i:u.href,h=(s=a.target)!=null?s:u.target;d&&(window.open(d,h),l=!0)}return l}}})}function Bue(t){return new Xn({key:new Dr("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:a}=s,{empty:l}=a;if(l)return!1;let u="";r.content.forEach(h=>{u+=h.textContent});const d=PD(u,{defaultProtocol:t.defaultProtocol}).find(h=>h.isLink&&h.value===u);return!u||!d||i!==void 0&&!i(d.value)?!1:t.editor.commands.setMark(t.type,{href:d.href})}}})}function mu(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(Due,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var zue=Zu.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){S7(t);return}S7(t.scheme,t.optionalSlashes)})},onDestroy(){Nue()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!mu(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const i=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!mu(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!mu(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Tr(this.options.HTMLAttributes,t),0]:["a",Tr(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n;const r=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${r})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!mu(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!mu(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Uu({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=PD(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!mu(a,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&e.push({text:s.value,data:{href:s.href},index:s.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(Lue({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!mu(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(Pue({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(Bue({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),Fue=Object.defineProperty,Uue=(t,e)=>{for(var n in e)Fue(t,n,{get:e[n],enumerable:!0})},Hue="listItem",w7="textStyle",k7=/^\s*([-+*])\s$/,BD=ds.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:t}){return["ul",Tr(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Hue,this.editor.getAttributes(w7)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=gd({find:k7,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=gd({find:k7,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(w7),editor:this.editor})),[t]}}),zD=ds.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Tr(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(i=>i.type==="paragraph"))n=e.parseChildren(t.tokens);else{const i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){const a=t.tokens.slice(1),l=e.parseChildren(a);n.push(...l)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>ax(t,e,r=>{var i,s;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((s=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:s.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),jue={};Uue(jue,{findListItemPos:()=>zh,getNextListDepth:()=>gx,handleBackspace:()=>X4,handleDelete:()=>Q4,hasListBefore:()=>FD,hasListItemAfter:()=>$ue,hasListItemBefore:()=>UD,listItemHasSubList:()=>HD,nextListIsDeeper:()=>jD,nextListIsHigher:()=>$D});var zh=(t,e)=>{const{$from:n}=e.selection,r=xr(t,e.schema);let i=null,s=n.depth,a=n.pos,l=null;for(;s>0&&l===null;)i=n.node(s),i.type===r?l=s:(s-=1,a-=1);return l===null?null:{$pos:e.doc.resolve(a),depth:l}},gx=(t,e)=>{const n=zh(t,e);if(!n)return!1;const[,r]=qae(e,t,n.$pos.pos+4);return r},FD=(t,e,n)=>{const{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),s=t.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},UD=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==t)},HD=(t,e,n)=>{if(!n)return!1;const r=xr(t,e.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},X4=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Ll(t.state,e)&&FD(t.state,e,n)){const{$anchor:l}=t.state.selection,u=t.state.doc.resolve(l.before()-1),d=[];u.node().descendants((g,b)=>{g.type.name===e&&d.push({node:g,pos:b})});const h=d.at(-1);if(!h)return!1;const p=t.state.doc.resolve(u.start()+h.pos+1);return t.chain().cut({from:l.start()-1,to:l.end()+1},p.end()).joinForward().run()}if(!Ll(t.state,e)||!Wae(t.state))return!1;const r=zh(e,t.state);if(!r)return!1;const s=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=HD(e,t.state,s);return UD(e,t.state)&&!a?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},jD=(t,e)=>{const n=gx(t,e),r=zh(t,e);return!r||!n?!1:n>r.depth},$D=(t,e)=>{const n=gx(t,e),r=zh(t,e);return!r||!n?!1:n<r.depth},Q4=(t,e)=>{if(!Ll(t.state,e)||!Yae(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:jD(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():$D(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},$ue=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==t)},qD=nr.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Q4(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Q4(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&X4(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&X4(t,n,r)&&(e=!0)}),e}}}}),C7=/^(\s*)(\d+)\.\s+(.*)$/,que=/^\s/;function Vue(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n],s=i.match(C7);if(!s)break;const[,a,l,u]=s,d=a.length;let h=u,p=n+1;const g=[i];for(;p<t.length;){const b=t[p];if(b.match(C7))break;if(b.trim()==="")g.push(b),h+=`
`,p+=1;else if(b.match(que))g.push(b),h+=`
${b.slice(d+2)}`,p+=1;else break}e.push({indent:d,number:parseInt(l,10),content:h.trim(),raw:g.join(`
`)}),r=p,n=p}return[e,r]}function VD(t,e,n){var r;const i=[];let s=0;for(;s<t.length;){const a=t[s];if(a.indent===e){const l=a.content.split(`
`),u=((r=l[0])==null?void 0:r.trim())||"",d=[];u&&d.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});const h=l.slice(1).join(`
`).trim();if(h){const b=n.blockTokens(h);d.push(...b)}let p=s+1;const g=[];for(;p<t.length&&t[p].indent>e;)g.push(t[p]),p+=1;if(g.length>0){const b=Math.min(...g.map(E=>E.indent)),y=VD(g,b,n);d.push({type:"list",ordered:!0,start:g[0].number,items:y,raw:g.map(E=>E.raw).join(`
`)})}i.push({type:"list_item",raw:a.raw,tokens:d}),s=p}else s+=1}return i}function Gue(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var Yue="listItem",A7="textStyle",N7=/^(\d+)\.\s$/,GD=ds.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Tr(this.options.HTMLAttributes,n),0]:["ol",Tr(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?Gue(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const i=t.split(`
`),[s,a]=Vue(i);if(s.length===0)return;const l=VD(s,0,n);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=s[0])==null?void 0:r.number)||1,items:l,raw:i.slice(0,a).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Yue,this.editor.getAttributes(A7)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=gd({find:N7,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=gd({find:N7,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(A7)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),Wue=/^\s*(\[([( |x])?\])\s$/,Kue=ds.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Tr(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const i=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return ax(t,e,i)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input"),u=document.createElement("div"),d=p=>{var g,b;l.ariaLabel=((b=(g=this.options.a11y)==null?void 0:g.checkboxLabel)==null?void 0:b.call(g,p,l.checked))||`Task item checkbox for ${p.textContent||"empty task item"}`};d(t),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",p=>p.preventDefault()),l.addEventListener("change",p=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:g}=p.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:b})=>{const y=n();if(typeof y!="number")return!1;const E=b.doc.nodeAt(y);return b.setNodeMarkup(y,void 0,{...E==null?void 0:E.attrs,checked:g}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,g)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([p,g])=>{i.setAttribute(p,g)}),i.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,a),i.append(s,u),Object.entries(e).forEach(([p,g])=>{i.setAttribute(p,g)});let h=new Set(Object.keys(e));return{dom:i,contentDOM:u,update:p=>{if(p.type!==this.type)return!1;i.dataset.checked=p.attrs.checked,l.checked=p.attrs.checked,d(p);const g=r.extensionManager.attributes,b=oh(p,g),y=new Set(Object.keys(b)),E=this.options.HTMLAttributes;return h.forEach(T=>{y.has(T)||(T in E?i.setAttribute(T,E[T]):i.removeAttribute(T))}),Object.entries(b).forEach(([T,S])=>{S==null?T in E?i.setAttribute(T,E[T]):i.removeAttribute(T):i.setAttribute(T,S)}),h=y,!0}}}},addInputRules(){return[gd({find:Wue,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Xue=ds.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Tr(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=s=>{const a=U4(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,u)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:u}),customNestedParser:r},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(s)},i=U4(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,a)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});nr.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(BD.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(zD.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(qD.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(GD.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Kue.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(Xue.configure(this.options.taskList)),t}});var M7="&nbsp;",Que=" ",Zue=ds.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Tr(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===M7||r[0].text===Que)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e)=>{if(!t)return"";const n=Array.isArray(t.content)?t.content:[];return n.length===0?M7:e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Jue=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ece=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,tce=Zu.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Tr(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[md({find:Jue,type:this.type})]},addPasteRules(){return[Uu({find:ece,type:this.type})]}}),nce=ds.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),rce=Zu.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Tr(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function ice(t={}){return new Xn({view(e){return new sce(e,t)}})}class sce{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.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),n=!e.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),a=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(n){let p=e.nodeBefore,g=e.nodeAfter;if(p||g){let b=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(b){let y=b.getBoundingClientRect(),E=p?y.bottom:y.top;p&&g&&(E=(E+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let T=this.width/2*l;r={left:y.left,right:y.right,top:E-T,bottom:E+T}}}}if(!r){let p=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*a;r={left:p.left-g,right:p.left+g,top:p.top,bottom:p.bottom}}let u=this.editorView.dom.offsetParent;this.element||(this.element=u.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let d,h;if(!u||u==document.body&&getComputedStyle(u).position=="static")d=-pageXOffset,h=-pageYOffset;else{let p=u.getBoundingClientRect(),g=p.width/u.offsetWidth,b=p.height/u.offsetHeight;d=p.left-u.scrollLeft*g,h=p.top-u.scrollTop*b}this.element.style.left=(r.left-d)/a+"px",this.element.style.top=(r.top-h)/l+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=VO(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class tr extends It{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return tr.valid(r)?new tr(r):It.near(r)}content(){return We.empty}eq(e){return e instanceof tr&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new tr(e.resolve(n.pos))}getBookmark(){return new bx(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!ace(e)||!oce(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&tr.valid(e))return e;let i=e.pos,s=null;for(let a=e.depth;;a--){let l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){s=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let u=e.doc.resolve(i);if(tr.valid(u))return u}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!dt.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=a,i+=n;let l=e.doc.resolve(i);if(tr.valid(l))return l}return null}}}tr.prototype.visible=!1;tr.findFrom=tr.findGapCursorFrom;It.jsonID("gapcursor",tr);class bx{constructor(e){this.pos=e}map(e){return new bx(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return tr.valid(n)?new tr(n):It.near(n)}}function YD(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function ace(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||YD(i.type))return!0;if(i.inlineContent)return!1}}return!0}function oce(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||YD(i.type))return!0;if(i.inlineContent)return!1}}return!0}function lce(){return new Xn({props:{decorations:fce,createSelectionBetween(t,e,n){return e.pos==n.pos&&tr.valid(n)?new tr(n):null},handleClick:cce,handleKeyDown:uce,handleDOMEvents:{beforeinput:dce}}})}const uce=GR({ArrowLeft:Bm("horiz",-1),ArrowRight:Bm("horiz",1),ArrowUp:Bm("vert",-1),ArrowDown:Bm("vert",1)});function Bm(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let a=r.selection,l=e>0?a.$to:a.$from,u=a.empty;if(a instanceof Tt){if(!s.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=tr.findGapCursorFrom(l,e,u);return d?(i&&i(r.tr.setSelection(new tr(d))),!0):!1}}function cce(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!tr.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&dt.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new tr(r))),!0)}function dce(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof tr))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=Ae.empty;for(let a=r.length-1;a>=0;a--)i=Ae.from(r[a].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new We(i,0,0));return s.setSelection(Tt.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function fce(t){if(!(t.selection instanceof tr))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Yn.create(t.doc,[Si.widget(t.selection.head,e,{key:"gapcursor"})])}var _1=200,qr=function(){};qr.prototype.append=function(e){return e.length?(e=qr.from(e),!this.length&&e||e.length<_1&&this.leafAppend(e)||this.length<_1&&e.leafPrepend(this)||this.appendInner(e)):this};qr.prototype.prepend=function(e){return e.length?qr.from(e).append(this):this};qr.prototype.appendInner=function(e){return new hce(this,e)};qr.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?qr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};qr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};qr.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};qr.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},n,r),i};qr.from=function(e){return e instanceof qr?e:e&&e.length?new WD(e):qr.empty};var WD=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={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,a,l){for(var u=s;u<a;u++)if(i(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,l){for(var u=s-1;u>=a;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=_1)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=_1)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qr);qr.empty=new WD([]);var hce=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,a){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(s,l),a)===!1||s>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,s)-l,a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,a){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(s,l)-l,a+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(i,l),s,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(qr);const pce=500;class Ys{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=e.tr,l,u,d=[],h=[];return this.items.forEach((p,g)=>{if(!p.step){i||(i=this.remapping(r,g+1),s=i.maps.length),s--,h.push(p);return}if(i){h.push(new fa(p.map));let b=p.step.map(i.slice(s)),y;b&&a.maybeStep(b).doc&&(y=a.mapping.maps[a.mapping.maps.length-1],d.push(new fa(y,void 0,void 0,d.length+h.length))),s--,y&&i.appendMap(y,s)}else a.maybeStep(p.step);if(p.selection)return l=i?p.selection.map(i.slice(s)):p.selection,u=new Ys(this.items.slice(0,r).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:l}}addTransform(e,n,r,i){let s=[],a=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let h=0;h<e.steps.length;h++){let p=e.steps[h].invert(e.docs[h]),g=new fa(e.mapping.maps[h],p,n),b;(b=u&&u.merge(g))&&(g=b,h?s.pop():l=l.slice(0,l.length-1)),s.push(g),n&&(a++,n=void 0),i||(u=g)}let d=a-r.depth;return d>gce&&(l=mce(l,d),a-=d),new Ys(l.append(s),a)}remapping(e,n){let r=new th;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ys(this.items.append(e.map(n=>new fa(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(g=>{g.selection&&l--},i);let u=n;this.items.forEach(g=>{let b=s.getMirror(--u);if(b==null)return;a=Math.min(a,b);let y=s.maps[b];if(g.step){let E=e.steps[b].invert(e.docs[b]),T=g.selection&&g.selection.map(s.slice(u+1,b));T&&l++,r.push(new fa(y,E,T))}else r.push(new fa(y))},i);let d=[];for(let g=n;g<a;g++)d.push(new fa(s.maps[g]));let h=this.items.slice(0,i).append(d).append(r),p=new Ys(h,l);return p.emptyItemCount()>pce&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)i.push(a),a.selection&&s++;else if(a.step){let u=a.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let h=a.selection&&a.selection.map(n.slice(r));h&&s++;let p=new fa(d.invert(),u,h),g,b=i.length-1;(g=i.length&&i[b].merge(p))?i[b]=g:i.push(p)}}else a.map&&r--},this.items.length,0),new Ys(qr.from(i.reverse()),s)}}Ys.empty=new Ys(qr.empty,0);function mce(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class fa{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new fa(n.getMap().invert(),n,this.selection)}}}class pl{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const gce=20;function bce(t,e,n,r){let i=n.getMeta(Du),s;if(i)return i.historyState;n.getMeta(Ece)&&(t=new pl(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(Du))return a.getMeta(Du).redo?new pl(t.done.addTransform(n,void 0,r,lg(e)),t.undone,O7(n.mapping.maps),t.prevTime,t.prevComposition):new pl(t.done,t.undone.addTransform(n,void 0,r,lg(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!a&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!vce(n,t.prevRanges)),d=a?uE(t.prevRanges,n.mapping):O7(n.mapping.maps);return new pl(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,lg(e)),Ys.empty,d,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new pl(t.done.rebased(n,s),t.undone.rebased(n,s),uE(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new pl(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),uE(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function vce(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function O7(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,a)=>e.push(s,a));return e}function uE(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function yce(t,e,n){let r=lg(e),i=Du.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),u=new pl(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(a).setMeta(Du,{redo:n,historyState:u})}let cE=!1,R7=null;function lg(t){let e=t.plugins;if(R7!=e){cE=!1,R7=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){cE=!0;break}}return cE}const Du=new Dr("history"),Ece=new Dr("closeHistory");function _ce(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Xn({key:Du,state:{init(){return new pl(Ys.empty,Ys.empty,null,0,-1)},apply(e,n,r){return bce(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?XD:r=="historyRedo"?QD:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function KD(t,e){return(n,r)=>{let i=Du.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=yce(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const XD=KD(!1,!0),QD=KD(!0,!0);nr.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Xn({key:new Dr("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const a=s-i,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,u);return t=!0,d}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,u=s-r,d=l-u,h=l;return e.deleteRange(d,h),!(this.storage.characters({node:e.doc})>r)}})]}});var xce=nr.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[ice(this.options)]}});nr.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Xn({key:new Dr("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return Yn.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((u,d)=>{if(u.isText)return;if(!(i>=d&&i<=d+u.nodeSize-1))return!1;a+=1});let l=0;return t.descendants((u,d)=>{if(u.isText||!(i>=d&&i<=d+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(Si.node(d,d+u.nodeSize,{class:this.options.className}))}),Yn.create(t,s)}}})]}});var Tce=nr.create({name:"gapCursor",addProseMirrorPlugins(){return[lce()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=cn(lt(t,"allowGapCursor",n)))!=null?e:null}}}),Sce=nr.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Xn({key:new Dr("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((a,l)=>{const u=r>=l&&r<=l+a.nodeSize,d=!a.isLeaf&&_b(a);if((u||!this.options.showOnlyCurrent)&&d){const h=[this.options.emptyNodeClass];s&&h.push(this.options.emptyEditorClass);const p=Si.node(l,l+a.nodeSize,{class:h.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),Yn.create(t,i)}}})]}});nr.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Xn({key:new Dr("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||lD(n.selection)||t.view.dragging?null:Yn.create(n.doc,[Si.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function D7({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var wce=nr.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Dr(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new Xn({key:e,appendTransaction:(i,s,a)=>{const{doc:l,tr:u,schema:d}=a,h=e.getState(a),p=l.content.size,g=d.nodes[n];if(h)return u.insert(p,g.create())},state:{init:(i,s)=>{const a=s.tr.doc.lastChild;return!D7({node:a,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const a=i.doc.lastChild;return!D7({node:a,types:r})}}})]}}),kce=nr.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>XD(t,e),redo:()=>({state:t,dispatch:e})=>QD(t,e)}},addProseMirrorPlugins(){return[_ce(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()}}}),Cce=nr.create({name:"starterKit",addExtensions(){var t,e,n,r;const i=[];return this.options.bold!==!1&&i.push(Zle.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(Yle.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(BD.configure(this.options.bulletList)),this.options.code!==!1&&i.push(tue.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(iue.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(sue.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(xce.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Tce.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(aue.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(oue.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(kce.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(lue.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(hue.configure(this.options.italic)),this.options.listItem!==!1&&i.push(zD.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(qD.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(zue.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(GD.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(Zue.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(tce.configure(this.options.strike)),this.options.text!==!1&&i.push(nce.configure(this.options.text)),this.options.underline!==!1&&i.push(rce.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(wce.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),Ace=Cce,Nce=Sce,Mce=t=>rr({find:/--$/,replace:t??"—"}),Oce=t=>rr({find:/\.\.\.$/,replace:t??"…"}),Rce=t=>rr({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:t??"“"}),Dce=t=>rr({find:/"$/,replace:t??"”"}),Ice=t=>rr({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:t??"‘"}),Lce=t=>rr({find:/'$/,replace:t??"’"}),Pce=t=>rr({find:/<-$/,replace:t??"←"}),Bce=t=>rr({find:/->$/,replace:t??"→"}),zce=t=>rr({find:/\(c\)$/,replace:t??"©"}),Fce=t=>rr({find:/\(tm\)$/,replace:t??"™"}),Uce=t=>rr({find:/\(sm\)$/,replace:t??"℠"}),Hce=t=>rr({find:/\(r\)$/,replace:t??"®"}),jce=t=>rr({find:/(?:^|\s)(1\/2)\s$/,replace:t??"½"}),$ce=t=>rr({find:/\+\/-$/,replace:t??"±"}),qce=t=>rr({find:/!=$/,replace:t??"≠"}),Vce=t=>rr({find:/<<$/,replace:t??"«"}),Gce=t=>rr({find:/>>$/,replace:t??"»"}),Yce=t=>rr({find:/\d+\s?([*x])\s?\d+$/,replace:t??"×"}),Wce=t=>rr({find:/\^2$/,replace:t??"²"}),Kce=t=>rr({find:/\^3$/,replace:t??"³"}),Xce=t=>rr({find:/(?:^|\s)(1\/4)\s$/,replace:t??"¼"}),Qce=t=>rr({find:/(?:^|\s)(3\/4)\s$/,replace:t??"¾"}),Zce=nr.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){const t=[];return this.options.emDash!==!1&&t.push(Mce(this.options.emDash)),this.options.ellipsis!==!1&&t.push(Oce(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&t.push(Rce(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&t.push(Dce(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&t.push(Ice(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&t.push(Lce(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&t.push(Pce(this.options.leftArrow)),this.options.rightArrow!==!1&&t.push(Bce(this.options.rightArrow)),this.options.copyright!==!1&&t.push(zce(this.options.copyright)),this.options.trademark!==!1&&t.push(Fce(this.options.trademark)),this.options.servicemark!==!1&&t.push(Uce(this.options.servicemark)),this.options.registeredTrademark!==!1&&t.push(Hce(this.options.registeredTrademark)),this.options.oneHalf!==!1&&t.push(jce(this.options.oneHalf)),this.options.plusMinus!==!1&&t.push($ce(this.options.plusMinus)),this.options.notEqual!==!1&&t.push(qce(this.options.notEqual)),this.options.laquo!==!1&&t.push(Vce(this.options.laquo)),this.options.raquo!==!1&&t.push(Gce(this.options.raquo)),this.options.multiplication!==!1&&t.push(Yce(this.options.multiplication)),this.options.superscriptTwo!==!1&&t.push(Wce(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&t.push(Kce(this.options.superscriptThree)),this.options.oneQuarter!==!1&&t.push(Xce(this.options.oneQuarter)),this.options.threeQuarters!==!1&&t.push(Qce(this.options.threeQuarters)),t}}),Jce=Zce;function I7(t){if(!t)return"";let e=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/___(.+?)___/g,"<strong><em>$1</em></strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/_(.+?)_/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener">$1</a>').replace(/^---$/gm,"<hr>").replace(/^\*\*\*$/gm,"<hr>").replace(/^[\-\*] (.+)$/gm,"<li>$1</li>").replace(/^\d+\. (.+)$/gm,"<li>$1</li>").replace(/^> (.+)$/gm,"<blockquote>$1</blockquote>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return!e.startsWith("<h")&&!e.startsWith("<ul")&&!e.startsWith("<ol")&&!e.startsWith("<blockquote")&&(e="<p>"+e+"</p>"),e=e.replace(/<p><\/p>/g,""),e=e.replace(/(<li>[\s\S]*?<\/li>)+/g,n=>`<ul>${n}</ul>`),e}function ede(t){if(!t)return!1;const e=t.replace(/\s/g,"").slice(0,100);return/[\u0600-\u06FF\u0590-\u05FF]/.test(e)}const tde=()=>{const{state:t}=Dd(),e=U.useRef(t.content),n=U.useMemo(()=>ede(t.content),[t.content]),r=jle({extensions:[Ace.configure({heading:{levels:[1,2,3]}}),Nce.configure({placeholder:"Document content will appear here..."}),Jce],content:I7(t.content),editable:!t.isStreaming,editorProps:{attributes:{class:"prose prose-sm max-w-none focus:outline-none min-h-full",dir:n?"rtl":"ltr"}},onUpdate:()=>{}});return U.useEffect(()=>{var i;if(!(!r||r.isDestroyed)&&t.isStreaming&&t.content!==e.current)try{const s=I7(t.content);r.commands.setContent(s),e.current=t.content;const a=(i=r.view)==null?void 0:i.dom;a&&(a.scrollTop=a.scrollHeight)}catch(s){console.error("Error updating editor content:",s)}},[r,t.content,t.isStreaming]),U.useEffect(()=>{if(!(!r||r.isDestroyed))try{r.setEditable(!t.isStreaming)}catch(i){console.error("Error setting editable state:",i)}},[r,t.isStreaming]),U.useEffect(()=>{var i;if(!(!r||r.isDestroyed))try{const s=(i=r.view)==null?void 0:i.dom;s&&s.setAttribute("dir",n?"rtl":"ltr")}catch(s){console.error("Error setting RTL direction:",s)}},[r,n]),r?C.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin canvas-editor",style:{backgroundColor:"var(--bg-primary)"},children:C.jsxs("div",{className:"p-6 max-w-3xl mx-auto",children:[C.jsx(Lle,{editor:r,className:"min-h-[calc(100vh-120px)]"}),t.isStreaming&&C.jsx("span",{className:"inline-block w-0.5 h-5 ml-0.5 animate-pulse",style:{backgroundColor:"var(--text-primary)"},"aria-hidden":"true"})]})}):C.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin canvas-editor",style:{backgroundColor:"var(--bg-primary)"},children:C.jsx("div",{className:"p-6 max-w-3xl mx-auto",children:C.jsx("div",{className:"min-h-[calc(100vh-120px)] flex items-center justify-center",children:C.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Loading..."})})})})},nde=()=>{const{state:t,closeCanvas:e}=Dd(),{canvasWidthPercent:n,isMobile:r}=gO(t.isOpen),i=U.useRef(null),s=U.useRef(null);return U.useEffect(()=>{const a=l=>{l.key==="Escape"&&t.isOpen&&e()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t.isOpen,e]),U.useEffect(()=>{t.isOpen&&s.current&&setTimeout(()=>{var a;(a=s.current)==null||a.focus()},100)},[t.isOpen]),t.isOpen?C.jsxs(C.Fragment,{children:[r&&C.jsx("div",{className:"fixed inset-0 z-40 transition-opacity duration-300 ease-in-out",style:{backgroundColor:"var(--bg-overlay)"},onClick:e,"aria-hidden":"true"}),C.jsxs("aside",{ref:i,role:r?"dialog":"complementary","aria-label":"Document Canvas","aria-modal":r?"true":void 0,className:`
          fixed top-0 right-0 h-full z-50
          flex flex-col
          canvas-panel
          ${t.isOpen?"canvas-panel-open":""}
        `,style:{width:r?"100%":`${n}%`,backgroundColor:"var(--bg-primary)",borderLeft:r?"none":"1px solid var(--border-primary)",boxShadow:"var(--shadow-lg)"},children:[C.jsx(Pne,{closeButtonRef:s}),C.jsx(tde,{})]})]}):null};async function rde(t,e,{signal:n}={}){const r=t.body.getReader(),i=new TextDecoder;let s="";for(;;){if(n!=null&&n.aborted)throw new DOMException("Aborted","AbortError");const{value:a,done:l}=await r.read();if(l)break;if(a){const u=i.decode(a,{stream:!0});s+=u;let d;for(;(d=s.indexOf(`
`))!==-1;){const h=s.slice(0,d).trim();if(s=s.slice(d+1),!h||!h.startsWith("data: "))continue;const p=h.slice(6);if(p==="[DONE]")return;try{const g=JSON.parse(p);e(g)}catch(g){console.error("Failed to parse SSE payload:",g,p)}}}}}async function ide(t){const e=await fetch("/config",{method:"GET",credentials:"include",signal:t});if(!e.ok)throw new Error("Metadata request failed: "+e.status);return e.json()}async function Z4({messages:t,auth:e,getToken:n,setActive:r,org:i,onPart:s,signal:a}){const l=t.map(({role:h,content:p,parts:g})=>{if(h){if(g)return{role:h,parts:g};const{clean:S,attachments:A}=Zf(p);if(A.length===0)return{role:h,content:S};const R=[];S.trim()&&R.push({type:"text",text:S});for(const z of A)z.mime&&z.mime.startsWith("image/")?R.push({type:"image_url",image_url:{url:z.url}}):R.push({type:"file",text:"[File attached: "+z.name+`]
File URL: `+z.url+`
File type: `+(z.mime||"unknown")});return{role:h,content:R}}const b=h||(t.type==="request"?"user":"assistant"),{clean:y,attachments:E}=Zf(p);if(E.length===0)return{role:b,content:y};const T=[];y.trim()&&T.push({type:"text",text:y});for(const S of E)S.mime&&S.mime.startsWith("image/")?T.push({type:"image_url",image_url:{url:S.url}}):T.push({type:"file",text:"[File attached: "+S.name+`]
File URL: `+S.url+`
File type: `+(S.mime||"unknown")});return{role:b,content:T}}),u={"Content-Type":"application/json"};if(e&&n)try{const h=await n({template:"template"});if(h&&(u.Authorization="Bearer "+h),r&&i)try{await r({organization:i})}catch{}}catch{}const d=await fetch("/chat/cycls",{method:"POST",headers:u,body:JSON.stringify({messages:l}),signal:a});if(!d.ok){let h="server",p="Server returned "+d.status;if(d.status===429){h="rate_limit";const g=d.headers.get("Retry-After");p=g?"Too many requests. Please try again in "+g+" seconds.":"Too many requests. Please wait a moment and try again."}else d.status>=500?p="Server error. Please try again later.":(d.status===401||d.status===403)&&(p="Authentication error. Please refresh and try again.");throw{type:h,status:d.status,message:p}}await rde(d,s,{signal:a})}const dE="cycls_chat_history",zm="cycls_active_chat",vx="cycls_message_count";function ZD(){try{const t=localStorage.getItem(vx);return t?parseInt(t,10):0}catch{return 0}}function sde(){try{const t=ZD();return localStorage.setItem(vx,String(t+1)),t+1}catch{return 0}}function ade(){try{localStorage.removeItem(vx)}catch{}}class Mr{static getAllChats(){try{const e=localStorage.getItem(dE);return e?JSON.parse(e):[]}catch(e){return console.error("Error loading chat history:",e),[]}}static saveAllChats(e){try{localStorage.setItem(dE,JSON.stringify(e))}catch(n){console.error("Error saving chat history:",n)}}static getActiveChat(){try{return localStorage.getItem(zm)}catch{return null}}static setActiveChat(e){try{localStorage.setItem(zm,e)}catch(n){console.error("Error saving active chat:",n)}}static createChat(e=[]){const n=this.getAllChats(),r={id:Date.now().toString(),title:this.generateTitle(e),messages:e,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};return n.length>=lo.MAX_CHATS&&(n.sort((i,s)=>new Date(i.createdAt)-new Date(s.createdAt)),n.shift()),n.push(r),this.saveAllChats(n),this.setActiveChat(r.id),r}static updateChat(e,n){const r=this.getAllChats(),i=r.findIndex(s=>s.id===e);i!==-1&&(r[i].messages=n,r[i].updatedAt=new Date().toISOString(),r[i].title=this.generateTitle(n),this.saveAllChats(r))}static deleteChat(e){const r=this.getAllChats().filter(i=>i.id!==e);this.saveAllChats(r),this.getActiveChat()===e&&localStorage.removeItem(zm)}static getChat(e){return this.getAllChats().find(r=>r.id===e)}static generateTitle(e){if(!e||e.length===0)return"New Chat";const n=e.find(s=>s.type==="request"||s.role==="user");if(!n)return"New Chat";const{clean:r}=Zf(n.content);return r.trim().slice(0,50)||"New Chat"}static clearAll(){try{localStorage.removeItem(dE),localStorage.removeItem(zm)}catch(e){console.error("Error clearing chat history:",e)}}}var be=typeof window<"u"?window:void 0,ei=typeof globalThis<"u"?globalThis:be;typeof self>"u"&&(ei.self=ei),typeof File>"u"&&(ei.File=function(){});var JD=Array.prototype,L7=JD.forEach,P7=JD.indexOf,as=ei==null?void 0:ei.navigator,Ve=ei==null?void 0:ei.document,Ui=ei==null?void 0:ei.location,J4=ei==null?void 0:ei.fetch,e3=ei!=null&&ei.XMLHttpRequest&&"withCredentials"in new ei.XMLHttpRequest?ei.XMLHttpRequest:void 0,B7=ei==null?void 0:ei.AbortController,Bi=as==null?void 0:as.userAgent,vt=be??{},no={DEBUG:!1,LIB_VERSION:"1.306.2"};function z7(t,e,n,r,i,s,a){try{var l=t[s](a),u=l.value}catch(d){return void n(d)}l.done?e(u):Promise.resolve(u).then(r,i)}function F7(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function a(u){z7(s,r,i,a,l,"next",u)}function l(u){z7(s,r,i,a,l,"throw",u)}a(void 0)})}}function Ze(){return Ze=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ze.apply(null,arguments)}function eI(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var ode=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],U7=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return ode.concat(e).some(r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1})},lde=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function jt(t,e){return t.indexOf(e)!==-1}var Sb=function(t){return t.trim()},t3=function(t){return t.replace(/^\$/,"")},ude=Array.isArray,tI=Object.prototype,nI=tI.hasOwnProperty,wb=tI.toString,an=ude||function(t){return wb.call(t)==="[object Array]"},Cl=t=>typeof t=="function",Ur=t=>t===Object(t)&&!an(t),Qc=t=>{if(Ur(t)){for(var e in t)if(nI.call(t,e))return!1;return!0}return!1},qe=t=>t===void 0,Or=t=>wb.call(t)=="[object String]",n3=t=>Or(t)&&t.trim().length===0,ko=t=>t===null,sn=t=>qe(t)||ko(t),Ta=t=>wb.call(t)=="[object Number]",Al=t=>wb.call(t)==="[object Boolean]",cde=t=>t instanceof FormData,dde=t=>jt(lde,t);function r3(t){return t===null||typeof t!="object"}function x1(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function rI(t){return!qe(Event)&&function(e,n){try{return e instanceof n}catch{return!1}}(t,Event)}var fde=[!0,"true",1,"1","yes"],fE=t=>jt(fde,t),hde=[!1,"false",0,"0","no"];function va(t,e,n,r,i){return e>n&&(r.warn("min cannot be greater than max."),e=n),Ta(t)?t>n?(r.warn(" cannot be  greater than max: "+n+". Using max value instead."),n):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),va(i||n,e,n,r))}class pde{constructor(e){this.t={},this.i=e.i,this.o=va(e.bucketSize,0,100,e.h),this.m=va(e.refillRate,0,this.o,e.h),this.S=va(e.refillInterval,0,864e5,e.h)}$(e,n){var r=n-e.lastAccess,i=Math.floor(r/this.S);if(i>0){var s=i*this.m;e.tokens=Math.min(e.tokens+s,this.o),e.lastAccess=e.lastAccess+i*this.S}}consumeRateLimit(e){var n,r=Date.now(),i=String(e),s=this.t[i];return s?this.$(s,r):(s={tokens:this.o,lastAccess:r},this.t[i]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.i)==null||n.call(this,e)),s.tokens===0)}stop(){this.t={}}}var Fm,H7,hE,mde=t=>t instanceof Error;function gde(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return hE&&n.length===H7||(H7=n.length,hE=n.reduce((r,i)=>{Fm||(Fm={});var s=Fm[i];if(s)r[s[0]]=s[1];else for(var a=t(i),l=a.length-1;l>=0;l--){var u=a[l],d=u==null?void 0:u.filename,h=e[i];if(d&&h){r[d]=h,Fm[i]=[d,h];break}}return r},{})),hE}}class bde{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(e),s=this.buildParsingContext(),a=this.parseStacktrace(i,s);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var n=this;return F7(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&an(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e})()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,i;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),Ze({},e,{cause:r,stack:i})}applyChunkIds(e,n){return e.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return F7(function*(){var r=e;for(var i of n.modifiers)r=yield i(r);return r})()}convertToExceptionList(e,n){var r,i,s,a={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(s=e.synthetic)!==null&&s!==void 0&&s}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var l=[a];return e.cause!=null&&l.push(...this.convertToExceptionList(e.cause,Ze({},n,{handled:!0}))),l}buildParsingContext(){return{chunkIdMap:gde(this.stackParser)}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var i=(s,a)=>{if(a<=4){var l=this.buildCoercingContext(e,n,a);return this.applyCoercers(s,l)}};return Ze({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:s=>i(s,r),next:s=>i(s,r+1)})}}var bd="?";function i3(t,e,n,r,i){var s={platform:t,filename:e,function:n==="<anonymous>"?bd:n,in_app:!0};return qe(r)||(s.lineno=r),qe(i)||(s.colno=i),s}var iI=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:bd,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},vde=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,yde=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ede=/\((\S*)(?::(\d+))(?::(\d+))\)/,_de=(t,e)=>{var n=vde.exec(t);if(n){var[,r,i,s]=n;return i3(e,r,bd,+i,+s)}var a=yde.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var l=Ede.exec(a[2]);l&&(a[2]=l[1],a[3]=l[2],a[4]=l[3])}var[u,d]=iI(a[1]||bd,a[2]);return i3(e,d,u,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},xde=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Tde=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Sde=(t,e)=>{var n=xde.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Tde.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],s=n[1]||bd;return[s,i]=iI(s,i),i3(e,i,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},j7=/\(error: (.*)\)/,$7=50;function wde(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(i,s){s===void 0&&(s=0);for(var a=[],l=i.split(`
`),u=s;u<l.length;u++){var d=l[u];if(!(d.length>1024)){var h=j7.test(d)?d.replace(j7,"$1"):d;if(!h.match(/\S*Error: /)){for(var p of n){var g=p(h,t);if(g){a.push(g);break}}if(a.length>=$7)break}}}return function(b){if(!b.length)return[];var y=Array.from(b);return y.reverse(),y.slice(0,$7).map(E=>{return Ze({},E,{filename:E.filename||(T=y,T[T.length-1]||{}).filename,function:E.function||bd});var T})}(a)}}class kde{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=Or(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return x1(e,"DOMException")}isDOMError(e){return x1(e,"DOMError")}}class Cde{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Ade{constructor(){}match(e){return x1(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r,i=n.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var Nde=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Mde{match(e){return typeof e=="string"}coerce(e,n){var r,[i,s]=this.getInfos(e);return{type:i??"Error",value:s??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,i=e.match(Nde);return i&&(n=i[1],r=i[2]),[n,r]}}var Ode=["fatal","error","warning","log","info","debug"];function sI(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length||i.length<=e?i:i.slice(0,e)+"..."}return""}class Rde{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return rI(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+sI(e)}isSeverityLevel(e){return Or(e)&&!n3(e)&&Ode.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(mde(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class Dde{match(e){return rI(e)}coerce(e,n){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+sI(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class Ide{match(e){return r3(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class Lde{match(e){return x1(e,"PromiseRejectionEvent")}coerce(e,n){var r,i=this.getUnhandledRejectionReason(e);return r3(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(e){if(r3(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var aI=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,r={k:function(i){if(be&&(no.DEBUG||vt.POSTHOG_DEBUG||n)&&!qe(be.console)&&be.console){for(var s=("__rrweb_original__"in be.console[i])?be.console[i].__rrweb_original__:be.console[i],a=arguments.length,l=new Array(a>1?a-1:0),u=1;u<a;u++)l[u-1]=arguments[u];s(t,...l)}},info:function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];r.k("log",...s)},warn:function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];r.k("warn",...s)},error:function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];r.k("error",...s)},critical:function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];console.error(t,...s)},uninitializedWarning:i=>{r.error("You must initialize PostHog before calling "+i)},createLogger:(i,s)=>aI(t+" "+i,s)};return r},Ye=aI("[PostHog.js]"),wr=Ye.createLogger,Pde=wr("[ExternalScriptsLoader]"),q7=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return Pde.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Ve==null?void 0:Ve.querySelectorAll("script");if(r){for(var i,s=function(){if(r[a].src===e){var u=r[a];return u.__posthog_loading_callback_fired?{v:n()}:(u.addEventListener("load",d=>{u.__posthog_loading_callback_fired=!0,n(void 0,d)}),u.onerror=d=>n(d),{v:void 0})}},a=0;a<r.length;a++)if(i=s())return i.v}var l=()=>{if(!Ve)return n("document not found");var u=Ve.createElement("script");if(u.type="text/javascript",u.crossOrigin="anonymous",u.src=e,u.onload=p=>{u.__posthog_loading_callback_fired=!0,n(void 0,p)},u.onerror=p=>n(p),t.config.prepare_external_dependency_script&&(u=t.config.prepare_external_dependency_script(u)),!u)return n("prepare_external_dependency_script returned null");var d,h=Ve.querySelectorAll("body > script");h.length>0?(d=h[0].parentNode)==null||d.insertBefore(u,h[0]):Ve.body.appendChild(u)};Ve!=null&&Ve.body?l():Ve==null||Ve.addEventListener("DOMContentLoaded",l)};vt.__PosthogExtensions__=vt.__PosthogExtensions__||{},vt.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var i=3e5;r=r+"&t="+Math.floor(Date.now()/i)*i}var s=t.requestRouter.endpointFor("assets",r);q7(t,s,n)},vt.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);q7(t,r,n)};var T1={};function Nl(t,e,n){if(an(t)){if(L7&&t.forEach===L7)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===T1)return}}}function An(t,e,n){if(!sn(t)){if(an(t))return Nl(t,e,n);if(cde(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===T1)return}else for(var i in t)if(nI.call(t,i)&&e.call(n,t[i],i)===T1)return}}var ur=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Nl(n,function(i){for(var s in i)i[s]!==void 0&&(t[s]=i[s])}),t},Ld=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Nl(n,function(i){Nl(i,function(s){t.push(s)})}),t};function ug(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var V7=function(t){try{return t()}catch{return}},Bde=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(i){Ye.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ye.critical(i)}}},yx=function(t){var e={};return An(t,function(n,r){(Or(n)&&n.length>0||Ta(n))&&(e[r]=n)}),e};function zde(t,e){return n=t,r=s=>Or(s)&&!ko(e)?s.slice(0,e):s,i=new Set,function s(a,l){return a!==Object(a)?r?r(a,l):a:i.has(a)?void 0:(i.add(a),an(a)?(u=[],Nl(a,d=>{u.push(s(d))})):(u={},An(a,(d,h)=>{i.has(d)||(u[h]=s(d,h))})),u);var u}(n);var n,r,i}var Fde=["herokuapp.com","vercel.app","netlify.app"];function Ude(t){var e=t==null?void 0:t.hostname;if(!Or(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of Fde)if(n===r)return!1;return!0}function oI(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function Er(t,e,n,r){var{capture:i=!1,passive:s=!0}=r??{};t==null||t.addEventListener(e,n,{capture:i,passive:s})}var lI="$people_distinct_id",cf="__alias",df="__timers",G7="$autocapture_disabled_server_side",s3="$heatmaps_enabled_server_side",Y7="$exception_capture_enabled_server_side",a3="$error_tracking_suppression_rules",W7="$error_tracking_capture_extension_exceptions",K7="$web_vitals_enabled_server_side",uI="$dead_clicks_enabled_server_side",X7="$web_vitals_allowed_metrics",pE="$session_recording_remote_config",S1="$sesid",cI="$session_is_sampled",Zc="$enabled_feature_flags",ff="$early_access_features",o3="$feature_flag_details",hf="$stored_person_properties",Eu="$stored_group_properties",l3="$surveys",Um="$surveys_activated",w1="$flag_call_reported",ro="$user_state",u3="$client_session_props",c3="$capture_rate_limit",d3="$initial_campaign_params",f3="$initial_referrer_info",k1="$initial_person_info",C1="$epp",dI="__POSTHOG_TOOLBAR__",G0="$posthog_cookieless",Hde=[lI,cf,"__cmpns",df,"$session_recording_enabled_server_side",s3,S1,Zc,a3,ro,ff,o3,Eu,hf,l3,w1,u3,c3,d3,f3,C1,k1];function Q7(t){return t instanceof Element&&(t.id===dI||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function kb(t){return!!t&&t.nodeType===1}function Ml(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function fI(t){return!!t&&t.nodeType===3}function hI(t){return!!t&&t.nodeType===11}function Ex(t){return t?Sb(t).split(/\s+/):[]}function Z7(t){var e=be==null?void 0:be.location.href;return!!(e&&t&&t.some(n=>e.match(n)))}function A1(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Ex(e)}function pI(t){return sn(t)?null:Sb(t).split(/(\s+)/).filter(e=>ch(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Fh(t){var e="";return h3(t)&&!yI(t)&&t.childNodes&&t.childNodes.length&&An(t.childNodes,function(n){var r;fI(n)&&n.textContent&&(e+=(r=pI(n.textContent))!==null&&r!==void 0?r:"")}),Sb(e)}function mI(t){return qe(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var _x=["a","button","form","input","select","textarea","label"];function gI(t,e){if(qe(e))return!0;var n,r=function(s){if(e.some(a=>s.matches(a)))return{v:!0}};for(var i of t)if(n=r(i))return n.v;return!1}function bI(t){var e=t.parentNode;return!(!e||!kb(e))&&e}var jde=["next","previous","prev",">","<"],J7=10,eC=[".ph-no-rageclick",".ph-no-capture"];function $de(t,e){if(!be||xx(t))return!1;var n,r,i;if(Al(e)?(n=!!e&&eC,r=void 0):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:eC,r=e==null?void 0:e.content_ignorelist),n===!1)return!1;var{targetElementList:s}=vI(t,!1);return!function(a,l){if(a===!1||qe(a))return!1;var u;if(a===!0)u=jde;else{if(!an(a))return!1;if(a.length>J7)return Ye.error("[PostHog] content_ignorelist array cannot exceed "+J7+" items. Use css_selector_ignorelist for more complex matching."),!1;u=a.map(d=>d.toLowerCase())}return l.some(d=>{var{safeText:h,ariaLabel:p}=d;return u.some(g=>h.includes(g)||p.includes(g))})}(r,s.map(a=>{var l;return{safeText:Fh(a).toLowerCase(),ariaLabel:((l=a.getAttribute("aria-label"))==null?void 0:l.toLowerCase().trim())||""}}))&&!gI(s,n)}var xx=t=>!t||Ml(t,"html")||!kb(t),vI=(t,e)=>{if(!be||xx(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],i=t;i.parentNode&&!Ml(i,"body");)if(hI(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=bI(i);if(!s)break;if(e||_x.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var a=be.getComputedStyle(s);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function qde(t,e,n,r,i){var s,a,l,u;if(n===void 0&&(n=void 0),!be||xx(t)||(s=n)!=null&&s.url_allowlist&&!Z7(n.url_allowlist)||(a=n)!=null&&a.url_ignorelist&&Z7(n.url_ignorelist))return!1;if((l=n)!=null&&l.dom_event_allowlist){var d=n.dom_event_allowlist;if(d&&!d.some(y=>e.type===y))return!1}var{parentIsUsefulElement:h,targetElementList:p}=vI(t,r);if(!function(y,E){var T=E==null?void 0:E.element_allowlist;if(qe(T))return!0;var S,A=function(z){if(T.some(I=>z.tagName.toLowerCase()===I))return{v:!0}};for(var R of y)if(S=A(R))return S.v;return!1}(p,n)||!gI(p,(u=n)==null?void 0:u.css_selector_allowlist))return!1;var g=be.getComputedStyle(t);if(g&&g.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var b=t.tagName.toLowerCase();switch(b){case"html":return!1;case"form":return(i||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(e.type)>=0;default:return h?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(_x.indexOf(b)>-1||t.getAttribute("contenteditable")==="true")}}function h3(t){for(var e=t;e.parentNode&&!Ml(e,"body");e=e.parentNode){var n=A1(e);if(jt(n,"ph-sensitive")||jt(n,"ph-no-capture"))return!1}if(jt(A1(t),"ph-include"))return!0;var r=t.type||"";if(Or(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!(Or(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function yI(t){return!!(Ml(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Ml(t,"select")||Ml(t,"textarea")||t.getAttribute("contenteditable")==="true")}var EI="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Vde=new RegExp("^(?:"+EI+")$"),Gde=new RegExp(EI),_I="\\d{3}-?\\d{2}-?\\d{4}",Yde=new RegExp("^("+_I+")$"),Wde=new RegExp("("+_I+")");function ch(t,e){return e===void 0&&(e=!0),!(sn(t)||Or(t)&&(t=Sb(t),(e?Vde:Gde).test((t||"").replace(/[- ]/g,""))||(e?Yde:Wde).test(t)))}function xI(t){var e=Fh(t);return ch(e=(e+" "+TI(t)).trim())?e:""}function TI(t){var e="";return t&&t.childNodes&&t.childNodes.length&&An(t.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=Fh(n);e=(e+" "+i).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+TI(n)).trim())}catch(s){Ye.error("[AutoCapture]",s)}}),e}function Kde(t){return function(e){var n=e.map(r=>{var i,s,a="";if(r.tag_name&&(a+=r.tag_name),r.attr_class)for(var l of(r.attr_class.sort(),r.attr_class))a+="."+l.replace(/"/g,"");var u=Ze({},r.text?{text:r.text}:{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),d={};return ug(u).sort((h,p)=>{var[g]=h,[b]=p;return g.localeCompare(b)}).forEach(h=>{var[p,g]=h;return d[tC(p.toString())]=tC(g.toString())}),a+=":",a+=ug(d).map(h=>{var[p,g]=h;return p+'="'+g+'"'}).join("")});return n.join(";")}(function(e){return e.map(n=>{var r,i,s={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)==null?void 0:i.slice(0,2048),attr_class:Xde(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return ug(n).filter(a=>{var[l]=a;return l.indexOf("attr__")===0}).forEach(a=>{var[l,u]=a;return s.attributes[l]=u}),s})}(t))}function tC(t){return t.replace(/"|\\"/g,'\\"')}function Xde(t){var e=t.attr__class;return e?an(e)?e:Ex(e):void 0}class SI{constructor(e){this.disabled=e===!1;var n=Ur(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var mE="$copy_autocapture",oo=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),N1=t=>{var e=Ve==null?void 0:Ve.createElement("a");return qe(e)?null:(e.href=t,e)},Qde=function(t,e){var n,r;e===void 0&&(e="&");var i=[];return An(t,function(s,a){qe(s)||qe(a)||a==="undefined"||(n=encodeURIComponent((l=>l instanceof File)(s)?s.name:s.toString()),r=encodeURIComponent(a),i[i.length]=r+"="+n)}),i.join(e)},M1=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var s=r[i].split("=");if(s[0]===e){n=s;break}}if(!an(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{Ye.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Uh=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[0]||"",s=r[1],a=i.split("?"),l=a[1],u=a[0],d=(l||"").split("&"),h=[],p=0;p<d.length;p++){var g=d[p].split("=");an(g)&&(e.includes(g[0])?h.push(g[0]+"="+n):h.push(d[p]))}var b=u;return l!=null&&(b+="?"+h.join("&")),s!=null&&(b+="#"+s),b},O1=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},nC=wr("[AutoCapture]");function gE(t,e){return e.length>t?e.slice(0,t)+"...":e}function Zde(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!kb(e));return e}function Jde(t,e,n,r){var i=t.tagName.toLowerCase(),s={tag_name:i};_x.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?s.$el_text=gE(1024,xI(t)):s.$el_text=gE(1024,Fh(t)));var a=A1(t);a.length>0&&(s.classes=a.filter(function(h){return h!==""})),An(t.attributes,function(h){var p;if((!yI(t)||["name","id","class","aria-label"].indexOf(h.name)!==-1)&&(r==null||!r.includes(h.name))&&!e&&ch(h.value)&&(p=h.name,!Or(p)||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")){var g=h.value;h.name==="class"&&(g=Ex(g).join(" ")),s["attr__"+h.name]=gE(1024,g)}});for(var l=1,u=1,d=t;d=Zde(d);)l++,d.tagName===t.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}function e0e(t,e){for(var n,r,{e:i,maskAllElementAttributes:s,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=e,d=[t],h=t;h.parentNode&&!Ml(h,"body");)hI(h.parentNode)?(d.push(h.parentNode.host),h=h.parentNode.host):(d.push(h.parentNode),h=h.parentNode);var p,g=[],b={},y=!1,E=!1;if(An(d,z=>{var I=h3(z);z.tagName.toLowerCase()==="a"&&(y=z.getAttribute("href"),y=I&&y&&ch(y)&&y),jt(A1(z),"ph-no-capture")&&(E=!0),g.push(Jde(z,s,a,l));var P=function($){if(!h3($))return{};var K={};return An($.attributes,function(Z){if(Z.name&&Z.name.indexOf("data-ph-capture-attribute")===0){var W=Z.name.replace("data-ph-capture-attribute-",""),re=Z.value;W&&re&&ch(re)&&(K[W]=re)}}),K}(z);ur(b,P)}),E)return{props:{},explicitNoCapture:E};if(a||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?g[0].$el_text=xI(t):g[0].$el_text=Fh(t)),y){var T,S;g[0].attr__href=y;var A=(T=N1(y))==null?void 0:T.host,R=be==null||(S=be.location)==null?void 0:S.host;A&&R&&A!==R&&(p=y)}return{props:ur({$event_type:i.type,$ce_version:1},u?{}:{$elements:g},{$elements_chain:Kde(g)},(n=g[0])!=null&&n.$el_text?{$el_text:(r=g[0])==null?void 0:r.$el_text}:{},p&&i.type==="click"?{$external_click_url:p}:{},b)}}class t0e{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new SI(e.config.rageclick),this.C=null}get I(){var e,n,r=Ur(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map(i=>new RegExp(i)),r.url_ignorelist=(n=r.url_ignorelist)==null?void 0:n.map(i=>new RegExp(i)),r}F(){if(this.isBrowserSupported()){if(be&&Ve){var e=r=>{r=r||(be==null?void 0:be.event);try{this.M(r)}catch(i){nC.error("Failed to capture event",i)}};if(Er(Ve,"submit",e,{capture:!0}),Er(Ve,"change",e,{capture:!0}),Er(Ve,"click",e,{capture:!0}),this.I.capture_copied_text){var n=r=>{r=r||(be==null?void 0:be.event),this.M(r,mE)};Er(Ve,"copy",n,{capture:!0}),Er(Ve,"cut",n,{capture:!0})}}}else nC.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[G7]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var n,r=[];return(n=this.C)==null||n.forEach(i=>{var s=Ve==null?void 0:Ve.querySelectorAll(i);s==null||s.forEach(a=>{e===a&&r.push(i)})}),r}get isEnabled(){var e,n,r=(e=this.instance.persistence)==null?void 0:e.props[G7],i=this.T;if(ko(i)&&!Al(r)&&!this.instance.O())return!1;var s=(n=this.T)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!s}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r,i=mI(e);fI(i)&&(i=i.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&$de(i,this.instance.config.rageclick)&&this.M(e,"$rageclick");var s=n===mE;if(i&&qde(i,e,this.I,s,s?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:l}=e0e(i,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.I.element_attribute_ignorelist,elementsChainAsString:this.R});if(l)return!1;var u=this.getElementSelectors(i);if(u&&u.length>0&&(a.$element_selectors=u),n===mE){var d,h=pI(be==null||(d=be.getSelection())==null?void 0:d.toString()),p=e.type||"clipboard";if(!h)return!1;a.$selected_content=h,a.$copy_type=p}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return Cl(Ve==null?void 0:Ve.querySelectorAll)}}Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Ta(t)&&isFinite(t)&&Math.floor(t)===t});var rC="0123456789abcdef";class R1{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||n<0||r<0||i<0||e>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new R1(s)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+rC.charAt(this.bytes[n]>>>4)+rC.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new R1(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class n0e{constructor(){this.A=0,this.D=0,this.j=new r0e}generate(){var e=this.generateOrAbort();if(qe(e)){this.A=0;var n=this.generateOrAbort();if(qe(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return R1.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var iC,wI=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};be&&!qe(be.crypto)&&crypto.getRandomValues&&(wI=t=>crypto.getRandomValues(t));class r0e{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(wI(this.N),this.U=0),this.N[this.U++]}}var Tl=()=>i0e().toString(),i0e=()=>(iC||(iC=new n0e)).generate(),Y0="",s0e=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function a0e(t,e){if(e){var n=function(i,s){if(s===void 0&&(s=Ve),Y0)return Y0;if(!s||["localhost","127.0.0.1"].includes(i))return"";for(var a=i.split("."),l=Math.min(a.length,8),u="dmn_chk_"+Tl();!Y0&&l--;){var d=a.slice(l).join("."),h=u+"=1;domain=."+d+";path=/";s.cookie=h+";max-age=3",s.cookie.includes(u)&&(s.cookie=h+";max-age=0",Y0=d)}return Y0}(t);if(!n){var r=(i=>{var s=i.match(s0e);return s?s[0]:""})(t);r!==n&&Ye.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Ea={H:()=>!!Ve,B:function(t){Ye.error("cookieStore error: "+t)},q:function(t){if(Ve){try{for(var e=t+"=",n=Ve.cookie.split(";").filter(s=>s.length),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(Ea.q(t))||{}}catch{}return e},G:function(t,e,n,r,i){if(Ve)try{var s="",a="",l=a0e(Ve.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),s="; expires="+u.toUTCString()}i&&(a="; secure");var d=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+l+a;return d.length>3686.4&&Ye.warn("cookieStore warning: large cookie, len="+d.length),Ve.cookie=d,d}catch{return}},V:function(t,e){if(Ve!=null&&Ve.cookie)try{Ea.G(t,"",-1,e)}catch{return}}},bE=null,Wn={H:function(){if(!ko(bE))return bE;var t=!0;if(qe(be))t=!1;else try{var e="__mplssupport__";Wn.G(e,"xyz"),Wn.q(e)!=='"xyz"'&&(t=!1),Wn.V(e)}catch{t=!1}return t||Ye.error("localStorage unsupported; falling back to cookie store"),bE=t,t},B:function(t){Ye.error("localStorage error: "+t)},q:function(t){try{return be==null?void 0:be.localStorage.getItem(t)}catch(e){Wn.B(e)}return null},W:function(t){try{return JSON.parse(Wn.q(t))||{}}catch{}return null},G:function(t,e){try{be==null||be.localStorage.setItem(t,JSON.stringify(e))}catch(n){Wn.B(n)}},V:function(t){try{be==null||be.localStorage.removeItem(t)}catch(e){Wn.B(e)}}},o0e=["distinct_id",S1,cI,C1,k1],Hm=Ze({},Wn,{W:function(t){try{var e={};try{e=Ea.W(t)||{}}catch{}var n=ur(e,JSON.parse(Wn.q(t)||"{}"));return Wn.G(t,n),n}catch{}return null},G:function(t,e,n,r,i,s){try{Wn.G(t,e,void 0,void 0,s);var a={};o0e.forEach(l=>{e[l]&&(a[l]=e[l])}),Object.keys(a).length&&Ea.G(t,a,n,r,i,s)}catch(l){Wn.B(l)}},V:function(t,e){try{be==null||be.localStorage.removeItem(t),Ea.V(t,e)}catch(n){Wn.B(n)}}}),jm={},l0e={H:function(){return!0},B:function(t){Ye.error("memoryStorage error: "+t)},q:function(t){return jm[t]||null},W:function(t){return jm[t]||null},G:function(t,e){jm[t]=e},V:function(t){delete jm[t]}},gu=null,Qr={H:function(){if(!ko(gu))return gu;if(gu=!0,qe(be))gu=!1;else try{var t="__support__";Qr.G(t,"xyz"),Qr.q(t)!=='"xyz"'&&(gu=!1),Qr.V(t)}catch{gu=!1}return gu},B:function(t){Ye.error("sessionStorage error: ",t)},q:function(t){try{return be==null?void 0:be.sessionStorage.getItem(t)}catch(e){Qr.B(e)}return null},W:function(t){try{return JSON.parse(Qr.q(t))||null}catch{}return null},G:function(t,e){try{be==null||be.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Qr.B(n)}},V:function(t){try{be==null||be.sessionStorage.removeItem(t)}catch(e){Qr.B(e)}}},io=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class u0e{constructor(e){this._instance=e}get I(){return this._instance.config}get consent(){return this.J()?io.DENIED:this.K}isOptedOut(){return this.I.cookieless_mode==="always"||this.consent===io.DENIED||this.consent===io.PENDING&&(this.I.opt_out_capturing_by_default||this.I.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===io.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.I.cookie_expiration,this.I.cross_subdomain_cookie,this.I.secure_cookie)}reset(){this.Y.V(this.X,this.I.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return fE(e)?io.GRANTED:jt(hde,e)?io.DENIED:io.PENDING}get Y(){if(!this.Z){var e=this.I.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Wn:Ea;var n=e==="localStorage"?Ea:Wn;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(fE(n.q(this.X))),n.V(this.X,this.I.cross_subdomain_cookie))}return this.Z}J(){return!!this.I.respect_dnt&&!!oI([as==null?void 0:as.doNotTrack,as==null?void 0:as.msDoNotTrack,vt.doNotTrack],e=>fE(e))}}var $m=wr("[Dead Clicks]"),c0e=()=>!0,d0e=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(uI)),r=t.instance.config.capture_dead_clicks;return Al(r)?r:!!Ur(r)||n};class kI{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[uI]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it(()=>{this.et()})}it(e){var n,r;(n=vt.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(r=vt.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",i=>{i?$m.error("failed to load script",i):e()})}et(){var e;if(Ve){if(!this.tt&&(e=vt.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Ur(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=vt.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(Ve),$m.info("starting...")}}else $m.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,$m.info("stopping..."))}}var W0=wr("[ExceptionAutocapture]");class f0e{constructor(e){var n,r,i;this.rt=()=>{var s;if(be&&this.isEnabled&&(s=vt.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var a=vt.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,l=vt.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,u=vt.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.I.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.I.capture_unhandled_rejections&&(this.nt=l(this.captureException.bind(this))),!this.ot&&this.I.capture_console_errors&&(this.ot=u(this.captureException.bind(this)))}catch(d){W0.error("failed to start",d),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[Y7]),this.I=this.ht(),this.dt=new pde({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10,refillInterval:1e4,h:W0}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ur(e)?n=Ze({},n,e):(qe(e)?this.ut:e)&&(n=Ze({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.I.capture_console_errors||this.I.capture_unhandled_errors||this.I.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(W0.info("enabled"),this.it(this.rt))}it(e){var n,r;(n=vt.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(r=vt.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",i=>{if(i)return W0.error("failed to load script",i);e()})}lt(){var e,n,r;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.I=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Y7]:this.ut}),this.startIfEnabled()}captureException(e){var n,r,i=(n=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&n!==void 0?n:"Exception";this.dt.consumeRateLimit(i)?W0.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}}function sC(t,e,n){try{if(!(e in t))return()=>{};var r=t[e],i=n(r);return Cl(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}class h0e{constructor(e){var n;this._instance=e,this.vt=(be==null||(n=be.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Ye.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,Ye.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(be&&be.history){var r=this;(e=be.history.pushState)!=null&&e.__posthog_wrapped__||sC(be.history,"pushState",i=>function(s,a,l){i.call(this,s,a,l),r.ft("pushState")}),(n=be.history.replaceState)!=null&&n.__posthog_wrapped__||sC(be.history,"replaceState",i=>function(s,a,l){i.call(this,s,a,l),r.ft("replaceState")}),this.gt()}}ft(e){try{var n,r=be==null||(n=be.location)==null?void 0:n.pathname;if(!r)return;r!==this.vt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.vt=r}catch(i){Ye.error("Error capturing "+e+" pageview",i)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};Er(be,"popstate",e),this.ct=()=>{be&&be.removeEventListener("popstate",e)}}}}var vE=wr("[SegmentIntegration]");function p0e(t,e){var n=t.config.segment;if(!n)return e();(function(r,i){var s=r.config.segment;if(!s)return i();var a=u=>{var d=()=>u.anonymousId()||Tl();r.config.get_device_id=d,u.id()&&(r.register({distinct_id:u.id(),$device_id:d()}),r.persistence.set_property(ro,"identified")),i()},l=s.user();"then"in l&&Cl(l.then)?l.then(u=>a(u)):a(l)})(t,()=>{n.register((r=>{Promise&&Promise.resolve||vE.warn("This browser does not have Promise support, and can not use the segment integration");var i=(s,a)=>{if(!a)return s;s.event.userId||s.event.anonymousId===r.get_distinct_id()||(vE.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(vE.info("UserId set, identifying with PostHog"),r.identify(s.event.userId));var l=r.calculateEventProperties(a,s.event.properties);return s.event.properties=Object.assign({},l,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>i(s,s.event.event),page:s=>i(s,"$pageview"),identify:s=>i(s,"$identify"),screen:s=>i(s,"$screen")}})(t)).then(()=>{e()})})}var CI="posthog-js";function AI(t,e){var{organization:n,projectId:r,prefix:i,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return l=>{var u,d,h,p,g;if(!(s==="*"||s.includes(l.level))||!t.__loaded)return l;l.tags||(l.tags={});var b=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());l.tags["PostHog Person URL"]=b,t.sessionRecordingStarted()&&(l.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var y=((u=l.exception)==null?void 0:u.values)||[],E=y.map(S=>Ze({},S,{stacktrace:S.stacktrace?Ze({},S.stacktrace,{type:"raw",frames:(S.stacktrace.frames||[]).map(A=>Ze({},A,{platform:"web:javascript"}))}):void 0})),T={$exception_message:((d=y[0])==null?void 0:d.value)||l.message,$exception_type:(h=y[0])==null?void 0:h.type,$exception_level:l.level,$exception_list:E,$sentry_event_id:l.event_id,$sentry_exception:l.exception,$sentry_exception_message:((p=y[0])==null?void 0:p.value)||l.message,$sentry_exception_type:(g=y[0])==null?void 0:g.type,$sentry_tags:l.tags};return n&&r&&(T.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+l.event_id),a&&t.exceptions.sendExceptionEvent(T),l}}class m0e{constructor(e,n,r,i,s,a){this.name=CI,this.setupOnce=function(l){l(AI(e,{organization:n,projectId:r,prefix:i,severityAllowList:s,sendExceptionsToPostHog:a==null||a}))}}}var g0e=be!=null&&be.location?O1(be.location.hash,"__posthog")||O1(location.hash,"state"):null,aC="_postHogToolbarParams",oC=wr("[Toolbar]"),cl=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(cl||{});class b0e{constructor(e){this.instance=e}_t(e){vt.ph_toolbar_state=e}yt(){var e;return(e=vt.ph_toolbar_state)!==null&&e!==void 0?e:cl.UNINITIALIZED}maybeLoadToolbar(e,n,r){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),!be||!Ve)return!1;e=e??be.location,r=r??be.history;try{if(!n){try{be.localStorage.setItem("test","test"),be.localStorage.removeItem("test")}catch{return!1}n=be==null?void 0:be.localStorage}var i,s=g0e||O1(e.hash,"__posthog")||O1(e.hash,"state"),a=s?V7(()=>JSON.parse(atob(decodeURIComponent(s))))||V7(()=>JSON.parse(decodeURIComponent(s))):null;return a&&a.action==="ph_authorize"?((i=a).source="url",i&&Object.keys(i).length>0&&(a.desiredHash?e.hash=a.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(n.getItem(aC)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}bt(e){var n=vt.ph_load_toolbar||vt.ph_load_editor;!sn(n)&&Cl(n)?n(e,this.instance):oC.warn("No toolbar load function found")}loadToolbar(e){var n=!(Ve==null||!Ve.getElementById(dI));if(!be||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=Ze({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(be.localStorage.setItem(aC,JSON.stringify(Ze({},i,{source:void 0}))),this.yt()===cl.LOADED)this.bt(i);else if(this.yt()===cl.UNINITIALIZED){var s;this._t(cl.LOADING),(s=vt.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",a=>{if(a)return oC.error("[Toolbar] Failed to load",a),void this._t(cl.UNINITIALIZED);this._t(cl.LOADED),this.bt(i)}),Er(be,"turbolinks:load",()=>{this._t(cl.UNINITIALIZED),this.loadToolbar(i)})}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,r){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,n,r)}}var v0e=wr("[TracingHeaders]");class y0e{constructor(e){this.xt=void 0,this.Et=void 0,this.rt=()=>{var n,r;qe(this.xt)&&((n=vt.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),qe(this.Et)&&((r=vt.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,r;(n=vt.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(r=vt.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",i=>{if(i)return v0e.error("failed to load script",i);e()})}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.Et)==null||n.call(this),this.xt=void 0,this.Et=void 0)}}var Rs="Mobile",D1="iOS",ya="Android",dh="Tablet",NI=ya+" "+dh,MI="iPad",OI="Apple",RI=OI+" Watch",fh="Safari",vd="BlackBerry",DI="Samsung",II=DI+"Browser",LI=DI+" Internet",Hu="Chrome",E0e=Hu+" OS",PI=Hu+" "+D1,Tx="Internet Explorer",BI=Tx+" "+Rs,Sx="Opera",_0e=Sx+" Mini",wx="Edge",zI="Microsoft "+wx,id="Firefox",FI=id+" "+D1,hh="Nintendo",ph="PlayStation",sd="Xbox",UI=ya+" "+Rs,HI=Rs+" "+fh,pf="Windows",p3=pf+" Phone",lC="Nokia",m3="Ouya",jI="Generic",x0e=jI+" "+Rs.toLowerCase(),$I=jI+" "+dh.toLowerCase(),g3="Konqueror",vi="(\\d+(\\.\\d+)?)",yE=new RegExp("Version/"+vi),T0e=new RegExp(sd,"i"),S0e=new RegExp(ph+" \\w+","i"),w0e=new RegExp(hh+" \\w+","i"),kx=new RegExp(vd+"|PlayBook|BB10","i"),k0e={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},C0e=(t,e)=>e&&jt(e,OI)||function(n){return jt(n,fh)&&!jt(n,Hu)&&!jt(n,ya)}(t),qI=function(t,e){return e=e||"",jt(t," OPR/")&&jt(t,"Mini")?_0e:jt(t," OPR/")?Sx:kx.test(t)?vd:jt(t,"IE"+Rs)||jt(t,"WPDesktop")?BI:jt(t,II)?LI:jt(t,wx)||jt(t,"Edg/")?zI:jt(t,"FBIOS")?"Facebook "+Rs:jt(t,"UCWEB")||jt(t,"UCBrowser")?"UC Browser":jt(t,"CriOS")?PI:jt(t,"CrMo")||jt(t,Hu)?Hu:jt(t,ya)&&jt(t,fh)?UI:jt(t,"FxiOS")?FI:jt(t.toLowerCase(),g3.toLowerCase())?g3:C0e(t,e)?jt(t,Rs)?HI:fh:jt(t,id)?id:jt(t,"MSIE")||jt(t,"Trident/")?Tx:jt(t,"Gecko")?id:""},A0e={[BI]:[new RegExp("rv:"+vi)],[zI]:[new RegExp(wx+"?\\/"+vi)],[Hu]:[new RegExp("("+Hu+"|CrMo)\\/"+vi)],[PI]:[new RegExp("CriOS\\/"+vi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+vi)],[fh]:[yE],[HI]:[yE],[Sx]:[new RegExp("(Opera|OPR)\\/"+vi)],[id]:[new RegExp(id+"\\/"+vi)],[FI]:[new RegExp("FxiOS\\/"+vi)],[g3]:[new RegExp("Konqueror[:/]?"+vi,"i")],[vd]:[new RegExp(vd+" "+vi),yE],[UI]:[new RegExp("android\\s"+vi,"i")],[LI]:[new RegExp(II+"\\/"+vi)],[Tx]:[new RegExp("(rv:|MSIE )"+vi)],Mozilla:[new RegExp("rv:"+vi)]},N0e=function(t,e){var n=qI(t,e),r=A0e[n];if(qe(r))return null;for(var i=0;i<r.length;i++){var s=r[i],a=t.match(s);if(a)return parseFloat(a[a.length-2])}return null},uC=[[new RegExp(sd+"; "+sd+" (.*?)[);]","i"),t=>[sd,t&&t[1]||""]],[new RegExp(hh,"i"),[hh,""]],[new RegExp(ph,"i"),[ph,""]],[kx,[vd,""]],[new RegExp(pf,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[p3,""];if(new RegExp(Rs).test(e)&&!/IEMobile\b/.test(e))return[pf+" "+Rs,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],i=k0e[r]||"";return/arm/i.test(e)&&(i="RT"),[pf,i]}return[pf,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[D1,e.join(".")]}return[D1,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=qe(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+ya+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ya+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[ya,e.join(".")]}return[ya,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[E0e,""]],[/Linux|debian/i,["Linux",""]]],cC=function(t){return w0e.test(t)?hh:S0e.test(t)?ph:T0e.test(t)?sd:new RegExp(m3,"i").test(t)?m3:new RegExp("("+p3+"|WPDesktop)","i").test(t)?p3:/iPad/.test(t)?MI:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?RI:kx.test(t)?vd:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(lC,"i").test(t)?lC:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(Rs).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?ya:NI:ya:new RegExp("(pda|"+Rs+")","i").test(t)?x0e:new RegExp(dh,"i").test(t)&&!new RegExp(dh+" pc","i").test(t)?$I:""},qm="https?://(.*)",Pd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],M0e=Ld(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Pd),Hh="<masked>",O0e=["li_fat_id"];function VI(t,e,n){if(!Ve)return{};var r,i=e?Ld([],Pd,n||[]):[],s=GI(Uh(Ve.URL,i,Hh),t),a=(r={},An(O0e,function(l){var u=Ea.q(l);r[l]=u||null}),r);return ur(a,s)}function GI(t,e){var n=M0e.concat(e||[]),r={};return An(n,function(i){var s=M1(t,i);r[i]=s||null}),r}function YI(t){var e=function(s){return s?s.search(qm+"google.([^/?]*)")===0?"google":s.search(qm+"bing.com")===0?"bing":s.search(qm+"yahoo.com")===0?"yahoo":s.search(qm+"duckduckgo.com")===0?"duckduckgo":null:null}(t),n=e!="yahoo"?"q":"p",r={};if(!ko(e)){r.$search_engine=e;var i=Ve?M1(Ve.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function dC(){return navigator.language||navigator.userLanguage}function WI(){return(Ve==null?void 0:Ve.referrer)||"$direct"}function KI(t,e){var n=t?Ld([],Pd,e||[]):[],r=Ui==null?void 0:Ui.href.substring(0,1e3);return{r:WI().substring(0,1e3),u:r?Uh(r,n,Hh):void 0}}function XI(t){var e,{r:n,u:r}=t,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=N1(n))==null?void 0:e.host};if(r){i.$current_url=r;var s=N1(r);i.$host=s==null?void 0:s.host,i.$pathname=s==null?void 0:s.pathname;var a=GI(r);ur(i,a)}if(n){var l=YI(n);ur(i,l)}return i}function QI(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function R0e(){try{return new Date().getTimezoneOffset()}catch{return}}function D0e(t,e){if(!Bi)return{};var n,r,i,s=t?Ld([],Pd,e||[]):[],[a,l]=function(u){for(var d=0;d<uC.length;d++){var[h,p]=uC[d],g=h.exec(u),b=g&&(Cl(p)?p(g,u):p);if(b)return b}return["",""]}(Bi);return ur(yx({$os:a,$os_version:l,$browser:qI(Bi,navigator.vendor),$device:cC(Bi),$device_type:(r=Bi,i=cC(r),i===MI||i===NI||i==="Kobo"||i==="Kindle Fire"||i===$I?dh:i===hh||i===sd||i===ph||i===m3?"Console":i===RI?"Wearable":i?Rs:"Desktop"),$timezone:QI(),$timezone_offset:R0e()}),{$current_url:Uh(Ui==null?void 0:Ui.href,s,Hh),$host:Ui==null?void 0:Ui.host,$pathname:Ui==null?void 0:Ui.pathname,$raw_user_agent:Bi.length>1e3?Bi.substring(0,997)+"...":Bi,$browser_version:N0e(Bi,navigator.vendor),$browser_language:dC(),$browser_language_prefix:(n=dC(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:be==null?void 0:be.screen.height,$screen_width:be==null?void 0:be.screen.width,$viewport_height:be==null?void 0:be.innerHeight,$viewport_width:be==null?void 0:be.innerWidth,$lib:"web",$lib_version:no.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var rl=wr("[Web Vitals]"),fC=9e5;class I0e{constructor(e){var n;this.St=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce((r,i)=>Ze({},r,{["$web_vitals_"+i.name+"_event"]:Ze({},i),["$web_vitals_"+i.name+"_value"]:i.value}),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var i,s=(i=this._instance.sessionManager)==null?void 0:i.checkAndGetSessionAndWindowId(!0);if(qe(s))rl.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();qe(a)||(sn(r==null?void 0:r.name)||sn(r==null?void 0:r.value)?rl.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?rl.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==a&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),qe(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=qe(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(Ze({},r,{$current_url:a,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,i,s,a,l=vt.__PosthogExtensions__;qe(l)||qe(l.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:s,onINP:a}=l.postHogWebVitalsCallbacks),r&&i&&s&&a?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):rl.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.St=!((n=this._instance.persistence)==null||!n.props[K7]),this.startIfEnabled()}get allowedMetrics(){var e,n,r=Ur(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return qe(r)?((n=this._instance.persistence)==null?void 0:n.props[X7])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Ur(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=Ur(this._instance.config.capture_performance)&&Ta(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:fC;return 0<e&&e<=6e4?fC:e}get isEnabled(){var e=Ui==null?void 0:Ui.protocol;if(e!=="http:"&&e!=="https:")return rl.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=Ur(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Al(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Al(n)?n:this.St}startIfEnabled(){this.isEnabled&&!this.P&&(rl.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=Ur(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Ur(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[K7]:n}),this._instance.persistence.register({[X7]:r})),this.St=n,this.startIfEnabled()}it(e){var n,r;(n=vt.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(r=vt.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",i=>{i?rl.error("failed to load script",i):e()})}Tt(){var e=be?be.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=n?Ld([],Pd,r||[]):[];return Uh(e,i,Hh)}rl.error("Could not determine current URL")}}var L0e=wr("[Heatmaps]");function hC(t){return Ur(t)&&"clientX"in t&&"clientY"in t&&Ta(t.clientX)&&Ta(t.clientY)}class P0e{constructor(e){var n;this.St=!1,this.P=!1,this.Ct=null,this.instance=e,this.St=!((n=this.instance.persistence)==null||!n.props[s3]),this.rageclicks=new SI(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Ur(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return qe(this.instance.config.capture_heatmaps)?qe(this.instance.config.enable_heatmaps)?this.St:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;L0e.info("starting..."),this.It(),this.Ft()}else{var e;clearInterval((e=this.Ct)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[s3]:n}),this.St=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ft(){this.Ct&&clearInterval(this.Ct),this.Ct=function(e){return(e==null?void 0:e.visibilityState)==="visible"}(Ve)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}It(){be&&Ve&&(this.jt=this.Dt.bind(this),Er(be,"beforeunload",this.jt),this.Lt=e=>this.At(e||(be==null?void 0:be.event)),Er(Ve,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||(be==null?void 0:be.event)),Er(Ve,"mousemove",this.Nt,{capture:!0}),this.zt=new kI(this.instance,c0e,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ft.bind(this),Er(Ve,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;be&&Ve&&(this.jt&&be.removeEventListener("beforeunload",this.jt),this.Lt&&Ve.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&Ve.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&Ve.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),a=function(l,u,d){for(var h=l;h&&kb(h)&&!Ml(h,"body");){if(h===d)return!1;if(jt(u,be==null?void 0:be.getComputedStyle(h).position))return!0;h=bI(h)}return!1}(mI(e),["fixed","sticky"],s);return{x:e.clientX+(a?0:i),y:e.clientY+(a?0:r),target_fixed:a,type:n}}At(e,n){var r;if(n===void 0&&(n="click"),!Q7(e.target)&&hC(e)){var i=this.qt(e,n);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(Ze({},i,{type:"rageclick"})),this.Wt(i)}}Ut(e){!Q7(e.target)&&hC(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout(()=>{this.Wt(this.qt(e,"mousemove"))},500))}Wt(e){if(be){var n=be.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,s=r?Ld([],Pd,i||[]):[],a=Uh(n,s,Hh);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!Qc(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class B0e{constructor(e){this._instance=e}doPageView(e,n){var r,i=this.Gt(e,n);return this.Vt={pathname:(r=be==null?void 0:be.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var r=this.Vt;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:l,maxScrollY:u,maxContentHeight:d,lastContentY:h,maxContentY:p}=s;if(!(qe(a)||qe(l)||qe(u)||qe(d)||qe(h)||qe(p))){a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),h=Math.ceil(h),p=Math.ceil(p);var g=a<=1?1:va(l/a,0,1,Ye),b=a<=1?1:va(u/a,0,1,Ye),y=d<=1?1:va(h/d,0,1,Ye),E=d<=1?1:va(p/d,0,1,Ye);i=ur(i,{$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:g,$prev_pageview_max_scroll:u,$prev_pageview_max_scroll_percentage:b,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:y,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:E})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var Ds=Uint8Array,Hi=Uint16Array,yd=Uint32Array,Cx=new Ds([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ax=new Ds([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),pC=new Ds([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ZI=function(t,e){for(var n=new Hi(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new yd(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},JI=ZI(Cx,2),z0e=JI[0],b3=JI[1];z0e[28]=258,b3[258]=28;for(var mC=ZI(Ax,0)[1],eL=new Hi(32768),Ln=0;Ln<32768;++Ln){var bu=(43690&Ln)>>>1|(21845&Ln)<<1;bu=(61680&(bu=(52428&bu)>>>2|(13107&bu)<<2))>>>4|(3855&bu)<<4,eL[Ln]=((65280&bu)>>>8|(255&bu)<<8)>>>1}var jf=function(t,e,n){for(var r=t.length,i=0,s=new Hi(e);i<r;++i)++s[t[i]-1];var a,l=new Hi(e);for(i=0;i<e;++i)l[i]=l[i-1]+s[i-1]<<1;for(a=new Hi(r),i=0;i<r;++i)a[i]=eL[l[t[i]-1]++]>>>15-t[i];return a},ju=new Ds(288);for(Ln=0;Ln<144;++Ln)ju[Ln]=8;for(Ln=144;Ln<256;++Ln)ju[Ln]=9;for(Ln=256;Ln<280;++Ln)ju[Ln]=7;for(Ln=280;Ln<288;++Ln)ju[Ln]=8;var I1=new Ds(32);for(Ln=0;Ln<32;++Ln)I1[Ln]=5;var F0e=jf(ju,9),U0e=jf(I1,5),tL=function(t){return(t/8>>0)+(7&t&&1)},nL=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Hi?Hi:t instanceof yd?yd:Ds)(n-e);return r.set(t.subarray(e,n)),r},Ja=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},K0=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},EE=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,s=n.slice();if(!i)return[new Ds(0),0];if(i==1){var a=new Ds(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort(function(I,P){return I.f-P.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,h=1,p=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};h!=i-1;)l=n[n[d].f<n[p].f?d++:p++],u=n[d!=h&&n[d].f<n[p].f?d++:p++],n[h++]={s:-1,f:l.f+u.f,l,r:u};var g=s[0].s;for(r=1;r<i;++r)s[r].s>g&&(g=s[r].s);var b=new Hi(g+1),y=v3(n[h-1],b,0);if(y>e){r=0;var E=0,T=y-e,S=1<<T;for(s.sort(function(I,P){return b[P.s]-b[I.s]||I.f-P.f});r<i;++r){var A=s[r].s;if(!(b[A]>e))break;E+=S-(1<<y-b[A]),b[A]=e}for(E>>>=T;E>0;){var R=s[r].s;b[R]<e?E-=1<<e-b[R]++-1:++r}for(;r>=0&&E;--r){var z=s[r].s;b[z]==e&&(--b[z],++E)}y=e}return[new Ds(b),y]},v3=function(t,e,n){return t.s==-1?Math.max(v3(t.l,e,n+1),v3(t.r,e,n+1)):e[t.s]=n},gC=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Hi(++e),r=0,i=t[0],s=1,a=function(u){n[r++]=u},l=1;l<=e;++l)if(t[l]==i&&l!=e)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=t[l]}return[n.subarray(0,r),e]},X0=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},y3=function(t,e,n){var r=n.length,i=tL(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<r;++s)t[i+s+4]=n[s];return 8*(i+4+r)},bC=function(t,e,n,r,i,s,a,l,u,d,h){Ja(e,h++,n),++i[256];for(var p=EE(i,15),g=p[0],b=p[1],y=EE(s,15),E=y[0],T=y[1],S=gC(g),A=S[0],R=S[1],z=gC(E),I=z[0],P=z[1],$=new Hi(19),K=0;K<A.length;++K)$[31&A[K]]++;for(K=0;K<I.length;++K)$[31&I[K]]++;for(var Z=EE($,7),W=Z[0],re=Z[1],ie=19;ie>4&&!W[pC[ie-1]];--ie);var ye,ae,de,J,ne=d+5<<3,he=X0(i,ju)+X0(s,I1)+a,Oe=X0(i,g)+X0(s,E)+a+14+3*ie+X0($,W)+(2*$[16]+3*$[17]+7*$[18]);if(ne<=he&&ne<=Oe)return y3(e,h,t.subarray(u,u+d));if(Ja(e,h,1+(Oe<he)),h+=2,Oe<he){ye=jf(g,b),ae=g,de=jf(E,T),J=E;var N=jf(W,re);for(Ja(e,h,R-257),Ja(e,h+5,P-1),Ja(e,h+10,ie-4),h+=14,K=0;K<ie;++K)Ja(e,h+3*K,W[pC[K]]);h+=3*ie;for(var X=[A,I],me=0;me<2;++me){var B=X[me];for(K=0;K<B.length;++K){var Ee=31&B[K];Ja(e,h,N[Ee]),h+=W[Ee],Ee>15&&(Ja(e,h,B[K]>>>5&127),h+=B[K]>>>12)}}}else ye=F0e,ae=ju,de=U0e,J=I1;for(K=0;K<l;++K)if(r[K]>255){Ee=r[K]>>>18&31,K0(e,h,ye[Ee+257]),h+=ae[Ee+257],Ee>7&&(Ja(e,h,r[K]>>>23&31),h+=Cx[Ee]);var Qe=31&r[K];K0(e,h,de[Qe]),h+=J[Qe],Qe>3&&(K0(e,h,r[K]>>>5&8191),h+=Ax[Qe])}else K0(e,h,ye[r[K]]),h+=ae[r[K]];return K0(e,h,ye[256]),h+ae[256]},H0e=new yd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),j0e=function(){for(var t=new yd(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),$0e=function(t,e,n,r,i){return function(s,a,l,u,d,h){var p=s.length,g=new Ds(u+p+5*(1+Math.floor(p/7e3))+d),b=g.subarray(u,g.length-d),y=0;if(!a||p<8)for(var E=0;E<=p;E+=65535){var T=E+65535;T<p?y=y3(b,y,s.subarray(E,T)):(b[E]=h,y=y3(b,y,s.subarray(E,p)))}else{for(var S=H0e[a-1],A=S>>>13,R=8191&S,z=(1<<l)-1,I=new Hi(32768),P=new Hi(z+1),$=Math.ceil(l/3),K=2*$,Z=function(kt){return(s[kt]^s[kt+1]<<$^s[kt+2]<<K)&z},W=new yd(25e3),re=new Hi(288),ie=new Hi(32),ye=0,ae=0,de=(E=0,0),J=0,ne=0;E<p;++E){var he=Z(E),Oe=32767&E,N=P[he];if(I[Oe]=N,P[he]=Oe,J<=E){var X=p-E;if((ye>7e3||de>24576)&&X>423){y=bC(s,b,0,W,re,ie,ae,de,ne,E-ne,y),de=ye=ae=0,ne=E;for(var me=0;me<286;++me)re[me]=0;for(me=0;me<30;++me)ie[me]=0}var B=2,Ee=0,Qe=R,Fe=Oe-N&32767;if(X>2&&he==Z(E-Fe))for(var Ft=Math.min(A,X)-1,ut=Math.min(32767,E),en=Math.min(258,X);Fe<=ut&&--Qe&&Oe!=N;){if(s[E+B]==s[E+B-Fe]){for(var Nt=0;Nt<en&&s[E+Nt]==s[E+Nt-Fe];++Nt);if(Nt>B){if(B=Nt,Ee=Fe,Nt>Ft)break;var Mn=Math.min(Fe,Nt-2),Vr=0;for(me=0;me<Mn;++me){var gt=E-Fe+me+32768&32767,St=gt-I[gt]+32768&32767;St>Vr&&(Vr=St,N=gt)}}}Fe+=(Oe=N)-(N=I[Oe])+32768&32767}if(Ee){W[de++]=268435456|b3[B]<<18|mC[Ee];var Gt=31&b3[B],tt=31&mC[Ee];ae+=Cx[Gt]+Ax[tt],++re[257+Gt],++ie[tt],J=E+B,++ye}else W[de++]=s[E],++re[s[E]]}}y=bC(s,b,h,W,re,ie,ae,de,ne,E-ne,y)}return nL(g,0,u+tL(y)+d)}(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!0)},_E=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function q0e(t,e){e===void 0&&(e={});var n=function(){var l=4294967295;return{p:function(u){for(var d=l,h=0;h<u.length;++h)d=j0e[255&d^u[h]]^d>>>8;l=d},d:function(){return 4294967295^l}}}(),r=t.length;n.p(t);var i,s=$0e(t,e,10+((i=e).filename&&i.filename.length+1||0),8),a=s.length;return function(l,u){var d=u.filename;if(l[0]=31,l[1]=139,l[2]=8,l[8]=u.level<2?4:u.level==9?2:0,l[9]=3,u.mtime!=0&&_E(l,4,Math.floor(new Date(u.mtime||Date.now())/1e3)),d){l[3]=8;for(var h=0;h<=d.length;++h)l[h+10]=d.charCodeAt(h)}}(s,e),_E(s,a-8,n.d()),_E(s,a-4,r),s}var V0e=function(t){var e,n,r,i,s="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
`).replace(/\r/g,`
`)).length,i=0;i<r;i++){var a=t.charCodeAt(i),l=null;a<128?n++:l=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),ko(l)||(n>e&&(s+=t.substring(e,n)),s+=l,e=n=i+1)}return n>e&&(s+=t.substring(e,t.length)),s},G0e=!!e3||!!J4,vC="text/plain",L1=function(t,e,n){var r;n===void 0&&(n=!0);var[i,s]=t.split("?"),a=Ze({},e),l=(r=s==null?void 0:s.split("&").map(d=>{var h,[p,g]=d.split("="),b=n&&(h=a[p])!==null&&h!==void 0?h:g;return delete a[p],p+"="+b}))!==null&&r!==void 0?r:[],u=Qde(a);return u&&l.push(u),i+"?"+l.join("&")},mf=(t,e)=>JSON.stringify(t,(n,r)=>typeof r=="bigint"?r.toString():r,e),xE=t=>{var{data:e,compression:n}=t;if(e){if(n===oo.GZipJS){var r=q0e(function(u,d){var h=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var p=new Ds(u.length+(u.length>>>1)),g=0,b=function(S){p[g++]=S},y=0;y<h;++y){if(g+5>p.length){var E=new Ds(g+8+(h-y<<1));E.set(p),p=E}var T=u.charCodeAt(y);T<128||d?b(T):T<2048?(b(192|T>>>6),b(128|63&T)):T>55295&&T<57344?(b(240|(T=65536+(1047552&T)|1023&u.charCodeAt(++y))>>>18),b(128|T>>>12&63),b(128|T>>>6&63),b(128|63&T)):(b(224|T>>>12),b(128|T>>>6&63),b(128|63&T))}return nL(p,0,g)}(mf(e)),{mtime:0}),i=new Blob([r],{type:vC});return{contentType:vC,body:i,estimatedSize:i.size}}if(n===oo.Base64){var s=function(u){var d,h,p,g,b,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",E=0,T=0,S="",A=[];if(!u)return u;u=V0e(u);do d=(b=u.charCodeAt(E++)<<16|u.charCodeAt(E++)<<8|u.charCodeAt(E++))>>18&63,h=b>>12&63,p=b>>6&63,g=63&b,A[T++]=y.charAt(d)+y.charAt(h)+y.charAt(p)+y.charAt(g);while(E<u.length);switch(S=A.join(""),u.length%3){case 1:S=S.slice(0,-2)+"==";break;case 2:S=S.slice(0,-1)+"="}return S}(mf(e)),a=(u=>"data="+encodeURIComponent(typeof u=="string"?u:mf(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var l=mf(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},cg=[];J4&&cg.push({transport:"fetch",method:t=>{var e,n,{contentType:r,body:i,estimatedSize:s}=(e=xE(t))!==null&&e!==void 0?e:{},a=new Headers;An(t.headers,function(h,p){a.append(p,h)}),r&&a.append("Content-Type",r);var l=t.url,u=null;if(B7){var d=new B7;u={signal:d.signal,timeout:setTimeout(()=>d.abort(),t.timeout)}}J4(l,Ze({method:(t==null?void 0:t.method)||"GET",headers:a,keepalive:t.method==="POST"&&(s||0)<52428.8,body:i,signal:(n=u)==null?void 0:n.signal},t.fetchOptions)).then(h=>h.text().then(p=>{var g={statusCode:h.status,text:p};if(h.status===200)try{g.json=JSON.parse(p)}catch(b){Ye.error(b)}t.callback==null||t.callback(g)})).catch(h=>{Ye.error(h),t.callback==null||t.callback({statusCode:0,text:h})}).finally(()=>u?clearTimeout(u.timeout):null)}}),e3&&cg.push({transport:"XHR",method:t=>{var e,n=new e3;n.open(t.method||"GET",t.url,!0);var{contentType:r,body:i}=(e=xE(t))!==null&&e!==void 0?e:{};An(t.headers,function(s,a){n.setRequestHeader(a,s)}),r&&n.setRequestHeader("Content-Type",r),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(s)}},n.send(i)}}),as!=null&&as.sendBeacon&&cg.push({transport:"sendBeacon",method:t=>{var e=L1(t.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=xE(t))!==null&&n!==void 0?n:{},s=typeof i=="string"?new Blob([i],{type:r}):i;as.sendBeacon(e,s)}catch{}}});var P1=function(t,e){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function yC(t,e,n){return mf({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var rL={exact:(t,e)=>e.some(n=>t.some(r=>n===r)),is_not:(t,e)=>e.every(n=>t.every(r=>n!==r)),regex:(t,e)=>e.some(n=>t.some(r=>P1(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!P1(n,r))),icontains:(t,e)=>e.map(Vm).some(n=>t.map(Vm).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(Vm).every(n=>t.map(Vm).every(r=>!n.includes(r)))},Vm=t=>t.toLowerCase();function iL(t,e){return!t||Object.entries(t).every(n=>{var[r,i]=n,s=e==null?void 0:e[r];if(qe(s)||ko(s))return!1;var a=[String(s)],l=rL[i.operator];return!!l&&l(i.values,a)})}var TE=wr("[Error tracking]");class Y0e{constructor(e){var n,r;this.Jt=[],this.Kt=new bde([new kde,new Lde,new Ade,new Cde,new Dde,new Rde,new Mde,new Ide],wde("web:javascript",_de,Sde)),this._instance=e,this.Jt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(a3))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,r,i,s=(n=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],a=(i=e.errorTracking)==null?void 0:i.captureExtensionExceptions;this.Jt=s,this._instance.persistence&&this._instance.persistence.register({[a3]:this.Jt,[W7]:a})}get Yt(){var e,n=!!this._instance.get_property(W7),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n==null?void 0:n.syntheticException,mechanism:{handled:n==null?void 0:n.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void TE.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void TE.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void TE.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var n=e.reduce((r,i)=>{var{type:s,value:a}=i;return Or(s)&&s.length>0&&r.$exception_types.push(s),Or(a)&&a.length>0&&r.$exception_values.push(a),r},{$exception_types:[],$exception_values:[]});return this.Jt.some(r=>{var i=r.values.map(s=>{var a,l=rL[s.operator],u=an(s.value)?s.value:[s.value],d=(a=n[s.key])!==null&&a!==void 0?a:[];return u.length>0&&l(u,d)});return r.type==="OR"?i.some(Boolean):i.every(Boolean)})}Zt(e){return e.flatMap(n=>{var r,i;return(r=(i=n.stacktrace)==null?void 0:i.frames)!==null&&r!==void 0?r:[]}).some(n=>n.filename&&n.filename.startsWith("chrome-extension://"))}ti(e){if(e.length>0){var n,r,i,s,a=(n=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],l=a[a.length-1];return(i=l==null||(s=l.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}Xt(e){return!sn(e)&&an(e)}}var qs=wr("[FeatureFlags]"),Q0=wr("[FeatureFlags]",{debugEnabled:!0}),SE="$active_feature_flags",zc="$override_feature_flags",EC="$feature_flag_payloads",Z0="$override_feature_flag_payloads",_C="$feature_flag_request_id",xC="$feature_flag_evaluated_at",TC=t=>{var e={};for(var[n,r]of ug(t||{}))r&&(e[n]=r);return e},W0e=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map(n=>{var r;return[n,(r=e[n].variant)!==null&&r!==void 0?r:e[n].enabled]})),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(n=>e[n].enabled).filter(n=>{var r;return(r=e[n].metadata)==null?void 0:r.payload}).map(n=>{var r;return[n,(r=e[n].metadata)==null?void 0:r.payload]}))):qs.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},K0e=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class X0e{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter(n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||qs.error("Invalid evaluation environment found:",n,"Expected non-empty string"),r}):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.di({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(o3),n=this._instance.get_property(zc),r=this._instance.get_property(Z0);if(!r&&!n)return e||{};var i=ur({},e||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var a of s){var l,u,d=i[a],h=n==null?void 0:n[a],p=qe(h)?(l=d==null?void 0:d.enabled)!==null&&l!==void 0&&l:!!h,g=qe(h)?d.variant:typeof h=="string"?h:void 0,b=r==null?void 0:r[a],y=Ze({},d,{enabled:p,variant:p?g??(d==null?void 0:d.variant):void 0});p!==(d==null?void 0:d.enabled)&&(y.original_enabled=d==null?void 0:d.enabled),g!==(d==null?void 0:d.variant)&&(y.original_variant=d==null?void 0:d.variant),b&&(y.metadata=Ze({},d==null?void 0:d.metadata,{payload:b,original_payload:d==null||(u=d.metadata)==null?void 0:u.payload})),i[a]=y}return this.ii||(qs.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:i}),this.ii=!0),i}getFlagVariants(){var e=this._instance.get_property(Zc),n=this._instance.get_property(zc);if(!n)return e||{};for(var r=ur({},e),i=Object.keys(n),s=0;s<i.length;s++)r[i[s]]=n[i[s]];return this.ii||(qs.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(EC),n=this._instance.get_property(Z0);if(!n)return e||{};for(var r=ur({},e||{}),i=Object.keys(n),s=0;s<i.length;s++)r[i[s]]=n[i[s]];return this.ii||(qs.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:r}),this.ii=!0),r}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout(()=>{this.di()},5))}vi(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}di(e){var n;if(this.vi(),!this._instance.O())if(this.ri)this.ni=!0;else{var r={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Ze({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(hf)||{}),group_properties:this._instance.get_property(Eu)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var i=this._instance.config.__preview_remote_config,s=i?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags",s+a);i&&(r.timezone=QI()),this.ri=!0,this._instance.ci({method:"POST",url:l,data:r,compression:this._instance.config.disable_compression?void 0:oo.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:u=>{var d,h,p=!0;if(u.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),p=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((h=u.json)!==null&&h!==void 0?h:{})),!r.disable_flags||this.ni)if(this.ai=!p,u.json&&(d=u.json.quotaLimited)!=null&&d.includes(K0e.FeatureFlags))qs.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var g;r.disable_flags||this.receivedFeatureFlags((g=u.json)!==null&&g!==void 0?g:{},p),this.ni&&(this.ni=!1,this.di())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,s=this._instance.get_property(_C)||void 0,a=this._instance.get_property(xC)||void 0,l=this._instance.get_property(w1)||{};if((n.send_event||!("send_event"in n))&&(!(e in l)||!l[e].includes(i))){var u,d,h,p,g,b,y,E,T;an(l[e])?l[e].push(i):l[e]=[i],(u=this._instance.persistence)==null||u.register({[w1]:l});var S=this.getFeatureFlagDetails(e),A={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:a,$feature_flag_bootstrapped_response:((d=this._instance.config.bootstrap)==null||(d=d.featureFlags)==null?void 0:d[e])||null,$feature_flag_bootstrapped_payload:((h=this._instance.config.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.ai};qe(S==null||(p=S.metadata)==null?void 0:p.version)||(A.$feature_flag_version=S.metadata.version);var R,z=(g=S==null||(b=S.reason)==null?void 0:b.description)!==null&&g!==void 0?g:S==null||(y=S.reason)==null?void 0:y.code;z&&(A.$feature_flag_reason=z),S!=null&&(E=S.metadata)!=null&&E.id&&(A.$feature_flag_id=S.metadata.id),qe(S==null?void 0:S.original_variant)&&qe(S==null?void 0:S.original_enabled)||(A.$feature_flag_original_response=qe(S.original_variant)?S.original_enabled:S.original_variant),S!=null&&(T=S.metadata)!=null&&T.original_payload&&(A.$feature_flag_original_payload=S==null||(R=S.metadata)==null?void 0:R.original_payload),this._instance.capture("$feature_flag_called",A)}return r}qs.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(i.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:oo.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:s=>{var a,l=(a=s.json)==null?void 0:a.featureFlagPayloads;n((l==null?void 0:l[e])||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,n);return qe(r)?void 0:!!r}qs.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==e)}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(a,l,u,d,h){u===void 0&&(u={}),d===void 0&&(d={}),h===void 0&&(h={});var p=W0e(a),g=p.flags,b=p.featureFlags,y=p.featureFlagPayloads;if(b){var E=a.requestId,T=a.evaluatedAt;if(an(b)){qs.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var S={};if(b)for(var A=0;A<b.length;A++)S[b[A]]=!0;l&&l.register({[SE]:b,[Zc]:S})}else{var R=b,z=y,I=g;a.errorsWhileComputingFlags&&(R=Ze({},u,R),z=Ze({},d,z),I=Ze({},h,I)),l&&l.register(Ze({[SE]:Object.keys(TC(R)),[Zc]:R||{},[EC]:z||{},[o3]:I||{}},E?{[_C]:E}:{},T?{[xC]:T}:{}))}}})(e,this._instance.persistence,r,i,s),this.pi(n)}}override(e,n){n===void 0&&(n=!1),qs.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return qs.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(zc),this._instance.persistence.unregister(Z0),this.pi(),Q0.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.ii=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(zc),Q0.info("Flag overrides cleared");else if(r.flags){if(an(r.flags)){for(var i={},s=0;s<r.flags.length;s++)i[r.flags[s]]=!0;this._instance.persistence.register({[zc]:i})}else this._instance.persistence.register({[zc]:r.flags});Q0.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Z0),Q0.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Z0]:r.payloads}),Q0.info("Payload overrides set",{payloads:r.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:r}=this.gi();e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,r){var i,s=(this._instance.get_property(ff)||[]).find(d=>d.flagKey===e),a={["$feature_enrollment/"+e]:n},l={$feature_flag:e,$feature_enrollment:n,$set:a};s&&(l.$early_access_feature_name=s.name),r&&(l.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(a,!1);var u=Ze({},this.getFlagVariants(),{[e]:n});(i=this._instance.persistence)==null||i.register({[SE]:Object.keys(TC(u)),[Zc]:u}),this.pi()}getEarlyAccessFeatures(e,n,r){n===void 0&&(n=!1);var i=this._instance.get_property(ff),s=r?"&"+r.map(a=>"stage="+a).join("&"):"";if(i&&!n)return e(i);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:a=>{var l,u;if(a.json){var d=a.json.earlyAccessFeatures;return(l=this._instance.persistence)==null||l.unregister(ff),(u=this._instance.persistence)==null||u.register({[ff]:d}),e(d)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter(r=>n[r]),flagVariants:Object.keys(n).filter(r=>n[r]).reduce((r,i)=>(r[i]=n[i],r),{})}}pi(e){var{flags:n,flagVariants:r}=this.gi();this.featureFlagEventHandlers.forEach(i=>i(n,r,{errorsLoading:e}))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(hf)||{};this._instance.register({[hf]:Ze({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(hf)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(Eu)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(i=>{r[i]=Ze({},r[i],e[i]),delete e[i]}),this._instance.register({[Eu]:Ze({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(Eu)||{};this._instance.register({[Eu]:Ze({},n,{[e]:{}})})}else this._instance.unregister(Eu)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.vi(),this.ii=!1}}var Q0e=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class wE{constructor(e,n){this.I=e,this.props={},this.mi=!1,this.yi=(r=>{var i="";return r.token&&(i=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+i+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&Ye.info("Persistence loaded",e.persistence,Ze({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){Q0e.indexOf(e.persistence.toLowerCase())===-1&&(Ye.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&Wn.H()?Wn:n==="localstorage+cookie"&&Hm.H()?Hm:n==="sessionstorage"&&Qr.H()?Qr:n==="memory"?l0e:n==="cookie"?Ea:Hm.H()?Hm:Ea}properties(){var e={};return An(this.props,function(n,r){if(r===Zc&&Ur(n))for(var i=Object.keys(n),s=0;s<i.length;s++)e["$feature/"+i[s]]=n[i[s]];else l=r,u=!1,(ko(a=Hde)?u:P7&&a.indexOf===P7?a.indexOf(l)!=-1:(An(a,function(d){if(u||(u=d===l))return T1}),u))||(e[r]=n);var a,l,u}),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=ur({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Ei,this.Si,this.I.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Ur(e)){qe(n)&&(n="None"),this.xi=qe(r)?this.$i:r;var i=!1;if(An(e,(s,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=s,i=!0)}),i)return this.save(),!0}return!1}register(e,n){if(Ur(e)){this.xi=qe(n)?this.$i:n;var r=!1;if(An(e,(i,s)=>{e.hasOwnProperty(s)&&this.props[s]!==i&&(this.props[s]=i,r=!0)}),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=VI(this.I.custom_campaign_params,this.I.mask_personal_data_properties,this.I.custom_personal_data_properties);Qc(yx(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=Ve==null?void 0:Ve.referrer)?YI(e):{})}update_referrer_info(){var e;this.register_once({$referrer:WI(),$referring_domain:Ve!=null&&Ve.referrer&&((e=N1(Ve.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[d3]||this.props[f3]||this.register_once({[k1]:KI(this.I.mask_personal_data_properties,this.I.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};An([f3,d3],a=>{var l=this.props[a];l&&An(l,function(u,d){e["$initial_"+t3(d)]=u})});var n,r,i=this.props[k1];if(i){var s=(n=XI(i),r={},An(n,function(a,l){r["$initial_"+t3(l)]=a}),r);ur(e,s)}return e}safe_merge(e){return An(this.props,function(n,r){r in e||(e[r]=n)}),e}update_config(e,n,r){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var i=this.bi(e),s=this.props;this.clear(),this.Y=i,this.props=s,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_secure(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_event_timer(e,n){var r=this.props[df]||{};r[e]=n,this.props[df]=r,this.save()}remove_event_timer(e){var n=(this.props[df]||{})[e];return qe(n)||(delete this.props[df][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}}var bi=wr("[Product Tours]"),kE="ph_product_tours";class Z0e{constructor(e){this.ki=null,this.Pi=null,this.Ti=void 0,this.Ri=!1,this._instance=e}onRemoteConfig(e){if(this._instance.config.disable_product_tours)bi.info("Product tours disabled via config");else{var n=e.productTours;sn(n)?bi.info("Product tours not enabled in remote config"):(this.Ti=n,bi.info("Remote config received, isProductToursEnabled: "+this.Ti),this.loadIfEnabled())}}loadIfEnabled(){var e;if(!this.Pi)if(this.Ri)bi.info("Already initializing product tours, skipping...");else if(this._instance.config.disable_product_tours)bi.info("Product tours disabled via config");else{var n=vt==null?void 0:vt.__PosthogExtensions__;if(n){var r=(e=this._instance.featureFlags)==null?void 0:e.isFeatureEnabled("product-tours-2025");if(!qe(this.Ti)||r){var i=this.Ti||r;if(i){this.Ri=!0;try{var s=n.generateProductTours;if(s)return void this.Ci(s,i);var a=n.loadExternalDependency;if(!a)return bi.error("PostHog loadExternalDependency extension not found."),void(this.Ri=!1);a(this._instance,"product-tours",l=>{l||!n.generateProductTours?bi.error("Could not load product tours script",l):this.Ci(n.generateProductTours,i),this.Ri=!1})}catch(l){bi.error("Error initializing product tours",l),this.Ri=!1}}else bi.info("Product tours not enabled")}else bi.info("Waiting for remote config or feature flag to enable product tours")}else bi.error("PostHog Extensions not found.")}}Ci(e,n){this.Pi=e(this._instance,n)||null,bi.info("Product tours loaded successfully")}getProductTours(e,n){if(n===void 0&&(n=!1),!an(this.ki)||n){var r=this._instance.persistence;if(r){var i=r.props[kE];if(an(i)&&!n)return this.ki=i,void e(i,{isLoaded:!0})}this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{var a=s.statusCode;if(a!==200||!s.json){var l="Product Tours API could not be loaded, status: "+a;return bi.error(l),void e([],{isLoaded:!1,error:l})}var u=an(s.json.product_tours)?s.json.product_tours:[];this.ki=u,r&&r.register({[kE]:u}),e(u,{isLoaded:!0})}})}else e(this.ki,{isLoaded:!0})}getActiveProductTours(e){if(sn(this.Pi))return bi.warn("Product tours not loaded yet"),void e([],{isLoaded:!1,error:"Product tours not loaded"});this.Pi.getActiveProductTours(e)}showProductTour(e){var n;bi.info("showProductTour("+e+")"),(n=this.Pi)==null||n.showTourById(e)}dismissProductTour(){var e;(e=this.Pi)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Pi)==null||e.nextStep()}previousStep(){var e;(e=this.Pi)==null||e.previousStep()}clearCache(){this.ki=null;var e=this._instance.persistence;e&&e.unregister(kE)}resetTour(e){var n;(n=this.Pi)==null||n.resetTour(e)}resetAllTours(){var e;(e=this.Pi)==null||e.resetAllTours()}}var J0=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({});(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({});(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({});(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({});var CE=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({});(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({});(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({});(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({});var dg=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t}({}),SC=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t}({}),sL=function(t){return t.Popover="popover",t.Inline="inline",t}({});class Nx{constructor(){this.Ii={},this.Ii={}}on(e,n){return this.Ii[e]||(this.Ii[e]=[]),this.Ii[e].push(n),()=>{this.Ii[e]=this.Ii[e].filter(r=>r!==n)}}emit(e,n){for(var r of this.Ii[e]||[])r(n);for(var i of this.Ii["*"]||[])i(e,n)}}function Fc(t,e,n){if(sn(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class J0e{constructor(e){this.Fi=new Nx,this.Mi=(n,r)=>this.Oi(n,r)&&this.Ai(n,r)&&this.Di(n,r)&&this.ji(n,r),this.Oi=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.Li=new Set,this.Ni=new Set}init(){var e;if(!qe((e=this._instance)==null?void 0:e.Ui)){var n;(n=this._instance)==null||n.Ui((r,i)=>{this.on(r,i)})}}register(e){var n,r;if(!qe((n=this._instance)==null?void 0:n.Ui)&&(e.forEach(a=>{var l,u;(l=this.Ni)==null||l.add(a),(u=a.steps)==null||u.forEach(d=>{var h;(h=this.Li)==null||h.add((d==null?void 0:d.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var i,s=new Set;e.forEach(a=>{var l;(l=a.steps)==null||l.forEach(u=>{u!=null&&u.selector&&s.add(u==null?void 0:u.selector)})}),(i=this._instance)==null||i.autocapture.setElementSelectors(s)}}on(e,n){var r;n!=null&&e.length!=0&&(this.Li.has(e)||this.Li.has(n==null?void 0:n.event))&&this.Ni&&((r=this.Ni)==null?void 0:r.size)>0&&this.Ni.forEach(i=>{this.zi(n,i)&&this.Fi.emit("actionCaptured",i.name)})}Hi(e){this.onAction("actionCaptured",n=>e(n))}zi(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Mi(e,r))return!0;return!1}onAction(e,n){return this.Fi.on(e,n)}Ai(e,n){if(n!=null&&n.url){var r,i=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!Fc(i,n.url,n.url_matching||"contains"))return!1}return!0}Di(e,n){return!!this.Bi(e,n)&&!!this.qi(e,n)&&!!this.Wi(e,n)}Bi(e,n){var r;if(n==null||!n.href)return!0;var i=this.Gi(e);if(i.length>0)return i.some(l=>Fc(l.href,n.href,n.href_matching||"exact"));var s,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&Fc((s=a.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}qi(e,n){var r;if(n==null||!n.text)return!0;var i=this.Gi(e);if(i.length>0)return i.some(d=>Fc(d.text,n.text,n.text_matching||"exact")||Fc(d.$el_text,n.text,n.text_matching||"exact"));var s,a,l,u=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!u&&(s=function(d){for(var h,p=[],g=/(?::|")text="(.*?)"/g;!sn(h=g.exec(d));)p.includes(h[1])||p.push(h[1]);return p}(u),a=n.text,l=n.text_matching||"exact",s.some(d=>Fc(d,a,l)))}Wi(e,n){var r,i;if(n==null||!n.selector)return!0;var s=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}Gi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}ji(e,n){return n==null||!n.properties||n.properties.length===0||iL(n.properties.reduce((r,i)=>{var s=an(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:s,operator:i.operator||"exact"},r},{}),e==null?void 0:e.properties)}}var un=wr("[Surveys]"),E3="seenSurvey_",efe=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},wC=t=>{var e=""+E3+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+E3+t.id+"_"+t.current_iteration),e},tfe=[CE.Popover,CE.Widget,CE.API],nfe={ignoreConditions:!1,ignoreDelay:!1,displayType:sL.Popover};class rfe{constructor(e){this._instance=e,this.Vi=new Map,this.Ji=new Map,this.Ki=new Map}Yi(e,n){return!!e&&iL(e.propertyFilters,n==null?void 0:n.properties)}Xi(e,n){var r=new Map;return e.forEach(i=>{var s;(s=i.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach(a=>{if(a!=null&&a.name){var l=r.get(a.name)||[];l.push(i.id),r.set(a.name,l)}})}),r}Qi(e,n,r){var i,s=(r===J0.Activation?this.Vi:this.Ji).get(e),a=[];return(i=this._instance)==null||i.getSurveys(l=>{a=l.filter(u=>s==null?void 0:s.includes(u.id))}),a.filter(l=>{var u,d=(u=l.conditions)==null||(u=u[r])==null||(u=u.values)==null?void 0:u.find(h=>h.name===e);return this.Yi(d,n)})}register(e){var n;qe((n=this._instance)==null?void 0:n.Ui)||(this.Zi(e),this.te(e))}te(e){var n=e.filter(r=>{var i,s;return((i=r.conditions)==null?void 0:i.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0});n.length!==0&&(this.ie==null&&(this.ie=new J0e(this._instance),this.ie.init(),this.ie.Hi(r=>{this.onAction(r)})),n.forEach(r=>{var i,s,a,l,u;r.conditions&&(i=r.conditions)!=null&&i.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((l=this.ie)==null||l.register(r.conditions.actions.values),(u=r.conditions)==null||(u=u.actions)==null||(u=u.values)==null||u.forEach(d=>{if(d&&d.name){var h=this.Ki.get(d.name);h&&h.push(r.id),this.Ki.set(d.name,h||[r.id])}}))}))}Zi(e){var n,r=e.filter(s=>{var a,l;return((a=s.conditions)==null?void 0:a.events)&&((l=s.conditions)==null||(l=l.events)==null||(l=l.values)==null?void 0:l.length)>0}),i=e.filter(s=>{var a,l;return((a=s.conditions)==null?void 0:a.cancelEvents)&&((l=s.conditions)==null||(l=l.cancelEvents)==null||(l=l.values)==null?void 0:l.length)>0});(r.length!==0||i.length!==0)&&((n=this._instance)==null||n.Ui((s,a)=>{this.onEvent(s,a)}),this.Vi=this.Xi(e,J0.Activation),this.Ji=this.Xi(e,J0.Cancellation))}onEvent(e,n){var r,i=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[Um])||[];if(dg.SHOWN===e&&n&&i.length>0){var s;un.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:i});var a=n==null||(s=n.properties)==null?void 0:s.$survey_id;if(a){var l=i.indexOf(a);l>=0&&(i.splice(l,1),this.ee(i))}}else{if(this.Ji.has(e)){var u=this.Qi(e,n,J0.Cancellation);u.length>0&&(un.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:u.map(h=>h.id)}),u.forEach(h=>{var p,g=i.indexOf(h.id);g>=0&&i.splice(g,1),(p=this._instance)==null||p.cancelPendingSurvey(h.id)}),this.ee(i))}if(this.Vi.has(e)){un.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Vi.get(e)});var d=this.Qi(e,n,J0.Activation);this.ee(i.concat(d.map(h=>h.id)||[]))}}}onAction(e){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[Um])||[];this.Ki.has(e)&&this.ee(r.concat(this.Ki.get(e)||[]))}ee(e){var n;un.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[Um]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Um];return n||[]}getEventToSurveys(){return this.Vi}re(){return this.ie}}class ife{constructor(e){this.se=void 0,this._surveyManager=null,this.ne=!1,this.oe=!1,this.ae=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(sn(n))return un.warn("Flags not loaded yet. Not loading surveys.");var r=an(n);this.se=r?n.length>0:n,un.info("flags response received, isSurveysEnabled: "+this.se),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(E3)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(i=>localStorage.removeItem(i))}loadIfEnabled(){if(!this._surveyManager)if(this.oe)un.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)un.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())un.info("Not loading surveys in cookieless mode without consent.");else{var e=vt==null?void 0:vt.__PosthogExtensions__;if(e){if(!qe(this.se)||this._instance.config.advanced_enable_surveys){var n=this.se||this._instance.config.advanced_enable_surveys;this.oe=!0;try{var r=e.generateSurveys;if(r)return void this.le(r,n);var i=e.loadExternalDependency;if(!i)return void this.ue("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",s=>{s||!e.generateSurveys?this.ue("Could not load surveys script",s):this.le(e.generateSurveys,n)})}catch(s){throw this.ue("Error initializing surveys",s),s}finally{this.oe=!1}}}else un.error("PostHog Extensions not found.")}}le(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new rfe(this._instance),un.info("Surveys loaded successfully"),this.he({isLoaded:!0})}ue(e,n){un.error(e,n),this.he({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ae.push(e),this._surveyManager&&this.he({isLoaded:!0}),()=>{this.ae=this.ae.filter(n=>n!==e)}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return un.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(l3);if(r&&!n)return e(r,{isLoaded:!0});if(this.ne)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.ne=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var s;this.ne=!1;var a=i.statusCode;if(a!==200||!i.json){var l="Surveys API could not be loaded, status: "+a;return un.error(l),e([],{isLoaded:!1,error:l})}var u,d=i.json.surveys||[],h=d.filter(p=>function(g){return!(!g.start_date||g.end_date)}(p)&&(function(g){var b;return!((b=g.conditions)==null||(b=b.events)==null||(b=b.values)==null||!b.length)}(p)||function(g){var b;return!((b=g.conditions)==null||(b=b.actions)==null||(b=b.values)==null||!b.length)}(p)));return h.length>0&&((u=this._surveyEventReceiver)==null||u.register(h)),(s=this._instance.persistence)==null||s.register({[l3]:d}),e(d,{isLoaded:!0})}})}catch(i){throw this.ne=!1,i}}he(e){for(var n of this.ae)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){un.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!sn(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);un.warn("init was not called")}de(e){var n=null;return this.getSurveys(r=>{var i;n=(i=r.find(s=>s.id===e))!==null&&i!==void 0?i:null}),n}ve(e){if(sn(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.de(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(sn(this._surveyManager))return un.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ve(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return sn(this._surveyManager)?(un.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(r=>{this.getSurveys(i=>{var s,a=(s=i.find(u=>u.id===e))!==null&&s!==void 0?s:null;if(a){var l=this.ve(a);r({visible:l.eligible,disabledReason:l.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(e,n){var r;if(sn(this._surveyManager))un.warn("init was not called");else{var i=typeof e=="string"?this.de(e):e;if(i!=null&&i.id)if(tfe.includes(i.type)){var s=Ve==null?void 0:Ve.querySelector(n);if(s)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(un.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,l;un.info("Rendering survey "+i.id+" with delay of "+((a=i.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(l=this._surveyManager)==null||l.renderSurvey(i,s),un.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,s);un.warn("Survey element not found")}else un.warn("Surveys of type "+i.type+" cannot be rendered in the app");else un.warn("Survey not found")}}displaySurvey(e,n){var r;if(sn(this._surveyManager))un.warn("init was not called");else{var i=this.de(e);if(i){var s=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(s=Ze({},i,{appearance:Ze({},i.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var a=this.canRenderSurvey(i);if(!a.visible)return void un.warn("Survey is not eligible to be displayed: ",a.disabledReason)}n.displayType!==sL.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,n.selector)}else un.warn("Survey not found")}}cancelPendingSurvey(e){sn(this._surveyManager)?un.warn("init was not called"):this._surveyManager.cancelSurvey(e)}}var kC=wr("[RateLimiter]");class sfe{constructor(e){var n,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=i=>{var s=i.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(a=>{kC.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void kC.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:s})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)==null?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var n,r,i;e===void 0&&(e=!1);var s=new Date().getTime(),a=(n=(r=this.instance.persistence)==null?void 0:r.get_property(c3))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:s};a.tokens+=(s-a.last)/1e3*this.captureEventsPerSecond,a.last=s,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var l=a.tokens<1;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,(i=this.instance.persistence)==null||i.set_property(c3,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var vu=wr("[RemoteConfig]");class afe{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=vt._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}ce(e){var n,r;(n=vt.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=vt.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(vu.error("PostHog Extensions not found. Cannot load remote config."),e())}fe(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return vu.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void vu.warn("Remote config is disabled. Falling back to local config.");this.ce(e=>{if(!e)return vu.info("No config found after loading remote JS config. Falling back to JSON."),void this.fe(n=>{this.fi(n)});this.fi(e)})}catch(e){vu.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):vu.info("__preview_remote_config is disabled. Logging config instead",e):vu.error("Failed to fetch remote config from PostHog.")}}var _3=3e3;class ofe{constructor(e,n){this.pe=!0,this.ge=[],this._e=va((n==null?void 0:n.flush_interval_ms)||_3,250,5e3,Ye.createLogger("flush interval"),_3),this.me=e}enqueue(e){this.ge.push(e),this.ye||this.be()}unload(){this.we();var e=this.ge.length>0?this.xe():{},n=Object.values(e);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.me(Ze({},r,{transport:"sendBeacon"}))})}enable(){this.pe=!1,this.be()}be(){var e=this;this.pe||(this.ye=setTimeout(()=>{if(this.we(),this.ge.length>0){var n=this.xe(),r=function(){var s=n[i],a=new Date().getTime();s.data&&an(s.data)&&An(s.data,l=>{l.offset=Math.abs(l.timestamp-a),delete l.timestamp}),e.me(s)};for(var i in n)r()}},this._e))}we(){clearTimeout(this.ye),this.ye=void 0}xe(){var e={};return An(this.ge,n=>{var r,i=n,s=(i?i.batchKey:null)||i.url;qe(e[s])&&(e[s]=Ze({},i,{data:[]})),(r=e[s].data)==null||r.push(i.data)}),this.ge=[],e}}var lfe=["retriesPerformedSoFar"];class ufe{constructor(e){this.Ee=!1,this.Se=3e3,this.ge=[],this._instance=e,this.ge=[],this.$e=!0,!qe(be)&&"onLine"in be.navigator&&(this.$e=be.navigator.onLine,this.ke=()=>{this.$e=!0,this.Dt()},this.Pe=()=>{this.$e=!1},Er(be,"online",this.ke),Er(be,"offline",this.Pe))}get length(){return this.ge.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=eI(e,lfe);Ta(n)&&n>0&&(r.url=L1(r.url,{retry_count:n})),this._instance.ci(Ze({},r,{callback:i=>{i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.Te(Ze({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(i)}}))}Te(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=function(a){var l=3e3*Math.pow(2,a),u=l/2,d=Math.min(18e5,l),h=(Math.random()-.5)*(d-u);return Math.ceil(d+h)}(n),i=Date.now()+r;this.ge.push({retryAt:i,requestOptions:e});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),Ye.warn(s),this.Ee||(this.Ee=!0,this.Re())}Re(){if(this.Ce&&clearTimeout(this.Ce),this.ge.length===0)return this.Ee=!1,void(this.Ce=void 0);this.Ce=setTimeout(()=>{this.$e&&this.ge.length>0&&this.Dt(),this.Re()},this.Se)}Dt(){var e=Date.now(),n=[],r=this.ge.filter(s=>s.retryAt<e||(n.push(s),!1));if(this.ge=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.Ce&&(clearTimeout(this.Ce),this.Ce=void 0),this.Ee=!1,qe(be)||(this.ke&&(be.removeEventListener("online",this.ke),this.ke=void 0),this.Pe&&(be.removeEventListener("offline",this.Pe),this.Pe=void 0)),this.ge))try{this._instance.ci(Ze({},e,{transport:"sendBeacon"}))}catch(n){Ye.error(n)}this.ge=[]}}class cfe{constructor(e){this.Ie=()=>{var n,r,i,s;this.Fe||(this.Fe={});var a=this.scrollElement(),l=this.scrollY(),u=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=l+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this.Fe.lastScrollY=Math.ceil(l),this.Fe.maxScrollY=Math.max(l,(n=this.Fe.maxScrollY)!==null&&n!==void 0?n:0),this.Fe.maxScrollHeight=Math.max(u,(r=this.Fe.maxScrollHeight)!==null&&r!==void 0?r:0),this.Fe.lastContentY=d,this.Fe.maxContentY=Math.max(d,(i=this.Fe.maxContentY)!==null&&i!==void 0?i:0),this.Fe.maxContentHeight=Math.max(h,(s=this.Fe.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=e}getContext(){return this.Fe}resetContext(){var e=this.Fe;return setTimeout(this.Ie,0),e}startMeasuringScrollPosition(){Er(be,"scroll",this.Ie,{capture:!0}),Er(be,"scrollend",this.Ie,{capture:!0}),Er(be,"resize",this.Ie)}scrollElement(){if(!this._instance.config.scroll_root_selector)return be==null?void 0:be.document.documentElement;var e=an(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var r=be==null?void 0:be.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return be&&(be.scrollY||be.pageYOffset||be.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return be&&(be.scrollX||be.pageXOffset||be.document.documentElement.scrollLeft)||0}}var dfe=t=>KI(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties);class CC{constructor(e,n,r,i){this.Me=s=>{var a=this.Oe();if(!a||a.sessionId!==s){var l={sessionId:s,props:this.Ae(this._instance)};this.De.register({[u3]:l})}},this._instance=e,this.je=n,this.De=r,this.Ae=i||dfe,this.je.onSessionId(this.Me)}Oe(){return this.De.props[u3]}getSetOnceProps(){var e,n=(e=this.Oe())==null?void 0:e.props;return n?"r"in n?XI(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return An(yx(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+t3(r)]=n}),e}}var AE=wr("[SessionId]");class AC{on(e,n){return this.Le.on(e,n)}constructor(e,n,r){var i;if(this.Ne=[],this.Ue=void 0,this.Le=new Nx,this.ze=(h,p)=>Math.abs(h-p)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.I=e.config,this.De=e.persistence,this.He=void 0,this.Be=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.qe=n||Tl,this.We=r||Tl;var s=this.I.persistence_name||this.I.token,a=this.I.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*va(a,60,36e3,AE.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ge(),this.Ve="ph_"+s+"_window_id",this.Je="ph_"+s+"_primary_window_exists",this.Ke()){var l=Qr.W(this.Ve),u=Qr.W(this.Je);l&&!u?this.He=l:Qr.V(this.Ve),Qr.G(this.Je,!0)}if((i=this.I.bootstrap)!=null&&i.sessionID)try{var d=(h=>{var p=h.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})(this.I.bootstrap.sessionID);this.Ye(this.I.bootstrap.sessionID,new Date().getTime(),d)}catch(h){AE.error("Invalid sessionID in bootstrap",h)}this.Xe()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return qe(this.Ne)&&(this.Ne=[]),this.Ne.push(e),this.Be&&e(this.Be,this.He),()=>{this.Ne=this.Ne.filter(n=>n!==e)}}Ke(){return this.I.persistence!=="memory"&&!this.De.wi&&Qr.H()}Qe(e){e!==this.He&&(this.He=e,this.Ke()&&Qr.G(this.Ve,e))}Ze(){return this.He?this.He:this.Ke()?Qr.W(this.Ve):null}Ye(e,n,r){e===this.Be&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Be=e,this.De.register({[S1]:[n,e,r]}))}tr(){var e=this.De.props[S1];return an(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ye(null,null,null)}destroy(){clearTimeout(this.ir),this.ir=void 0,this.Ue&&be&&(be.removeEventListener("beforeunload",this.Ue,{capture:!1}),this.Ue=void 0),this.Ne=[]}Xe(){this.Ue=()=>{this.Ke()&&Qr.V(this.Je)},Er(be,"beforeunload",this.Ue,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.I.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[i,s,a]=this.tr(),l=this.Ze(),u=Ta(a)&&a>0&&Math.abs(r-a)>864e5,d=!1,h=!s,p=!h&&!e&&this.ze(r,i);h||p||u?(s=this.qe(),l=this.We(),AE.info("new session ID generated",{sessionId:s,windowId:l,changeReason:{noSessionId:h,activityTimeout:p,sessionPastMaximumLength:u}}),a=r,d=!0):l||(l=this.We(),d=!0);var g=i===0||!e||u?r:i,b=a===0?new Date().getTime():a;return this.Qe(l),this.Ye(s,g,b),e||this.Ge(),d&&this.Ne.forEach(y=>y(s,l,d?{noSessionId:h,activityTimeout:p,sessionPastMaximumLength:u}:void 0)),{sessionId:s,windowId:l,sessionStartTimestamp:b,changeReason:d?{noSessionId:h,activityTimeout:p,sessionPastMaximumLength:u}:void 0,lastActivityTimestamp:i}}Ge(){clearTimeout(this.ir),this.ir=setTimeout(()=>{var[e]=this.tr();if(this.ze(new Date().getTime(),e)){var n=this.Be;this.resetSessionId(),this.Le.emit("forcedIdleReset",{idleSessionId:n})}},1.1*this.sessionTimeoutMs)}}var ffe=["$set_once","$set"],il=wr("[SiteApps]");class hfe{constructor(e){this._instance=e,this.er=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rr(e,n){if(n){var r=this.globalsForEvent(n);this.er.push(r),this.er.length>1e3&&(this.er=this.er.slice(10))}}get siteAppLoaders(){var e;return(e=vt._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ui(this.rr.bind(this));this.sr=()=>{e(),this.er=[],this.sr=void 0}}}globalsForEvent(e){var n,r,i,s,a,l,u;if(!e)throw new Error("Event payload is required");var d={},h=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var[g,b]of Object.entries(p))d[g]={id:h[g],type:g,properties:b};var{$set_once:y,$set:E}=e;return{event:Ze({},eI(e,ffe),{properties:Ze({},e.properties,E?{$set:Ze({},(n=(r=e.properties)==null?void 0:r.$set)!==null&&n!==void 0?n:{},E)}:{},y?{$set_once:Ze({},(i=(s=e.properties)==null?void 0:s.$set_once)!==null&&i!==void 0?i:{},y)}:{}),elements_chain:(a=(l=e.properties)==null?void 0:l.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(u=e.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(e){var n=this.apps[e.id],r=()=>{var l;!n.errored&&this.er.length&&(il.info("Processing "+this.er.length+" events for site app with id "+e.id),this.er.forEach(u=>n.processEvent==null?void 0:n.processEvent(u)),n.processedBuffer=!0),Object.values(this.apps).every(u=>u.processedBuffer||u.errored)&&((l=this.sr)==null||l.call(this))},i=!1,s=l=>{n.errored=!l,n.loaded=!0,il.info("Site app with id "+e.id+" "+(l?"loaded":"errored")),i&&r()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:l=>{s(l)}});a&&(n.processEvent=a),i=!0}catch(l){il.error("Error while initializing PostHog app with config id "+e.id,l),s(!1)}if(i&&n.loaded)try{r()}catch(l){il.error("Error while processing buffered events PostHog app with config id "+e.id,l),n.errored=!0}}nr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}ar(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(n)}catch(i){il.error("Error while processing event "+e.event+" for site app "+r.id,i)}}}onRemoteConfig(e){var n,r,i,s=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.nr(),void this._instance.on("eventCaptured",d=>this.ar(d))):void il.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.sr)==null||r.call(this),(i=e.siteApps)!=null&&i.length)if(this.isEnabled){var a=function(d){var h;vt["__$$ph_site_app_"+d]=s._instance,(h=vt.__PosthogExtensions__)==null||h.loadSiteApp==null||h.loadSiteApp(s._instance,u,p=>{if(p)return il.error("Error while initializing PostHog app with config id "+d,p)})};for(var{id:l,url:u}of e.siteApps)a(l)}else il.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var aL=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&U7(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(i=>U7(i==null?void 0:i.brand,e)))return!0}catch{}return!!t.webdriver},gf=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),NC="i.posthog.com";class pfe{constructor(e){this.lr={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+NC,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.lr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.lr[this.apiHost]=gf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.lr[this.apiHost]=gf.EU:this.lr[this.apiHost]=gf.CUSTOM),this.lr[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===gf.CUSTOM)return this.apiHost+n;var r=NC+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var mfe={icontains:(t,e)=>!!be&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!be&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!be&&P1(e.href,t),not_regex:(t,e)=>!!be&&!P1(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class oi{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(i=>{oi.ur("retrieved web experiments from the server"),n.hr=new Map,i.forEach(s=>{if(s.feature_flag_key){var a;n.hr&&(oi.ur("setting flag key ",s.feature_flag_key," to web experiment ",s),(a=n.hr)==null||a.set(s.feature_flag_key,s));var l=n._instance.getFeatureFlag(s.feature_flag_key);Or(l)&&s.variants[l]&&n.dr(s.name,l,s.variants[l].transforms)}else if(s.variants)for(var u in s.variants){var d=s.variants[u];oi.vr(d)&&n.dr(s.name,u,d.transforms)}})},r)},this._instance=e,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(e){if(this._is_bot())oi.ur("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(sn(this.hr))return this.hr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();oi.ur("applying feature flags",e),e.forEach(n=>{var r;if(this.hr&&(r=this.hr)!=null&&r.has(n)){var i,s=this._instance.getFeatureFlag(n),a=(i=this.hr)==null?void 0:i.get(n);s&&a!=null&&a.variants[s]&&this.dr(a.name,s,a.variants[s].transforms)}})}}previewWebExperiment(){var e=oi.getWindowLocation();if(e!=null&&e.search){var n=M1(e==null?void 0:e.search,"__experiment_id"),r=M1(e==null?void 0:e.search,"__experiment_variant");n&&r&&(oi.ur("previewing web experiments "+n+" && "+r),this.getWebExperiments(i=>{this.cr(parseInt(n),r,i)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return e(i);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:s=>{if(s.statusCode!==200||!s.json)return e([]);var a=s.json.experiments||[];return e(a)}})}cr(e,n,r){var i=r.filter(s=>s.id===e);i&&i.length>0&&(oi.ur("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.dr(i[0].name,n,i[0].variants[n].transforms))}static vr(e){return!sn(e.conditions)&&oi.pr(e)&&oi.gr(e)}static pr(e){var n;if(sn(e.conditions)||sn((n=e.conditions)==null?void 0:n.url))return!0;var r,i,s,a=oi.getWindowLocation();return!!a&&((r=e.conditions)==null||!r.url||mfe[(i=(s=e.conditions)==null?void 0:s.urlMatchType)!==null&&i!==void 0?i:"icontains"](e.conditions.url,a))}static getWindowLocation(){return be==null?void 0:be.location}static gr(e){var n;if(sn(e.conditions)||sn((n=e.conditions)==null?void 0:n.utm))return!0;var r=VI();if(r.utm_source){var i,s,a,l,u,d,h,p,g=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,b=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_source)==r.utm_source,y=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_medium||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==r.utm_medium,E=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return g&&y&&E&&b}return!1}static ur(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];Ye.info("[WebExperiments] "+e,r)}dr(e,n,r){this._is_bot()?oi.ur("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(i=>{if(i.selector){var s;oi.ur("applying transform of variant "+n+" for experiment "+e+" ",i);var a=(s=document)==null?void 0:s.querySelectorAll(i.selector);a==null||a.forEach(l=>{var u=l;i.html&&(u.innerHTML=i.html),i.css&&u.setAttribute("style",i.css)})}}):oi.ur("Control variants leave the page unmodified.")}_is_bot(){return as&&this._instance?aL(as,this._instance.config.custom_blocked_useragents):void 0}}var gfe=wr("[PostHog ExternalIntegrations]"),bfe={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class vfe{constructor(e){this._instance=e}it(e,n){var r;(r=vt.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,i=>{if(i)return gfe.error("failed to load script",i);n()})}startIfEnabledOrStop(){var e=this,n=function(a){var l,u,d;!i||(l=vt.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]||e.it(bfe[a],()=>{var h;(h=vt.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[a])==null||h.start(e._instance)}),!i&&(u=vt.__PosthogExtensions__)!=null&&(u=u.integrations)!=null&&u[a]&&((d=vt.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[a])==null||d.stop())};for(var[r,i]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var x3="[SessionRecording]",ef=wr(x3);class MC{get started(){var e;return!((e=this._r)==null||!e.isStarted)}get status(){return this._r?this._r.status:this.mr&&!this.yr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.mr=!1,this.br=void 0,this._instance=e,!this._instance.sessionManager)throw ef.error("started without valid sessionManager"),new Error(x3+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(x3+' cannot be used with cookieless_mode="always"')}get yr(){var e,n=!((e=this._instance.get_property(pE))==null||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return be&&n&&r&&!i}startIfEnabledOrStop(e){var n;if(!this.yr||(n=this._r)==null||!n.isStarted){var r=!qe(Object.assign)&&!qe(Array.from);this.yr&&r?(this.wr(e),ef.info("starting")):this.stopRecording()}}wr(e){var n,r,i;this.yr&&(vt!=null&&(n=vt.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(r=vt.__PosthogExtensions__)!=null&&r.initSessionRecording?this.Er(e):(i=vt.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,this.Sr,s=>{if(s)return ef.error("could not load recorder",s);this.Er(e)}))}stopRecording(){var e,n;(e=this.br)==null||e.call(this),this.br=void 0,(n=this._r)==null||n.stop()}$r(){var e;(e=this._instance.persistence)==null||e.unregister(cI)}kr(e){if(this._instance.persistence){var n,r,i=this._instance.persistence,s=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,l=a==null?void 0:a.sampleRate,u=sn(l)?null:parseFloat(l);sn(u)&&this.$r();var d=a==null?void 0:a.minimumDurationMilliseconds;i.register({[pE]:Ze({enabled:!!a},a,{networkPayloadCapture:Ze({capturePerformance:e.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:u,minimumDurationMilliseconds:qe(d)?null:d,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers})})};s(),(n=this.br)==null||n.call(this),this.br=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.kr(e),this.mr=!0,this.startIfEnabledOrStop()):this.mr=!0:ef.info("skipping remote config with no sessionRecording",e)}log(e,n){var r;n===void 0&&(n="log"),(r=this._r)!=null&&r.log?this._r.log(e,n):ef.warn("log called before recorder was ready")}get Sr(){var e,n,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(pE);return(r==null||(n=r.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}Er(e){var n,r;if((n=vt.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this._r||(this._r=(r=vt.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this._r._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this._r.start(e)}onRRwebEmit(e){var n;(n=this._r)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this._r||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this._r)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this._r||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this._r)==null||e.overrideSampling()}overrideTrigger(e){var n,r;this._r||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this._r)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this._r)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var r;return!((r=this._r)==null||!r.tryAddCustomEvent(e,n))}}var $f={},T3=()=>{},Wc="posthog",oL=!G0e&&(Bi==null?void 0:Bi.indexOf("MSIE"))===-1&&(Bi==null?void 0:Bi.indexOf("Mozilla"))===-1,OC=t=>{var e;return Ze({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ude(Ve==null?void 0:Ve.location),persistence:"localStorage+cookie",persistence_name:"",loaded:T3,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:Ui&&Or(Ui==null?void 0:Ui.search)&&Ui.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(be==null||(e=be.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;Ye.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:_3},error_tracking:{},_onCapture:T3,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},RC=t=>{var e={};qe(t.process_person)||(e.person_profiles=t.process_person),qe(t.xhr_headers)||(e.request_headers=t.xhr_headers),qe(t.cookie_name)||(e.persistence_name=t.cookie_name),qe(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),qe(t.store_google)||(e.save_campaign_params=t.store_google),qe(t.verbose)||(e.debug=t.verbose);var n=ur({},e,t);return an(t.property_blacklist)&&(qe(t.property_denylist)?n.property_denylist=t.property_blacklist:an(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:Ye.error("Invalid value for property_denylist config: "+t.property_denylist)),n};class yfe{constructor(){this.__forceAllowLocalhost=!1}get Pr(){return this.__forceAllowLocalhost}set Pr(e){Ye.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Cb{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new yfe,this.Tr=!1,this.version=no.LIB_VERSION,this.Rr=new Nx,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=OC(),this.SentryIntegration=m0e,this.sentryIntegration=e=>function(n,r){var i=AI(n,r);return{name:CI,processEvent:s=>i(s)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Cr=!1,this.Ir=null,this.Fr=null,this.Mr=null,this.featureFlags=new X0e(this),this.toolbar=new b0e(this),this.scrollManager=new cfe(this),this.pageViewManager=new B0e(this),this.surveys=new ife(this),this.productTours=new Z0e(this),this.experiments=new oi(this),this.exceptions=new Y0e(this),this.rateLimiter=new sfe(this),this.requestRouter=new pfe(this),this.consent=new u0e(this),this.externalIntegrations=new vfe(this),this.people={set:(e,n,r)=>{var i=Or(e)?{[e]:n}:e;this.setPersonProperties(i),r==null||r({})},set_once:(e,n,r)=>{var i=Or(e)?{[e]:n}:e;this.setPersonProperties(void 0,i),r==null||r({})}},this.on("eventCaptured",e=>Ye.info('send "'+(e==null?void 0:e.event)+'"',e))}init(e,n,r){if(r&&r!==Wc){var i,s=(i=$f[r])!==null&&i!==void 0?i:new Cb;return s._init(e,n,r),$f[r]=s,$f[Wc][r]=s,s}return this._init(e,n,r)}_init(e,n,r){var i;if(n===void 0&&(n={}),qe(e)||n3(e))return Ye.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Or(n.debug),this.Ar=n,this.Dr=[],n.person_profiles&&(this.Fr=n.person_profiles),this.set_config(ur({},OC(n.defaults),RC(n),{name:r,token:e})),this.config.on_xhr_error&&Ye.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:oo.GZipJS;var s=this.jr();this.persistence=new wE(this.config,s),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new wE(Ze({},this.config,{persistence:"sessionStorage"}),s);var a=Ze({},this.persistence.props),l=Ze({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Lr=new ofe(A=>this.Nr(A),this.config.request_queue_config),this.Ur=new ufe(this),this.__request_queue=[];var u=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new AC(this),this.sessionPropsManager=new CC(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Ye.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.zr(u)},0)):(Ye.info("Initializing extensions synchronously"),this.zr(u)),no.DEBUG=no.DEBUG||this.config.debug,no.DEBUG&&Ye.info("Starting in debug mode",{this:this,config:n,thisC:Ze({},this.config),p:a,s:l}),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var d,h,p=this.config.get_device_id(Tl()),g=(d=n.bootstrap)!=null&&d.isIdentifiedID?p:n.bootstrap.distinctID;this.persistence.set_property(ro,(h=n.bootstrap)!=null&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:g})}if(this.Hr()){var b,y,E=Object.keys(((b=n.bootstrap)==null?void 0:b.featureFlags)||{}).filter(A=>{var R;return!((R=n.bootstrap)==null||(R=R.featureFlags)==null||!R[A])}).reduce((A,R)=>{var z;return A[R]=((z=n.bootstrap)==null||(z=z.featureFlags)==null?void 0:z[R])||!1,A},{}),T=Object.keys(((y=n.bootstrap)==null?void 0:y.featureFlagPayloads)||{}).filter(A=>E[A]).reduce((A,R)=>{var z,I;return(z=n.bootstrap)!=null&&(z=z.featureFlagPayloads)!=null&&z[R]&&(A[R]=(I=n.bootstrap)==null||(I=I.featureFlagPayloads)==null?void 0:I[R]),A},{});this.featureFlags.receivedFeatureFlags({featureFlags:E,featureFlagPayloads:T})}if(u)this.register_once({distinct_id:G0,$device_id:null},"");else if(!this.get_distinct_id()){var S=this.config.get_device_id(Tl());this.register_once({distinct_id:S,$device_id:S},""),this.persistence.set_property(ro,"anonymous")}return Er(be,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?p0e(this,()=>this.Br()):this.Br(),Cl(this.config._onCapture)&&this.config._onCapture!==T3&&(Ye.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",A=>this.config._onCapture(A.event,A))),this.config.ip&&Ye.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}zr(e){var n=performance.now();this.historyAutocapture=new h0e(this),this.historyAutocapture.startIfEnabled();var r=[];r.push(()=>{new y0e(this).startIfEnabledOrStop()}),r.push(()=>{var i;this.siteApps=new hfe(this),(i=this.siteApps)==null||i.init()}),e||r.push(()=>{this.sessionRecording=new MC(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||r.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.push(()=>{this.autocapture=new t0e(this),this.autocapture.startIfEnabled()}),r.push(()=>{this.surveys.loadIfEnabled()}),r.push(()=>{this.productTours.loadIfEnabled()}),r.push(()=>{this.heatmaps=new P0e(this),this.heatmaps.startIfEnabled()}),r.push(()=>{this.webVitalsAutocapture=new I0e(this)}),r.push(()=>{this.exceptionObserver=new f0e(this),this.exceptionObserver.startIfEnabled()}),r.push(()=>{this.deadClicksAutocapture=new kI(this,d0e),this.deadClicksAutocapture.startIfEnabled()}),r.push(()=>{if(this.qr){var i=this.qr;this.qr=void 0,this.fi(i)}}),this.Wr(r,n)}Wr(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.Wr(e,n)},0);var r=e.shift();if(r)try{r()}catch(s){Ye.error("Error initializing extension:",s)}}var i=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&Ye.info("PostHog extensions initialized ("+i+"ms)")}fi(e){var n,r,i,s,a,l,u,d;if(!Ve||!Ve.body)return Ye.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.fi(e)},500);this.config.__preview_deferred_init_extensions&&(this.qr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=jt(e.supportedCompression,oo.GZipJS)?oo.GZipJS:jt(e.supportedCompression,oo.Base64)?oo.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Fr?this.Fr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(i=this.sessionRecording)==null||i.onRemoteConfig(e),(s=this.autocapture)==null||s.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.productTours.onRemoteConfig(e),(l=this.webVitalsAutocapture)==null||l.onRemoteConfig(e),(u=this.exceptionObserver)==null||u.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(d=this.deadClicksAutocapture)==null||d.onRemoteConfig(e)}Br(){try{this.config.loaded(this)}catch(e){Ye.critical("`loaded` function failed",e)}this.Gr(),this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Vr()},1),new afe(this).load(),this.featureFlags.flags()}Gr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Lr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Nl(this.__request_queue,e=>this.Nr(e)),this.__request_queue=[],this.Gr()}_handle_unload(){var e,n;this.config.request_batching?(this.Jr()&&this.capture("$pageleave"),(e=this.Lr)==null||e.unload(),(n=this.Ur)==null||n.unload()):this.Jr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(oL?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=L1(e.url,{ip:this.config.ip?1:0}),e.headers=Ze({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,i,s,a=Ze({},n);a.timeout=a.timeout||6e4,a.url=L1(a.url,{_:new Date().getTime().toString(),ver:no.LIB_VERSION,compression:a.compression});var l=(r=a.transport)!==null&&r!==void 0?r:"fetch",u=cg.filter(h=>!a.disableTransport||!h.transport||!a.disableTransport.includes(h.transport)),d=(i=(s=oI(u,h=>h.transport===l))==null?void 0:s.method)!==null&&i!==void 0?i:u[0].method;if(!d)throw new Error("No available transport method");d(a)})(Ze({},e,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(i=this.config).on_request_error)==null||r.call(i,n)),e.callback==null||e.callback(n)}}))))}Nr(e){this.Ur?this.Ur.retriableRequest(e):this.ci(e)}_execute_array(e){var n,r=[],i=[],s=[];Nl(e,l=>{l&&(n=l[0],an(n)?s.push(l):Cl(l)?l.call(this):an(l)&&n==="alias"?r.push(l):an(l)&&n.indexOf("capture")!==-1&&Cl(this[n])?s.push(l):i.push(l))});var a=function(l,u){Nl(l,function(d){if(an(d[0])){var h=u;An(d,function(p){h=h[p[0]].apply(h,p.slice(1))})}else this[d[0]].apply(this,d.slice(1))},u)};a(r,this),a(i,this),a(s,this)}Hr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Lr){if(this.is_capturing())if(!qe(e)&&Or(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var a=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){n!=null&&n.$current_url&&!Or(n==null?void 0:n.$current_url)&&(Ye.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,u=(r==null?void 0:r.timestamp)||l,d=Tl(),h={uuid:d,event:e,properties:this.calculateEventProperties(e,n||{},u,d)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&s&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),a&&(h.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),r!=null&&r.$set&&(h.$set=r==null?void 0:r.$set);var p,g=e!=="$groupidentify",b=this.Kr(r==null?void 0:r.$set_once,g);if(b&&(h.$set_once=b),(h=zde(h,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,qe(r==null?void 0:r.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=l),e===dg.DISMISSED||e===dg.SENT){var y=n==null?void 0:n[SC.SURVEY_ID],E=n==null?void 0:n[SC.SURVEY_ITERATION];p={id:y,current_iteration:E},localStorage.getItem(wC(p))||localStorage.setItem(wC(p),"true"),h.$set=Ze({},h.$set,{[efe({id:y,current_iteration:E},e===dg.SENT?"responded":"dismissed")]:!0})}var T=Ze({},h.properties.$set,h.$set);if(Qc(T)||this.setPersonPropertiesForFlags(T),!sn(this.config.before_send)){var S=this.Yr(h);if(!S)return;h=S}this.Rr.emit("eventCaptured",h);var A={method:"POST",url:(i=r==null?void 0:r._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Nr(A):this.Lr.enqueue(A),h}Ye.critical("This capture call is ignored due to client rate limiting.")}}else Ye.error("No event name provided to posthog.capture")}else Ye.uninitializedWarning("posthog.capture")}Ui(e){return this.on("eventCaptured",n=>e(n.event,n))}calculateEventProperties(e,n,r,i,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var a=s?void 0:this.persistence.remove_event_timer(e),l=Ze({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(l.$cookieless_mode=!0),e==="$snapshot"){var u=Ze({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!Or(l.distinct_id)&&!Ta(l.distinct_id)||n3(l.distinct_id))&&Ye.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var d,h=D0e(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:p,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());l.$session_id=p,l.$window_id=g}this.sessionPropsManager&&ur(l,this.sessionPropsManager.getSessionProps());try{var b;this.sessionRecording&&ur(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(b=this.Ur)==null?void 0:b.length}catch(S){l.$sdk_debug_error_capturing_properties=String(S)}if(this.requestRouter.region===gf.CUSTOM&&(l.$lib_custom_api_host=this.config.api_host),d=e!=="$pageview"||s?e!=="$pageleave"||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),l=ur(l,d),e==="$pageview"&&Ve&&(l.title=Ve.title),!qe(a)){var y=r.getTime()-a;l.$duration=parseFloat((y/1e3).toFixed(3))}Bi&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser"),(l=ur({},h,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),an(this.config.property_denylist)?An(this.config.property_denylist,function(S){delete l[S]}):Ye.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(Ye.error("sanitize_properties is deprecated. Use before_send instead"),l=E(l,e));var T=this.Xr();return l.$process_person_profile=T,T&&!s&&this.Qr("_calculate_event_properties"),l}Kr(e,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.Xr()||this.Tr)return e;var i=this.persistence.get_initial_props(),s=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),a=ur({},i,s||{},e||{}),l=this.config.sanitize_properties;return l&&(Ye.error("sanitize_properties is deprecated. Use before_send instead"),a=l(a,"$set_once")),n&&(this.Tr=!0),Qc(a)?void 0:a}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var i;(i=this.persistence)==null||i.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Zr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Rr.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=nfe),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,r){if(!this.__loaded||!this.persistence)return Ye.uninitializedWarning("posthog.identify");if(Ta(e)&&(e=e.toString(),Ye.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Ye.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==G0){if(this.Qr("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==i&&e!==this.get_property(cf)&&(this.unregister(cf),this.register({distinct_id:e}));var a=(this.persistence.get_property(ro)||"anonymous")==="anonymous";e!==i&&a?(this.persistence.set_property(ro,"identified"),this.setPersonPropertiesForFlags(Ze({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.Mr=yC(e,n,r),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(w1))}}else Ye.critical('The string "'+G0+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Ye.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Qr("posthog.setPersonProperties")){var r=yC(this.get_distinct_id(),e,n);this.Mr!==r?(this.setPersonPropertiesForFlags(Ze({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Mr=r):Ye.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,r){if(e&&n){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:Ze({},i,{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),i[e]===n||r||this.reloadFeatureFlags()}else Ye.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Qr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,r,i,s;if(Ye.info("reset"),!this.__loaded)return Ye.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(ro,"anonymous"),(s=this.sessionManager)==null||s.resetSessionId(),this.Mr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:G0,$device_id:null},"");else{var l=this.config.get_device_id(Tl());this.register_once({distinct_id:l,$device_id:e?l:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var s,a=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0)}return i}alias(e,n){return e===this.get_property(lI)?(Ye.critical("Attempting to create alias for existing People user - aborting."),-2):this.Qr("posthog.alias")?(qe(n)&&(n=this.get_distinct_id()),e!==n?(this.Zr(cf,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(Ye.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=Ze({},this.config);if(Ur(e)){var r,i,s,a,l;ur(this.config,RC(e));var u=this.jr();(r=this.persistence)==null||r.update_config(this.config,n,u),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new wE(Ze({},this.config,{persistence:"sessionStorage"}),u);var d=this.Or(this.config.debug);Al(d)&&(this.config.debug=d),Al(this.config.debug)&&(this.config.debug?(no.DEBUG=!0,Wn.H()&&Wn.G("ph_debug","true"),Ye.info("set_config",{config:e,oldConfig:n,newConfig:Ze({},this.config)})):(no.DEBUG=!1,Wn.H()&&Wn.V("ph_debug"))),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.ts(),(l=this.externalIntegrations)==null||l.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,r={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var i,s,a,l,u;(i=this.sessionManager)==null||i.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),r.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("url")),r.event_trigger&&((u=this.sessionRecording)==null||u.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(Ze({},i,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Wc;return n!==Wc&&(n=Wc+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(ro))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(ro))==="identified"}Xr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Qc(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[cf])&&((n=this.persistence)==null||(n=n.props)==null||!n[C1]))}Jr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Xr()||this.Qr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Qr(e){return this.config.person_profiles==="never"?(Ye.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Zr(C1,!0),!0)}jr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}ts(){var e,n,r,i,s=this.jr();return((e=this.persistence)==null?void 0:e.wi)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.wi)!==s&&((i=this.sessionPersistence)==null||i.set_disabled(s)),s}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var r,i;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),this.sessionManager=new AC(this),this.persistence&&(this.sessionPropsManager=new CC(this,this.sessionManager,this.persistence)),this.sessionRecording=new MC(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.ts(),this.Gr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(qe(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((i=e==null?void 0:e.captureEventName)!==null&&i!==void 0?i:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vr()}else Ye.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.ts(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:G0,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Vr())):Ye.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===io.GRANTED?"granted":e===io.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ts()}_is_bot(){return as?aL(as,this.config.custom_blocked_useragents):void 0}Vr(){Ve&&(Ve.visibilityState==="visible"?this.Cr||(this.Cr=!0,this.capture("$pageview",{title:Ve.title},{send_instantly:!0}),this.Ir&&(Ve.removeEventListener("visibilitychange",this.Ir),this.Ir=null)):this.Ir||(this.Ir=this.Vr.bind(this),Er(Ve,"visibilitychange",this.Ir)))}debug(e){e===!1?(be==null||be.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(be==null||be.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,n,r,i,s,a,l,u=this.Ar||{};return"advanced_disable_flags"in u?!!u.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Ye.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,s=Ye,a=(n="advanced_disable_flags")in(e=u)&&!qe(e[n]),l=r in e&&!qe(e[r]),a?e[n]:l?(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]):i)}Yr(e){if(sn(this.config.before_send))return e;var n=an(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),sn(r)){var s="Event '"+e.event+"' was rejected in beforeSend function";return dde(e.event)?Ye.warn(s+". This can cause unexpected behavior."):Ye.info(s),null}r.properties&&!Qc(r.properties)||Ye.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Or(e){var n=Al(e)&&!e,r=Wn.H()&&Wn.q("ph_debug")==="true";return!n&&(!!r||e)}}(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=Bde(t.prototype[e[n]])})(Cb,["identify"]);var DC,jh=(DC=$f[Wc]=new Cb,function(){function t(){t.done||(t.done=!0,oL=!1,An($f,function(e){e._dom_loaded()}))}Ve!=null&&Ve.addEventListener?Ve.readyState==="complete"?t():Er(Ve,"DOMContentLoaded",t,{capture:!1}):be&&Ye.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),DC);let Ed=!1;function Efe(){Ed||(jh.init("phc_2qafhOCTgCnygXsPEHOA0RBtJf5nvVsi7yIene4DWaF",{api_host:"https://us.i.posthog.com",person_profiles:"identified_only",capture_pageview:!0,capture_pageleave:!0,autocapture:!1,persistence:"localStorage",loaded:t=>{var e,n;(n=(e=import.meta)==null?void 0:e.env)!=null&&n.DEV&&console.log("[PostHog] Initialized in development mode")}}),Ed=!0)}function _fe(t,e={}){var i,s,a,l,u;if(!t||!Ed)return;const n={email:((i=t.primaryEmailAddress)==null?void 0:i.emailAddress)||((a=(s=t.emailAddresses)==null?void 0:s[0])==null?void 0:a.emailAddress),name:t.fullName||`${t.firstName||""} ${t.lastName||""}`.trim(),first_name:t.firstName,last_name:t.lastName,avatar_url:t.imageUrl,created_at:t.createdAt,...e},r=Object.fromEntries(Object.entries(n).filter(([d,h])=>h!=null&&h!==""));jh.identify(t.id,r),(u=(l=import.meta)==null?void 0:l.env)!=null&&u.DEV&&console.log("[PostHog] User identified:",t.id,r)}function xfe(){var t,e;Ed&&(jh.reset(),(e=(t=import.meta)==null?void 0:t.env)!=null&&e.DEV&&console.log("[PostHog] User reset"))}function lL(){return typeof window>"u"?"unknown":window.location.hostname}function Tfe(){var e,n;if(!Ed)return;const t=lL();jh.register({agent_domain:t,agent_subdomain:t.split(".")[0]}),(n=(e=import.meta)==null?void 0:e.env)!=null&&n.DEV&&console.log("[PostHog] Agent domain set:",t)}function kr(t,e={}){var n,r;Ed&&(jh.capture(t,{...e,agent_domain:lL()}),(r=(n=import.meta)==null?void 0:n.env)!=null&&r.DEV&&console.log("[PostHog] Event:",t,e))}function Sfe(){kr("user_signed_in")}function wfe(){kr("user_signed_out")}function kfe(t={}){kr("message_sent",{has_attachments:t.hasAttachments||!1,attachment_count:t.attachmentCount||0,message_length:t.messageLength||0,chat_id:t.chatId,is_new_chat:t.isNewChat||!1})}function Cfe(t){kr("chat_created",{chat_id:t})}function Afe(t){kr("chat_selected",{chat_id:t})}function Nfe(t){kr("chat_deleted",{chat_id:t})}function Mfe(){kr("new_chat_started")}function Ofe(t){kr("message_regenerated",{message_index:t})}function Rfe(t){kr("message_retried",{message_index:t})}function S3(){kr("generation_stopped")}function Dfe(t,e){kr("file_upload_started",{file_name:t,file_type:e})}function Ife(t,e){kr("file_upload_completed",{file_name:t,file_type:e})}function Lfe(t,e){kr("file_upload_failed",{file_name:t,error_message:e})}function IC(t){kr("tier_modal_shown",{tier:t})}function Pfe(t){kr("tier_modal_dismissed",{tier:t})}function Bfe(t){kr("upgrade_clicked",{tier:t})}function zfe(t){kr("free_limit_reached",{message_count:t})}function NE(t,e,n={}){kr("error_occurred",{error_type:t,error_message:e,...n})}function Ffe(){kr("sidebar_opened")}function LC(){kr("sidebar_closed")}const Ufe=({messages:t,setMessages:e,setShouldFocus:n,setIsLoading:r,setUploadProgress:i,setIsUserScrolled:s,onFirstSend:a,auth:l,org:u,getToken:d,setActive:h,activeChatId:p,setActiveChatId:g,onMessageSuccess:b,analyticsEnabled:y,onCanvasEvent:E})=>{const T=U.useRef(null),S=U.useCallback(async R=>{const z=typeof R=="object"&&R!==null,I=z?R.text||"":String(R||""),P=z?R.files||[]:[];if(!I.trim()&&P.length===0){n(!0);return}if(I===":clear"&&P.length===0){e([]),g(null),Mr.setActiveChat(""),window.scrollTo(0,0);return}t.length===0&&a(),r(!0),s(!1);const $=[];for(let ne=0;ne<P.length;ne++){const he=P[ne];try{i({fileName:he.name,progress:0}),y&&Dfe(he.name,he.type);const Oe=await Ite(he,d);i({fileName:he.name,progress:100}),y&&Ife(he.name,he.type),$.push(Oe),setTimeout(()=>i(null),500)}catch(Oe){console.error("Upload error:",Oe),y&&Lfe(he.name,Oe.message),i(null),r(!1),e(N=>[...N,{role:"user",content:I},{role:"assistant",parts:[],error:{type:"server",message:"Failed to upload "+he.name+": "+Oe.message,status:null}}]);return}}let K=I;if($.length>0){const ne=`<!--cycls:attachments
`+JSON.stringify($)+`
cycls:attachments-->`;K=I+`

`+ne}const Z={role:"user",content:K},W={role:"assistant",parts:[]};e(ne=>[...ne,Z,W]);const re=[...t,Z];let ie=p;const ye=!ie;ie?Mr.updateChat(ie,re):(ie=Mr.createChat(re).id,g(ie),y&&Cfe(ie)),y&&kfe({hasAttachments:$.length>0,attachmentCount:$.length,messageLength:I.length,chatId:ie,isNewChat:ye}),T.current=new AbortController;let ae=!1,de=null;const J=()=>{de&&clearTimeout(de),de=setTimeout(()=>{T.current&&(ae=!0,T.current.abort())},3e5)};J();try{let ne=null,he=null,Oe=null;await Z4({messages:re,auth:l,getToken:d,setActive:h,org:u,onPart:X=>{if(J(),X.type==="canvas"){E&&E(X),e(me=>{const B=[...me],Ee=B[B.length-1];return Ee.parts||(Ee.parts=[]),X.open===!0&&(Oe={type:"canvas",title:X.title||"Untitled",content:"",_complete:!1},Ee.parts.push(Oe)),X.content&&Oe&&(Oe.content+=X.content),X.done===!0&&Oe&&(Oe._complete=!0),B});return}e(me=>{const B=[...me],Ee=B[B.length-1];return Ee.parts||(Ee.parts=[]),X.type==="step"?(he||(he={type:"steps",steps:[]},Ee.parts.push(he)),(X.step||X.data!==void 0)&&he.steps.push({step:X.step||"",data:X.data!==void 0?X.data:null,result:X.result,_complete:!0}),ne=null,B):(he=null,ne&&ne.type===X.type?X.row?ne.rows.push(X.row):X.type==="text"&&X.text?ne.text+=X.text:X.type==="thinking"&&X.thinking?ne.thinking+=X.thinking:X.type==="code"&&X.code&&(ne.code+=X.code):(ne&&ne.type==="thinking"&&(ne._complete=!0,ne._startTime&&(ne._duration=Math.round((Date.now()-ne._startTime)/1e3))),ne={...X},X.headers&&(ne.rows=[]),X.type==="thinking"&&(ne._startTime=Date.now()),Ee.parts.push(ne)),B)})},signal:T.current.signal}),de&&clearTimeout(de),e(X=>{const me=[...X],B=me[me.length-1];return B!=null&&B.parts&&B.parts.forEach(Ee=>{Ee.type==="thinking"&&!Ee._complete&&(Ee._complete=!0,Ee._startTime&&(Ee._duration=Math.round((Date.now()-Ee._startTime)/1e3)))}),me});const N=[...re,W];Mr.updateChat(ie,N),b&&b(),r(!1),n(!0)}catch(ne){de&&clearTimeout(de);let he={type:"server",message:"An unexpected error occurred",status:null};if(ne.name==="AbortError")if(ae)he={type:"timeout",message:"Request timed out. The server took too long to respond."},y&&NE("timeout",he.message);else{console.log("Generation stopped by user"),y&&S3(),e(Oe=>{const N=[...Oe],X=N[N.length-1];if((X==null?void 0:X.role)==="assistant"&&X.parts){X.parts.push({type:"text",text:`

*[Generation stopped]*`});const me=t.concat([Z,X]);ie&&Mr.updateChat(ie,me)}return N}),r(!1),n(!0);return}else ne instanceof TypeError&&ne.message.includes("fetch")?(he={type:"network",message:"Network error. Please check your connection and try again."},y&&NE("network",he.message)):ne.type&&(he=ne,y&&NE(ne.type,ne.message,{status:ne.status}));console.error("Request error:",ne),e(Oe=>{const N=[...Oe],X=N[N.length-1];return(X==null?void 0:X.role)==="assistant"&&(X.error=he),N}),r(!1),n(!0)}},[t,l,u,d,h,p,g,b,y,e,n,r,i,s,a,E]),A=U.useCallback(()=>{T.current&&(T.current.abort(),T.current=null)},[]);return{send:S,handleStop:A}},Hfe=t=>{const[e,n]=U.useState(!1);return U.useEffect(()=>{const r=()=>n(window.innerWidth<768);return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e?0:t?Og.expanded:Og.collapsed},jfe=(t,e,n=null,r=!0)=>{const i=U.useRef(null);U.useEffect(()=>{!e||!r||(n?i.current!==n.id&&(_fe(n,{subscription_status:t?"paid":"free"}),i.current===null&&Sfe(),i.current=n.id):i.current!==null&&(wfe(),xfe(),i.current=null))},[n,r,t,e])},$fe=({HEADER:t,INTRO:e,AUTH:n,ORG:r,TITLE:i,TIER:s})=>C.jsx(uL,{HEADER:t,INTRO:e,AUTH:n,ORG:r,TITLE:i,TIER:s,authApi:null,clerkApi:null,userApi:{user:null,isLoaded:!0},subscription:null,isSubscriptionLoading:!1,subscriptionError:null}),qfe=({HEADER:t,INTRO:e,AUTH:n,ORG:r,TITLE:i,TIER:s})=>{const a=Eh(),l=JF(),u=eU(),{subscription:d,isLoading:h,error:p}=yne();return C.jsx(uL,{HEADER:t,INTRO:e,AUTH:n,ORG:r,TITLE:i,TIER:s,authApi:a,clerkApi:l,userApi:u,subscription:d,isSubscriptionLoading:h,subscriptionError:p})},PC=t=>C.jsx(Vte,{children:t.AUTH?C.jsx(qfe,{...t}):C.jsx($fe,{...t})}),uL=({HEADER:t,INTRO:e,AUTH:n,ORG:r,TITLE:i,TIER:s,authApi:a,clerkApi:l,userApi:u,subscription:d,isSubscriptionLoading:h,subscriptionError:p})=>{const g=_B(),b=(a==null?void 0:a.getToken)||null,{state:y,openCanvas:E,appendContent:T,markDone:S,closeCanvas:A}=Dd(),{chatWidthPercent:R,isMobile:z}=gO(y.isOpen),[I,P]=U.useState([]),[$,K]=U.useState(!1),[Z,W]=U.useState(!1),[re,ie]=U.useState(null),[ye,ae]=U.useState(!1),[de,J]=U.useState(!1),[ne,he]=U.useState(null),Oe=U.useRef(null),[N,X]=U.useState(!1),[me,B]=U.useState([]),[Ee,Qe]=U.useState(null),Fe=Hfe(N),[Ft,ut]=U.useState(!1),[en,Nt]=U.useState(0),Mn=5,Vr=U.useCallback(()=>{ut(!1),g&&Pfe(s)},[s,g]),gt=U.useMemo(()=>{var Be,Yt,On;return d?((On=(Yt=(Be=d==null?void 0:d.subscriptionItems)==null?void 0:Be[0])==null?void 0:Yt.plan)==null?void 0:On.name)==="Cycls Pass":!1},[d]),St=U.useMemo(()=>{var Be,Yt,On;return d&&((On=(Yt=(Be=d==null?void 0:d.subscriptionItems)==null?void 0:Be[0])==null?void 0:Yt.plan)==null?void 0:On.name)||null},[d]);jfe(n&&gt,g&&n,(u==null?void 0:u.user)||null,(u==null?void 0:u.isLoaded)??!0);const Gt=U.useMemo(()=>!n||s!=="cycls_pass"||gt?!1:en>=Mn,[n,s,gt,en,Mn]);U.useEffect(()=>{gt&&(ade(),Nt(0),ut(!1))},[gt]),U.useEffect(()=>{const Be=Mr.getAllChats();B(Be),Nt(ZD())},[]),U.useEffect(()=>{I.length>0&&Ee&&(Mr.updateChat(Ee,I),B(Mr.getAllChats()))},[I,Ee]),U.useEffect(()=>{document.title=i},[i]),U.useEffect(()=>{const Be=()=>{const Yt=window.scrollY||document.documentElement.scrollTop,On=document.documentElement.scrollHeight,hr=window.innerHeight,Cr=On-Yt-hr<100;J(!Cr)};return window.addEventListener("scroll",Be),()=>window.removeEventListener("scroll",Be)},[]),U.useEffect(()=>{!de&&Oe.current&&Oe.current.scrollIntoView({behavior:"smooth"})},[I,de]),U.useEffect(()=>{if($){const Be=document.querySelector("textarea");Be==null||Be.focus(),K(!1)}},[$]);const tt=U.useCallback(()=>{if(!n||s!=="cycls_pass"||gt)return;const Be=sde();Nt(Be),Be>=Mn&&(ut(!0),g&&zfe(Be),g&&IC(s))},[n,s,gt,Mn,g]),kt=U.useCallback(Be=>{Be.open===!0&&E({title:Be.title||"Untitled"}),Be.content&&T(Be.content),Be.done===!0&&S(),Be.open===!1&&A()},[E,T,S,A]),{send:fn,handleStop:qt}=Ufe({messages:I,setMessages:P,setShouldFocus:K,setIsLoading:W,setUploadProgress:ie,setIsUserScrolled:J,onFirstSend:()=>ae(!0),auth:n,org:r,getToken:a==null?void 0:a.getToken,setActive:l==null?void 0:l.setActive,activeChatId:Ee,setActiveChatId:Qe,onMessageSuccess:tt,analyticsEnabled:g,onCanvasEvent:kt}),hn=U.useCallback(()=>{P([]),Qe(null),ae(!1),Mr.setActiveChat(""),window.scrollTo(0,0),g&&Mfe()},[g]),fr=U.useCallback(Be=>{const Yt=Mr.getChat(Be);Yt&&(P(Yt.messages),Qe(Be),ae(Yt.messages.length>0),Mr.setActiveChat(Be),window.innerWidth<768&&X(!1),window.scrollTo(0,0),g&&Afe(Be))},[g]),ea=U.useCallback(Be=>{Mr.deleteChat(Be),B(Mr.getAllChats()),g&&Nfe(Be),Be===Ee&&hn()},[Ee,hn,g]),fs=U.useCallback(()=>{const Be=!N;X(Be),g&&(Be?Ffe():LC())},[N,g]),ri=U.useCallback(()=>{X(!1),g&&LC()},[g]),ir=U.useCallback(async Be=>{const Yt=Be-1;if(Yt<0)return;g&&Ofe(Be),P(ft=>{const Wt=[...ft],ze=Wt[Be];return((ze==null?void 0:ze.type)==="response"||(ze==null?void 0:ze.role)==="assistant")&&(Wt[Be]={role:"assistant",parts:[]}),Wt});const On=I[Yt];if(!(On.type==="request"||On.role==="user"))return;const Cr=I.slice(0,Be);W(!0),J(!1);const sr=new AbortController;let Tn=!1,tn=null;const ar=()=>{tn&&clearTimeout(tn),tn=setTimeout(()=>{Tn=!0,sr.abort()},3e5)};ar();try{let ft=null,Wt=null;await Z4({messages:Cr,auth:n,getToken:a==null?void 0:a.getToken,setActive:l==null?void 0:l.setActive,org:r,onPart:ze=>{ar(),P(pn=>{const Sn=[...pn],q=Sn[Be];return q.parts||(q.parts=[]),ze.type==="step"?(Wt||(Wt={type:"steps",steps:[]},q.parts.push(Wt)),(ze.step||ze.data!==void 0)&&Wt.steps.push({step:ze.step||"",data:ze.data!==void 0?ze.data:null,result:ze.result,_complete:!0}),ft=null,Sn):(Wt=null,ft&&ft.type===ze.type?ze.row?ft.rows.push(ze.row):ze.type==="text"&&ze.text?ft.text+=ze.text:ze.type==="thinking"&&ze.thinking?ft.thinking+=ze.thinking:ze.type==="code"&&ze.code&&(ft.code+=ze.code):(ft&&ft.type==="thinking"&&(ft._complete=!0,ft._startTime&&(ft._duration=Math.round((Date.now()-ft._startTime)/1e3))),ft={...ze},ze.headers&&(ft.rows=[]),ze.type==="thinking"&&(ft._startTime=Date.now()),q.parts.push(ft)),Sn)})},signal:sr.signal}),tn&&clearTimeout(tn),P(ze=>{const pn=[...ze],Sn=pn[Be];return Sn!=null&&Sn.parts&&Sn.parts.forEach(q=>{q.type==="thinking"&&!q._complete&&(q._complete=!0,q._startTime&&(q._duration=Math.round((Date.now()-q._startTime)/1e3)))}),pn}),Ee&&P(ze=>(Mr.updateChat(Ee,ze),B(Mr.getAllChats()),ze)),W(!1),K(!0)}catch(ft){if(tn&&clearTimeout(tn),ft.name==="AbortError"&&!Tn){g&&S3(),P(Wt=>{const ze=[...Wt],pn=ze[Be];return pn!=null&&pn.parts&&pn.parts.push({type:"text",text:`

*[Generation stopped]*`}),Ee&&Mr.updateChat(Ee,ze),ze}),W(!1),K(!0);return}console.error("Regeneration error:",ft),P(Wt=>{const ze=[...Wt];return ze[Be].error={type:"server",message:ft.message||"Error"},ze}),W(!1)}},[I,n,r,a==null?void 0:a.getToken,l==null?void 0:l.setActive,Ee,g]),ge=U.useCallback(async Be=>{const Yt=Be-1;if(Yt<0)return;g&&Rfe(Be),he(Be),P(ft=>{const Wt=[...ft],ze=Wt[Be];return((ze==null?void 0:ze.type)==="response"||(ze==null?void 0:ze.role)==="assistant")&&(Wt[Be]={role:"assistant",parts:[]}),Wt});const On=I[Yt];if(!(On.type==="request"||On.role==="user")){he(null);return}const Cr=I.slice(0,Be);W(!0),J(!1);const sr=new AbortController;let Tn=!1,tn=null;const ar=()=>{tn&&clearTimeout(tn),tn=setTimeout(()=>{Tn=!0,sr.abort()},3e5)};ar();try{let ft=null,Wt=null;await Z4({messages:Cr,auth:n,getToken:a==null?void 0:a.getToken,setActive:l==null?void 0:l.setActive,org:r,onPart:ze=>{ar(),P(pn=>{const Sn=[...pn],q=Sn[Be];return q.parts||(q.parts=[]),ze.type==="step"?(Wt||(Wt={type:"steps",steps:[]},q.parts.push(Wt)),(ze.step||ze.data!==void 0)&&Wt.steps.push({step:ze.step||"",data:ze.data!==void 0?ze.data:null,result:ze.result,_complete:!0}),ft=null,Sn):(Wt=null,ft&&ft.type===ze.type?ze.row?ft.rows.push(ze.row):ze.type==="text"&&ze.text?ft.text+=ze.text:ze.type==="thinking"&&ze.thinking?ft.thinking+=ze.thinking:ze.type==="code"&&ze.code&&(ft.code+=ze.code):(ft&&ft.type==="thinking"&&(ft._complete=!0,ft._startTime&&(ft._duration=Math.round((Date.now()-ft._startTime)/1e3))),ft={...ze},ze.headers&&(ft.rows=[]),ze.type==="thinking"&&(ft._startTime=Date.now()),q.parts.push(ft)),Sn)})},signal:sr.signal}),tn&&clearTimeout(tn),P(ze=>{const pn=[...ze],Sn=pn[Be];return Sn!=null&&Sn.parts&&Sn.parts.forEach(q=>{q.type==="thinking"&&!q._complete&&(q._complete=!0,q._startTime&&(q._duration=Math.round((Date.now()-q._startTime)/1e3)))}),pn}),Ee&&P(ze=>(Mr.updateChat(Ee,ze),B(Mr.getAllChats()),ze)),W(!1),he(null),K(!0)}catch(ft){if(tn&&clearTimeout(tn),ft.name==="AbortError"&&!Tn){g&&S3(),P(Wt=>{const ze=[...Wt],pn=ze[Be];return pn!=null&&pn.parts&&pn.parts.push({type:"text",text:`

*[Generation stopped]*`}),Ee&&Mr.updateChat(Ee,ze),ze}),W(!1),he(null),K(!0);return}console.error("Retry error:",ft),P(Wt=>{const ze=[...Wt];return ze[Be].error={type:"server",message:ft.message||"Error"},ze}),W(!1),he(null)}},[I,n,r,a==null?void 0:a.getToken,l==null?void 0:l.setActive,Ee,g]),we=U.useCallback(()=>{ut(!0),g&&(Bfe(s),IC(s))},[s,g]),rt=I.length===0,st=n?C.jsx(XU,{appearance:{elements:{avatarBox:"w-6 h-6",userButtonTrigger:"focus:shadow-none"}}}):null;return C.jsx(cO.Provider,{value:b,children:C.jsxs("div",{className:"min-h-screen theme-transition",style:{backgroundColor:"var(--bg-primary)"},children:[C.jsx(pO,{isAuthenticated:n&&(a==null?void 0:a.isSignedIn),isPublic:!n,meta:{title:i,description:t}}),C.jsx(mne,{isOpen:N,onClose:ri,onToggle:fs,chats:me,activeChat:Ee,onSelectChat:fr,onNewChat:hn,onDeleteChat:ea,user:u==null?void 0:u.user,isOnPaidPlan:gt,tierName:St,UserButtonComponent:st,isAuthenticated:n}),C.jsx(gne,{open:Ft&&s==="cycls_pass",onClose:Vr,tier:s||"Pro"}),C.jsxs("main",{className:"min-h-screen transition-all duration-300 ease-in-out",style:{marginLeft:`${Fe}px`,width:y.isOpen&&!z?`calc(${R}% - ${Fe}px)`:`calc(100% - ${Fe}px)`},children:[C.jsx("div",{className:"p-10",children:C.jsxs("div",{className:"fixed max-sm:top-[2%] max-sm:right-3 top-1 right-4 flex items-center gap-2 z-20",children:[C.jsx(HC,{className:"max-sm:bg-[var(--bg-primary)] max-sm:shadow-sm max-sm:border max-sm:border-[var(--border-color)]"}),n&&C.jsxs("a",{href:"https://cycls.ai/",type:"button",className:`
                inline-flex items-center gap-2
                rounded-xl px-3 py-2
                text-sm font-medium
                hover:bg-[var(--bg-hover)]
                active:bg-[var(--bg-active)]
                transition-colors
                focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20
                max-sm:bg-[var(--bg-primary)] max-sm:shadow-sm max-sm:border max-sm:border-[var(--border-color)]
              `,style:{color:"var(--text-primary)"},children:[C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"}),C.jsx("path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"})]}),C.jsx("span",{children:"Home"})]})]})}),C.jsxs("div",{className:"mx-auto max-w-3xl min-h-screen px-4 pb-[200px] md:pb-[180px]",children:[re&&C.jsx(sne,{fileName:re.fileName,progress:re.progress}),C.jsx("div",{className:"prose m-2 mx-auto max-w-3xl p-2 prose-pre:p-0 pt-14 md:pt-2",children:C.jsx(Lu,{markdown:t,onSend:fn})}),!rt&&C.jsxs("div",{className:`transition-opacity duration-500 ${ye?"opacity-100":"opacity-0"}`,children:[C.jsx(hO,{messages:I,onSend:fn,onRegenerate:ir,onRetry:ge,retryingIndex:ne,isGenerating:Z}),C.jsx("div",{ref:Oe})]}),rt&&!ye&&e&&e.trim()!==""&&C.jsx("div",{className:"mx-auto max-w-3xl prose prose-sm prose-pre:p-0",children:C.jsx(Lu,{markdown:e,onSend:fn})})]})]}),C.jsx(nde,{}),C.jsx(ine,{onSend:fn,isLoading:Z,onStop:qt,disabled:Gt,onUpgradeClick:we,sidebarWidth:Fe,canvasOpen:y.isOpen,canvasWidthPercent:y.isOpen&&!z?100-R:0})]})})},BC=({meta:t})=>{const e=!!t.prod,n=!!t.auth,r=String(t.header??""),i=String(t.intro??""),s=String(t.title??"AI Agent"),a=t.tier||null,l=t.pk,u=t.org||void 0,d=typeof window<"u"?window.location.origin+"/":"/";if(!n)return C.jsx(PC,{HEADER:r,INTRO:i,AUTH:n,ORG:u,TITLE:s,TIER:a});const h=e?{isSatellite:!1,domain:"cycls.ai",fallbackRedirectUrl:d,forceRedirectUrl:d}:{fallbackRedirectUrl:d,forceRedirectUrl:d};return C.jsx($A,{publishableKey:l,...h,children:C.jsx(Ene,{tier:a,children:C.jsx(Lz,{children:C.jsxs(fz,{children:[C.jsx(Gm,{path:"/auth",element:C.jsx(bne,{afterUrl:d})}),C.jsx(Gm,{path:"/",element:C.jsx(vne,{children:C.jsx(PC,{HEADER:r,INTRO:i,AUTH:n,ORG:u,TITLE:s,TIER:a})})}),C.jsx(Gm,{path:"*",element:C.jsx(ZC,{to:"/",replace:!0})})]})})})})};function Vfe(){const[t,e]=le.useState({status:"loading"});return le.useEffect(()=>{const n=new AbortController;return(async()=>{try{const r=await ide(n.signal);e({status:"ready",data:r})}catch(r){e({status:"error",error:r})}})(),()=>n.abort()},[]),t}const Gfe=()=>{var n,r,i,s;const t=Vfe();if(U.useEffect(()=>{var a;t.status==="ready"&&((a=t.data)==null?void 0:a.analytics)===!0&&(Efe(),Tfe())},[t.status,(n=t.data)==null?void 0:n.analytics]),t.status==="loading")return C.jsx(Dy,{children:C.jsx("div",{className:"min-h-screen grid place-items-center text-sm",style:{backgroundColor:"var(--bg-primary)",color:"var(--text-tertiary)"},children:"Loading…"})});if(t.status==="error"){console.error("Failed to load /metadata:",t.error);const a={header:"",intro:"",prod:((i=(r=import.meta)==null?void 0:r.env)==null?void 0:i.PROD)||!1,auth:!1,title:"AI Agent",tier:null,analytics:!1};return C.jsx(Dy,{children:C.jsx(OE.Provider,{value:!1,children:C.jsx(BC,{meta:a})})})}const e=((s=t.data)==null?void 0:s.analytics)===!0;return C.jsx(Dy,{children:C.jsx(OE.Provider,{value:e,children:C.jsx(BC,{meta:t.data})})})},fg=document.getElementById("root");fg._reactRoot||(fg._reactRoot=EB.createRoot(fg));fg._reactRoot.render(C.jsx(Gfe,{}));export{E4 as _,Wfe as c,mh as g};
