@gientech/modual 2.0.11 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1398 +0,0 @@
1
- import*as k from"react";import je,{useState as Pt,useCallback as mt,useImperativeHandle as p0,forwardRef as vo,useMemo as xt,useRef as It,createContext as Zn,useEffect as lr,createElement as ts,useContext as ii,useLayoutEffect as b4,useReducer as y4,Component as x4,memo as C4}from"react";import wu,{flushSync as w4,unstable_batchedUpdates as D4,createPortal as E4}from"react-dom";import{R as $p,y as rs}from"./index-CN2AYX8Q.js";import{aR as xn,bz as k4,aE as Tp,M as $r,V as Mp,bA as m0,bB as ns,y as yr,H as wt,f as tt,aQ as Rp,A as vt,L as Te,bC as g0,bD as Ro,J as qe,_ as At,aT as Pp,a5 as Jo,G as zn,z as Ip,aF as Jn,bE as zp,bF as jp,aW as _p,aV as Lp,aX as za,t as As,p as Hp,ad as En,ac as kn,l as bo,o as oa,T as os,bG as S4,X as B4,k as Ue,af as Kp,bh as qp,g as Fs,m as Ua,bH as Wp,bb as as,$ as Vp,aJ as Du,r as si,b5 as Bo,bI as A4,W as Up,aq as wn,as as v0,bJ as Yp,be as F4,bd as N4,bg as O4,bf as $4,a0 as T4,bc as Ed,U as kd,a3 as M4,a2 as R4,ax as Ns,am as b0,bK as P4,Y as I4,bq as z4,bl as j4,B as is,N as po,bL as y0,aU as x0,bM as Sd,bN as C0,bO as Bd,bP as Ad,E as ss,bQ as Gp,a9 as ls,bR as _4,bv as Rt,bS as L4,K as H4,at as K4,aZ as q4,bT as W4,bU as V4,v as Xp,bx as Fd,bV as U4,w as Y4,aN as G4,s as X4,D as Q4,aK as Z4,c as Os}from"./index-LDFwTu47.js";import{R as J4,a as e2,S as Qp,P as Zp}from"./index-D9lYd8TZ.js";import{S as t2}from"./index-NFQIKNFn.js";function Eu(e){return e!=null&&e===e.window}const r2=e=>{var t,r;if(typeof window>"u")return 0;let n=0;return Eu(e)?n=e.pageYOffset:e instanceof Document?n=e.documentElement.scrollTop:(e instanceof HTMLElement||e)&&(n=e.scrollTop),e&&!Eu(e)&&typeof n!="number"&&(n=(r=((t=e.ownerDocument)!==null&&t!==void 0?t:e).documentElement)===null||r===void 0?void 0:r.scrollTop),n};function n2(e,t,r,n){const o=r-t;return e/=n/2,e<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t}function o2(e,t={}){const{getContainer:r=()=>window,callback:n,duration:o=450}=t,a=r(),u=r2(a),c=Date.now(),f=()=>{const m=Date.now()-c,b=n2(m>o?o:m,u,e,o);Eu(a)?a.scrollTo(window.pageXOffset,b):a instanceof Document||a.constructor.name==="HTMLDocument"?a.documentElement.scrollTop=b:a.scrollTop=b,m<o?xn(f):typeof n=="function"&&n()};xn(f)}const a2=e=>{const[t,r]=Pt(null);return[mt((o,a,u)=>{const c=t??o,f=Math.min(c||0,o),d=Math.max(c||0,o),m=a.slice(f,d+1).map(e),b=m.some(w=>!u.has(w)),g=[];return m.forEach(w=>{b?(u.has(w)||g.push(w),u.add(w)):(u.delete(w),g.push(w))}),r(b?d:null),g},[t]),r]};function i2(e,t){return e._antProxy=e._antProxy||{},Object.keys(t).forEach(r=>{if(!(r in e._antProxy)){const n=e[r];e._antProxy[r]=n,e[r]=t[r]}}),e}const s2=(e,t)=>p0(e,()=>{const r=t(),{nativeElement:n}=r;return typeof Proxy<"u"?new Proxy(n,{get(o,a){return r[a]?r[a]:Reflect.get(o,a)}}):i2(n,r)}),l2=e=>{const t=k.useRef(e),[,r]=k4();return[()=>t.current,n=>{t.current=n,r()}]};var Jp=function(t){if(Tp()&&window.document.documentElement){var r=Array.isArray(t)?t:[t],n=window.document.documentElement;return r.some(function(o){return o in n.style})}return!1},u2=function(t,r){if(!Jp(t))return!1;var n=document.createElement("div"),o=n.style[t];return n.style[t]=r,n.style[t]!==o};function c2(e,t){return!Array.isArray(e)&&t!==void 0?u2(e,t):Jp(e)}var d2=$r.ESC,f2=$r.TAB;function h2(e){var t=e.visible,r=e.triggerRef,n=e.onVisibleChange,o=e.autoFocus,a=e.overlayRef,u=k.useRef(!1),c=function(){if(t){var b,g;(b=r.current)===null||b===void 0||(g=b.focus)===null||g===void 0||g.call(b),n==null||n(!1)}},f=function(){var b;return(b=a.current)!==null&&b!==void 0&&b.focus?(a.current.focus(),u.current=!0,!0):!1},d=function(b){switch(b.keyCode){case d2:c();break;case f2:{var g=!1;u.current||(g=f()),g?b.preventDefault():c();break}}};k.useEffect(function(){return t?(window.addEventListener("keydown",d),o&&xn(f,3),function(){window.removeEventListener("keydown",d),u.current=!1}):function(){u.current=!1}},[t])}var p2=vo(function(e,t){var r=e.overlay,n=e.arrow,o=e.prefixCls,a=xt(function(){var c;return typeof r=="function"?c=r():c=r,c},[r]),u=Mp(t,m0(a));return je.createElement(je.Fragment,null,n&&je.createElement("div",{className:"".concat(o,"-arrow")}),je.cloneElement(a,{ref:ns(a)?u:void 0}))}),Wo={adjustX:1,adjustY:1},Vo=[0,0],m2={topLeft:{points:["bl","tl"],overflow:Wo,offset:[0,-4],targetOffset:Vo},top:{points:["bc","tc"],overflow:Wo,offset:[0,-4],targetOffset:Vo},topRight:{points:["br","tr"],overflow:Wo,offset:[0,-4],targetOffset:Vo},bottomLeft:{points:["tl","bl"],overflow:Wo,offset:[0,4],targetOffset:Vo},bottom:{points:["tc","bc"],overflow:Wo,offset:[0,4],targetOffset:Vo},bottomRight:{points:["tr","br"],overflow:Wo,offset:[0,4],targetOffset:Vo}},g2=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function v2(e,t){var r,n=e.arrow,o=n===void 0?!1:n,a=e.prefixCls,u=a===void 0?"rc-dropdown":a,c=e.transitionName,f=e.animation,d=e.align,m=e.placement,b=m===void 0?"bottomLeft":m,g=e.placements,w=g===void 0?m2:g,C=e.getPopupContainer,D=e.showAction,p=e.hideAction,B=e.overlayClassName,F=e.overlayStyle,S=e.visible,O=e.trigger,M=O===void 0?["hover"]:O,_=e.autoFocus,z=e.overlay,K=e.children,$=e.onVisibleChange,Q=yr(e,g2),V=je.useState(),X=wt(V,2),G=X[0],j=X[1],H="visible"in e?S:G,U=je.useRef(null),R=je.useRef(null),te=je.useRef(null);je.useImperativeHandle(t,function(){return U.current});var q=function(le){j(le),$==null||$(le)};h2({visible:H,triggerRef:te,onVisibleChange:q,autoFocus:_,overlayRef:R});var se=function(le){var ue=e.onOverlayClick;j(!1),ue&&ue(le)},ye=function(){return je.createElement(p2,{ref:R,overlay:z,prefixCls:u,arrow:o})},we=function(){return typeof z=="function"?ye:ye()},ie=function(){var le=e.minOverlayWidthMatchTrigger,ue=e.alignPoint;return"minOverlayWidthMatchTrigger"in e?le:!ue},me=function(){var le=e.openClassName;return le!==void 0?le:"".concat(u,"-open")},Oe=je.cloneElement(K,{className:tt((r=K.props)===null||r===void 0?void 0:r.className,H&&me()),ref:ns(K)?Mp(te,m0(K)):void 0}),ee=p;return!ee&&M.indexOf("contextMenu")!==-1&&(ee=["click"]),je.createElement(Rp,vt({builtinPlacements:w},Q,{prefixCls:u,ref:U,popupClassName:tt(B,Te({},"".concat(u,"-show-arrow"),o)),popupStyle:F,action:M,showAction:D,hideAction:ee,popupPlacement:b,popupAlign:d,popupTransitionName:c,popupAnimation:f,popupVisible:H,stretch:ie()?"minWidth":"",popup:we(),onPopupVisibleChange:q,onPopupClick:se,getPopupContainer:C}),Oe)}const b2=je.forwardRef(v2),y2=e=>typeof e!="object"&&typeof e!="function"||e===null;var e1=k.createContext(null);function t1(e,t){return e===void 0?null:"".concat(e,"-").concat(t)}function r1(e){var t=k.useContext(e1);return t1(t,e)}var x2=["children","locked"],Dn=k.createContext(null);function C2(e,t){var r=qe({},e);return Object.keys(t).forEach(function(n){var o=t[n];o!==void 0&&(r[n]=o)}),r}function Ya(e){var t=e.children,r=e.locked,n=yr(e,x2),o=k.useContext(Dn),a=g0(function(){return C2(o,n)},[o,n],function(u,c){return!r&&(u[0]!==c[0]||!Ro(u[1],c[1],!0))});return k.createElement(Dn.Provider,{value:a},t)}var w2=[],n1=k.createContext(null);function $s(){return k.useContext(n1)}var o1=k.createContext(w2);function ha(e){var t=k.useContext(o1);return k.useMemo(function(){return e!==void 0?[].concat(At(t),[e]):t},[t,e])}var a1=k.createContext(null),w0=k.createContext({});function Nd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Pp(e)){var r=e.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(r)||e.isContentEditable||r==="a"&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),a=Number(o),u=null;return o&&!Number.isNaN(a)?u=a:n&&u===null&&(u=0),n&&e.disabled&&(u=null),u!==null&&(u>=0||t&&u<0)}return!1}function D2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=At(e.querySelectorAll("*")).filter(function(n){return Nd(n,t)});return Nd(e,t)&&r.unshift(e),r}var ku=$r.LEFT,Su=$r.RIGHT,Bu=$r.UP,Li=$r.DOWN,Hi=$r.ENTER,i1=$r.ESC,Fa=$r.HOME,Na=$r.END,Od=[Bu,Li,ku,Su];function E2(e,t,r,n){var o,a="prev",u="next",c="children",f="parent";if(e==="inline"&&n===Hi)return{inlineTrigger:!0};var d=Te(Te({},Bu,a),Li,u),m=Te(Te(Te(Te({},ku,r?u:a),Su,r?a:u),Li,c),Hi,c),b=Te(Te(Te(Te(Te(Te({},Bu,a),Li,u),Hi,c),i1,f),ku,r?c:f),Su,r?f:c),g={inline:d,horizontal:m,vertical:b,inlineSub:d,horizontalSub:b,verticalSub:b},w=(o=g["".concat(e).concat(t?"":"Sub")])===null||o===void 0?void 0:o[n];switch(w){case a:return{offset:-1,sibling:!0};case u:return{offset:1,sibling:!0};case f:return{offset:-1,sibling:!1};case c:return{offset:1,sibling:!1};default:return null}}function k2(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function S2(e,t){for(var r=e||document.activeElement;r;){if(t.has(r))return r;r=r.parentElement}return null}function D0(e,t){var r=D2(e,!0);return r.filter(function(n){return t.has(n)})}function $d(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var o=D0(e,t),a=o.length,u=o.findIndex(function(c){return r===c});return n<0?u===-1?u=a-1:u-=1:n>0&&(u+=1),u=(u+a)%a,o[u]}var Au=function(t,r){var n=new Set,o=new Map,a=new Map;return t.forEach(function(u){var c=document.querySelector("[data-menu-id='".concat(t1(r,u),"']"));c&&(n.add(c),a.set(c,u),o.set(u,c))}),{elements:n,key2element:o,element2key:a}};function B2(e,t,r,n,o,a,u,c,f,d){var m=k.useRef(),b=k.useRef();b.current=t;var g=function(){xn.cancel(m.current)};return k.useEffect(function(){return function(){g()}},[]),function(w){var C=w.which;if([].concat(Od,[Hi,i1,Fa,Na]).includes(C)){var D=a(),p=Au(D,n),B=p,F=B.elements,S=B.key2element,O=B.element2key,M=S.get(t),_=S2(M,F),z=O.get(_),K=E2(e,u(z,!0).length===1,r,C);if(!K&&C!==Fa&&C!==Na)return;(Od.includes(C)||[Fa,Na].includes(C))&&w.preventDefault();var $=function(R){if(R){var te=R,q=R.querySelector("a");q!=null&&q.getAttribute("href")&&(te=q);var se=O.get(R);c(se),g(),m.current=xn(function(){b.current===se&&te.focus()})}};if([Fa,Na].includes(C)||K.sibling||!_){var Q;!_||e==="inline"?Q=o.current:Q=k2(_);var V,X=D0(Q,F);C===Fa?V=X[0]:C===Na?V=X[X.length-1]:V=$d(Q,F,_,K.offset),$(V)}else if(K.inlineTrigger)f(z);else if(K.offset>0)f(z,!0),g(),m.current=xn(function(){p=Au(D,n);var U=_.getAttribute("aria-controls"),R=document.getElementById(U),te=$d(R,p.elements);$(te)},5);else if(K.offset<0){var G=u(z,!0),j=G[G.length-2],H=S.get(j);f(j,!1),$(H)}}d==null||d(w)}}function A2(e){Promise.resolve().then(e)}var E0="__RC_UTIL_PATH_SPLIT__",Td=function(t){return t.join(E0)},F2=function(t){return t.split(E0)},Fu="rc-menu-more";function N2(){var e=k.useState({}),t=wt(e,2),r=t[1],n=It(new Map),o=It(new Map),a=k.useState([]),u=wt(a,2),c=u[0],f=u[1],d=It(0),m=It(!1),b=function(){m.current||r({})},g=mt(function(S,O){var M=Td(O);o.current.set(M,S),n.current.set(S,M),d.current+=1;var _=d.current;A2(function(){_===d.current&&b()})},[]),w=mt(function(S,O){var M=Td(O);o.current.delete(M),n.current.delete(S)},[]),C=mt(function(S){f(S)},[]),D=mt(function(S,O){var M=n.current.get(S)||"",_=F2(M);return O&&c.includes(_[0])&&_.unshift(Fu),_},[c]),p=mt(function(S,O){return S.filter(function(M){return M!==void 0}).some(function(M){var _=D(M,!0);return _.includes(O)})},[D]),B=function(){var O=At(n.current.keys());return c.length&&O.push(Fu),O},F=mt(function(S){var O="".concat(n.current.get(S)).concat(E0),M=new Set;return At(o.current.keys()).forEach(function(_){_.startsWith(O)&&M.add(o.current.get(_))}),M},[]);return k.useEffect(function(){return function(){m.current=!0}},[]),{registerPath:g,unregisterPath:w,refreshOverflowKeys:C,isSubPathKey:p,getKeyPath:D,getKeys:B,getSubPathKeys:F}}function Ra(e){var t=k.useRef(e);t.current=e;var r=k.useCallback(function(){for(var n,o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return(n=t.current)===null||n===void 0?void 0:n.call.apply(n,[t].concat(a))},[]);return e?r:void 0}var O2=Math.random().toFixed(5).toString().slice(2),Md=0;function $2(e){var t=Jo(e,{value:e}),r=wt(t,2),n=r[0],o=r[1];return k.useEffect(function(){Md+=1;var a="".concat(O2,"-").concat(Md);o("rc-menu-uuid-".concat(a))},[]),n}function s1(e,t,r,n){var o=k.useContext(Dn),a=o.activeKey,u=o.onActive,c=o.onInactive,f={active:a===e};return t||(f.onMouseEnter=function(d){r==null||r({key:e,domEvent:d}),u(e)},f.onMouseLeave=function(d){n==null||n({key:e,domEvent:d}),c(e)}),f}function l1(e){var t=k.useContext(Dn),r=t.mode,n=t.rtl,o=t.inlineIndent;if(r!=="inline")return null;var a=e;return n?{paddingRight:a*o}:{paddingLeft:a*o}}function u1(e){var t=e.icon,r=e.props,n=e.children,o;return t===null||t===!1?null:(typeof t=="function"?o=k.createElement(t,qe({},r)):typeof t!="boolean"&&(o=t),o||n||null)}var T2=["item"];function us(e){var t=e.item,r=yr(e,T2);return Object.defineProperty(r,"item",{get:function(){return zn(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),t}}),r}var M2=["title","attribute","elementRef"],R2=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],P2=["active"],I2=(function(e){zp(r,e);var t=jp(r);function r(){return _p(this,r),t.apply(this,arguments)}return Lp(r,[{key:"render",value:function(){var o=this.props,a=o.title,u=o.attribute,c=o.elementRef,f=yr(o,M2),d=Jn(f,["eventKey","popupClassName","popupOffset","onTitleClick"]);return zn(!u,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),k.createElement(za.Item,vt({},u,{title:typeof a=="string"?a:void 0},d,{ref:c}))}}]),r})(k.Component),z2=k.forwardRef(function(e,t){var r=e.style,n=e.className,o=e.eventKey;e.warnKey;var a=e.disabled,u=e.itemIcon,c=e.children,f=e.role,d=e.onMouseEnter,m=e.onMouseLeave,b=e.onClick,g=e.onKeyDown,w=e.onFocus,C=yr(e,R2),D=r1(o),p=k.useContext(Dn),B=p.prefixCls,F=p.onItemClick,S=p.disabled,O=p.overflowDisabled,M=p.itemIcon,_=p.selectedKeys,z=p.onActive,K=k.useContext(w0),$=K._internalRenderMenuItem,Q="".concat(B,"-item"),V=k.useRef(),X=k.useRef(),G=S||a,j=Ip(t,X),H=ha(o),U=function(ue){return{key:o,keyPath:At(H).reverse(),item:V.current,domEvent:ue}},R=u||M,te=s1(o,G,d,m),q=te.active,se=yr(te,P2),ye=_.includes(o),we=l1(H.length),ie=function(ue){if(!G){var De=U(ue);b==null||b(us(De)),F(De)}},me=function(ue){if(g==null||g(ue),ue.which===$r.ENTER){var De=U(ue);b==null||b(us(De)),F(De)}},Oe=function(ue){z(o),w==null||w(ue)},ee={};e.role==="option"&&(ee["aria-selected"]=ye);var pe=k.createElement(I2,vt({ref:V,elementRef:j,role:f===null?"none":f||"menuitem",tabIndex:a?null:-1,"data-menu-id":O&&D?null:D},Jn(C,["extra"]),se,ee,{component:"li","aria-disabled":a,style:qe(qe({},we),r),className:tt(Q,Te(Te(Te({},"".concat(Q,"-active"),q),"".concat(Q,"-selected"),ye),"".concat(Q,"-disabled"),G),n),onClick:ie,onKeyDown:me,onFocus:Oe}),c,k.createElement(u1,{props:qe(qe({},e),{},{isSelected:ye}),icon:R}));return $&&(pe=$(pe,e,{selected:ye})),pe});function j2(e,t){var r=e.eventKey,n=$s(),o=ha(r);return k.useEffect(function(){if(n)return n.registerPath(r,o),function(){n.unregisterPath(r,o)}},[o]),n?null:k.createElement(z2,vt({},e,{ref:t}))}const Ts=k.forwardRef(j2);var _2=["className","children"],L2=function(t,r){var n=t.className,o=t.children,a=yr(t,_2),u=k.useContext(Dn),c=u.prefixCls,f=u.mode,d=u.rtl;return k.createElement("ul",vt({className:tt(c,d&&"".concat(c,"-rtl"),"".concat(c,"-sub"),"".concat(c,"-").concat(f==="inline"?"inline":"vertical"),n),role:"menu"},a,{"data-menu-list":!0,ref:r}),o)},k0=k.forwardRef(L2);k0.displayName="SubMenuList";function S0(e,t){return As(e).map(function(r,n){if(k.isValidElement(r)){var o,a,u=r.key,c=(o=(a=r.props)===null||a===void 0?void 0:a.eventKey)!==null&&o!==void 0?o:u,f=c==null;f&&(c="tmp_key-".concat([].concat(At(t),[n]).join("-")));var d={key:c,eventKey:c};return k.cloneElement(r,d)}return r})}var _r={adjustX:1,adjustY:1},H2={topLeft:{points:["bl","tl"],overflow:_r},topRight:{points:["br","tr"],overflow:_r},bottomLeft:{points:["tl","bl"],overflow:_r},bottomRight:{points:["tr","br"],overflow:_r},leftTop:{points:["tr","tl"],overflow:_r},leftBottom:{points:["br","bl"],overflow:_r},rightTop:{points:["tl","tr"],overflow:_r},rightBottom:{points:["bl","br"],overflow:_r}},K2={topLeft:{points:["bl","tl"],overflow:_r},topRight:{points:["br","tr"],overflow:_r},bottomLeft:{points:["tl","bl"],overflow:_r},bottomRight:{points:["tr","br"],overflow:_r},rightTop:{points:["tr","tl"],overflow:_r},rightBottom:{points:["br","bl"],overflow:_r},leftTop:{points:["tl","tr"],overflow:_r},leftBottom:{points:["bl","br"],overflow:_r}};function c1(e,t,r){if(t)return t;if(r)return r[e]||r.other}var q2={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function W2(e){var t=e.prefixCls,r=e.visible,n=e.children,o=e.popup,a=e.popupStyle,u=e.popupClassName,c=e.popupOffset,f=e.disabled,d=e.mode,m=e.onVisibleChange,b=k.useContext(Dn),g=b.getPopupContainer,w=b.rtl,C=b.subMenuOpenDelay,D=b.subMenuCloseDelay,p=b.builtinPlacements,B=b.triggerSubMenuAction,F=b.forceSubMenuRender,S=b.rootClassName,O=b.motion,M=b.defaultMotions,_=k.useState(!1),z=wt(_,2),K=z[0],$=z[1],Q=w?qe(qe({},K2),p):qe(qe({},H2),p),V=q2[d],X=c1(d,O,M),G=k.useRef(X);d!=="inline"&&(G.current=X);var j=qe(qe({},G.current),{},{leavedClassName:"".concat(t,"-hidden"),removeOnLeave:!1,motionAppear:!0}),H=k.useRef();return k.useEffect(function(){return H.current=xn(function(){$(r)}),function(){xn.cancel(H.current)}},[r]),k.createElement(Rp,{prefixCls:t,popupClassName:tt("".concat(t,"-popup"),Te({},"".concat(t,"-rtl"),w),u,S),stretch:d==="horizontal"?"minWidth":null,getPopupContainer:g,builtinPlacements:Q,popupPlacement:V,popupVisible:K,popup:o,popupStyle:a,popupAlign:c&&{offset:c},action:f?[]:[B],mouseEnterDelay:C,mouseLeaveDelay:D,onPopupVisibleChange:m,forceRender:F,popupMotion:j,fresh:!0},n)}function V2(e){var t=e.id,r=e.open,n=e.keyPath,o=e.children,a="inline",u=k.useContext(Dn),c=u.prefixCls,f=u.forceSubMenuRender,d=u.motion,m=u.defaultMotions,b=u.mode,g=k.useRef(!1);g.current=b===a;var w=k.useState(!g.current),C=wt(w,2),D=C[0],p=C[1],B=g.current?r:!1;k.useEffect(function(){g.current&&p(!1)},[b]);var F=qe({},c1(a,d,m));n.length>1&&(F.motionAppear=!1);var S=F.onVisibleChanged;return F.onVisibleChanged=function(O){return!g.current&&!O&&p(!0),S==null?void 0:S(O)},D?null:k.createElement(Ya,{mode:a,locked:!g.current},k.createElement(Hp,vt({visible:B},F,{forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(c,"-hidden")}),function(O){var M=O.className,_=O.style;return k.createElement(k0,{id:t,className:M,style:_},o)}))}var U2=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Y2=["active"],G2=k.forwardRef(function(e,t){var r=e.style,n=e.className,o=e.title,a=e.eventKey;e.warnKey;var u=e.disabled,c=e.internalPopupClose,f=e.children,d=e.itemIcon,m=e.expandIcon,b=e.popupClassName,g=e.popupOffset,w=e.popupStyle,C=e.onClick,D=e.onMouseEnter,p=e.onMouseLeave,B=e.onTitleClick,F=e.onTitleMouseEnter,S=e.onTitleMouseLeave,O=yr(e,U2),M=r1(a),_=k.useContext(Dn),z=_.prefixCls,K=_.mode,$=_.openKeys,Q=_.disabled,V=_.overflowDisabled,X=_.activeKey,G=_.selectedKeys,j=_.itemIcon,H=_.expandIcon,U=_.onItemClick,R=_.onOpenChange,te=_.onActive,q=k.useContext(w0),se=q._internalRenderSubMenuItem,ye=k.useContext(a1),we=ye.isSubPathKey,ie=ha(),me="".concat(z,"-submenu"),Oe=Q||u,ee=k.useRef(),pe=k.useRef(),le=d??j,ue=m??H,De=$.includes(a),Ce=!V&&De,Ee=we(G,a),Fe=s1(a,Oe,F,S),Be=Fe.active,Ne=yr(Fe,Y2),ze=k.useState(!1),Me=wt(ze,2),Ge=Me[0],dt=Me[1],ut=function(pt){Oe||dt(pt)},Pe=function(pt){ut(!0),D==null||D({key:a,domEvent:pt})},Le=function(pt){ut(!1),p==null||p({key:a,domEvent:pt})},Ve=k.useMemo(function(){return Be||(K!=="inline"?Ge||we([X],a):!1)},[K,Be,X,Ge,a,we]),ft=l1(ie.length),Je=function(pt){Oe||(B==null||B({key:a,domEvent:pt}),K==="inline"&&R(a,!De))},Xe=Ra(function(Dt){C==null||C(us(Dt)),U(Dt)}),St=function(pt){K!=="inline"&&R(a,pt)},bt=function(){te(a)},ct=M&&"".concat(M,"-popup"),rt=k.useMemo(function(){return k.createElement(u1,{icon:K!=="horizontal"?ue:void 0,props:qe(qe({},e),{},{isOpen:Ce,isSubMenu:!0})},k.createElement("i",{className:"".concat(me,"-arrow")}))},[K,ue,e,Ce,me]),$e=k.createElement("div",vt({role:"menuitem",style:ft,className:"".concat(me,"-title"),tabIndex:Oe?null:-1,ref:ee,title:typeof o=="string"?o:null,"data-menu-id":V&&M?null:M,"aria-expanded":Ce,"aria-haspopup":!0,"aria-controls":ct,"aria-disabled":Oe,onClick:Je,onFocus:bt},Ne),o,rt),de=k.useRef(K);if(K!=="inline"&&ie.length>1?de.current="vertical":de.current=K,!V){var it=de.current;$e=k.createElement(W2,{mode:it,prefixCls:me,visible:!c&&Ce&&K!=="inline",popupClassName:b,popupOffset:g,popupStyle:w,popup:k.createElement(Ya,{mode:it==="horizontal"?"vertical":it},k.createElement(k0,{id:ct,ref:pe},f)),disabled:Oe,onVisibleChange:St},$e)}var yt=k.createElement(za.Item,vt({ref:t,role:"none"},O,{component:"li",style:r,className:tt(me,"".concat(me,"-").concat(K),n,Te(Te(Te(Te({},"".concat(me,"-open"),Ce),"".concat(me,"-active"),Ve),"".concat(me,"-selected"),Ee),"".concat(me,"-disabled"),Oe)),onMouseEnter:Pe,onMouseLeave:Le}),$e,!V&&k.createElement(V2,{id:ct,open:Ce,keyPath:ie},f));return se&&(yt=se(yt,e,{selected:Ee,active:Ve,open:Ce,disabled:Oe})),k.createElement(Ya,{onItemClick:Xe,mode:K==="horizontal"?"vertical":K,itemIcon:le,expandIcon:ue},yt)}),Ms=k.forwardRef(function(e,t){var r=e.eventKey,n=e.children,o=ha(r),a=S0(n,o),u=$s();k.useEffect(function(){if(u)return u.registerPath(r,o),function(){u.unregisterPath(r,o)}},[o]);var c;return u?c=a:c=k.createElement(G2,vt({ref:t},e),a),k.createElement(o1.Provider,{value:o},c)});function B0(e){var t=e.className,r=e.style,n=k.useContext(Dn),o=n.prefixCls,a=$s();return a?null:k.createElement("li",{role:"separator",className:tt("".concat(o,"-item-divider"),t),style:r})}var X2=["className","title","eventKey","children"],Q2=k.forwardRef(function(e,t){var r=e.className,n=e.title;e.eventKey;var o=e.children,a=yr(e,X2),u=k.useContext(Dn),c=u.prefixCls,f="".concat(c,"-item-group");return k.createElement("li",vt({ref:t,role:"presentation"},a,{onClick:function(m){return m.stopPropagation()},className:tt(f,r)}),k.createElement("div",{role:"presentation",className:"".concat(f,"-title"),title:typeof n=="string"?n:void 0},n),k.createElement("ul",{role:"group",className:"".concat(f,"-list")},o))}),A0=k.forwardRef(function(e,t){var r=e.eventKey,n=e.children,o=ha(r),a=S0(n,o),u=$s();return u?a:k.createElement(Q2,vt({ref:t},Jn(e,["warnKey"])),a)}),Z2=["label","children","key","type","extra"];function Nu(e,t,r){var n=t.item,o=t.group,a=t.submenu,u=t.divider;return(e||[]).map(function(c,f){if(c&&En(c)==="object"){var d=c,m=d.label,b=d.children,g=d.key,w=d.type,C=d.extra,D=yr(d,Z2),p=g??"tmp-".concat(f);return b||w==="group"?w==="group"?k.createElement(o,vt({key:p},D,{title:m}),Nu(b,t,r)):k.createElement(a,vt({key:p},D,{title:m}),Nu(b,t,r)):w==="divider"?k.createElement(u,vt({key:p},D)):k.createElement(n,vt({key:p},D,{extra:C}),m,(!!C||C===0)&&k.createElement("span",{className:"".concat(r,"-item-extra")},C))}return null}).filter(function(c){return c})}function Rd(e,t,r,n,o){var a=e,u=qe({divider:B0,item:Ts,group:A0,submenu:Ms},n);return t&&(a=Nu(t,u,o)),S0(a,r)}var J2=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],Eo=[],e3=k.forwardRef(function(e,t){var r,n=e,o=n.prefixCls,a=o===void 0?"rc-menu":o,u=n.rootClassName,c=n.style,f=n.className,d=n.tabIndex,m=d===void 0?0:d,b=n.items,g=n.children,w=n.direction,C=n.id,D=n.mode,p=D===void 0?"vertical":D,B=n.inlineCollapsed,F=n.disabled,S=n.disabledOverflow,O=n.subMenuOpenDelay,M=O===void 0?.1:O,_=n.subMenuCloseDelay,z=_===void 0?.1:_,K=n.forceSubMenuRender,$=n.defaultOpenKeys,Q=n.openKeys,V=n.activeKey,X=n.defaultActiveFirst,G=n.selectable,j=G===void 0?!0:G,H=n.multiple,U=H===void 0?!1:H,R=n.defaultSelectedKeys,te=n.selectedKeys,q=n.onSelect,se=n.onDeselect,ye=n.inlineIndent,we=ye===void 0?24:ye,ie=n.motion,me=n.defaultMotions,Oe=n.triggerSubMenuAction,ee=Oe===void 0?"hover":Oe,pe=n.builtinPlacements,le=n.itemIcon,ue=n.expandIcon,De=n.overflowedIndicator,Ce=De===void 0?"...":De,Ee=n.overflowedIndicatorPopupClassName,Fe=n.getPopupContainer,Be=n.onClick,Ne=n.onOpenChange,ze=n.onKeyDown;n.openAnimation,n.openTransitionName;var Me=n._internalRenderMenuItem,Ge=n._internalRenderSubMenuItem,dt=n._internalComponents,ut=yr(n,J2),Pe=k.useMemo(function(){return[Rd(g,b,Eo,dt,a),Rd(g,b,Eo,{},a)]},[g,b,dt]),Le=wt(Pe,2),Ve=Le[0],ft=Le[1],Je=k.useState(!1),Xe=wt(Je,2),St=Xe[0],bt=Xe[1],ct=k.useRef(),rt=$2(C),$e=w==="rtl",de=Jo($,{value:Q,postState:function(jt){return jt||Eo}}),it=wt(de,2),yt=it[0],Dt=it[1],pt=function(jt){var Ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Tr(){Dt(jt),Ne==null||Ne(jt)}Ut?w4(Tr):Tr()},Qt=k.useState(yt),gt=wt(Qt,2),Zt=gt[0],rr=gt[1],nr=k.useRef(!1),ht=k.useMemo(function(){return(p==="inline"||p==="vertical")&&B?["vertical",B]:[p,!1]},[p,B]),gr=wt(ht,2),or=gr[0],Dr=gr[1],ot=or==="inline",Er=k.useState(or),kr=wt(Er,2),Vt=kr[0],Jt=kr[1],Ot=k.useState(Dr),x=wt(Ot,2),v=x[0],oe=x[1];k.useEffect(function(){Jt(or),oe(Dr),nr.current&&(ot?Dt(Zt):pt(Eo))},[or,Dr]);var A=k.useState(0),L=wt(A,2),be=L[0],xe=L[1],ke=be>=Ve.length-1||Vt!=="horizontal"||S;k.useEffect(function(){ot&&rr(yt)},[yt]),k.useEffect(function(){return nr.current=!0,function(){nr.current=!1}},[]);var Ie=N2(),J=Ie.registerPath,ce=Ie.unregisterPath,he=Ie.refreshOverflowKeys,He=Ie.isSubPathKey,W=Ie.getKeyPath,lt=Ie.getKeys,re=Ie.getSubPathKeys,et=k.useMemo(function(){return{registerPath:J,unregisterPath:ce}},[J,ce]),kt=k.useMemo(function(){return{isSubPathKey:He}},[He]);k.useEffect(function(){he(ke?Eo:Ve.slice(be+1).map(function(ar){return ar.key}))},[be,ke]);var xr=Jo(V||X&&((r=Ve[0])===null||r===void 0?void 0:r.key),{value:V}),_t=wt(xr,2),st=_t[0],Sn=_t[1],to=Ra(function(ar){Sn(ar)}),xo=Ra(function(){Sn(void 0)});p0(t,function(){return{list:ct.current,focus:function(jt){var Ut,Tr=lt(),Sr=Au(Tr,rt),jn=Sr.elements,Do=Sr.key2element,_n=Sr.element2key,Ln=D0(ct.current,jn),ro=st??(Ln[0]?_n.get(Ln[0]):(Ut=Ve.find(function(mn){return!mn.props.disabled}))===null||Ut===void 0?void 0:Ut.key),ge=Do.get(ro);if(ro&&ge){var Yt;ge==null||(Yt=ge.focus)===null||Yt===void 0||Yt.call(ge,jt)}}}});var Ca=Jo(R||[],{value:te,postState:function(jt){return Array.isArray(jt)?jt:jt==null?Eo:[jt]}}),pn=wt(Ca,2),Qr=pn[0],jr=pn[1],wa=function(jt){if(j){var Ut=jt.key,Tr=Qr.includes(Ut),Sr;U?Tr?Sr=Qr.filter(function(Do){return Do!==Ut}):Sr=[].concat(At(Qr),[Ut]):Sr=[Ut],jr(Sr);var jn=qe(qe({},jt),{},{selectedKeys:Sr});Tr?se==null||se(jn):q==null||q(jn)}!U&&yt.length&&Vt!=="inline"&&pt(Eo)},Ho=Ra(function(ar){Be==null||Be(us(ar)),wa(ar)}),Co=Ra(function(ar,jt){var Ut=yt.filter(function(Sr){return Sr!==ar});if(jt)Ut.push(ar);else if(Vt!=="inline"){var Tr=re(ar);Ut=Ut.filter(function(Sr){return!Tr.has(Sr)})}Ro(yt,Ut,!0)||pt(Ut,!0)}),Da=function(jt,Ut){var Tr=Ut??!yt.includes(jt);Co(jt,Tr)},Ea=B2(Vt,st,$e,rt,ct,lt,W,Sn,Da,ze);k.useEffect(function(){bt(!0)},[]);var wo=k.useMemo(function(){return{_internalRenderMenuItem:Me,_internalRenderSubMenuItem:Ge}},[Me,Ge]),Fr=Vt!=="horizontal"||S?Ve:Ve.map(function(ar,jt){return k.createElement(Ya,{key:ar.key,overflowDisabled:jt>be},ar)}),Bn=k.createElement(za,vt({id:C,ref:ct,prefixCls:"".concat(a,"-overflow"),component:"ul",itemComponent:Ts,className:tt(a,"".concat(a,"-root"),"".concat(a,"-").concat(Vt),f,Te(Te({},"".concat(a,"-inline-collapsed"),v),"".concat(a,"-rtl"),$e),u),dir:w,style:c,role:"menu",tabIndex:m,data:Fr,renderRawItem:function(jt){return jt},renderRawRest:function(jt){var Ut=jt.length,Tr=Ut?Ve.slice(-Ut):null;return k.createElement(Ms,{eventKey:Fu,title:Ce,disabled:ke,internalPopupClose:Ut===0,popupClassName:Ee},Tr)},maxCount:Vt!=="horizontal"||S?za.INVALIDATE:za.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(jt){xe(jt)},onKeyDown:Ea},ut));return k.createElement(w0.Provider,{value:wo},k.createElement(e1.Provider,{value:rt},k.createElement(Ya,{prefixCls:a,rootClassName:u,mode:Vt,openKeys:yt,rtl:$e,disabled:F,motion:St?ie:null,defaultMotions:St?me:null,activeKey:st,onActive:to,onInactive:xo,selectedKeys:Qr,inlineIndent:we,subMenuOpenDelay:M,subMenuCloseDelay:z,forceSubMenuRender:K,builtinPlacements:pe,triggerSubMenuAction:ee,getPopupContainer:Fe,itemIcon:le,expandIcon:ue,onItemClick:Ho,onOpenChange:Co},k.createElement(a1.Provider,{value:kt},Bn),k.createElement("div",{style:{display:"none"},"aria-hidden":!0},k.createElement(n1.Provider,{value:et},ft)))))}),li=e3;li.Item=Ts;li.SubMenu=Ms;li.ItemGroup=A0;li.Divider=B0;const d1=k.createContext({});var t3={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},r3=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:t3}))},f1=k.forwardRef(r3);const cs=Zn({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var n3=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const h1=e=>{const{prefixCls:t,className:r,dashed:n}=e,o=n3(e,["prefixCls","className","dashed"]),{getPrefixCls:a}=k.useContext(bo),u=a("menu",t),c=tt({[`${u}-item-divider-dashed`]:!!n},r);return k.createElement(B0,Object.assign({className:c},o))},p1=e=>{var t;const{className:r,children:n,icon:o,title:a,danger:u,extra:c}=e,{prefixCls:f,firstLevel:d,direction:m,disableMenuItemTitleTooltip:b,inlineCollapsed:g}=k.useContext(cs),w=S=>{const O=n==null?void 0:n[0],M=k.createElement("span",{className:tt(`${f}-title-content`,{[`${f}-title-content-with-extra`]:!!c||c===0})},n);return(!o||k.isValidElement(n)&&n.type==="span")&&n&&S&&d&&typeof O=="string"?k.createElement("div",{className:`${f}-inline-collapsed-noicon`},O.charAt(0)):M},{siderCollapsed:C}=k.useContext(d1);let D=a;typeof a>"u"?D=d?n:"":a===!1&&(D="");const p={title:D};!C&&!g&&(p.title=null,p.open=!1);const B=As(n).length;let F=k.createElement(Ts,Object.assign({},Jn(e,["title","icon","danger"]),{className:tt({[`${f}-item-danger`]:u,[`${f}-item-only-child`]:(o?B+1:B)===1},r),title:typeof a=="string"?a:void 0}),oa(o,{className:tt(k.isValidElement(o)?(t=o.props)===null||t===void 0?void 0:t.className:void 0,`${f}-item-icon`)}),w(g));return b||(F=k.createElement(os,Object.assign({},p,{placement:m==="rtl"?"left":"right",classNames:{root:`${f}-inline-collapsed-tooltip`}}),F)),F};var o3=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const ds=k.createContext(null),m1=k.forwardRef((e,t)=>{const{children:r}=e,n=o3(e,["children"]),o=k.useContext(ds),a=k.useMemo(()=>Object.assign(Object.assign({},o),n),[o,n.prefixCls,n.mode,n.selectable,n.rootClassName]),u=S4(r),c=Ip(t,u?m0(r):null);return k.createElement(ds.Provider,{value:a},k.createElement(B4,{space:!0},u?k.cloneElement(r,{ref:c}):r))}),a3=e=>{const{componentCls:t,motionDurationSlow:r,horizontalLineHeight:n,colorSplit:o,lineWidth:a,lineType:u,itemPaddingInline:c}=e;return{[`${t}-horizontal`]:{lineHeight:n,border:0,borderBottom:`${Ue(a)} ${u} ${o}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${t}-item, ${t}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:c},[`> ${t}-item:hover,
2
- > ${t}-item-active,
3
- > ${t}-submenu ${t}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${t}-item, ${t}-submenu-title`]:{transition:[`border-color ${r}`,`background ${r}`].join(",")},[`${t}-submenu-arrow`]:{display:"none"}}}},i3=({componentCls:e,menuArrowOffset:t,calc:r})=>({[`${e}-rtl`]:{direction:"rtl"},[`${e}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${e}-rtl${e}-vertical,
4
- ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${Ue(r(t).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${Ue(t)})`}}}}),Pd=e=>Kp(e),Id=(e,t)=>{const{componentCls:r,itemColor:n,itemSelectedColor:o,subMenuItemSelectedColor:a,groupTitleColor:u,itemBg:c,subMenuItemBg:f,itemSelectedBg:d,activeBarHeight:m,activeBarWidth:b,activeBarBorderWidth:g,motionDurationSlow:w,motionEaseInOut:C,motionEaseOut:D,itemPaddingInline:p,motionDurationMid:B,itemHoverColor:F,lineType:S,colorSplit:O,itemDisabledColor:M,dangerItemColor:_,dangerItemHoverColor:z,dangerItemSelectedColor:K,dangerItemActiveBg:$,dangerItemSelectedBg:Q,popupBg:V,itemHoverBg:X,itemActiveBg:G,menuSubMenuBg:j,horizontalItemSelectedColor:H,horizontalItemSelectedBg:U,horizontalItemBorderRadius:R,horizontalItemHoverBg:te}=e;return{[`${r}-${t}, ${r}-${t} > ${r}`]:{color:n,background:c,[`&${r}-root:focus-visible`]:Object.assign({},Pd(e)),[`${r}-item`]:{"&-group-title, &-extra":{color:u}},[`${r}-submenu-selected > ${r}-submenu-title`]:{color:a},[`${r}-item, ${r}-submenu-title`]:{color:n,[`&:not(${r}-item-disabled):focus-visible`]:Object.assign({},Pd(e))},[`${r}-item-disabled, ${r}-submenu-disabled`]:{color:`${M} !important`},[`${r}-item:not(${r}-item-selected):not(${r}-submenu-selected)`]:{[`&:hover, > ${r}-submenu-title:hover`]:{color:F}},[`&:not(${r}-horizontal)`]:{[`${r}-item:not(${r}-item-selected)`]:{"&:hover":{backgroundColor:X},"&:active":{backgroundColor:G}},[`${r}-submenu-title`]:{"&:hover":{backgroundColor:X},"&:active":{backgroundColor:G}}},[`${r}-item-danger`]:{color:_,[`&${r}-item:hover`]:{[`&:not(${r}-item-selected):not(${r}-submenu-selected)`]:{color:z}},[`&${r}-item:active`]:{background:$}},[`${r}-item a`]:{"&, &:hover":{color:"inherit"}},[`${r}-item-selected`]:{color:o,[`&${r}-item-danger`]:{color:K},"a, a:hover":{color:"inherit"}},[`& ${r}-item-selected`]:{backgroundColor:d,[`&${r}-item-danger`]:{backgroundColor:Q}},[`&${r}-submenu > ${r}`]:{backgroundColor:j},[`&${r}-popup > ${r}`]:{backgroundColor:V},[`&${r}-submenu-popup > ${r}`]:{backgroundColor:V},[`&${r}-horizontal`]:Object.assign(Object.assign({},t==="dark"?{borderBottom:0}:{}),{[`> ${r}-item, > ${r}-submenu`]:{top:g,marginTop:e.calc(g).mul(-1).equal(),marginBottom:0,borderRadius:R,"&::after":{position:"absolute",insetInline:p,bottom:0,borderBottom:`${Ue(m)} solid transparent`,transition:`border-color ${w} ${C}`,content:'""'},"&:hover, &-active, &-open":{background:te,"&::after":{borderBottomWidth:m,borderBottomColor:H}},"&-selected":{color:H,backgroundColor:U,"&:hover":{backgroundColor:U},"&::after":{borderBottomWidth:m,borderBottomColor:H}}}}),[`&${r}-root`]:{[`&${r}-inline, &${r}-vertical`]:{borderInlineEnd:`${Ue(g)} ${S} ${O}`}},[`&${r}-inline`]:{[`${r}-sub${r}-inline`]:{background:f},[`${r}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${Ue(b)} solid ${o}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${B} ${D}`,`opacity ${B} ${D}`].join(","),content:'""'},[`&${r}-item-danger`]:{"&::after":{borderInlineEndColor:K}}},[`${r}-selected, ${r}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${B} ${C}`,`opacity ${B} ${C}`].join(",")}}}}}},zd=e=>{const{componentCls:t,itemHeight:r,itemMarginInline:n,padding:o,menuArrowSize:a,marginXS:u,itemMarginBlock:c,itemWidth:f,itemPaddingInline:d}=e,m=e.calc(a).add(o).add(u).equal();return{[`${t}-item`]:{position:"relative",overflow:"hidden"},[`${t}-item, ${t}-submenu-title`]:{height:r,lineHeight:Ue(r),paddingInline:d,overflow:"hidden",textOverflow:"ellipsis",marginInline:n,marginBlock:c,width:f},[`> ${t}-item,
5
- > ${t}-submenu > ${t}-submenu-title`]:{height:r,lineHeight:Ue(r)},[`${t}-item-group-list ${t}-submenu-title,
6
- ${t}-submenu-title`]:{paddingInlineEnd:m}}},s3=e=>{const{componentCls:t,iconCls:r,itemHeight:n,colorTextLightSolid:o,dropdownWidth:a,controlHeightLG:u,motionEaseOut:c,paddingXL:f,itemMarginInline:d,fontSizeLG:m,motionDurationFast:b,motionDurationSlow:g,paddingXS:w,boxShadowSecondary:C,collapsedWidth:D,collapsedIconSize:p}=e,B={height:n,lineHeight:Ue(n),listStylePosition:"inside",listStyleType:"disc"};return[{[t]:{"&-inline, &-vertical":Object.assign({[`&${t}-root`]:{boxShadow:"none"}},zd(e))},[`${t}-submenu-popup`]:{[`${t}-vertical`]:Object.assign(Object.assign({},zd(e)),{boxShadow:C})}},{[`${t}-submenu-popup ${t}-vertical${t}-sub`]:{minWidth:a,maxHeight:`calc(100vh - ${Ue(e.calc(u).mul(2.5).equal())})`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${t}-inline`]:{width:"100%",[`&${t}-root`]:{[`${t}-item, ${t}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${g}`,`background ${g}`,`padding ${b} ${c}`].join(","),[`> ${t}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${t}-sub${t}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${t}-submenu > ${t}-submenu-title`]:B,[`& ${t}-item-group-title`]:{paddingInlineStart:f}},[`${t}-item`]:B}},{[`${t}-inline-collapsed`]:{width:D,[`&${t}-root`]:{[`${t}-item, ${t}-submenu ${t}-submenu-title`]:{[`> ${t}-inline-collapsed-noicon`]:{fontSize:m,textAlign:"center"}}},[`> ${t}-item,
7
- > ${t}-item-group > ${t}-item-group-list > ${t}-item,
8
- > ${t}-item-group > ${t}-item-group-list > ${t}-submenu > ${t}-submenu-title,
9
- > ${t}-submenu > ${t}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${Ue(e.calc(p).div(2).equal())} - ${Ue(d)})`,textOverflow:"clip",[`
10
- ${t}-submenu-arrow,
11
- ${t}-submenu-expand-icon
12
- `]:{opacity:0},[`${t}-item-icon, ${r}`]:{margin:0,fontSize:p,lineHeight:Ue(n),"+ span":{display:"inline-block",opacity:0}}},[`${t}-item-icon, ${r}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${t}-item-icon, ${r}`]:{display:"none"},"a, a:hover":{color:o}},[`${t}-item-group-title`]:Object.assign(Object.assign({},qp),{paddingInline:w})}}]},jd=e=>{const{componentCls:t,motionDurationSlow:r,motionDurationMid:n,motionEaseInOut:o,motionEaseOut:a,iconCls:u,iconSize:c,iconMarginInlineEnd:f}=e;return{[`${t}-item, ${t}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${r}`,`background ${r}`,`padding calc(${r} + 0.1s) ${o}`].join(","),[`${t}-item-icon, ${u}`]:{minWidth:c,fontSize:c,transition:[`font-size ${n} ${a}`,`margin ${r} ${o}`,`color ${r}`].join(","),"+ span":{marginInlineStart:f,opacity:1,transition:[`opacity ${r} ${o}`,`margin ${r}`,`color ${r}`].join(",")}},[`${t}-item-icon`]:Object.assign({},A4()),[`&${t}-item-only-child`]:{[`> ${u}, > ${t}-item-icon`]:{marginInlineEnd:0}}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important",cursor:"not-allowed",pointerEvents:"none"},[`> ${t}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},_d=e=>{const{componentCls:t,motionDurationSlow:r,motionEaseInOut:n,borderRadius:o,menuArrowSize:a,menuArrowOffset:u}=e;return{[`${t}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:a,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${r} ${n}, opacity ${r}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(a).mul(.6).equal(),height:e.calc(a).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:o,transition:[`background ${r} ${n}`,`transform ${r} ${n}`,`top ${r} ${n}`,`color ${r} ${n}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(${Ue(e.calc(u).mul(-1).equal())})`},"&::after":{transform:`rotate(-45deg) translateY(${Ue(u)})`}}}}},l3=e=>{const{antCls:t,componentCls:r,fontSize:n,motionDurationSlow:o,motionDurationMid:a,motionEaseInOut:u,paddingXS:c,padding:f,colorSplit:d,lineWidth:m,zIndexPopup:b,borderRadiusLG:g,subMenuItemBorderRadius:w,menuArrowSize:C,menuArrowOffset:D,lineType:p,groupTitleLineHeight:B,groupTitleFontSize:F}=e;return[{"":{[r]:Object.assign(Object.assign({},Du()),{"&-hidden":{display:"none"}})},[`${r}-submenu-hidden`]:{display:"none"}},{[r]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},si(e)),Du()),{marginBottom:0,paddingInlineStart:0,fontSize:n,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${o} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${r}-item`]:{flex:"none"}},[`${r}-item, ${r}-submenu, ${r}-submenu-title`]:{borderRadius:e.itemBorderRadius},[`${r}-item-group-title`]:{padding:`${Ue(c)} ${Ue(f)}`,fontSize:F,lineHeight:B,transition:`all ${o}`},[`&-horizontal ${r}-submenu`]:{transition:[`border-color ${o} ${u}`,`background ${o} ${u}`].join(",")},[`${r}-submenu, ${r}-submenu-inline`]:{transition:[`border-color ${o} ${u}`,`background ${o} ${u}`,`padding ${a} ${u}`].join(",")},[`${r}-submenu ${r}-sub`]:{cursor:"initial",transition:[`background ${o} ${u}`,`padding ${o} ${u}`].join(",")},[`${r}-title-content`]:{transition:`color ${o}`,"&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},[`> ${t}-typography-ellipsis-single-line`]:{display:"inline",verticalAlign:"unset"},[`${r}-item-extra`]:{marginInlineStart:"auto",paddingInlineStart:e.padding}},[`${r}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${r}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:d,borderStyle:p,borderWidth:0,borderTopWidth:m,marginBlock:m,padding:0,"&-dashed":{borderStyle:"dashed"}}}),jd(e)),{[`${r}-item-group`]:{[`${r}-item-group-list`]:{margin:0,padding:0,[`${r}-item, ${r}-submenu-title`]:{paddingInline:`${Ue(e.calc(n).mul(2).equal())} ${Ue(f)}`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:b,borderRadius:g,boxShadow:"none",transformOrigin:"0 0",[`&${r}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:0,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'},[`> ${r}`]:Object.assign(Object.assign(Object.assign({borderRadius:g},jd(e)),_d(e)),{[`${r}-item, ${r}-submenu > ${r}-submenu-title`]:{borderRadius:w},[`${r}-submenu-title::after`]:{transition:`transform ${o} ${u}`}})},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:e.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:e.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:e.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:e.paddingXS}}}),_d(e)),{[`&-inline-collapsed ${r}-submenu-arrow,
13
- &-inline ${r}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Ue(D)})`},"&::after":{transform:`rotate(45deg) translateX(${Ue(e.calc(D).mul(-1).equal())})`}},[`${r}-submenu-open${r}-submenu-inline > ${r}-submenu-title > ${r}-submenu-arrow`]:{transform:`translateY(${Ue(e.calc(C).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${Ue(e.calc(D).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${Ue(D)})`}}})},{[`${t}-layout-header`]:{[r]:{lineHeight:"inherit"}}}]},u3=e=>{var t,r,n;const{colorPrimary:o,colorError:a,colorTextDisabled:u,colorErrorBg:c,colorText:f,colorTextDescription:d,colorBgContainer:m,colorFillAlter:b,colorFillContent:g,lineWidth:w,lineWidthBold:C,controlItemBgActive:D,colorBgTextHover:p,controlHeightLG:B,lineHeight:F,colorBgElevated:S,marginXXS:O,padding:M,fontSize:_,controlHeightSM:z,fontSizeLG:K,colorTextLightSolid:$,colorErrorHover:Q}=e,V=(t=e.activeBarWidth)!==null&&t!==void 0?t:0,X=(r=e.activeBarBorderWidth)!==null&&r!==void 0?r:w,G=(n=e.itemMarginInline)!==null&&n!==void 0?n:e.marginXXS,j=new Bo($).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:f,itemColor:f,colorItemTextHover:f,itemHoverColor:f,colorItemTextHoverHorizontal:o,horizontalItemHoverColor:o,colorGroupTitle:d,groupTitleColor:d,colorItemTextSelected:o,itemSelectedColor:o,subMenuItemSelectedColor:o,colorItemTextSelectedHorizontal:o,horizontalItemSelectedColor:o,colorItemBg:m,itemBg:m,colorItemBgHover:p,itemHoverBg:p,colorItemBgActive:g,itemActiveBg:D,colorSubItemBg:b,subMenuItemBg:b,colorItemBgSelected:D,itemSelectedBg:D,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:V,colorActiveBarHeight:C,activeBarHeight:C,colorActiveBarBorderSize:w,activeBarBorderWidth:X,colorItemTextDisabled:u,itemDisabledColor:u,colorDangerItemText:a,dangerItemColor:a,colorDangerItemTextHover:a,dangerItemHoverColor:a,colorDangerItemTextSelected:a,dangerItemSelectedColor:a,colorDangerItemBgActive:c,dangerItemActiveBg:c,colorDangerItemBgSelected:c,dangerItemSelectedBg:c,itemMarginInline:G,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:B,groupTitleLineHeight:F,collapsedWidth:B*2,popupBg:S,itemMarginBlock:O,itemPaddingInline:M,horizontalLineHeight:`${B*1.15}px`,iconSize:_,iconMarginInlineEnd:z-_,collapsedIconSize:K,groupTitleFontSize:_,darkItemDisabledColor:new Bo($).setA(.25).toRgbString(),darkItemColor:j,darkDangerItemColor:a,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:$,darkItemSelectedBg:o,darkDangerItemSelectedBg:a,darkItemHoverBg:"transparent",darkGroupTitleColor:j,darkItemHoverColor:$,darkDangerItemHoverColor:Q,darkDangerItemSelectedColor:$,darkDangerItemActiveBg:a,itemWidth:V?`calc(100% + ${X}px)`:`calc(100% - ${G*2}px)`}},c3=(e,t=e,r=!0)=>Fs("Menu",o=>{const{colorBgElevated:a,controlHeightLG:u,fontSize:c,darkItemColor:f,darkDangerItemColor:d,darkItemBg:m,darkSubMenuItemBg:b,darkItemSelectedColor:g,darkItemSelectedBg:w,darkDangerItemSelectedBg:C,darkItemHoverBg:D,darkGroupTitleColor:p,darkItemHoverColor:B,darkItemDisabledColor:F,darkDangerItemHoverColor:S,darkDangerItemSelectedColor:O,darkDangerItemActiveBg:M,popupBg:_,darkPopupBg:z}=o,K=o.calc(c).div(7).mul(5).equal(),$=Ua(o,{menuArrowSize:K,menuHorizontalHeight:o.calc(u).mul(1.15).equal(),menuArrowOffset:o.calc(K).mul(.25).equal(),menuSubMenuBg:a,calc:o.calc,popupBg:_}),Q=Ua($,{itemColor:f,itemHoverColor:B,groupTitleColor:p,itemSelectedColor:g,subMenuItemSelectedColor:g,itemBg:m,popupBg:z,subMenuItemBg:b,itemActiveBg:"transparent",itemSelectedBg:w,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:D,itemDisabledColor:F,dangerItemColor:d,dangerItemHoverColor:S,dangerItemSelectedColor:O,dangerItemActiveBg:M,dangerItemSelectedBg:C,menuSubMenuBg:b,horizontalItemSelectedColor:g,horizontalItemSelectedBg:w});return[l3($),a3($),s3($),Id($,"light"),Id(Q,"dark"),i3($),Wp($),as($,"slide-up"),as($,"slide-down"),Vp($,"zoom-big")]},u3,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:r,unitless:{groupTitleLineHeight:!0}})(e,t),g1=e=>{var t;const{popupClassName:r,icon:n,title:o,theme:a}=e,u=k.useContext(cs),{prefixCls:c,inlineCollapsed:f,theme:d}=u,m=ha();let b;if(!n)b=f&&!m.length&&o&&typeof o=="string"?k.createElement("div",{className:`${c}-inline-collapsed-noicon`},o.charAt(0)):k.createElement("span",{className:`${c}-title-content`},o);else{const C=k.isValidElement(o)&&o.type==="span";b=k.createElement(k.Fragment,null,oa(n,{className:tt(k.isValidElement(n)?(t=n.props)===null||t===void 0?void 0:t.className:void 0,`${c}-item-icon`)}),C?o:k.createElement("span",{className:`${c}-title-content`},o))}const g=k.useMemo(()=>Object.assign(Object.assign({},u),{firstLevel:!1}),[u]),[w]=Up("Menu");return k.createElement(cs.Provider,{value:g},k.createElement(Ms,Object.assign({},Jn(e,["icon"]),{title:b,popupClassName:tt(c,r,`${c}-${a||d}`),popupStyle:Object.assign({zIndex:w},e.popupStyle)})))};var d3=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};function Nl(e){return e===null||e===!1}const f3={item:p1,submenu:g1,divider:h1},h3=vo((e,t)=>{var r;const n=k.useContext(ds),o=n||{},{getPrefixCls:a,getPopupContainer:u,direction:c,menu:f}=k.useContext(bo),d=a(),{prefixCls:m,className:b,style:g,theme:w="light",expandIcon:C,_internalDisableMenuItemTitleTooltip:D,inlineCollapsed:p,siderCollapsed:B,rootClassName:F,mode:S,selectable:O,onClick:M,overflowedIndicatorPopupClassName:_}=e,z=d3(e,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),K=Jn(z,["collapsedWidth"]);(r=o.validator)===null||r===void 0||r.call(o,{mode:S});const $=wn((...we)=>{var ie;M==null||M.apply(void 0,we),(ie=o.onClick)===null||ie===void 0||ie.call(o)}),Q=o.mode||S,V=O??o.selectable,X=p??B,G={horizontal:{motionName:`${d}-slide-up`},inline:Yp(d),other:{motionName:`${d}-zoom-big`}},j=a("menu",m||o.prefixCls),H=v0(j),[U,R,te]=c3(j,H,!n),q=tt(`${j}-${w}`,f==null?void 0:f.className,b),se=k.useMemo(()=>{var we,ie;if(typeof C=="function"||Nl(C))return C||null;if(typeof o.expandIcon=="function"||Nl(o.expandIcon))return o.expandIcon||null;if(typeof(f==null?void 0:f.expandIcon)=="function"||Nl(f==null?void 0:f.expandIcon))return(f==null?void 0:f.expandIcon)||null;const me=(we=C??(o==null?void 0:o.expandIcon))!==null&&we!==void 0?we:f==null?void 0:f.expandIcon;return oa(me,{className:tt(`${j}-submenu-expand-icon`,k.isValidElement(me)?(ie=me.props)===null||ie===void 0?void 0:ie.className:void 0)})},[C,o==null?void 0:o.expandIcon,f==null?void 0:f.expandIcon,j]),ye=k.useMemo(()=>({prefixCls:j,inlineCollapsed:X||!1,direction:c,firstLevel:!0,theme:w,mode:Q,disableMenuItemTitleTooltip:D}),[j,X,c,D,w]);return U(k.createElement(ds.Provider,{value:null},k.createElement(cs.Provider,{value:ye},k.createElement(li,Object.assign({getPopupContainer:u,overflowedIndicator:k.createElement(f1,null),overflowedIndicatorPopupClassName:tt(j,`${j}-${w}`,_),mode:Q,selectable:V,onClick:$},K,{inlineCollapsed:X,style:Object.assign(Object.assign({},f==null?void 0:f.style),g),className:q,prefixCls:j,direction:c,defaultMotions:G,expandIcon:se,ref:t,rootClassName:tt(F,R,o.rootClassName,te,H),_internalComponents:f3})))))}),pa=vo((e,t)=>{const r=It(null),n=k.useContext(d1);return p0(t,()=>({menu:r.current,focus:o=>{var a;(a=r.current)===null||a===void 0||a.focus(o)}})),k.createElement(h3,Object.assign({ref:r},e,n))});pa.Item=p1;pa.SubMenu=g1;pa.Divider=h1;pa.ItemGroup=A0;const p3=e=>{const{componentCls:t,menuCls:r,colorError:n,colorTextLightSolid:o}=e,a=`${r}-item`;return{[`${t}, ${t}-menu-submenu`]:{[`${r} ${a}`]:{[`&${a}-danger:not(${a}-disabled)`]:{color:n,"&:hover":{color:o,backgroundColor:n}}}}}},m3=e=>{const{componentCls:t,menuCls:r,zIndexPopup:n,dropdownArrowDistance:o,sizePopupArrow:a,antCls:u,iconCls:c,motionDurationMid:f,paddingBlock:d,fontSize:m,dropdownEdgeChildPadding:b,colorTextDisabled:g,fontSizeIcon:w,controlPaddingHorizontal:C,colorBgElevated:D}=e;return[{[t]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:n,display:"block","&::before":{position:"absolute",insetBlock:e.calc(a).div(2).sub(o).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:"100vh",overflowY:"auto"},[`&-trigger${u}-btn`]:{[`& > ${c}-down, & > ${u}-btn-icon > ${c}-down`]:{fontSize:w}},[`${t}-wrap`]:{position:"relative",[`${u}-btn > ${c}-down`]:{fontSize:w},[`${c}-down::before`]:{transition:`transform ${f}`}},[`${t}-wrap-open`]:{[`${c}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${u}-slide-down-enter${u}-slide-down-enter-active${t}-placement-bottomLeft,
14
- &${u}-slide-down-appear${u}-slide-down-appear-active${t}-placement-bottomLeft,
15
- &${u}-slide-down-enter${u}-slide-down-enter-active${t}-placement-bottom,
16
- &${u}-slide-down-appear${u}-slide-down-appear-active${t}-placement-bottom,
17
- &${u}-slide-down-enter${u}-slide-down-enter-active${t}-placement-bottomRight,
18
- &${u}-slide-down-appear${u}-slide-down-appear-active${t}-placement-bottomRight`]:{animationName:$4},[`&${u}-slide-up-enter${u}-slide-up-enter-active${t}-placement-topLeft,
19
- &${u}-slide-up-appear${u}-slide-up-appear-active${t}-placement-topLeft,
20
- &${u}-slide-up-enter${u}-slide-up-enter-active${t}-placement-top,
21
- &${u}-slide-up-appear${u}-slide-up-appear-active${t}-placement-top,
22
- &${u}-slide-up-enter${u}-slide-up-enter-active${t}-placement-topRight,
23
- &${u}-slide-up-appear${u}-slide-up-appear-active${t}-placement-topRight`]:{animationName:O4},[`&${u}-slide-down-leave${u}-slide-down-leave-active${t}-placement-bottomLeft,
24
- &${u}-slide-down-leave${u}-slide-down-leave-active${t}-placement-bottom,
25
- &${u}-slide-down-leave${u}-slide-down-leave-active${t}-placement-bottomRight`]:{animationName:N4},[`&${u}-slide-up-leave${u}-slide-up-leave-active${t}-placement-topLeft,
26
- &${u}-slide-up-leave${u}-slide-up-leave-active${t}-placement-top,
27
- &${u}-slide-up-leave${u}-slide-up-leave-active${t}-placement-topRight`]:{animationName:F4}}},T4(e,D,{arrowPlacement:{top:!0,bottom:!0}}),{[`${t} ${r}`]:{position:"relative",margin:0},[`${r}-submenu-popup`]:{position:"absolute",zIndex:n,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${t}, ${t}-menu-submenu`]:Object.assign(Object.assign({},si(e)),{[r]:Object.assign(Object.assign({padding:b,listStyleType:"none",backgroundColor:D,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary},kd(e)),{"&:empty":{padding:0,boxShadow:"none"},[`${r}-item-group-title`]:{padding:`${Ue(d)} ${Ue(C)}`,color:e.colorTextDescription,transition:`all ${f}`},[`${r}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${r}-item-icon`]:{minWidth:m,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${r}-title-content`]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},"> a":{color:"inherit",transition:`all ${f}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},[`${r}-item-extra`]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},[`${r}-item, ${r}-submenu-title`]:Object.assign(Object.assign({display:"flex",margin:0,padding:`${Ue(d)} ${Ue(C)}`,color:e.colorText,fontWeight:"normal",fontSize:m,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${f}`,borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},kd(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:g,cursor:"not-allowed","&:hover":{color:g,backgroundColor:D,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${Ue(e.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},[`${t}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:e.paddingXS,[`${t}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:w,fontStyle:"normal"}}}),[`${r}-item-group-list`]:{margin:`0 ${Ue(e.marginXS)}`,padding:0,listStyle:"none"},[`${r}-submenu-title`]:{paddingInlineEnd:e.calc(C).add(e.fontSizeSM).equal()},[`${r}-submenu-vertical`]:{position:"relative"},[`${r}-submenu${r}-submenu-disabled ${t}-menu-submenu-title`]:{[`&, ${t}-menu-submenu-arrow-icon`]:{color:g,backgroundColor:D,cursor:"not-allowed"}},[`${r}-submenu-selected ${t}-menu-submenu-title`]:{color:e.colorPrimary}})})},[as(e,"slide-up"),as(e,"slide-down"),Ed(e,"move-up"),Ed(e,"move-down"),Vp(e,"zoom-big")]]},g3=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},M4({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),R4(e)),v3=Fs("Dropdown",e=>{const{marginXXS:t,sizePopupArrow:r,paddingXXS:n,componentCls:o}=e,a=Ua(e,{menuCls:`${o}-menu`,dropdownArrowDistance:e.calc(r).div(2).add(t).equal(),dropdownEdgeChildPadding:n});return[m3(a),p3(a)]},g3,{resetStyle:!1}),Rs=e=>{var t;const{menu:r,arrow:n,prefixCls:o,children:a,trigger:u,disabled:c,dropdownRender:f,popupRender:d,getPopupContainer:m,overlayClassName:b,rootClassName:g,overlayStyle:w,open:C,onOpenChange:D,visible:p,onVisibleChange:B,mouseEnterDelay:F=.15,mouseLeaveDelay:S=.1,autoAdjustOverflow:O=!0,placement:M="",overlay:_,transitionName:z,destroyOnHidden:K,destroyPopupOnHide:$}=e,{getPopupContainer:Q,getPrefixCls:V,direction:X,dropdown:G}=k.useContext(bo),j=d||f;Ns();const H=k.useMemo(()=>{const Me=V();return z!==void 0?z:M.includes("top")?`${Me}-slide-down`:`${Me}-slide-up`},[V,M,z]),U=k.useMemo(()=>M?M.includes("Center")?M.slice(0,M.indexOf("Center")):M:X==="rtl"?"bottomRight":"bottomLeft",[M,X]),R=V("dropdown",o),te=v0(R),[q,se,ye]=v3(R,te),[,we]=b0(),ie=k.Children.only(y2(a)?k.createElement("span",null,a):a),me=oa(ie,{className:tt(`${R}-trigger`,{[`${R}-rtl`]:X==="rtl"},ie.props.className),disabled:(t=ie.props.disabled)!==null&&t!==void 0?t:c}),Oe=c?[]:u,ee=!!(Oe!=null&&Oe.includes("contextMenu")),[pe,le]=Jo(!1,{value:C??p}),ue=wn(Me=>{D==null||D(Me,{source:"trigger"}),B==null||B(Me),le(Me)}),De=tt(b,g,se,ye,te,G==null?void 0:G.className,{[`${R}-rtl`]:X==="rtl"}),Ce=P4({arrowPointAtCenter:typeof n=="object"&&n.pointAtCenter,autoAdjustOverflow:O,offset:we.marginXXS,arrowWidth:n?we.sizePopupArrow:0,borderRadius:we.borderRadius}),Ee=wn(()=>{r!=null&&r.selectable&&(r!=null&&r.multiple)||(D==null||D(!1,{source:"menu"}),le(!1))}),Fe=()=>{let Me;return r!=null&&r.items?Me=k.createElement(pa,Object.assign({},r)):typeof _=="function"?Me=_():Me=_,j&&(Me=j(Me)),Me=k.Children.only(typeof Me=="string"?k.createElement("span",null,Me):Me),k.createElement(m1,{prefixCls:`${R}-menu`,rootClassName:tt(ye,te),expandIcon:k.createElement("span",{className:`${R}-menu-submenu-arrow`},X==="rtl"?k.createElement(J4,{className:`${R}-menu-submenu-arrow-icon`}):k.createElement(e2,{className:`${R}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:Ee,validator:({mode:Ge})=>{}},Me)},[Be,Ne]=Up("Dropdown",w==null?void 0:w.zIndex);let ze=k.createElement(b2,Object.assign({alignPoint:ee},Jn(e,["rootClassName"]),{mouseEnterDelay:F,mouseLeaveDelay:S,visible:pe,builtinPlacements:Ce,arrow:!!n,overlayClassName:De,prefixCls:R,getPopupContainer:m||Q,transitionName:H,trigger:Oe,overlay:Fe,placement:U,onVisibleChange:ue,overlayStyle:Object.assign(Object.assign(Object.assign({},G==null?void 0:G.style),w),{zIndex:Be}),autoDestroy:K??$}),me);return Be&&(ze=k.createElement(I4.Provider,{value:Ne},ze)),q(ze)},b3=z4(Rs,"align",void 0,"dropdown",e=>e),y3=e=>k.createElement(b3,Object.assign({},e),k.createElement("span",null));Rs._InternalPanelDoNotUseOrYouWillBeFired=y3;function tn(e,t){return e[t]}var x3=["children"];function v1(e,t){return"".concat(e,"-").concat(t)}function C3(e){return e&&e.type&&e.type.isTreeNode}function ui(e,t){return e??t}function aa(e){var t=e||{},r=t.title,n=t._title,o=t.key,a=t.children,u=r||"title";return{title:u,_title:n||[u],key:o||"key",children:a||"children"}}function b1(e){function t(r){var n=As(r);return n.map(function(o){if(!C3(o))return zn(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var a=o.key,u=o.props,c=u.children,f=yr(u,x3),d=qe({key:a},f),m=t(c);return m.length&&(d.children=m),d}).filter(function(o){return o})}return t(e)}function Ol(e,t,r){var n=aa(r),o=n._title,a=n.key,u=n.children,c=new Set(t===!0?[]:t),f=[];function d(m){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return m.map(function(g,w){for(var C=v1(b?b.pos:"0",w),D=ui(g[a],C),p,B=0;B<o.length;B+=1){var F=o[B];if(g[F]!==void 0){p=g[F];break}}var S=Object.assign(Jn(g,[].concat(At(o),[a,u])),{title:p,key:D,parent:b,pos:C,children:null,data:g,isStart:[].concat(At(b?b.isStart:[]),[w===0]),isEnd:[].concat(At(b?b.isEnd:[]),[w===m.length-1])});return f.push(S),t===!0||c.has(D)?S.children=d(g[u]||[],S):S.children=[],S})}return d(e),f}function w3(e,t,r){var n={};En(r)==="object"?n=r:n={externalGetKey:r},n=n||{};var o=n,a=o.childrenPropName,u=o.externalGetKey,c=o.fieldNames,f=aa(c),d=f.key,m=f.children,b=a||m,g;u?typeof u=="string"?g=function(D){return D[u]}:typeof u=="function"&&(g=function(D){return u(D)}):g=function(D,p){return ui(D[d],p)};function w(C,D,p,B){var F=C?C[b]:e,S=C?v1(p.pos,D):"0",O=C?[].concat(At(B),[C]):[];if(C){var M=g(C,S),_={node:C,index:D,pos:S,key:M,parentPos:p.node?p.pos:null,level:p.level+1,nodes:O};t(_)}F&&F.forEach(function(z,K){w(z,K,{node:C,pos:S,level:p?p.level+1:-1},O)})}w(null)}function F0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.initWrapper,n=t.processEntity,o=t.onProcessFinished,a=t.externalGetKey,u=t.childrenPropName,c=t.fieldNames,f=arguments.length>2?arguments[2]:void 0,d=a||f,m={},b={},g={posEntities:m,keyEntities:b};return r&&(g=r(g)||g),w3(e,function(w){var C=w.node,D=w.index,p=w.pos,B=w.key,F=w.parentPos,S=w.level,O=w.nodes,M={node:C,nodes:O,index:D,key:B,pos:p,level:S},_=ui(B,p);m[p]=M,b[_]=M,M.parent=m[F],M.parent&&(M.parent.children=M.parent.children||[],M.parent.children.push(M)),n&&n(M,g)},{externalGetKey:d,childrenPropName:u,fieldNames:c}),o&&o(g),g}function ja(e,t){var r=t.expandedKeys,n=t.selectedKeys,o=t.loadedKeys,a=t.loadingKeys,u=t.checkedKeys,c=t.halfCheckedKeys,f=t.dragOverNodeKey,d=t.dropPosition,m=t.keyEntities,b=tn(m,e),g={eventKey:e,expanded:r.indexOf(e)!==-1,selected:n.indexOf(e)!==-1,loaded:o.indexOf(e)!==-1,loading:a.indexOf(e)!==-1,checked:u.indexOf(e)!==-1,halfChecked:c.indexOf(e)!==-1,pos:String(b?b.pos:""),dragOver:f===e&&d===0,dragOverGapTop:f===e&&d===-1,dragOverGapBottom:f===e&&d===1};return g}function Br(e){var t=e.data,r=e.expanded,n=e.selected,o=e.checked,a=e.loaded,u=e.loading,c=e.halfChecked,f=e.dragOver,d=e.dragOverGapTop,m=e.dragOverGapBottom,b=e.pos,g=e.active,w=e.eventKey,C=qe(qe({},t),{},{expanded:r,selected:n,checked:o,loaded:a,loading:u,halfChecked:c,dragOver:f,dragOverGapTop:d,dragOverGapBottom:m,pos:b,active:g,key:w});return"props"in C||Object.defineProperty(C,"props",{get:function(){return zn(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),C}function y1(e,t){var r=new Set;return e.forEach(function(n){t.has(n)||r.add(n)}),r}function D3(e){var t=e||{},r=t.disabled,n=t.disableCheckbox,o=t.checkable;return!!(r||n)||o===!1}function E3(e,t,r,n){for(var o=new Set(e),a=new Set,u=0;u<=r;u+=1){var c=t.get(u)||new Set;c.forEach(function(b){var g=b.key,w=b.node,C=b.children,D=C===void 0?[]:C;o.has(g)&&!n(w)&&D.filter(function(p){return!n(p.node)}).forEach(function(p){o.add(p.key)})})}for(var f=new Set,d=r;d>=0;d-=1){var m=t.get(d)||new Set;m.forEach(function(b){var g=b.parent,w=b.node;if(!(n(w)||!b.parent||f.has(b.parent.key))){if(n(b.parent.node)){f.add(g.key);return}var C=!0,D=!1;(g.children||[]).filter(function(p){return!n(p.node)}).forEach(function(p){var B=p.key,F=o.has(B);C&&!F&&(C=!1),!D&&(F||a.has(B))&&(D=!0)}),C&&o.add(g.key),D&&a.add(g.key),f.add(g.key)}})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(y1(a,o))}}function k3(e,t,r,n,o){for(var a=new Set(e),u=new Set(t),c=0;c<=n;c+=1){var f=r.get(c)||new Set;f.forEach(function(g){var w=g.key,C=g.node,D=g.children,p=D===void 0?[]:D;!a.has(w)&&!u.has(w)&&!o(C)&&p.filter(function(B){return!o(B.node)}).forEach(function(B){a.delete(B.key)})})}u=new Set;for(var d=new Set,m=n;m>=0;m-=1){var b=r.get(m)||new Set;b.forEach(function(g){var w=g.parent,C=g.node;if(!(o(C)||!g.parent||d.has(g.parent.key))){if(o(g.parent.node)){d.add(w.key);return}var D=!0,p=!1;(w.children||[]).filter(function(B){return!o(B.node)}).forEach(function(B){var F=B.key,S=a.has(F);D&&!S&&(D=!1),!p&&(S||u.has(F))&&(p=!0)}),D||a.delete(w.key),p&&u.add(w.key),d.add(w.key)}})}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(y1(u,a))}}function ea(e,t,r,n){var o=[],a;n?a=n:a=D3;var u=new Set(e.filter(function(m){var b=!!tn(r,m);return b||o.push(m),b})),c=new Map,f=0;Object.keys(r).forEach(function(m){var b=r[m],g=b.level,w=c.get(g);w||(w=new Set,c.set(g,w)),w.add(b),f=Math.max(f,g)}),zn(!o.length,"Tree missing follow keys: ".concat(o.slice(0,100).map(function(m){return"'".concat(m,"'")}).join(", ")));var d;return t===!0?d=E3(u,c,f,a):d=k3(u,t.halfCheckedKeys,c,f,a),d}var S3=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const x1=e=>{const{getPopupContainer:t,getPrefixCls:r,direction:n}=k.useContext(bo),{prefixCls:o,type:a="default",danger:u,disabled:c,loading:f,onClick:d,htmlType:m,children:b,className:g,menu:w,arrow:C,autoFocus:D,overlay:p,trigger:B,align:F,open:S,onOpenChange:O,placement:M,getPopupContainer:_,href:z,icon:K=k.createElement(f1,null),title:$,buttonsRender:Q=Ce=>Ce,mouseEnterDelay:V,mouseLeaveDelay:X,overlayClassName:G,overlayStyle:j,destroyOnHidden:H,destroyPopupOnHide:U,dropdownRender:R,popupRender:te}=e,q=S3(e,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyOnHidden","destroyPopupOnHide","dropdownRender","popupRender"]),se=r("dropdown",o),ye=`${se}-button`,ie={menu:w,arrow:C,autoFocus:D,align:F,disabled:c,trigger:c?[]:B,onOpenChange:O,getPopupContainer:_||t,mouseEnterDelay:V,mouseLeaveDelay:X,overlayClassName:G,overlayStyle:j,destroyOnHidden:H,popupRender:te||R},{compactSize:me,compactItemClassnames:Oe}=j4(se,n),ee=tt(ye,Oe,g);"destroyPopupOnHide"in e&&(ie.destroyPopupOnHide=U),"overlay"in e&&(ie.overlay=p),"open"in e&&(ie.open=S),"placement"in e?ie.placement=M:ie.placement=n==="rtl"?"bottomLeft":"bottomRight";const pe=k.createElement(is,{type:a,danger:u,disabled:c,loading:f,onClick:d,htmlType:m,href:z,title:$},b),le=k.createElement(is,{type:a,danger:u,icon:K}),[ue,De]=Q([pe,le]);return k.createElement(t2.Compact,Object.assign({className:ee,size:me,block:!0},q),ue,k.createElement(Rs,Object.assign({},ie),De))};x1.__ANT_BUTTON=!0;const N0=Rs;N0.Button=x1;function Ld(e,t,r,n){var o=wu.unstable_batchedUpdates?function(u){wu.unstable_batchedUpdates(r,u)}:r;return e!=null&&e.addEventListener&&e.addEventListener(t,o,n),{remove:function(){e!=null&&e.removeEventListener&&e.removeEventListener(t,o,n)}}}var uo={},ci="rc-table-internal-hook";function O0(e){var t=k.createContext(void 0),r=function(o){var a=o.value,u=o.children,c=k.useRef(a);c.current=a;var f=k.useState(function(){return{getValue:function(){return c.current},listeners:new Set}}),d=wt(f,1),m=d[0];return po(function(){D4(function(){m.listeners.forEach(function(b){b(a)})})},[a]),k.createElement(t.Provider,{value:m},u)};return{Context:t,Provider:r,defaultValue:e}}function Ir(e,t){var r=wn(typeof t=="function"?t:function(b){if(t===void 0)return b;if(!Array.isArray(t))return b[t];var g={};return t.forEach(function(w){g[w]=b[w]}),g}),n=k.useContext(e==null?void 0:e.Context),o=n||{},a=o.listeners,u=o.getValue,c=k.useRef();c.current=r(n?u():e==null?void 0:e.defaultValue);var f=k.useState({}),d=wt(f,2),m=d[1];return po(function(){if(!n)return;function b(g){var w=r(g);Ro(c.current,w,!0)||m({})}return a.add(b),function(){a.delete(b)}},[n]),c.current}function B3(){var e=k.createContext(null);function t(){return k.useContext(e)}function r(o,a){var u=ns(o),c=function(d,m){var b=u?{ref:m}:{},g=k.useRef(0),w=k.useRef(d),C=t();return C!==null?k.createElement(o,vt({},d,b)):((!a||a(w.current,d))&&(g.current+=1),w.current=d,k.createElement(e.Provider,{value:g.current},k.createElement(o,vt({},d,b))))};return u?k.forwardRef(c):c}function n(o,a){var u=ns(o),c=function(d,m){var b=u?{ref:m}:{};return t(),k.createElement(o,vt({},d,b))};return u?k.memo(k.forwardRef(c),a):k.memo(c,a)}return{makeImmutable:r,responseImmutable:n,useImmutableMark:t}}var $0=B3(),C1=$0.makeImmutable,ma=$0.responseImmutable,A3=$0.useImmutableMark,Hr=O0(),w1=k.createContext({renderWithProps:!1}),F3="RC_TABLE_KEY";function N3(e){return e==null?[]:Array.isArray(e)?e:[e]}function Ps(e){var t=[],r={};return e.forEach(function(n){for(var o=n||{},a=o.key,u=o.dataIndex,c=a||N3(u).join("-")||F3;r[c];)c="".concat(c,"_next");r[c]=!0,t.push(c)}),t}function Ou(e){return e!=null}function O3(e){return typeof e=="number"&&!Number.isNaN(e)}function $3(e){return e&&En(e)==="object"&&!Array.isArray(e)&&!k.isValidElement(e)}function T3(e,t,r,n,o,a){var u=k.useContext(w1),c=A3(),f=g0(function(){if(Ou(n))return[n];var d=t==null||t===""?[]:Array.isArray(t)?t:[t],m=y0(e,d),b=m,g=void 0;if(o){var w=o(m,e,r);$3(w)?(b=w.children,g=w.props,u.renderWithProps=!0):b=w}return[b,g]},[c,e,n,t,o,r],function(d,m){if(a){var b=wt(d,2),g=b[1],w=wt(m,2),C=w[1];return a(C,g)}return u.renderWithProps?!0:!Ro(d,m,!0)});return f}function M3(e,t,r,n){var o=e+t-1;return e<=n&&o>=r}function R3(e,t){return Ir(Hr,function(r){var n=M3(e,t||1,r.hoverStartRow,r.hoverEndRow);return[n,r.onHover]})}var P3=function(t){var r=t.ellipsis,n=t.rowType,o=t.children,a,u=r===!0?{showTitle:!0}:r;return u&&(u.showTitle||n==="header")&&(typeof o=="string"||typeof o=="number"?a=o.toString():k.isValidElement(o)&&typeof o.props.children=="string"&&(a=o.props.children)),a};function I3(e){var t,r,n,o,a,u,c,f,d=e.component,m=e.children,b=e.ellipsis,g=e.scope,w=e.prefixCls,C=e.className,D=e.align,p=e.record,B=e.render,F=e.dataIndex,S=e.renderIndex,O=e.shouldCellUpdate,M=e.index,_=e.rowType,z=e.colSpan,K=e.rowSpan,$=e.fixLeft,Q=e.fixRight,V=e.firstFixLeft,X=e.lastFixLeft,G=e.firstFixRight,j=e.lastFixRight,H=e.appendNode,U=e.additionalProps,R=U===void 0?{}:U,te=e.isSticky,q="".concat(w,"-cell"),se=Ir(Hr,["supportSticky","allColumnsFixedLeft","rowHoverable"]),ye=se.supportSticky,we=se.allColumnsFixedLeft,ie=se.rowHoverable,me=T3(p,F,S,m,B,O),Oe=wt(me,2),ee=Oe[0],pe=Oe[1],le={},ue=typeof $=="number"&&ye,De=typeof Q=="number"&&ye;ue&&(le.position="sticky",le.left=$),De&&(le.position="sticky",le.right=Q);var Ce=(t=(r=(n=pe==null?void 0:pe.colSpan)!==null&&n!==void 0?n:R.colSpan)!==null&&r!==void 0?r:z)!==null&&t!==void 0?t:1,Ee=(o=(a=(u=pe==null?void 0:pe.rowSpan)!==null&&u!==void 0?u:R.rowSpan)!==null&&a!==void 0?a:K)!==null&&o!==void 0?o:1,Fe=R3(M,Ee),Be=wt(Fe,2),Ne=Be[0],ze=Be[1],Me=wn(function(ft){var Je;p&&ze(M,M+Ee-1),R==null||(Je=R.onMouseEnter)===null||Je===void 0||Je.call(R,ft)}),Ge=wn(function(ft){var Je;p&&ze(-1,-1),R==null||(Je=R.onMouseLeave)===null||Je===void 0||Je.call(R,ft)});if(Ce===0||Ee===0)return null;var dt=(c=R.title)!==null&&c!==void 0?c:P3({rowType:_,ellipsis:b,children:ee}),ut=tt(q,C,(f={},Te(Te(Te(Te(Te(Te(Te(Te(Te(Te(f,"".concat(q,"-fix-left"),ue&&ye),"".concat(q,"-fix-left-first"),V&&ye),"".concat(q,"-fix-left-last"),X&&ye),"".concat(q,"-fix-left-all"),X&&we&&ye),"".concat(q,"-fix-right"),De&&ye),"".concat(q,"-fix-right-first"),G&&ye),"".concat(q,"-fix-right-last"),j&&ye),"".concat(q,"-ellipsis"),b),"".concat(q,"-with-append"),H),"".concat(q,"-fix-sticky"),(ue||De)&&te&&ye),Te(f,"".concat(q,"-row-hover"),!pe&&Ne)),R.className,pe==null?void 0:pe.className),Pe={};D&&(Pe.textAlign=D);var Le=qe(qe(qe(qe({},pe==null?void 0:pe.style),le),Pe),R.style),Ve=ee;return En(Ve)==="object"&&!Array.isArray(Ve)&&!k.isValidElement(Ve)&&(Ve=null),b&&(X||G)&&(Ve=k.createElement("span",{className:"".concat(q,"-content")},Ve)),k.createElement(d,vt({},pe,R,{className:ut,style:Le,title:dt,scope:g,onMouseEnter:ie?Me:void 0,onMouseLeave:ie?Ge:void 0,colSpan:Ce!==1?Ce:null,rowSpan:Ee!==1?Ee:null}),H,Ve)}const ga=k.memo(I3);function T0(e,t,r,n,o){var a=r[e]||{},u=r[t]||{},c,f;a.fixed==="left"?c=n.left[o==="rtl"?t:e]:u.fixed==="right"&&(f=n.right[o==="rtl"?e:t]);var d=!1,m=!1,b=!1,g=!1,w=r[t+1],C=r[e-1],D=w&&!w.fixed||C&&!C.fixed||r.every(function(O){return O.fixed==="left"});if(o==="rtl"){if(c!==void 0){var p=C&&C.fixed==="left";g=!p&&D}else if(f!==void 0){var B=w&&w.fixed==="right";b=!B&&D}}else if(c!==void 0){var F=w&&w.fixed==="left";d=!F&&D}else if(f!==void 0){var S=C&&C.fixed==="right";m=!S&&D}return{fixLeft:c,fixRight:f,lastFixLeft:d,firstFixRight:m,lastFixRight:b,firstFixLeft:g,isSticky:n.isSticky}}var D1=k.createContext({});function z3(e){var t=e.className,r=e.index,n=e.children,o=e.colSpan,a=o===void 0?1:o,u=e.rowSpan,c=e.align,f=Ir(Hr,["prefixCls","direction"]),d=f.prefixCls,m=f.direction,b=k.useContext(D1),g=b.scrollColumnIndex,w=b.stickyOffsets,C=b.flattenColumns,D=r+a-1,p=D+1===g?a+1:a,B=T0(r,r+p-1,C,w,m);return k.createElement(ga,vt({className:t,index:r,component:"td",prefixCls:d,record:null,dataIndex:null,align:c,colSpan:p,rowSpan:u,render:function(){return n}},B))}var j3=["children"];function _3(e){var t=e.children,r=yr(e,j3);return k.createElement("tr",r,t)}function Is(e){var t=e.children;return t}Is.Row=_3;Is.Cell=z3;function L3(e){var t=e.children,r=e.stickyOffsets,n=e.flattenColumns,o=Ir(Hr,"prefixCls"),a=n.length-1,u=n[a],c=k.useMemo(function(){return{stickyOffsets:r,flattenColumns:n,scrollColumnIndex:u!=null&&u.scrollbar?a:null}},[u,n,a,r]);return k.createElement(D1.Provider,{value:c},k.createElement("tfoot",{className:"".concat(o,"-summary")},t))}const Ei=ma(L3);var E1=Is;function H3(e){return null}function K3(e){return null}function k1(e,t,r,n,o,a,u){var c=a(t,u);e.push({record:t,indent:r,index:u,rowKey:c});var f=o==null?void 0:o.has(c);if(t&&Array.isArray(t[n])&&f)for(var d=0;d<t[n].length;d+=1)k1(e,t[n][d],r+1,n,o,a,d)}function S1(e,t,r,n){var o=k.useMemo(function(){if(r!=null&&r.size){for(var a=[],u=0;u<(e==null?void 0:e.length);u+=1){var c=e[u];k1(a,c,0,t,r,n,u)}return a}return e==null?void 0:e.map(function(f,d){return{record:f,indent:0,index:d,rowKey:n(f,d)}})},[e,t,r,n]);return o}function B1(e,t,r,n){var o=Ir(Hr,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),a=o.flattenColumns,u=o.expandableType,c=o.expandedKeys,f=o.childrenColumnName,d=o.onTriggerExpand,m=o.rowExpandable,b=o.onRow,g=o.expandRowByClick,w=o.rowClassName,C=u==="nest",D=u==="row"&&(!m||m(e)),p=D||C,B=c&&c.has(t),F=f&&e&&e[f],S=wn(d),O=b==null?void 0:b(e,r),M=O==null?void 0:O.onClick,_=function(Q){g&&p&&d(e,Q);for(var V=arguments.length,X=new Array(V>1?V-1:0),G=1;G<V;G++)X[G-1]=arguments[G];M==null||M.apply(void 0,[Q].concat(X))},z;typeof w=="string"?z=w:typeof w=="function"&&(z=w(e,r,n));var K=Ps(a);return qe(qe({},o),{},{columnsKey:K,nestExpandable:C,expanded:B,hasNestChildren:F,record:e,onTriggerExpand:S,rowSupportExpand:D,expandable:p,rowProps:qe(qe({},O),{},{className:tt(z,O==null?void 0:O.className),onClick:_})})}function A1(e){var t=e.prefixCls,r=e.children,n=e.component,o=e.cellComponent,a=e.className,u=e.expanded,c=e.colSpan,f=e.isEmpty,d=e.stickyOffset,m=d===void 0?0:d,b=Ir(Hr,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),g=b.scrollbarSize,w=b.fixHeader,C=b.fixColumn,D=b.componentWidth,p=b.horizonScroll,B=r;return(f?p&&D:C)&&(B=k.createElement("div",{style:{width:D-m-(w&&!f?g:0),position:"sticky",left:m,overflow:"hidden"},className:"".concat(t,"-expanded-row-fixed")},B)),k.createElement(n,{className:a,style:{display:u?null:"none"}},k.createElement(ga,{component:o,prefixCls:t,colSpan:c},B))}function q3(e){var t=e.prefixCls,r=e.record,n=e.onExpand,o=e.expanded,a=e.expandable,u="".concat(t,"-row-expand-icon");if(!a)return k.createElement("span",{className:tt(u,"".concat(t,"-row-spaced"))});var c=function(d){n(r,d),d.stopPropagation()};return k.createElement("span",{className:tt(u,Te(Te({},"".concat(t,"-row-expanded"),o),"".concat(t,"-row-collapsed"),!o)),onClick:c})}function W3(e,t,r){var n=[];function o(a){(a||[]).forEach(function(u,c){n.push(t(u,c)),o(u[r])})}return o(e),n}function F1(e,t,r,n){return typeof e=="string"?e:typeof e=="function"?e(t,r,n):""}function N1(e,t,r,n,o){var a,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,f=e.record,d=e.prefixCls,m=e.columnsKey,b=e.fixedInfoList,g=e.expandIconColumnIndex,w=e.nestExpandable,C=e.indentSize,D=e.expandIcon,p=e.expanded,B=e.hasNestChildren,F=e.onTriggerExpand,S=e.expandable,O=e.expandedKeys,M=m[r],_=b[r],z;r===(g||0)&&w&&(z=k.createElement(k.Fragment,null,k.createElement("span",{style:{paddingLeft:"".concat(C*n,"px")},className:"".concat(d,"-row-indent indent-level-").concat(n)}),D({prefixCls:d,expanded:p,expandable:B,record:f,onExpand:F})));var K=((a=t.onCell)===null||a===void 0?void 0:a.call(t,f,o))||{};if(c){var $=K.rowSpan,Q=$===void 0?1:$;if(S&&Q&&r<c){for(var V=Q,X=o;X<o+Q;X+=1){var G=u[X];O.has(G)&&(V+=1)}K.rowSpan=V}}return{key:M,fixedInfo:_,appendCellNode:z,additionalCellProps:K}}function V3(e){var t=e.className,r=e.style,n=e.record,o=e.index,a=e.renderIndex,u=e.rowKey,c=e.rowKeys,f=e.indent,d=f===void 0?0:f,m=e.rowComponent,b=e.cellComponent,g=e.scopeCellComponent,w=e.expandedRowInfo,C=B1(n,u,o,d),D=C.prefixCls,p=C.flattenColumns,B=C.expandedRowClassName,F=C.expandedRowRender,S=C.rowProps,O=C.expanded,M=C.rowSupportExpand,_=k.useRef(!1);_.current||(_.current=O);var z=F1(B,n,o,d),K=k.createElement(m,vt({},S,{"data-row-key":u,className:tt(t,"".concat(D,"-row"),"".concat(D,"-row-level-").concat(d),S==null?void 0:S.className,Te({},z,d>=1)),style:qe(qe({},r),S==null?void 0:S.style)}),p.map(function(V,X){var G=V.render,j=V.dataIndex,H=V.className,U=N1(C,V,X,d,o,c,w==null?void 0:w.offset),R=U.key,te=U.fixedInfo,q=U.appendCellNode,se=U.additionalCellProps;return k.createElement(ga,vt({className:H,ellipsis:V.ellipsis,align:V.align,scope:V.rowScope,component:V.rowScope?g:b,prefixCls:D,key:R,record:n,index:o,renderIndex:a,dataIndex:j,render:G,shouldCellUpdate:V.shouldCellUpdate},te,{appendNode:q,additionalProps:se}))})),$;if(M&&(_.current||O)){var Q=F(n,o,d+1,O);$=k.createElement(A1,{expanded:O,className:tt("".concat(D,"-expanded-row"),"".concat(D,"-expanded-row-level-").concat(d+1),z),prefixCls:D,component:m,cellComponent:b,colSpan:w?w.colSpan:p.length,stickyOffset:w==null?void 0:w.sticky,isEmpty:!1},Q)}return k.createElement(k.Fragment,null,K,$)}const U3=ma(V3);function Y3(e){var t=e.columnKey,r=e.onColumnResize,n=e.prefixCls,o=e.title,a=k.useRef();return po(function(){a.current&&r(t,a.current.offsetWidth)},[]),k.createElement(x0,{data:t},k.createElement("th",{ref:a,className:"".concat(n,"-measure-cell")},k.createElement("div",{className:"".concat(n,"-measure-cell-content")},o||"\xA0")))}function G3(e){var t=e.prefixCls,r=e.columnsKey,n=e.onColumnResize,o=e.columns,a=k.useRef(null),u=Ir(Hr,["measureRowRender"]),c=u.measureRowRender,f=k.createElement("tr",{"aria-hidden":"true",className:"".concat(t,"-measure-row"),ref:a,tabIndex:-1},k.createElement(x0.Collection,{onBatchResize:function(m){Pp(a.current)&&m.forEach(function(b){var g=b.data,w=b.size;n(g,w.offsetWidth)})}},r.map(function(d){var m=o.find(function(w){return w.key===d}),b=m==null?void 0:m.title,g=k.isValidElement(b)?k.cloneElement(b,{ref:null}):b;return k.createElement(Y3,{prefixCls:t,key:d,columnKey:d,onColumnResize:n,title:g})})));return c?c(f):f}function X3(e){var t=e.data,r=e.measureColumnWidth,n=Ir(Hr,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode","expandedRowOffset","fixedInfoList","colWidths"]),o=n.prefixCls,a=n.getComponent,u=n.onColumnResize,c=n.flattenColumns,f=n.getRowKey,d=n.expandedKeys,m=n.childrenColumnName,b=n.emptyNode,g=n.expandedRowOffset,w=g===void 0?0:g,C=n.colWidths,D=S1(t,m,d,f),p=k.useMemo(function(){return D.map(function($){return $.rowKey})},[D]),B=k.useRef({renderWithProps:!1}),F=k.useMemo(function(){for(var $=c.length-w,Q=0,V=0;V<w;V+=1)Q+=C[V]||0;return{offset:w,colSpan:$,sticky:Q}},[c.length,w,C]),S=a(["body","wrapper"],"tbody"),O=a(["body","row"],"tr"),M=a(["body","cell"],"td"),_=a(["body","cell"],"th"),z;t.length?z=D.map(function($,Q){var V=$.record,X=$.indent,G=$.index,j=$.rowKey;return k.createElement(U3,{key:j,rowKey:j,rowKeys:p,record:V,index:Q,renderIndex:G,rowComponent:O,cellComponent:M,scopeCellComponent:_,indent:X,expandedRowInfo:F})}):z=k.createElement(A1,{expanded:!0,className:"".concat(o,"-placeholder"),prefixCls:o,component:O,cellComponent:M,colSpan:c.length,isEmpty:!0},b);var K=Ps(c);return k.createElement(w1.Provider,{value:B.current},k.createElement(S,{className:"".concat(o,"-tbody")},r&&k.createElement(G3,{prefixCls:o,columnsKey:K,onColumnResize:u,columns:c}),z))}const Q3=ma(X3);var Z3=["expandable"],_a="RC_TABLE_INTERNAL_COL_DEFINE";function J3(e){var t=e.expandable,r=yr(e,Z3),n;return"expandable"in e?n=qe(qe({},r),t):n=r,n.showExpandColumn===!1&&(n.expandIconColumnIndex=-1),n}var ev=["columnType"];function O1(e){for(var t=e.colWidths,r=e.columns,n=e.columCount,o=Ir(Hr,["tableLayout"]),a=o.tableLayout,u=[],c=n||r.length,f=!1,d=c-1;d>=0;d-=1){var m=t[d],b=r&&r[d],g=void 0,w=void 0;if(b&&(g=b[_a],a==="auto"&&(w=b.minWidth)),m||w||g||f){var C=g||{};C.columnType;var D=yr(C,ev);u.unshift(k.createElement("col",vt({key:d,style:{width:m,minWidth:w}},D))),f=!0}}return u.length>0?k.createElement("colgroup",null,u):null}var tv=["className","noData","columns","flattenColumns","colWidths","colGroup","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","scrollX","tableLayout","onScroll","children"];function rv(e,t){return xt(function(){for(var r=[],n=0;n<t;n+=1){var o=e[n];if(o!==void 0)r[n]=o;else return null}return r},[e.join("_"),t])}var nv=k.forwardRef(function(e,t){var r=e.className,n=e.noData,o=e.columns,a=e.flattenColumns,u=e.colWidths,c=e.colGroup,f=e.columCount,d=e.stickyOffsets,m=e.direction,b=e.fixHeader,g=e.stickyTopOffset,w=e.stickyBottomOffset,C=e.stickyClassName,D=e.scrollX,p=e.tableLayout,B=p===void 0?"fixed":p,F=e.onScroll,S=e.children,O=yr(e,tv),M=Ir(Hr,["prefixCls","scrollbarSize","isSticky","getComponent"]),_=M.prefixCls,z=M.scrollbarSize,K=M.isSticky,$=M.getComponent,Q=$(["header","table"],"table"),V=K&&!b?0:z,X=k.useRef(null),G=k.useCallback(function(ye){Sd(t,ye),Sd(X,ye)},[]);k.useEffect(function(){function ye(ie){var me=ie,Oe=me.currentTarget,ee=me.deltaX;ee&&(F({currentTarget:Oe,scrollLeft:Oe.scrollLeft+ee}),ie.preventDefault())}var we=X.current;return we==null||we.addEventListener("wheel",ye,{passive:!1}),function(){we==null||we.removeEventListener("wheel",ye)}},[]);var j=a[a.length-1],H={fixed:j?j.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(_,"-cell-scrollbar")}}},U=xt(function(){return V?[].concat(At(o),[H]):o},[V,o]),R=xt(function(){return V?[].concat(At(a),[H]):a},[V,a]),te=xt(function(){var ye=d.right,we=d.left;return qe(qe({},d),{},{left:m==="rtl"?[].concat(At(we.map(function(ie){return ie+V})),[0]):we,right:m==="rtl"?ye:[].concat(At(ye.map(function(ie){return ie+V})),[0]),isSticky:K})},[V,d,K]),q=rv(u,f),se=xt(function(){var ye=!q||!q.length||q.every(function(we){return!we});return n||ye},[n,q]);return k.createElement("div",{style:qe({overflow:"hidden"},K?{top:g,bottom:w}:{}),ref:G,className:tt(r,Te({},C,!!C))},k.createElement(Q,{style:{tableLayout:B,minWidth:"100%",width:D}},se?c:k.createElement(O1,{colWidths:[].concat(At(q),[V]),columCount:f+1,columns:R}),S(qe(qe({},O),{},{stickyOffsets:te,columns:U,flattenColumns:R}))))});const Hd=k.memo(nv);var ov=function(t){var r=t.cells,n=t.stickyOffsets,o=t.flattenColumns,a=t.rowComponent,u=t.cellComponent,c=t.onHeaderRow,f=t.index,d=Ir(Hr,["prefixCls","direction"]),m=d.prefixCls,b=d.direction,g;c&&(g=c(r.map(function(C){return C.column}),f));var w=Ps(r.map(function(C){return C.column}));return k.createElement(a,g,r.map(function(C,D){var p=C.column,B=T0(C.colStart,C.colEnd,o,n,b),F;return p&&p.onHeaderCell&&(F=C.column.onHeaderCell(p)),k.createElement(ga,vt({},C,{scope:p.title?C.colSpan>1?"colgroup":"col":null,ellipsis:p.ellipsis,align:p.align,component:u,prefixCls:m,key:w[D]},B,{additionalProps:F,rowType:"header"}))}))};function av(e){var t=[];function r(u,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t[f]=t[f]||[];var d=c,m=u.filter(Boolean).map(function(b){var g={key:b.key,className:b.className||"",children:b.title,column:b,colStart:d},w=1,C=b.children;return C&&C.length>0&&(w=r(C,d,f+1).reduce(function(D,p){return D+p},0),g.hasSubColumns=!0),"colSpan"in b&&(w=b.colSpan),"rowSpan"in b&&(g.rowSpan=b.rowSpan),g.colSpan=w,g.colEnd=g.colStart+w-1,t[f].push(g),d+=w,w});return m}r(e,0);for(var n=t.length,o=function(c){t[c].forEach(function(f){!("rowSpan"in f)&&!f.hasSubColumns&&(f.rowSpan=n-c)})},a=0;a<n;a+=1)o(a);return t}var iv=function(t){var r=t.stickyOffsets,n=t.columns,o=t.flattenColumns,a=t.onHeaderRow,u=Ir(Hr,["prefixCls","getComponent"]),c=u.prefixCls,f=u.getComponent,d=k.useMemo(function(){return av(n)},[n]),m=f(["header","wrapper"],"thead"),b=f(["header","row"],"tr"),g=f(["header","cell"],"th");return k.createElement(m,{className:"".concat(c,"-thead")},d.map(function(w,C){var D=k.createElement(ov,{key:C,flattenColumns:o,cells:w,stickyOffsets:r,rowComponent:b,cellComponent:g,onHeaderRow:a,index:C});return D}))};const Kd=ma(iv);function qd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return typeof t=="number"?t:t.endsWith("%")?e*parseFloat(t)/100:null}function sv(e,t,r){return k.useMemo(function(){if(t&&t>0){var n=0,o=0;e.forEach(function(g){var w=qd(t,g.width);w?n+=w:o+=1});var a=Math.max(t,r),u=Math.max(a-n,o),c=o,f=u/o,d=0,m=e.map(function(g){var w=qe({},g),C=qd(t,w.width);if(C)w.width=C;else{var D=Math.floor(f);w.width=c===1?u:D,u-=D,c-=1}return d+=w.width,w});if(d<a){var b=a/d;u=a,m.forEach(function(g,w){var C=Math.floor(g.width*b);g.width=w===m.length-1?u:C,u-=C})}return[m,Math.max(d,a)]}return[e,t]},[e,t,r])}var lv=["children"],uv=["fixed"];function M0(e){return As(e).filter(function(t){return k.isValidElement(t)}).map(function(t){var r=t.key,n=t.props,o=n.children,a=yr(n,lv),u=qe({key:r},a);return o&&(u.children=M0(o)),u})}function $1(e){return e.filter(function(t){return t&&En(t)==="object"&&!t.hidden}).map(function(t){var r=t.children;return r&&r.length>0?qe(qe({},t),{},{children:$1(r)}):t})}function $u(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return e.filter(function(r){return r&&En(r)==="object"}).reduce(function(r,n,o){var a=n.fixed,u=a===!0?"left":a,c="".concat(t,"-").concat(o),f=n.children;return f&&f.length>0?[].concat(At(r),At($u(f,c).map(function(d){var m;return qe(qe({},d),{},{fixed:(m=d.fixed)!==null&&m!==void 0?m:u})}))):[].concat(At(r),[qe(qe({key:c},n),{},{fixed:u})])},[])}function cv(e){return e.map(function(t){var r=t.fixed,n=yr(t,uv),o=r;return r==="left"?o="right":r==="right"&&(o="left"),qe({fixed:o},n)})}function dv(e,t){var r=e.prefixCls,n=e.columns,o=e.children,a=e.expandable,u=e.expandedKeys,c=e.columnTitle,f=e.getRowKey,d=e.onTriggerExpand,m=e.expandIcon,b=e.rowExpandable,g=e.expandIconColumnIndex,w=e.expandedRowOffset,C=w===void 0?0:w,D=e.direction,p=e.expandRowByClick,B=e.columnWidth,F=e.fixed,S=e.scrollWidth,O=e.clientWidth,M=k.useMemo(function(){var j=n||M0(o)||[];return $1(j.slice())},[n,o]),_=k.useMemo(function(){if(a){var j=M.slice();if(!j.includes(uo)){var H=g||0,U=H===0&&F==="right"?M.length:H;U>=0&&j.splice(U,0,uo)}var R=j.indexOf(uo);j=j.filter(function(ye,we){return ye!==uo||we===R});var te=M[R],q;F?q=F:q=te?te.fixed:null;var se=Te(Te(Te(Te(Te(Te({},_a,{className:"".concat(r,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",c),"fixed",q),"className","".concat(r,"-row-expand-icon-cell")),"width",B),"render",function(we,ie,me){var Oe=f(ie,me),ee=u.has(Oe),pe=b?b(ie):!0,le=m({prefixCls:r,expanded:ee,expandable:pe,record:ie,onExpand:d});return p?k.createElement("span",{onClick:function(De){return De.stopPropagation()}},le):le});return j.map(function(ye,we){var ie=ye===uo?se:ye;return we<C?qe(qe({},ie),{},{fixed:ie.fixed||"left"}):ie})}return M.filter(function(ye){return ye!==uo})},[a,M,f,u,m,D,C]),z=k.useMemo(function(){var j=_;return t&&(j=t(j)),j.length||(j=[{render:function(){return null}}]),j},[t,_,D]),K=k.useMemo(function(){return D==="rtl"?cv($u(z)):$u(z)},[z,D,S]),$=k.useMemo(function(){for(var j=-1,H=K.length-1;H>=0;H-=1){var U=K[H].fixed;if(U==="left"||U===!0){j=H;break}}if(j>=0)for(var R=0;R<=j;R+=1){var te=K[R].fixed;if(te!=="left"&&te!==!0)return!0}var q=K.findIndex(function(we){var ie=we.fixed;return ie==="right"});if(q>=0)for(var se=q;se<K.length;se+=1){var ye=K[se].fixed;if(ye!=="right")return!0}return!1},[K]),Q=sv(K,S,O),V=wt(Q,2),X=V[0],G=V[1];return[z,X,G,$]}function fv(e,t,r){var n=J3(e),o=n.expandIcon,a=n.expandedRowKeys,u=n.defaultExpandedRowKeys,c=n.defaultExpandAllRows,f=n.expandedRowRender,d=n.onExpand,m=n.onExpandedRowsChange,b=n.childrenColumnName,g=o||q3,w=b||"children",C=k.useMemo(function(){return f?"row":e.expandable&&e.internalHooks===ci&&e.expandable.__PARENT_RENDER_ICON__||t.some(function(M){return M&&En(M)==="object"&&M[w]})?"nest":!1},[!!f,t]),D=k.useState(function(){return u||(c?W3(t,r,w):[])}),p=wt(D,2),B=p[0],F=p[1],S=k.useMemo(function(){return new Set(a||B||[])},[a,B]),O=k.useCallback(function(M){var _=r(M,t.indexOf(M)),z,K=S.has(_);K?(S.delete(_),z=At(S)):z=[].concat(At(S),[_]),F(z),d&&d(!K,M),m&&m(z)},[r,S,t,d,m]);return[n,C,S,g,w,O]}function hv(e,t,r){var n=e.map(function(o,a){return T0(a,a,e,t,r)});return g0(function(){return n},[n],function(o,a){return!Ro(o,a)})}function pv(e){var t=It(e),r=Pt({}),n=wt(r,2),o=n[1],a=It(null),u=It([]);function c(f){u.current.push(f);var d=Promise.resolve();a.current=d,d.then(function(){if(a.current===d){var m=u.current,b=t.current;u.current=[],m.forEach(function(g){t.current=g(t.current)}),a.current=null,b!==t.current&&o({})}})}return lr(function(){return function(){a.current=null}},[]),[t.current,c]}function mv(e){var t=It(null),r=It();function n(){window.clearTimeout(r.current)}function o(u){t.current=u,n(),r.current=window.setTimeout(function(){t.current=null,r.current=void 0},100)}function a(){return t.current}return lr(function(){return n},[]),[o,a]}function gv(){var e=k.useState(-1),t=wt(e,2),r=t[0],n=t[1],o=k.useState(-1),a=wt(o,2),u=a[0],c=a[1],f=k.useCallback(function(d,m){n(d),c(m)},[]);return[r,u,f]}var Wd=Tp()?window:null;function vv(e,t){var r=En(e)==="object"?e:{},n=r.offsetHeader,o=n===void 0?0:n,a=r.offsetSummary,u=a===void 0?0:a,c=r.offsetScroll,f=c===void 0?0:c,d=r.getContainer,m=d===void 0?function(){return Wd}:d,b=m()||Wd,g=!!e;return k.useMemo(function(){return{isSticky:g,stickyClassName:g?"".concat(t,"-sticky-holder"):"",offsetHeader:o,offsetSummary:u,offsetScroll:f,container:b}},[g,f,o,u,t,b])}function bv(e,t,r){var n=xt(function(){var o=t.length,a=function(d,m,b){for(var g=[],w=0,C=d;C!==m;C+=b)g.push(w),t[C].fixed&&(w+=e[C]||0);return g},u=a(0,o,1),c=a(o-1,-1,-1).reverse();return r==="rtl"?{left:c,right:u}:{left:u,right:c}},[e,t,r]);return n}function Vd(e){var t=e.className,r=e.children;return k.createElement("div",{className:t},r)}function Ud(e){var t=C0(e),r=t.getBoundingClientRect(),n=document.documentElement;return{left:r.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:r.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}var yv=function(t,r){var n,o,a=t.scrollBodyRef,u=t.onScroll,c=t.offsetScroll,f=t.container,d=t.direction,m=Ir(Hr,"prefixCls"),b=((n=a.current)===null||n===void 0?void 0:n.scrollWidth)||0,g=((o=a.current)===null||o===void 0?void 0:o.clientWidth)||0,w=b&&g*(g/b),C=k.useRef(),D=pv({scrollLeft:0,isHiddenScrollBar:!0}),p=wt(D,2),B=p[0],F=p[1],S=k.useRef({delta:0,x:0}),O=k.useState(!1),M=wt(O,2),_=M[0],z=M[1],K=k.useRef(null);k.useEffect(function(){return function(){xn.cancel(K.current)}},[]);var $=function(){z(!1)},Q=function(H){H.persist(),S.current.delta=H.pageX-B.scrollLeft,S.current.x=0,z(!0),H.preventDefault()},V=function(H){var U,R=H||((U=window)===null||U===void 0?void 0:U.event),te=R.buttons;if(!_||te===0){_&&z(!1);return}var q=S.current.x+H.pageX-S.current.x-S.current.delta,se=d==="rtl";q=Math.max(se?w-g:0,Math.min(se?0:g-w,q));var ye=!se||Math.abs(q)+Math.abs(w)<g;ye&&(u({scrollLeft:q/g*(b+2)}),S.current.x=H.pageX)},X=function(){xn.cancel(K.current),K.current=xn(function(){if(a.current){var H=Ud(a.current).top,U=H+a.current.offsetHeight,R=f===window?document.documentElement.scrollTop+window.innerHeight:Ud(f).top+f.clientHeight;F(function(te){return qe(qe({},te),{},{isHiddenScrollBar:U-Bd()<=R||H>=R-c})})}})},G=function(H){F(function(U){return qe(qe({},U),{},{scrollLeft:b?H/b*g:0})})};return k.useImperativeHandle(r,function(){return{setScrollLeft:G,checkScrollBarVisible:X}}),k.useEffect(function(){var j=Ld(document.body,"mouseup",$,!1),H=Ld(document.body,"mousemove",V,!1);return X(),function(){j.remove(),H.remove()}},[w,_]),k.useEffect(function(){if(a.current){for(var j=[],H=C0(a.current);H;)j.push(H),H=H.parentElement;return j.forEach(function(U){return U.addEventListener("scroll",X,!1)}),window.addEventListener("resize",X,!1),window.addEventListener("scroll",X,!1),f.addEventListener("scroll",X,!1),function(){j.forEach(function(U){return U.removeEventListener("scroll",X)}),window.removeEventListener("resize",X),window.removeEventListener("scroll",X),f.removeEventListener("scroll",X)}}},[f]),k.useEffect(function(){B.isHiddenScrollBar||F(function(j){var H=a.current;return H?qe(qe({},j),{},{scrollLeft:H.scrollLeft/H.scrollWidth*H.clientWidth}):j})},[B.isHiddenScrollBar]),b<=g||!w||B.isHiddenScrollBar?null:k.createElement("div",{style:{height:Bd(),width:g,bottom:c},className:"".concat(m,"-sticky-scroll")},k.createElement("div",{onMouseDown:Q,ref:C,className:tt("".concat(m,"-sticky-scroll-bar"),Te({},"".concat(m,"-sticky-scroll-bar-active"),_)),style:{width:"".concat(w,"px"),transform:"translate3d(".concat(B.scrollLeft,"px, 0, 0)")}}))};const xv=k.forwardRef(yv);var T1="rc-table",Cv=[],wv={};function Dv(){return"No Data"}function Ev(e,t){var r=qe({rowKey:"key",prefixCls:T1,emptyText:Dv},e),n=r.prefixCls,o=r.className,a=r.rowClassName,u=r.style,c=r.data,f=r.rowKey,d=r.scroll,m=r.tableLayout,b=r.direction,g=r.title,w=r.footer,C=r.summary,D=r.caption,p=r.id,B=r.showHeader,F=r.components,S=r.emptyText,O=r.onRow,M=r.onHeaderRow,_=r.measureRowRender,z=r.onScroll,K=r.internalHooks,$=r.transformColumns,Q=r.internalRefs,V=r.tailor,X=r.getContainerWidth,G=r.sticky,j=r.rowHoverable,H=j===void 0?!0:j,U=c||Cv,R=!!U.length,te=K===ci,q=k.useCallback(function(Ct,$t){return y0(F,Ct)||$t},[F]),se=k.useMemo(function(){return typeof f=="function"?f:function(Ct){var $t=Ct&&Ct[f];return $t}},[f]),ye=q(["body"]),we=gv(),ie=wt(we,3),me=ie[0],Oe=ie[1],ee=ie[2],pe=fv(r,U,se),le=wt(pe,6),ue=le[0],De=le[1],Ce=le[2],Ee=le[3],Fe=le[4],Be=le[5],Ne=d==null?void 0:d.x,ze=k.useState(0),Me=wt(ze,2),Ge=Me[0],dt=Me[1],ut=dv(qe(qe(qe({},r),ue),{},{expandable:!!ue.expandedRowRender,columnTitle:ue.columnTitle,expandedKeys:Ce,getRowKey:se,onTriggerExpand:Be,expandIcon:Ee,expandIconColumnIndex:ue.expandIconColumnIndex,direction:b,scrollWidth:te&&V&&typeof Ne=="number"?Ne:null,clientWidth:Ge}),te?$:null),Pe=wt(ut,4),Le=Pe[0],Ve=Pe[1],ft=Pe[2],Je=Pe[3],Xe=ft??Ne,St=k.useMemo(function(){return{columns:Le,flattenColumns:Ve}},[Le,Ve]),bt=k.useRef(),ct=k.useRef(),rt=k.useRef(),$e=k.useRef();k.useImperativeHandle(t,function(){return{nativeElement:bt.current,scrollTo:function($t){var Nr;if(rt.current instanceof HTMLElement){var Kr=$t.index,Cr=$t.top,gn=$t.key;if(O3(Cr)){var Qe;(Qe=rt.current)===null||Qe===void 0||Qe.scrollTo({top:Cr})}else{var qr,An=gn??se(U[Kr]);(qr=rt.current.querySelector('[data-row-key="'.concat(An,'"]')))===null||qr===void 0||qr.scrollIntoView()}}else(Nr=rt.current)!==null&&Nr!==void 0&&Nr.scrollTo&&rt.current.scrollTo($t)}}});var de=k.useRef(),it=k.useState(!1),yt=wt(it,2),Dt=yt[0],pt=yt[1],Qt=k.useState(!1),gt=wt(Qt,2),Zt=gt[0],rr=gt[1],nr=k.useState(new Map),ht=wt(nr,2),gr=ht[0],or=ht[1],Dr=Ps(Ve),ot=Dr.map(function(Ct){return gr.get(Ct)}),Er=k.useMemo(function(){return ot},[ot.join("_")]),kr=bv(Er,Ve,b),Vt=d&&Ou(d.y),Jt=d&&Ou(Xe)||!!ue.fixed,Ot=Jt&&Ve.some(function(Ct){var $t=Ct.fixed;return $t}),x=k.useRef(),v=vv(G,n),oe=v.isSticky,A=v.offsetHeader,L=v.offsetSummary,be=v.offsetScroll,xe=v.stickyClassName,ke=v.container,Ie=k.useMemo(function(){return C==null?void 0:C(U)},[C,U]),J=(Vt||oe)&&k.isValidElement(Ie)&&Ie.type===Is&&Ie.props.fixed,ce,he,He;Vt&&(he={overflowY:R?"scroll":"auto",maxHeight:d.y}),Jt&&(ce={overflowX:"auto"},Vt||(he={overflowY:"hidden"}),He={width:Xe===!0?"auto":Xe,minWidth:"100%"});var W=k.useCallback(function(Ct,$t){or(function(Nr){if(Nr.get(Ct)!==$t){var Kr=new Map(Nr);return Kr.set(Ct,$t),Kr}return Nr})},[]),lt=mv(),re=wt(lt,2),et=re[0],kt=re[1];function xr(Ct,$t){$t&&(typeof $t=="function"?$t(Ct):$t.scrollLeft!==Ct&&($t.scrollLeft=Ct,$t.scrollLeft!==Ct&&setTimeout(function(){$t.scrollLeft=Ct},0)))}var _t=wn(function(Ct){var $t=Ct.currentTarget,Nr=Ct.scrollLeft,Kr=b==="rtl",Cr=typeof Nr=="number"?Nr:$t.scrollLeft,gn=$t||wv;if(!kt()||kt()===gn){var Qe;et(gn),xr(Cr,ct.current),xr(Cr,rt.current),xr(Cr,de.current),xr(Cr,(Qe=x.current)===null||Qe===void 0?void 0:Qe.setScrollLeft)}var qr=$t||ct.current;if(qr){var An=te&&V&&typeof Xe=="number"?Xe:qr.scrollWidth,ur=qr.clientWidth;if(An===ur){pt(!1),rr(!1);return}Kr?(pt(-Cr<An-ur),rr(-Cr>0)):(pt(Cr>0),rr(Cr<An-ur))}}),st=wn(function(Ct){_t(Ct),z==null||z(Ct)}),Sn=function(){if(Jt&&rt.current){var $t;_t({currentTarget:C0(rt.current),scrollLeft:($t=rt.current)===null||$t===void 0?void 0:$t.scrollLeft})}else pt(!1),rr(!1)},to=function($t){var Nr,Kr=$t.width;(Nr=x.current)===null||Nr===void 0||Nr.checkScrollBarVisible();var Cr=bt.current?bt.current.offsetWidth:Kr;te&&X&&bt.current&&(Cr=X(bt.current,Cr)||Cr),Cr!==Ge&&(Sn(),dt(Cr))},xo=k.useRef(!1);k.useEffect(function(){xo.current&&Sn()},[Jt,c,Le.length]),k.useEffect(function(){xo.current=!0},[]);var Ca=k.useState(0),pn=wt(Ca,2),Qr=pn[0],jr=pn[1],wa=k.useState(!0),Ho=wt(wa,2),Co=Ho[0],Da=Ho[1];po(function(){(!V||!te)&&(rt.current instanceof Element?jr(Ad(rt.current).width):jr(Ad($e.current).width)),Da(c2("position","sticky"))},[]),k.useEffect(function(){te&&Q&&(Q.body.current=rt.current)});var Ea=k.useCallback(function(Ct){return k.createElement(k.Fragment,null,k.createElement(Kd,Ct),J==="top"&&k.createElement(Ei,Ct,Ie))},[J,Ie]),wo=k.useCallback(function(Ct){return k.createElement(Ei,Ct,Ie)},[Ie]),Fr=q(["table"],"table"),Bn=k.useMemo(function(){return m||(Ot?Xe==="max-content"?"auto":"fixed":Vt||oe||Ve.some(function(Ct){var $t=Ct.ellipsis;return $t})?"fixed":"auto")},[Vt,Ot,Ve,m,oe]),ar,jt={colWidths:Er,columCount:Ve.length,stickyOffsets:kr,onHeaderRow:M,fixHeader:Vt,scroll:d},Ut=k.useMemo(function(){return R?null:typeof S=="function"?S():S},[R,S]),Tr=k.createElement(Q3,{data:U,measureColumnWidth:Vt||Jt||oe}),Sr=k.createElement(O1,{colWidths:Ve.map(function(Ct){var $t=Ct.width;return $t}),columns:Ve}),jn=D!=null?k.createElement("caption",{className:"".concat(n,"-caption")},D):void 0,Do=ss(r,{data:!0}),_n=ss(r,{aria:!0});if(Vt||oe){var Ln;typeof ye=="function"?(Ln=ye(U,{scrollbarSize:Qr,ref:rt,onScroll:_t}),jt.colWidths=Ve.map(function(Ct,$t){var Nr=Ct.width,Kr=$t===Ve.length-1?Nr-Qr:Nr;return typeof Kr=="number"&&!Number.isNaN(Kr)?Kr:0})):Ln=k.createElement("div",{style:qe(qe({},ce),he),onScroll:st,ref:rt,className:tt("".concat(n,"-body"))},k.createElement(Fr,vt({style:qe(qe({},He),{},{tableLayout:Bn})},_n),jn,Sr,Tr,!J&&Ie&&k.createElement(Ei,{stickyOffsets:kr,flattenColumns:Ve},Ie)));var ro=qe(qe(qe({noData:!U.length},jt),St),{},{direction:b,stickyClassName:xe,scrollX:Xe,tableLayout:Bn,onScroll:_t});ar=k.createElement(k.Fragment,null,B!==!1&&k.createElement(Hd,vt({},ro,{stickyTopOffset:A,className:"".concat(n,"-header"),ref:ct,colGroup:Sr}),Ea),Ln,J&&J!=="top"&&k.createElement(Hd,vt({},ro,{stickyBottomOffset:L,className:"".concat(n,"-summary"),ref:de,colGroup:Sr}),wo),oe&&rt.current&&rt.current instanceof Element&&k.createElement(xv,{ref:x,offsetScroll:be,scrollBodyRef:rt,onScroll:_t,container:ke,direction:b}))}else ar=k.createElement("div",{style:qe(qe({},ce),he),className:tt("".concat(n,"-content")),onScroll:_t,ref:rt},k.createElement(Fr,vt({style:qe(qe({},He),{},{tableLayout:Bn})},_n),jn,Sr,B!==!1&&k.createElement(Kd,vt({},jt,St)),Tr,Ie&&k.createElement(Ei,{stickyOffsets:kr,flattenColumns:Ve},Ie)));var ge=k.createElement("div",vt({className:tt(n,o,Te(Te(Te(Te(Te(Te(Te(Te(Te(Te({},"".concat(n,"-rtl"),b==="rtl"),"".concat(n,"-ping-left"),Dt),"".concat(n,"-ping-right"),Zt),"".concat(n,"-layout-fixed"),m==="fixed"),"".concat(n,"-fixed-header"),Vt),"".concat(n,"-fixed-column"),Ot),"".concat(n,"-fixed-column-gapped"),Ot&&Je),"".concat(n,"-scroll-horizontal"),Jt),"".concat(n,"-has-fix-left"),Ve[0]&&Ve[0].fixed),"".concat(n,"-has-fix-right"),Ve[Ve.length-1]&&Ve[Ve.length-1].fixed==="right")),style:u,id:p,ref:bt},Do),g&&k.createElement(Vd,{className:"".concat(n,"-title")},g(U)),k.createElement("div",{ref:$e,className:"".concat(n,"-container")},ar),w&&k.createElement(Vd,{className:"".concat(n,"-footer")},w(U)));Jt&&(ge=k.createElement(x0,{onResize:to},ge));var Yt=hv(Ve,kr,b),mn=k.useMemo(function(){return{scrollX:Xe,prefixCls:n,getComponent:q,scrollbarSize:Qr,direction:b,fixedInfoList:Yt,isSticky:oe,supportSticky:Co,componentWidth:Ge,fixHeader:Vt,fixColumn:Ot,horizonScroll:Jt,tableLayout:Bn,rowClassName:a,expandedRowClassName:ue.expandedRowClassName,expandIcon:Ee,expandableType:De,expandRowByClick:ue.expandRowByClick,expandedRowRender:ue.expandedRowRender,expandedRowOffset:ue.expandedRowOffset,onTriggerExpand:Be,expandIconColumnIndex:ue.expandIconColumnIndex,indentSize:ue.indentSize,allColumnsFixedLeft:Ve.every(function(Ct){return Ct.fixed==="left"}),emptyNode:Ut,columns:Le,flattenColumns:Ve,onColumnResize:W,colWidths:Er,hoverStartRow:me,hoverEndRow:Oe,onHover:ee,rowExpandable:ue.rowExpandable,onRow:O,getRowKey:se,expandedKeys:Ce,childrenColumnName:Fe,rowHoverable:H,measureRowRender:_}},[Xe,n,q,Qr,b,Yt,oe,Co,Ge,Vt,Ot,Jt,Bn,a,ue.expandedRowClassName,Ee,De,ue.expandRowByClick,ue.expandedRowRender,ue.expandedRowOffset,Be,ue.expandIconColumnIndex,ue.indentSize,Ut,Le,Ve,W,Er,me,Oe,ee,ue.rowExpandable,O,se,Ce,Fe,H,_]);return k.createElement(Hr.Provider,{value:mn},ge)}var kv=k.forwardRef(Ev);function M1(e){return C1(kv,e)}var va=M1();va.EXPAND_COLUMN=uo;va.INTERNAL_HOOKS=ci;va.Column=H3;va.ColumnGroup=K3;va.Summary=E1;var R0=O0(null),R1=O0(null);function Sv(e,t,r){var n=t||1;return r[e+n]-(r[e]||0)}function Bv(e){var t=e.rowInfo,r=e.column,n=e.colIndex,o=e.indent,a=e.index,u=e.component,c=e.renderIndex,f=e.record,d=e.style,m=e.className,b=e.inverse,g=e.getHeight,w=r.render,C=r.dataIndex,D=r.className,p=r.width,B=Ir(R1,["columnsOffset"]),F=B.columnsOffset,S=N1(t,r,n,o,a),O=S.key,M=S.fixedInfo,_=S.appendCellNode,z=S.additionalCellProps,K=z.style,$=z.colSpan,Q=$===void 0?1:$,V=z.rowSpan,X=V===void 0?1:V,G=n-1,j=Sv(G,Q,F),H=Q>1?p-j:0,U=qe(qe(qe({},K),d),{},{flex:"0 0 ".concat(j,"px"),width:"".concat(j,"px"),marginRight:H,pointerEvents:"auto"}),R=k.useMemo(function(){return b?X<=1:Q===0||X===0||X>1},[X,Q,b]);R?U.visibility="hidden":b&&(U.height=g==null?void 0:g(X));var te=R?function(){return null}:w,q={};return(X===0||Q===0)&&(q.rowSpan=1,q.colSpan=1),k.createElement(ga,vt({className:tt(D,m),ellipsis:r.ellipsis,align:r.align,scope:r.rowScope,component:u,prefixCls:t.prefixCls,key:O,record:f,index:a,renderIndex:c,dataIndex:C,render:te,shouldCellUpdate:r.shouldCellUpdate},M,{appendNode:_,additionalProps:qe(qe({},z),{},{style:U},q)}))}var Av=["data","index","className","rowKey","style","extra","getHeight"],Fv=k.forwardRef(function(e,t){var r=e.data,n=e.index,o=e.className,a=e.rowKey,u=e.style,c=e.extra,f=e.getHeight,d=yr(e,Av),m=r.record,b=r.indent,g=r.index,w=Ir(Hr,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),C=w.scrollX,D=w.flattenColumns,p=w.prefixCls,B=w.fixColumn,F=w.componentWidth,S=Ir(R0,["getComponent"]),O=S.getComponent,M=B1(m,a,n,b),_=O(["body","row"],"div"),z=O(["body","cell"],"div"),K=M.rowSupportExpand,$=M.expanded,Q=M.rowProps,V=M.expandedRowRender,X=M.expandedRowClassName,G;if(K&&$){var j=V(m,n,b+1,$),H=F1(X,m,n,b),U={};B&&(U={style:Te({},"--virtual-width","".concat(F,"px"))});var R="".concat(p,"-expanded-row-cell");G=k.createElement(_,{className:tt("".concat(p,"-expanded-row"),"".concat(p,"-expanded-row-level-").concat(b+1),H)},k.createElement(ga,{component:z,prefixCls:p,className:tt(R,Te({},"".concat(R,"-fixed"),B)),additionalProps:U},j))}var te=qe(qe({},u),{},{width:C});c&&(te.position="absolute",te.pointerEvents="none");var q=k.createElement(_,vt({},Q,d,{"data-row-key":a,ref:K?null:t,className:tt(o,"".concat(p,"-row"),Q==null?void 0:Q.className,Te({},"".concat(p,"-row-extra"),c)),style:qe(qe({},te),Q==null?void 0:Q.style)}),D.map(function(se,ye){return k.createElement(Bv,{key:ye,component:z,rowInfo:M,column:se,colIndex:ye,indent:b,index:n,renderIndex:g,record:m,inverse:c,getHeight:f})}));return K?k.createElement("div",{ref:t},q,G):q}),Yd=ma(Fv),Nv=k.forwardRef(function(e,t){var r=e.data,n=e.onScroll,o=Ir(Hr,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),a=o.flattenColumns,u=o.onColumnResize,c=o.getRowKey,f=o.expandedKeys,d=o.prefixCls,m=o.childrenColumnName,b=o.scrollX,g=o.direction,w=Ir(R0),C=w.sticky,D=w.scrollY,p=w.listItemHeight,B=w.getComponent,F=w.onScroll,S=k.useRef(),O=S1(r,m,f,c),M=k.useMemo(function(){var G=0;return a.map(function(j){var H=j.width,U=j.minWidth,R=j.key,te=Math.max(H||0,U||0);return G+=te,[R,te,G]})},[a]),_=k.useMemo(function(){return M.map(function(G){return G[2]})},[M]);k.useEffect(function(){M.forEach(function(G){var j=wt(G,2),H=j[0],U=j[1];u(H,U)})},[M]),k.useImperativeHandle(t,function(){var G,j={scrollTo:function(U){var R;(R=S.current)===null||R===void 0||R.scrollTo(U)},nativeElement:(G=S.current)===null||G===void 0?void 0:G.nativeElement};return Object.defineProperty(j,"scrollLeft",{get:function(){var U;return((U=S.current)===null||U===void 0?void 0:U.getScrollInfo().x)||0},set:function(U){var R;(R=S.current)===null||R===void 0||R.scrollTo({left:U})}}),Object.defineProperty(j,"scrollTop",{get:function(){var U;return((U=S.current)===null||U===void 0?void 0:U.getScrollInfo().y)||0},set:function(U){var R;(R=S.current)===null||R===void 0||R.scrollTo({top:U})}}),j});var z=function(j,H){var U,R=(U=O[H])===null||U===void 0?void 0:U.record,te=j.onCell;if(te){var q,se=te(R,H);return(q=se==null?void 0:se.rowSpan)!==null&&q!==void 0?q:1}return 1},K=function(j){var H=j.start,U=j.end,R=j.getSize,te=j.offsetY;if(U<0)return null;for(var q=a.filter(function(Ce){return z(Ce,H)===0}),se=H,ye=function(Ee){if(q=q.filter(function(Fe){return z(Fe,Ee)===0}),!q.length)return se=Ee,1},we=H;we>=0&&!ye(we);we-=1);for(var ie=a.filter(function(Ce){return z(Ce,U)!==1}),me=U,Oe=function(Ee){if(ie=ie.filter(function(Fe){return z(Fe,Ee)!==1}),!ie.length)return me=Math.max(Ee-1,U),1},ee=U;ee<O.length&&!Oe(ee);ee+=1);for(var pe=[],le=function(Ee){var Fe=O[Ee];if(!Fe)return 1;a.some(function(Be){return z(Be,Ee)>1})&&pe.push(Ee)},ue=se;ue<=me;ue+=1)le(ue);var De=pe.map(function(Ce){var Ee=O[Ce],Fe=c(Ee.record,Ce),Be=function(Me){var Ge=Ce+Me-1,dt=c(O[Ge].record,Ge),ut=R(Fe,dt);return ut.bottom-ut.top},Ne=R(Fe);return k.createElement(Yd,{key:Ce,data:Ee,rowKey:Fe,index:Ce,style:{top:-te+Ne.top},extra:!0,getHeight:Be})});return De},$=k.useMemo(function(){return{columnsOffset:_}},[_]),Q="".concat(d,"-tbody"),V=B(["body","wrapper"]),X={};return C&&(X.position="sticky",X.bottom=0,En(C)==="object"&&C.offsetScroll&&(X.bottom=C.offsetScroll)),k.createElement(R1.Provider,{value:$},k.createElement(Gp,{fullHeight:!1,ref:S,prefixCls:"".concat(Q,"-virtual"),styles:{horizontalScrollBar:X},className:Q,height:D,itemHeight:p||24,data:O,itemKey:function(j){return c(j.record)},component:V,scrollWidth:b,direction:g,onVirtualScroll:function(j){var H,U=j.x;n({currentTarget:(H=S.current)===null||H===void 0?void 0:H.nativeElement,scrollLeft:U})},onScroll:F,extraRender:K},function(G,j,H){var U=c(G.record,j);return k.createElement(Yd,{data:G,rowKey:U,index:j,style:H.style})}))}),Ov=ma(Nv),$v=function(t,r){var n=r.ref,o=r.onScroll;return k.createElement(Ov,{ref:n,data:t,onScroll:o})};function Tv(e,t){var r=e.data,n=e.columns,o=e.scroll,a=e.sticky,u=e.prefixCls,c=u===void 0?T1:u,f=e.className,d=e.listItemHeight,m=e.components,b=e.onScroll,g=o||{},w=g.x,C=g.y;typeof w!="number"&&(w=1),typeof C!="number"&&(C=500);var D=wn(function(F,S){return y0(m,F)||S}),p=wn(b),B=k.useMemo(function(){return{sticky:a,scrollY:C,listItemHeight:d,getComponent:D,onScroll:p}},[a,C,d,D,p]);return k.createElement(R0.Provider,{value:B},k.createElement(va,vt({},e,{className:tt(f,"".concat(c,"-virtual")),scroll:qe(qe({},o),{},{x:w}),components:qe(qe({},m),{},{body:r!=null&&r.length?$v:void 0}),columns:n,internalHooks:ci,tailor:!0,ref:t})))}var Mv=k.forwardRef(Tv);function P1(e){return C1(Mv,e)}P1();const Rv=e=>null,Pv=e=>null;var P0=k.createContext(null),Iv=k.createContext({}),zv=function(t){for(var r=t.prefixCls,n=t.level,o=t.isStart,a=t.isEnd,u="".concat(r,"-indent-unit"),c=[],f=0;f<n;f+=1)c.push(k.createElement("span",{key:f,className:tt(u,Te(Te({},"".concat(u,"-start"),o[f]),"".concat(u,"-end"),a[f]))}));return k.createElement("span",{"aria-hidden":"true",className:"".concat(r,"-indent")},c)};const jv=k.memo(zv);var _v=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],Gd="open",Xd="close",Lv="---",Ga=function(t){var r,n,o,a=t.eventKey,u=t.className,c=t.style,f=t.dragOver,d=t.dragOverGapTop,m=t.dragOverGapBottom,b=t.isLeaf,g=t.isStart,w=t.isEnd,C=t.expanded,D=t.selected,p=t.checked,B=t.halfChecked,F=t.loading,S=t.domRef,O=t.active,M=t.data,_=t.onMouseMove,z=t.selectable,K=yr(t,_v),$=je.useContext(P0),Q=je.useContext(Iv),V=je.useRef(null),X=je.useState(!1),G=wt(X,2),j=G[0],H=G[1],U=!!($.disabled||t.disabled||(r=Q.nodeDisabled)!==null&&r!==void 0&&r.call(Q,M)),R=je.useMemo(function(){return!$.checkable||t.checkable===!1?!1:$.checkable},[$.checkable,t.checkable]),te=function(de){U||$.onNodeSelect(de,Br(t))},q=function(de){U||!R||t.disableCheckbox||$.onNodeCheck(de,Br(t),!p)},se=je.useMemo(function(){return typeof z=="boolean"?z:$.selectable},[z,$.selectable]),ye=function(de){$.onNodeClick(de,Br(t)),se?te(de):q(de)},we=function(de){$.onNodeDoubleClick(de,Br(t))},ie=function(de){$.onNodeMouseEnter(de,Br(t))},me=function(de){$.onNodeMouseLeave(de,Br(t))},Oe=function(de){$.onNodeContextMenu(de,Br(t))},ee=je.useMemo(function(){return!!($.draggable&&(!$.draggable.nodeDraggable||$.draggable.nodeDraggable(M)))},[$.draggable,M]),pe=function(de){de.stopPropagation(),H(!0),$.onNodeDragStart(de,t);try{de.dataTransfer.setData("text/plain","")}catch{}},le=function(de){de.preventDefault(),de.stopPropagation(),$.onNodeDragEnter(de,t)},ue=function(de){de.preventDefault(),de.stopPropagation(),$.onNodeDragOver(de,t)},De=function(de){de.stopPropagation(),$.onNodeDragLeave(de,t)},Ce=function(de){de.stopPropagation(),H(!1),$.onNodeDragEnd(de,t)},Ee=function(de){de.preventDefault(),de.stopPropagation(),H(!1),$.onNodeDrop(de,t)},Fe=function(de){F||$.onNodeExpand(de,Br(t))},Be=je.useMemo(function(){var $e=tn($.keyEntities,a)||{},de=$e.children;return!!(de||[]).length},[$.keyEntities,a]),Ne=je.useMemo(function(){return b===!1?!1:b||!$.loadData&&!Be||$.loadData&&t.loaded&&!Be},[b,$.loadData,Be,t.loaded]);je.useEffect(function(){F||typeof $.loadData=="function"&&C&&!Ne&&!t.loaded&&$.onNodeLoad(Br(t))},[F,$.loadData,$.onNodeLoad,C,Ne,t]);var ze=je.useMemo(function(){var $e;return($e=$.draggable)!==null&&$e!==void 0&&$e.icon?je.createElement("span",{className:"".concat($.prefixCls,"-draggable-icon")},$.draggable.icon):null},[$.draggable]),Me=function(de){var it=t.switcherIcon||$.switcherIcon;return typeof it=="function"?it(qe(qe({},t),{},{isLeaf:de})):it},Ge=function(){if(Ne){var de=Me(!0);return de!==!1?je.createElement("span",{className:tt("".concat($.prefixCls,"-switcher"),"".concat($.prefixCls,"-switcher-noop"))},de):null}var it=Me(!1);return it!==!1?je.createElement("span",{onClick:Fe,className:tt("".concat($.prefixCls,"-switcher"),"".concat($.prefixCls,"-switcher_").concat(C?Gd:Xd))},it):null},dt=je.useMemo(function(){if(!R)return null;var $e=typeof R!="boolean"?R:null;return je.createElement("span",{className:tt("".concat($.prefixCls,"-checkbox"),Te(Te(Te({},"".concat($.prefixCls,"-checkbox-checked"),p),"".concat($.prefixCls,"-checkbox-indeterminate"),!p&&B),"".concat($.prefixCls,"-checkbox-disabled"),U||t.disableCheckbox)),onClick:q,role:"checkbox","aria-checked":B?"mixed":p,"aria-disabled":U||t.disableCheckbox,"aria-label":"Select ".concat(typeof t.title=="string"?t.title:"tree node")},$e)},[R,p,B,U,t.disableCheckbox,t.title]),ut=je.useMemo(function(){return Ne?null:C?Gd:Xd},[Ne,C]),Pe=je.useMemo(function(){return je.createElement("span",{className:tt("".concat($.prefixCls,"-iconEle"),"".concat($.prefixCls,"-icon__").concat(ut||"docu"),Te({},"".concat($.prefixCls,"-icon_loading"),F))})},[$.prefixCls,ut,F]),Le=je.useMemo(function(){var $e=!!$.draggable,de=!t.disabled&&$e&&$.dragOverNodeKey===a;return de?$.dropIndicatorRender({dropPosition:$.dropPosition,dropLevelOffset:$.dropLevelOffset,indent:$.indent,prefixCls:$.prefixCls,direction:$.direction}):null},[$.dropPosition,$.dropLevelOffset,$.indent,$.prefixCls,$.direction,$.draggable,$.dragOverNodeKey,$.dropIndicatorRender]),Ve=je.useMemo(function(){var $e=t.title,de=$e===void 0?Lv:$e,it="".concat($.prefixCls,"-node-content-wrapper"),yt;if($.showIcon){var Dt=t.icon||$.icon;yt=Dt?je.createElement("span",{className:tt("".concat($.prefixCls,"-iconEle"),"".concat($.prefixCls,"-icon__customize"))},typeof Dt=="function"?Dt(t):Dt):Pe}else $.loadData&&F&&(yt=Pe);var pt;return typeof de=="function"?pt=de(M):$.titleRender?pt=$.titleRender(M):pt=de,je.createElement("span",{ref:V,title:typeof de=="string"?de:"",className:tt(it,"".concat(it,"-").concat(ut||"normal"),Te({},"".concat($.prefixCls,"-node-selected"),!U&&(D||j))),onMouseEnter:ie,onMouseLeave:me,onContextMenu:Oe,onClick:ye,onDoubleClick:we},yt,je.createElement("span",{className:"".concat($.prefixCls,"-title")},pt),Le)},[$.prefixCls,$.showIcon,t,$.icon,Pe,$.titleRender,M,ut,ie,me,Oe,ye,we]),ft=ss(K,{aria:!0,data:!0}),Je=tn($.keyEntities,a)||{},Xe=Je.level,St=w[w.length-1],bt=!U&&ee,ct=$.draggingNodeKey===a,rt=z!==void 0?{"aria-selected":!!z}:void 0;return je.createElement("div",vt({ref:S,role:"treeitem","aria-expanded":b?void 0:C,className:tt(u,"".concat($.prefixCls,"-treenode"),(o={},Te(Te(Te(Te(Te(Te(Te(Te(Te(Te(o,"".concat($.prefixCls,"-treenode-disabled"),U),"".concat($.prefixCls,"-treenode-switcher-").concat(C?"open":"close"),!b),"".concat($.prefixCls,"-treenode-checkbox-checked"),p),"".concat($.prefixCls,"-treenode-checkbox-indeterminate"),B),"".concat($.prefixCls,"-treenode-selected"),D),"".concat($.prefixCls,"-treenode-loading"),F),"".concat($.prefixCls,"-treenode-active"),O),"".concat($.prefixCls,"-treenode-leaf-last"),St),"".concat($.prefixCls,"-treenode-draggable"),ee),"dragging",ct),Te(Te(Te(Te(Te(Te(Te(o,"drop-target",$.dropTargetKey===a),"drop-container",$.dropContainerKey===a),"drag-over",!U&&f),"drag-over-gap-top",!U&&d),"drag-over-gap-bottom",!U&&m),"filter-node",(n=$.filterTreeNode)===null||n===void 0?void 0:n.call($,Br(t))),"".concat($.prefixCls,"-treenode-leaf"),Ne))),style:c,draggable:bt,onDragStart:bt?pe:void 0,onDragEnter:ee?le:void 0,onDragOver:ee?ue:void 0,onDragLeave:ee?De:void 0,onDrop:ee?Ee:void 0,onDragEnd:ee?Ce:void 0,onMouseMove:_},rt,ft),je.createElement(jv,{prefixCls:$.prefixCls,level:Xe,isStart:g,isEnd:w}),ze,Ge(),dt,Ve)};Ga.isTreeNode=1;function Mn(e,t){if(!e)return[];var r=e.slice(),n=r.indexOf(t);return n>=0&&r.splice(n,1),r}function Vn(e,t){var r=(e||[]).slice();return r.indexOf(t)===-1&&r.push(t),r}function I0(e){return e.split("-")}function Hv(e,t){var r=[],n=tn(t,e);function o(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];a.forEach(function(u){var c=u.key,f=u.children;r.push(c),o(f)})}return o(n.children),r}function Kv(e){if(e.parent){var t=I0(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function qv(e){var t=I0(e.pos);return Number(t[t.length-1])===0}function Qd(e,t,r,n,o,a,u,c,f,d){var m,b=e.clientX,g=e.clientY,w=e.target.getBoundingClientRect(),C=w.top,D=w.height,p=(d==="rtl"?-1:1)*(((o==null?void 0:o.x)||0)-b),B=(p-12)/n,F=f.filter(function(U){var R;return(R=c[U])===null||R===void 0||(R=R.children)===null||R===void 0?void 0:R.length}),S=tn(c,r.eventKey);if(g<C+D/2){var O=u.findIndex(function(U){return U.key===S.key}),M=O<=0?0:O-1,_=u[M].key;S=tn(c,_)}var z=S.key,K=S,$=S.key,Q=0,V=0;if(!F.includes(z))for(var X=0;X<B&&Kv(S);X+=1)S=S.parent,V+=1;var G=t.data,j=S.node,H=!0;return qv(S)&&S.level===0&&g<C+D/2&&a({dragNode:G,dropNode:j,dropPosition:-1})&&S.key===r.eventKey?Q=-1:(K.children||[]).length&&F.includes($)?a({dragNode:G,dropNode:j,dropPosition:0})?Q=0:H=!1:V===0?B>-1.5?a({dragNode:G,dropNode:j,dropPosition:1})?Q=1:H=!1:a({dragNode:G,dropNode:j,dropPosition:0})?Q=0:a({dragNode:G,dropNode:j,dropPosition:1})?Q=1:H=!1:a({dragNode:G,dropNode:j,dropPosition:1})?Q=1:H=!1,{dropPosition:Q,dropLevelOffset:V,dropTargetKey:S.key,dropTargetPos:S.pos,dragOverNodeKey:$,dropContainerKey:Q===0?null:((m=S.parent)===null||m===void 0?void 0:m.key)||null,dropAllowed:H}}function Zd(e,t){if(e){var r=t.multiple;return r?e.slice():e.length?[e[0]]:e}}function $l(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(En(e)==="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return zn(!1,"`checkedKeys` is not an array or an object"),null;return t}function Tu(e,t){var r=new Set;function n(o){if(!r.has(o)){var a=tn(t,o);if(a){r.add(o);var u=a.parent,c=a.node;c.disabled||u&&n(u.key)}}}return(e||[]).forEach(function(o){n(o)}),At(r)}const so={},Mu="SELECT_ALL",Ru="SELECT_INVERT",Pu="SELECT_NONE",Jd=[],I1=(e,t,r=[])=>((t||[]).forEach(n=>{r.push(n),n&&typeof n=="object"&&e in n&&I1(e,n[e],r)}),r),Wv=(e,t)=>{const{preserveSelectedRowKeys:r,selectedRowKeys:n,defaultSelectedRowKeys:o,getCheckboxProps:a,getTitleCheckboxProps:u,onChange:c,onSelect:f,onSelectAll:d,onSelectInvert:m,onSelectNone:b,onSelectMultiple:g,columnWidth:w,type:C,selections:D,fixed:p,renderCell:B,hideSelectAll:F,checkStrictly:S=!0}=t||{},{prefixCls:O,data:M,pageData:_,getRecordByKey:z,getRowKey:K,expandType:$,childrenColumnName:Q,locale:V,getPopupContainer:X}=e,G=Ns(),[j,H]=a2(Ee=>Ee),[U,R]=Jo(n||o||Jd,{value:n}),te=k.useRef(new Map),q=mt(Ee=>{if(r){const Fe=new Map;Ee.forEach(Be=>{let Ne=z(Be);!Ne&&te.current.has(Be)&&(Ne=te.current.get(Be)),Fe.set(Be,Ne)}),te.current=Fe}},[z,r]);k.useEffect(()=>{q(U)},[U]);const se=xt(()=>I1(Q,_),[Q,_]),{keyEntities:ye}=xt(()=>{if(S)return{keyEntities:null};let Ee=M;if(r){const Fe=new Set(se.map((Ne,ze)=>K(Ne,ze))),Be=Array.from(te.current).reduce((Ne,[ze,Me])=>Fe.has(ze)?Ne:Ne.concat(Me),[]);Ee=[].concat(At(Ee),At(Be))}return F0(Ee,{externalGetKey:K,childrenPropName:Q})},[M,K,S,Q,r,se]),we=xt(()=>{const Ee=new Map;return se.forEach((Fe,Be)=>{const Ne=K(Fe,Be),ze=(a?a(Fe):null)||{};Ee.set(Ne,ze)}),Ee},[se,K,a]),ie=mt(Ee=>{const Fe=K(Ee);let Be;return we.has(Fe)?Be=we.get(K(Ee)):Be=a?a(Ee):void 0,!!(Be!=null&&Be.disabled)},[we,K]),[me,Oe]=xt(()=>{if(S)return[U||[],[]];const{checkedKeys:Ee,halfCheckedKeys:Fe}=ea(U,!0,ye,ie);return[Ee||[],Fe]},[U,S,ye,ie]),ee=xt(()=>{const Ee=C==="radio"?me.slice(0,1):me;return new Set(Ee)},[me,C]),pe=xt(()=>C==="radio"?new Set:new Set(Oe),[Oe,C]);k.useEffect(()=>{t||R(Jd)},[!!t]);const le=mt((Ee,Fe)=>{let Be,Ne;q(Ee),r?(Be=Ee,Ne=Ee.map(ze=>te.current.get(ze))):(Be=[],Ne=[],Ee.forEach(ze=>{const Me=z(ze);Me!==void 0&&(Be.push(ze),Ne.push(Me))})),R(Be),c==null||c(Be,Ne,{type:Fe})},[R,z,c,r]),ue=mt((Ee,Fe,Be,Ne)=>{if(f){const ze=Be.map(Me=>z(Me));f(z(Ee),Fe,ze,Ne)}le(Be,"single")},[f,z,le]),De=xt(()=>!D||F?null:(D===!0?[Mu,Ru,Pu]:D).map(Fe=>Fe===Mu?{key:"all",text:V.selectionAll,onSelect(){le(M.map((Be,Ne)=>K(Be,Ne)).filter(Be=>{const Ne=we.get(Be);return!(Ne!=null&&Ne.disabled)||ee.has(Be)}),"all")}}:Fe===Ru?{key:"invert",text:V.selectInvert,onSelect(){const Be=new Set(ee);_.forEach((ze,Me)=>{const Ge=K(ze,Me),dt=we.get(Ge);dt!=null&&dt.disabled||(Be.has(Ge)?Be.delete(Ge):Be.add(Ge))});const Ne=Array.from(Be);m&&(G.deprecated(!1,"onSelectInvert","onChange"),m(Ne)),le(Ne,"invert")}}:Fe===Pu?{key:"none",text:V.selectNone,onSelect(){b==null||b(),le(Array.from(ee).filter(Be=>{const Ne=we.get(Be);return Ne==null?void 0:Ne.disabled}),"none")}}:Fe).map(Fe=>Object.assign(Object.assign({},Fe),{onSelect:(...Be)=>{var Ne,ze;(ze=Fe.onSelect)===null||ze===void 0||(Ne=ze).call.apply(Ne,[Fe].concat(Be)),H(null)}})),[D,ee,_,K,m,le]);return[mt(Ee=>{var Fe;if(!t)return Ee.filter($e=>$e!==so);let Be=At(Ee);const Ne=new Set(ee),ze=se.map(K).filter($e=>!we.get($e).disabled),Me=ze.every($e=>Ne.has($e)),Ge=ze.some($e=>Ne.has($e)),dt=()=>{const $e=[];Me?ze.forEach(it=>{Ne.delete(it),$e.push(it)}):ze.forEach(it=>{Ne.has(it)||(Ne.add(it),$e.push(it))});const de=Array.from(Ne);d==null||d(!Me,de.map(it=>z(it)),$e.map(it=>z(it))),le(de,"all"),H(null)};let ut,Pe;if(C!=="radio"){let $e;if(De){const Zt={getPopupContainer:X,items:De.map((rr,nr)=>{const{key:ht,text:gr,onSelect:or}=rr;return{key:ht??nr,onClick:()=>{or==null||or(ze)},label:gr}})};$e=k.createElement("div",{className:`${O}-selection-extra`},k.createElement(N0,{menu:Zt,getPopupContainer:X},k.createElement("span",null,k.createElement(_4,null))))}const de=se.map((Zt,rr)=>{const nr=K(Zt,rr),ht=we.get(nr)||{};return Object.assign({checked:Ne.has(nr)},ht)}).filter(({disabled:Zt})=>Zt),it=!!de.length&&de.length===se.length,yt=it&&de.every(({checked:Zt})=>Zt),Dt=it&&de.some(({checked:Zt})=>Zt),pt=(u==null?void 0:u())||{},{onChange:Qt,disabled:gt}=pt;Pe=k.createElement(ls,Object.assign({"aria-label":$e?"Custom selection":"Select all"},pt,{checked:it?yt:!!se.length&&Me,indeterminate:it?!yt&&Dt:!Me&&Ge,onChange:Zt=>{dt(),Qt==null||Qt(Zt)},disabled:gt??(se.length===0||it),skipGroup:!0})),ut=!F&&k.createElement("div",{className:`${O}-selection`},Pe,$e)}let Le;C==="radio"?Le=($e,de,it)=>{const yt=K(de,it),Dt=Ne.has(yt),pt=we.get(yt);return{node:k.createElement($p,Object.assign({},pt,{checked:Dt,onClick:Qt=>{var gt;Qt.stopPropagation(),(gt=pt==null?void 0:pt.onClick)===null||gt===void 0||gt.call(pt,Qt)},onChange:Qt=>{var gt;Ne.has(yt)||ue(yt,!0,[yt],Qt.nativeEvent),(gt=pt==null?void 0:pt.onChange)===null||gt===void 0||gt.call(pt,Qt)}})),checked:Dt}}:Le=($e,de,it)=>{var yt;const Dt=K(de,it),pt=Ne.has(Dt),Qt=pe.has(Dt),gt=we.get(Dt);let Zt;return $==="nest"?Zt=Qt:Zt=(yt=gt==null?void 0:gt.indeterminate)!==null&&yt!==void 0?yt:Qt,{node:k.createElement(ls,Object.assign({},gt,{indeterminate:Zt,checked:pt,skipGroup:!0,onClick:rr=>{var nr;rr.stopPropagation(),(nr=gt==null?void 0:gt.onClick)===null||nr===void 0||nr.call(gt,rr)},onChange:rr=>{var nr;const{nativeEvent:ht}=rr,{shiftKey:gr}=ht,or=ze.indexOf(Dt),Dr=me.some(ot=>ze.includes(ot));if(gr&&S&&Dr){const ot=j(or,ze,Ne),Er=Array.from(Ne);g==null||g(!pt,Er.map(kr=>z(kr)),ot.map(kr=>z(kr))),le(Er,"multiple")}else{const ot=me;if(S){const Er=pt?Mn(ot,Dt):Vn(ot,Dt);ue(Dt,!pt,Er,ht)}else{const Er=ea([].concat(At(ot),[Dt]),!0,ye,ie),{checkedKeys:kr,halfCheckedKeys:Vt}=Er;let Jt=kr;if(pt){const Ot=new Set(kr);Ot.delete(Dt),Jt=ea(Array.from(Ot),{halfCheckedKeys:Vt},ye,ie).checkedKeys}ue(Dt,!pt,Jt,ht)}}H(pt?null:or),(nr=gt==null?void 0:gt.onChange)===null||nr===void 0||nr.call(gt,rr)}})),checked:pt}};const Ve=($e,de,it)=>{const{node:yt,checked:Dt}=Le($e,de,it);return B?B(Dt,de,it,yt):yt};if(!Be.includes(so))if(Be.findIndex($e=>{var de;return((de=$e[_a])===null||de===void 0?void 0:de.columnType)==="EXPAND_COLUMN"})===0){const[$e,...de]=Be;Be=[$e,so].concat(At(de))}else Be=[so].concat(At(Be));const ft=Be.indexOf(so);Be=Be.filter(($e,de)=>$e!==so||de===ft);const Je=Be[ft-1],Xe=Be[ft+1];let St=p;St===void 0&&((Xe==null?void 0:Xe.fixed)!==void 0?St=Xe.fixed:(Je==null?void 0:Je.fixed)!==void 0&&(St=Je.fixed)),St&&Je&&((Fe=Je[_a])===null||Fe===void 0?void 0:Fe.columnType)==="EXPAND_COLUMN"&&Je.fixed===void 0&&(Je.fixed=St);const bt=tt(`${O}-selection-col`,{[`${O}-selection-col-with-dropdown`]:D&&C==="checkbox"}),ct=()=>t!=null&&t.columnTitle?typeof t.columnTitle=="function"?t.columnTitle(Pe):t.columnTitle:ut,rt={fixed:St,width:w,className:`${O}-selection-column`,title:ct(),render:Ve,onCell:t.onCell,align:t.align,[_a]:{className:bt}};return Be.map($e=>$e===so?rt:$e)},[K,se,t,me,ee,pe,w,De,$,we,g,ue,ie]),ee]};function Vv(e){return t=>{const{prefixCls:r,onExpand:n,record:o,expanded:a,expandable:u}=t,c=`${r}-row-expand-icon`;return k.createElement("button",{type:"button",onClick:f=>{n(o,f),f.stopPropagation()},className:tt(c,{[`${c}-spaced`]:!u,[`${c}-expanded`]:u&&a,[`${c}-collapsed`]:u&&!a}),"aria-label":a?e.collapse:e.expand,"aria-expanded":a})}}function Uv(e){return(r,n)=>{const o=r.querySelector(`.${e}-container`);let a=n;if(o){const u=getComputedStyle(o),c=Number.parseInt(u.borderLeftWidth,10),f=Number.parseInt(u.borderRightWidth,10);a=n-c-f}return a}}const mo=(e,t)=>"key"in e&&e.key!==void 0&&e.key!==null?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t;function ba(e,t){return t?`${t}-${e}`:`${e}`}const zs=(e,t)=>typeof e=="function"?e(t):e,Yv=(e,t)=>{const r=zs(e,t);return Object.prototype.toString.call(r)==="[object Object]"?"":r};var Gv={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},Xv=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:Gv}))},Qv=k.forwardRef(Xv),Zv=function(t){var r=t.dropPosition,n=t.dropLevelOffset,o=t.indent,a={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(r){case-1:a.top=0,a.left=-n*o;break;case 1:a.bottom=0,a.left=-n*o;break;case 0:a.bottom=0,a.left=o;break}return je.createElement("div",{style:a})};function z1(e){if(e==null)throw new TypeError("Cannot destructure "+e)}function Jv(e,t){var r=k.useState(!1),n=wt(r,2),o=n[0],a=n[1];po(function(){if(o)return e(),function(){t()}},[o]),po(function(){return a(!0),function(){a(!1)}},[])}var e5=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],t5=k.forwardRef(function(e,t){var r=e.className,n=e.style,o=e.motion,a=e.motionNodes,u=e.motionType,c=e.onMotionStart,f=e.onMotionEnd,d=e.active,m=e.treeNodeRequiredProps,b=yr(e,e5),g=k.useState(!0),w=wt(g,2),C=w[0],D=w[1],p=k.useContext(P0),B=p.prefixCls,F=a&&u!=="hide";po(function(){a&&F!==C&&D(F)},[a]);var S=function(){a&&c()},O=k.useRef(!1),M=function(){a&&!O.current&&(O.current=!0,f())};Jv(S,M);var _=function(K){F===K&&M()};return a?k.createElement(Hp,vt({ref:t,visible:C},o,{motionAppear:u==="show",onVisibleChanged:_}),function(z,K){var $=z.className,Q=z.style;return k.createElement("div",{ref:K,className:tt("".concat(B,"-treenode-motion"),$),style:Q},a.map(function(V){var X=Object.assign({},(z1(V.data),V.data)),G=V.title,j=V.key,H=V.isStart,U=V.isEnd;delete X.children;var R=ja(j,m);return k.createElement(Ga,vt({},X,R,{title:G,active:d,data:V.data,key:j,isStart:H,isEnd:U}))}))}):k.createElement(Ga,vt({domRef:t,className:r,style:n},b,{active:d}))});function r5(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=e.length,n=t.length;if(Math.abs(r-n)!==1)return{add:!1,key:null};function o(a,u){var c=new Map;a.forEach(function(d){c.set(d,!0)});var f=u.filter(function(d){return!c.has(d)});return f.length===1?f[0]:null}return r<n?{add:!0,key:o(e,t)}:{add:!1,key:o(t,e)}}function ef(e,t,r){var n=e.findIndex(function(c){return c.key===r}),o=e[n+1],a=t.findIndex(function(c){return c.key===r});if(o){var u=t.findIndex(function(c){return c.key===o.key});return t.slice(a+1,u)}return t.slice(a+1)}var n5=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],tf={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},o5=function(){},Po="RC_TREE_MOTION_".concat(Math.random()),Iu={key:Po},j1={key:Po,level:0,index:0,pos:"0",node:Iu,nodes:[Iu]},rf={parent:null,children:[],pos:j1.pos,data:Iu,title:null,key:Po,isStart:[],isEnd:[]};function nf(e,t,r,n){return t===!1||!r?e:e.slice(0,Math.ceil(r/n)+1)}function of(e){var t=e.key,r=e.pos;return ui(t,r)}function a5(e){for(var t=String(e.data.key),r=e;r.parent;)r=r.parent,t="".concat(r.data.key," > ").concat(t);return t}var i5=k.forwardRef(function(e,t){var r=e.prefixCls,n=e.data;e.selectable,e.checkable;var o=e.expandedKeys,a=e.selectedKeys,u=e.checkedKeys,c=e.loadedKeys,f=e.loadingKeys,d=e.halfCheckedKeys,m=e.keyEntities,b=e.disabled,g=e.dragging,w=e.dragOverNodeKey,C=e.dropPosition,D=e.motion,p=e.height,B=e.itemHeight,F=e.virtual,S=e.scrollWidth,O=e.focusable,M=e.activeItem,_=e.focused,z=e.tabIndex,K=e.onKeyDown,$=e.onFocus,Q=e.onBlur,V=e.onActiveChange,X=e.onListChangeStart,G=e.onListChangeEnd,j=yr(e,n5),H=k.useRef(null),U=k.useRef(null);k.useImperativeHandle(t,function(){return{scrollTo:function(Le){H.current.scrollTo(Le)},getIndentWidth:function(){return U.current.offsetWidth}}});var R=k.useState(o),te=wt(R,2),q=te[0],se=te[1],ye=k.useState(n),we=wt(ye,2),ie=we[0],me=we[1],Oe=k.useState(n),ee=wt(Oe,2),pe=ee[0],le=ee[1],ue=k.useState([]),De=wt(ue,2),Ce=De[0],Ee=De[1],Fe=k.useState(null),Be=wt(Fe,2),Ne=Be[0],ze=Be[1],Me=k.useRef(n);Me.current=n;function Ge(){var Pe=Me.current;me(Pe),le(Pe),Ee([]),ze(null),G()}po(function(){se(o);var Pe=r5(q,o);if(Pe.key!==null)if(Pe.add){var Le=ie.findIndex(function(bt){var ct=bt.key;return ct===Pe.key}),Ve=nf(ef(ie,n,Pe.key),F,p,B),ft=ie.slice();ft.splice(Le+1,0,rf),le(ft),Ee(Ve),ze("show")}else{var Je=n.findIndex(function(bt){var ct=bt.key;return ct===Pe.key}),Xe=nf(ef(n,ie,Pe.key),F,p,B),St=n.slice();St.splice(Je+1,0,rf),le(St),Ee(Xe),ze("hide")}else ie!==n&&(me(n),le(n))},[o,n]),k.useEffect(function(){g||Ge()},[g]);var dt=D?pe:n,ut={expandedKeys:o,selectedKeys:a,loadedKeys:c,loadingKeys:f,checkedKeys:u,halfCheckedKeys:d,dragOverNodeKey:w,dropPosition:C,keyEntities:m};return k.createElement(k.Fragment,null,_&&M&&k.createElement("span",{style:tf,"aria-live":"assertive"},a5(M)),k.createElement("div",null,k.createElement("input",{style:tf,disabled:O===!1||b,tabIndex:O!==!1?z:null,onKeyDown:K,onFocus:$,onBlur:Q,value:"",onChange:o5,"aria-label":"for screen reader"})),k.createElement("div",{className:"".concat(r,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},k.createElement("div",{className:"".concat(r,"-indent")},k.createElement("div",{ref:U,className:"".concat(r,"-indent-unit")}))),k.createElement(Gp,vt({},j,{data:dt,itemKey:of,height:p,fullHeight:!1,virtual:F,itemHeight:B,scrollWidth:S,prefixCls:"".concat(r,"-list"),ref:H,role:"tree",onVisibleChange:function(Le){Le.every(function(Ve){return of(Ve)!==Po})&&Ge()}}),function(Pe){var Le=Pe.pos,Ve=Object.assign({},(z1(Pe.data),Pe.data)),ft=Pe.title,Je=Pe.key,Xe=Pe.isStart,St=Pe.isEnd,bt=ui(Je,Le);delete Ve.key,delete Ve.children;var ct=ja(bt,ut);return k.createElement(t5,vt({},Ve,ct,{title:ft,active:!!M&&Je===M.key,pos:Le,data:Pe.data,isStart:Xe,isEnd:St,motion:D,motionNodes:Je===Po?Ce:null,motionType:Ne,onMotionStart:X,onMotionEnd:Ge,treeNodeRequiredProps:ut,onMouseMove:function(){V(null)}}))}))}),s5=10,z0=(function(e){zp(r,e);var t=jp(r);function r(){var n;_p(this,r);for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return n=t.call.apply(t,[this].concat(a)),Te(Rt(n),"destroyed",!1),Te(Rt(n),"delayedDragEnterLogic",void 0),Te(Rt(n),"loadingRetryTimes",{}),Te(Rt(n),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:aa()}),Te(Rt(n),"dragStartMousePosition",null),Te(Rt(n),"dragNodeProps",null),Te(Rt(n),"currentMouseOverDroppableNodeKey",null),Te(Rt(n),"listRef",k.createRef()),Te(Rt(n),"onNodeDragStart",function(c,f){var d=n.state,m=d.expandedKeys,b=d.keyEntities,g=n.props.onDragStart,w=f.eventKey;n.dragNodeProps=f,n.dragStartMousePosition={x:c.clientX,y:c.clientY};var C=Mn(m,w);n.setState({draggingNodeKey:w,dragChildrenKeys:Hv(w,b),indent:n.listRef.current.getIndentWidth()}),n.setExpandedKeys(C),window.addEventListener("dragend",n.onWindowDragEnd),g==null||g({event:c,node:Br(f)})}),Te(Rt(n),"onNodeDragEnter",function(c,f){var d=n.state,m=d.expandedKeys,b=d.keyEntities,g=d.dragChildrenKeys,w=d.flattenNodes,C=d.indent,D=n.props,p=D.onDragEnter,B=D.onExpand,F=D.allowDrop,S=D.direction,O=f.pos,M=f.eventKey;if(n.currentMouseOverDroppableNodeKey!==M&&(n.currentMouseOverDroppableNodeKey=M),!n.dragNodeProps){n.resetDragState();return}var _=Qd(c,n.dragNodeProps,f,C,n.dragStartMousePosition,F,w,b,m,S),z=_.dropPosition,K=_.dropLevelOffset,$=_.dropTargetKey,Q=_.dropContainerKey,V=_.dropTargetPos,X=_.dropAllowed,G=_.dragOverNodeKey;if(g.includes($)||!X){n.resetDragState();return}if(n.delayedDragEnterLogic||(n.delayedDragEnterLogic={}),Object.keys(n.delayedDragEnterLogic).forEach(function(j){clearTimeout(n.delayedDragEnterLogic[j])}),n.dragNodeProps.eventKey!==f.eventKey&&(c.persist(),n.delayedDragEnterLogic[O]=window.setTimeout(function(){if(n.state.draggingNodeKey!==null){var j=At(m),H=tn(b,f.eventKey);H&&(H.children||[]).length&&(j=Vn(m,f.eventKey)),n.props.hasOwnProperty("expandedKeys")||n.setExpandedKeys(j),B==null||B(j,{node:Br(f),expanded:!0,nativeEvent:c.nativeEvent})}},800)),n.dragNodeProps.eventKey===$&&K===0){n.resetDragState();return}n.setState({dragOverNodeKey:G,dropPosition:z,dropLevelOffset:K,dropTargetKey:$,dropContainerKey:Q,dropTargetPos:V,dropAllowed:X}),p==null||p({event:c,node:Br(f),expandedKeys:m})}),Te(Rt(n),"onNodeDragOver",function(c,f){var d=n.state,m=d.dragChildrenKeys,b=d.flattenNodes,g=d.keyEntities,w=d.expandedKeys,C=d.indent,D=n.props,p=D.onDragOver,B=D.allowDrop,F=D.direction;if(n.dragNodeProps){var S=Qd(c,n.dragNodeProps,f,C,n.dragStartMousePosition,B,b,g,w,F),O=S.dropPosition,M=S.dropLevelOffset,_=S.dropTargetKey,z=S.dropContainerKey,K=S.dropTargetPos,$=S.dropAllowed,Q=S.dragOverNodeKey;m.includes(_)||!$||(n.dragNodeProps.eventKey===_&&M===0?n.state.dropPosition===null&&n.state.dropLevelOffset===null&&n.state.dropTargetKey===null&&n.state.dropContainerKey===null&&n.state.dropTargetPos===null&&n.state.dropAllowed===!1&&n.state.dragOverNodeKey===null||n.resetDragState():O===n.state.dropPosition&&M===n.state.dropLevelOffset&&_===n.state.dropTargetKey&&z===n.state.dropContainerKey&&K===n.state.dropTargetPos&&$===n.state.dropAllowed&&Q===n.state.dragOverNodeKey||n.setState({dropPosition:O,dropLevelOffset:M,dropTargetKey:_,dropContainerKey:z,dropTargetPos:K,dropAllowed:$,dragOverNodeKey:Q}),p==null||p({event:c,node:Br(f)}))}}),Te(Rt(n),"onNodeDragLeave",function(c,f){n.currentMouseOverDroppableNodeKey===f.eventKey&&!c.currentTarget.contains(c.relatedTarget)&&(n.resetDragState(),n.currentMouseOverDroppableNodeKey=null);var d=n.props.onDragLeave;d==null||d({event:c,node:Br(f)})}),Te(Rt(n),"onWindowDragEnd",function(c){n.onNodeDragEnd(c,null,!0),window.removeEventListener("dragend",n.onWindowDragEnd)}),Te(Rt(n),"onNodeDragEnd",function(c,f){var d=n.props.onDragEnd;n.setState({dragOverNodeKey:null}),n.cleanDragState(),d==null||d({event:c,node:Br(f)}),n.dragNodeProps=null,window.removeEventListener("dragend",n.onWindowDragEnd)}),Te(Rt(n),"onNodeDrop",function(c,f){var d,m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,b=n.state,g=b.dragChildrenKeys,w=b.dropPosition,C=b.dropTargetKey,D=b.dropTargetPos,p=b.dropAllowed;if(p){var B=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),C!==null){var F=qe(qe({},ja(C,n.getTreeNodeRequiredProps())),{},{active:((d=n.getActiveItem())===null||d===void 0?void 0:d.key)===C,data:tn(n.state.keyEntities,C).node}),S=g.includes(C);zn(!S,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var O=I0(D),M={event:c,node:Br(F),dragNode:n.dragNodeProps?Br(n.dragNodeProps):null,dragNodesKeys:[n.dragNodeProps.eventKey].concat(g),dropToGap:w!==0,dropPosition:w+Number(O[O.length-1])};m||B==null||B(M),n.dragNodeProps=null}}}),Te(Rt(n),"cleanDragState",function(){var c=n.state.draggingNodeKey;c!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null}),Te(Rt(n),"triggerExpandActionExpand",function(c,f){var d=n.state,m=d.expandedKeys,b=d.flattenNodes,g=f.expanded,w=f.key,C=f.isLeaf;if(!(C||c.shiftKey||c.metaKey||c.ctrlKey)){var D=b.filter(function(B){return B.key===w})[0],p=Br(qe(qe({},ja(w,n.getTreeNodeRequiredProps())),{},{data:D.data}));n.setExpandedKeys(g?Mn(m,w):Vn(m,w)),n.onNodeExpand(c,p)}}),Te(Rt(n),"onNodeClick",function(c,f){var d=n.props,m=d.onClick,b=d.expandAction;b==="click"&&n.triggerExpandActionExpand(c,f),m==null||m(c,f)}),Te(Rt(n),"onNodeDoubleClick",function(c,f){var d=n.props,m=d.onDoubleClick,b=d.expandAction;b==="doubleClick"&&n.triggerExpandActionExpand(c,f),m==null||m(c,f)}),Te(Rt(n),"onNodeSelect",function(c,f){var d=n.state.selectedKeys,m=n.state,b=m.keyEntities,g=m.fieldNames,w=n.props,C=w.onSelect,D=w.multiple,p=f.selected,B=f[g.key],F=!p;F?D?d=Vn(d,B):d=[B]:d=Mn(d,B);var S=d.map(function(O){var M=tn(b,O);return M?M.node:null}).filter(Boolean);n.setUncontrolledState({selectedKeys:d}),C==null||C(d,{event:"select",selected:F,node:f,selectedNodes:S,nativeEvent:c.nativeEvent})}),Te(Rt(n),"onNodeCheck",function(c,f,d){var m=n.state,b=m.keyEntities,g=m.checkedKeys,w=m.halfCheckedKeys,C=n.props,D=C.checkStrictly,p=C.onCheck,B=f.key,F,S={event:"check",node:f,checked:d,nativeEvent:c.nativeEvent};if(D){var O=d?Vn(g,B):Mn(g,B),M=Mn(w,B);F={checked:O,halfChecked:M},S.checkedNodes=O.map(function(V){return tn(b,V)}).filter(Boolean).map(function(V){return V.node}),n.setUncontrolledState({checkedKeys:O})}else{var _=ea([].concat(At(g),[B]),!0,b),z=_.checkedKeys,K=_.halfCheckedKeys;if(!d){var $=new Set(z);$.delete(B);var Q=ea(Array.from($),{halfCheckedKeys:K},b);z=Q.checkedKeys,K=Q.halfCheckedKeys}F=z,S.checkedNodes=[],S.checkedNodesPositions=[],S.halfCheckedKeys=K,z.forEach(function(V){var X=tn(b,V);if(X){var G=X.node,j=X.pos;S.checkedNodes.push(G),S.checkedNodesPositions.push({node:G,pos:j})}}),n.setUncontrolledState({checkedKeys:z},!1,{halfCheckedKeys:K})}p==null||p(F,S)}),Te(Rt(n),"onNodeLoad",function(c){var f,d=c.key,m=n.state.keyEntities,b=tn(m,d);if(!(b!=null&&(f=b.children)!==null&&f!==void 0&&f.length)){var g=new Promise(function(w,C){n.setState(function(D){var p=D.loadedKeys,B=p===void 0?[]:p,F=D.loadingKeys,S=F===void 0?[]:F,O=n.props,M=O.loadData,_=O.onLoad;if(!M||B.includes(d)||S.includes(d))return null;var z=M(c);return z.then(function(){var K=n.state.loadedKeys,$=Vn(K,d);_==null||_($,{event:"load",node:c}),n.setUncontrolledState({loadedKeys:$}),n.setState(function(Q){return{loadingKeys:Mn(Q.loadingKeys,d)}}),w()}).catch(function(K){if(n.setState(function(Q){return{loadingKeys:Mn(Q.loadingKeys,d)}}),n.loadingRetryTimes[d]=(n.loadingRetryTimes[d]||0)+1,n.loadingRetryTimes[d]>=s5){var $=n.state.loadedKeys;zn(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:Vn($,d)}),w()}C(K)}),{loadingKeys:Vn(S,d)}})});return g.catch(function(){}),g}}),Te(Rt(n),"onNodeMouseEnter",function(c,f){var d=n.props.onMouseEnter;d==null||d({event:c,node:f})}),Te(Rt(n),"onNodeMouseLeave",function(c,f){var d=n.props.onMouseLeave;d==null||d({event:c,node:f})}),Te(Rt(n),"onNodeContextMenu",function(c,f){var d=n.props.onRightClick;d&&(c.preventDefault(),d({event:c,node:f}))}),Te(Rt(n),"onFocus",function(){var c=n.props.onFocus;n.setState({focused:!0});for(var f=arguments.length,d=new Array(f),m=0;m<f;m++)d[m]=arguments[m];c==null||c.apply(void 0,d)}),Te(Rt(n),"onBlur",function(){var c=n.props.onBlur;n.setState({focused:!1}),n.onActiveChange(null);for(var f=arguments.length,d=new Array(f),m=0;m<f;m++)d[m]=arguments[m];c==null||c.apply(void 0,d)}),Te(Rt(n),"getTreeNodeRequiredProps",function(){var c=n.state,f=c.expandedKeys,d=c.selectedKeys,m=c.loadedKeys,b=c.loadingKeys,g=c.checkedKeys,w=c.halfCheckedKeys,C=c.dragOverNodeKey,D=c.dropPosition,p=c.keyEntities;return{expandedKeys:f||[],selectedKeys:d||[],loadedKeys:m||[],loadingKeys:b||[],checkedKeys:g||[],halfCheckedKeys:w||[],dragOverNodeKey:C,dropPosition:D,keyEntities:p}}),Te(Rt(n),"setExpandedKeys",function(c){var f=n.state,d=f.treeData,m=f.fieldNames,b=Ol(d,c,m);n.setUncontrolledState({expandedKeys:c,flattenNodes:b},!0)}),Te(Rt(n),"onNodeExpand",function(c,f){var d=n.state.expandedKeys,m=n.state,b=m.listChanging,g=m.fieldNames,w=n.props,C=w.onExpand,D=w.loadData,p=f.expanded,B=f[g.key];if(!b){var F=d.includes(B),S=!p;if(zn(p&&F||!p&&!F,"Expand state not sync with index check"),d=S?Vn(d,B):Mn(d,B),n.setExpandedKeys(d),C==null||C(d,{node:f,expanded:S,nativeEvent:c.nativeEvent}),S&&D){var O=n.onNodeLoad(f);O&&O.then(function(){var M=Ol(n.state.treeData,d,g);n.setUncontrolledState({flattenNodes:M})}).catch(function(){var M=n.state.expandedKeys,_=Mn(M,B);n.setExpandedKeys(_)})}}}),Te(Rt(n),"onListChangeStart",function(){n.setUncontrolledState({listChanging:!0})}),Te(Rt(n),"onListChangeEnd",function(){setTimeout(function(){n.setUncontrolledState({listChanging:!1})})}),Te(Rt(n),"onActiveChange",function(c){var f=n.state.activeKey,d=n.props,m=d.onActiveChange,b=d.itemScrollOffset,g=b===void 0?0:b;f!==c&&(n.setState({activeKey:c}),c!==null&&n.scrollTo({key:c,offset:g}),m==null||m(c))}),Te(Rt(n),"getActiveItem",function(){var c=n.state,f=c.activeKey,d=c.flattenNodes;return f===null?null:d.find(function(m){var b=m.key;return b===f})||null}),Te(Rt(n),"offsetActiveKey",function(c){var f=n.state,d=f.flattenNodes,m=f.activeKey,b=d.findIndex(function(C){var D=C.key;return D===m});b===-1&&c<0&&(b=d.length),b=(b+c+d.length)%d.length;var g=d[b];if(g){var w=g.key;n.onActiveChange(w)}else n.onActiveChange(null)}),Te(Rt(n),"onKeyDown",function(c){var f=n.state,d=f.activeKey,m=f.expandedKeys,b=f.checkedKeys,g=f.fieldNames,w=n.props,C=w.onKeyDown,D=w.checkable,p=w.selectable;switch(c.which){case $r.UP:{n.offsetActiveKey(-1),c.preventDefault();break}case $r.DOWN:{n.offsetActiveKey(1),c.preventDefault();break}}var B=n.getActiveItem();if(B&&B.data){var F=n.getTreeNodeRequiredProps(),S=B.data.isLeaf===!1||!!(B.data[g.children]||[]).length,O=Br(qe(qe({},ja(d,F)),{},{data:B.data,active:!0}));switch(c.which){case $r.LEFT:{S&&m.includes(d)?n.onNodeExpand({},O):B.parent&&n.onActiveChange(B.parent.key),c.preventDefault();break}case $r.RIGHT:{S&&!m.includes(d)?n.onNodeExpand({},O):B.children&&B.children.length&&n.onActiveChange(B.children[0].key),c.preventDefault();break}case $r.ENTER:case $r.SPACE:{D&&!O.disabled&&O.checkable!==!1&&!O.disableCheckbox?n.onNodeCheck({},O,!b.includes(d)):!D&&p&&!O.disabled&&O.selectable!==!1&&n.onNodeSelect({},O);break}}}C==null||C(c)}),Te(Rt(n),"setUncontrolledState",function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var m=!1,b=!0,g={};Object.keys(c).forEach(function(w){if(n.props.hasOwnProperty(w)){b=!1;return}m=!0,g[w]=c[w]}),m&&(!f||b)&&n.setState(qe(qe({},g),d))}}),Te(Rt(n),"scrollTo",function(c){n.listRef.current.scrollTo(c)}),n}return Lp(r,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var o=this.props,a=o.activeKey,u=o.itemScrollOffset,c=u===void 0?0:u;a!==void 0&&a!==this.state.activeKey&&(this.setState({activeKey:a}),a!==null&&this.scrollTo({key:a,offset:c}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var o=this.state,a=o.focused,u=o.flattenNodes,c=o.keyEntities,f=o.draggingNodeKey,d=o.activeKey,m=o.dropLevelOffset,b=o.dropContainerKey,g=o.dropTargetKey,w=o.dropPosition,C=o.dragOverNodeKey,D=o.indent,p=this.props,B=p.prefixCls,F=p.className,S=p.style,O=p.showLine,M=p.focusable,_=p.tabIndex,z=_===void 0?0:_,K=p.selectable,$=p.showIcon,Q=p.icon,V=p.switcherIcon,X=p.draggable,G=p.checkable,j=p.checkStrictly,H=p.disabled,U=p.motion,R=p.loadData,te=p.filterTreeNode,q=p.height,se=p.itemHeight,ye=p.scrollWidth,we=p.virtual,ie=p.titleRender,me=p.dropIndicatorRender,Oe=p.onContextMenu,ee=p.onScroll,pe=p.direction,le=p.rootClassName,ue=p.rootStyle,De=ss(this.props,{aria:!0,data:!0}),Ce;X&&(En(X)==="object"?Ce=X:typeof X=="function"?Ce={nodeDraggable:X}:Ce={});var Ee={prefixCls:B,selectable:K,showIcon:$,icon:Q,switcherIcon:V,draggable:Ce,draggingNodeKey:f,checkable:G,checkStrictly:j,disabled:H,keyEntities:c,dropLevelOffset:m,dropContainerKey:b,dropTargetKey:g,dropPosition:w,dragOverNodeKey:C,indent:D,direction:pe,dropIndicatorRender:me,loadData:R,filterTreeNode:te,titleRender:ie,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return k.createElement(P0.Provider,{value:Ee},k.createElement("div",{className:tt(B,F,le,Te(Te(Te({},"".concat(B,"-show-line"),O),"".concat(B,"-focused"),a),"".concat(B,"-active-focused"),d!==null)),style:ue},k.createElement(i5,vt({ref:this.listRef,prefixCls:B,style:S,data:u,disabled:H,selectable:K,checkable:!!G,motion:U,dragging:f!==null,height:q,itemHeight:se,virtual:we,focusable:M,focused:a,tabIndex:z,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Oe,onScroll:ee,scrollWidth:ye},this.getTreeNodeRequiredProps(),De))))}}],[{key:"getDerivedStateFromProps",value:function(o,a){var u=a.prevProps,c={prevProps:o};function f(z){return!u&&o.hasOwnProperty(z)||u&&u[z]!==o[z]}var d,m=a.fieldNames;if(f("fieldNames")&&(m=aa(o.fieldNames),c.fieldNames=m),f("treeData")?d=o.treeData:f("children")&&(zn(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),d=b1(o.children)),d){c.treeData=d;var b=F0(d,{fieldNames:m});c.keyEntities=qe(Te({},Po,j1),b.keyEntities)}var g=c.keyEntities||a.keyEntities;if(f("expandedKeys")||u&&f("autoExpandParent"))c.expandedKeys=o.autoExpandParent||!u&&o.defaultExpandParent?Tu(o.expandedKeys,g):o.expandedKeys;else if(!u&&o.defaultExpandAll){var w=qe({},g);delete w[Po];var C=[];Object.keys(w).forEach(function(z){var K=w[z];K.children&&K.children.length&&C.push(K.key)}),c.expandedKeys=C}else!u&&o.defaultExpandedKeys&&(c.expandedKeys=o.autoExpandParent||o.defaultExpandParent?Tu(o.defaultExpandedKeys,g):o.defaultExpandedKeys);if(c.expandedKeys||delete c.expandedKeys,d||c.expandedKeys){var D=Ol(d||a.treeData,c.expandedKeys||a.expandedKeys,m);c.flattenNodes=D}if(o.selectable&&(f("selectedKeys")?c.selectedKeys=Zd(o.selectedKeys,o):!u&&o.defaultSelectedKeys&&(c.selectedKeys=Zd(o.defaultSelectedKeys,o))),o.checkable){var p;if(f("checkedKeys")?p=$l(o.checkedKeys)||{}:!u&&o.defaultCheckedKeys?p=$l(o.defaultCheckedKeys)||{}:d&&(p=$l(o.checkedKeys)||{checkedKeys:a.checkedKeys,halfCheckedKeys:a.halfCheckedKeys}),p){var B=p,F=B.checkedKeys,S=F===void 0?[]:F,O=B.halfCheckedKeys,M=O===void 0?[]:O;if(!o.checkStrictly){var _=ea(S,!0,g);S=_.checkedKeys,M=_.halfCheckedKeys}c.checkedKeys=S,c.halfCheckedKeys=M}}return f("loadedKeys")&&(c.loadedKeys=o.loadedKeys),c}}]),r})(k.Component);Te(z0,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:Zv,allowDrop:function(){return!0},expandAction:!1});Te(z0,"TreeNode",Ga);var l5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},u5=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:l5}))},_1=k.forwardRef(u5),c5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},d5=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:c5}))},f5=k.forwardRef(d5),h5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},p5=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:h5}))},m5=k.forwardRef(p5),g5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},v5=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:g5}))},b5=k.forwardRef(v5);const y5=({treeCls:e,treeNodeCls:t,directoryNodeSelectedBg:r,directoryNodeSelectedColor:n,motionDurationMid:o,borderRadius:a,controlItemBgHover:u})=>({[`${e}${e}-directory ${t}`]:{[`${e}-node-content-wrapper`]:{position:"static",[`&:has(${e}-drop-indicator)`]:{position:"relative"},[`> *:not(${e}-drop-indicator)`]:{position:"relative"},"&:hover":{background:"transparent"},"&:before":{position:"absolute",inset:0,transition:`background-color ${o}`,content:'""',borderRadius:a},"&:hover:before":{background:u}},[`${e}-switcher, ${e}-checkbox, ${e}-draggable-icon`]:{zIndex:1},"&-selected":{background:r,borderRadius:a,[`${e}-switcher, ${e}-draggable-icon`]:{color:n},[`${e}-node-content-wrapper`]:{color:n,background:"transparent","&, &:hover":{color:n},"&:before, &:hover:before":{background:r}}}}}),x5=new H4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),C5=(e,t)=>({[`.${e}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${t.motionDurationSlow}`}}}),w5=(e,t)=>({[`.${e}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${Ue(t.lineWidthBold)} solid ${t.colorPrimary}`,borderRadius:"50%",content:'""'}}}),D5=(e,t)=>{const{treeCls:r,treeNodeCls:n,treeNodePadding:o,titleHeight:a,indentSize:u,nodeSelectedBg:c,nodeHoverBg:f,colorTextQuaternary:d,controlItemBgActiveDisabled:m}=t;return{[r]:Object.assign(Object.assign({},si(t)),{"--rc-virtual-list-scrollbar-bg":t.colorSplit,background:t.colorBgContainer,borderRadius:t.borderRadius,transition:`background-color ${t.motionDurationSlow}`,"&-rtl":{direction:"rtl"},[`&${r}-rtl ${r}-switcher_close ${r}-switcher-icon svg`]:{transform:"rotate(90deg)"},[`&-focused:not(:hover):not(${r}-active-focused)`]:Kp(t),[`${r}-list-holder-inner`]:{alignItems:"flex-start"},[`&${r}-block-node`]:{[`${r}-list-holder-inner`]:{alignItems:"stretch",[`${r}-node-content-wrapper`]:{flex:"auto"},[`${n}.dragging:after`]:{position:"absolute",inset:0,border:`1px solid ${t.colorPrimary}`,opacity:0,animationName:x5,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none",borderRadius:t.borderRadius}}},[n]:{display:"flex",alignItems:"flex-start",marginBottom:o,lineHeight:Ue(a),position:"relative","&:before":{content:'""',position:"absolute",zIndex:1,insetInlineStart:0,width:"100%",top:"100%",height:o},[`&-disabled ${r}-node-content-wrapper`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}},[`${r}-checkbox-disabled + ${r}-node-selected,&${n}-disabled${n}-selected ${r}-node-content-wrapper`]:{backgroundColor:m},[`${r}-checkbox-disabled`]:{pointerEvents:"unset"},[`&:not(${n}-disabled)`]:{[`${r}-node-content-wrapper`]:{"&:hover":{color:t.nodeHoverColor}}},[`&-active ${r}-node-content-wrapper`]:{background:t.controlItemBgHover},[`&:not(${n}-disabled).filter-node ${r}-title`]:{color:t.colorPrimary,fontWeight:t.fontWeightStrong},"&-draggable":{cursor:"grab",[`${r}-draggable-icon`]:{flexShrink:0,width:a,textAlign:"center",visibility:"visible",color:d},[`&${n}-disabled ${r}-draggable-icon`]:{visibility:"hidden"}}},[`${r}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:u}},[`${r}-draggable-icon`]:{visibility:"hidden"},[`${r}-switcher, ${r}-checkbox`]:{marginInlineEnd:t.calc(t.calc(a).sub(t.controlInteractiveSize)).div(2).equal()},[`${r}-switcher`]:Object.assign(Object.assign({},C5(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${t.motionDurationSlow}`,"&-noop":{cursor:"unset"},"&:before":{pointerEvents:"none",content:'""',width:a,height:a,position:"absolute",left:{_skip_check_:!0,value:0},top:0,borderRadius:t.borderRadius,transition:`all ${t.motionDurationSlow}`},[`&:not(${r}-switcher-noop):hover:before`]:{backgroundColor:t.colorBgTextHover},[`&_close ${r}-switcher-icon svg`]:{transform:"rotate(-90deg)"},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:`1px solid ${t.colorBorder}`,content:'""'}}}),[`${r}-node-content-wrapper`]:Object.assign(Object.assign({position:"relative",minHeight:a,paddingBlock:0,paddingInline:t.paddingXS,background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:`all ${t.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`},w5(e,t)),{"&:hover":{backgroundColor:f},[`&${r}-node-selected`]:{color:t.nodeSelectedColor,backgroundColor:c},[`${r}-iconEle`]:{display:"inline-block",width:a,height:a,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}}),[`${r}-unselectable ${r}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${n}.drop-container > [draggable]`]:{boxShadow:`0 0 0 2px ${t.colorPrimary}`},"&-show-line":{[`${r}-indent-unit`]:{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&-end:before":{display:"none"}},[`${r}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${n}-leaf-last ${r}-switcher-leaf-line:before`]:{top:"auto !important",bottom:"auto !important",height:`${Ue(t.calc(a).div(2).equal())} !important`}})}},E5=(e,t,r=!0)=>{const n=`.${e}`,o=`${n}-treenode`,a=t.calc(t.paddingXS).div(2).equal(),u=Ua(t,{treeCls:n,treeNodeCls:o,treeNodePadding:a});return[D5(e,u),r&&y5(u)].filter(Boolean)},k5=e=>{const{controlHeightSM:t,controlItemBgHover:r,controlItemBgActive:n}=e,o=t;return{titleHeight:o,indentSize:o,nodeHoverBg:r,nodeHoverColor:e.colorText,nodeSelectedBg:n,nodeSelectedColor:e.colorText}},S5=e=>{const{colorTextLightSolid:t,colorPrimary:r}=e;return Object.assign(Object.assign({},k5(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:r})},B5=Fs("Tree",(e,{prefixCls:t})=>[{[e.componentCls]:L4(`${t}-checkbox`,e)},E5(t,e),Wp(e)],S5),af=4;function A5(e){const{dropPosition:t,dropLevelOffset:r,prefixCls:n,indent:o,direction:a="ltr"}=e,u=a==="ltr"?"left":"right",c=a==="ltr"?"right":"left",f={[u]:-r*o+af,[c]:0};switch(t){case-1:f.top=-3;break;case 1:f.bottom=-3;break;default:f.bottom=-3,f[u]=o+af;break}return je.createElement("div",{style:f,className:`${n}-drop-indicator`})}var F5={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},N5=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:F5}))},O5=k.forwardRef(N5),$5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},T5=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:$5}))},M5=k.forwardRef(T5),R5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},P5=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:R5}))},I5=k.forwardRef(P5);const z5=e=>{var t,r;const{prefixCls:n,switcherIcon:o,treeNodeProps:a,showLine:u,switcherLoadingIcon:c}=e,{isLeaf:f,expanded:d,loading:m}=a;if(m)return k.isValidElement(c)?c:k.createElement(K4,{className:`${n}-switcher-loading-icon`});let b;if(u&&typeof u=="object"&&(b=u.showLeafIcon),f){if(!u)return null;if(typeof b!="boolean"&&b){const C=typeof b=="function"?b(a):b,D=`${n}-switcher-line-custom-icon`;return k.isValidElement(C)?oa(C,{className:tt((t=C.props)===null||t===void 0?void 0:t.className,D)}):C}return b?k.createElement(_1,{className:`${n}-switcher-line-icon`}):k.createElement("span",{className:`${n}-switcher-leaf-line`})}const g=`${n}-switcher-icon`,w=typeof o=="function"?o(a):o;return k.isValidElement(w)?oa(w,{className:tt((r=w.props)===null||r===void 0?void 0:r.className,g)}):w!==void 0?w:u?d?k.createElement(M5,{className:`${n}-switcher-line-icon`}):k.createElement(I5,{className:`${n}-switcher-line-icon`}):k.createElement(O5,{className:g})},L1=je.forwardRef((e,t)=>{var r;const{getPrefixCls:n,direction:o,virtual:a,tree:u}=je.useContext(bo),{prefixCls:c,className:f,showIcon:d=!1,showLine:m,switcherIcon:b,switcherLoadingIcon:g,blockNode:w=!1,children:C,checkable:D=!1,selectable:p=!0,draggable:B,disabled:F,motion:S,style:O}=e,M=n("tree",c),_=n(),z=je.useContext(q4),K=F??z,$=S??Object.assign(Object.assign({},Yp(_)),{motionAppear:!1}),Q=Object.assign(Object.assign({},e),{checkable:D,selectable:p,showIcon:d,motion:$,blockNode:w,disabled:K,showLine:!!m,dropIndicatorRender:A5}),[V,X,G]=B5(M),[,j]=b0(),H=j.paddingXS/2+(((r=j.Tree)===null||r===void 0?void 0:r.titleHeight)||j.controlHeightSM),U=je.useMemo(()=>{if(!B)return!1;let te={};switch(typeof B){case"function":te.nodeDraggable=B;break;case"object":te=Object.assign({},B);break}return te.icon!==!1&&(te.icon=te.icon||je.createElement(b5,null)),te},[B]),R=te=>je.createElement(z5,{prefixCls:M,switcherIcon:b,switcherLoadingIcon:g,treeNodeProps:te,showLine:m});return V(je.createElement(z0,Object.assign({itemHeight:H,ref:t,virtual:a},Q,{style:Object.assign(Object.assign({},u==null?void 0:u.style),O),prefixCls:M,className:tt({[`${M}-icon-hide`]:!d,[`${M}-block-node`]:w,[`${M}-unselectable`]:!p,[`${M}-rtl`]:o==="rtl",[`${M}-disabled`]:K},u==null?void 0:u.className,f,X,G),direction:o,checkable:D&&je.createElement("span",{className:`${M}-checkbox-inner`}),selectable:p,switcherIcon:R,draggable:U}),C))}),sf=0,Tl=1,lf=2;function j0(e,t,r){const{key:n,children:o}=r;function a(u){const c=u[n],f=u[o];t(c,u)!==!1&&j0(f||[],t,r)}e.forEach(a)}function j5({treeData:e,expandedKeys:t,startKey:r,endKey:n,fieldNames:o}){const a=[];let u=sf;if(r&&r===n)return[r];if(!r||!n)return[];function c(f){return f===r||f===n}return j0(e,f=>{if(u===lf)return!1;if(c(f)){if(a.push(f),u===sf)u=Tl;else if(u===Tl)return u=lf,!1}else u===Tl&&a.push(f);return t.includes(f)},aa(o)),a}function Ml(e,t,r){const n=At(t),o=[];return j0(e,(a,u)=>{const c=n.indexOf(a);return c!==-1&&(o.push(u),n.splice(c,1)),!!n.length},aa(r)),o}var uf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};function _5(e){const{isLeaf:t,expanded:r}=e;return t?k.createElement(_1,null):r?k.createElement(f5,null):k.createElement(m5,null)}function cf({treeData:e,children:t}){return e||b1(t)}const L5=(e,t)=>{var{defaultExpandAll:r,defaultExpandParent:n,defaultExpandedKeys:o}=e,a=uf(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const u=k.useRef(null),c=k.useRef(null),f=()=>{const{keyEntities:K}=F0(cf(a),{fieldNames:a.fieldNames});let $;return r?$=Object.keys(K):n?$=Tu(a.expandedKeys||o||[],K):$=a.expandedKeys||o||[],$},[d,m]=k.useState(a.selectedKeys||a.defaultSelectedKeys||[]),[b,g]=k.useState(()=>f());k.useEffect(()=>{"selectedKeys"in a&&m(a.selectedKeys)},[a.selectedKeys]),k.useEffect(()=>{"expandedKeys"in a&&g(a.expandedKeys)},[a.expandedKeys]);const w=(K,$)=>{var Q;return"expandedKeys"in a||g(K),(Q=a.onExpand)===null||Q===void 0?void 0:Q.call(a,K,$)},C=(K,$)=>{var Q;const{multiple:V,fieldNames:X}=a,{node:G,nativeEvent:j}=$,{key:H=""}=G,U=cf(a),R=Object.assign(Object.assign({},$),{selected:!0}),te=(j==null?void 0:j.ctrlKey)||(j==null?void 0:j.metaKey),q=j==null?void 0:j.shiftKey;let se;V&&te?(se=K,u.current=H,c.current=se,R.selectedNodes=Ml(U,se,X)):V&&q?(se=Array.from(new Set([].concat(At(c.current||[]),At(j5({treeData:U,expandedKeys:b,startKey:H,endKey:u.current,fieldNames:X}))))),R.selectedNodes=Ml(U,se,X)):(se=[H],u.current=H,c.current=se,R.selectedNodes=Ml(U,se,X)),(Q=a.onSelect)===null||Q===void 0||Q.call(a,se,R),"selectedKeys"in a||m(se)},{getPrefixCls:D,direction:p}=k.useContext(bo),{prefixCls:B,className:F,showIcon:S=!0,expandAction:O="click"}=a,M=uf(a,["prefixCls","className","showIcon","expandAction"]),_=D("tree",B),z=tt(`${_}-directory`,{[`${_}-directory-rtl`]:p==="rtl"},F);return k.createElement(L1,Object.assign({icon:_5,ref:t,blockNode:!0},M,{showIcon:S,expandAction:O,prefixCls:_,className:z,expandedKeys:b,selectedKeys:d,onSelect:C,onExpand:w}))},H5=k.forwardRef(L5),_0=L1;_0.DirectoryTree=H5;_0.TreeNode=Ga;const df=e=>{const{value:t,filterSearch:r,tablePrefixCls:n,locale:o,onChange:a}=e;return r?k.createElement("div",{className:`${n}-filter-dropdown-search`},k.createElement(W4,{prefix:k.createElement(V4,null),placeholder:o.filterSearchPlaceholder,onChange:a,value:t,htmlSize:1,className:`${n}-filter-dropdown-search-input`})):null},K5=e=>{const{keyCode:t}=e;t===$r.ENTER&&e.stopPropagation()},q5=k.forwardRef((e,t)=>k.createElement("div",{className:e.className,onClick:r=>r.stopPropagation(),onKeyDown:K5,ref:t},e.children));function ta(e){let t=[];return(e||[]).forEach(({value:r,children:n})=>{t.push(r),n&&(t=[].concat(At(t),At(ta(n))))}),t}function W5(e){return e.some(({children:t})=>t)}function H1(e,t){return typeof t=="string"||typeof t=="number"?t==null?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()):!1}function K1({filters:e,prefixCls:t,filteredKeys:r,filterMultiple:n,searchValue:o,filterSearch:a}){return e.map((u,c)=>{const f=String(u.value);if(u.children)return{key:f||c,label:u.text,popupClassName:`${t}-dropdown-submenu`,children:K1({filters:u.children,prefixCls:t,filteredKeys:r,filterMultiple:n,searchValue:o,filterSearch:a})};const d=n?ls:$p,m={key:u.value!==void 0?f:c,label:k.createElement(k.Fragment,null,k.createElement(d,{checked:r.includes(f)}),k.createElement("span",null,u.text))};return o.trim()?typeof a=="function"?a(o,u)?m:null:H1(o,u.text)?m:null:m})}function Rl(e){return e||[]}const V5=e=>{var t,r,n,o;const{tablePrefixCls:a,prefixCls:u,column:c,dropdownPrefixCls:f,columnKey:d,filterOnClose:m,filterMultiple:b,filterMode:g="menu",filterSearch:w=!1,filterState:C,triggerFilter:D,locale:p,children:B,getPopupContainer:F,rootClassName:S}=e,{filterResetToDefaultFilteredValue:O,defaultFilteredValue:M,filterDropdownProps:_={},filterDropdownOpen:z,filterDropdownVisible:K,onFilterDropdownVisibleChange:$,onFilterDropdownOpenChange:Q}=c,[V,X]=k.useState(!1),G=!!(C&&(!((t=C.filteredKeys)===null||t===void 0)&&t.length||C.forceFiltered)),j=Pe=>{var Le;X(Pe),(Le=_.onOpenChange)===null||Le===void 0||Le.call(_,Pe),Q==null||Q(Pe),$==null||$(Pe)},H=(o=(n=(r=_.open)!==null&&r!==void 0?r:z)!==null&&n!==void 0?n:K)!==null&&o!==void 0?o:V,U=C==null?void 0:C.filteredKeys,[R,te]=l2(Rl(U)),q=({selectedKeys:Pe})=>{te(Pe)},se=(Pe,{node:Le,checked:Ve})=>{q(b?{selectedKeys:Pe}:{selectedKeys:Ve&&Le.key?[Le.key]:[]})};k.useEffect(()=>{V&&q({selectedKeys:Rl(U)})},[U]);const[ye,we]=k.useState([]),ie=Pe=>{we(Pe)},[me,Oe]=k.useState(""),ee=Pe=>{const{value:Le}=Pe.target;Oe(Le)};k.useEffect(()=>{V||Oe("")},[V]);const pe=Pe=>{const Le=Pe!=null&&Pe.length?Pe:null;if(Le===null&&(!C||!C.filteredKeys)||Ro(Le,C==null?void 0:C.filteredKeys,!0))return null;D({column:c,key:d,filteredKeys:Le})},le=()=>{j(!1),pe(R())},ue=({confirm:Pe,closeDropdown:Le}={confirm:!1,closeDropdown:!1})=>{Pe&&pe([]),Le&&j(!1),Oe(""),te(O?(M||[]).map(Ve=>String(Ve)):[])},De=({closeDropdown:Pe}={closeDropdown:!0})=>{Pe&&j(!1),pe(R())},Ce=(Pe,Le)=>{Le.source==="trigger"&&(Pe&&U!==void 0&&te(Rl(U)),j(Pe),!Pe&&!c.filterDropdown&&m&&le())},Ee=tt({[`${f}-menu-without-submenu`]:!W5(c.filters||[])}),Fe=Pe=>{if(Pe.target.checked){const Le=ta(c==null?void 0:c.filters).map(Ve=>String(Ve));te(Le)}else te([])},Be=({filters:Pe})=>(Pe||[]).map((Le,Ve)=>{const ft=String(Le.value),Je={title:Le.text,key:Le.value!==void 0?ft:String(Ve)};return Le.children&&(Je.children=Be({filters:Le.children})),Je}),Ne=Pe=>{var Le;return Object.assign(Object.assign({},Pe),{text:Pe.title,value:Pe.key,children:((Le=Pe.children)===null||Le===void 0?void 0:Le.map(Ve=>Ne(Ve)))||[]})};let ze;const{direction:Me,renderEmpty:Ge}=k.useContext(bo);if(typeof c.filterDropdown=="function")ze=c.filterDropdown({prefixCls:`${f}-custom`,setSelectedKeys:Pe=>q({selectedKeys:Pe}),selectedKeys:R(),confirm:De,clearFilters:ue,filters:c.filters,visible:H,close:()=>{j(!1)}});else if(c.filterDropdown)ze=c.filterDropdown;else{const Pe=R()||[],Le=()=>{var ft,Je;const Xe=(ft=Ge==null?void 0:Ge("Table.filter"))!==null&&ft!==void 0?ft:k.createElement(Fd,{image:Fd.PRESENTED_IMAGE_SIMPLE,description:p.filterEmptyText,styles:{image:{height:24}},style:{margin:0,padding:"16px 0"}});if((c.filters||[]).length===0)return Xe;if(g==="tree")return k.createElement(k.Fragment,null,k.createElement(df,{filterSearch:w,value:me,onChange:ee,tablePrefixCls:a,locale:p}),k.createElement("div",{className:`${a}-filter-dropdown-tree`},b?k.createElement(ls,{checked:Pe.length===ta(c.filters).length,indeterminate:Pe.length>0&&Pe.length<ta(c.filters).length,className:`${a}-filter-dropdown-checkall`,onChange:Fe},(Je=p==null?void 0:p.filterCheckall)!==null&&Je!==void 0?Je:p==null?void 0:p.filterCheckAll):null,k.createElement(_0,{checkable:!0,selectable:!1,blockNode:!0,multiple:b,checkStrictly:!b,className:`${f}-menu`,onCheck:se,checkedKeys:Pe,selectedKeys:Pe,showIcon:!1,treeData:Be({filters:c.filters}),autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:me.trim()?ct=>typeof w=="function"?w(me,Ne(ct)):H1(me,ct.title):void 0})));const St=K1({filters:c.filters||[],filterSearch:w,prefixCls:u,filteredKeys:R(),filterMultiple:b,searchValue:me}),bt=St.every(ct=>ct===null);return k.createElement(k.Fragment,null,k.createElement(df,{filterSearch:w,value:me,onChange:ee,tablePrefixCls:a,locale:p}),bt?Xe:k.createElement(pa,{selectable:!0,multiple:b,prefixCls:`${f}-menu`,className:Ee,onSelect:q,onDeselect:q,selectedKeys:Pe,getPopupContainer:F,openKeys:ye,onOpenChange:ie,items:St}))},Ve=()=>O?Ro((M||[]).map(ft=>String(ft)),Pe,!0):Pe.length===0;ze=k.createElement(k.Fragment,null,Le(),k.createElement("div",{className:`${u}-dropdown-btns`},k.createElement(is,{type:"link",size:"small",disabled:Ve(),onClick:()=>ue()},p.filterReset),k.createElement(is,{type:"primary",size:"small",onClick:le},p.filterConfirm)))}c.filterDropdown&&(ze=k.createElement(m1,{selectable:void 0},ze)),ze=k.createElement(q5,{className:`${u}-dropdown`},ze);const ut=Xp({trigger:["click"],placement:Me==="rtl"?"bottomLeft":"bottomRight",children:(()=>{let Pe;return typeof c.filterIcon=="function"?Pe=c.filterIcon(G):c.filterIcon?Pe=c.filterIcon:Pe=k.createElement(Qv,null),k.createElement("span",{role:"button",tabIndex:-1,className:tt(`${u}-trigger`,{active:G}),onClick:Le=>{Le.stopPropagation()}},Pe)})(),getPopupContainer:F},Object.assign(Object.assign({},_),{rootClassName:tt(S,_.rootClassName),open:H,onOpenChange:Ce,popupRender:()=>typeof(_==null?void 0:_.dropdownRender)=="function"?_.dropdownRender(ze):ze}));return k.createElement("div",{className:`${u}-column`},k.createElement("span",{className:`${a}-column-title`},B),k.createElement(N0,Object.assign({},ut)))},zu=(e,t,r)=>{let n=[];return(e||[]).forEach((o,a)=>{var u;const c=ba(a,r),f=o.filterDropdown!==void 0;if(o.filters||f||"onFilter"in o)if("filteredValue"in o){let d=o.filteredValue;f||(d=(u=d==null?void 0:d.map(String))!==null&&u!==void 0?u:d),n.push({column:o,key:mo(o,c),filteredKeys:d,forceFiltered:o.filtered})}else n.push({column:o,key:mo(o,c),filteredKeys:t&&o.defaultFilteredValue?o.defaultFilteredValue:void 0,forceFiltered:o.filtered});"children"in o&&(n=[].concat(At(n),At(zu(o.children,t,c))))}),n};function q1(e,t,r,n,o,a,u,c,f){return r.map((d,m)=>{const b=ba(m,c),{filterOnClose:g=!0,filterMultiple:w=!0,filterMode:C,filterSearch:D}=d;let p=d;if(p.filters||p.filterDropdown){const B=mo(p,b),F=n.find(({key:S})=>B===S);p=Object.assign(Object.assign({},p),{title:S=>k.createElement(V5,{tablePrefixCls:e,prefixCls:`${e}-filter`,dropdownPrefixCls:t,column:p,columnKey:B,filterState:F,filterOnClose:g,filterMultiple:w,filterMode:C,filterSearch:D,triggerFilter:a,locale:o,getPopupContainer:u,rootClassName:f},zs(d.title,S))})}return"children"in p&&(p=Object.assign(Object.assign({},p),{children:q1(e,t,p.children,n,o,a,u,b,f)})),p})}const ff=e=>{const t={};return e.forEach(({key:r,filteredKeys:n,column:o})=>{const a=r,{filters:u,filterDropdown:c}=o;if(c)t[a]=n||null;else if(Array.isArray(n)){const f=ta(u);t[a]=f.filter(d=>n.includes(String(d)))}else t[a]=null}),t},ju=(e,t,r)=>t.reduce((o,a)=>{const{column:{onFilter:u,filters:c},filteredKeys:f}=a;return u&&f&&f.length?o.map(d=>Object.assign({},d)).filter(d=>f.some(m=>{const b=ta(c),g=b.findIndex(C=>String(C)===String(m)),w=g!==-1?b[g]:m;return d[r]&&(d[r]=ju(d[r],t,r)),u(w,d)})):o},e),W1=e=>e.flatMap(t=>"children"in t?[t].concat(At(W1(t.children||[]))):[t]),U5=e=>{const{prefixCls:t,dropdownPrefixCls:r,mergedColumns:n,onFilterChange:o,getPopupContainer:a,locale:u,rootClassName:c}=e;Ns();const f=k.useMemo(()=>W1(n||[]),[n]),[d,m]=k.useState(()=>zu(f,!0)),b=k.useMemo(()=>{const D=zu(f,!1);if(D.length===0)return D;let p=!0;if(D.forEach(({filteredKeys:B})=>{B!==void 0&&(p=!1)}),p){const B=(f||[]).map((F,S)=>mo(F,ba(S)));return d.filter(({key:F})=>B.includes(F)).map(F=>{const S=f[B.indexOf(F.key)];return Object.assign(Object.assign({},F),{column:Object.assign(Object.assign({},F.column),S),forceFiltered:S.filtered})})}return D},[f,d]),g=k.useMemo(()=>ff(b),[b]),w=D=>{const p=b.filter(({key:B})=>B!==D.key);p.push(D),m(p),o(ff(p),p)};return[D=>q1(t,r,D,b,u,w,a,void 0,c),b,g]},Y5=(e,t,r)=>{const n=k.useRef({});function o(a){var u;if(!n.current||n.current.data!==e||n.current.childrenColumnName!==t||n.current.getRowKey!==r){let f=function(d){d.forEach((m,b)=>{const g=r(m,b);c.set(g,m),m&&typeof m=="object"&&t in m&&f(m[t]||[])})};const c=new Map;f(e),n.current={data:e,childrenColumnName:t,kvMap:c,getRowKey:r}}return(u=n.current.kvMap)===null||u===void 0?void 0:u.get(a)}return[o]};var G5=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const V1=10;function X5(e,t){const r={current:e.current,pageSize:e.pageSize};return Object.keys(t&&typeof t=="object"?t:{}).forEach(o=>{const a=e[o];typeof a!="function"&&(r[o]=a)}),r}function Q5(e,t,r){const n=r&&typeof r=="object"?r:{},{total:o=0}=n,a=G5(n,["total"]),[u,c]=Pt(()=>({current:"defaultCurrent"in a?a.defaultCurrent:1,pageSize:"defaultPageSize"in a?a.defaultPageSize:V1})),f=Xp(u,a,{total:o>0?o:e}),d=Math.ceil((o||e)/f.pageSize);f.current>d&&(f.current=d||1);const m=(g,w)=>{c({current:g??1,pageSize:w||f.pageSize})},b=(g,w)=>{var C;r&&((C=r.onChange)===null||C===void 0||C.call(r,g,w)),m(g,w),t(g,w||(f==null?void 0:f.pageSize))};return r===!1?[{},()=>{}]:[Object.assign(Object.assign({},f),{onChange:b}),m]}var Z5={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},J5=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:Z5}))},e6=k.forwardRef(J5),t6={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},r6=function(t,r){return k.createElement(kn,vt({},t,{ref:r,icon:t6}))},n6=k.forwardRef(r6);const Ki="ascend",Pl="descend",fs=e=>typeof e.sorter=="object"&&typeof e.sorter.multiple=="number"?e.sorter.multiple:!1,hf=e=>typeof e=="function"?e:e&&typeof e=="object"&&e.compare?e.compare:!1,o6=(e,t)=>t?e[e.indexOf(t)+1]:e[0],_u=(e,t,r)=>{let n=[];const o=(a,u)=>{n.push({column:a,key:mo(a,u),multiplePriority:fs(a),sortOrder:a.sortOrder})};return(e||[]).forEach((a,u)=>{const c=ba(u,r);a.children?("sortOrder"in a&&o(a,c),n=[].concat(At(n),At(_u(a.children,t,c)))):a.sorter&&("sortOrder"in a?o(a,c):t&&a.defaultSortOrder&&n.push({column:a,key:mo(a,c),multiplePriority:fs(a),sortOrder:a.defaultSortOrder}))}),n},U1=(e,t,r,n,o,a,u,c)=>(t||[]).map((d,m)=>{const b=ba(m,c);let g=d;if(g.sorter){const w=g.sortDirections||o,C=g.showSorterTooltip===void 0?u:g.showSorterTooltip,D=mo(g,b),p=r.find(({key:$})=>$===D),B=p?p.sortOrder:null,F=o6(w,B);let S;if(d.sortIcon)S=d.sortIcon({sortOrder:B});else{const $=w.includes(Ki)&&k.createElement(n6,{className:tt(`${e}-column-sorter-up`,{active:B===Ki})}),Q=w.includes(Pl)&&k.createElement(e6,{className:tt(`${e}-column-sorter-down`,{active:B===Pl})});S=k.createElement("span",{className:tt(`${e}-column-sorter`,{[`${e}-column-sorter-full`]:!!($&&Q)})},k.createElement("span",{className:`${e}-column-sorter-inner`,"aria-hidden":"true"},$,Q))}const{cancelSort:O,triggerAsc:M,triggerDesc:_}=a||{};let z=O;F===Pl?z=_:F===Ki&&(z=M);const K=typeof C=="object"?Object.assign({title:z},C):{title:z};g=Object.assign(Object.assign({},g),{className:tt(g.className,{[`${e}-column-sort`]:B}),title:$=>{const Q=`${e}-column-sorters`,V=k.createElement("span",{className:`${e}-column-title`},zs(d.title,$)),X=k.createElement("div",{className:Q},V,S);return C?typeof C!="boolean"&&(C==null?void 0:C.target)==="sorter-icon"?k.createElement("div",{className:`${Q} ${e}-column-sorters-tooltip-target-sorter`},V,k.createElement(os,Object.assign({},K),S)):k.createElement(os,Object.assign({},K),X):X},onHeaderCell:$=>{var Q;const V=((Q=d.onHeaderCell)===null||Q===void 0?void 0:Q.call(d,$))||{},X=V.onClick,G=V.onKeyDown;V.onClick=U=>{n({column:d,key:D,sortOrder:F,multiplePriority:fs(d)}),X==null||X(U)},V.onKeyDown=U=>{U.keyCode===$r.ENTER&&(n({column:d,key:D,sortOrder:F,multiplePriority:fs(d)}),G==null||G(U))};const j=Yv(d.title,{}),H=j==null?void 0:j.toString();return B&&(V["aria-sort"]=B==="ascend"?"ascending":"descending"),V["aria-label"]=H||"",V.className=tt(V.className,`${e}-column-has-sorters`),V.tabIndex=0,d.ellipsis&&(V.title=(j??"").toString()),V}})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:U1(e,g.children,r,n,o,a,u,b)})),g}),pf=e=>{const{column:t,sortOrder:r}=e;return{column:t,order:r,field:t.dataIndex,columnKey:t.key}},mf=e=>{const t=e.filter(({sortOrder:r})=>r).map(pf);if(t.length===0&&e.length){const r=e.length-1;return Object.assign(Object.assign({},pf(e[r])),{column:void 0,order:void 0,field:void 0,columnKey:void 0})}return t.length<=1?t[0]||{}:t},Lu=(e,t,r)=>{const n=t.slice().sort((u,c)=>c.multiplePriority-u.multiplePriority),o=e.slice(),a=n.filter(({column:{sorter:u},sortOrder:c})=>hf(u)&&c);return a.length?o.sort((u,c)=>{for(let f=0;f<a.length;f+=1){const d=a[f],{column:{sorter:m},sortOrder:b}=d,g=hf(m);if(g&&b){const w=g(u,c,b);if(w!==0)return b===Ki?w:-w}}return 0}).map(u=>{const c=u[r];return c?Object.assign(Object.assign({},u),{[r]:Lu(c,t,r)}):u}):o},a6=e=>{const{prefixCls:t,mergedColumns:r,sortDirections:n,tableLocale:o,showSorterTooltip:a,onSorterChange:u}=e,[c,f]=k.useState(()=>_u(r,!0)),d=(D,p)=>{const B=[];return D.forEach((F,S)=>{const O=ba(S,p);if(B.push(mo(F,O)),Array.isArray(F.children)){const M=d(F.children,O);B.push.apply(B,At(M))}}),B},m=k.useMemo(()=>{let D=!0;const p=_u(r,!1);if(!p.length){const O=d(r);return c.filter(({key:M})=>O.includes(M))}const B=[];function F(O){D?B.push(O):B.push(Object.assign(Object.assign({},O),{sortOrder:null}))}let S=null;return p.forEach(O=>{S===null?(F(O),O.sortOrder&&(O.multiplePriority===!1?D=!1:S=!0)):(S&&O.multiplePriority!==!1||(D=!1),F(O))}),B},[r,c]),b=k.useMemo(()=>{var D,p;const B=m.map(({column:F,sortOrder:S})=>({column:F,order:S}));return{sortColumns:B,sortColumn:(D=B[0])===null||D===void 0?void 0:D.column,sortOrder:(p=B[0])===null||p===void 0?void 0:p.order}},[m]),g=D=>{let p;D.multiplePriority===!1||!m.length||m[0].multiplePriority===!1?p=[D]:p=[].concat(At(m.filter(({key:B})=>B!==D.key)),[D]),f(p),u(mf(p),p)};return[D=>U1(t,D,m,g,n,o,a),m,b,()=>mf(m)]},Y1=(e,t)=>e.map(n=>{const o=Object.assign({},n);return o.title=zs(n.title,t),"children"in o&&(o.children=Y1(o.children,t)),o}),i6=e=>[k.useCallback(r=>Y1(r,e),[e])],s6=M1((e,t)=>{const{_renderTimes:r}=e,{_renderTimes:n}=t;return r!==n}),l6=P1((e,t)=>{const{_renderTimes:r}=e,{_renderTimes:n}=t;return r!==n}),u6=e=>{const{componentCls:t,lineWidth:r,lineType:n,tableBorderColor:o,tableHeaderBg:a,tablePaddingVertical:u,tablePaddingHorizontal:c,calc:f}=e,d=`${Ue(r)} ${n} ${o}`,m=(b,g,w)=>({[`&${t}-${b}`]:{[`> ${t}-container`]:{[`> ${t}-content, > ${t}-body`]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{[`> ${t}-expanded-row-fixed`]:{margin:`${Ue(f(g).mul(-1).equal())}
28
- ${Ue(f(f(w).add(r)).mul(-1).equal())}`}}}}}});return{[`${t}-wrapper`]:{[`${t}${t}-bordered`]:Object.assign(Object.assign(Object.assign({[`> ${t}-title`]:{border:d,borderBottom:0},[`> ${t}-container`]:{borderInlineStart:d,borderTop:d,[`
29
- > ${t}-content,
30
- > ${t}-header,
31
- > ${t}-body,
32
- > ${t}-summary
33
- `]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:d},"> thead":{"> tr:not(:last-child) > th":{borderBottom:d},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{[`> ${t}-cell-fix-right-first::after`]:{borderInlineEnd:d}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{[`> ${t}-expanded-row-fixed`]:{margin:`${Ue(f(u).mul(-1).equal())} ${Ue(f(f(c).add(r)).mul(-1).equal())}`,"&::after":{position:"absolute",top:0,insetInlineEnd:r,bottom:0,borderInlineEnd:d,content:'""'}}}}}},[`&${t}-scroll-horizontal`]:{[`> ${t}-container > ${t}-body`]:{"> table > tbody":{[`
34
- > tr${t}-expanded-row,
35
- > tr${t}-placeholder
36
- `]:{"> th, > td":{borderInlineEnd:0}}}}}},m("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),m("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{[`> ${t}-footer`]:{border:d,borderTop:0}}),[`${t}-cell`]:{[`${t}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${Ue(r)} 0 ${Ue(r)} ${a}`}},[`${t}-bordered ${t}-cell-scrollbar`]:{borderInlineEnd:d}}}},c6=e=>{const{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-cell-ellipsis`]:Object.assign(Object.assign({},qp),{wordBreak:"keep-all",[`
37
- &${t}-cell-fix-left-last,
38
- &${t}-cell-fix-right-first
39
- `]:{overflow:"visible",[`${t}-cell-content`]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},[`${t}-column-title`]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},d6=e=>{const{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-tbody > tr${t}-placeholder`]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},f6=e=>{const{componentCls:t,antCls:r,motionDurationSlow:n,lineWidth:o,paddingXS:a,lineType:u,tableBorderColor:c,tableExpandIconBg:f,tableExpandColumnWidth:d,borderRadius:m,tablePaddingVertical:b,tablePaddingHorizontal:g,tableExpandedRowBg:w,paddingXXS:C,expandIconMarginTop:D,expandIconSize:p,expandIconHalfInner:B,expandIconScale:F,calc:S}=e,O=`${Ue(o)} ${u} ${c}`,M=S(C).sub(o).equal();return{[`${t}-wrapper`]:{[`${t}-expand-icon-col`]:{width:d},[`${t}-row-expand-icon-cell`]:{textAlign:"center",[`${t}-row-expand-icon`]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},[`${t}-row-indent`]:{height:1,float:"left"},[`${t}-row-expand-icon`]:Object.assign(Object.assign({},U4(e)),{position:"relative",float:"left",width:p,height:p,color:"inherit",lineHeight:Ue(p),background:f,border:O,borderRadius:m,transform:`scale(${F})`,"&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:`transform ${n} ease-out`,content:'""'},"&::before":{top:B,insetInlineEnd:M,insetInlineStart:M,height:o},"&::after":{top:M,bottom:M,insetInlineStart:B,width:o,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),[`${t}-row-indent + ${t}-row-expand-icon`]:{marginTop:D,marginInlineEnd:a},[`tr${t}-expanded-row`]:{"&, &:hover":{"> th, > td":{background:w}},[`${r}-descriptions-view`]:{display:"flex",table:{flex:"auto",width:"100%"}}},[`${t}-expanded-row-fixed`]:{position:"relative",margin:`${Ue(S(b).mul(-1).equal())} ${Ue(S(g).mul(-1).equal())}`,padding:`${Ue(b)} ${Ue(g)}`}}}},h6=e=>{const{componentCls:t,antCls:r,iconCls:n,tableFilterDropdownWidth:o,tableFilterDropdownSearchWidth:a,paddingXXS:u,paddingXS:c,colorText:f,lineWidth:d,lineType:m,tableBorderColor:b,headerIconColor:g,fontSizeSM:w,tablePaddingHorizontal:C,borderRadius:D,motionDurationSlow:p,colorIcon:B,colorPrimary:F,tableHeaderFilterActiveBg:S,colorTextDisabled:O,tableFilterDropdownBg:M,tableFilterDropdownHeight:_,controlItemBgHover:z,controlItemBgActive:K,boxShadowSecondary:$,filterDropdownMenuBg:Q,calc:V}=e,X=`${r}-dropdown`,G=`${t}-filter-dropdown`,j=`${r}-tree`,H=`${Ue(d)} ${m} ${b}`;return[{[`${t}-wrapper`]:{[`${t}-filter-column`]:{display:"flex",justifyContent:"space-between"},[`${t}-filter-trigger`]:{position:"relative",display:"flex",alignItems:"center",marginBlock:V(u).mul(-1).equal(),marginInline:`${Ue(u)} ${Ue(V(C).div(2).mul(-1).equal())}`,padding:`0 ${Ue(u)}`,color:g,fontSize:w,borderRadius:D,cursor:"pointer",transition:`all ${p}`,"&:hover":{color:B,background:S},"&.active":{color:F}}}},{[`${r}-dropdown`]:{[G]:Object.assign(Object.assign({},si(e)),{minWidth:o,backgroundColor:M,borderRadius:D,boxShadow:$,overflow:"hidden",[`${X}-menu`]:{maxHeight:_,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:Q,"&:empty::after":{display:"block",padding:`${Ue(c)} 0`,color:O,fontSize:w,textAlign:"center",content:'"Not Found"'}},[`${G}-tree`]:{paddingBlock:`${Ue(c)} 0`,paddingInline:c,[j]:{padding:0},[`${j}-treenode ${j}-node-content-wrapper:hover`]:{backgroundColor:z},[`${j}-treenode-checkbox-checked ${j}-node-content-wrapper`]:{"&, &:hover":{backgroundColor:K}}},[`${G}-search`]:{padding:c,borderBottom:H,"&-input":{input:{minWidth:a},[n]:{color:O}}},[`${G}-checkall`]:{width:"100%",marginBottom:u,marginInlineStart:u},[`${G}-btns`]:{display:"flex",justifyContent:"space-between",padding:`${Ue(V(c).sub(d).equal())} ${Ue(c)}`,overflow:"hidden",borderTop:H}})}},{[`${r}-dropdown ${G}, ${G}-submenu`]:{[`${r}-checkbox-wrapper + span`]:{paddingInlineStart:c,color:f},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},p6=e=>{const{componentCls:t,lineWidth:r,colorSplit:n,motionDurationSlow:o,zIndexTableFixed:a,tableBg:u,zIndexTableSticky:c,calc:f}=e,d=n;return{[`${t}-wrapper`]:{[`
40
- ${t}-cell-fix-left,
41
- ${t}-cell-fix-right
42
- `]:{position:"sticky !important",zIndex:a,background:u},[`
43
- ${t}-cell-fix-left-first::after,
44
- ${t}-cell-fix-left-last::after
45
- `]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:f(r).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:`box-shadow ${o}`,content:'""',pointerEvents:"none",willChange:"transform"},[`${t}-cell-fix-left-all::after`]:{display:"none"},[`
46
- ${t}-cell-fix-right-first::after,
47
- ${t}-cell-fix-right-last::after
48
- `]:{position:"absolute",top:0,bottom:f(r).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:`box-shadow ${o}`,content:'""',pointerEvents:"none"},[`${t}-container`]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:f(c).add(1).equal({unit:!1}),width:30,transition:`box-shadow ${o}`,content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},[`${t}-ping-left`]:{[`&:not(${t}-has-fix-left) ${t}-container::before`]:{boxShadow:`inset 10px 0 8px -8px ${d}`},[`
49
- ${t}-cell-fix-left-first::after,
50
- ${t}-cell-fix-left-last::after
51
- `]:{boxShadow:`inset 10px 0 8px -8px ${d}`},[`${t}-cell-fix-left-last::before`]:{backgroundColor:"transparent !important"}},[`${t}-ping-right`]:{[`&:not(${t}-has-fix-right) ${t}-container::after`]:{boxShadow:`inset -10px 0 8px -8px ${d}`},[`
52
- ${t}-cell-fix-right-first::after,
53
- ${t}-cell-fix-right-last::after
54
- `]:{boxShadow:`inset -10px 0 8px -8px ${d}`}},[`${t}-fixed-column-gapped`]:{[`
55
- ${t}-cell-fix-left-first::after,
56
- ${t}-cell-fix-left-last::after,
57
- ${t}-cell-fix-right-first::after,
58
- ${t}-cell-fix-right-last::after
59
- `]:{boxShadow:"none"}}}}},m6=e=>{const{componentCls:t,antCls:r,margin:n}=e;return{[`${t}-wrapper ${t}-pagination${r}-pagination`]:{margin:`${Ue(n)} 0`}}},g6=e=>{const{componentCls:t,tableRadius:r}=e;return{[`${t}-wrapper`]:{[t]:{[`${t}-title, ${t}-header`]:{borderRadius:`${Ue(r)} ${Ue(r)} 0 0`},[`${t}-title + ${t}-container`]:{borderStartStartRadius:0,borderStartEndRadius:0,[`${t}-header, table`]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:r,borderStartEndRadius:r,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:r},"> *:last-child":{borderStartEndRadius:r}}},"&-footer":{borderRadius:`0 0 ${Ue(r)} ${Ue(r)}`}}}}},v6=e=>{const{componentCls:t}=e;return{[`${t}-wrapper-rtl`]:{direction:"rtl",table:{direction:"rtl"},[`${t}-pagination-left`]:{justifyContent:"flex-end"},[`${t}-pagination-right`]:{justifyContent:"flex-start"},[`${t}-row-expand-icon`]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},[`${t}-container`]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},[`${t}-row-indent`]:{float:"right"}}}}},b6=e=>{const{componentCls:t,antCls:r,iconCls:n,fontSizeIcon:o,padding:a,paddingXS:u,headerIconColor:c,headerIconHoverColor:f,tableSelectionColumnWidth:d,tableSelectedRowBg:m,tableSelectedRowHoverBg:b,tableRowHoverBg:g,tablePaddingHorizontal:w,calc:C}=e;return{[`${t}-wrapper`]:{[`${t}-selection-col`]:{width:d,[`&${t}-selection-col-with-dropdown`]:{width:C(d).add(o).add(C(a).div(4)).equal()}},[`${t}-bordered ${t}-selection-col`]:{width:C(d).add(C(u).mul(2)).equal(),[`&${t}-selection-col-with-dropdown`]:{width:C(d).add(o).add(C(a).div(4)).add(C(u).mul(2)).equal()}},[`
60
- table tr th${t}-selection-column,
61
- table tr td${t}-selection-column,
62
- ${t}-selection-column
63
- `]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",[`${r}-radio-wrapper`]:{marginInlineEnd:0}},[`table tr th${t}-selection-column${t}-cell-fix-left`]:{zIndex:C(e.zIndexTableFixed).add(1).equal({unit:!1})},[`table tr th${t}-selection-column::after`]:{backgroundColor:"transparent !important"},[`${t}-selection`]:{position:"relative",display:"inline-flex",flexDirection:"column"},[`${t}-selection-extra`]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,marginInlineStart:"100%",paddingInlineStart:Ue(C(w).div(4).equal()),[n]:{color:c,fontSize:o,verticalAlign:"baseline","&:hover":{color:f}}},[`${t}-tbody`]:{[`${t}-row`]:{[`&${t}-row-selected`]:{[`> ${t}-cell`]:{background:m,"&-row-hover":{background:b}}},[`> ${t}-cell-row-hover`]:{background:g}}}}}},y6=e=>{const{componentCls:t,tableExpandColumnWidth:r,calc:n}=e,o=(a,u,c,f)=>({[`${t}${t}-${a}`]:{fontSize:f,[`
64
- ${t}-title,
65
- ${t}-footer,
66
- ${t}-cell,
67
- ${t}-thead > tr > th,
68
- ${t}-tbody > tr > th,
69
- ${t}-tbody > tr > td,
70
- tfoot > tr > th,
71
- tfoot > tr > td
72
- `]:{padding:`${Ue(u)} ${Ue(c)}`},[`${t}-filter-trigger`]:{marginInlineEnd:Ue(n(c).div(2).mul(-1).equal())},[`${t}-expanded-row-fixed`]:{margin:`${Ue(n(u).mul(-1).equal())} ${Ue(n(c).mul(-1).equal())}`},[`${t}-tbody`]:{[`${t}-wrapper:only-child ${t}`]:{marginBlock:Ue(n(u).mul(-1).equal()),marginInline:`${Ue(n(r).sub(c).equal())} ${Ue(n(c).mul(-1).equal())}`}},[`${t}-selection-extra`]:{paddingInlineStart:Ue(n(c).div(4).equal())}}});return{[`${t}-wrapper`]:Object.assign(Object.assign({},o("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),o("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},x6=e=>{const{componentCls:t,marginXXS:r,fontSizeIcon:n,headerIconColor:o,headerIconHoverColor:a}=e;return{[`${t}-wrapper`]:{[`${t}-thead th${t}-column-has-sorters`]:{outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}, left 0s`,"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},[`
73
- &${t}-cell-fix-left:hover,
74
- &${t}-cell-fix-right:hover
75
- `]:{background:e.tableFixedHeaderSortActiveBg}},[`${t}-thead th${t}-column-sort`]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},[`td${t}-column-sort`]:{background:e.tableBodySortBg},[`${t}-column-title`]:{position:"relative",zIndex:1,flex:1,minWidth:0},[`${t}-column-sorters`]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},[`${t}-column-sorters-tooltip-target-sorter`]:{"&::after":{content:"none"}},[`${t}-column-sorter`]:{marginInlineStart:r,color:o,fontSize:0,transition:`color ${e.motionDurationSlow}`,"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:n,"&.active":{color:e.colorPrimary}},[`${t}-column-sorter-up + ${t}-column-sorter-down`]:{marginTop:"-0.3em"}},[`${t}-column-sorters:hover ${t}-column-sorter`]:{color:a}}}},C6=e=>{const{componentCls:t,opacityLoading:r,tableScrollThumbBg:n,tableScrollThumbBgHover:o,tableScrollThumbSize:a,tableScrollBg:u,zIndexTableSticky:c,stickyScrollBarBorderRadius:f,lineWidth:d,lineType:m,tableBorderColor:b}=e,g=`${Ue(d)} ${m} ${b}`;return{[`${t}-wrapper`]:{[`${t}-sticky`]:{"&-holder":{position:"sticky",zIndex:c,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:`${Ue(a)} !important`,zIndex:c,display:"flex",alignItems:"center",background:u,borderTop:g,opacity:r,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:n,borderRadius:f,transition:`all ${e.motionDurationSlow}, transform 0s`,position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:o}}}}}}},gf=e=>{const{componentCls:t,lineWidth:r,tableBorderColor:n,calc:o}=e,a=`${Ue(r)} ${e.lineType} ${n}`;return{[`${t}-wrapper`]:{[`${t}-summary`]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},[`div${t}-summary`]:{boxShadow:`0 ${Ue(o(r).mul(-1).equal())} 0 ${n}`}}}},w6=e=>{const{componentCls:t,motionDurationMid:r,lineWidth:n,lineType:o,tableBorderColor:a,calc:u}=e,c=`${Ue(n)} ${o} ${a}`,f=`${t}-expanded-row-cell`;return{[`${t}-wrapper`]:{[`${t}-tbody-virtual`]:{[`${t}-tbody-virtual-holder-inner`]:{[`
76
- & > ${t}-row,
77
- & > div:not(${t}-row) > ${t}-row
78
- `]:{display:"flex",boxSizing:"border-box",width:"100%"}},[`${t}-cell`]:{borderBottom:c,transition:`background ${r}`},[`${t}-expanded-row`]:{[`${f}${f}-fixed`]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:`calc(var(--virtual-width) - ${Ue(n)})`,borderInlineEnd:"none"}}},[`${t}-bordered`]:{[`${t}-tbody-virtual`]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:c,position:"absolute"},[`${t}-cell`]:{borderInlineEnd:c,[`&${t}-cell-fix-right-first:before`]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:u(n).mul(-1).equal(),borderInlineStart:c}}},[`&${t}-virtual`]:{[`${t}-placeholder ${t}-cell`]:{borderInlineEnd:c,borderBottom:c}}}}}},D6=e=>{const{componentCls:t,fontWeightStrong:r,tablePaddingVertical:n,tablePaddingHorizontal:o,tableExpandColumnWidth:a,lineWidth:u,lineType:c,tableBorderColor:f,tableFontSize:d,tableBg:m,tableRadius:b,tableHeaderTextColor:g,motionDurationMid:w,tableHeaderBg:C,tableHeaderCellSplitColor:D,tableFooterTextColor:p,tableFooterBg:B,calc:F}=e,S=`${Ue(u)} ${c} ${f}`;return{[`${t}-wrapper`]:Object.assign(Object.assign({clear:"both",maxWidth:"100%","--rc-virtual-list-scrollbar-bg":e.tableScrollBg},Du()),{[t]:Object.assign(Object.assign({},si(e)),{fontSize:d,background:m,borderRadius:`${Ue(b)} ${Ue(b)} 0 0`,scrollbarColor:`${e.tableScrollThumbBg} ${e.tableScrollBg}`}),table:{width:"100%",textAlign:"start",borderRadius:`${Ue(b)} ${Ue(b)} 0 0`,borderCollapse:"separate",borderSpacing:0},[`
79
- ${t}-cell,
80
- ${t}-thead > tr > th,
81
- ${t}-tbody > tr > th,
82
- ${t}-tbody > tr > td,
83
- tfoot > tr > th,
84
- tfoot > tr > td
85
- `]:{position:"relative",padding:`${Ue(n)} ${Ue(o)}`,overflowWrap:"break-word"},[`${t}-title`]:{padding:`${Ue(n)} ${Ue(o)}`},[`${t}-thead`]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:g,fontWeight:r,textAlign:"start",background:C,borderBottom:S,transition:`background ${w} ease`,"&[colspan]:not([colspan='1'])":{textAlign:"center"},[`&:not(:last-child):not(${t}-selection-column):not(${t}-row-expand-icon-cell):not([colspan])::before`]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:D,transform:"translateY(-50%)",transition:`background-color ${w}`,content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},[`${t}-tbody`]:{"> tr":{"> th, > td":{transition:`background ${w}, border-color ${w}`,borderBottom:S,[`
86
- > ${t}-wrapper:only-child,
87
- > ${t}-expanded-row-fixed > ${t}-wrapper:only-child
88
- `]:{[t]:{marginBlock:Ue(F(n).mul(-1).equal()),marginInline:`${Ue(F(a).sub(o).equal())}
89
- ${Ue(F(o).mul(-1).equal())}`,[`${t}-tbody > tr:last-child > td`]:{borderBottomWidth:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:g,fontWeight:r,textAlign:"start",background:C,borderBottom:S,transition:`background ${w} ease`},[`& > ${t}-measure-cell`]:{paddingBlock:"0 !important",borderBlock:"0 !important",[`${t}-measure-cell-content`]:{height:0,overflow:"hidden",pointerEvents:"none"}}}},[`${t}-footer`]:{padding:`${Ue(n)} ${Ue(o)}`,color:p,background:B}})}},E6=e=>{const{colorFillAlter:t,colorBgContainer:r,colorTextHeading:n,colorFillSecondary:o,colorFillContent:a,controlItemBgActive:u,controlItemBgActiveHover:c,padding:f,paddingSM:d,paddingXS:m,colorBorderSecondary:b,borderRadiusLG:g,controlHeight:w,colorTextPlaceholder:C,fontSize:D,fontSizeSM:p,lineHeight:B,lineWidth:F,colorIcon:S,colorIconHover:O,opacityLoading:M,controlInteractiveSize:_}=e,z=new Bo(o).onBackground(r).toHexString(),K=new Bo(a).onBackground(r).toHexString(),$=new Bo(t).onBackground(r).toHexString(),Q=new Bo(S),V=new Bo(O),X=_/2-F,G=X*2+F*3;return{headerBg:$,headerColor:n,headerSortActiveBg:z,headerSortHoverBg:K,bodySortBg:$,rowHoverBg:$,rowSelectedBg:u,rowSelectedHoverBg:c,rowExpandedBg:t,cellPaddingBlock:f,cellPaddingInline:f,cellPaddingBlockMD:d,cellPaddingInlineMD:m,cellPaddingBlockSM:m,cellPaddingInlineSM:m,borderColor:b,headerBorderRadius:g,footerBg:$,footerColor:n,cellFontSize:D,cellFontSizeMD:D,cellFontSizeSM:D,headerSplitColor:b,fixedHeaderSortActiveBg:z,headerFilterHoverBg:a,filterDropdownMenuBg:r,filterDropdownBg:r,expandIconBg:r,selectionColumnWidth:w,stickyScrollBarBg:C,stickyScrollBarBorderRadius:100,expandIconMarginTop:(D*B-F*3)/2-Math.ceil((p*1.4-F*3)/2),headerIconColor:Q.clone().setA(Q.a*M).toRgbString(),headerIconHoverColor:V.clone().setA(V.a*M).toRgbString(),expandIconHalfInner:X,expandIconSize:G,expandIconScale:_/G}},vf=2,k6=Fs("Table",e=>{const{colorTextHeading:t,colorSplit:r,colorBgContainer:n,controlInteractiveSize:o,headerBg:a,headerColor:u,headerSortActiveBg:c,headerSortHoverBg:f,bodySortBg:d,rowHoverBg:m,rowSelectedBg:b,rowSelectedHoverBg:g,rowExpandedBg:w,cellPaddingBlock:C,cellPaddingInline:D,cellPaddingBlockMD:p,cellPaddingInlineMD:B,cellPaddingBlockSM:F,cellPaddingInlineSM:S,borderColor:O,footerBg:M,footerColor:_,headerBorderRadius:z,cellFontSize:K,cellFontSizeMD:$,cellFontSizeSM:Q,headerSplitColor:V,fixedHeaderSortActiveBg:X,headerFilterHoverBg:G,filterDropdownBg:j,expandIconBg:H,selectionColumnWidth:U,stickyScrollBarBg:R,calc:te}=e,q=Ua(e,{tableFontSize:K,tableBg:n,tableRadius:z,tablePaddingVertical:C,tablePaddingHorizontal:D,tablePaddingVerticalMiddle:p,tablePaddingHorizontalMiddle:B,tablePaddingVerticalSmall:F,tablePaddingHorizontalSmall:S,tableBorderColor:O,tableHeaderTextColor:u,tableHeaderBg:a,tableFooterTextColor:_,tableFooterBg:M,tableHeaderCellSplitColor:V,tableHeaderSortBg:c,tableHeaderSortHoverBg:f,tableBodySortBg:d,tableFixedHeaderSortActiveBg:X,tableHeaderFilterActiveBg:G,tableFilterDropdownBg:j,tableRowHoverBg:m,tableSelectedRowBg:b,tableSelectedRowHoverBg:g,zIndexTableFixed:vf,zIndexTableSticky:te(vf).add(1).equal({unit:!1}),tableFontSizeMiddle:$,tableFontSizeSmall:Q,tableSelectionColumnWidth:U,tableExpandIconBg:H,tableExpandColumnWidth:te(o).add(te(e.padding).mul(2)).equal(),tableExpandedRowBg:w,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:R,tableScrollThumbBgHover:t,tableScrollBg:r});return[D6(q),m6(q),gf(q),x6(q),h6(q),u6(q),g6(q),f6(q),gf(q),d6(q),b6(q),p6(q),C6(q),c6(q),y6(q),v6(q),w6(q)]},E6,{unitless:{expandIconScale:!0}}),bf=[],S6=(e,t)=>{var r,n;const{prefixCls:o,className:a,rootClassName:u,style:c,size:f,bordered:d,dropdownPrefixCls:m,dataSource:b,pagination:g,rowSelection:w,rowKey:C="key",rowClassName:D,columns:p,children:B,childrenColumnName:F,onChange:S,getPopupContainer:O,loading:M,expandIcon:_,expandable:z,expandedRowRender:K,expandIconColumnIndex:$,indentSize:Q,scroll:V,sortDirections:X,locale:G,showSorterTooltip:j={target:"full-header"},virtual:H}=e;Ns();const U=k.useMemo(()=>p||M0(B),[p,B]),R=k.useMemo(()=>U.some(ke=>ke.responsive),[U]),te=Y4(R),q=k.useMemo(()=>{const ke=new Set(Object.keys(te).filter(Ie=>te[Ie]));return U.filter(Ie=>!Ie.responsive||Ie.responsive.some(J=>ke.has(J)))},[U,te]),se=Jn(e,["className","style","columns"]),{locale:ye=G4,direction:we,table:ie,renderEmpty:me,getPrefixCls:Oe,getPopupContainer:ee}=k.useContext(bo),pe=X4(f),le=Object.assign(Object.assign({},ye.Table),G),ue=b||bf,De=Oe("table",o),Ce=Oe("dropdown",m),[,Ee]=b0(),Fe=v0(De),[Be,Ne,ze]=k6(De,Fe),Me=Object.assign(Object.assign({childrenColumnName:F,expandIconColumnIndex:$},z),{expandIcon:(r=z==null?void 0:z.expandIcon)!==null&&r!==void 0?r:(n=ie==null?void 0:ie.expandable)===null||n===void 0?void 0:n.expandIcon}),{childrenColumnName:Ge="children"}=Me,dt=k.useMemo(()=>ue.some(ke=>ke==null?void 0:ke[Ge])?"nest":K||z!=null&&z.expandedRowRender?"row":null,[ue]),ut={body:k.useRef(null)},Pe=Uv(De),Le=k.useRef(null),Ve=k.useRef(null);s2(t,()=>Object.assign(Object.assign({},Ve.current),{nativeElement:Le.current}));const ft=k.useMemo(()=>typeof C=="function"?C:ke=>ke==null?void 0:ke[C],[C]),[Je]=Y5(ue,Ge,ft),Xe={},St=(ke,Ie,J=!1)=>{var ce,he,He,W;const lt=Object.assign(Object.assign({},Xe),ke);J&&((ce=Xe.resetPagination)===null||ce===void 0||ce.call(Xe),!((he=lt.pagination)===null||he===void 0)&&he.current&&(lt.pagination.current=1),g&&((He=g.onChange)===null||He===void 0||He.call(g,1,(W=lt.pagination)===null||W===void 0?void 0:W.pageSize))),V&&V.scrollToFirstRowOnChange!==!1&&ut.body.current&&o2(0,{getContainer:()=>ut.body.current}),S==null||S(lt.pagination,lt.filters,lt.sorter,{currentDataSource:ju(Lu(ue,lt.sorterStates,Ge),lt.filterStates,Ge),action:Ie})},bt=(ke,Ie)=>{St({sorter:ke,sorterStates:Ie},"sort",!1)},[ct,rt,$e,de]=a6({prefixCls:De,mergedColumns:q,onSorterChange:bt,sortDirections:X||["ascend","descend"],tableLocale:le,showSorterTooltip:j}),it=k.useMemo(()=>Lu(ue,rt,Ge),[ue,rt]);Xe.sorter=de(),Xe.sorterStates=rt;const yt=(ke,Ie)=>{St({filters:ke,filterStates:Ie},"filter",!0)},[Dt,pt,Qt]=U5({prefixCls:De,locale:le,dropdownPrefixCls:Ce,mergedColumns:q,onFilterChange:yt,getPopupContainer:O||ee,rootClassName:tt(u,Fe)}),gt=ju(it,pt,Ge);Xe.filters=Qt,Xe.filterStates=pt;const Zt=k.useMemo(()=>{const ke={};return Object.keys(Qt).forEach(Ie=>{Qt[Ie]!==null&&(ke[Ie]=Qt[Ie])}),Object.assign(Object.assign({},$e),{filters:ke})},[$e,Qt]),[rr]=i6(Zt),nr=(ke,Ie)=>{St({pagination:Object.assign(Object.assign({},Xe.pagination),{current:ke,pageSize:Ie})},"paginate")},[ht,gr]=Q5(gt.length,nr,g);Xe.pagination=g===!1?{}:X5(ht,g),Xe.resetPagination=gr;const or=k.useMemo(()=>{if(g===!1||!ht.pageSize)return gt;const{current:ke=1,total:Ie,pageSize:J=V1}=ht;return gt.length<Ie?gt.length>J?gt.slice((ke-1)*J,ke*J):gt:gt.slice((ke-1)*J,ke*J)},[!!g,gt,ht==null?void 0:ht.current,ht==null?void 0:ht.pageSize,ht==null?void 0:ht.total]),[Dr,ot]=Wv({prefixCls:De,data:gt,pageData:or,getRowKey:ft,getRecordByKey:Je,expandType:dt,childrenColumnName:Ge,locale:le,getPopupContainer:O||ee},w),Er=(ke,Ie,J)=>{let ce;return typeof D=="function"?ce=tt(D(ke,Ie,J)):ce=tt(D),tt({[`${De}-row-selected`]:ot.has(ft(ke,Ie))},ce)};Me.__PARENT_RENDER_ICON__=Me.expandIcon,Me.expandIcon=Me.expandIcon||_||Vv(le),dt==="nest"&&Me.expandIconColumnIndex===void 0?Me.expandIconColumnIndex=w?1:0:Me.expandIconColumnIndex>0&&w&&(Me.expandIconColumnIndex-=1),typeof Me.indentSize!="number"&&(Me.indentSize=typeof Q=="number"?Q:15);const kr=k.useCallback(ke=>rr(Dr(Dt(ct(ke)))),[ct,Dt,Dr]),Vt=()=>{if(g===!1||!(ht!=null&&ht.total))return{};const ke=()=>ht.size||(pe==="small"||pe==="middle"?"small":void 0),Ie=_t=>{const st=_t==="left"?"start":_t==="right"?"end":_t;return k.createElement(Zp,Object.assign({},ht,{align:ht.align||st,className:tt(`${De}-pagination`,ht.className),size:ke()}))},J=we==="rtl"?"left":"right",ce=ht.position;if(ce===null||!Array.isArray(ce))return{bottom:Ie(J)};const he=ce.find(_t=>typeof _t=="string"&&_t.toLowerCase().includes("top")),He=ce.find(_t=>typeof _t=="string"&&_t.toLowerCase().includes("bottom")),W=ce.every(_t=>`${_t}`=="none"),lt=he?he.toLowerCase().replace("top",""):"",re=He?He.toLowerCase().replace("bottom",""):"",et=!he&&!He&&!W,kt=()=>lt?Ie(lt):void 0,xr=()=>{if(re)return Ie(re);if(et)return Ie(J)};return{top:kt(),bottom:xr()}},Jt=k.useMemo(()=>typeof M=="boolean"?{spinning:M}:typeof M=="object"&&M!==null?Object.assign({spinning:!0},M):void 0,[M]),Ot=tt(ze,Fe,`${De}-wrapper`,ie==null?void 0:ie.className,{[`${De}-wrapper-rtl`]:we==="rtl"},a,u,Ne),x=Object.assign(Object.assign({},ie==null?void 0:ie.style),c),v=k.useMemo(()=>Jt!=null&&Jt.spinning&&ue===bf?null:typeof(G==null?void 0:G.emptyText)<"u"?G.emptyText:(me==null?void 0:me("Table"))||k.createElement(Q4,{componentName:"Table"}),[Jt==null?void 0:Jt.spinning,ue,G==null?void 0:G.emptyText,me]),oe=H?l6:s6,A={},L=k.useMemo(()=>{const{fontSize:ke,lineHeight:Ie,lineWidth:J,padding:ce,paddingXS:he,paddingSM:He}=Ee,W=Math.floor(ke*Ie);switch(pe){case"middle":return He*2+W+J;case"small":return he*2+W+J;default:return ce*2+W+J}},[Ee,pe]);H&&(A.listItemHeight=L);const{top:be,bottom:xe}=Vt();return Be(k.createElement("div",{ref:Le,className:Ot,style:x},k.createElement(Qp,Object.assign({spinning:!1},Jt),be,k.createElement(oe,Object.assign({},A,se,{ref:Ve,columns:q,direction:we,expandable:Me,prefixCls:De,className:tt({[`${De}-middle`]:pe==="middle",[`${De}-small`]:pe==="small",[`${De}-bordered`]:d,[`${De}-empty`]:ue.length===0},ze,Fe,Ne),data:or,rowKey:ft,rowClassName:Er,emptyText:v,internalHooks:ci,internalRefs:ut,transformColumns:kr,getContainerWidth:Pe,measureRowRender:ke=>k.createElement(Z4,{getPopupContainer:Ie=>Ie},ke)})),xe)))},B6=k.forwardRef(S6),A6=(e,t)=>{const r=k.useRef(0);return r.current+=1,k.createElement(B6,Object.assign({},e,{ref:t,_renderTimes:r.current}))},eo=k.forwardRef(A6);eo.SELECTION_COLUMN=so;eo.EXPAND_COLUMN=uo;eo.SELECTION_ALL=Mu;eo.SELECTION_INVERT=Ru;eo.SELECTION_NONE=Pu;eo.Column=Rv;eo.ColumnGroup=Pv;eo.Summary=E1;var an={},F6=Object.defineProperty,N6=(e,t,r)=>t in e?F6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sr=(e,t,r)=>N6(e,typeof t!="symbol"?t+"":t,r),ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function js(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yf={exports:{}},Oa={};/**
90
- * @license React
91
- * react-jsx-runtime.production.min.js
92
- *
93
- * Copyright (c) Facebook, Inc. and its affiliates.
94
- *
95
- * This source code is licensed under the MIT license found in the
96
- * LICENSE file in the root directory of this source tree.
97
- */var xf;function O6(){if(xf)return Oa;xf=1;var e=je,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(c,f,d){var m,b={},g=null,w=null;d!==void 0&&(g=""+d),f.key!==void 0&&(g=""+f.key),f.ref!==void 0&&(w=f.ref);for(m in f)n.call(f,m)&&!a.hasOwnProperty(m)&&(b[m]=f[m]);if(c&&c.defaultProps)for(m in f=c.defaultProps,f)b[m]===void 0&&(b[m]=f[m]);return{$$typeof:t,type:c,key:g,ref:w,props:b,_owner:o.current}}return Oa.Fragment=r,Oa.jsx=u,Oa.jsxs=u,Oa}var Cf;function $6(){return Cf||(Cf=1,yf.exports=O6()),yf.exports}var Z=$6();/*!
98
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
99
- *
100
- * Copyright (c) 2014-2017, Jon Schlinkert.
101
- * Released under the MIT License.
102
- */function wf(e){return Object.prototype.toString.call(e)==="[object Object]"}function Lr(e){var t,r;return wf(e)===!1?!1:(t=e.constructor,t===void 0?!0:(r=t.prototype,!(wf(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}var G1=Symbol.for("immer-nothing"),Df=Symbol.for("immer-draftable"),sn=Symbol.for("immer-state");function bn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Xa=Object.getPrototypeOf;function Io(e){return!!e&&!!e[sn]}function zo(e){var t;return e?X1(e)||Array.isArray(e)||!!e[Df]||!!((t=e.constructor)!=null&&t[Df])||di(e)||Ls(e):!1}var T6=Object.prototype.constructor.toString(),Ef=new WeakMap;function X1(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Ef.get(r);return n===void 0&&(n=Function.toString.call(r),Ef.set(r,n)),n===T6}function hs(e,t,r=!0){_s(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,o)=>t(o,n,e))}function _s(e){const t=e[sn];return t?t.type_:Array.isArray(e)?1:di(e)?2:Ls(e)?3:0}function Hu(e,t){return _s(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Q1(e,t,r){const n=_s(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function M6(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function di(e){return e instanceof Map}function Ls(e){return e instanceof Set}function ko(e){return e.copy_||e.base_}function Ku(e,t){if(di(e))return new Map(e);if(Ls(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=X1(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[sn];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){const u=o[a],c=n[u];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(n[u]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[u]})}return Object.create(Xa(e),n)}else{const n=Xa(e);if(n!==null&&r)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function L0(e,t=!1){return Hs(e)||Io(e)||!zo(e)||(_s(e)>1&&Object.defineProperties(e,{set:Si,add:Si,clear:Si,delete:Si}),Object.freeze(e),t&&Object.values(e).forEach(r=>L0(r,!0))),e}function R6(){bn(2)}var Si={value:R6};function Hs(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var P6={};function jo(e){const t=P6[e];return t||bn(0,e),t}var Qa;function Z1(){return Qa}function I6(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function kf(e,t){t&&(jo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function qu(e){Wu(e),e.drafts_.forEach(z6),e.drafts_=null}function Wu(e){e===Qa&&(Qa=e.parent_)}function Sf(e){return Qa=I6(Qa,e)}function z6(e){const t=e[sn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Bf(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[sn].modified_&&(qu(t),bn(4)),zo(e)&&(e=ps(t,e),t.parent_||ms(t,e)),t.patches_&&jo("Patches").generateReplacementPatches_(r[sn].base_,e,t.patches_,t.inversePatches_)):e=ps(t,r,[]),qu(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==G1?e:void 0}function ps(e,t,r){if(Hs(t))return t;const n=e.immer_.shouldUseStrictIteration(),o=t[sn];if(!o)return hs(t,(a,u)=>Af(e,o,t,a,u,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return ms(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const a=o.copy_;let u=a,c=!1;o.type_===3&&(u=new Set(a),a.clear(),c=!0),hs(u,(f,d)=>Af(e,o,a,f,d,r,c),n),ms(e,a,!1),r&&e.patches_&&jo("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function Af(e,t,r,n,o,a,u){if(o==null||typeof o!="object"&&!u)return;const c=Hs(o);if(!(c&&!u)){if(Io(o)){const f=a&&t&&t.type_!==3&&!Hu(t.assigned_,n)?a.concat(n):void 0,d=ps(e,o,f);if(Q1(r,n,d),Io(d))e.canAutoFreeze_=!1;else return}else u&&r.add(o);if(zo(o)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&c)return;ps(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(di(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&ms(e,o)}}}function ms(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&L0(t,r)}function j6(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Z1(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,a=H0;r&&(o=[n],a=Za);const{revoke:u,proxy:c}=Proxy.revocable(o,a);return n.draft_=c,n.revoke_=u,c}var H0={get(e,t){if(t===sn)return e;const r=ko(e);if(!Hu(r,t))return _6(e,r,t);const n=r[t];return e.finalized_||!zo(n)?n:n===Il(e.base_,t)?(zl(e),e.copy_[t]=Uu(n,e)):n},has(e,t){return t in ko(e)},ownKeys(e){return Reflect.ownKeys(ko(e))},set(e,t,r){const n=J1(ko(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const o=Il(ko(e),t),a=o==null?void 0:o[sn];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(M6(r,o)&&(r!==void 0||Hu(e.base_,t)))return!0;zl(e),Vu(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Il(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,zl(e),Vu(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ko(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){bn(11)},getPrototypeOf(e){return Xa(e.base_)},setPrototypeOf(){bn(12)}},Za={};hs(H0,(e,t)=>{Za[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Za.deleteProperty=function(e,t){return Za.set.call(this,e,t,void 0)};Za.set=function(e,t,r){return H0.set.call(this,e[0],t,r,e[0])};function Il(e,t){const r=e[sn];return(r?ko(r):e)[t]}function _6(e,t,r){var o;const n=J1(t,r);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function J1(e,t){if(!(t in e))return;let r=Xa(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Xa(r)}}function Vu(e){e.modified_||(e.modified_=!0,e.parent_&&Vu(e.parent_))}function zl(e){e.copy_||(e.copy_=Ku(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var L6=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const a=r;r=t;const u=this;return function(c=a,...f){return u.produce(c,d=>r.call(this,d,...f))}}typeof r!="function"&&bn(6),n!==void 0&&typeof n!="function"&&bn(7);let o;if(zo(t)){const a=Sf(this),u=Uu(t,void 0);let c=!0;try{o=r(u),c=!1}finally{c?qu(a):Wu(a)}return kf(a,n),Bf(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===G1&&(o=void 0),this.autoFreeze_&&L0(o,!0),n){const a=[],u=[];jo("Patches").generateReplacementPatches_(t,o,a,u),n(a,u)}return o}else bn(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...u)=>this.produceWithPatches(a,c=>t(c,...u));let n,o;return[this.produce(t,r,(a,u)=>{n=a,o=u}),n,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){zo(e)||bn(8),Io(e)&&(e=H6(e));const t=Sf(this),r=Uu(e,void 0);return r[sn].isManual_=!0,Wu(t),r}finishDraft(e,t){const r=e&&e[sn];(!r||!r.isManual_)&&bn(9);const{scope_:n}=r;return kf(n,t),Bf(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));const n=jo("Patches").applyPatches_;return Io(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Uu(e,t){const r=di(e)?jo("MapSet").proxyMap_(e,t):Ls(e)?jo("MapSet").proxySet_(e,t):j6(e,t);return(t?t.scope_:Z1()).drafts_.push(r),r}function H6(e){return Io(e)||bn(10,e),em(e)}function em(e){if(!zo(e)||Hs(e))return e;const t=e[sn];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Ku(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Ku(e,!0);return hs(r,(o,a)=>{Q1(r,o,em(a))},n),t&&(t.finalized_=!1),r}var Ja=new L6,K0=Ja.produce,Ff=Ja.createDraft.bind(Ja),Nf=Ja.finishDraft.bind(Ja),K6={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var o=ae.transform(r,t,{affinity:n});e.current=o,o==null&&e.unref()}}},q6={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var o=Tt.transform(r,t,{affinity:n});e.current=o,o==null&&e.unref()}}},W6={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var o=Ae.transform(r,t,{affinity:n});e.current=o,o==null&&e.unref()}}},gs=new WeakMap,vs=new WeakMap,La=new WeakMap,tm=new WeakMap,Of=new WeakMap,$f=new WeakMap,Tf=new WeakMap,ae={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,n=ae.levels(e,t);return r?n=n.slice(1):n=n.slice(0,-1),n},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var o=e[n],a=t[n];if(o!==a)break;r.push(o)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),a=e[r],u=t[r];return ae.equals(n,o)&&a>u},endsAt(e,t){var r=e.length,n=e.slice(0,r),o=t.slice(0,r);return ae.equals(n,o)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),a=e[r],u=t[r];return ae.equals(n,o)&&a<u},equals(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])},hasPrevious(e){return e[e.length-1]>0},isAfter(e,t){return ae.compare(e,t)===1},isAncestor(e,t){return e.length<t.length&&ae.compare(e,t)===0},isBefore(e,t){return ae.compare(e,t)===-1},isChild(e,t){return e.length===t.length+1&&ae.compare(e,t)===0},isCommon(e,t){return e.length<=t.length&&ae.compare(e,t)===0},isDescendant(e,t){return e.length>t.length&&ae.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&ae.compare(e,t)===0},isPath(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="number")},isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1),o=e[e.length-1],a=t[t.length-1];return o!==a&&ae.equals(r,n)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,n=[],o=0;o<=e.length;o++)n.push(e.slice(0,o));return r&&n.reverse(),n},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!ae.isAncestor(t,e)&&!ae.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e)return null;var n=[...e],{affinity:o="forward"}=r;if(e.length===0)return n;switch(t.type){case"insert_node":{var{path:a}=t;(ae.equals(a,n)||ae.endsBefore(a,n)||ae.isAncestor(a,n))&&(n[a.length-1]+=1);break}case"remove_node":{var{path:u}=t;if(ae.equals(u,n)||ae.isAncestor(u,n))return null;ae.endsBefore(u,n)&&(n[u.length-1]-=1);break}case"merge_node":{var{path:c,position:f}=t;ae.equals(c,n)||ae.endsBefore(c,n)?n[c.length-1]-=1:ae.isAncestor(c,n)&&(n[c.length-1]-=1,n[c.length]+=f);break}case"split_node":{var{path:d,position:m}=t;if(ae.equals(d,n)){if(o==="forward")n[n.length-1]+=1;else if(o!=="backward")return null}else ae.endsBefore(d,n)?n[d.length-1]+=1:ae.isAncestor(d,n)&&e[d.length]>=m&&(n[d.length-1]+=1,n[d.length]-=m);break}case"move_node":{var{path:b,newPath:g}=t;if(ae.equals(b,g))return n;if(ae.isAncestor(b,n)||ae.equals(b,n)){var w=g.slice();return ae.endsBefore(b,g)&&b.length<g.length&&(w[b.length-1]-=1),w.concat(n.slice(b.length))}else ae.isSibling(b,g)&&(ae.isAncestor(g,n)||ae.equals(g,n))?ae.endsBefore(b,n)?n[b.length-1]-=1:n[b.length-1]+=1:ae.endsBefore(g,n)||ae.equals(g,n)||ae.isAncestor(g,n)?(ae.endsBefore(b,n)&&(n[b.length-1]-=1),n[g.length-1]+=1):ae.endsBefore(b,n)&&(ae.equals(g,n)&&(n[g.length-1]+=1),n[b.length-1]-=1);break}}return n}};function ei(e){"@babel/helpers - typeof";return ei=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ei(e)}function V6(e,t){if(ei(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ei(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function U6(e){var t=V6(e,"string");return ei(t)==="symbol"?t:String(t)}function Gr(e,t,r){return t=U6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function $a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mf(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Y6=(e,t,r)=>{switch(r.type){case"insert_node":{var{path:n,node:o}=r,a=Ye.parent(e,n),u=n[n.length-1];if(u>a.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n,"] because the destination is past the end of the node."));if(a.children.splice(u,0,o),t)for(var[c,f]of Ae.points(t))t[f]=Tt.transform(c,r);break}case"insert_text":{var{path:d,offset:m,text:b}=r;if(b.length===0)break;var g=Ye.leaf(e,d),w=g.text.slice(0,m),C=g.text.slice(m);if(g.text=w+b+C,t)for(var[D,p]of Ae.points(t))t[p]=Tt.transform(D,r);break}case"merge_node":{var{path:B}=r,F=Ye.get(e,B),S=ae.previous(B),O=Ye.get(e,S),M=Ye.parent(e,B),_=B[B.length-1];if(nt.isText(F)&&nt.isText(O))O.text+=F.text;else if(!nt.isText(F)&&!nt.isText(O))O.children.push(...F.children);else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(B,"] to nodes of different interfaces: ").concat(Pr.stringify(F)," ").concat(Pr.stringify(O)));if(M.children.splice(_,1),t)for(var[z,K]of Ae.points(t))t[K]=Tt.transform(z,r);break}case"move_node":{var{path:$,newPath:Q}=r;if(ae.isAncestor($,Q))throw new Error("Cannot move a path [".concat($,"] to new path [").concat(Q,"] because the destination is inside itself."));var V=Ye.get(e,$),X=Ye.parent(e,$),G=$[$.length-1];X.children.splice(G,1);var j=ae.transform($,r),H=Ye.get(e,ae.parent(j)),U=j[j.length-1];if(H.children.splice(U,0,V),t)for(var[R,te]of Ae.points(t))t[te]=Tt.transform(R,r);break}case"remove_node":{var{path:q}=r,se=q[q.length-1],ye=Ye.parent(e,q);if(ye.children.splice(se,1),t)for(var[we,ie]of Ae.points(t)){var me=Tt.transform(we,r);if(t!=null&&me!=null)t[ie]=me;else{var Oe=void 0,ee=void 0;for(var[pe,le]of Ye.texts(e))if(ae.compare(le,q)===-1)Oe=[pe,le];else{ee=[pe,le];break}var ue=!1;Oe&&ee&&(ae.equals(ee[1],q)?ue=!ae.hasPrevious(ee[1]):ue=ae.common(Oe[1],q).length<ae.common(ee[1],q).length),Oe&&!ue?(we.path=Oe[1],we.offset=Oe[0].text.length):ee?(we.path=ee[1],we.offset=0):t=null}}break}case"remove_text":{var{path:De,offset:Ce,text:Ee}=r;if(Ee.length===0)break;var Fe=Ye.leaf(e,De),Be=Fe.text.slice(0,Ce),Ne=Fe.text.slice(Ce+Ee.length);if(Fe.text=Be+Ne,t)for(var[ze,Me]of Ae.points(t))t[Me]=Tt.transform(ze,r);break}case"set_node":{var{path:Ge,properties:dt,newProperties:ut}=r;if(Ge.length===0)throw new Error("Cannot set properties on the root node!");var Pe=Ye.get(e,Ge);for(var Le in ut){if(Le==="children"||Le==="text")throw new Error('Cannot set the "'.concat(Le,'" property of nodes!'));var Ve=ut[Le];Ve==null?delete Pe[Le]:Pe[Le]=Ve}for(var ft in dt)ut.hasOwnProperty(ft)||delete Pe[ft];break}case"set_selection":{var{newProperties:Je}=r;if(Je==null)t=Je;else{if(t==null){if(!Ae.isRange(Je))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Pr.stringify(Je)," when there is no current selection."));t=$a({},Je)}for(var Xe in Je){var St=Je[Xe];if(St==null){if(Xe==="anchor"||Xe==="focus")throw new Error('Cannot remove the "'.concat(Xe,'" selection property'));delete t[Xe]}else t[Xe]=St}}break}case"split_node":{var{path:bt,position:ct,properties:rt}=r;if(bt.length===0)throw new Error('Cannot apply a "split_node" operation at path ['.concat(bt,"] because the root node cannot be split."));var $e=Ye.get(e,bt),de=Ye.parent(e,bt),it=bt[bt.length-1],yt;if(nt.isText($e)){var Dt=$e.text.slice(0,ct),pt=$e.text.slice(ct);$e.text=Dt,yt=$a($a({},rt),{},{text:pt})}else{var Qt=$e.children.slice(0,ct),gt=$e.children.slice(ct);$e.children=Qt,yt=$a($a({},rt),{},{children:gt})}if(de.children.splice(it+1,0,yt),t)for(var[Zt,rr]of Ae.points(t))t[rr]=Tt.transform(Zt,r);break}}return t},G6={transform(e,t){e.children=Ff(e.children);var r=e.selection&&Ff(e.selection);try{r=Y6(e,r,t)}finally{e.children=Nf(e.children),r?e.selection=Io(r)?Nf(r):r:e.selection=null}}},X6={insertNodes(e,t,r){e.insertNodes(t,r)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},Q6={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},rm=(e,t)=>{for(var r in e){var n=e[r],o=t[r];if(Lr(n)&&Lr(o)){if(!rm(n,o))return!1}else if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(n[a]!==o[a])return!1}else if(n!==o)return!1}for(var u in t)if(e[u]===void 0&&t[u]!==void 0)return!1;return!0};function Z6(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Qn(e,t){if(e==null)return{};var r=Z6(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var J6=["anchor","focus"];function Rf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function eb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rf(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ae={edges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:o}=e;return Ae.isBackward(e)===r?[n,o]:[o,n]},end(e){var[,t]=Ae.edges(e);return t},equals(e,t){return Tt.equals(e.anchor,t.anchor)&&Tt.equals(e.focus,t.focus)},includes(e,t){if(Ae.isRange(t)){if(Ae.includes(e,t.anchor)||Ae.includes(e,t.focus))return!0;var[r,n]=Ae.edges(e),[o,a]=Ae.edges(t);return Tt.isBefore(r,o)&&Tt.isAfter(n,a)}var[u,c]=Ae.edges(e),f=!1,d=!1;return Tt.isPoint(t)?(f=Tt.compare(t,u)>=0,d=Tt.compare(t,c)<=0):(f=ae.compare(t,u.path)>=0,d=ae.compare(t,c.path)<=0),f&&d},intersection(e,t){var r=Qn(e,J6),[n,o]=Ae.edges(e),[a,u]=Ae.edges(t),c=Tt.isBefore(n,a)?a:n,f=Tt.isBefore(o,u)?o:u;return Tt.isBefore(f,c)?null:eb({anchor:c,focus:f},r)},isBackward(e){var{anchor:t,focus:r}=e;return Tt.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return Tt.equals(t,r)},isExpanded(e){return!Ae.isCollapsed(e)},isForward(e){return!Ae.isBackward(e)},isRange(e){return Lr(e)&&Tt.isPoint(e.anchor)&&Tt.isPoint(e.focus)},*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Ae.edges(e);return t},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return K0(e,n=>{if(n===null)return null;var{affinity:o="inward"}=r,a,u;if(o==="inward"){var c=Ae.isCollapsed(n);Ae.isForward(n)?(a="forward",u=c?a:"backward"):(a="backward",u=c?a:"forward")}else o==="outward"?Ae.isForward(n)?(a="backward",u="forward"):(a="forward",u="backward"):(a=o,u=o);var f=Tt.transform(n.anchor,t,{affinity:a}),d=Tt.transform(n.focus,t,{affinity:u});if(!f||!d)return null;n.anchor=f,n.focus=d})}},Pf=e=>Lr(e)&&Ye.isNodeList(e.children)&&!T.isEditor(e),at={isAncestor(e){return Lr(e)&&Ye.isNodeList(e.children)},isElement:Pf,isElementList(e){return Array.isArray(e)&&e.every(t=>at.isElement(t))},isElementProps(e){return e.children!==void 0},isElementType:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return Pf(e)&&e[r]===t},matches(e,t){for(var r in t)if(r!=="children"&&e[r]!==t[r])return!1;return!0}},tb=["children"],rb=["text"],If=new WeakMap,Ye={ancestor(e,t){var r=Ye.get(e,t);if(nt.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Pr.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function*(){for(var n of ae.ancestors(t,r)){var o=Ye.ancestor(e,n),a=[o,n];yield a}})()},child(e,t){if(nt.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Pr.stringify(e)));var r=e.children[t];if(r==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Pr.stringify(e)));return r},children(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function*(){for(var{reverse:n=!1}=r,o=Ye.ancestor(e,t),{children:a}=o,u=n?a.length-1:0;n?u>=0:u<a.length;){var c=Ye.child(o,u),f=t.concat(u);yield[c,f],u=n?u-1:u+1}})()},common(e,t,r){var n=ae.common(t,r),o=Ye.get(e,n);return[o,n]},descendant(e,t){var r=Ye.get(e,t);if(T.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Pr.stringify(r)));return r},descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){for(var[r,n]of Ye.nodes(e,t))n.length!==0&&(yield[r,n])})()},elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){for(var[r,n]of Ye.nodes(e,t))at.isElement(r)&&(yield[r,n])})()},extractProps(e){if(at.isAncestor(e)){var t=Qn(e,tb);return t}else{var t=Qn(e,rb);return t}},first(e,t){for(var r=t.slice(),n=Ye.get(e,r);n&&!(nt.isText(n)||n.children.length===0);)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){if(nt.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Pr.stringify(e)));var r=K0({children:e.children},n=>{var[o,a]=Ae.edges(t),u=Ye.nodes(n,{reverse:!0,pass:g=>{var[,w]=g;return!Ae.includes(t,w)}});for(var[,c]of u){if(!Ae.includes(t,c)){var f=Ye.parent(n,c),d=c[c.length-1];f.children.splice(d,1)}if(ae.equals(c,a.path)){var m=Ye.leaf(n,c);m.text=m.text.slice(0,a.offset)}if(ae.equals(c,o.path)){var b=Ye.leaf(n,c);b.text=b.text.slice(o.offset)}}T.isEditor(n)&&(n.selection=null)});return r.children},get(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(nt.isText(r)||!r.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Pr.stringify(e)));r=r.children[o]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(nt.isText(r)||!r.children[o])return!1;r=r.children[o]}return!0},isNode(e){return nt.isText(e)||at.isElement(e)||T.isEditor(e)},isNodeList(e){if(!Array.isArray(e))return!1;var t=If.get(e);if(t!==void 0)return t;var r=e.every(n=>Ye.isNode(n));return If.set(e,r),r},last(e,t){for(var r=t.slice(),n=Ye.get(e,r);n&&!(nt.isText(n)||n.children.length===0);){var o=n.children.length-1;n=n.children[o],r.push(o)}return[n,r]},leaf(e,t){var r=Ye.get(e,t);if(!nt.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Pr.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function*(){for(var n of ae.levels(t,r)){var o=Ye.get(e,n);yield[o,n]}})()},matches(e,t){return at.isElement(e)&&at.isElementProps(t)&&at.matches(e,t)||nt.isText(e)&&nt.isTextProps(t)&&nt.matches(e,t)},nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){for(var{pass:r,reverse:n=!1}=t,{from:o=[],to:a}=t,u=new Set,c=[],f=e;!(a&&(n?ae.isBefore(c,a):ae.isAfter(c,a)));){if(u.has(f)||(yield[f,c]),!u.has(f)&&!nt.isText(f)&&f.children.length!==0&&(r==null||r([f,c])===!1)){u.add(f);var d=n?f.children.length-1:0;ae.isAncestor(c,o)&&(d=o[c.length]),c=c.concat(d),f=Ye.get(e,c);continue}if(c.length===0)break;if(!n){var m=ae.next(c);if(Ye.has(e,m)){c=m,f=Ye.get(e,c);continue}}if(n&&c[c.length-1]!==0){var b=ae.previous(c);c=b,f=Ye.get(e,c);continue}c=ae.parent(c),f=Ye.get(e,c),u.add(f)}})()},parent(e,t){var r=ae.parent(t),n=Ye.get(e,r);if(nt.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string(e){return nt.isText(e)?e.text:e.children.map(Ye.string).join("")},texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){for(var[r,n]of Ye.nodes(e,t))nt.isText(r)&&(yield[r,n])})()}};function zf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zf(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Pa={isNodeOperation(e){return Pa.isOperation(e)&&e.type.endsWith("_node")},isOperation(e){if(!Lr(e))return!1;switch(e.type){case"insert_node":return ae.isPath(e.path)&&Ye.isNode(e.node);case"insert_text":return typeof e.offset=="number"&&typeof e.text=="string"&&ae.isPath(e.path);case"merge_node":return typeof e.position=="number"&&ae.isPath(e.path)&&Lr(e.properties);case"move_node":return ae.isPath(e.path)&&ae.isPath(e.newPath);case"remove_node":return ae.isPath(e.path)&&Ye.isNode(e.node);case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&ae.isPath(e.path);case"set_node":return ae.isPath(e.path)&&Lr(e.properties)&&Lr(e.newProperties);case"set_selection":return e.properties===null&&Ae.isRange(e.newProperties)||e.newProperties===null&&Ae.isRange(e.properties)||Lr(e.properties)&&Lr(e.newProperties);case"split_node":return ae.isPath(e.path)&&typeof e.position=="number"&&Lr(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(t=>Pa.isOperation(t))},isSelectionOperation(e){return Pa.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return Pa.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return pr(pr({},e),{},{type:"remove_node"});case"insert_text":return pr(pr({},e),{},{type:"remove_text"});case"merge_node":return pr(pr({},e),{},{type:"split_node",path:ae.previous(e.path)});case"move_node":{var{newPath:t,path:r}=e;if(ae.equals(t,r))return e;if(ae.isSibling(r,t))return pr(pr({},e),{},{path:t,newPath:r});var n=ae.transform(r,e),o=ae.transform(ae.next(r),e);return pr(pr({},e),{},{path:n,newPath:o})}case"remove_node":return pr(pr({},e),{},{type:"insert_node"});case"remove_text":return pr(pr({},e),{},{type:"insert_text"});case"set_node":{var{properties:a,newProperties:u}=e;return pr(pr({},e),{},{properties:u,newProperties:a})}case"set_selection":{var{properties:c,newProperties:f}=e;return c==null?pr(pr({},e),{},{properties:f,newProperties:null}):f==null?pr(pr({},e),{},{properties:null,newProperties:c}):pr(pr({},e),{},{properties:f,newProperties:c})}case"split_node":return pr(pr({},e),{},{type:"merge_node",path:ae.next(e.path)})}}},jf=new WeakMap,nb=e=>{var t=jf.get(e);if(t!==void 0)return t;if(!Lr(e))return!1;var r=typeof e.addMark=="function"&&typeof e.apply=="function"&&typeof e.deleteFragment=="function"&&typeof e.insertBreak=="function"&&typeof e.insertSoftBreak=="function"&&typeof e.insertFragment=="function"&&typeof e.insertNode=="function"&&typeof e.insertText=="function"&&typeof e.isElementReadOnly=="function"&&typeof e.isInline=="function"&&typeof e.isSelectable=="function"&&typeof e.isVoid=="function"&&typeof e.normalizeNode=="function"&&typeof e.onChange=="function"&&typeof e.removeMark=="function"&&typeof e.getDirtyPaths=="function"&&(e.marks===null||Lr(e.marks))&&(e.selection===null||Ae.isRange(e.selection))&&Ye.isNodeList(e.children)&&Pa.isOperationList(e.operations);return jf.set(e,r),r},T={above(e,t){return e.above(t)},addMark(e,t,r){e.addMark(t,r)},after(e,t,r){return e.after(t,r)},before(e,t,r){return e.before(t,r)},deleteBackward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e,t){e.deleteFragment(t)},edges(e,t){return e.edges(t)},elementReadOnly(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.elementReadOnly(t)},end(e,t){return e.end(t)},first(e,t){return e.first(t)},fragment(e,t){return e.fragment(t)},hasBlocks(e,t){return e.hasBlocks(t)},hasInlines(e,t){return e.hasInlines(t)},hasPath(e,t){return e.hasPath(t)},hasTexts(e,t){return e.hasTexts(t)},insertBreak(e){e.insertBreak()},insertFragment(e,t,r){e.insertFragment(t,r)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock(e,t){return e.isBlock(t)},isEdge(e,t,r){return e.isEdge(t,r)},isEditor(e){return nb(e)},isElementReadOnly(e,t){return e.isElementReadOnly(t)},isEmpty(e,t){return e.isEmpty(t)},isEnd(e,t,r){return e.isEnd(t,r)},isInline(e,t){return e.isInline(t)},isNormalizing(e){return e.isNormalizing()},isSelectable(e,t){return e.isSelectable(t)},isStart(e,t,r){return e.isStart(t,r)},isVoid(e,t){return e.isVoid(t)},last(e,t){return e.last(t)},leaf(e,t,r){return e.leaf(t,r)},levels(e,t){return e.levels(t)},marks(e){return e.getMarks()},next(e,t){return e.next(t)},node(e,t,r){return e.node(t,r)},nodes(e,t){return e.nodes(t)},normalize(e,t){e.normalize(t)},parent(e,t,r){return e.parent(t,r)},path(e,t,r){return e.path(t,r)},pathRef(e,t,r){return e.pathRef(t,r)},pathRefs(e){return e.pathRefs()},point(e,t,r){return e.point(t,r)},pointRef(e,t,r){return e.pointRef(t,r)},pointRefs(e){return e.pointRefs()},positions(e,t){return e.positions(t)},previous(e,t){return e.previous(t)},range(e,t,r){return e.range(t,r)},rangeRef(e,t,r){return e.rangeRef(t,r)},rangeRefs(e){return e.rangeRefs()},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start(e,t){return e.start(t)},string(e,t,r){return e.string(t,r)},unhangRange(e,t,r){return e.unhangRange(t,r)},void(e,t){return e.void(t)},withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,r)=>e.shouldMergeNodesRemovePrevNode(t,r)},ob={isSpan(e){return Array.isArray(e)&&e.length===2&&e.every(ae.isPath)}};function _f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Lf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_f(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_f(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Tt={compare(e,t){var r=ae.compare(e.path,t.path);return r===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter(e,t){return Tt.compare(e,t)===1},isBefore(e,t){return Tt.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&ae.equals(e.path,t.path)},isPoint(e){return Lr(e)&&typeof e.offset=="number"&&ae.isPath(e.path)},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return K0(e,n=>{if(n===null)return null;var{affinity:o="forward"}=r,{path:a,offset:u}=n;switch(t.type){case"insert_node":case"move_node":{n.path=ae.transform(a,t,r);break}case"insert_text":{ae.equals(t.path,a)&&(t.offset<u||t.offset===u&&o==="forward")&&(n.offset+=t.text.length);break}case"merge_node":{ae.equals(t.path,a)&&(n.offset+=t.position),n.path=ae.transform(a,t,r);break}case"remove_text":{ae.equals(t.path,a)&&t.offset<=u&&(n.offset-=Math.min(u-t.offset,t.text.length));break}case"remove_node":{if(ae.equals(t.path,a)||ae.isAncestor(t.path,a))return null;n.path=ae.transform(a,t,r);break}case"split_node":{if(ae.equals(t.path,a)){if(t.position===u&&o==null)return null;(t.position<u||t.position===u&&o==="forward")&&(n.offset-=t.position,n.path=ae.transform(a,t,Lf(Lf({},r),{},{affinity:"forward"})))}else n.path=ae.transform(a,t,r);break}}})}},Hf=void 0,Pr={setScrubber(e){Hf=e},stringify(e){return JSON.stringify(e,Hf)}},ab=["text"],ib=["anchor","focus"];function Kf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Wn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kf(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var nt={equals(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:n=!1}=r;function o(a){var u=Qn(a,ab);return u}return rm(n?o(e):e,n?o(t):t)},isText(e){return Lr(e)&&typeof e.text=="string"},isTextList(e){return Array.isArray(e)&&e.every(t=>nt.isText(t))},isTextProps(e){return e.text!==void 0},matches(e,t){for(var r in t)if(r!=="text"&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[Wn({},e)];for(var n of t){var o=Qn(n,ib),[a,u]=Ae.edges(n),c=[],f=0,d=a.offset,m=u.offset;for(var b of r){var{length:g}=b.text,w=f;if(f+=g,d<=w&&f<=m){Object.assign(b,o),c.push(b);continue}if(d!==m&&(d===f||m===w)||d>f||m<w||m===w&&w!==0){c.push(b);continue}var C=b,D=void 0,p=void 0;if(m<f){var B=m-w;p=Wn(Wn({},C),{},{text:C.text.slice(B)}),C=Wn(Wn({},C),{},{text:C.text.slice(0,B)})}if(d>w){var F=d-w;D=Wn(Wn({},C),{},{text:C.text.slice(0,F)}),C=Wn(Wn({},C),{},{text:C.text.slice(F)})}Object.assign(C,o),D&&c.push(D),c.push(C),p&&c.push(p)}r=c}return r}},q0=e=>e.selection?e.selection:e.children.length>0?T.end(e,[]):[0],ya=(e,t)=>{var[r]=T.node(e,t);return n=>n===r},W0=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=!t,n=t?fb(e):e,o=Et.None,a=Et.None,u=0,c=null,f=null;for(var d of n){var m=d.codePointAt(0);if(!m)break;var b=Eb(d,m);if([o,a]=r?[a,b]:[b,o],Xo(o,Et.ZWJ)&&Xo(a,Et.ExtPict)&&(r?c=qf(e.substring(0,u)):c=qf(e.substring(0,e.length-u)),!c)||Xo(o,Et.RI)&&Xo(a,Et.RI)&&(f!==null?f=!f:r?f=!0:f=Fb(e.substring(0,e.length-u)),!f)||o!==Et.None&&a!==Et.None&&Sb(o,a))break;u+=d.length}return u||1},sb=/\s/,lb=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,ub=/['\u2018\u2019]/,cb=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0,n=!1;e.length>0;){var o=W0(e,t),[a,u]=V0(e,o,t);if(db(a,u,t))n=!0,r+=o;else if(!n)r+=o;else break;e=u}return r},V0=(e,t,r)=>{if(r){var n=e.length-t;return[e.slice(n,e.length),e.slice(0,n)]}return[e.slice(0,t),e.slice(t)]},db=function e(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(sb.test(t))return!1;if(ub.test(t)){var o=W0(r,n),[a,u]=V0(r,o,n);if(e(a,u,n))return!0}return!lb.test(t)},fb=function*(e){for(var t=e.length-1,r=0;r<e.length;r++){var n=e.charAt(t-r);if(pb(n.charCodeAt(0))){var o=e.charAt(t-r-1);if(hb(o.charCodeAt(0))){yield o+n,r++;continue}}yield n}},hb=e=>e>=55296&&e<=56319,pb=e=>e>=56320&&e<=57343,Et;(function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"})(Et||(Et={}));var mb=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,gb=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,vb=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,bb=/^[\u1100-\u115F\uA960-\uA97C]$/,yb=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,xb=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Cb=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,wb=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,Db=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,Eb=(e,t)=>{var r=Et.Any;return e.search(mb)!==-1&&(r|=Et.Extend),t===8205&&(r|=Et.ZWJ),t>=127462&&t<=127487&&(r|=Et.RI),e.search(gb)!==-1&&(r|=Et.Prepend),e.search(vb)!==-1&&(r|=Et.SpacingMark),e.search(bb)!==-1&&(r|=Et.L),e.search(yb)!==-1&&(r|=Et.V),e.search(xb)!==-1&&(r|=Et.T),e.search(Cb)!==-1&&(r|=Et.LV),e.search(wb)!==-1&&(r|=Et.LVT),e.search(Db)!==-1&&(r|=Et.ExtPict),r};function Xo(e,t){return(e&t)!==0}var kb=[[Et.L,Et.L|Et.V|Et.LV|Et.LVT],[Et.LV|Et.V,Et.V|Et.T],[Et.LVT|Et.T,Et.T],[Et.Any,Et.Extend|Et.ZWJ],[Et.Any,Et.SpacingMark],[Et.Prepend,Et.Any],[Et.ZWJ,Et.ExtPict],[Et.RI,Et.RI]];function Sb(e,t){return kb.findIndex(r=>Xo(e,r[0])&&Xo(t,r[1]))===-1}var Bb=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,qf=e=>e.search(Bb)!==-1,Ab=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Fb=e=>{var t=e.match(Ab);if(t===null)return!1;var r=t[0].length/2;return r%2===1},Nb={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};T.withoutNormalizing(e,()=>{var{voids:n=!1}=r,{at:o=q0(e)}=r;if(ae.isPath(o)&&(o=T.range(e,o)),Ae.isRange(o))if(Ae.isCollapsed(o))o=o.anchor;else{var a=Ae.end(o);if(!n&&T.void(e,{at:a}))return;var u=Ae.start(o),c=T.pointRef(e,u),f=T.pointRef(e,a);_e.delete(e,{at:o,voids:n});var d=c.unref(),m=f.unref();o=d||m,_e.setSelection(e,{anchor:o,focus:o})}if(!(!n&&T.void(e,{at:o})||T.elementReadOnly(e,{at:o}))){var{path:b,offset:g}=o;t.length>0&&e.apply({type:"insert_text",path:b,offset:g,text:t})}})}};function Wf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Bi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wf(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var _e=Bi(Bi(Bi(Bi({},G6),X6),Q6),Nb),qi=new WeakMap,Ob=e=>qi.get(e)||!1,$b=(e,t,r)=>{var n=qi.get(e)||!1;qi.set(e,!0);try{t(),r()}finally{qi.set(e,n)}};function nm(e,t,r){var n=gs.get(e)||[],o=vs.get(e)||new Set,a,u,c=b=>{if(b){var g=b.join(",");u.has(g)||(u.add(g),a.push(b))}};if(r){a=[],u=new Set;for(var f of n){var d=r(f);c(d)}}else a=n,u=o;for(var m of t)c(m);gs.set(e,a),vs.set(e,u)}var Tb=(e,t)=>{for(var r of T.pathRefs(e))K6.transform(r,t);for(var n of T.pointRefs(e))q6.transform(n,t);for(var o of T.rangeRefs(e))W6.transform(o,t);if(!Ob(e)){var a=ae.operationCanTransformPath(t)?u=>ae.transform(u,t):void 0;nm(e,e.getDirtyPaths(t),a)}_e.transform(e,t),e.operations.push(t),T.normalize(e,{operation:t}),t.type==="set_selection"&&(e.marks=null),La.get(e)||(La.set(e,!0),Promise.resolve().then(()=>{La.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},Mb=(e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":{var{path:r}=t;return ae.levels(r)}case"insert_node":{var{node:n,path:o}=t,a=ae.levels(o),u=nt.isText(n)?[]:Array.from(Ye.nodes(n),Q=>{var[,V]=Q;return o.concat(V)});return[...a,...u]}case"merge_node":{var{path:c}=t,f=ae.ancestors(c),d=ae.previous(c);return[...f,d]}case"move_node":{var{path:m,newPath:b}=t;if(ae.equals(m,b))return[];var g=[],w=[];for(var C of ae.ancestors(m)){var D=ae.transform(C,t);g.push(D)}for(var p of ae.ancestors(b)){var B=ae.transform(p,t);w.push(B)}var F=w[w.length-1],S=b[b.length-1],O=F.concat(S);return[...g,...w,O]}case"remove_node":{var{path:M}=t,_=ae.ancestors(M);return[..._]}case"split_node":{var{path:z}=t,K=ae.levels(z),$=ae.next(z);return[...K,$]}default:return[]}},Rb=e=>{var{selection:t}=e;return t?Ye.fragment(e,t):[]},Pb=(e,t)=>{var[r,n]=t;if(!nt.isText(r)){if(at.isElement(r)&&r.children.length===0){var o={text:""};_e.insertNodes(e,o,{at:n.concat(0),voids:!0});return}for(var a=T.isEditor(r)?!1:at.isElement(r)&&(e.isInline(r)||r.children.length===0||nt.isText(r.children[0])||e.isInline(r.children[0])),u=0,c=0;c<r.children.length;c++,u++){var f=Ye.get(e,n);if(!nt.isText(f)){var d=f.children[u],m=f.children[u-1],b=c===r.children.length-1,g=nt.isText(d)||at.isElement(d)&&e.isInline(d);if(g!==a)_e.removeNodes(e,{at:n.concat(u),voids:!0}),u--;else if(at.isElement(d)){if(e.isInline(d)){if(m==null||!nt.isText(m)){var w={text:""};_e.insertNodes(e,w,{at:n.concat(u),voids:!0}),u++}else if(b){var C={text:""};_e.insertNodes(e,C,{at:n.concat(u+1),voids:!0}),u++}}}else{if(!nt.isText(d)&&!("children"in d)){var D=d;D.children=[]}m!=null&&nt.isText(m)&&(nt.equals(d,m,{loose:!0})?(_e.mergeNodes(e,{at:n.concat(u),voids:!0}),u--):m.text===""?(_e.removeNodes(e,{at:n.concat(u-1),voids:!0}),u--):d.text===""&&(_e.removeNodes(e,{at:n.concat(u),voids:!0}),u--))}}}}},Ib=(e,t)=>{var{iteration:r,initialDirtyPathsLength:n}=t,o=n*42;if(r>o)throw new Error("Could not completely normalize the editor after ".concat(o," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0},zb=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{voids:r=!1,mode:n="lowest",at:o=e.selection,match:a}=t;if(o){var u=T.path(e,o),c=n==="lowest";for(var[f,d]of T.levels(e,{at:u,voids:r,match:a,reverse:c}))if(!nt.isText(f)){if(Ae.isRange(o)){if(ae.isAncestor(d,o.anchor.path)&&ae.isAncestor(d,o.focus.path))return[f,d]}else if(!ae.equals(u,d))return[f,d]}}};function Vf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Uf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vf(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var jb=(e,t,r)=>{var{selection:n}=e;if(n){var o=(b,g)=>{if(!nt.isText(b))return!1;var[w,C]=T.parent(e,g);return!e.isVoid(w)||e.markableVoid(w)},a=Ae.isExpanded(n),u=!1;if(!a){var[c,f]=T.node(e,n);if(c&&o(c,f)){var[d]=T.parent(e,f);u=d&&e.markableVoid(d)}}if(a||u)_e.setNodes(e,{[t]:r},{match:o,split:!0,voids:!0});else{var m=Uf(Uf({},T.marks(e)||{}),{},{[t]:r});e.marks=m,La.get(e)||e.onChange()}}};function Yf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Gf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yf(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var _b=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=T.point(e,t,{edge:"end"}),o=T.end(e,[]),a={anchor:n,focus:o},{distance:u=1}=r,c=0,f;for(var d of T.positions(e,Gf(Gf({},r),{},{at:a}))){if(c>u)break;c!==0&&(f=d),c++}return f};function Xf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Qf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xf(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Lb=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=T.start(e,[]),o=T.point(e,t,{edge:"start"}),a={anchor:n,focus:o},{distance:u=1}=r,c=0,f;for(var d of T.positions(e,Qf(Qf({},r),{},{at:a,reverse:!0}))){if(c>u)break;c!==0&&(f=d),c++}return f},Hb=(e,t)=>{var{selection:r}=e;r&&Ae.isCollapsed(r)&&_e.delete(e,{unit:t,reverse:!0})},Kb=(e,t)=>{var{selection:r}=e;r&&Ae.isCollapsed(r)&&_e.delete(e,{unit:t})},qb=function(e){var{direction:t="forward"}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=e;r&&Ae.isExpanded(r)&&_e.delete(e,{reverse:t==="backward"})},Wb=(e,t)=>[T.start(e,t),T.end(e,t)];function Zf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Jf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zf(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Vb=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.above(e,Jf(Jf({},t),{},{match:r=>at.isElement(r)&&T.isElementReadOnly(e,r)}))},Ub=(e,t)=>T.point(e,t,{edge:"end"}),Yb=(e,t)=>{var r=T.path(e,t,{edge:"start"});return T.node(e,r)},Gb=(e,t)=>{var r=T.range(e,t);return Ye.fragment(e,r)};function eh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function th(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eh(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Xb=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T.above(e,th(th({},t),{},{match:r=>at.isElement(r)&&T.isVoid(e,r)}))},Qb=(e,t)=>t.children.some(r=>at.isElement(r)&&T.isBlock(e,r)),Zb=(e,t)=>t.children.some(r=>nt.isText(r)||T.isInline(e,r)),Jb=(e,t)=>Ye.has(e,t),e8=(e,t)=>t.children.every(r=>nt.isText(r)),t8=e=>{_e.splitNodes(e,{always:!0})},r8=(e,t,r)=>{_e.insertNodes(e,t,r)},n8=e=>{_e.splitNodes(e,{always:!0})};function rh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function o8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rh(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var a8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:n,marks:o}=e;if(n){if(o){var a=o8({text:t},o);_e.insertNodes(e,a,{at:r.at,voids:r.voids})}else _e.insertText(e,t,r);e.marks=null}},i8=(e,t)=>!e.isInline(t),s8=(e,t,r)=>T.isStart(e,t,r)||T.isEnd(e,t,r),l8=(e,t)=>{var{children:r}=t,[n]=r;return r.length===0||r.length===1&&nt.isText(n)&&n.text===""&&!e.isVoid(t)},u8=(e,t,r)=>{var n=T.end(e,r);return Tt.equals(t,n)},c8=e=>{var t=tm.get(e);return t===void 0?!0:t},d8=(e,t,r)=>{if(t.offset!==0)return!1;var n=T.start(e,r);return Tt.equals(t,n)},f8=(e,t)=>{var r=T.path(e,t,{edge:"end"});return T.node(e,r)},h8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=T.path(e,t,r),o=Ye.leaf(e,n);return[o,n]};function p8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){var{at:r=e.selection,reverse:n=!1,voids:o=!1}=t,{match:a}=t;if(a==null&&(a=()=>!0),!!r){var u=[],c=T.path(e,r);for(var[f,d]of Ye.levels(e,c))if(a(f,d)&&(u.push([f,d]),!o&&at.isElement(f)&&T.isVoid(e,f)))break;n&&u.reverse(),yield*u}})()}var m8=["text"],g8=["text"],v8=function(e){var{marks:t,selection:r}=e;if(!r)return null;var{anchor:n,focus:o}=r;if(t)return t;if(Ae.isExpanded(r)){var a=T.isEnd(e,n,n.path);if(a){var u=T.after(e,n);u&&(n=u)}var[c]=T.nodes(e,{match:nt.isText,at:{anchor:n,focus:o}});if(c){var[f]=c,d=Qn(f,m8);return d}else return{}}var{path:m}=n,[b]=T.leaf(e,m);if(n.offset===0){var g=T.previous(e,{at:m,match:nt.isText}),w=T.above(e,{match:S=>at.isElement(S)&&T.isVoid(e,S)&&e.markableVoid(S)});if(!w){var C=T.above(e,{match:S=>at.isElement(S)&&T.isBlock(e,S)});if(g&&C){var[D,p]=g,[,B]=C;ae.isAncestor(B,p)&&(b=D)}}}var F=Qn(b,g8);return F},b8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:n=!1}=t,{match:o,at:a=e.selection}=t;if(a){var u=T.after(e,a,{voids:n});if(u){var[,c]=T.last(e,[]),f=[u.path,c];if(ae.isPath(a)&&a.length===0)throw new Error("Cannot get the next node from the root node!");if(o==null)if(ae.isPath(a)){var[d]=T.parent(e,a);o=b=>d.children.includes(b)}else o=()=>!0;var[m]=T.nodes(e,{at:f,match:o,mode:r,voids:n});return m}}},y8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=T.path(e,t,r),o=Ye.get(e,n);return[o,n]};function x8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){var{at:r=e.selection,mode:n="all",universal:o=!1,reverse:a=!1,voids:u=!1,ignoreNonSelectable:c=!1}=t,{match:f}=t;if(f||(f=()=>!0),!!r){var d,m;if(ob.isSpan(r))d=r[0],m=r[1];else{var b=T.path(e,r,{edge:"start"}),g=T.path(e,r,{edge:"end"});d=a?g:b,m=a?b:g}var w=Ye.nodes(e,{reverse:a,from:d,to:m,pass:O=>{var[M]=O;return at.isElement(M)?!!(!u&&(T.isVoid(e,M)||T.isElementReadOnly(e,M))||c&&!T.isSelectable(e,M)):!1}}),C=[],D;for(var[p,B]of w)if(!(c&&at.isElement(p)&&!T.isSelectable(e,p))){var F=D&&ae.compare(B,D[1])===0;if(!(n==="highest"&&F)){if(!f(p,B)){if(o&&!F&&nt.isText(p))return;continue}if(n==="lowest"&&F){D=[p,B];continue}var S=n==="lowest"?D:[p,B];S&&(o?C.push(S):yield S),D=[p,B]}}n==="lowest"&&D&&(o?C.push(D):yield D),o&&(yield*C)}})()}var C8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1,operation:n}=t,o=d=>gs.get(d)||[],a=d=>vs.get(d)||new Set,u=d=>{var m=o(d).pop(),b=m.join(",");return a(d).delete(b),m};if(T.isNormalizing(e)){if(r){var c=Array.from(Ye.nodes(e),d=>{var[,m]=d;return m}),f=new Set(c.map(d=>d.join(",")));gs.set(e,c),vs.set(e,f)}o(e).length!==0&&T.withoutNormalizing(e,()=>{for(var d of o(e))if(Ye.has(e,d)){var m=T.node(e,d),[b,g]=m;at.isElement(b)&&b.children.length===0&&e.normalizeNode(m,{operation:n})}for(var w=o(e),C=w.length,D=0;w.length!==0;){if(!e.shouldNormalize({dirtyPaths:w,iteration:D,initialDirtyPathsLength:C,operation:n}))return;var p=u(e);if(Ye.has(e,p)){var B=T.node(e,p);e.normalizeNode(B,{operation:n})}D++,w=o(e)}})}},w8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=T.path(e,t,r),o=ae.parent(n),a=T.node(e,o);return a},D8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,o={current:t,affinity:n,unref(){var{current:u}=o,c=T.pathRefs(e);return c.delete(o),o.current=null,u}},a=T.pathRefs(e);return a.add(o),o},E8=e=>{var t=Of.get(e);return t||(t=new Set,Of.set(e,t)),t},k8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:n,edge:o}=r;if(ae.isPath(t)){if(o==="start"){var[,a]=Ye.first(e,t);t=a}else if(o==="end"){var[,u]=Ye.last(e,t);t=u}}return Ae.isRange(t)&&(o==="start"?t=Ae.start(t):o==="end"?t=Ae.end(t):t=ae.common(t.anchor.path,t.focus.path)),Tt.isPoint(t)&&(t=t.path),n!=null&&(t=t.slice(0,n)),t},S8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,o={current:t,affinity:n,unref(){var{current:u}=o,c=T.pointRefs(e);return c.delete(o),o.current=null,u}},a=T.pointRefs(e);return a.add(o),o},B8=e=>{var t=$f.get(e);return t||(t=new Set,$f.set(e,t)),t},A8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:n="start"}=r;if(ae.isPath(t)){var o;if(n==="end"){var[,a]=Ye.last(e,t);o=a}else{var[,u]=Ye.first(e,t);o=u}var c=Ye.get(e,o);if(!nt.isText(c))throw new Error("Cannot get the ".concat(n," point in the node at path [").concat(t,"] because it has no ").concat(n," text node."));return{path:o,offset:n==="end"?c.text.length:0}}if(Ae.isRange(t)){var[f,d]=Ae.edges(t);return n==="start"?f:d}return t};function F8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){var{at:r=e.selection,unit:n="offset",reverse:o=!1,voids:a=!1,ignoreNonSelectable:u=!1}=t;if(!r)return;var c=T.range(e,r),[f,d]=Ae.edges(c),m=o?d:f,b=!1,g="",w=0,C=0,D=0;for(var[p,B]of T.nodes(e,{at:r,reverse:o,voids:a,ignoreNonSelectable:u})){if(at.isElement(p)){if(!a&&(e.isVoid(p)||e.isElementReadOnly(p))){yield T.start(e,B);continue}if(e.isInline(p))continue;if(T.hasInlines(e,p)){var F=ae.isAncestor(B,d.path)?d:T.end(e,B),S=ae.isAncestor(B,f.path)?f:T.start(e,B);g=T.string(e,{anchor:S,focus:F},{voids:a}),b=!0}}if(nt.isText(p)){var O=ae.equals(B,m.path);for(O?(C=o?m.offset:p.text.length-m.offset,D=m.offset):(C=p.text.length,D=o?C:0),(O||b||n==="offset")&&(yield{path:B,offset:D},b=!1);;){if(w===0){if(g==="")break;w=M(g,n,o),g=V0(g,w,o)[1]}if(D=o?D-w:D+w,C=C-w,C<0){w=-C;break}w=0,yield{path:B,offset:D}}}}function M(_,z,K){return z==="character"?W0(_,K):z==="word"?cb(_,K):z==="line"||z==="block"?_.length:1}})()}var N8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:n=!1}=t,{match:o,at:a=e.selection}=t;if(a){var u=T.before(e,a,{voids:n});if(u){var[,c]=T.first(e,[]),f=[u.path,c];if(ae.isPath(a)&&a.length===0)throw new Error("Cannot get the previous node from the root node!");if(o==null)if(ae.isPath(a)){var[d]=T.parent(e,a);o=b=>d.children.includes(b)}else o=()=>!0;var[m]=T.nodes(e,{reverse:!0,at:f,match:o,mode:r,voids:n});return m}}},O8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,o={current:t,affinity:n,unref(){var{current:u}=o,c=T.rangeRefs(e);return c.delete(o),o.current=null,u}},a=T.rangeRefs(e);return a.add(o),o},$8=e=>{var t=Tf.get(e);return t||(t=new Set,Tf.set(e,t)),t},T8=(e,t,r)=>{if(Ae.isRange(t)&&!r)return t;var n=T.start(e,t),o=T.end(e,r||t);return{anchor:n,focus:o}};function nh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function M8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nh(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var R8=(e,t)=>{var{selection:r}=e;if(r){var n=(m,b)=>{if(!nt.isText(m))return!1;var[g,w]=T.parent(e,b);return!e.isVoid(g)||e.markableVoid(g)},o=Ae.isExpanded(r),a=!1;if(!o){var[u,c]=T.node(e,r);if(u&&n(u,c)){var[f]=T.parent(e,c);a=f&&e.markableVoid(f)}}if(o||a)_e.unsetNodes(e,t,{match:n,split:!0,voids:!0});else{var d=M8({},T.marks(e)||{});delete d[t],e.marks=d,La.get(e)||e.onChange()}}},P8=(e,t)=>{tm.set(e,t)},I8=(e,t)=>T.point(e,t,{edge:"start"}),z8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:n=!1}=r,o=T.range(e,t),[a,u]=Ae.edges(o),c="";for(var[f,d]of T.nodes(e,{at:o,match:nt.isText,voids:n})){var m=f.text;ae.equals(d,u.path)&&(m=m.slice(0,u.offset)),ae.equals(d,a.path)&&(m=m.slice(a.offset)),c+=m}return c},j8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:n=!1}=r,[o,a]=Ae.edges(t);if(o.offset!==0||a.offset!==0||Ae.isCollapsed(t)||ae.hasPrevious(a.path))return t;var u=T.above(e,{at:a,match:w=>at.isElement(w)&&T.isBlock(e,w),voids:n}),c=u?u[1]:[],f=T.start(e,o),d={anchor:f,focus:a},m=!0;for(var[b,g]of T.nodes(e,{at:d,match:nt.isText,reverse:!0,voids:n})){if(m){m=!1;continue}if(b.text!==""||ae.isBefore(g,c)){a={path:g,offset:b.text.length};break}}return{anchor:o,focus:a}},_8=(e,t)=>{var r=T.isNormalizing(e);T.setNormalizing(e,!1);try{t()}finally{T.setNormalizing(e,r)}T.normalize(e)},L8=(e,t,r)=>{var[n,o]=t;return at.isElement(n)&&T.isEmpty(e,n)||nt.isText(n)&&n.text===""&&o[o.length-1]!==0},H8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T.withoutNormalizing(e,()=>{var r,n,{reverse:o=!1,unit:a="character",distance:u=1,voids:c=!1}=t,{at:f=e.selection,hanging:d=!1}=t;if(f){var m=!1;if(Ae.isRange(f)&&Ae.isCollapsed(f)&&(m=!0,f=f.anchor),Tt.isPoint(f)){var b=T.void(e,{at:f,mode:"highest"});if(!c&&b){var[,g]=b;f=g}else{var w={unit:a,distance:u},C=o?T.before(e,f,w)||T.start(e,[]):T.after(e,f,w)||T.end(e,[]);f={anchor:f,focus:C},d=!0}}if(ae.isPath(f)){_e.removeNodes(e,{at:f,voids:c});return}if(!Ae.isCollapsed(f)){if(!d){var[,D]=Ae.edges(f),p=T.end(e,[]);Tt.equals(D,p)||(f=T.unhangRange(e,f,{voids:c}))}var[B,F]=Ae.edges(f),S=T.above(e,{match:Fe=>at.isElement(Fe)&&T.isBlock(e,Fe),at:B,voids:c}),O=T.above(e,{match:Fe=>at.isElement(Fe)&&T.isBlock(e,Fe),at:F,voids:c}),M=S&&O&&!ae.equals(S[1],O[1]),_=ae.equals(B.path,F.path),z=c?null:(r=T.void(e,{at:B,mode:"highest"}))!==null&&r!==void 0?r:T.elementReadOnly(e,{at:B,mode:"highest"}),K=c?null:(n=T.void(e,{at:F,mode:"highest"}))!==null&&n!==void 0?n:T.elementReadOnly(e,{at:F,mode:"highest"});if(z){var $=T.before(e,B);$&&S&&ae.isAncestor(S[1],$.path)&&(B=$)}if(K){var Q=T.after(e,F);Q&&O&&ae.isAncestor(O[1],Q.path)&&(F=Q)}var V=[],X;for(var G of T.nodes(e,{at:f,voids:c})){var[j,H]=G;X&&ae.compare(H,X)===0||(!c&&at.isElement(j)&&(T.isVoid(e,j)||T.isElementReadOnly(e,j))||!ae.isCommon(H,B.path)&&!ae.isCommon(H,F.path))&&(V.push(G),X=H)}var U=Array.from(V,Fe=>{var[,Be]=Fe;return T.pathRef(e,Be)}),R=T.pointRef(e,B),te=T.pointRef(e,F),q="";if(!_&&!z){var se=R.current,[ye]=T.leaf(e,se),{path:we}=se,{offset:ie}=B,me=ye.text.slice(ie);me.length>0&&(e.apply({type:"remove_text",path:we,offset:ie,text:me}),q=me)}if(U.reverse().map(Fe=>Fe.unref()).filter(Fe=>Fe!==null).forEach(Fe=>_e.removeNodes(e,{at:Fe,voids:c})),!K){var Oe=te.current,[ee]=T.leaf(e,Oe),{path:pe}=Oe,le=_?B.offset:0,ue=ee.text.slice(le,F.offset);ue.length>0&&(e.apply({type:"remove_text",path:pe,offset:le,text:ue}),q=ue)}!_&&M&&te.current&&R.current&&_e.mergeNodes(e,{at:te.current,hanging:!0,voids:c}),m&&o&&a==="character"&&q.length>1&&q.match(/[\u0E00-\u0E7F]+/)&&_e.insertText(e,q.slice(0,q.length-u));var De=R.unref(),Ce=te.unref(),Ee=o?De||Ce:Ce||De;t.at==null&&Ee&&_e.select(e,Ee)}}})},K8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};T.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:o=!1}=r,{at:a=q0(e),batchDirty:u=!0}=r;if(t.length){if(Ae.isRange(a))if(n||(a=T.unhangRange(e,a,{voids:o})),Ae.isCollapsed(a))a=a.anchor;else{var[,c]=Ae.edges(a);if(!o&&T.void(e,{at:c}))return;var f=T.pointRef(e,c);_e.delete(e,{at:a}),a=f.unref()}else ae.isPath(a)&&(a=T.start(e,a));if(!(!o&&T.void(e,{at:a}))){var d=T.above(e,{at:a,match:me=>at.isElement(me)&&T.isInline(e,me),mode:"highest",voids:o});if(d){var[,m]=d;if(T.isEnd(e,a,m)){var b=T.after(e,m);a=b}else if(T.isStart(e,a,m)){var g=T.before(e,m);a=g}}var w=T.above(e,{match:me=>at.isElement(me)&&T.isBlock(e,me),at:a,voids:o}),[,C]=w,D=T.isStart(e,a,C),p=T.isEnd(e,a,C),B=D&&p,F=!D||D&&p,S=!p,[,O]=Ye.first({children:t},[]),[,M]=Ye.last({children:t},[]),_=[],z=me=>{var[Oe,ee]=me,pe=ee.length===0;return pe?!1:B?!0:!(F&&ae.isAncestor(ee,O)&&at.isElement(Oe)&&!e.isVoid(Oe)&&!e.isInline(Oe)||S&&ae.isAncestor(ee,M)&&at.isElement(Oe)&&!e.isVoid(Oe)&&!e.isInline(Oe))};for(var K of Ye.nodes({children:t},{pass:z}))z(K)&&_.push(K);var $=[],Q=[],V=[],X=!0,G=!1;for(var[j]of _)at.isElement(j)&&!e.isInline(j)?(X=!1,G=!0,Q.push(j)):X?$.push(j):V.push(j);var[H]=T.nodes(e,{at:a,match:me=>nt.isText(me)||T.isInline(e,me),mode:"highest",voids:o}),[,U]=H,R=T.isStart(e,a,U),te=T.isEnd(e,a,U),q=T.pathRef(e,p&&!V.length?ae.next(C):C),se=T.pathRef(e,te?ae.next(U):U);_e.splitNodes(e,{at:a,match:me=>G?at.isElement(me)&&T.isBlock(e,me):nt.isText(me)||T.isInline(e,me),mode:G?"lowest":"highest",always:G&&(!D||$.length>0)&&(!p||V.length>0),voids:o});var ye=T.pathRef(e,!R||R&&te?ae.next(U):U);if(_e.insertNodes(e,$,{at:ye.current,match:me=>nt.isText(me)||T.isInline(e,me),mode:"highest",voids:o,batchDirty:u}),B&&!$.length&&Q.length&&!V.length&&_e.delete(e,{at:C,voids:o}),_e.insertNodes(e,Q,{at:q.current,match:me=>at.isElement(me)&&T.isBlock(e,me),mode:"lowest",voids:o,batchDirty:u}),_e.insertNodes(e,V,{at:se.current,match:me=>nt.isText(me)||T.isInline(e,me),mode:"highest",voids:o,batchDirty:u}),!r.at){var we;if(V.length>0&&se.current?we=ae.previous(se.current):Q.length>0&&q.current?we=ae.previous(q.current):ye.current&&(we=ae.previous(ye.current)),we){var ie=T.end(e,we);_e.select(e,ie)}}ye.unref(),q.unref(),se.unref()}}})},q8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{edge:r="anchor"}=t,{selection:n}=e;if(n){if(r==="anchor")_e.select(e,n.anchor);else if(r==="focus")_e.select(e,n.focus);else if(r==="start"){var[o]=Ae.edges(n);_e.select(e,o)}else if(r==="end"){var[,a]=Ae.edges(n);_e.select(e,a)}}else return},W8=e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},V8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=e,{distance:n=1,unit:o="character",reverse:a=!1}=t,{edge:u=null}=t;if(r){u==="start"&&(u=Ae.isBackward(r)?"focus":"anchor"),u==="end"&&(u=Ae.isBackward(r)?"anchor":"focus");var{anchor:c,focus:f}=r,d={distance:n,unit:o,ignoreNonSelectable:!0},m={};if(u==null||u==="anchor"){var b=a?T.before(e,c,d):T.after(e,c,d);b&&(m.anchor=b)}if(u==null||u==="focus"){var g=a?T.before(e,f,d):T.after(e,f,d);g&&(m.focus=g)}_e.setSelection(e,m)}},U8=(e,t)=>{var{selection:r}=e;if(t=T.range(e,t),r){_e.setSelection(e,t);return}if(!Ae.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Pr.stringify(t)));e.apply({type:"set_selection",properties:r,newProperties:t})};function oh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ah(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oh(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Y8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:n}=e,{edge:o="both"}=r;if(n){o==="start"&&(o=Ae.isBackward(n)?"focus":"anchor"),o==="end"&&(o=Ae.isBackward(n)?"anchor":"focus");var{anchor:a,focus:u}=n,c=o==="anchor"?a:u;_e.setSelection(e,{[o==="anchor"?"anchor":"focus"]:ah(ah({},c),t)})}},G8=(e,t)=>{var{selection:r}=e,n={},o={};if(r){for(var a in t)(a==="anchor"&&t.anchor!=null&&!Tt.equals(t.anchor,r.anchor)||a==="focus"&&t.focus!=null&&!Tt.equals(t.focus,r.focus)||a!=="anchor"&&a!=="focus"&&t[a]!==r[a])&&(n[a]=r[a],o[a]=t[a]);Object.keys(n).length>0&&e.apply({type:"set_selection",properties:n,newProperties:o})}},X8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};T.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:o=!1,mode:a="lowest",batchDirty:u=!0}=r,{at:c,match:f,select:d}=r;if(Ye.isNode(t)&&(t=[t]),t.length!==0){var[m]=t;if(c||(c=q0(e),d!==!1&&(d=!0)),d==null&&(d=!1),Ae.isRange(c))if(n||(c=T.unhangRange(e,c,{voids:o})),Ae.isCollapsed(c))c=c.anchor;else{var[,b]=Ae.edges(c),g=T.pointRef(e,b);_e.delete(e,{at:c}),c=g.unref()}if(Tt.isPoint(c)){f==null&&(nt.isText(m)?f=$=>nt.isText($):e.isInline(m)?f=$=>nt.isText($)||T.isInline(e,$):f=$=>at.isElement($)&&T.isBlock(e,$));var[w]=T.nodes(e,{at:c.path,match:f,mode:a,voids:o});if(w){var[,C]=w,D=T.pathRef(e,C),p=T.isEnd(e,c,C);_e.splitNodes(e,{at:c,match:f,mode:a,voids:o});var B=D.unref();c=p?ae.next(B):B}else return}var F=ae.parent(c),S=c[c.length-1];if(!(!o&&T.void(e,{at:F}))){if(u){var O=[],M=ae.levels(F);$b(e,()=>{var $=function(){var V=F.concat(S);S++;var X={type:"insert_node",path:V,node:Q};e.apply(X),c=ae.next(c),O.push(X),nt.isText?M.push(...Array.from(Ye.nodes(Q),G=>{var[,j]=G;return V.concat(j)})):M.push(V)};for(var Q of t)$()},()=>{nm(e,M,$=>{var Q=$;for(var V of O)if(ae.operationCanTransformPath(V)&&(Q=ae.transform(Q,V),!Q))return null;return Q})})}else for(var _ of t){var z=F.concat(S);S++,e.apply({type:"insert_node",path:z,node:_}),c=ae.next(c)}if(c=ae.previous(c),d){var K=T.end(e,c);K&&_e.select(e,K)}}}})},Q8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T.withoutNormalizing(e,()=>{var{at:r=e.selection,mode:n="lowest",voids:o=!1}=t,{match:a}=t;if(a==null&&(a=ae.isPath(r)?ya(e,r):S=>at.isElement(S)&&T.isBlock(e,S)),!!r){var u=T.nodes(e,{at:r,match:a,mode:n,voids:o}),c=Array.from(u,S=>{var[,O]=S;return T.pathRef(e,O)});for(var f of c){var d=f.unref();if(d.length<2)throw new Error("Cannot lift node at a path [".concat(d,"] because it has a depth of less than `2`."));var m=T.node(e,ae.parent(d)),[b,g]=m,w=d[d.length-1],{length:C}=b.children;if(C===1){var D=ae.next(g);_e.moveNodes(e,{at:d,to:D,voids:o}),_e.removeNodes(e,{at:g,voids:o})}else if(w===0)_e.moveNodes(e,{at:d,to:g,voids:o});else if(w===C-1){var p=ae.next(g);_e.moveNodes(e,{at:d,to:p,voids:o})}else{var B=ae.next(d),F=ae.next(g);_e.splitNodes(e,{at:B,voids:o}),_e.moveNodes(e,{at:d,to:F,voids:o})}}}})},Z8=["text"],J8=["children"],om=(e,t)=>{if(at.isElement(t)){var r=t;return T.isVoid(e,t)?!0:r.children.length===1?om(e,r.children[0]):!1}else return!T.isEditor(t)},ey=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T.withoutNormalizing(e,()=>{var{match:r,at:n=e.selection}=t,{hanging:o=!1,voids:a=!1,mode:u="lowest"}=t;if(n){if(r==null)if(ae.isPath(n)){var[c]=T.parent(e,n);r=$=>c.children.includes($)}else r=$=>at.isElement($)&&T.isBlock(e,$);if(!o&&Ae.isRange(n)&&(n=T.unhangRange(e,n,{voids:a})),Ae.isRange(n))if(Ae.isCollapsed(n))n=n.anchor;else{var[,f]=Ae.edges(n),d=T.pointRef(e,f);_e.delete(e,{at:n}),n=d.unref(),t.at==null&&_e.select(e,n)}var[m]=T.nodes(e,{at:n,match:r,voids:a,mode:u}),b=T.previous(e,{at:n,match:r,voids:a,mode:u});if(!(!m||!b)){var[g,w]=m,[C,D]=b;if(!(w.length===0||D.length===0)){var p=ae.next(D),B=ae.common(w,D),F=ae.isSibling(w,D),S=Array.from(T.levels(e,{at:w}),$=>{var[Q]=$;return Q}).slice(B.length).slice(0,-1),O=T.above(e,{at:w,mode:"highest",match:$=>S.includes($)&&om(e,$)}),M=O&&T.pathRef(e,O[1]),_,z;if(nt.isText(g)&&nt.isText(C)){var K=Qn(g,Z8);z=C.text.length,_=K}else if(at.isElement(g)&&at.isElement(C)){var K=Qn(g,J8);z=C.children.length,_=K}else throw new Error("Cannot merge the node at path [".concat(w,"] with the previous sibling because it is not the same kind: ").concat(Pr.stringify(g)," ").concat(Pr.stringify(C)));F||_e.moveNodes(e,{at:w,to:p,voids:a}),M&&_e.removeNodes(e,{at:M.current,voids:a}),T.shouldMergeNodesRemovePrevNode(e,b,m)?_e.removeNodes(e,{at:D,voids:a}):e.apply({type:"merge_node",path:p,position:z,properties:_}),M&&M.unref()}}}})},ty=(e,t)=>{T.withoutNormalizing(e,()=>{var{to:r,at:n=e.selection,mode:o="lowest",voids:a=!1}=t,{match:u}=t;if(n){u==null&&(u=ae.isPath(n)?ya(e,n):w=>at.isElement(w)&&T.isBlock(e,w));var c=T.pathRef(e,r),f=T.nodes(e,{at:n,match:u,mode:o,voids:a}),d=Array.from(f,w=>{var[,C]=w;return T.pathRef(e,C)});for(var m of d){var b=m.unref(),g=c.current;b.length!==0&&e.apply({type:"move_node",path:b,newPath:g}),c.current&&ae.isSibling(g,b)&&ae.isAfter(g,b)&&(c.current=ae.next(c.current))}c.unref()}})},ry=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:n=!1,mode:o="lowest"}=t,{at:a=e.selection,match:u}=t;if(a){u==null&&(u=ae.isPath(a)?ya(e,a):g=>at.isElement(g)&&T.isBlock(e,g)),!r&&Ae.isRange(a)&&(a=T.unhangRange(e,a,{voids:n}));var c=T.nodes(e,{at:a,match:u,mode:o,voids:n}),f=Array.from(c,g=>{var[,w]=g;return T.pathRef(e,w)});for(var d of f){var m=d.unref();if(m){var[b]=T.node(e,m);e.apply({type:"remove_node",path:m,node:b})}}}})},ny=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};T.withoutNormalizing(e,()=>{var{match:n,at:o=e.selection,compare:a,merge:u}=r,{hanging:c=!1,mode:f="lowest",split:d=!1,voids:m=!1}=r;if(o){if(n==null&&(n=ae.isPath(o)?ya(e,o):z=>at.isElement(z)&&T.isBlock(e,z)),!c&&Ae.isRange(o)&&(o=T.unhangRange(e,o,{voids:m})),d&&Ae.isRange(o)){if(Ae.isCollapsed(o)&&T.leaf(e,o.anchor)[0].text.length>0)return;var b=T.rangeRef(e,o,{affinity:"inward"}),[g,w]=Ae.edges(o),C=f==="lowest"?"lowest":"highest",D=T.isEnd(e,w,w.path);_e.splitNodes(e,{at:w,match:n,mode:C,voids:m,always:!D});var p=T.isStart(e,g,g.path);_e.splitNodes(e,{at:g,match:n,mode:C,voids:m,always:!p}),o=b.unref(),r.at==null&&_e.select(e,o)}a||(a=(z,K)=>z!==K);for(var[B,F]of T.nodes(e,{at:o,match:n,mode:f,voids:m})){var S={},O={};if(F.length!==0){var M=!1;for(var _ in t)_==="children"||_==="text"||a(t[_],B[_])&&(M=!0,B.hasOwnProperty(_)&&(S[_]=B[_]),u?t[_]!=null&&(O[_]=u(B[_],t[_])):t[_]!=null&&(O[_]=t[_]));M&&e.apply({type:"set_node",path:F,properties:S,newProperties:O})}}}})},oy=(e,t)=>{if(Ae.isCollapsed(t))return t.anchor;var[,r]=Ae.edges(t),n=T.pointRef(e,r);return _e.delete(e,{at:t}),n.unref()},ay=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T.withoutNormalizing(e,()=>{var{mode:r="lowest",voids:n=!1}=t,{match:o,at:a=e.selection,height:u=0,always:c=!1}=t;if(o==null&&(o=te=>at.isElement(te)&&T.isBlock(e,te)),Ae.isRange(a)&&(a=oy(e,a)),ae.isPath(a)){var f=a,d=T.point(e,f),[m]=T.parent(e,f);o=te=>te===m,u=d.path.length-f.length+1,a=d,c=!0}if(a){var b=T.pointRef(e,a,{affinity:"backward"}),g;try{var[w]=T.nodes(e,{at:a,match:o,mode:r,voids:n});if(!w)return;var C=T.void(e,{at:a,mode:"highest"}),D=0;if(!n&&C){var[p,B]=C;if(at.isElement(p)&&e.isInline(p)){var F=T.after(e,B);if(!F){var S={text:""},O=ae.next(B);_e.insertNodes(e,S,{at:O,voids:n}),F=T.point(e,O)}a=F,c=!0}var M=a.path.length-B.length;u=M+1,c=!0}g=T.pointRef(e,a);var _=a.path.length-u,[,z]=w,K=a.path.slice(0,_),$=u===0?a.offset:a.path[_]+D;for(var[Q,V]of T.levels(e,{at:K,reverse:!0,voids:n})){var X=!1;if(V.length<z.length||V.length===0||!n&&at.isElement(Q)&&T.isVoid(e,Q))break;var G=b.current,j=T.isEnd(e,G,V);if(c||!b||!T.isEdge(e,G,V)){X=!0;var H=Ye.extractProps(Q);e.apply({type:"split_node",path:V,position:$,properties:H})}$=V[V.length-1]+(X||j?1:0)}if(t.at==null){var U=g.current||T.end(e,[]);_e.select(e,U)}}finally{var R;b.unref(),(R=g)===null||R===void 0||R.unref()}}})},iy=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(t)||(t=[t]);var n={};for(var o of t)n[o]=null;_e.setNodes(e,n,r)},sy=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T.withoutNormalizing(e,()=>{var{mode:r="lowest",split:n=!1,voids:o=!1}=t,{at:a=e.selection,match:u}=t;if(a){u==null&&(u=ae.isPath(a)?ya(e,a):g=>at.isElement(g)&&T.isBlock(e,g)),ae.isPath(a)&&(a=T.range(e,a));var c=Ae.isRange(a)?T.rangeRef(e,a):null,f=T.nodes(e,{at:a,match:u,mode:r,voids:o}),d=Array.from(f,g=>{var[,w]=g;return T.pathRef(e,w)}).reverse(),m=function(){var g=b.unref(),[w]=T.node(e,g),C=T.range(e,g);n&&c&&(C=Ae.intersection(c.current,C)),_e.liftNodes(e,{at:C,match:D=>at.isAncestor(w)&&w.children.includes(D),voids:o})};for(var b of d)m();c&&c.unref()}})};function ih(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function sh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ih(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ih(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ly=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};T.withoutNormalizing(e,()=>{var{mode:n="lowest",split:o=!1,voids:a=!1}=r,{match:u,at:c=e.selection}=r;if(c){if(u==null&&(ae.isPath(c)?u=ya(e,c):e.isInline(t)?u=C=>at.isElement(C)&&T.isInline(e,C)||nt.isText(C):u=C=>at.isElement(C)&&T.isBlock(e,C)),o&&Ae.isRange(c)){var[f,d]=Ae.edges(c),m=T.rangeRef(e,c,{affinity:"inward"});_e.splitNodes(e,{at:d,match:u,voids:a}),_e.splitNodes(e,{at:f,match:u,voids:a}),c=m.unref(),r.at==null&&_e.select(e,c)}var b=Array.from(T.nodes(e,{at:c,match:e.isInline(t)?C=>at.isElement(C)&&T.isBlock(e,C):C=>T.isEditor(C),mode:"lowest",voids:a})),g=function(){var C=Ae.isRange(c)?Ae.intersection(c,T.range(e,w)):c;if(!C)return 0;var D=Array.from(T.nodes(e,{at:C,match:u,mode:n,voids:a}));if(D.length>0){var[p]=D,B=D[D.length-1],[,F]=p,[,S]=B;if(F.length===0&&S.length===0)return 0;var O=ae.equals(F,S)?ae.parent(F):ae.common(F,S),M=T.range(e,F,S),_=T.node(e,O),[z]=_,K=O.length+1,$=ae.next(S.slice(0,K)),Q=sh(sh({},t),{},{children:[]});_e.insertNodes(e,Q,{at:$,voids:a}),_e.moveNodes(e,{at:M,match:V=>at.isAncestor(z)&&z.children.includes(V),to:$.concat(0),voids:a})}};for(var[,w]of b)g()}})},uy=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Tb(e,...r)},addMark:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return jb(e,...r)},deleteBackward:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Hb(e,...r)},deleteForward:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Kb(e,...r)},deleteFragment:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return qb(e,...r)},getFragment:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Rb(e,...r)},insertBreak:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return t8(e,...r)},insertSoftBreak:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return n8(e,...r)},insertFragment:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return K8(e,...r)},insertNode:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r8(e,...r)},insertText:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return a8(e,...r)},normalizeNode:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Pb(e,...r)},removeMark:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return R8(e,...r)},getDirtyPaths:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Mb(e,...r)},shouldNormalize:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ib(e,...r)},above:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return zb(e,...r)},after:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return _b(e,...r)},before:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Lb(e,...r)},collapse:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return q8(e,...r)},delete:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return H8(e,...r)},deselect:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return W8(e,...r)},edges:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Wb(e,...r)},elementReadOnly:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Vb(e,...r)},end:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ub(e,...r)},first:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Yb(e,...r)},fragment:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Gb(e,...r)},getMarks:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return v8(e,...r)},hasBlocks:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Qb(e,...r)},hasInlines:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Zb(e,...r)},hasPath:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Jb(e,...r)},hasTexts:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e8(e,...r)},insertNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return X8(e,...r)},isBlock:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return i8(e,...r)},isEdge:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return s8(e,...r)},isEmpty:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return l8(e,...r)},isEnd:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return u8(e,...r)},isNormalizing:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return c8(e,...r)},isStart:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return d8(e,...r)},last:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return f8(e,...r)},leaf:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return h8(e,...r)},levels:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return p8(e,...r)},liftNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Q8(e,...r)},mergeNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ey(e,...r)},move:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return V8(e,...r)},moveNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ty(e,...r)},next:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return b8(e,...r)},node:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return y8(e,...r)},nodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return x8(e,...r)},normalize:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C8(e,...r)},parent:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w8(e,...r)},path:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return k8(e,...r)},pathRef:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return D8(e,...r)},pathRefs:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return E8(e,...r)},point:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return A8(e,...r)},pointRef:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return S8(e,...r)},pointRefs:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return B8(e,...r)},positions:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return F8(e,...r)},previous:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return N8(e,...r)},range:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return T8(e,...r)},rangeRef:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return O8(e,...r)},rangeRefs:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return $8(e,...r)},removeNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ry(e,...r)},select:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return U8(e,...r)},setNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ny(e,...r)},setNormalizing:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return P8(e,...r)},setPoint:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Y8(e,...r)},setSelection:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return G8(e,...r)},splitNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ay(e,...r)},start:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return I8(e,...r)},string:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return z8(e,...r)},unhangRange:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return j8(e,...r)},unsetNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return iy(e,...r)},unwrapNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return sy(e,...r)},void:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Xb(e,...r)},withoutNormalizing:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return _8(e,...r)},wrapNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ly(e,...r)},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return L8(e,...r)}};return e},jl,lh;function cy(){if(lh)return jl;lh=1,jl=o;var e="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",t="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",r=new RegExp("^[^"+t+"]*["+e+"]"),n=new RegExp("^[^"+e+"]*["+t+"]");function o(a){return a=String(a||""),r.test(a)?"rtl":n.test(a)?"ltr":"neutral"}return jl}var dy=cy();const am=js(dy);var _l,uh;function U0(){if(uh)return _l;uh=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return _l=e,_l}var Ll,ch;function fy(){if(ch)return Ll;ch=1;var e=typeof ki=="object"&&ki&&ki.Object===Object&&ki;return Ll=e,Ll}var Hl,dh;function im(){if(dh)return Hl;dh=1;var e=fy(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Hl=r,Hl}var Kl,fh;function hy(){if(fh)return Kl;fh=1;var e=im(),t=function(){return e.Date.now()};return Kl=t,Kl}var ql,hh;function py(){if(hh)return ql;hh=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return ql=t,ql}var Wl,ph;function my(){if(ph)return Wl;ph=1;var e=py(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Wl=r,Wl}var Vl,mh;function sm(){if(mh)return Vl;mh=1;var e=im(),t=e.Symbol;return Vl=t,Vl}var Ul,gh;function gy(){if(gh)return Ul;gh=1;var e=sm(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,o=e?e.toStringTag:void 0;function a(u){var c=r.call(u,o),f=u[o];try{u[o]=void 0;var d=!0}catch{}var m=n.call(u);return d&&(c?u[o]=f:delete u[o]),m}return Ul=a,Ul}var Yl,vh;function vy(){if(vh)return Yl;vh=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Yl=r,Yl}var Gl,bh;function by(){if(bh)return Gl;bh=1;var e=sm(),t=gy(),r=vy(),n="[object Null]",o="[object Undefined]",a=e?e.toStringTag:void 0;function u(c){return c==null?c===void 0?o:n:a&&a in Object(c)?t(c):r(c)}return Gl=u,Gl}var Xl,yh;function yy(){if(yh)return Xl;yh=1;function e(t){return t!=null&&typeof t=="object"}return Xl=e,Xl}var Ql,xh;function xy(){if(xh)return Ql;xh=1;var e=by(),t=yy(),r="[object Symbol]";function n(o){return typeof o=="symbol"||t(o)&&e(o)==r}return Ql=n,Ql}var Zl,Ch;function Cy(){if(Ch)return Zl;Ch=1;var e=my(),t=U0(),r=xy(),n=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;function f(d){if(typeof d=="number")return d;if(r(d))return n;if(t(d)){var m=typeof d.valueOf=="function"?d.valueOf():d;d=t(m)?m+"":m}if(typeof d!="string")return d===0?d:+d;d=e(d);var b=a.test(d);return b||u.test(d)?c(d.slice(2),b?2:8):o.test(d)?n:+d}return Zl=f,Zl}var Jl,wh;function lm(){if(wh)return Jl;wh=1;var e=U0(),t=hy(),r=Cy(),n="Expected a function",o=Math.max,a=Math.min;function u(c,f,d){var m,b,g,w,C,D,p=0,B=!1,F=!1,S=!0;if(typeof c!="function")throw new TypeError(n);f=r(f)||0,e(d)&&(B=!!d.leading,F="maxWait"in d,g=F?o(r(d.maxWait)||0,f):g,S="trailing"in d?!!d.trailing:S);function O(G){var j=m,H=b;return m=b=void 0,p=G,w=c.apply(H,j),w}function M(G){return p=G,C=setTimeout(K,f),B?O(G):w}function _(G){var j=G-D,H=G-p,U=f-j;return F?a(U,g-H):U}function z(G){var j=G-D,H=G-p;return D===void 0||j>=f||j<0||F&&H>=g}function K(){var G=t();if(z(G))return $(G);C=setTimeout(K,_(G))}function $(G){return C=void 0,S&&m?O(G):(m=b=void 0,w)}function Q(){C!==void 0&&clearTimeout(C),p=0,m=D=b=C=void 0}function V(){return C===void 0?w:$(t())}function X(){var G=t(),j=z(G);if(m=arguments,b=this,D=G,j){if(C===void 0)return M(D);if(F)return clearTimeout(C),C=setTimeout(K,f),O(D)}return C===void 0&&(C=setTimeout(K,f)),w}return X.cancel=Q,X.flush=V,X}return Jl=u,Jl}var wy=lm();const Dy=js(wy);var eu,Dh;function Ey(){if(Dh)return eu;Dh=1;var e=lm(),t=U0(),r="Expected a function";function n(o,a,u){var c=!0,f=!0;if(typeof o!="function")throw new TypeError(r);return t(u)&&(c="leading"in u?!!u.leading:c,f="trailing"in u?!!u.trailing:f),e(o,a,{leading:c,maxWait:a,trailing:f})}return eu=n,eu}var ky=Ey();const Sy=js(ky),Eh=e=>typeof e=="object"&&e!=null&&e.nodeType===1,kh=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Ai=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const r=getComputedStyle(e,null);return kh(r.overflowY,t)||kh(r.overflowX,t)||(n=>{const o=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!o&&(o.clientHeight<n.scrollHeight||o.clientWidth<n.scrollWidth)})(e)}return!1},Fi=(e,t,r,n,o,a,u,c)=>a<e&&u>t||a>e&&u<t?0:a<=e&&c<=r||u>=t&&c>=r?a-e-n:u>t&&c<r||a<e&&c>r?u-t+o:0,By=e=>e.parentElement??(e.getRootNode().host||null),Sh=(e,t)=>{var r,n,o,a;if(typeof document>"u")return[];const{scrollMode:u,block:c,inline:f,boundary:d,skipOverflowHiddenElements:m}=t,b=typeof d=="function"?d:U=>U!==d;if(!Eh(e))throw new TypeError("Invalid target");const g=document.scrollingElement||document.documentElement,w=[];let C=e;for(;Eh(C)&&b(C);){if(C=By(C),C===g){w.push(C);break}C!=null&&C===document.body&&Ai(C)&&!Ai(document.documentElement)||C!=null&&Ai(C,m)&&w.push(C)}const D=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,p=(a=(o=window.visualViewport)==null?void 0:o.height)!=null?a:innerHeight,{scrollX:B,scrollY:F}=window,{height:S,width:O,top:M,right:_,bottom:z,left:K}=e.getBoundingClientRect(),{top:$,right:Q,bottom:V,left:X}=(U=>{const R=window.getComputedStyle(U);return{top:parseFloat(R.scrollMarginTop)||0,right:parseFloat(R.scrollMarginRight)||0,bottom:parseFloat(R.scrollMarginBottom)||0,left:parseFloat(R.scrollMarginLeft)||0}})(e);let G=c==="start"||c==="nearest"?M-$:c==="end"?z+V:M+S/2-$+V,j=f==="center"?K+O/2-X+Q:f==="end"?_+Q:K-X;const H=[];for(let U=0;U<w.length;U++){const R=w[U],{height:te,width:q,top:se,right:ye,bottom:we,left:ie}=R.getBoundingClientRect();if(u==="if-needed"&&M>=0&&K>=0&&z<=p&&_<=D&&(R===g&&!Ai(R)||M>=se&&z<=we&&K>=ie&&_<=ye))return H;const me=getComputedStyle(R),Oe=parseInt(me.borderLeftWidth,10),ee=parseInt(me.borderTopWidth,10),pe=parseInt(me.borderRightWidth,10),le=parseInt(me.borderBottomWidth,10);let ue=0,De=0;const Ce="offsetWidth"in R?R.offsetWidth-R.clientWidth-Oe-pe:0,Ee="offsetHeight"in R?R.offsetHeight-R.clientHeight-ee-le:0,Fe="offsetWidth"in R?R.offsetWidth===0?0:q/R.offsetWidth:0,Be="offsetHeight"in R?R.offsetHeight===0?0:te/R.offsetHeight:0;if(g===R)ue=c==="start"?G:c==="end"?G-p:c==="nearest"?Fi(F,F+p,p,ee,le,F+G,F+G+S,S):G-p/2,De=f==="start"?j:f==="center"?j-D/2:f==="end"?j-D:Fi(B,B+D,D,Oe,pe,B+j,B+j+O,O),ue=Math.max(0,ue+F),De=Math.max(0,De+B);else{ue=c==="start"?G-se-ee:c==="end"?G-we+le+Ee:c==="nearest"?Fi(se,we,te,ee,le+Ee,G,G+S,S):G-(se+te/2)+Ee/2,De=f==="start"?j-ie-Oe:f==="center"?j-(ie+q/2)+Ce/2:f==="end"?j-ye+pe+Ce:Fi(ie,ye,q,Oe,pe+Ce,j,j+O,O);const{scrollLeft:Ne,scrollTop:ze}=R;ue=Be===0?0:Math.max(0,Math.min(ze+ue/Be,R.scrollHeight-te/Be+Ee)),De=Fe===0?0:Math.max(0,Math.min(Ne+De/Fe,R.scrollWidth-q/Fe+Ce)),G+=ze-ue,j+=Ne-De}H.push({el:R,top:ue,left:De})}return H},Ay=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function Fy(e,t){if(!e.isConnected||!(o=>{let a=o;for(;a&&a.parentNode;){if(a.parentNode===document)return!0;a=a.parentNode instanceof ShadowRoot?a.parentNode.host:a.parentNode}return!1})(e))return;const r=(o=>{const a=window.getComputedStyle(o);return{top:parseFloat(a.scrollMarginTop)||0,right:parseFloat(a.scrollMarginRight)||0,bottom:parseFloat(a.scrollMarginBottom)||0,left:parseFloat(a.scrollMarginLeft)||0}})(e);if((o=>typeof o=="object"&&typeof o.behavior=="function")(t))return t.behavior(Sh(e,t));const n=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:o,top:a,left:u}of Sh(e,Ay(t))){const c=a-r.top+r.bottom,f=u-r.left+r.right;o.scroll({top:c,left:f,behavior:n})}}var No=[],Ny=function(){return No.some(function(e){return e.activeTargets.length>0})},Oy=function(){return No.some(function(e){return e.skippedTargets.length>0})},Bh="ResizeObserver loop completed with undelivered notifications.",$y=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:Bh}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=Bh),window.dispatchEvent(e)},ti;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(ti||(ti={}));var Oo=function(e){return Object.freeze(e)},Ty=(function(){function e(t,r){this.inlineSize=t,this.blockSize=r,Oo(this)}return e})(),um=(function(){function e(t,r,n,o){return this.x=t,this.y=r,this.width=n,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Oo(this)}return e.prototype.toJSON=function(){var t=this,r=t.x,n=t.y,o=t.top,a=t.right,u=t.bottom,c=t.left,f=t.width,d=t.height;return{x:r,y:n,top:o,right:a,bottom:u,left:c,width:f,height:d}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e})(),Y0=function(e){return e instanceof SVGElement&&"getBBox"in e},cm=function(e){if(Y0(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var o=e,a=o.offsetWidth,u=o.offsetHeight;return!(a||u||e.getClientRects().length)},Ah=function(e){var t;if(e instanceof Element)return!0;var r=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},My=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Ha=typeof window<"u"?window:{},Ni=new WeakMap,Fh=/auto|scroll/,Ry=/^tb|vertical/,Py=/msie|trident/i.test(Ha.navigator&&Ha.navigator.userAgent),Tn=function(e){return parseFloat(e||"0")},ra=function(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=!1),new Ty((r?t:e)||0,(r?e:t)||0)},Nh=Oo({devicePixelContentBoxSize:ra(),borderBoxSize:ra(),contentBoxSize:ra(),contentRect:new um(0,0,0,0)}),dm=function(e,t){if(t===void 0&&(t=!1),Ni.has(e)&&!t)return Ni.get(e);if(cm(e))return Ni.set(e,Nh),Nh;var r=getComputedStyle(e),n=Y0(e)&&e.ownerSVGElement&&e.getBBox(),o=!Py&&r.boxSizing==="border-box",a=Ry.test(r.writingMode||""),u=!n&&Fh.test(r.overflowY||""),c=!n&&Fh.test(r.overflowX||""),f=n?0:Tn(r.paddingTop),d=n?0:Tn(r.paddingRight),m=n?0:Tn(r.paddingBottom),b=n?0:Tn(r.paddingLeft),g=n?0:Tn(r.borderTopWidth),w=n?0:Tn(r.borderRightWidth),C=n?0:Tn(r.borderBottomWidth),D=n?0:Tn(r.borderLeftWidth),p=b+d,B=f+m,F=D+w,S=g+C,O=c?e.offsetHeight-S-e.clientHeight:0,M=u?e.offsetWidth-F-e.clientWidth:0,_=o?p+F:0,z=o?B+S:0,K=n?n.width:Tn(r.width)-_-M,$=n?n.height:Tn(r.height)-z-O,Q=K+p+M+F,V=$+B+O+S,X=Oo({devicePixelContentBoxSize:ra(Math.round(K*devicePixelRatio),Math.round($*devicePixelRatio),a),borderBoxSize:ra(Q,V,a),contentBoxSize:ra(K,$,a),contentRect:new um(b,f,K,$)});return Ni.set(e,X),X},fm=function(e,t,r){var n=dm(e,r),o=n.borderBoxSize,a=n.contentBoxSize,u=n.devicePixelContentBoxSize;switch(t){case ti.DEVICE_PIXEL_CONTENT_BOX:return u;case ti.BORDER_BOX:return o;default:return a}},Iy=(function(){function e(t){var r=dm(t);this.target=t,this.contentRect=r.contentRect,this.borderBoxSize=Oo([r.borderBoxSize]),this.contentBoxSize=Oo([r.contentBoxSize]),this.devicePixelContentBoxSize=Oo([r.devicePixelContentBoxSize])}return e})(),hm=function(e){if(cm(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},zy=function(){var e=1/0,t=[];No.forEach(function(a){if(a.activeTargets.length!==0){var u=[];a.activeTargets.forEach(function(c){var f=new Iy(c.target),d=hm(c.target);u.push(f),c.lastReportedSize=fm(c.target,c.observedBox),d<e&&(e=d)}),t.push(function(){a.callback.call(a.observer,u,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var r=0,n=t;r<n.length;r++){var o=n[r];o()}return e},Oh=function(e){No.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(r){r.isActive()&&(hm(r.target)>e?t.activeTargets.push(r):t.skippedTargets.push(r))})})},jy=function(){var e=0;for(Oh(e);Ny();)e=zy(),Oh(e);return Oy()&&$y(),e>0},tu,pm=[],_y=function(){return pm.splice(0).forEach(function(e){return e()})},Ly=function(e){if(!tu){var t=0,r=document.createTextNode(""),n={characterData:!0};new MutationObserver(function(){return _y()}).observe(r,n),tu=function(){r.textContent="".concat(t?t--:t++)}}pm.push(e),tu()},Hy=function(e){Ly(function(){requestAnimationFrame(e)})},Wi=0,Ky=function(){return!!Wi},qy=250,Wy={attributes:!0,characterData:!0,childList:!0,subtree:!0},$h=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Th=function(e){return e===void 0&&(e=0),Date.now()+e},ru=!1,Vy=(function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var r=this;if(t===void 0&&(t=qy),!ru){ru=!0;var n=Th(t);Hy(function(){var o=!1;try{o=jy()}finally{if(ru=!1,t=n-Th(),!Ky())return;o?r.run(1e3):t>0?r.run(t):r.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,r=function(){return t.observer&&t.observer.observe(document.body,Wy)};document.body?r():Ha.addEventListener("DOMContentLoaded",r)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),$h.forEach(function(r){return Ha.addEventListener(r,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),$h.forEach(function(r){return Ha.removeEventListener(r,t.listener,!0)}),this.stopped=!0)},e})(),Yu=new Vy,Mh=function(e){!Wi&&e>0&&Yu.start(),Wi+=e,!Wi&&Yu.stop()},Uy=function(e){return!Y0(e)&&!My(e)&&getComputedStyle(e).display==="inline"},Yy=(function(){function e(t,r){this.target=t,this.observedBox=r||ti.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=fm(this.target,this.observedBox,!0);return Uy(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e})(),Gy=(function(){function e(t,r){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=r}return e})(),Oi=new WeakMap,Rh=function(e,t){for(var r=0;r<e.length;r+=1)if(e[r].target===t)return r;return-1},$i=(function(){function e(){}return e.connect=function(t,r){var n=new Gy(t,r);Oi.set(t,n)},e.observe=function(t,r,n){var o=Oi.get(t),a=o.observationTargets.length===0;Rh(o.observationTargets,r)<0&&(a&&No.push(o),o.observationTargets.push(new Yy(r,n&&n.box)),Mh(1),Yu.schedule())},e.unobserve=function(t,r){var n=Oi.get(t),o=Rh(n.observationTargets,r),a=n.observationTargets.length===1;o>=0&&(a&&No.splice(No.indexOf(n),1),n.observationTargets.splice(o,1),Mh(-1))},e.disconnect=function(t){var r=this,n=Oi.get(t);n.observationTargets.slice().forEach(function(o){return r.unobserve(t,o.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e})(),Xy=(function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");$i.connect(this,t)}return e.prototype.observe=function(t,r){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ah(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");$i.observe(this,t,r)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ah(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");$i.unobserve(this,t)},e.prototype.disconnect=function(){$i.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e})(),vn={},Ph;function Qy(){if(Ph)return vn;Ph=1,Object.defineProperty(vn,"__esModule",{value:!0});for(var e=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},r={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:e?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},n={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)n["f"+o]=111+o;function a(g,w,C){w&&!("byKey"in w)&&(C=w,w=null),Array.isArray(g)||(g=[g]);var D=g.map(function(F){return f(F,w)}),p=function(F){return D.some(function(S){return d(S,F)})},B=C==null?p:p(C);return B}function u(g,w){return a(g,w)}function c(g,w){return a(g,{byKey:!0},w)}function f(g,w){var C=w&&w.byKey,D={};g=g.replace("++","+add");var p=g.split("+"),B=p.length;for(var F in t)D[t[F]]=!1;var S=!0,O=!1,M=void 0;try{for(var _=p[Symbol.iterator](),z;!(S=(z=_.next()).done);S=!0){var K=z.value,$=K.endsWith("?")&&K.length>1;$&&(K=K.slice(0,-1));var Q=b(K),V=t[Q];if(K.length>1&&!V&&!r[K]&&!n[Q])throw new TypeError('Unknown modifier: "'+K+'"');(B===1||!V)&&(C?D.key=Q:D.which=m(K)),V&&(D[V]=$?null:!0)}}catch(X){O=!0,M=X}finally{try{!S&&_.return&&_.return()}finally{if(O)throw M}}return D}function d(g,w){for(var C in g){var D=g[C],p=void 0;if(D!=null&&(C==="key"&&w.key!=null?p=w.key.toLowerCase():C==="which"?p=D===91&&w.which===93?91:w.which:p=w[C],!(p==null&&D===!1)&&p!==D))return!1}return!0}function m(g){g=b(g);var w=n[g]||g.toUpperCase().charCodeAt(0);return w}function b(g){return g=g.toLowerCase(),g=r[g]||g,g}return vn.default=a,vn.isHotkey=a,vn.isCodeHotkey=u,vn.isKeyHotkey=c,vn.parseHotkey=f,vn.compareHotkey=d,vn.toKeyCode=m,vn.toKeyName=b,vn}var nu=Qy();function Zy(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function ia(e,t){if(e==null)return{};var r=Zy(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ri(e){"@babel/helpers - typeof";return ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ri(e)}function Jy(e,t){if(ri(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ri(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function e7(e){var t=Jy(e,"string");return ri(t)==="symbol"?t:String(t)}function fn(e,t,r){return t=e7(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var G0=Zn(null),yo=()=>{var e=ii(G0);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},ou,au,mm=parseInt(je.version.split(".")[0],10),gm=typeof navigator<"u"&&typeof window<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ih=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),Ur=typeof navigator<"u"&&/Android/.test(navigator.userAgent),Qo=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),So=typeof navigator<"u"&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),t7=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),vm=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),r7=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),n7=Ur&&typeof navigator<"u"&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),o7=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),a7=typeof navigator<"u"&&/.*UCBrowser/.test(navigator.userAgent),i7=typeof navigator<"u"&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),Vi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&/Version\/(\d+)/.test(navigator.userAgent)&&(ou=navigator.userAgent.match(/Version\/(\d+)/))!==null&&ou!==void 0&&ou[1]&&parseInt((au=navigator.userAgent.match(/Version\/(\d+)/))===null||au===void 0?void 0:au[1],10)<17;var io=(!r7||!n7)&&!t7&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",na=new WeakMap,X0=new WeakMap,Q0=new WeakMap,bm=new WeakMap,Ui=new WeakMap,Gu=new WeakMap,ni=new WeakMap,$o=new WeakMap,bs=new WeakMap,Ks=new WeakMap,Xu=new WeakMap,ho=new WeakMap,Ao=new WeakMap,Ka=new WeakMap,Qu=new WeakMap,Z0=new WeakMap,yn=new WeakMap,Yn=new WeakMap,en=new WeakMap,co=new WeakMap,fo=new WeakMap,ym=new WeakMap,sa=Symbol("placeholder"),xm=Symbol("mark-placeholder"),Cm=globalThis.Node,s7=globalThis.Text,J0=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,l7=e=>go(e)&&e.nodeType===8,dn=e=>go(e)&&e.nodeType===1,go=e=>{var t=J0(e);return!!t&&e instanceof t.Node},Zu=e=>{var t=e&&e.anchorNode&&J0(e.anchorNode);return!!t&&e instanceof t.Selection},wm=e=>go(e)&&e.nodeType===3,u7=e=>e.clipboardData&&e.clipboardData.getData("text/plain")!==""&&e.clipboardData.types.length===1,c7=e=>{var[t,r]=e;if(dn(t)&&t.childNodes.length){var n=r===t.childNodes.length,o=n?r-1:r;for([t,o]=Dm(t,o,n?"backward":"forward"),n=o<r;dn(t)&&t.childNodes.length;){var a=n?t.childNodes.length-1:0;t=f7(t,a,n?"backward":"forward")}r=n&&t.textContent!=null?t.textContent.length:0}return[t,r]},d7=e=>{for(var t=e&&e.parentNode;t;){if(t.toString()==="[object ShadowRoot]")return!0;t=t.parentNode}return!1},Dm=(e,t,r)=>{for(var{childNodes:n}=e,o=n[t],a=t,u=!1,c=!1;(l7(o)||dn(o)&&o.childNodes.length===0||dn(o)&&o.getAttribute("contenteditable")==="false")&&!(u&&c);){if(a>=n.length){u=!0,a=t-1,r="backward";continue}if(a<0){c=!0,a=t+1,r="forward";continue}o=n[a],t=a,a+=r==="forward"?1:-1}return[o,t]},f7=(e,t,r)=>{var[n]=Dm(e,t,r);return n},Em=e=>{var t="";if(wm(e)&&e.nodeValue)return e.nodeValue;if(dn(e)){for(var r of Array.from(e.childNodes))t+=Em(r);var n=getComputedStyle(e).getPropertyValue("display");(n==="block"||n==="list"||e.tagName==="BR")&&(t+=`
103
- `)}return t},h7=/data-slate-fragment="(.+?)"/m,p7=e=>{var t=e.getData("text/html"),[,r]=t.match(h7)||[];return r},qa=e=>e.getSelection!=null?e.getSelection():document.getSelection(),ec=(e,t,r)=>{var{target:n}=t;if(dn(n)&&n.matches('[contentEditable="false"]'))return!1;var{document:o}=Re.getWindow(e);if(o.contains(n))return Re.hasDOMNode(e,n,{editable:!0});var a=r.find(u=>{var{addedNodes:c,removedNodes:f}=u;for(var d of c)if(d===n||d.contains(n))return!0;for(var m of f)if(m===n||m.contains(n))return!0});return!a||a===t?!1:ec(e,a,r)},m7=()=>{for(var e=document.activeElement;(t=e)!==null&&t!==void 0&&t.shadowRoot&&(r=e.shadowRoot)!==null&&r!==void 0&&r.activeElement;){var t,r,n;e=(n=e)===null||n===void 0||(n=n.shadowRoot)===null||n===void 0?void 0:n.activeElement}return e},zh=(e,t)=>!!(e.compareDocumentPosition(t)&Cm.DOCUMENT_POSITION_PRECEDING),g7=(e,t)=>!!(e.compareDocumentPosition(t)&Cm.DOCUMENT_POSITION_FOLLOWING),v7=0;class b7{constructor(){fn(this,"id",void 0),this.id="".concat(v7++)}}var Re={androidPendingDiffs:e=>en.get(e),androidScheduleFlush:e=>{var t;(t=Z0.get(e))===null||t===void 0||t()},blur:e=>{var t=Re.toDOMNode(e,e),r=Re.findDocumentOrShadowRoot(e);ho.set(e,!1),r.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,r=Re.findDocumentOrShadowRoot(e),n=qa(r);n&&n.rangeCount>0&&n.removeAllRanges(),t&&_e.deselect(e)},findDocumentOrShadowRoot:e=>{var t=Re.toDOMNode(e,e),r=t.getRootNode();return r instanceof Document||r instanceof ShadowRoot?r:t.ownerDocument},findEventRange:(e,t)=>{"nativeEvent"in t&&(t=t.nativeEvent);var{clientX:r,clientY:n,target:o}=t;if(r==null||n==null)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var a=Re.toSlateNode(e,t.target),u=Re.findPath(e,a);if(at.isElement(a)&&T.isVoid(e,a)){var c=o.getBoundingClientRect(),f=e.isInline(a)?r-c.left<c.left+c.width-r:n-c.top<c.top+c.height-n,d=T.point(e,u,{edge:f?"start":"end"}),m=f?T.before(e,d):T.after(e,d);if(m){var b=T.range(e,m);return b}}var g,{document:w}=Re.getWindow(e);if(w.caretRangeFromPoint)g=w.caretRangeFromPoint(r,n);else{var C=w.caretPositionFromPoint(r,n);C&&(g=w.createRange(),g.setStart(C.offsetNode,C.offset),g.setEnd(C.offsetNode,C.offset))}if(!g)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var D=Re.toSlateRange(e,g,{exactMatch:!1,suppressThrow:!1});return D},findKey:(e,t)=>{var r=bs.get(t);return r||(r=new b7,bs.set(t,r)),r},findPath:(e,t)=>{for(var r=[],n=t;;){var o=Q0.get(n);if(o==null){if(T.isEditor(n))return r;break}var a=X0.get(n);if(a==null)break;r.unshift(a),n=o}throw new Error("Unable to find the path for Slate node: ".concat(Pr.stringify(t)))},focus:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{retries:5};if(!ho.get(e)){if(t.retries<=0)throw new Error("Could not set focus, editor seems stuck with pending operations");if(e.operations.length>0){setTimeout(()=>{Re.focus(e,{retries:t.retries-1})},10);return}var r=Re.toDOMNode(e,e),n=Re.findDocumentOrShadowRoot(e);if(n.activeElement!==r){if(e.selection&&n instanceof Document){var o=qa(n),a=Re.toDOMRange(e,e.selection);o==null||o.removeAllRanges(),o==null||o.addRange(a)}e.selection||_e.select(e,T.start(e,[])),ho.set(e,!0),r.focus({preventScroll:!0})}}},getWindow:e=>{var t=bm.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},hasDOMNode:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{editable:n=!1}=r,o=Re.toDOMNode(e,e),a;try{a=dn(t)?t:t.parentElement}catch(u){if(u instanceof Error&&!u.message.includes('Permission denied to access property "nodeType"'))throw u}return a?a.closest("[data-slate-editor]")===o&&(!n||a.isContentEditable?!0:typeof a.isContentEditable=="boolean"&&a.closest('[contenteditable="false"]')===o||!!a.getAttribute("data-slate-zero-width")):!1},hasEditableTarget:(e,t)=>go(t)&&Re.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:r,focus:n}=t;return T.hasPath(e,r.path)&&T.hasPath(e,n.path)},hasSelectableTarget:(e,t)=>Re.hasEditableTarget(e,t)||Re.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>go(t)&&Re.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!Ao.get(e),isFocused:e=>!!ho.get(e),isReadOnly:e=>!!Xu.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(Xu.get(e))return!1;var r=Re.hasTarget(e,t)&&Re.toSlateNode(e,t);return at.isElement(r)&&T.isVoid(e,r)},setFragmentData:(e,t,r)=>e.setFragmentData(t,r),toDOMNode:(e,t)=>{var r=Ks.get(e),n=T.isEditor(t)?Ui.get(e):r==null?void 0:r.get(Re.findKey(e,t));if(!n)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(Pr.stringify(t)));return n},toDOMPoint:(e,t)=>{var[r]=T.node(e,t.path),n=Re.toDOMNode(e,r),o;T.void(e,{at:t})&&(t={path:t.path,offset:0});for(var a="[data-slate-string], [data-slate-zero-width]",u=Array.from(n.querySelectorAll(a)),c=0,f=0;f<u.length;f++){var d=u[f],m=d.childNodes[0];if(!(m==null||m.textContent==null)){var{length:b}=m.textContent,g=d.getAttribute("data-slate-length"),w=g==null?b:parseInt(g,10),C=c+w,D=u[f+1];if(t.offset===C&&D!==null&&D!==void 0&&D.hasAttribute("data-slate-mark-placeholder")){var p,B=D.childNodes[0];o=[B instanceof s7?B:D,(p=D.textContent)!==null&&p!==void 0&&p.startsWith("\uFEFF")?1:0];break}if(t.offset<=C){var F=Math.min(b,Math.max(0,t.offset-c));o=[m,F];break}c=C}}if(!o)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(Pr.stringify(t)));return o},toDOMRange:(e,t)=>{var{anchor:r,focus:n}=t,o=Ae.isBackward(t),a=Re.toDOMPoint(e,r),u=Ae.isCollapsed(t)?a:Re.toDOMPoint(e,n),c=Re.getWindow(e),f=c.document.createRange(),[d,m]=o?u:a,[b,g]=o?a:u,w=dn(d)?d:d.parentElement,C=!!w.getAttribute("data-slate-zero-width"),D=dn(b)?b:b.parentElement,p=!!D.getAttribute("data-slate-zero-width");return f.setStart(d,C?1:m),f.setEnd(b,p?1:g),f},toSlateNode:(e,t)=>{var r=dn(t)?t:t.parentElement;r&&!r.hasAttribute("data-slate-node")&&(r=r.closest("[data-slate-node]"));var n=r?ni.get(r):null;if(!n)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(r));return n},toSlatePoint:(e,t,r)=>{var{exactMatch:n,suppressThrow:o,searchDirection:a="backward"}=r,[u,c]=n?t:c7(t),f=u.parentNode,d=null,m=0;if(f){var b,g,w=Re.toDOMNode(e,e),C=f.closest('[data-slate-void="true"]'),D=C&&w.contains(C)?C:null,p=f.closest('[contenteditable="false"]'),B=p&&w.contains(p)?p:null,F=f.closest("[data-slate-leaf]"),S=null;if(F){if(d=F.closest('[data-slate-node="text"]'),d){var O=Re.getWindow(e),M=O.document.createRange();M.setStart(d,0),M.setEnd(u,c);var _=M.cloneContents(),z=[...Array.prototype.slice.call(_.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(_.querySelectorAll("[contenteditable=false]"))];z.forEach(ie=>{if(Ur&&!n&&ie.hasAttribute("data-slate-zero-width")&&ie.textContent.length>0&&ie.textContext!=="\uFEFF"){ie.textContent.startsWith("\uFEFF")&&(ie.textContent=ie.textContent.slice(1));return}ie.parentNode.removeChild(ie)}),m=_.textContent.length,S=d}}else if(D){for(var K=D.querySelectorAll("[data-slate-leaf]"),$=0;$<K.length;$++){var Q=K[$];if(Re.hasDOMNode(e,Q)){F=Q;break}}F?(d=F.closest('[data-slate-node="text"]'),S=F,m=S.textContent.length,S.querySelectorAll("[data-slate-zero-width]").forEach(ie=>{m-=ie.textContent.length})):m=1}else if(B){var V=ie=>ie?ie.querySelectorAll("[data-slate-leaf]:not(:scope [data-slate-editor] [data-slate-leaf])"):[],X=B.closest('[data-slate-node="element"]');if(a==="forward"){var G,j=[...V(X),...V(X==null?void 0:X.nextElementSibling)];F=(G=j.find(ie=>g7(B,ie)))!==null&&G!==void 0?G:null}else{var H,U=[...V(X==null?void 0:X.previousElementSibling),...V(X)];F=(H=U.findLast(ie=>zh(B,ie)))!==null&&H!==void 0?H:null}F&&(d=F.closest('[data-slate-node="text"]'),S=F,a==="forward"?m=0:(m=S.textContent.length,S.querySelectorAll("[data-slate-zero-width]").forEach(ie=>{m-=ie.textContent.length})))}S&&m===S.textContent.length&&Ur&&S.getAttribute("data-slate-zero-width")==="z"&&(b=S.textContent)!==null&&b!==void 0&&b.startsWith("\uFEFF")&&(f.hasAttribute("data-slate-zero-width")||Qo&&(g=S.textContent)!==null&&g!==void 0&&g.endsWith(`
104
-
105
- `))&&m--}if(Ur&&!d&&!n){var R=f.hasAttribute("data-slate-node")?f:f.closest("[data-slate-node]");if(R&&Re.hasDOMNode(e,R,{editable:!0})){var te=Re.toSlateNode(e,R),{path:q,offset:se}=T.start(e,Re.findPath(e,te));return R.querySelector("[data-slate-leaf]")||(se=c),{path:q,offset:se}}}if(!d){if(o)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var ye=Re.toSlateNode(e,d),we=Re.findPath(e,ye);return{path:we,offset:m}},toSlateRange:(e,t,r)=>{var n,{exactMatch:o,suppressThrow:a}=r,u=Zu(t)?t.anchorNode:t.startContainer,c,f,d,m,b;if(u)if(Zu(t)){if(Qo&&t.rangeCount>1){d=t.focusNode;var g=t.getRangeAt(0),w=t.getRangeAt(t.rangeCount-1);if(d instanceof HTMLTableRowElement&&g.startContainer instanceof HTMLTableRowElement&&w.startContainer instanceof HTMLTableRowElement){let _=function(z){return z.childElementCount>0?_(z.children[0]):z};var C=g.startContainer,D=w.startContainer,p=_(C.children[g.startOffset]),B=_(D.children[w.startOffset]);m=0,B.childNodes.length>0?c=B.childNodes[0]:c=B,p.childNodes.length>0?d=p.childNodes[0]:d=p,B instanceof HTMLElement?f=B.innerHTML.length:f=0}else g.startContainer===d?(c=w.endContainer,f=w.endOffset,m=g.startOffset):(c=g.startContainer,f=g.endOffset,m=w.startOffset)}else c=t.anchorNode,f=t.anchorOffset,d=t.focusNode,m=t.focusOffset;vm&&d7(c)||Qo?b=t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:b=t.isCollapsed}else c=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset,b=t.collapsed;if(c==null||d==null||f==null||m==null)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));Qo&&(n=d.textContent)!==null&&n!==void 0&&n.endsWith(`
106
-
107
- `)&&m===d.textContent.length&&m--;var F=Re.toSlatePoint(e,[c,f],{exactMatch:o,suppressThrow:a});if(!F)return null;var S=zh(c,d)||c===d&&m<f,O=b?F:Re.toSlatePoint(e,[d,m],{exactMatch:o,suppressThrow:a,searchDirection:S?"forward":"backward"});if(!O)return null;var M={anchor:F,focus:O};return Ae.isExpanded(M)&&Ae.isForward(M)&&dn(d)&&T.void(e,{at:M.focus,mode:"highest"})&&(M=T.unhangRange(e,M,{voids:!0})),M}};function y7(e,t){var{path:r,diff:n}=t;if(!T.hasPath(e,r))return!1;var o=Ye.get(e,r);if(!nt.isText(o))return!1;if(n.start!==o.text.length||n.text.length===0)return o.text.slice(n.start,n.start+n.text.length)===n.text;var a=ae.next(r);if(!T.hasPath(e,a))return!1;var u=Ye.get(e,a);return nt.isText(u)&&u.text.startsWith(n.text)}function km(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.reduce((o,a)=>o.slice(0,a.start)+a.text+o.slice(a.end),e)}function x7(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++)if(e.charAt(n)!==t.charAt(n))return n;return r}function C7(e,t,r){for(var n=Math.min(e.length,t.length,r),o=0;o<n;o++)if(e.charAt(e.length-o-1)!==t.charAt(t.length-o-1))return o;return n}function Sm(e,t){var{start:r,end:n,text:o}=t,a=e.slice(r,n),u=x7(a,o),c=Math.min(a.length-u,o.length-u),f=C7(a,o,c),d={start:r+u,end:n-f,text:o.slice(u,o.length-f)};return d.start===d.end&&d.text.length===0?null:d}function w7(e,t,r){var n=Math.min(t.start,r.start),o=Math.max(0,Math.min(t.start+t.text.length,r.end)-r.start),a=km(e,t,r),u=Math.max(r.start+r.text.length,t.start+t.text.length+(t.start+t.text.length>r.start?r.text.length:0)-o),c=a.slice(n,u),f=Math.max(t.end,r.end-t.text.length+(t.end-t.start));return Sm(e,{start:n,end:f,text:c})}function D7(e){var{path:t,diff:r}=e;return{anchor:{path:t,offset:r.start},focus:{path:t,offset:r.end}}}function Ju(e,t){var{path:r,offset:n}=t;if(!T.hasPath(e,r))return null;var o=Ye.get(e,r);if(!nt.isText(o))return null;var a=T.above(e,{match:c=>at.isElement(c)&&T.isBlock(e,c),at:r});if(!a)return null;for(;n>o.text.length;){var u=T.next(e,{at:r,match:nt.isText});if(!u||!ae.isDescendant(u[1],a[1]))return null;n-=o.text.length,o=u[0],r=u[1]}return{path:r,offset:n}}function jh(e,t){var r=Ju(e,t.anchor);if(!r)return null;if(Ae.isCollapsed(t))return{anchor:r,focus:r};var n=Ju(e,t.focus);return n?{anchor:r,focus:n}:null}function e0(e,t,r){var n=en.get(e),o=n==null?void 0:n.find(m=>{var{path:b}=m;return ae.equals(b,t.path)});if(!o||t.offset<=o.diff.start)return Tt.transform(t,r,{affinity:"backward"});var{diff:a}=o;if(t.offset<=a.start+a.text.length){var u={path:t.path,offset:a.start},c=Tt.transform(u,r,{affinity:"backward"});return c?{path:c.path,offset:c.offset+t.offset-a.start}:null}var f={path:t.path,offset:t.offset-a.text.length+a.end-a.start},d=Tt.transform(f,r,{affinity:"backward"});return d?r.type==="split_node"&&ae.equals(r.path,t.path)&&f.offset<r.position&&a.start<r.position?d:{path:d.path,offset:d.offset+a.text.length-a.end+a.start}:null}function _h(e,t,r){var n=e0(e,t.anchor,r);if(!n)return null;if(Ae.isCollapsed(t))return{anchor:n,focus:n};var o=e0(e,t.focus,r);return o?{anchor:n,focus:o}:null}function E7(e,t){var{path:r,diff:n,id:o}=e;switch(t.type){case"insert_text":return!ae.equals(t.path,r)||t.offset>=n.end?e:t.offset<=n.start?{diff:{start:t.text.length+n.start,end:t.text.length+n.end,text:n.text},id:o,path:r}:{diff:{start:n.start,end:n.end+t.text.length,text:n.text},id:o,path:r};case"remove_text":return!ae.equals(t.path,r)||t.offset>=n.end?e:t.offset+t.text.length<=n.start?{diff:{start:n.start-t.text.length,end:n.end-t.text.length,text:n.text},id:o,path:r}:{diff:{start:n.start,end:n.end-t.text.length,text:n.text},id:o,path:r};case"split_node":return!ae.equals(t.path,r)||t.position>=n.end?{diff:n,id:o,path:ae.transform(r,t,{affinity:"backward"})}:t.position>n.start?{diff:{start:n.start,end:Math.min(t.position,n.end),text:n.text},id:o,path:r}:{diff:{start:n.start-t.position,end:n.end-t.position,text:n.text},id:o,path:ae.transform(r,t,{affinity:"forward"})};case"merge_node":return ae.equals(t.path,r)?{diff:{start:n.start+t.position,end:n.end+t.position,text:n.text},id:o,path:ae.transform(r,t)}:{diff:n,id:o,path:ae.transform(r,t)}}var a=ae.transform(r,t);return a?{diff:n,path:a,id:o}:null}function Lh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ti(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lh(Object(r),!0).forEach(function(n){fn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var k7=25,S7=200,B7=function(){},A7=e=>(e==null?void 0:e.constructor.name)==="DataTransfer";function F7(e){var{editor:t,scheduleOnDOMSelectionChange:r,onDOMSelectionChange:n}=e,o=!1,a=null,u=null,c=null,f=0,d=!1,m=()=>{var X=fo.get(t);if(fo.delete(t),X){var{selection:G}=t,j=jh(t,X);j&&(!G||!Ae.equals(j,G))&&_e.select(t,j)}},b=()=>{var X=co.get(t);if(co.delete(t),!!X){if(X.at){var G=Tt.isPoint(X.at)?Ju(t,X.at):jh(t,X.at);if(!G)return;var j=T.range(t,G);(!t.selection||!Ae.equals(t.selection,j))&&_e.select(t,G)}X.run()}},g=()=>{if(u&&(clearTimeout(u),u=null),c&&(clearTimeout(c),c=null),!O()&&!S()){m();return}o||(o=!0,setTimeout(()=>o=!1)),S()&&(o="action");var X=t.selection&&T.rangeRef(t,t.selection,{affinity:"forward"});Yn.set(t,t.marks),B7("flush",co.get(t),en.get(t));for(var G=O(),j;j=(H=en.get(t))===null||H===void 0?void 0:H[0];){var H,U,R=yn.get(t);R!==void 0&&(yn.delete(t),t.marks=R),R&&d===!1&&(d=null);var te=D7(j);(!t.selection||!Ae.equals(t.selection,te))&&_e.select(t,te),j.diff.text?T.insertText(t,j.diff.text):T.deleteFragment(t),en.set(t,(U=en.get(t))===null||U===void 0?void 0:U.filter(ye=>{var{id:we}=ye;return we!==j.id})),y7(t,j)||(G=!1,co.delete(t),Yn.delete(t),o="action",fo.delete(t),r.cancel(),n.cancel(),X==null||X.unref())}var q=X==null?void 0:X.unref();if(q&&!fo.get(t)&&(!t.selection||!Ae.equals(q,t.selection))&&_e.select(t,q),S()){b();return}G&&r(),r.flush(),n.flush(),m();var se=Yn.get(t);Yn.delete(t),se!==void 0&&(t.marks=se,t.onChange())},w=X=>{a&&clearTimeout(a),a=setTimeout(()=>{Ao.set(t,!1),g()},k7)},C=X=>{Ao.set(t,!0),a&&(clearTimeout(a),a=null)},D=function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,G=Gu.get(t);if(G){if(O()||X){G.style.display="none";return}G.style.removeProperty("display")}},p=(X,G)=>{var j,H=(j=en.get(t))!==null&&j!==void 0?j:[];en.set(t,H);var U=Ye.leaf(t,X),R=H.findIndex(se=>ae.equals(se.path,X));if(R<0){var te=Sm(U.text,G);te&&H.push({path:X,diff:G,id:f++}),D();return}var q=w7(U.text,H[R].diff,G);if(!q){H.splice(R,1),D();return}H[R]=Ti(Ti({},H[R]),{},{diff:q})},B=function(X){var{at:G}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};d=!1,fo.delete(t),r.cancel(),n.cancel(),S()&&g(),co.set(t,{at:G,run:X}),c=setTimeout(g)},F=X=>{var G;if(u&&(clearTimeout(u),u=null),!na.get(t)){var{inputType:j}=X,H=null,U=X.dataTransfer||X.data||void 0;d!==!1&&j!=="insertText"&&j!=="insertCompositionText"&&(d=!1);var[R]=X.getTargetRanges();R&&(H=Re.toSlateRange(t,R,{exactMatch:!1,suppressThrow:!0}));var te=Re.getWindow(t),q=te.getSelection();if(!H&&q&&(R=q,H=Re.toSlateRange(t,q,{exactMatch:!1,suppressThrow:!0})),H=(G=H)!==null&&G!==void 0?G:t.selection,!!H){var se=!0;if(j.startsWith("delete")){if(Ae.isExpanded(H)){var[ye,we]=Ae.edges(H),ie=Ye.leaf(t,ye.path);if(ie.text.length===ye.offset&&we.offset===0){var me=T.next(t,{at:ye.path,match:nt.isText});me&&ae.equals(me[1],we.path)&&(H={anchor:we,focus:we})}}var Oe=j.endsWith("Backward")?"backward":"forward",[ee,pe]=Ae.edges(H),[le,ue]=T.leaf(t,ee.path),De={text:"",start:ee.offset,end:pe.offset},Ce=en.get(t),Ee=Ce==null?void 0:Ce.find(bt=>ae.equals(bt.path,ue)),Fe=Ee?[Ee.diff,De]:[De],Be=km(le.text,...Fe);if(Be.length===0&&(se=!1),Ae.isExpanded(H)){if(se&&ae.equals(H.anchor.path,H.focus.path)){var Ne={path:H.anchor.path,offset:ee.offset},ze=T.range(t,Ne,Ne);return z(ze),p(H.anchor.path,{text:"",end:pe.offset,start:ee.offset})}return B(()=>T.deleteFragment(t,{direction:Oe}),{at:H})}}switch(j){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return B(()=>T.deleteFragment(t),{at:H});case"deleteContent":case"deleteContentForward":{var{anchor:Me}=H;if(se&&Ae.isCollapsed(H)){var Ge=Ye.leaf(t,Me.path);if(Me.offset<Ge.text.length)return p(Me.path,{text:"",start:Me.offset,end:Me.offset+1})}return B(()=>T.deleteForward(t),{at:H})}case"deleteContentBackward":{var dt,{anchor:ut}=H,Pe=Zu(R)?R.isCollapsed:!!((dt=R)!==null&&dt!==void 0&&dt.collapsed);return se&&Pe&&Ae.isCollapsed(H)&&ut.offset>0?p(ut.path,{text:"",start:ut.offset-1,end:ut.offset}):B(()=>T.deleteBackward(t),{at:H})}case"deleteEntireSoftLine":return B(()=>{T.deleteBackward(t,{unit:"line"}),T.deleteForward(t,{unit:"line"})},{at:H});case"deleteHardLineBackward":return B(()=>T.deleteBackward(t,{unit:"block"}),{at:H});case"deleteSoftLineBackward":return B(()=>T.deleteBackward(t,{unit:"line"}),{at:H});case"deleteHardLineForward":return B(()=>T.deleteForward(t,{unit:"block"}),{at:H});case"deleteSoftLineForward":return B(()=>T.deleteForward(t,{unit:"line"}),{at:H});case"deleteWordBackward":return B(()=>T.deleteBackward(t,{unit:"word"}),{at:H});case"deleteWordForward":return B(()=>T.deleteForward(t,{unit:"word"}),{at:H});case"insertLineBreak":return B(()=>T.insertSoftBreak(t),{at:H});case"insertParagraph":return B(()=>T.insertBreak(t),{at:H});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{if(A7(U))return B(()=>Re.insertData(t,U),{at:H});var Le=U??"";if(yn.get(t)&&(Le=Le.replace("\uFEFF","")),j==="insertText"&&/.*\n.*\n$/.test(Le)&&(Le=Le.slice(0,-1)),Le.includes(`
108
- `))return B(()=>{var bt=Le.split(`
109
- `);bt.forEach((ct,rt)=>{ct&&T.insertText(t,ct),rt!==bt.length-1&&T.insertSoftBreak(t)})},{at:H});if(ae.equals(H.anchor.path,H.focus.path)){var[Ve,ft]=Ae.edges(H),Je={start:Ve.offset,end:ft.offset,text:Le};if(Le&&d&&j==="insertCompositionText"){var Xe=d.start+d.text.search(/\S|$/),St=Je.start+Je.text.search(/\S|$/);St===Xe+1&&Je.end===d.start+d.text.length?(Je.start-=1,d=null,Q()):d=!1}else j==="insertText"?d===null?d=Je:d&&Ae.isCollapsed(H)&&d.end+d.text.length===Ve.offset?d=Ti(Ti({},d),{},{text:d.text+Le}):d=!1:d=!1;if(se){p(Ve.path,Je);return}}return B(()=>T.insertText(t,Le),{at:H})}}}}},S=()=>!!co.get(t),O=()=>{var X;return!!((X=en.get(t))!==null&&X!==void 0&&X.length)},M=()=>S()||O(),_=()=>o,z=X=>{fo.set(t,X),u&&(clearTimeout(u),u=null);var{selection:G}=t;if(X){var j=!G||!ae.equals(G.anchor.path,X.anchor.path),H=!G||!ae.equals(G.anchor.path.slice(0,-1),X.anchor.path.slice(0,-1));(j&&d||H)&&(d=!1),(j||O())&&(u=setTimeout(g,S7))}},K=()=>{(S()||!O())&&g()},$=X=>{O()||(D(!0),setTimeout(D))},Q=()=>{S()||(c=setTimeout(g))},V=X=>{if(!(O()||S())&&X.some(j=>ec(t,j,X))){var G;(G=ym.get(t))===null||G===void 0||G()}};return{flush:g,scheduleFlush:Q,hasPendingDiffs:O,hasPendingAction:S,hasPendingChanges:M,isFlushing:_,handleUserSelect:z,handleCompositionEnd:w,handleCompositionStart:C,handleDOMBeforeInput:F,handleKeyDown:$,handleDomMutations:V,handleInput:K}}function N7(){var e=It(!1);return lr(()=>(e.current=!0,()=>{e.current=!1}),[]),e.current}var oi=Vi?b4:lr;function O7(e,t,r){var[n]=Pt(()=>new MutationObserver(t));oi(()=>{n.takeRecords()}),lr(()=>{if(!e.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");return n.observe(e.current,r),()=>n.disconnect()},[n,e,r])}var $7=["node"];function Hh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function T7(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hh(Object(r),!0).forEach(function(n){fn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var M7={subtree:!0,childList:!0,characterData:!0},R7=Ur?e=>{var{node:t}=e,r=ia(e,$7);if(!Ur)return null;var n=yo(),o=N7(),[a]=Pt(()=>F7(T7({editor:n},r)));return O7(t,a.handleDomMutations,M7),Z0.set(n,a.scheduleFlush),o&&a.flush(),a}:()=>null,P7=["anchor","focus"],I7=["anchor","focus"],z7=(e,t)=>Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>t.hasOwnProperty(r)&&e[r]===t[r]),Bm=(e,t)=>{var r=ia(e,P7),n=ia(t,I7);return e[sa]===t[sa]&&z7(r,n)},j7=(e,t)=>{if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++){var n=e[r],o=t[r];if(!Ae.equals(n,o)||!Bm(n,o))return!1}return!0},_7=(e,t)=>{if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++){var n=e[r],o=t[r];if(n.anchor.offset!==o.anchor.offset||n.focus.offset!==o.focus.offset||!Bm(n,o))return!1}return!0};function Kh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function L7(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kh(Object(r),!0).forEach(function(n){fn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var H7=e=>{var{isLast:t,leaf:r,parent:n,text:o}=e,a=yo(),u=Re.findPath(a,o),c=ae.parent(u),f=!!r[xm];return a.isVoid(n)?je.createElement(iu,{length:Ye.string(n).length}):r.text===""&&n.children[n.children.length-1]===o&&!a.isInline(n)&&T.string(a,c)===""?je.createElement(iu,{isLineBreak:!0,isMarkPlaceholder:f}):r.text===""?je.createElement(iu,{isMarkPlaceholder:f}):t&&r.text.slice(-1)===`
110
- `?je.createElement(qh,{isTrailing:!0,text:r.text}):je.createElement(qh,{text:r.text})},qh=e=>{var{text:t,isTrailing:r=!1}=e,n=It(null),o=()=>"".concat(t??"").concat(r?`
111
- `:""),[a]=Pt(o);return oi(()=>{var u=o();n.current&&n.current.textContent!==u&&(n.current.textContent=u)}),je.createElement(K7,{ref:n},a)},K7=C4(vo((e,t)=>je.createElement("span",{"data-slate-string":!0,ref:t},e.children))),iu=e=>{var{length:t=0,isLineBreak:r=!1,isMarkPlaceholder:n=!1}=e,o={"data-slate-zero-width":r?"n":"z","data-slate-length":t};return n&&(o["data-slate-mark-placeholder"]=!0),je.createElement("span",L7({},o),!(Ur||gm)||!r?"\uFEFF":null,r?je.createElement("br",null):null)};function Wh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Am(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wh(Object(r),!0).forEach(function(n){fn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var q7=Ur?300:0;function W7(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}function Vh(e){e.current&&(clearTimeout(e.current),e.current=null)}var V7=e=>{var{leaf:t,isLast:r,text:n,parent:o,renderPlaceholder:a,renderLeaf:u=F=>je.createElement(Y7,Am({},F))}=e,c=yo(),f=It(null),d=It(null),[m,b]=Pt(!1),g=It(null),w=mt(F=>{if(W7(f,F==null),F==null){var S;Gu.delete(c),(S=t.onPlaceholderResize)===null||S===void 0||S.call(t,null)}else{if(Gu.set(c,F),!f.current){var O=window.ResizeObserver||Xy;f.current=new O(()=>{var M;(M=t.onPlaceholderResize)===null||M===void 0||M.call(t,F)})}f.current.observe(F),d.current=F}},[d,t,c]),C=je.createElement(H7,{isLast:r,leaf:t,parent:o,text:n}),D=!!t[sa];if(lr(()=>(D?g.current||(g.current=setTimeout(()=>{b(!0),g.current=null},q7)):(Vh(g),b(!1)),()=>Vh(g)),[D,b]),D&&m){var p={children:t.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:So?"inherit":void 0},contentEditable:!1,ref:w}};C=je.createElement(je.Fragment,null,a(p),C)}var B={"data-slate-leaf":!0};return u({attributes:B,children:C,leaf:t,text:n})},U7=je.memo(V7,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&nt.equals(t.leaf,e.leaf)&&t.leaf[sa]===e.leaf[sa]),Y7=e=>{var{attributes:t,children:r}=e;return je.createElement("span",Am({},t),r)},G7=e=>{for(var{decorations:t,isLast:r,parent:n,renderPlaceholder:o,renderLeaf:a,text:u}=e,c=yo(),f=It(null),d=nt.decorations(u,t),m=Re.findKey(c,u),b=[],g=0;g<d.length;g++){var w=d[g];b.push(je.createElement(U7,{isLast:r&&g===d.length-1,key:"".concat(m.id,"-").concat(g),renderPlaceholder:o,leaf:w,text:u,parent:n,renderLeaf:a}))}var C=mt(D=>{var p=Ks.get(c);D?(p==null||p.set(m,D),$o.set(u,D),ni.set(D,u)):(p==null||p.delete(m),$o.delete(u),f.current&&ni.delete(f.current)),f.current=D},[f,c,m,u]);return je.createElement("span",{"data-slate-node":"text",ref:C},b)},Fm=je.memo(G7,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&_7(t.decorations,e.decorations));function Uh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function t0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Uh(Object(r),!0).forEach(function(n){fn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var X7=e=>{var{decorations:t,element:r,renderElement:n=F=>je.createElement(Z7,t0({},F)),renderPlaceholder:o,renderLeaf:a,selection:u}=e,c=yo(),f=tx(),d=c.isInline(r),m=Re.findKey(c,r),b=mt(F=>{var S=Ks.get(c);F?(S==null||S.set(m,F),$o.set(r,F),ni.set(F,r)):(S==null||S.delete(m),$o.delete(r))},[c,m,r]),g=Om({decorations:t,node:r,renderElement:n,renderPlaceholder:o,renderLeaf:a,selection:u}),w={"data-slate-node":"element",ref:b};if(d&&(w["data-slate-inline"]=!0),!d&&T.hasInlines(c,r)){var C=Ye.string(r),D=am(C);D==="rtl"&&(w.dir=D)}if(T.isVoid(c,r)){w["data-slate-void"]=!0,!f&&d&&(w.contentEditable=!1);var p=d?"span":"div",[[B]]=Ye.texts(r);g=je.createElement(p,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},je.createElement(Fm,{renderPlaceholder:o,decorations:[],isLast:!1,parent:r,text:B})),X0.set(B,0),Q0.set(B,r)}return n({attributes:w,children:g,element:r})},Q7=je.memo(X7,(e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&j7(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&Ae.equals(e.selection,t.selection))),Z7=e=>{var{attributes:t,children:r,element:n}=e,o=yo(),a=o.isInline(n)?"span":"div";return je.createElement(a,t0(t0({},t),{},{style:{position:"relative"}}),r)},Nm=Zn(()=>[]),J7=()=>ii(Nm),ex=Zn(!1),Om=e=>{var{decorations:t,node:r,renderElement:n,renderPlaceholder:o,renderLeaf:a,selection:u}=e,c=J7(),f=yo();na.set(f,!1);for(var d=Re.findPath(f,r),m=[],b=at.isElement(r)&&!f.isInline(r)&&T.hasInlines(f,r),g=0;g<r.children.length;g++){var w=d.concat(g),C=r.children[g],D=Re.findKey(f,C),p=T.range(f,w),B=u&&Ae.intersection(p,u),F=c([C,w]);for(var S of t){var O=Ae.intersection(S,p);O&&F.push(O)}at.isElement(C)?m.push(je.createElement(ex.Provider,{key:"provider-".concat(D.id),value:!!B},je.createElement(Q7,{decorations:F,element:C,key:D.id,renderElement:n,renderPlaceholder:o,renderLeaf:a,selection:B}))):m.push(je.createElement(Fm,{decorations:F,key:D.id,isLast:b&&g===r.children.length-1,parent:r,renderPlaceholder:o,renderLeaf:a,text:C})),X0.set(C,g),Q0.set(C,r)}return m},$m=Zn(!1),tx=()=>ii($m),Tm=Zn(null),Mm=()=>{var e=ii(Tm);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:t}=e;return t};function rx(){var e=yo(),t=It(!1),r=It(0),n=mt(()=>{if(!t.current){t.current=!0;var o=Re.getWindow(e);o.cancelAnimationFrame(r.current),r.current=o.requestAnimationFrame(()=>{t.current=!1})}},[e]);return lr(()=>()=>cancelAnimationFrame(r.current),[]),{receivedUserInput:t,onUserInput:n}}var nx=3,ox={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",insertSoftBreak:"shift+enter",splitBlock:"enter",undo:"mod+z"},ax={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},ix={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},mr=e=>{var t=ox[e],r=ax[e],n=ix[e],o=t&&nu.isHotkey(t),a=r&&nu.isHotkey(r),u=n&&nu.isHotkey(n);return c=>!!(o&&o(c)||Ih&&a&&a(c)||!Ih&&u&&u(c))},br={isBold:mr("bold"),isCompose:mr("compose"),isMoveBackward:mr("moveBackward"),isMoveForward:mr("moveForward"),isDeleteBackward:mr("deleteBackward"),isDeleteForward:mr("deleteForward"),isDeleteLineBackward:mr("deleteLineBackward"),isDeleteLineForward:mr("deleteLineForward"),isDeleteWordBackward:mr("deleteWordBackward"),isDeleteWordForward:mr("deleteWordForward"),isExtendBackward:mr("extendBackward"),isExtendForward:mr("extendForward"),isExtendLineBackward:mr("extendLineBackward"),isExtendLineForward:mr("extendLineForward"),isItalic:mr("italic"),isMoveLineBackward:mr("moveLineBackward"),isMoveLineForward:mr("moveLineForward"),isMoveWordBackward:mr("moveWordBackward"),isMoveWordForward:mr("moveWordForward"),isRedo:mr("redo"),isSoftBreak:mr("insertSoftBreak"),isSplitBlock:mr("splitBlock"),isTransposeCharacter:mr("transposeCharacter"),isUndo:mr("undo")},sx=(e,t)=>{var r=[],n=()=>{r=[]},o=u=>{if(t.current){var c=u.filter(f=>ec(e,f,u));r.push(...c)}};function a(){r.length>0&&(r.reverse().forEach(u=>{u.type!=="characterData"&&(u.removedNodes.forEach(c=>{u.target.insertBefore(c,u.nextSibling)}),u.addedNodes.forEach(c=>{u.target.removeChild(c)}))}),n())}return{registerMutations:o,restoreDOM:a,clear:n}},lx={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class Rm extends x4{constructor(){super(...arguments),fn(this,"context",null),fn(this,"manager",null),fn(this,"mutationObserver",null)}observe(){var t,{node:r}=this.props;if(!r.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");(t=this.mutationObserver)===null||t===void 0||t.observe(r.current,lx)}componentDidMount(){var{receivedUserInput:t}=this.props,r=this.context;this.manager=sx(r,t),this.mutationObserver=new MutationObserver(this.manager.registerMutations),this.observe()}getSnapshotBeforeUpdate(){var t,r,n,o=(t=this.mutationObserver)===null||t===void 0?void 0:t.takeRecords();if(o!=null&&o.length){var a;(a=this.manager)===null||a===void 0||a.registerMutations(o)}return(r=this.mutationObserver)===null||r===void 0||r.disconnect(),(n=this.manager)===null||n===void 0||n.restoreDOM(),null}componentDidUpdate(){var t;(t=this.manager)===null||t===void 0||t.clear(),this.observe()}componentWillUnmount(){var t;(t=this.mutationObserver)===null||t===void 0||t.disconnect()}render(){return this.props.children}}fn(Rm,"contextType",G0);var ux=Ur?Rm:e=>{var{children:t}=e;return je.createElement(je.Fragment,null,t)},cx=Zn(!1),dx=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],fx=["text"];function Yh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Rn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yh(Object(r),!0).forEach(function(n){fn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var hx=e=>je.createElement(je.Fragment,null,Om(e)),su=vo((e,t)=>{var r=mt(ee=>je.createElement(px,Rn({},ee)),[]),{autoFocus:n,decorate:o=mx,onDOMBeforeInput:a,placeholder:u,readOnly:c=!1,renderElement:f,renderLeaf:d,renderPlaceholder:m=r,scrollSelectionIntoView:b=gx,style:g={},as:w="div",disableDefaultStyles:C=!1}=e,D=ia(e,dx),p=Mm(),[B,F]=Pt(!1),S=It(null),O=It([]),[M,_]=Pt(),z=It(!1),{onUserInput:K,receivedUserInput:$}=rx(),[,Q]=y4(ee=>ee+1,0);ym.set(p,Q),Xu.set(p,c);var V=xt(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);lr(()=>{S.current&&n&&S.current.focus()},[n]);var X=It(),G=xt(()=>Sy(()=>{if(na.get(p)){G();return}var ee=Re.toDOMNode(p,p),pe=ee.getRootNode();if(!z.current&&So&&pe instanceof ShadowRoot){z.current=!0;var le=m7();le?document.execCommand("indent"):_e.deselect(p),z.current=!1;return}var ue=X.current;if((Ur||!Re.isComposing(p))&&(!V.isUpdatingSelection||ue!=null&&ue.isFlushing())&&!V.isDraggingInternally){var De=Re.findDocumentOrShadowRoot(p),{activeElement:Ce}=De,Ee=Re.toDOMNode(p,p),Fe=qa(De);if(Ce===Ee?(V.latestElement=Ce,ho.set(p,!0)):ho.delete(p),!Fe)return _e.deselect(p);var{anchorNode:Be,focusNode:Ne}=Fe,ze=Re.hasEditableTarget(p,Be)||Re.isTargetInsideNonReadonlyVoid(p,Be),Me=Re.hasTarget(p,Ne);if(ze&&Me){var Ge=Re.toSlateRange(p,Fe,{exactMatch:!1,suppressThrow:!0});Ge&&(!Re.isComposing(p)&&!(ue!=null&&ue.hasPendingChanges())&&!(ue!=null&&ue.isFlushing())?_e.select(p,Ge):ue==null||ue.handleUserSelect(Ge))}c&&(!ze||!Me)&&_e.deselect(p)}},100),[p,c,V]),j=xt(()=>Dy(G,0),[G]);X.current=R7({node:S,onDOMSelectionChange:G,scheduleOnDOMSelectionChange:j}),oi(()=>{var ee,pe,le;S.current&&(le=J0(S.current))?(bm.set(p,le),Ui.set(p,S.current),$o.set(p,S.current),ni.set(S.current,p)):$o.delete(p);var{selection:ue}=p,De=Re.findDocumentOrShadowRoot(p),Ce=qa(De);if(!(!Ce||!Re.isFocused(p)||(ee=X.current)!==null&&ee!==void 0&&ee.hasPendingAction())){var Ee=ze=>{var Me=Ce.type!=="None";if(!(!ue&&!Me)){var Ge=Ce.focusNode,dt;if(Qo&&Ce.rangeCount>1){var ut=Ce.getRangeAt(0),Pe=Ce.getRangeAt(Ce.rangeCount-1);ut.startContainer===Ge?dt=Pe.endContainer:dt=ut.startContainer}else dt=Ce.anchorNode;var Le=Ui.get(p),Ve=!1;if(Le.contains(dt)&&Le.contains(Ge)&&(Ve=!0),Me&&Ve&&ue&&!ze){var ft=Re.toSlateRange(p,Ce,{exactMatch:!0,suppressThrow:!0});if(ft&&Ae.equals(ft,ue)){var Je;if(!V.hasMarkPlaceholder||(Je=dt)!==null&&Je!==void 0&&(Je=Je.parentElement)!==null&&Je!==void 0&&Je.hasAttribute("data-slate-mark-placeholder"))return}}if(ue&&!Re.hasRange(p,ue)){p.selection=Re.toSlateRange(p,Ce,{exactMatch:!1,suppressThrow:!0});return}V.isUpdatingSelection=!0;var Xe=ue&&Re.toDOMRange(p,ue);return Xe?(Re.isComposing(p)&&!Ur?Ce.collapseToEnd():Ae.isBackward(ue)?Ce.setBaseAndExtent(Xe.endContainer,Xe.endOffset,Xe.startContainer,Xe.startOffset):Ce.setBaseAndExtent(Xe.startContainer,Xe.startOffset,Xe.endContainer,Xe.endOffset),b(p,Xe)):Ce.removeAllRanges(),Xe}};Ce.rangeCount<=1&&Ee();var Fe=((pe=X.current)===null||pe===void 0?void 0:pe.isFlushing())==="action";if(!Ur||!Fe){setTimeout(()=>{V.isUpdatingSelection=!1});return}var Be=null,Ne=requestAnimationFrame(()=>{if(Fe){var ze=Me=>{try{var Ge=Re.toDOMNode(p,p);Ge.focus(),Ee(Me)}catch{}};ze(),Be=setTimeout(()=>{ze(!0),V.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(Ne),Be&&clearTimeout(Be)}}});var H=mt(ee=>{var pe=Re.toDOMNode(p,p),le=pe.getRootNode();if(z!=null&&z.current&&So&&le instanceof ShadowRoot){var ue=ee.getTargetRanges(),De=ue[0],Ce=new window.Range;Ce.setStart(De.startContainer,De.startOffset),Ce.setEnd(De.endContainer,De.endOffset);var Ee=Re.toSlateRange(p,Ce,{exactMatch:!1,suppressThrow:!1});_e.select(p,Ee),ee.preventDefault(),ee.stopImmediatePropagation();return}if(K(),!c&&Re.hasEditableTarget(p,ee.target)&&!vx(ee,a)){var Fe;if(X.current)return X.current.handleDOMBeforeInput(ee);j.flush(),G.flush();var{selection:Be}=p,{inputType:Ne}=ee,ze=ee.dataTransfer||ee.data||void 0,Me=Ne==="insertCompositionText"||Ne==="deleteCompositionText";if(Me&&Re.isComposing(p))return;var Ge=!1;if(Ne==="insertText"&&Be&&Ae.isCollapsed(Be)&&ee.data&&ee.data.length===1&&/[a-z ]/i.test(ee.data)&&Be.anchor.offset!==0&&(Ge=!0,p.marks&&(Ge=!1),!na.get(p))){var dt,ut,{anchor:Pe}=Be,[Le,Ve]=Re.toDOMPoint(p,Pe),ft=(dt=Le.parentElement)===null||dt===void 0?void 0:dt.closest("a"),Je=Re.getWindow(p);if(Ge&&ft&&Re.hasDOMNode(p,ft)){var Xe,St=Je==null?void 0:Je.document.createTreeWalker(ft,NodeFilter.SHOW_TEXT).lastChild();St===Le&&((Xe=St.textContent)===null||Xe===void 0?void 0:Xe.length)===Ve&&(Ge=!1)}if(Ge&&Le.parentElement&&(Je==null||(ut=Je.getComputedStyle(Le.parentElement))===null||ut===void 0?void 0:ut.whiteSpace)==="pre"){var bt=T.above(p,{at:Pe.path,match:yt=>at.isElement(yt)&&T.isBlock(p,yt)});bt&&Ye.string(bt[0]).includes(" ")&&(Ge=!1)}}if((!Ne.startsWith("delete")||Ne.startsWith("deleteBy"))&&!na.get(p)){var[ct]=ee.getTargetRanges();if(ct){var rt=Re.toSlateRange(p,ct,{exactMatch:!1,suppressThrow:!1});if(!Be||!Ae.equals(Be,rt)){Ge=!1;var $e=!Me&&p.selection&&T.rangeRef(p,p.selection);_e.select(p,rt),$e&&Ka.set(p,$e)}}}if(Me)return;if(Ge||ee.preventDefault(),Be&&Ae.isExpanded(Be)&&Ne.startsWith("delete")){var de=Ne.endsWith("Backward")?"backward":"forward";T.deleteFragment(p,{direction:de});return}switch(Ne){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":{T.deleteFragment(p);break}case"deleteContent":case"deleteContentForward":{T.deleteForward(p);break}case"deleteContentBackward":{T.deleteBackward(p);break}case"deleteEntireSoftLine":{T.deleteBackward(p,{unit:"line"}),T.deleteForward(p,{unit:"line"});break}case"deleteHardLineBackward":{T.deleteBackward(p,{unit:"block"});break}case"deleteSoftLineBackward":{T.deleteBackward(p,{unit:"line"});break}case"deleteHardLineForward":{T.deleteForward(p,{unit:"block"});break}case"deleteSoftLineForward":{T.deleteForward(p,{unit:"line"});break}case"deleteWordBackward":{T.deleteBackward(p,{unit:"word"});break}case"deleteWordForward":{T.deleteForward(p,{unit:"word"});break}case"insertLineBreak":T.insertSoftBreak(p);break;case"insertParagraph":{T.insertBreak(p);break}case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{Ne==="insertFromComposition"&&Re.isComposing(p)&&(F(!1),Ao.set(p,!1)),(ze==null?void 0:ze.constructor.name)==="DataTransfer"?Re.insertData(p,ze):typeof ze=="string"&&(Ge?O.current.push(()=>T.insertText(p,ze)):T.insertText(p,ze));break}}var it=(Fe=Ka.get(p))===null||Fe===void 0?void 0:Fe.unref();Ka.delete(p),it&&(!p.selection||!Ae.equals(p.selection,it))&&_e.select(p,it)}},[p,G,K,a,c,j]),U=mt(ee=>{ee==null?(G.cancel(),j.cancel(),Ui.delete(p),$o.delete(p),S.current&&io&&S.current.removeEventListener("beforeinput",H)):io&&ee.addEventListener("beforeinput",H),S.current=ee,typeof t=="function"?t(ee):t&&(t.current=ee)},[G,j,p,H,t]);oi(()=>{var ee=Re.getWindow(p);ee.document.addEventListener("selectionchange",j);var pe=()=>{V.isDraggingInternally=!1};return ee.document.addEventListener("dragend",pe),ee.document.addEventListener("drop",pe),()=>{ee.document.removeEventListener("selectionchange",j),ee.document.removeEventListener("dragend",pe),ee.document.removeEventListener("drop",pe)}},[j,V]);var R=o([p,[]]),te=u&&p.children.length===1&&Array.from(Ye.texts(p)).length===1&&Ye.string(p)===""&&!B,q=mt(ee=>{if(ee&&te){var pe;_((pe=ee.getBoundingClientRect())===null||pe===void 0?void 0:pe.height)}else _(void 0)},[te]);if(te){var se=T.start(p,[]);R.push({[sa]:!0,placeholder:u,onPlaceholderResize:q,anchor:se,focus:se})}var{marks:ye}=p;if(V.hasMarkPlaceholder=!1,p.selection&&Ae.isCollapsed(p.selection)&&ye){var{anchor:we}=p.selection,ie=Ye.leaf(p,we.path),me=ia(ie,fx);if(!nt.equals(ie,ye,{loose:!0})){V.hasMarkPlaceholder=!0;var Oe=Object.fromEntries(Object.keys(me).map(ee=>[ee,null]));R.push(Rn(Rn(Rn({[xm]:!0},Oe),ye),{},{anchor:we,focus:we}))}}return lr(()=>{setTimeout(()=>{var{selection:ee}=p;if(ee){var{anchor:pe}=ee,le=Ye.leaf(p,pe.path);if(ye&&!nt.equals(le,ye,{loose:!0})){yn.set(p,ye);return}}yn.delete(p)})}),je.createElement($m.Provider,{value:c},je.createElement(cx.Provider,{value:B},je.createElement(Nm.Provider,{value:o},je.createElement(ux,{node:S,receivedUserInput:$},je.createElement(w,Rn(Rn({role:c?void 0:"textbox","aria-multiline":c?void 0:!0},D),{},{spellCheck:io||!Vi?D.spellCheck:!1,autoCorrect:io||!Vi?D.autoCorrect:"false",autoCapitalize:io||!Vi?D.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!c,zindex:-1,suppressContentEditableWarning:!0,ref:U,style:Rn(Rn({},C?{}:Rn({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},M?{minHeight:M}:{})),g),onBeforeInput:mt(ee=>{if(!io&&!c&&!Vr(ee,D.onBeforeInput)&&Re.hasSelectableTarget(p,ee.target)&&(ee.preventDefault(),!Re.isComposing(p))){var pe=ee.data;T.insertText(p,pe)}},[D.onBeforeInput,p,c]),onInput:mt(ee=>{if(!Vr(ee,D.onInput)){if(X.current){X.current.handleInput();return}for(var pe of O.current)pe();if(O.current=[],!Re.isFocused(p)){var le=ee.nativeEvent,ue=p;if(le.inputType==="historyUndo"&&typeof ue.undo=="function"){ue.undo();return}if(le.inputType==="historyRedo"&&typeof ue.redo=="function"){ue.redo();return}}}},[D.onInput,p]),onBlur:mt(ee=>{if(!(c||V.isUpdatingSelection||!Re.hasSelectableTarget(p,ee.target)||Vr(ee,D.onBlur))){var pe=Re.findDocumentOrShadowRoot(p);if(V.latestElement!==pe.activeElement){var{relatedTarget:le}=ee,ue=Re.toDOMNode(p,p);if(le!==ue&&!(dn(le)&&le.hasAttribute("data-slate-spacer"))){if(le!=null&&go(le)&&Re.hasDOMNode(p,le)){var De=Re.toSlateNode(p,le);if(at.isElement(De)&&!p.isVoid(De))return}if(So){var Ce=qa(pe);Ce==null||Ce.removeAllRanges()}ho.delete(p)}}}},[c,V.isUpdatingSelection,V.latestElement,p,D.onBlur]),onClick:mt(ee=>{if(Re.hasTarget(p,ee.target)&&!Vr(ee,D.onClick)&&go(ee.target)){var pe=Re.toSlateNode(p,ee.target),le=Re.findPath(p,pe);if(!T.hasPath(p,le)||Ye.get(p,le)!==pe)return;if(ee.detail===nx&&le.length>=1){var ue=le;if(!(at.isElement(pe)&&T.isBlock(p,pe))){var De,Ce=T.above(p,{match:Ge=>at.isElement(Ge)&&T.isBlock(p,Ge),at:le});ue=(De=Ce==null?void 0:Ce[1])!==null&&De!==void 0?De:le.slice(0,1)}var Ee=T.range(p,ue);_e.select(p,Ee);return}if(c)return;var Fe=T.start(p,le),Be=T.end(p,le),Ne=T.void(p,{at:Fe}),ze=T.void(p,{at:Be});if(Ne&&ze&&ae.equals(Ne[1],ze[1])){var Me=T.range(p,Fe);_e.select(p,Me)}}},[p,D.onClick,c]),onCompositionEnd:mt(ee=>{if(Re.hasSelectableTarget(p,ee.target)){var pe;if(Re.isComposing(p)&&Promise.resolve().then(()=>{F(!1),Ao.set(p,!1)}),(pe=X.current)===null||pe===void 0||pe.handleCompositionEnd(ee),Vr(ee,D.onCompositionEnd)||Ur)return;if(!So&&!o7&&!gm&&!i7&&!a7&&ee.data){var le=yn.get(p);yn.delete(p),le!==void 0&&(Yn.set(p,p.marks),p.marks=le),T.insertText(p,ee.data);var ue=Yn.get(p);Yn.delete(p),ue!==void 0&&(p.marks=ue)}}},[D.onCompositionEnd,p]),onCompositionUpdate:mt(ee=>{Re.hasSelectableTarget(p,ee.target)&&!Vr(ee,D.onCompositionUpdate)&&(Re.isComposing(p)||(F(!0),Ao.set(p,!0)))},[D.onCompositionUpdate,p]),onCompositionStart:mt(ee=>{if(Re.hasSelectableTarget(p,ee.target)){var pe;if((pe=X.current)===null||pe===void 0||pe.handleCompositionStart(ee),Vr(ee,D.onCompositionStart)||Ur)return;F(!0);var{selection:le}=p;if(le&&Ae.isExpanded(le)){T.deleteFragment(p);return}}},[D.onCompositionStart,p]),onCopy:mt(ee=>{Re.hasSelectableTarget(p,ee.target)&&!Vr(ee,D.onCopy)&&!Gh(ee)&&(ee.preventDefault(),Re.setFragmentData(p,ee.clipboardData,"copy"))},[D.onCopy,p]),onCut:mt(ee=>{if(!c&&Re.hasSelectableTarget(p,ee.target)&&!Vr(ee,D.onCut)&&!Gh(ee)){ee.preventDefault(),Re.setFragmentData(p,ee.clipboardData,"cut");var{selection:pe}=p;if(pe)if(Ae.isExpanded(pe))T.deleteFragment(p);else{var le=Ye.parent(p,pe.anchor.path);T.isVoid(p,le)&&_e.delete(p)}}},[c,p,D.onCut]),onDragOver:mt(ee=>{if(Re.hasTarget(p,ee.target)&&!Vr(ee,D.onDragOver)){var pe=Re.toSlateNode(p,ee.target);at.isElement(pe)&&T.isVoid(p,pe)&&ee.preventDefault()}},[D.onDragOver,p]),onDragStart:mt(ee=>{if(!c&&Re.hasTarget(p,ee.target)&&!Vr(ee,D.onDragStart)){var pe=Re.toSlateNode(p,ee.target),le=Re.findPath(p,pe),ue=at.isElement(pe)&&T.isVoid(p,pe)||T.void(p,{at:le,voids:!0});if(ue){var De=T.range(p,le);_e.select(p,De)}V.isDraggingInternally=!0,Re.setFragmentData(p,ee.dataTransfer,"drag")}},[c,p,D.onDragStart,V]),onDrop:mt(ee=>{if(!c&&Re.hasTarget(p,ee.target)&&!Vr(ee,D.onDrop)){ee.preventDefault();var pe=p.selection,le=Re.findEventRange(p,ee),ue=ee.dataTransfer;_e.select(p,le),V.isDraggingInternally&&pe&&!Ae.equals(pe,le)&&!T.void(p,{at:le,voids:!0})&&_e.delete(p,{at:pe}),Re.insertData(p,ue),Re.isFocused(p)||Re.focus(p)}},[c,p,D.onDrop,V]),onDragEnd:mt(ee=>{!c&&V.isDraggingInternally&&D.onDragEnd&&Re.hasTarget(p,ee.target)&&D.onDragEnd(ee)},[c,V,D,p]),onFocus:mt(ee=>{if(!c&&!V.isUpdatingSelection&&Re.hasEditableTarget(p,ee.target)&&!Vr(ee,D.onFocus)){var pe=Re.toDOMNode(p,p),le=Re.findDocumentOrShadowRoot(p);if(V.latestElement=le.activeElement,Qo&&ee.target!==pe){pe.focus();return}ho.set(p,!0)}},[c,V,p,D.onFocus]),onKeyDown:mt(ee=>{if(!c&&Re.hasEditableTarget(p,ee.target)){var pe;(pe=X.current)===null||pe===void 0||pe.handleKeyDown(ee);var{nativeEvent:le}=ee;if(Re.isComposing(p)&&le.isComposing===!1&&(Ao.set(p,!1),F(!1)),Vr(ee,D.onKeyDown)||Re.isComposing(p))return;var{selection:ue}=p,De=p.children[ue!==null?ue.focus.path[0]:0],Ce=am(Ye.string(De))==="rtl";if(br.isRedo(le)){ee.preventDefault();var Ee=p;typeof Ee.redo=="function"&&Ee.redo();return}if(br.isUndo(le)){ee.preventDefault();var Fe=p;typeof Fe.undo=="function"&&Fe.undo();return}if(br.isMoveLineBackward(le)){ee.preventDefault(),_e.move(p,{unit:"line",reverse:!0});return}if(br.isMoveLineForward(le)){ee.preventDefault(),_e.move(p,{unit:"line"});return}if(br.isExtendLineBackward(le)){ee.preventDefault(),_e.move(p,{unit:"line",edge:"focus",reverse:!0});return}if(br.isExtendLineForward(le)){ee.preventDefault(),_e.move(p,{unit:"line",edge:"focus"});return}if(br.isMoveBackward(le)){ee.preventDefault(),ue&&Ae.isCollapsed(ue)?_e.move(p,{reverse:!Ce}):_e.collapse(p,{edge:Ce?"end":"start"});return}if(br.isMoveForward(le)){ee.preventDefault(),ue&&Ae.isCollapsed(ue)?_e.move(p,{reverse:Ce}):_e.collapse(p,{edge:Ce?"start":"end"});return}if(br.isMoveWordBackward(le)){ee.preventDefault(),ue&&Ae.isExpanded(ue)&&_e.collapse(p,{edge:"focus"}),_e.move(p,{unit:"word",reverse:!Ce});return}if(br.isMoveWordForward(le)){ee.preventDefault(),ue&&Ae.isExpanded(ue)&&_e.collapse(p,{edge:"focus"}),_e.move(p,{unit:"word",reverse:Ce});return}if(io){if((vm||So)&&ue&&(br.isDeleteBackward(le)||br.isDeleteForward(le))&&Ae.isCollapsed(ue)){var Be=Ye.parent(p,ue.anchor.path);if(at.isElement(Be)&&T.isVoid(p,Be)&&(T.isInline(p,Be)||T.isBlock(p,Be))){ee.preventDefault(),T.deleteBackward(p,{unit:"block"});return}}}else{if(br.isBold(le)||br.isItalic(le)||br.isTransposeCharacter(le)){ee.preventDefault();return}if(br.isSoftBreak(le)){ee.preventDefault(),T.insertSoftBreak(p);return}if(br.isSplitBlock(le)){ee.preventDefault(),T.insertBreak(p);return}if(br.isDeleteBackward(le)){ee.preventDefault(),ue&&Ae.isExpanded(ue)?T.deleteFragment(p,{direction:"backward"}):T.deleteBackward(p);return}if(br.isDeleteForward(le)){ee.preventDefault(),ue&&Ae.isExpanded(ue)?T.deleteFragment(p,{direction:"forward"}):T.deleteForward(p);return}if(br.isDeleteLineBackward(le)){ee.preventDefault(),ue&&Ae.isExpanded(ue)?T.deleteFragment(p,{direction:"backward"}):T.deleteBackward(p,{unit:"line"});return}if(br.isDeleteLineForward(le)){ee.preventDefault(),ue&&Ae.isExpanded(ue)?T.deleteFragment(p,{direction:"forward"}):T.deleteForward(p,{unit:"line"});return}if(br.isDeleteWordBackward(le)){ee.preventDefault(),ue&&Ae.isExpanded(ue)?T.deleteFragment(p,{direction:"backward"}):T.deleteBackward(p,{unit:"word"});return}if(br.isDeleteWordForward(le)){ee.preventDefault(),ue&&Ae.isExpanded(ue)?T.deleteFragment(p,{direction:"forward"}):T.deleteForward(p,{unit:"word"});return}}}},[c,p,D.onKeyDown]),onPaste:mt(ee=>{!c&&Re.hasEditableTarget(p,ee.target)&&!Vr(ee,D.onPaste)&&(!io||u7(ee.nativeEvent)||So)&&(ee.preventDefault(),Re.insertData(p,ee.clipboardData))},[c,p,D.onPaste])}),je.createElement(hx,{decorations:R,node:p,renderElement:f,renderPlaceholder:m,renderLeaf:d,selection:p.selection}))))))}),px=e=>{var{attributes:t,children:r}=e;return je.createElement("span",Rn({},t),r,Ur&&je.createElement("br",null))},mx=()=>[],gx=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&Ae.isCollapsed(e.selection))){var r=t.startContainer.parentElement;r.getBoundingClientRect=t.getBoundingClientRect.bind(t),Fy(r,{scrollMode:"if-needed"}),delete r.getBoundingClientRect}},Vr=(e,t)=>{if(!t)return!1;var r=t(e);return r??(e.isDefaultPrevented()||e.isPropagationStopped())},Gh=e=>go(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),vx=(e,t)=>{if(!t)return!1;var r=t(e);return r??e.defaultPrevented},bx=Zn(!1),yx=Zn({});function xx(e){var t=It([]).current,r=It({editor:e}).current,n=mt(a=>{r.editor=a,t.forEach(u=>u(a))},[t,r]),o=xt(()=>({getSlate:()=>r.editor,addEventListener:a=>(t.push(a),()=>{t.splice(t.indexOf(a),1)})}),[t,r]);return{selectorContext:o,onChange:n}}var Cx=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],lu=e=>{var{editor:t,children:r,onChange:n,onSelectionChange:o,onValueChange:a,initialValue:u}=e,c=ia(e,Cx),[f,d]=je.useState(()=>{if(!Ye.isNodeList(u))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(Pr.stringify(u)));if(!T.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(Pr.stringify(t)));return t.children=u,Object.assign(t,c),{v:0,editor:t}}),{selectorContext:m,onChange:b}=xx(t),g=mt(D=>{var p;switch(n&&n(t.children),D==null||(p=D.operation)===null||p===void 0?void 0:p.type){case"set_selection":o==null||o(t.selection);break;default:a==null||a(t.children)}d(B=>({v:B.v+1,editor:t})),b(t)},[t,b,n,o,a]);lr(()=>(Qu.set(t,g),()=>{Qu.set(t,()=>{})}),[t,g]);var[w,C]=Pt(Re.isFocused(t));return lr(()=>{C(Re.isFocused(t))},[t]),oi(()=>{var D=()=>C(Re.isFocused(t));return mm>=17?(document.addEventListener("focusin",D),document.addEventListener("focusout",D),()=>{document.removeEventListener("focusin",D),document.removeEventListener("focusout",D)}):(document.addEventListener("focus",D,!0),document.addEventListener("blur",D,!0),()=>{document.removeEventListener("focus",D,!0),document.removeEventListener("blur",D,!0)})},[]),je.createElement(yx.Provider,{value:m},je.createElement(Tm.Provider,{value:f},je.createElement(G0.Provider,{value:f.editor},je.createElement(bx.Provider,{value:w},r))))},Xh=(e,t)=>{var r=(t.top+t.bottom)/2;return e.top<=r&&e.bottom>=r},Qh=(e,t,r)=>{var n=Re.toDOMRange(e,t).getBoundingClientRect(),o=Re.toDOMRange(e,r).getBoundingClientRect();return Xh(n,o)&&Xh(o,n)},wx=(e,t)=>{var r=T.range(e,Ae.end(t)),n=Array.from(T.positions(e,{at:t})),o=0,a=n.length,u=Math.floor(a/2);if(Qh(e,T.range(e,n[o]),r))return T.range(e,n[o],r);if(n.length<2)return T.range(e,n[n.length-1],r);for(;u!==n.length&&u!==o;)Qh(e,T.range(e,n[u]),r)?a=u:o=u,u=Math.floor((o+a)/2);return T.range(e,n[a],r)};function Zh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Jh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zh(Object(r),!0).forEach(function(n){fn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Dx=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x-slate-fragment",r=e,{apply:n,onChange:o,deleteBackward:a,addMark:u,removeMark:c}=r;return Ks.set(r,new WeakMap),r.addMark=(f,d)=>{var m,b;(m=Z0.get(r))===null||m===void 0||m(),!yn.get(r)&&(b=en.get(r))!==null&&b!==void 0&&b.length&&yn.set(r,null),Yn.delete(r),u(f,d)},r.removeMark=f=>{var d;!yn.get(r)&&(d=en.get(r))!==null&&d!==void 0&&d.length&&yn.set(r,null),Yn.delete(r),c(f)},r.deleteBackward=f=>{if(f!=="line")return a(f);if(r.selection&&Ae.isCollapsed(r.selection)){var d=T.above(r,{match:w=>at.isElement(w)&&T.isBlock(r,w),at:r.selection});if(d){var[,m]=d,b=T.range(r,m,r.selection.anchor),g=wx(r,b);Ae.isCollapsed(g)||_e.delete(r,{at:g})}}},r.apply=f=>{var d=[],m=[],b=en.get(r);if(b!=null&&b.length){var g=b.map(G=>E7(G,f)).filter(Boolean);en.set(r,g)}var w=fo.get(r);w&&fo.set(r,_h(r,w,f));var C=co.get(r);if(C!=null&&C.at){var D=Tt.isPoint(C==null?void 0:C.at)?e0(r,C.at,f):_h(r,C.at,f);co.set(r,D?Jh(Jh({},C),{},{at:D}):null)}switch(f.type){case"insert_text":case"remove_text":case"set_node":case"split_node":{d.push(...Uo(r,f.path));break}case"set_selection":{var p;(p=Ka.get(r))===null||p===void 0||p.unref(),Ka.delete(r);break}case"insert_node":case"remove_node":{d.push(...Uo(r,ae.parent(f.path)));break}case"merge_node":{var B=ae.previous(f.path);d.push(...Uo(r,B));break}case"move_node":{var F=ae.common(ae.parent(f.path),ae.parent(f.newPath));d.push(...Uo(r,F));var S;ae.isBefore(f.path,f.newPath)?(d.push(...Uo(r,ae.parent(f.path))),S=f.newPath):(d.push(...Uo(r,ae.parent(f.newPath))),S=f.path);var O=Ye.get(e,ae.parent(S)),M=Re.findKey(r,O),_=T.pathRef(r,ae.parent(S));m.push([_,M]);break}}switch(n(f),f.type){case"insert_node":case"remove_node":case"merge_node":case"move_node":case"split_node":na.set(r,!0)}for(var[z,K]of d){var[$]=T.node(r,z);bs.set($,K)}for(var[Q,V]of m){if(Q.current){var[X]=T.node(r,Q.current);bs.set(X,V)}Q.unref()}},r.setFragmentData=f=>{var{selection:d}=r;if(d){var[m,b]=Ae.edges(d),g=T.void(r,{at:m.path}),w=T.void(r,{at:b.path});if(!(Ae.isCollapsed(d)&&!g)){var C=Re.toDOMRange(r,d),D=C.cloneContents(),p=D.childNodes[0];if(D.childNodes.forEach($=>{$.textContent&&$.textContent.trim()!==""&&(p=$)}),w){var[B]=w,F=C.cloneRange(),S=Re.toDOMNode(r,B);F.setEndAfter(S),D=F.cloneContents()}if(g&&(p=D.querySelector("[data-slate-spacer]")),Array.from(D.querySelectorAll("[data-slate-zero-width]")).forEach($=>{var Q=$.getAttribute("data-slate-zero-width")==="n";$.textContent=Q?`
112
- `:""}),wm(p)){var O=p.ownerDocument.createElement("span");O.style.whiteSpace="pre",O.appendChild(p),D.appendChild(O),p=O}var M=r.getFragment(),_=JSON.stringify(M),z=window.btoa(encodeURIComponent(_));p.setAttribute("data-slate-fragment",z),f.setData("application/".concat(t),z);var K=D.ownerDocument.createElement("div");return K.appendChild(D),K.setAttribute("hidden","true"),D.ownerDocument.body.appendChild(K),f.setData("text/html",K.innerHTML),f.setData("text/plain",Em(K)),D.ownerDocument.body.removeChild(K),f}}},r.insertData=f=>{r.insertFragmentData(f)||r.insertTextData(f)},r.insertFragmentData=f=>{var d=f.getData("application/".concat(t))||p7(f);if(d){var m=decodeURIComponent(window.atob(d)),b=JSON.parse(m);return r.insertFragment(b),!0}return!1},r.insertTextData=f=>{var d=f.getData("text/plain");if(d){var m=d.split(/\r\n|\r|\n/),b=!1;for(var g of m)b&&_e.splitNodes(r,{always:!0}),r.insertText(g),b=!0;return!0}return!1},r.onChange=f=>{var d=mm<18?wu.unstable_batchedUpdates:m=>m();d(()=>{var m=Qu.get(r);m&&m(f),o(f)})},r},Uo=(e,t)=>{var r=[];for(var[n,o]of T.levels(e,{at:t})){var a=Re.findKey(e,n);r.push([o,a])}return r};function tc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lo=tc();function Pm(e){Lo=e}var Wa={exec:()=>null};function Xt(e,t=""){let r=typeof e=="string"?e:e.source;const n={replace:(o,a)=>{let u=typeof a=="string"?a:a.source;return u=u.replace(Yr.caret,"$1"),r=r.replace(o,u),n},getRegex:()=>new RegExp(r,t)};return n}var Yr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Ex=/^(?:[ \t]*(?:\n|$))+/,kx=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Sx=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bx=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,rc=/(?:[*+-]|\d{1,9}[.)])/,Im=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zm=Xt(Im).replace(/bull/g,rc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ax=Xt(Im).replace(/bull/g,rc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Fx=/^[^\n]+/,oc=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Nx=Xt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",oc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ox=Xt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,rc).getRegex(),qs="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ac=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$x=Xt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ac).replace("tag",qs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jm=Xt(nc).replace("hr",fi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qs).getRegex(),Tx=Xt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jm).getRegex(),ic={blockquote:Tx,code:kx,def:Nx,fences:Sx,heading:Bx,hr:fi,html:$x,lheading:zm,list:Ox,newline:Ex,paragraph:jm,table:Wa,text:Fx},ep=Xt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qs).getRegex(),Mx={...ic,lheading:Ax,table:ep,paragraph:Xt(nc).replace("hr",fi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ep).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qs).getRegex()},Rx={...ic,html:Xt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ac).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Wa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Xt(nc).replace("hr",fi).replace("heading",` *#{1,6} *[^
113
- ]`).replace("lheading",zm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Px=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ix=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_m=/^( {2,}|\\)\n(?!\s*$)/,zx=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ws=/[\p{P}\p{S}]/u,sc=/[\s\p{P}\p{S}]/u,Lm=/[^\s\p{P}\p{S}]/u,jx=Xt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sc).getRegex(),Hm=/(?!~)[\p{P}\p{S}]/u,_x=/(?!~)[\s\p{P}\p{S}]/u,Lx=/(?:[^\s\p{P}\p{S}]|~)/u,Hx=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Km=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Kx=Xt(Km,"u").replace(/punct/g,Ws).getRegex(),qx=Xt(Km,"u").replace(/punct/g,Hm).getRegex(),qm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Wx=Xt(qm,"gu").replace(/notPunctSpace/g,Lm).replace(/punctSpace/g,sc).replace(/punct/g,Ws).getRegex(),Vx=Xt(qm,"gu").replace(/notPunctSpace/g,Lx).replace(/punctSpace/g,_x).replace(/punct/g,Hm).getRegex(),Ux=Xt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Lm).replace(/punctSpace/g,sc).replace(/punct/g,Ws).getRegex(),Yx=Xt(/\\(punct)/,"gu").replace(/punct/g,Ws).getRegex(),Gx=Xt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Xx=Xt(ac).replace("(?:-->|$)","-->").getRegex(),Qx=Xt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Xx).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ys=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Zx=Xt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ys).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Wm=Xt(/^!?\[(label)\]\[(ref)\]/).replace("label",ys).replace("ref",oc).getRegex(),Vm=Xt(/^!?\[(ref)\](?:\[\])?/).replace("ref",oc).getRegex(),Jx=Xt("reflink|nolink(?!\\()","g").replace("reflink",Wm).replace("nolink",Vm).getRegex(),lc={_backpedal:Wa,anyPunctuation:Yx,autolink:Gx,blockSkip:Hx,br:_m,code:Ix,del:Wa,emStrongLDelim:Kx,emStrongRDelimAst:Wx,emStrongRDelimUnd:Ux,escape:Px,link:Zx,nolink:Vm,punctuation:jx,reflink:Wm,reflinkSearch:Jx,tag:Qx,text:zx,url:Wa},e9={...lc,link:Xt(/^!?\[(label)\]\((.*?)\)/).replace("label",ys).getRegex(),reflink:Xt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ys).getRegex()},r0={...lc,emStrongRDelimAst:Vx,emStrongLDelim:qx,url:Xt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},t9={...r0,br:Xt(_m).replace("{2,}","*").getRegex(),text:Xt(r0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Mi={normal:ic,gfm:Mx,pedantic:Rx},Ta={normal:lc,gfm:r0,breaks:t9,pedantic:e9},r9={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tp=e=>r9[e];function Pn(e,t){if(t){if(Yr.escapeTest.test(e))return e.replace(Yr.escapeReplace,tp)}else if(Yr.escapeTestNoEncode.test(e))return e.replace(Yr.escapeReplaceNoEncode,tp);return e}function rp(e){try{e=encodeURI(e).replace(Yr.percentDecode,"%")}catch{return null}return e}function np(e,t){var a;const r=e.replace(Yr.findPipe,(u,c,f)=>{let d=!1,m=c;for(;--m>=0&&f[m]==="\\";)d=!d;return d?"|":" |"}),n=r.split(Yr.splitPipe);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(Yr.slashPipe,"|");return n}function Ma(e,t,r){const n=e.length;if(n===0)return"";let o=0;for(;o<n&&e.charAt(n-o-1)===t;)o++;return e.slice(0,n-o)}function n9(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function op(e,t,r,n,o){const a=t.href,u=t.title||null,c=e[1].replace(o.other.outputLinkReplace,"$1");n.state.inLink=!0;const f={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:u,text:c,tokens:n.inlineTokens(c)};return n.state.inLink=!1,f}function o9(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(n===null)return t;const o=n[1];return t.split(`
114
- `).map(a=>{const u=a.match(r.other.beginningSpace);if(u===null)return a;const[c]=u;return c.length>=o.length?a.slice(o.length):a}).join(`
115
- `)}var xs=class{constructor(e){sr(this,"options"),sr(this,"rules"),sr(this,"lexer"),this.options=e||Lo}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Ma(r,`
116
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=o9(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){const n=Ma(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ma(t[0],`
117
- `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=Ma(t[0],`
118
- `).split(`
119
- `),n="",o="";const a=[];for(;r.length>0;){let u=!1;const c=[];let f;for(f=0;f<r.length;f++)if(this.rules.other.blockquoteStart.test(r[f]))c.push(r[f]),u=!0;else if(!u)c.push(r[f]);else break;r=r.slice(f);const d=c.join(`
120
- `),m=d.replace(this.rules.other.blockquoteSetextReplace,`
121
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
122
- ${d}`:d,o=o?`${o}
123
- ${m}`:m;const b=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(m,a,!0),this.lexer.state.top=b,r.length===0)break;const g=a.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){const w=g,C=w.raw+`
124
- `+r.join(`
125
- `),D=this.blockquote(C);a[a.length-1]=D,n=n.substring(0,n.length-w.raw.length)+D.raw,o=o.substring(0,o.length-w.text.length)+D.text;break}else if((g==null?void 0:g.type)==="list"){const w=g,C=w.raw+`
126
- `+r.join(`
127
- `),D=this.list(C);a[a.length-1]=D,n=n.substring(0,n.length-g.raw.length)+D.raw,o=o.substring(0,o.length-w.raw.length)+D.raw,r=C.substring(a.at(-1).raw.length).split(`
128
- `);continue}}return{type:"blockquote",raw:n,tokens:a,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,o={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const a=this.rules.other.listItemRegex(r);let u=!1;for(;e;){let f=!1,d="",m="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let b=t[2].split(`
129
- `,1)[0].replace(this.rules.other.listReplaceTabs,B=>" ".repeat(3*B.length)),g=e.split(`
130
- `,1)[0],w=!b.trim(),C=0;if(this.options.pedantic?(C=2,m=b.trimStart()):w?C=t[1].length+1:(C=t[2].search(this.rules.other.nonSpaceChar),C=C>4?1:C,m=b.slice(C),C+=t[1].length),w&&this.rules.other.blankLine.test(g)&&(d+=g+`
131
- `,e=e.substring(g.length+1),f=!0),!f){const B=this.rules.other.nextBulletRegex(C),F=this.rules.other.hrRegex(C),S=this.rules.other.fencesBeginRegex(C),O=this.rules.other.headingBeginRegex(C),M=this.rules.other.htmlBeginRegex(C);for(;e;){const _=e.split(`
132
- `,1)[0];let z;if(g=_,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),z=g):z=g.replace(this.rules.other.tabCharGlobal," "),S.test(g)||O.test(g)||M.test(g)||B.test(g)||F.test(g))break;if(z.search(this.rules.other.nonSpaceChar)>=C||!g.trim())m+=`
133
- `+z.slice(C);else{if(w||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(b)||O.test(b)||F.test(b))break;m+=`
134
- `+g}!w&&!g.trim()&&(w=!0),d+=_+`
135
- `,e=e.substring(_.length+1),b=z.slice(C)}}o.loose||(u?o.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(u=!0));let D=null,p;this.options.gfm&&(D=this.rules.other.listIsTask.exec(m),D&&(p=D[0]!=="[ ] ",m=m.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:d,task:!!D,checked:p,loose:!1,text:m,tokens:[]}),o.raw+=d}const c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let f=0;f<o.items.length;f++)if(this.lexer.state.top=!1,o.items[f].tokens=this.lexer.blockTokens(o.items[f].text,[]),!o.loose){const d=o.items[f].tokens.filter(b=>b.type==="space"),m=d.length>0&&d.some(b=>this.rules.other.anyLine.test(b.raw));o.loose=m}if(o.loose)for(let f=0;f<o.items.length;f++)o.items[f].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:o}}}table(e){var u;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const r=np(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(u=t[3])!=null&&u.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
136
- `):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const c of n)this.rules.other.tableAlignRight.test(c)?a.align.push("right"):this.rules.other.tableAlignCenter.test(c)?a.align.push("center"):this.rules.other.tableAlignLeft.test(c)?a.align.push("left"):a.align.push(null);for(let c=0;c<r.length;c++)a.header.push({text:r[c],tokens:this.lexer.inline(r[c]),header:!0,align:a.align[c]});for(const c of o)a.rows.push(np(c,a.header.length).map((f,d)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:a.align[d]})));return a}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)===`
137
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const a=Ma(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{const a=n9(t[2],"()");if(a===-2)return;if(a>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let n=t[2],o="";if(this.options.pedantic){const a=this.rules.other.pedanticHrefTitle.exec(n);a&&(n=a[1],o=a[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),op(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[n.toLowerCase()];if(!o){const a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return op(r,o,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){const o=[...n[0]].length-1;let a,u,c=o,f=0;const d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+o);(n=d.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(u=[...a].length,n[3]||n[4]){c+=u;continue}else if((n[5]||n[6])&&o%3&&!((o+u)%3)){f+=u;continue}if(c-=u,c>0)continue;u=Math.min(u,u+c+f);const m=[...n[0]][0].length,b=e.slice(0,o+n.index+m+u);if(Math.min(o,u)%2){const w=b.slice(1,-1);return{type:"em",raw:b,text:w,tokens:this.lexer.inlineTokens(w)}}const g=b.slice(2,-2);return{type:"strong",raw:b,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){var r;let t;if(t=this.rules.inline.url.exec(e)){let n,o;if(t[2]==="@")n=t[0],o="mailto:"+n;else{let a;do a=t[0],t[0]=((r=this.rules.inline._backpedal.exec(t[0]))==null?void 0:r[0])??"";while(a!==t[0]);n=t[0],t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},Gn=class n0{constructor(t){sr(this,"tokens"),sr(this,"options"),sr(this,"state"),sr(this,"tokenizer"),sr(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Lo,this.options.tokenizer=this.options.tokenizer||new xs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:Yr,block:Mi.normal,inline:Ta.normal};this.options.pedantic?(r.block=Mi.pedantic,r.inline=Ta.pedantic):this.options.gfm&&(r.block=Mi.gfm,this.options.breaks?r.inline=Ta.breaks:r.inline=Ta.gfm),this.tokenizer.rules=r}static get rules(){return{block:Mi,inline:Ta}}static lex(t,r){return new n0(r).lex(t)}static lexInline(t,r){return new n0(r).inlineTokens(t)}lex(t){t=t.replace(Yr.carriageReturn,`
138
- `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){var o,a,u;for(this.options.pedantic&&(t=t.replace(Yr.tabCharGlobal," ").replace(Yr.spaceLine,""));t;){let c;if((a=(o=this.options.extensions)==null?void 0:o.block)!=null&&a.some(d=>(c=d.call({lexer:this},t,r))?(t=t.substring(c.raw.length),r.push(c),!0):!1))continue;if(c=this.tokenizer.space(t)){t=t.substring(c.raw.length);const d=r.at(-1);c.raw.length===1&&d!==void 0?d.raw+=`
139
- `:r.push(c);continue}if(c=this.tokenizer.code(t)){t=t.substring(c.raw.length);const d=r.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=`
140
- `+c.raw,d.text+=`
141
- `+c.text,this.inlineQueue.at(-1).src=d.text):r.push(c);continue}if(c=this.tokenizer.fences(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.heading(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.hr(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.blockquote(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.list(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.html(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.def(t)){t=t.substring(c.raw.length);const d=r.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=`
142
- `+c.raw,d.text+=`
143
- `+c.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title});continue}if(c=this.tokenizer.table(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.lheading(t)){t=t.substring(c.raw.length),r.push(c);continue}let f=t;if((u=this.options.extensions)!=null&&u.startBlock){let d=1/0;const m=t.slice(1);let b;this.options.extensions.startBlock.forEach(g=>{b=g.call({lexer:this},m),typeof b=="number"&&b>=0&&(d=Math.min(d,b))}),d<1/0&&d>=0&&(f=t.substring(0,d+1))}if(this.state.top&&(c=this.tokenizer.paragraph(f))){const d=r.at(-1);n&&(d==null?void 0:d.type)==="paragraph"?(d.raw+=`
144
- `+c.raw,d.text+=`
145
- `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):r.push(c),n=f.length!==t.length,t=t.substring(c.raw.length);continue}if(c=this.tokenizer.text(t)){t=t.substring(c.raw.length);const d=r.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=`
146
- `+c.raw,d.text+=`
147
- `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):r.push(c);continue}if(t){const d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var c,f,d;let n=t,o=null;if(this.tokens.links){const m=Object.keys(this.tokens.links);if(m.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)m.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,o.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,u="";for(;t;){a||(u=""),a=!1;let m;if((f=(c=this.options.extensions)==null?void 0:c.inline)!=null&&f.some(g=>(m=g.call({lexer:this},t,r))?(t=t.substring(m.raw.length),r.push(m),!0):!1))continue;if(m=this.tokenizer.escape(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.tag(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.link(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(m.raw.length);const g=r.at(-1);m.type==="text"&&(g==null?void 0:g.type)==="text"?(g.raw+=m.raw,g.text+=m.text):r.push(m);continue}if(m=this.tokenizer.emStrong(t,n,u)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.codespan(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.br(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.del(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.autolink(t)){t=t.substring(m.raw.length),r.push(m);continue}if(!this.state.inLink&&(m=this.tokenizer.url(t))){t=t.substring(m.raw.length),r.push(m);continue}let b=t;if((d=this.options.extensions)!=null&&d.startInline){let g=1/0;const w=t.slice(1);let C;this.options.extensions.startInline.forEach(D=>{C=D.call({lexer:this},w),typeof C=="number"&&C>=0&&(g=Math.min(g,C))}),g<1/0&&g>=0&&(b=t.substring(0,g+1))}if(m=this.tokenizer.inlineText(b)){t=t.substring(m.raw.length),m.raw.slice(-1)!=="_"&&(u=m.raw.slice(-1)),a=!0;const g=r.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=m.raw,g.text+=m.text):r.push(m);continue}if(t){const g="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return r}},Cs=class{constructor(e){sr(this,"options"),sr(this,"parser"),this.options=e||Lo}space(e){return""}code({text:e,lang:t,escaped:r}){var a;const n=(a=(t||"").match(Yr.notSpaceStart))==null?void 0:a[0],o=e.replace(Yr.endingNewline,"")+`
148
- `;return n?'<pre><code class="language-'+Pn(n)+'">'+(r?o:Pn(o,!0))+`</code></pre>
149
- `:"<pre><code>"+(r?o:Pn(o,!0))+`</code></pre>
150
- `}blockquote({tokens:e}){return`<blockquote>
151
- ${this.parser.parse(e)}</blockquote>
152
- `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
153
- `}hr(e){return`<hr>
154
- `}list(e){const t=e.ordered,r=e.start;let n="";for(let u=0;u<e.items.length;u++){const c=e.items[u];n+=this.listitem(c)}const o=t?"ol":"ul",a=t&&r!==1?' start="'+r+'"':"";return"<"+o+a+`>
155
- `+n+"</"+o+`>
156
- `}listitem(e){var r;let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?((r=e.tokens[0])==null?void 0:r.type)==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+Pn(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
157
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
158
- `}table(e){let t="",r="";for(let o=0;o<e.header.length;o++)r+=this.tablecell(e.header[o]);t+=this.tablerow({text:r});let n="";for(let o=0;o<e.rows.length;o++){const a=e.rows[o];r="";for(let u=0;u<a.length;u++)r+=this.tablecell(a[u]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
159
- <thead>
160
- `+t+`</thead>
161
- `+n+`</table>
162
- `}tablerow({text:e}){return`<tr>
163
- ${e}</tr>
164
- `}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
165
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Pn(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),o=rp(e);if(o===null)return n;e=o;let a='<a href="'+e+'"';return t&&(a+=' title="'+Pn(t)+'"'),a+=">"+n+"</a>",a}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));const o=rp(e);if(o===null)return Pn(r);e=o;let a=`<img src="${e}" alt="${r}"`;return t&&(a+=` title="${Pn(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Pn(e.text)}},uc=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Xn=class o0{constructor(t){sr(this,"options"),sr(this,"renderer"),sr(this,"textRenderer"),this.options=t||Lo,this.options.renderer=this.options.renderer||new Cs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new uc}static parse(t,r){return new o0(r).parse(t)}static parseInline(t,r){return new o0(r).parseInline(t)}parse(t,r=!0){var o,a;let n="";for(let u=0;u<t.length;u++){const c=t[u];if((a=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&a[c.type]){const d=c,m=this.options.extensions.renderers[d.type].call({parser:this},d);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)){n+=m||"";continue}}const f=c;switch(f.type){case"space":{n+=this.renderer.space(f);continue}case"hr":{n+=this.renderer.hr(f);continue}case"heading":{n+=this.renderer.heading(f);continue}case"code":{n+=this.renderer.code(f);continue}case"table":{n+=this.renderer.table(f);continue}case"blockquote":{n+=this.renderer.blockquote(f);continue}case"list":{n+=this.renderer.list(f);continue}case"html":{n+=this.renderer.html(f);continue}case"paragraph":{n+=this.renderer.paragraph(f);continue}case"text":{let d=f,m=this.renderer.text(d);for(;u+1<t.length&&t[u+1].type==="text";)d=t[++u],m+=`
166
- `+this.renderer.text(d);r?n+=this.renderer.paragraph({type:"paragraph",raw:m,text:m,tokens:[{type:"text",raw:m,text:m,escaped:!0}]}):n+=m;continue}default:{const d='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(t,r=this.renderer){var o,a;let n="";for(let u=0;u<t.length;u++){const c=t[u];if((a=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&a[c.type]){const d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){n+=d||"";continue}}const f=c;switch(f.type){case"escape":{n+=r.text(f);break}case"html":{n+=r.html(f);break}case"link":{n+=r.link(f);break}case"image":{n+=r.image(f);break}case"strong":{n+=r.strong(f);break}case"em":{n+=r.em(f);break}case"codespan":{n+=r.codespan(f);break}case"br":{n+=r.br(f);break}case"del":{n+=r.del(f);break}case"text":{n+=r.text(f);break}default:{const d='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}},uu,Yi=(uu=class{constructor(e){sr(this,"options"),sr(this,"block"),this.options=e||Lo}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Gn.lex:Gn.lexInline}provideParser(){return this.block?Xn.parse:Xn.parseInline}},sr(uu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),uu),a9=class{constructor(...e){sr(this,"defaults",tc()),sr(this,"options",this.setOptions),sr(this,"parse",this.parseMarkdown(!0)),sr(this,"parseInline",this.parseMarkdown(!1)),sr(this,"Parser",Xn),sr(this,"Renderer",Cs),sr(this,"TextRenderer",uc),sr(this,"Lexer",Gn),sr(this,"Tokenizer",xs),sr(this,"Hooks",Yi),this.use(...e)}walkTokens(e,t){var n,o;let r=[];for(const a of e)switch(r=r.concat(t.call(this,a)),a.type){case"table":{const u=a;for(const c of u.header)r=r.concat(this.walkTokens(c.tokens,t));for(const c of u.rows)for(const f of c)r=r.concat(this.walkTokens(f.tokens,t));break}case"list":{const u=a;r=r.concat(this.walkTokens(u.items,t));break}default:{const u=a;(o=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&o[u.type]?this.defaults.extensions.childTokens[u.type].forEach(c=>{const f=u[c].flat(1/0);r=r.concat(this.walkTokens(f,t))}):u.tokens&&(r=r.concat(this.walkTokens(u.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const a=t.renderers[o.name];a?t.renderers[o.name]=function(...u){let c=o.renderer.apply(this,u);return c===!1&&(c=a.apply(this,u)),c}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const a=t[o.level];a?a.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=this.defaults.renderer||new Cs(this.defaults);for(const a in r.renderer){if(!(a in o))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;const u=a,c=r.renderer[u],f=o[u];o[u]=(...d)=>{let m=c.apply(o,d);return m===!1&&(m=f.apply(o,d)),m||""}}n.renderer=o}if(r.tokenizer){const o=this.defaults.tokenizer||new xs(this.defaults);for(const a in r.tokenizer){if(!(a in o))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const u=a,c=r.tokenizer[u],f=o[u];o[u]=(...d)=>{let m=c.apply(o,d);return m===!1&&(m=f.apply(o,d)),m}}n.tokenizer=o}if(r.hooks){const o=this.defaults.hooks||new Yi;for(const a in r.hooks){if(!(a in o))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;const u=a,c=r.hooks[u],f=o[u];Yi.passThroughHooks.has(a)?o[u]=d=>{if(this.defaults.async)return Promise.resolve(c.call(o,d)).then(b=>f.call(o,b));const m=c.call(o,d);return f.call(o,m)}:o[u]=(...d)=>{let m=c.apply(o,d);return m===!1&&(m=f.apply(o,d)),m}}n.hooks=o}if(r.walkTokens){const o=this.defaults.walkTokens,a=r.walkTokens;n.walkTokens=function(u){let c=[];return c.push(a.call(this,u)),o&&(c=c.concat(o.call(this,u))),c}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Gn.lex(e,t??this.defaults)}parser(e,t){return Xn.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{const n={...r},o={...this.defaults,...n},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const u=o.hooks?o.hooks.provideLexer():e?Gn.lex:Gn.lexInline,c=o.hooks?o.hooks.provideParser():e?Xn.parse:Xn.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(t):t).then(f=>u(f,o)).then(f=>o.hooks?o.hooks.processAllTokens(f):f).then(f=>o.walkTokens?Promise.all(this.walkTokens(f,o.walkTokens)).then(()=>f):f).then(f=>c(f,o)).then(f=>o.hooks?o.hooks.postprocess(f):f).catch(a);try{o.hooks&&(t=o.hooks.preprocess(t));let f=u(t,o);o.hooks&&(f=o.hooks.processAllTokens(f)),o.walkTokens&&this.walkTokens(f,o.walkTokens);let d=c(f,o);return o.hooks&&(d=o.hooks.postprocess(d)),d}catch(f){return a(f)}}}onError(e,t){return r=>{if(r.message+=`
167
- Please report this to https://github.com/markedjs/marked.`,e){const n="<p>An error occurred:</p><pre>"+Pn(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},_o=new a9;function Wt(e,t){return _o.parse(e,t)}Wt.options=Wt.setOptions=function(e){return _o.setOptions(e),Wt.defaults=_o.defaults,Pm(Wt.defaults),Wt};Wt.getDefaults=tc;Wt.defaults=Lo;Wt.use=function(...e){return _o.use(...e),Wt.defaults=_o.defaults,Pm(Wt.defaults),Wt};Wt.walkTokens=function(e,t){return _o.walkTokens(e,t)};Wt.parseInline=_o.parseInline;Wt.Parser=Xn;Wt.parser=Xn.parse;Wt.Renderer=Cs;Wt.TextRenderer=uc;Wt.Lexer=Gn;Wt.lexer=Gn.lex;Wt.Tokenizer=xs;Wt.Hooks=Yi;Wt.parse=Wt;Wt.options;Wt.setOptions;Wt.use;Wt.walkTokens;Wt.parseInline;Xn.parse;Gn.lex;var rn=function(){return rn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},rn.apply(this,arguments)};function ws(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var fr="-ms-",Va="-moz-",Gt="-webkit-",Um="comm",Vs="rule",cc="decl",i9="@import",Ym="@keyframes",s9="@layer",Gm=Math.abs,dc=String.fromCharCode,a0=Object.assign;function l9(e,t){return Rr(e,0)^45?(((t<<2^Rr(e,0))<<2^Rr(e,1))<<2^Rr(e,2))<<2^Rr(e,3):0}function Xm(e){return e.trim()}function Un(e,t){return(e=t.exec(e))?e[0]:e}function Nt(e,t,r){return e.replace(t,r)}function Gi(e,t,r){return e.indexOf(t,r)}function Rr(e,t){return e.charCodeAt(t)|0}function la(e,t,r){return e.slice(t,r)}function In(e){return e.length}function Qm(e){return e.length}function Ia(e,t){return t.push(e),e}function u9(e,t){return e.map(t).join("")}function ap(e,t){return e.filter(function(r){return!Un(r,t)})}var Us=1,ua=1,Zm=0,hn=0,Ar=0,xa="";function Ys(e,t,r,n,o,a,u,c){return{value:e,root:t,parent:r,type:n,props:o,children:a,line:Us,column:ua,length:u,return:"",siblings:c}}function lo(e,t){return a0(Ys("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Yo(e){for(;e.root;)e=lo(e.root,{children:[e]});Ia(e,e.siblings)}function c9(){return Ar}function d9(){return Ar=hn>0?Rr(xa,--hn):0,ua--,Ar===10&&(ua=1,Us--),Ar}function Cn(){return Ar=hn<Zm?Rr(xa,hn++):0,ua++,Ar===10&&(ua=1,Us++),Ar}function To(){return Rr(xa,hn)}function Xi(){return hn}function Gs(e,t){return la(xa,e,t)}function i0(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function f9(e){return Us=ua=1,Zm=In(xa=e),hn=0,[]}function h9(e){return xa="",e}function cu(e){return Xm(Gs(hn-1,s0(e===91?e+2:e===40?e+1:e)))}function p9(e){for(;(Ar=To())&&Ar<33;)Cn();return i0(e)>2||i0(Ar)>3?"":" "}function m9(e,t){for(;--t&&Cn()&&!(Ar<48||Ar>102||Ar>57&&Ar<65||Ar>70&&Ar<97););return Gs(e,Xi()+(t<6&&To()==32&&Cn()==32))}function s0(e){for(;Cn();)switch(Ar){case e:return hn;case 34:case 39:e!==34&&e!==39&&s0(Ar);break;case 40:e===41&&s0(e);break;case 92:Cn();break}return hn}function g9(e,t){for(;Cn()&&e+Ar!==57&&!(e+Ar===84&&To()===47););return"/*"+Gs(t,hn-1)+"*"+dc(e===47?e:Cn())}function v9(e){for(;!i0(To());)Cn();return Gs(e,hn)}function b9(e){return h9(Qi("",null,null,null,[""],e=f9(e),0,[0],e))}function Qi(e,t,r,n,o,a,u,c,f){for(var d=0,m=0,b=u,g=0,w=0,C=0,D=1,p=1,B=1,F=0,S="",O=o,M=a,_=n,z=S;p;)switch(C=F,F=Cn()){case 40:if(C!=108&&Rr(z,b-1)==58){Gi(z+=Nt(cu(F),"&","&\f"),"&\f",Gm(d?c[d-1]:0))!=-1&&(B=-1);break}case 34:case 39:case 91:z+=cu(F);break;case 9:case 10:case 13:case 32:z+=p9(C);break;case 92:z+=m9(Xi()-1,7);continue;case 47:switch(To()){case 42:case 47:Ia(y9(g9(Cn(),Xi()),t,r,f),f);break;default:z+="/"}break;case 123*D:c[d++]=In(z)*B;case 125*D:case 59:case 0:switch(F){case 0:case 125:p=0;case 59+m:B==-1&&(z=Nt(z,/\f/g,"")),w>0&&In(z)-b&&Ia(w>32?sp(z+";",n,r,b-1,f):sp(Nt(z," ","")+";",n,r,b-2,f),f);break;case 59:z+=";";default:if(Ia(_=ip(z,t,r,d,m,o,c,S,O=[],M=[],b,a),a),F===123)if(m===0)Qi(z,t,_,_,O,a,b,c,M);else switch(g===99&&Rr(z,3)===110?100:g){case 100:case 108:case 109:case 115:Qi(e,_,_,n&&Ia(ip(e,_,_,0,0,o,c,S,o,O=[],b,M),M),o,M,b,c,n?O:M);break;default:Qi(z,_,_,_,[""],M,0,c,M)}}d=m=w=0,D=B=1,S=z="",b=u;break;case 58:b=1+In(z),w=C;default:if(D<1){if(F==123)--D;else if(F==125&&D++==0&&d9()==125)continue}switch(z+=dc(F),F*D){case 38:B=m>0?1:(z+="\f",-1);break;case 44:c[d++]=(In(z)-1)*B,B=1;break;case 64:To()===45&&(z+=cu(Cn())),g=To(),m=b=In(S=z+=v9(Xi())),F++;break;case 45:C===45&&In(z)==2&&(D=0)}}return a}function ip(e,t,r,n,o,a,u,c,f,d,m,b){for(var g=o-1,w=o===0?a:[""],C=Qm(w),D=0,p=0,B=0;D<n;++D)for(var F=0,S=la(e,g+1,g=Gm(p=u[D])),O=e;F<C;++F)(O=Xm(p>0?w[F]+" "+S:Nt(S,/&\f/g,w[F])))&&(f[B++]=O);return Ys(e,t,r,o===0?Vs:c,f,d,m,b)}function y9(e,t,r,n){return Ys(e,t,r,Um,dc(c9()),la(e,2,-2),0,n)}function sp(e,t,r,n,o){return Ys(e,t,r,cc,la(e,0,n),la(e,n+1,-1),n,o)}function Jm(e,t,r){switch(l9(e,t)){case 5103:return Gt+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Gt+e+e;case 4789:return Va+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Gt+e+Va+e+fr+e+e;case 5936:switch(Rr(e,t+11)){case 114:return Gt+e+fr+Nt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Gt+e+fr+Nt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Gt+e+fr+Nt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Gt+e+fr+e+e;case 6165:return Gt+e+fr+"flex-"+e+e;case 5187:return Gt+e+Nt(e,/(\w+).+(:[^]+)/,Gt+"box-$1$2"+fr+"flex-$1$2")+e;case 5443:return Gt+e+fr+"flex-item-"+Nt(e,/flex-|-self/g,"")+(Un(e,/flex-|baseline/)?"":fr+"grid-row-"+Nt(e,/flex-|-self/g,""))+e;case 4675:return Gt+e+fr+"flex-line-pack"+Nt(e,/align-content|flex-|-self/g,"")+e;case 5548:return Gt+e+fr+Nt(e,"shrink","negative")+e;case 5292:return Gt+e+fr+Nt(e,"basis","preferred-size")+e;case 6060:return Gt+"box-"+Nt(e,"-grow","")+Gt+e+fr+Nt(e,"grow","positive")+e;case 4554:return Gt+Nt(e,/([^-])(transform)/g,"$1"+Gt+"$2")+e;case 6187:return Nt(Nt(Nt(e,/(zoom-|grab)/,Gt+"$1"),/(image-set)/,Gt+"$1"),e,"")+e;case 5495:case 3959:return Nt(e,/(image-set\([^]*)/,Gt+"$1$`$1");case 4968:return Nt(Nt(e,/(.+:)(flex-)?(.*)/,Gt+"box-pack:$3"+fr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Gt+e+e;case 4200:if(!Un(e,/flex-|baseline/))return fr+"grid-column-align"+la(e,t)+e;break;case 2592:case 3360:return fr+Nt(e,"template-","")+e;case 4384:case 3616:return r&&r.some(function(n,o){return t=o,Un(n.props,/grid-\w+-end/)})?~Gi(e+(r=r[t].value),"span",0)?e:fr+Nt(e,"-start","")+e+fr+"grid-row-span:"+(~Gi(r,"span",0)?Un(r,/\d+/):+Un(r,/\d+/)-+Un(e,/\d+/))+";":fr+Nt(e,"-start","")+e;case 4896:case 4128:return r&&r.some(function(n){return Un(n.props,/grid-\w+-start/)})?e:fr+Nt(Nt(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Nt(e,/(.+)-inline(.+)/,Gt+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(In(e)-1-t>6)switch(Rr(e,t+1)){case 109:if(Rr(e,t+4)!==45)break;case 102:return Nt(e,/(.+:)(.+)-([^]+)/,"$1"+Gt+"$2-$3$1"+Va+(Rr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Gi(e,"stretch",0)?Jm(Nt(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return Nt(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,o,a,u,c,f,d){return fr+o+":"+a+d+(u?fr+o+"-span:"+(c?f:+f-+a)+d:"")+e});case 4949:if(Rr(e,t+6)===121)return Nt(e,":",":"+Gt)+e;break;case 6444:switch(Rr(e,Rr(e,14)===45?18:11)){case 120:return Nt(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Gt+(Rr(e,14)===45?"inline-":"")+"box$3$1"+Gt+"$2$3$1"+fr+"$2box$3")+e;case 100:return Nt(e,":",":"+fr)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Nt(e,"scroll-","scroll-snap-")+e}return e}function Ds(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function x9(e,t,r,n){switch(e.type){case s9:if(e.children.length)break;case i9:case cc:return e.return=e.return||e.value;case Um:return"";case Ym:return e.return=e.value+"{"+Ds(e.children,n)+"}";case Vs:if(!In(e.value=e.props.join(",")))return""}return In(r=Ds(e.children,n))?e.return=e.value+"{"+r+"}":""}function C9(e){var t=Qm(e);return function(r,n,o,a){for(var u="",c=0;c<t;c++)u+=e[c](r,n,o,a)||"";return u}}function w9(e){return function(t){t.root||(t=t.return)&&e(t)}}function D9(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case cc:e.return=Jm(e.value,e.length,r);return;case Ym:return Ds([lo(e,{value:Nt(e.value,"@","@"+Gt)})],n);case Vs:if(e.length)return u9(r=e.props,function(o){switch(Un(o,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Yo(lo(e,{props:[Nt(o,/:(read-\w+)/,":"+Va+"$1")]})),Yo(lo(e,{props:[o]})),a0(e,{props:ap(r,n)});break;case"::placeholder":Yo(lo(e,{props:[Nt(o,/:(plac\w+)/,":"+Gt+"input-$1")]})),Yo(lo(e,{props:[Nt(o,/:(plac\w+)/,":"+Va+"$1")]})),Yo(lo(e,{props:[Nt(o,/:(plac\w+)/,fr+"input-$1")]})),Yo(lo(e,{props:[o]})),a0(e,{props:ap(r,n)});break}return""})}}var E9={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ca=typeof process<"u"&&an!==void 0&&(an.REACT_APP_SC_ATTR||an.SC_ATTR)||"data-styled",eg="active",tg="data-styled-version",Xs="6.1.19",fc=`/*!sc*/
168
- `,Es=typeof window<"u"&&typeof document<"u",k9=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&an!==void 0&&an.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&an.REACT_APP_SC_DISABLE_SPEEDY!==""?an.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&an.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&an!==void 0&&an.SC_DISABLE_SPEEDY!==void 0&&an.SC_DISABLE_SPEEDY!==""&&an.SC_DISABLE_SPEEDY!=="false"&&an.SC_DISABLE_SPEEDY),Qs=Object.freeze([]),da=Object.freeze({});function S9(e,t,r){return r===void 0&&(r=da),e.theme!==r.theme&&e.theme||t||r.theme}var rg=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),B9=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,A9=/(^-|-$)/g;function lp(e){return e.replace(B9,"-").replace(A9,"")}var F9=/(a)(d)/gi,Ri=52,up=function(e){return String.fromCharCode(e+(e>25?39:97))};function l0(e){var t,r="";for(t=Math.abs(e);t>Ri;t=t/Ri|0)r=up(t%Ri)+r;return(up(t%Ri)+r).replace(F9,"$1-$2")}var du,ng=5381,Zo=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},og=function(e){return Zo(ng,e)};function N9(e){return l0(og(e)>>>0)}function O9(e){return e.displayName||e.name||"Component"}function fu(e){return typeof e=="string"&&!0}var ag=typeof Symbol=="function"&&Symbol.for,ig=ag?Symbol.for("react.memo"):60115,$9=ag?Symbol.for("react.forward_ref"):60112,T9={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},M9={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},sg={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},R9=((du={})[$9]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},du[ig]=sg,du);function cp(e){return("type"in(t=e)&&t.type.$$typeof)===ig?sg:"$$typeof"in e?R9[e.$$typeof]:T9;var t}var P9=Object.defineProperty,I9=Object.getOwnPropertyNames,dp=Object.getOwnPropertySymbols,z9=Object.getOwnPropertyDescriptor,j9=Object.getPrototypeOf,fp=Object.prototype;function lg(e,t,r){if(typeof t!="string"){if(fp){var n=j9(t);n&&n!==fp&&lg(e,n,r)}var o=I9(t);dp&&(o=o.concat(dp(t)));for(var a=cp(e),u=cp(t),c=0;c<o.length;++c){var f=o[c];if(!(f in M9||r&&r[f]||u&&f in u||a&&f in a)){var d=z9(t,f);try{P9(e,f,d)}catch{}}}}return e}function fa(e){return typeof e=="function"}function hc(e){return typeof e=="object"&&"styledComponentId"in e}function Fo(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function hp(e,t){if(e.length===0)return"";for(var r=e[0],n=1;n<e.length;n++)r+=e[n];return r}function ai(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function u0(e,t,r){if(r===void 0&&(r=!1),!r&&!ai(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var n=0;n<t.length;n++)e[n]=u0(e[n],t[n]);else if(ai(t))for(var n in t)e[n]=u0(e[n],t[n]);return e}function pc(e,t){Object.defineProperty(e,"toString",{value:t})}function hi(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var _9=(function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var r=0,n=0;n<t;n++)r+=this.groupSizes[n];return r},e.prototype.insertRules=function(t,r){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,a=o;t>=a;)if((a<<=1)<0)throw hi(16,"".concat(t));this.groupSizes=new Uint32Array(a),this.groupSizes.set(n),this.length=a;for(var u=o;u<a;u++)this.groupSizes[u]=0}for(var c=this.indexOfGroup(t+1),f=(u=0,r.length);u<f;u++)this.tag.insertRule(c,r[u])&&(this.groupSizes[t]++,c++)},e.prototype.clearGroup=function(t){if(t<this.length){var r=this.groupSizes[t],n=this.indexOfGroup(t),o=n+r;this.groupSizes[t]=0;for(var a=n;a<o;a++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(t){var r="";if(t>=this.length||this.groupSizes[t]===0)return r;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),a=o+n,u=o;u<a;u++)r+="".concat(this.tag.getRule(u)).concat(fc);return r},e})(),Zi=new Map,ks=new Map,Ji=1,Pi=function(e){if(Zi.has(e))return Zi.get(e);for(;ks.has(Ji);)Ji++;var t=Ji++;return Zi.set(e,t),ks.set(t,e),t},L9=function(e,t){Ji=t+1,Zi.set(e,t),ks.set(t,e)},H9="style[".concat(ca,"][").concat(tg,'="').concat(Xs,'"]'),K9=new RegExp("^".concat(ca,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),q9=function(e,t,r){for(var n,o=r.split(","),a=0,u=o.length;a<u;a++)(n=o[a])&&e.registerName(t,n)},W9=function(e,t){for(var r,n=((r=t.textContent)!==null&&r!==void 0?r:"").split(fc),o=[],a=0,u=n.length;a<u;a++){var c=n[a].trim();if(c){var f=c.match(K9);if(f){var d=0|parseInt(f[1],10),m=f[2];d!==0&&(L9(m,d),q9(e,m,f[3]),e.getTag().insertRules(d,o)),o.length=0}else o.push(c)}}},pp=function(e){for(var t=document.querySelectorAll(H9),r=0,n=t.length;r<n;r++){var o=t[r];o&&o.getAttribute(ca)!==eg&&(W9(e,o),o.parentNode&&o.parentNode.removeChild(o))}};function V9(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var ug=function(e){var t=document.head,r=e||t,n=document.createElement("style"),o=(function(c){var f=Array.from(c.querySelectorAll("style[".concat(ca,"]")));return f[f.length-1]})(r),a=o!==void 0?o.nextSibling:null;n.setAttribute(ca,eg),n.setAttribute(tg,Xs);var u=V9();return u&&n.setAttribute("nonce",u),r.insertBefore(n,a),n},U9=(function(){function e(t){this.element=ug(t),this.element.appendChild(document.createTextNode("")),this.sheet=(function(r){if(r.sheet)return r.sheet;for(var n=document.styleSheets,o=0,a=n.length;o<a;o++){var u=n[o];if(u.ownerNode===r)return u}throw hi(17)})(this.element),this.length=0}return e.prototype.insertRule=function(t,r){try{return this.sheet.insertRule(r,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var r=this.sheet.cssRules[t];return r&&r.cssText?r.cssText:""},e})(),Y9=(function(){function e(t){this.element=ug(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,r){if(t<=this.length&&t>=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e})(),G9=(function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,r){return t<=this.length&&(this.rules.splice(t,0,r),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e})(),mp=Es,X9={isServer:!Es,useCSSOMInjection:!k9},cg=(function(){function e(t,r,n){t===void 0&&(t=da),r===void 0&&(r={});var o=this;this.options=rn(rn({},X9),t),this.gs=r,this.names=new Map(n),this.server=!!t.isServer,!this.server&&Es&&mp&&(mp=!1,pp(this)),pc(this,function(){return(function(a){for(var u=a.getTag(),c=u.length,f="",d=function(b){var g=(function(B){return ks.get(B)})(b);if(g===void 0)return"continue";var w=a.names.get(g),C=u.getGroup(b);if(w===void 0||!w.size||C.length===0)return"continue";var D="".concat(ca,".g").concat(b,'[id="').concat(g,'"]'),p="";w!==void 0&&w.forEach(function(B){B.length>0&&(p+="".concat(B,","))}),f+="".concat(C).concat(D,'{content:"').concat(p,'"}').concat(fc)},m=0;m<c;m++)d(m);return f})(o)})}return e.registerId=function(t){return Pi(t)},e.prototype.rehydrate=function(){!this.server&&Es&&pp(this)},e.prototype.reconstructWithOptions=function(t,r){return r===void 0&&(r=!0),new e(rn(rn({},this.options),t),this.gs,r&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=(function(r){var n=r.useCSSOMInjection,o=r.target;return r.isServer?new G9(o):n?new U9(o):new Y9(o)})(this.options),new _9(t)));var t},e.prototype.hasNameForId=function(t,r){return this.names.has(t)&&this.names.get(t).has(r)},e.prototype.registerName=function(t,r){if(Pi(t),this.names.has(t))this.names.get(t).add(r);else{var n=new Set;n.add(r),this.names.set(t,n)}},e.prototype.insertRules=function(t,r,n){this.registerName(t,r),this.getTag().insertRules(Pi(t),n)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(Pi(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e})(),Q9=/&/g,Z9=/^\s*\/\/.*$/gm;function dg(e,t){return e.map(function(r){return r.type==="rule"&&(r.value="".concat(t," ").concat(r.value),r.value=r.value.replaceAll(",",",".concat(t," ")),r.props=r.props.map(function(n){return"".concat(t," ").concat(n)})),Array.isArray(r.children)&&r.type!=="@keyframes"&&(r.children=dg(r.children,t)),r})}function J9(e){var t,r,n,o=da,a=o.options,u=a===void 0?da:a,c=o.plugins,f=c===void 0?Qs:c,d=function(g,w,C){return C.startsWith(r)&&C.endsWith(r)&&C.replaceAll(r,"").length>0?".".concat(t):g},m=f.slice();m.push(function(g){g.type===Vs&&g.value.includes("&")&&(g.props[0]=g.props[0].replace(Q9,r).replace(n,d))}),u.prefix&&m.push(D9),m.push(x9);var b=function(g,w,C,D){w===void 0&&(w=""),C===void 0&&(C=""),D===void 0&&(D="&"),t=D,r=w,n=new RegExp("\\".concat(r,"\\b"),"g");var p=g.replace(Z9,""),B=b9(C||w?"".concat(C," ").concat(w," { ").concat(p," }"):p);u.namespace&&(B=dg(B,u.namespace));var F=[];return Ds(B,C9(m.concat(w9(function(S){return F.push(S)})))),F};return b.hash=f.length?f.reduce(function(g,w){return w.name||hi(15),Zo(g,w.name)},ng).toString():"",b}var eC=new cg,c0=J9(),fg=je.createContext({shouldForwardProp:void 0,styleSheet:eC,stylis:c0});fg.Consumer;je.createContext(void 0);function gp(){return ii(fg)}var tC=(function(){function e(t,r){var n=this;this.inject=function(o,a){a===void 0&&(a=c0);var u=n.name+a.hash;o.hasNameForId(n.id,u)||o.insertRules(n.id,u,a(n.rules,u,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=r,pc(this,function(){throw hi(12,String(n.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=c0),this.name+t.hash},e})(),rC=function(e){return e>="A"&&e<="Z"};function vp(e){for(var t="",r=0;r<e.length;r++){var n=e[r];if(r===1&&n==="-"&&e[0]==="-")return e;rC(n)?t+="-"+n.toLowerCase():t+=n}return t.startsWith("ms-")?"-"+t:t}var hg=function(e){return e==null||e===!1||e===""},pg=function(e){var t,r,n=[];for(var o in e){var a=e[o];e.hasOwnProperty(o)&&!hg(a)&&(Array.isArray(a)&&a.isCss||fa(a)?n.push("".concat(vp(o),":"),a,";"):ai(a)?n.push.apply(n,ws(ws(["".concat(o," {")],pg(a),!1),["}"],!1)):n.push("".concat(vp(o),": ").concat((t=o,(r=a)==null||typeof r=="boolean"||r===""?"":typeof r!="number"||r===0||t in E9||t.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return n};function Mo(e,t,r,n){if(hg(e))return[];if(hc(e))return[".".concat(e.styledComponentId)];if(fa(e)){if(!fa(a=e)||a.prototype&&a.prototype.isReactComponent||!t)return[e];var o=e(t);return Mo(o,t,r,n)}var a;return e instanceof tC?r?(e.inject(r,n),[e.getName(n)]):[e]:ai(e)?pg(e):Array.isArray(e)?Array.prototype.concat.apply(Qs,e.map(function(u){return Mo(u,t,r,n)})):[e.toString()]}function nC(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(fa(r)&&!hc(r))return!1}return!0}var oC=og(Xs),aC=(function(){function e(t,r,n){this.rules=t,this.staticRulesId="",this.isStatic=(n===void 0||n.isStatic)&&nC(t),this.componentId=r,this.baseHash=Zo(oC,r),this.baseStyle=n,cg.registerId(r)}return e.prototype.generateAndInjectStyles=function(t,r,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,r,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&r.hasNameForId(this.componentId,this.staticRulesId))o=Fo(o,this.staticRulesId);else{var a=hp(Mo(this.rules,t,r,n)),u=l0(Zo(this.baseHash,a)>>>0);if(!r.hasNameForId(this.componentId,u)){var c=n(a,".".concat(u),void 0,this.componentId);r.insertRules(this.componentId,u,c)}o=Fo(o,u),this.staticRulesId=u}else{for(var f=Zo(this.baseHash,n.hash),d="",m=0;m<this.rules.length;m++){var b=this.rules[m];if(typeof b=="string")d+=b;else if(b){var g=hp(Mo(b,t,r,n));f=Zo(f,g+m),d+=g}}if(d){var w=l0(f>>>0);r.hasNameForId(this.componentId,w)||r.insertRules(this.componentId,w,n(d,".".concat(w),void 0,this.componentId)),o=Fo(o,w)}}return o},e})(),mg=je.createContext(void 0);mg.Consumer;var hu={};function iC(e,t,r){var n=hc(e),o=e,a=!fu(e),u=t.attrs,c=u===void 0?Qs:u,f=t.componentId,d=f===void 0?(function(O,M){var _=typeof O!="string"?"sc":lp(O);hu[_]=(hu[_]||0)+1;var z="".concat(_,"-").concat(N9(Xs+_+hu[_]));return M?"".concat(M,"-").concat(z):z})(t.displayName,t.parentComponentId):f,m=t.displayName,b=m===void 0?(function(O){return fu(O)?"styled.".concat(O):"Styled(".concat(O9(O),")")})(e):m,g=t.displayName&&t.componentId?"".concat(lp(t.displayName),"-").concat(t.componentId):t.componentId||d,w=n&&o.attrs?o.attrs.concat(c).filter(Boolean):c,C=t.shouldForwardProp;if(n&&o.shouldForwardProp){var D=o.shouldForwardProp;if(t.shouldForwardProp){var p=t.shouldForwardProp;C=function(O,M){return D(O,M)&&p(O,M)}}else C=D}var B=new aC(r,g,n?o.componentStyle:void 0);function F(O,M){return(function(_,z,K){var $=_.attrs,Q=_.componentStyle,V=_.defaultProps,X=_.foldedComponentIds,G=_.styledComponentId,j=_.target,H=je.useContext(mg),U=gp(),R=_.shouldForwardProp||U.shouldForwardProp,te=S9(z,H,V)||da,q=(function(Oe,ee,pe){for(var le,ue=rn(rn({},ee),{className:void 0,theme:pe}),De=0;De<Oe.length;De+=1){var Ce=fa(le=Oe[De])?le(ue):le;for(var Ee in Ce)ue[Ee]=Ee==="className"?Fo(ue[Ee],Ce[Ee]):Ee==="style"?rn(rn({},ue[Ee]),Ce[Ee]):Ce[Ee]}return ee.className&&(ue.className=Fo(ue.className,ee.className)),ue})($,z,te),se=q.as||j,ye={};for(var we in q)q[we]===void 0||we[0]==="$"||we==="as"||we==="theme"&&q.theme===te||(we==="forwardedAs"?ye.as=q.forwardedAs:R&&!R(we,se)||(ye[we]=q[we]));var ie=(function(Oe,ee){var pe=gp(),le=Oe.generateAndInjectStyles(ee,pe.styleSheet,pe.stylis);return le})(Q,q),me=Fo(X,G);return ie&&(me+=" "+ie),q.className&&(me+=" "+q.className),ye[fu(se)&&!rg.has(se)?"class":"className"]=me,K&&(ye.ref=K),ts(se,ye)})(S,O,M)}F.displayName=b;var S=je.forwardRef(F);return S.attrs=w,S.componentStyle=B,S.displayName=b,S.shouldForwardProp=C,S.foldedComponentIds=n?Fo(o.foldedComponentIds,o.styledComponentId):"",S.styledComponentId=g,S.target=n?o.target:e,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(O){this._foldedDefaultProps=n?(function(M){for(var _=[],z=1;z<arguments.length;z++)_[z-1]=arguments[z];for(var K=0,$=_;K<$.length;K++)u0(M,$[K],!0);return M})({},o.defaultProps,O):O}}),pc(S,function(){return".".concat(S.styledComponentId)}),a&&lg(S,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),S}function bp(e,t){for(var r=[e[0]],n=0,o=t.length;n<o;n+=1)r.push(t[n],e[n+1]);return r}var yp=function(e){return Object.assign(e,{isCss:!0})};function sC(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(fa(e)||ai(e))return yp(Mo(bp(Qs,ws([e],t,!0))));var n=e;return t.length===0&&n.length===1&&typeof n[0]=="string"?Mo(n):yp(Mo(bp(n,t)))}function d0(e,t,r){if(r===void 0&&(r=da),!t)throw hi(1,t);var n=function(o){for(var a=[],u=1;u<arguments.length;u++)a[u-1]=arguments[u];return e(t,r,sC.apply(void 0,ws([o],a,!1)))};return n.attrs=function(o){return d0(e,t,rn(rn({},r),{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},n.withConfig=function(o){return d0(e,t,rn(rn({},r),o))},n}var gg=function(e){return d0(iC,e)},tr=gg;rg.forEach(function(e){tr[e]=gg(e)});const lC=tr.span.attrs({className:"unified-rich-text-template-container"})`
169
- display: inline-block;
170
- min-width: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.minWidth)||"80px"}};
171
- padding: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.padding)||"2px 6px"}};
172
- margin: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.margin)||"0 2px"}};
173
- border-radius: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderRadius)||"4px"}};
174
- border: none !important;
175
- cursor: pointer;
176
- transition: all 0.2s;
177
- font-weight: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.fontWeight)||"500"}};
178
- user-select: none;
179
- font-size: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.fontSize)||"14px"}};
180
- line-height: 2;
181
- width: auto; /* 让宽度根据内容自动调整 */
182
- min-width: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.minWidth)||"80px"}};
183
- min-height: ${e=>{var u,c,f,d;const t=((c=(u=e.$styles)==null?void 0:u.templateField)==null?void 0:c.padding)||"2px 6px",r=((d=(f=e.$styles)==null?void 0:f.templateField)==null?void 0:d.fontSize)||"14px",n=t.split(" ").map(m=>parseInt(m)),o=(n.length,n[0]),a=parseInt(r);return o*2+a*1.4+"px"}};
184
-
185
- /* 高度自适应 */
186
- height: auto; /* 允许高度根据内容自动调整 */
187
- white-space: normal; /* 允许换行 */
188
- box-sizing: border-box; /* 确保padding和border包含在宽度内 */
189
- overflow: visible; /* 确保内容不被隐藏 */
190
- word-wrap: break-word; /* 允许长单词换行 */
191
- max-width: 100%; /* 限制在容器宽度内 */
192
-
193
- /* 使用传入的样式配置 */
194
- background-color: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.backgroundColor)||"#E5EEFF"}};
195
- color: #055AFF;
196
- border: 1px solid ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderColor)||"#84ADFF"}};
197
-
198
- ${e=>{var t,r;return e.$isEditing&&`
199
- background-color: white !important;
200
- color: #055AFF !important;
201
- border: 2px solid ${((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderColor)||"#84ADFF"} !important;
202
- outline: none;
203
- min-width: 30px;
204
- `}}
205
-
206
- &:hover {
207
- opacity: 0.8;
208
- }
209
- `,uC=tr.input.attrs({className:"unified-rich-text-template-input"})`
210
- background: white;
211
- border: 2px solid ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderColor)||"#84ADFF"}};
212
- border-radius: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderRadius)||"4px"}};
213
- padding: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.padding)||"2px 6px"}};
214
- margin: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.margin)||"0 2px"}};
215
- min-width: ${"30px"};
216
- width: ${e=>{var d,m,b,g;const t=e.$value.length;if(t===0)return((m=(d=e.$styles)==null?void 0:d.templateField)==null?void 0:m.minWidth)||"120px";const r=((g=(b=e.$styles)==null?void 0:b.templateField)==null?void 0:g.padding)||"2px 6.2px",n=r.split(" ").map(w=>parseInt(w)),o=n.length===2?n[1]:n[0],a=12.5,u=20,c=t*a+o*2+u,f=Math.min(Math.max(c,120),e.$maxWidth);return console.log("TemplateInput \u5BBD\u5EA6\u8BA1\u7B97\u8C03\u8BD5:",{contentLength:t,padding:r,paddingValues:n,leftRightPadding:o,charWidth:a,bufferSpace:u,calculatedWidth:c,maxWidth:e.$maxWidth,finalWidth:f,inputValue:e.$value}),f+"px"}} !important; /* 使用!important确保宽度不被覆盖 */
217
- height: ${e=>{var u,c,f,d;const t=((c=(u=e.$styles)==null?void 0:u.templateField)==null?void 0:c.padding)||"2px 6px",r=((d=(f=e.$styles)==null?void 0:f.templateField)==null?void 0:d.fontSize)||"14px",n=t.split(" ").map(m=>parseInt(m)),o=(n.length,n[0]),a=parseInt(r);return o*2+a*1.4+"px"}};
218
- font-size: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.fontSize)||"14px"}};
219
- font-family: inherit;
220
- outline: none;
221
- color: #055AFF;
222
- line-height: 2;
223
- box-sizing: border-box;
224
- white-space: nowrap; /* 防止内部换行 */
225
- overflow: hidden; /* 隐藏超出部分 */
226
- text-overflow: ellipsis; /* 超出部分显示省略号 */
227
-
228
- &:focus {
229
- border-color: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderColor)||"#84ADFF"}};
230
- box-shadow: 0 0 0 3px ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderColor)||"#84ADFF"}}20;
231
- }
232
- `,vg=vo(({element:e,attributes:t,children:r,styles:n,onTemplateChange:o},a)=>{var _,z,K,$,Q,V,X,G,j,H,U,R;const u=Mm(),[c,f]=Pt(!1),[d,m]=Pt(e.value||""),[b,g]=Pt(e.value&&e.value!==""?e.value:e.placeholder||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9"),[w,C]=Pt(600),D=It(null),p=mt(()=>{try{const te=document.querySelector('[data-slate-editor="true"]');if(te){const q=te.closest('.sc-jwTyAe, .bdQKlw, [role="textbox"]')||te.parentElement;if(q){const se=q.clientWidth,ye=se-40;return console.log("TemplateField: \u7F16\u8F91\u5668\u5BB9\u5668\u5BBD\u5EA6:",se,"\u53EF\u7528\u5BBD\u5EA6:",ye),Math.max(ye,200)}}return 600}catch(te){return console.warn("TemplateField: \u65E0\u6CD5\u83B7\u53D6\u7F16\u8F91\u5668\u5BBD\u5EA6\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u503C:",te),600}},[]);lr(()=>{g(e.value&&e.value!==""?e.value:e.placeholder||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9");const te=p();C(te)},[e.value,e.placeholder,p]);const B=mt(()=>{f(!0),m(e.value||""),setTimeout(()=>{D.current&&(D.current.focus(),D.current.select())},0)},[e.value]),F=mt(te=>{const q=te.target.value;m(q)},[]),S=mt(()=>{const te=Re.findPath(u,e);console.log("TemplateField: \u627E\u5230\u5143\u7D20\u8DEF\u5F84:",te),console.log("TemplateField: \u5F53\u524D\u5143\u7D20:",e),console.log("TemplateField: \u8981\u8BBE\u7F6E\u7684\u503C:",d),_e.setNodes(u,{value:d},{at:te});const q=d.trim()!==""?d:e.placeholder||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9";g(q);const se=u.children[te[0]];if(se&&"children"in se){const ye=se.children[te[1]];console.log("TemplateField: \u66F4\u65B0\u540E\u7684\u5143\u7D20:",ye)}f(!1)},[u,e,d]),O=mt(()=>{S()},[S]),M=mt(te=>{te.key==="Enter"?(te.preventDefault(),S()):te.key==="Escape"&&(te.preventDefault(),m(e.value||""),f(!1))},[S,e.value]);return c?Z.jsxs("span",{...t,"data-slate-void":"true","data-slate-inline":"true","data-slate-length":"0",contentEditable:!1,children:[Z.jsx(uC,{ref:D,value:d,onChange:F,onBlur:O,onKeyDown:M,placeholder:"",$styles:n,$value:d,$maxWidth:w,style:{backgroundColor:"white",color:((_=n==null?void 0:n.templateField)==null?void 0:_.textColor)||"#055AFF",border:`2px solid ${((z=n==null?void 0:n.templateField)==null?void 0:z.borderColor)||"#84ADFF"}`,minWidth:((K=n==null?void 0:n.templateField)==null?void 0:K.minWidth)||"120px"}}),r]}):Z.jsxs("span",{...t,"data-slate-void":"true","data-slate-inline":"true","data-slate-length":"0",contentEditable:!1,children:[Z.jsxs(lC,{ref:a,$style:e.style||"blue",$isEditing:!1,$styles:n,$contentLength:b.length,onClick:B,style:{letterSpacing:n==null?void 0:n.letterSpacing,lineHeight:n==null?void 0:n.lineHeight,backgroundColor:($=n==null?void 0:n.templateField)==null?void 0:$.backgroundColor,borderColor:(Q=n==null?void 0:n.templateField)==null?void 0:Q.borderColor,borderRadius:(V=n==null?void 0:n.templateField)==null?void 0:V.borderRadius,padding:(X=n==null?void 0:n.templateField)==null?void 0:X.padding,margin:(G=n==null?void 0:n.templateField)==null?void 0:G.margin,fontSize:(j=n==null?void 0:n.templateField)==null?void 0:j.fontSize,fontWeight:(H=n==null?void 0:n.templateField)==null?void 0:H.fontWeight,minWidth:(U=n==null?void 0:n.templateField)==null?void 0:U.minWidth,color:(R=n==null?void 0:n.templateField)==null?void 0:R.textColor,width:"auto",maxWidth:"100%"},children:[(console.log("TemplateField \u6E32\u67D3\u8C03\u8BD5:",{elementValue:e.value,elementPlaceholder:e.placeholder,displayValue:b,displayValueLength:b.length,contentLength:b.length}),null),b]}),Z.jsx("span",{contentEditable:!1,style:{display:"none"},children:r})]})});vg.displayName="TemplateField";const cC=({children:e,attributes:t,styles:r,extraProps:n})=>{var a;const o=!!(n!=null&&n.isCollapsed);return Z.jsxs("div",{...t,className:"think-container",children:[Z.jsx("div",{className:"think-indicator"}),Z.jsx("div",{className:"think-content py-2",children:Z.jsx("div",{className:"think-text text-[#86909C] pl-5 my-3 border border-[#ECECEE] border-solid border-l-3 border-t-0 border-b-0 border-r-0",style:{color:`${(a=r==null?void 0:r.text)==null?void 0:a.color} !important`,display:o?"none":"block"},children:e})})]})},bg=je.forwardRef(({attributes:e,element:t,eventsEmit:r,dataSource:n,tagIndex:o},a)=>{var O;const[u,c]=Pt(null),[f,d]=Pt(!0),[m,b]=Pt(1),[g,w]=Pt(10);lr(()=>{if(!u){if(!n){d(!0);try{const M=new CustomEvent("retrieve-sql-data:request-data",{detail:{id:t.id}});window.dispatchEvent(M)}catch{console.warn("Failed to dispatch retrieve-sql-data:request-data")}return}try{const M=(n==null?void 0:n.queryReplyPairList)||[];console.log("RetrieveSqlDataElement pairList:",M);let _=null,z=null,K;for(const V of M){const X=V==null?void 0:V.reply;if(!(X!=null&&X.databaseReference))continue;const G=X.databaseReference;console.log(G,"123123123jk123lk12j3l12jl3"),G!=null&&G.retrieveSqlData&&(console.log("Found source in raw12eku1h2lkjeh12ljkhelk12hejk:",G.retrieveSqlData.filePath),K=G.retrieveSqlData.filePath);let j=G;if(typeof G=="string")try{j=JSON.parse(G)}catch{}if(!j)continue;const H=Array.isArray(j)?j:[j],U=H.findIndex(q=>(q==null?void 0:q.id)===t.id),R=U>=0?H[U]:null;if(console.log("~~~~~~~~~~~~~~~",R),R){_=R,z=R.retrieveSqlData||R.retrieve_table_data||R.retrieveTableData;break}const te=H.find(q=>{var se,ye;return(((ye=(se=q==null?void 0:q.retrieveSqlData)==null?void 0:se.preData)==null?void 0:ye.length)||0)>0});!_&&te&&(_=te,z=te.retrieveSqlData||te.retrieve_table_data||te.retrieveTableData)}if(!_||!z){console.warn("No databaseReference with preData found for id:",t.id),d(!1);return}const $=Array.isArray(z==null?void 0:z.preData)?z.preData[0]:null;if(!$){console.warn("Matched item has no preData"),d(!1);return}const Q={columns:($.columns||[]).map(V=>({key:V.key,title:V.title})),rows:$.data||$.rows||[],total:(z==null?void 0:z.total)||0,fetchUrl:(z==null?void 0:z.fetchUrl)||"/index/knowledgeBase/file/stream",source:K||(z==null?void 0:z.source)||(_==null?void 0:_.source)};c(Q),d(!1)}catch(M){console.error("Init preData parsing failed:",M),d(!1)}}},[t.id,u,n]),lr(()=>{const M=_=>{try{const z=(_==null?void 0:_.detail)||{},K=z==null?void 0:z.id;if(!K||String(K)!==String(t.id))return;const $=z.databaseReference;if(!$)return;let Q=$;if(typeof $=="string")try{Q=JSON.parse($)}catch{}if(!Q)return;const V=Array.isArray(Q)?Q:[Q],X=V.findIndex(R=>String(R==null?void 0:R.id)===String(t.id)),G=X>=0?V[X]:null;if(!G)return;const j=(G==null?void 0:G.retrieveSqlData)||(G==null?void 0:G.retrieve_table_data)||(G==null?void 0:G.retrieveTableData),H=Array.isArray(j==null?void 0:j.preData)?j.preData[0]:null;if(!H)return;const U={columns:(H.columns||[]).map(R=>({key:R.key,title:R.title})),rows:H.data||H.rows||[],total:(j==null?void 0:j.total)||0,fetchUrl:(j==null?void 0:j.fetchUrl)||"/index/knowledgeBase/file/stream",source:(G==null?void 0:G.source)||(j==null?void 0:j.source)};c(U),d(!1)}catch{console.warn("Failed to handle retrieve-sql-data:data-response")}};return window.addEventListener("retrieve-sql-data:data-response",M),()=>{window.removeEventListener("retrieve-sql-data:data-response",M)}},[t.id]);const C=M=>{if(!M||M.length===0)return[];const _=M.find(z=>z&&typeof z=="object")||{};return Object.keys(_).map(z=>({key:z,title:z}))},D=(M,_)=>{b(M),_&&w(_);const z=K=>{let $=null;if(K&&Array.isArray(K.columns)&&Array.isArray(K.rows))$={columns:K.columns,rows:K.rows,total:Number(K.total)||0,fetchUrl:K.fetchUrl||(u==null?void 0:u.fetchUrl)||"",source:K.source||(u==null?void 0:u.source)};else if(K&&Array.isArray(K.data)){const Q=K.data;$={columns:u!=null&&u.columns&&u.columns.length>0?u.columns:C(Q),rows:Q,total:Number(K.totalCount??K.total??(u==null?void 0:u.total)??Q.length)||0,fetchUrl:(u==null?void 0:u.fetchUrl)||"",source:u==null?void 0:u.source},typeof K.currentPage=="number"&&b(K.currentPage),typeof K.pageSize=="number"&&w(K.pageSize)}else if(Array.isArray(K)){const Q=K;$={columns:u!=null&&u.columns&&u.columns.length>0?u.columns:C(Q),rows:Q,total:Number((u==null?void 0:u.total)??Q.length)||0,fetchUrl:(u==null?void 0:u.fetchUrl)||"",source:u==null?void 0:u.source}}if(!$){console.warn("replacePredataFunction received unsupported data format:",K);return}console.log("Replacing table data with:",$),c($)};r==null||r("retrieve-sql-data:pagingation_click",{id:t.id,page:M,pageSize:_||g,fetchUrl:u==null?void 0:u.fetchUrl,total:u==null?void 0:u.total,source:u==null?void 0:u.source,replacePredataFunction:z})},p=M=>u!=null&&u.rows?Math.max(...u.rows.map(_=>{const z=_[M];return z?String(z).length:0})):0,B=(((O=u==null?void 0:u.columns)==null?void 0:O.length)||0)===1,F=(u==null?void 0:u.columns.map((M,_)=>({title:M.title||M.key,dataIndex:M.key,key:M.key,render:z=>{const K=z==null||z===""?"-":z;return B?Z.jsx("div",{style:{whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere",lineHeight:1.5},children:String(K)}):K},...B?{width:void 0}:{}})))||[],S=(u==null?void 0:u.rows.map((M,_)=>({key:_,...M})))||[];return Z.jsx("div",{...e,ref:a,className:"retrieve-sql-data-container my-4",children:f?Z.jsxs("div",{className:"flex items-center justify-center py-8",children:[Z.jsx(Qp,{size:"large"}),Z.jsx("span",{className:"ml-2 text-gray-500",children:"\u52A0\u8F7D\u6570\u636E\u4E2D..."})]}):u?Z.jsxs("div",{className:"retrieve-sql-data-content",children:[o!==null&&Z.jsxs("div",{className:"mb-2 flex items-center",children:[Z.jsx("span",{className:"w-6 h-6 bg-orange-100 text-orange-600 rounded text-xs font-medium flex items-center justify-center",children:o}),Z.jsx("span",{children:" \u6570\u636E\u8868\u67E5\u8BE2\u7ED3\u679C\uFF1A"})]}),Z.jsx("div",{className:"table-container",style:{border:"1px solid #d9d9d9",borderRadius:"6px",position:"relative"},children:Z.jsx(eo,{columns:F.map((M,_)=>({...M,...B?{width:void 0,minWidth:void 0,maxWidth:void 0,fixed:void 0,ellipsis:!1}:{width:_===0?160:void 0,minWidth:120,maxWidth:_===0?180:300,fixed:_===0?"left":void 0,ellipsis:{showTitle:!0}},render:z=>{if(z==null)return"-";const K=String(z);if(B)return Z.jsx("div",{style:{whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere",lineHeight:1.5,cursor:"default"},title:K,children:K});const $=p(M.key);let Q="200px";return _===0?Q="80px":$<=8?Q="100px":$<=15?Q="150px":$<=25?Q="200px":$<=40?Q="250px":Q="300px",Z.jsx("div",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:Q,display:"inline-block",cursor:"default"},title:K,children:K})}})),dataSource:S,pagination:!1,size:"small",bordered:!1,className:"database-table",style:{minWidth:B?"100%":"1000px"},scroll:{x:B?void 0:"max-content",y:400}})}),u.total>g&&Z.jsx("div",{className:"flex justify-center mt-3",children:Z.jsx(Zp,{current:m,pageSize:g,total:u.total,onChange:D,onShowSizeChange:D,showSizeChanger:!1,showQuickJumper:!1,size:"small"})})]}):Z.jsx("div",{className:"text-center py-4 text-gray-500",children:"\u6682\u65E0\u6570\u636E"})})});bg.displayName="RetrieveSqlDataElement";var es={exports:{}},pu={exports:{}},mu,xp;function dC(){if(xp)return mu;xp=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return mu=e,mu}var gu,Cp;function fC(){if(Cp)return gu;Cp=1;var e=dC();function t(){}function r(){}return r.resetWarningCache=t,gu=function(){function n(u,c,f,d,m,b){if(b!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}n.isRequired=n;function o(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return a.PropTypes=a,a},gu}var wp;function hC(){return wp||(wp=1,pu.exports=fC()()),pu.exports}var f0={exports:{}},pC=f0.exports,Dp;function mC(){return Dp||(Dp=1,(function(e,t){(function(r,n){e.exports=n()})(typeof self<"u"?self:pC,function(){return(function(){var r={};(function(){r.d=function(s,i){for(var l in i)r.o(i,l)&&!r.o(s,l)&&Object.defineProperty(s,l,{enumerable:!0,get:i[l]})}})(),(function(){r.o=function(s,i){return Object.prototype.hasOwnProperty.call(s,i)}})();var n={};r.d(n,{default:function(){return m4}});class o{constructor(i,l){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;let h="KaTeX parse error: "+i,y,E;const N=l&&l.loc;if(N&&N.start<=N.end){const Y=N.lexer.input;y=N.start,E=N.end,y===Y.length?h+=" at end of input: ":h+=" at position "+(y+1)+": ";const ne=Y.slice(y,E).replace(/[^]/g,"$&\u0332");let fe;y>15?fe="\u2026"+Y.slice(y-15,y):fe=Y.slice(0,y);let ve;E+15<Y.length?ve=Y.slice(E,E+15)+"\u2026":ve=Y.slice(E),h+=fe+ne+ve}const P=new Error(h);return P.name="ParseError",P.__proto__=o.prototype,P.position=y,y!=null&&E!=null&&(P.length=E-y),P.rawMessage=i,P}}o.prototype.__proto__=Error.prototype;var a=o;const u=function(s,i){return s===void 0?i:s},c=/([A-Z])/g,f=function(s){return s.replace(c,"-$1").toLowerCase()},d={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},m=/[&><"']/g;function b(s){return String(s).replace(m,i=>d[i])}const g=function(s){return s.type==="ordgroup"||s.type==="color"?s.body.length===1?g(s.body[0]):s:s.type==="font"?g(s.body):s},w=function(s){const i=g(s);return i.type==="mathord"||i.type==="textord"||i.type==="atom"},C=function(s){if(!s)throw new Error("Expected non-null, but got "+String(s));return s};var D={deflt:u,escape:b,hyphenate:f,getBaseElem:g,isCharacterBox:w,protocolFromUrl:function(s){const i=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(s);return i?i[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(i[1])?null:i[1].toLowerCase():"_relative"}};const p={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:s=>"#"+s},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:(s,i)=>(i.push(s),i)},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:s=>Math.max(0,s),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:s=>Math.max(0,s),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:s=>Math.max(0,s),cli:"-e, --max-expand <n>",cliProcessor:s=>s==="Infinity"?1/0:parseInt(s)},globalGroup:{type:"boolean",cli:!1}};function B(s){if(s.default)return s.default;const i=s.type,l=Array.isArray(i)?i[0]:i;if(typeof l!="string")return l.enum[0];switch(l){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class F{constructor(i){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,i=i||{};for(const l in p)if(p.hasOwnProperty(l)){const h=p[l];this[l]=i[l]!==void 0?h.processor?h.processor(i[l]):i[l]:B(h)}}reportNonstrict(i,l,h){let y=this.strict;if(typeof y=="function"&&(y=y(i,l,h)),!(!y||y==="ignore")){if(y===!0||y==="error")throw new a("LaTeX-incompatible input and strict mode is set to 'error': "+(l+" ["+i+"]"),h);y==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(l+" ["+i+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+y+"': "+l+" ["+i+"]"))}}useStrictBehavior(i,l,h){let y=this.strict;if(typeof y=="function")try{y=y(i,l,h)}catch{y="error"}return!y||y==="ignore"?!1:y===!0||y==="error"?!0:y==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(l+" ["+i+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+y+"': "+l+" ["+i+"]")),!1)}isTrusted(i){if(i.url&&!i.protocol){const l=D.protocolFromUrl(i.url);if(l==null)return!1;i.protocol=l}return!!(typeof this.trust=="function"?this.trust(i):this.trust)}}class S{constructor(i,l,h){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=i,this.size=l,this.cramped=h}sup(){return X[G[this.id]]}sub(){return X[j[this.id]]}fracNum(){return X[H[this.id]]}fracDen(){return X[U[this.id]]}cramp(){return X[R[this.id]]}text(){return X[te[this.id]]}isTight(){return this.size>=2}}const O=0,M=1,_=2,z=3,K=4,$=5,Q=6,V=7,X=[new S(O,0,!1),new S(M,0,!0),new S(_,1,!1),new S(z,1,!0),new S(K,2,!1),new S($,2,!0),new S(Q,3,!1),new S(V,3,!0)],G=[K,$,K,$,Q,V,Q,V],j=[$,$,$,$,V,V,V,V],H=[_,z,K,$,Q,V,Q,V],U=[z,z,$,$,V,V,V,V],R=[M,M,z,z,$,$,V,V],te=[O,M,_,z,_,z,_,z];var q={DISPLAY:X[O],TEXT:X[_],SCRIPT:X[K],SCRIPTSCRIPT:X[Q]};const se=[{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 ye(s){for(let i=0;i<se.length;i++){const l=se[i];for(let h=0;h<l.blocks.length;h++){const y=l.blocks[h];if(s>=y[0]&&s<=y[1])return l.name}}return null}const we=[];se.forEach(s=>s.blocks.forEach(i=>we.push(...i)));function ie(s){for(let i=0;i<we.length;i+=2)if(s>=we[i]&&s<=we[i+1])return!0;return!1}const me=80,Oe=function(s,i){return"M95,"+(622+s+i)+`
233
- c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
234
- c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
235
- 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
236
- s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
237
- c69,-144,104.5,-217.7,106.5,-221
238
- l`+s/2.075+" -"+s+`
239
- c5.3,-9.3,12,-14,20,-14
240
- H400000v`+(40+s)+`H845.2724
241
- s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
242
- c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
243
- M`+(834+s)+" "+i+"h400000v"+(40+s)+"h-400000z"},ee=function(s,i){return"M263,"+(601+s+i)+`c0.7,0,18,39.7,52,119
244
- c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
245
- c340,-704.7,510.7,-1060.3,512,-1067
246
- l`+s/2.084+" -"+s+`
247
- c4.7,-7.3,11,-11,19,-11
248
- H40000v`+(40+s)+`H1012.3
249
- s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
250
- 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
251
- s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
252
- c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
253
- M`+(1001+s)+" "+i+"h400000v"+(40+s)+"h-400000z"},pe=function(s,i){return"M983 "+(10+s+i)+`
254
- l`+s/3.13+" -"+s+`
255
- c4,-6.7,10,-10,18,-10 H400000v`+(40+s)+`
256
- 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
257
- 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
258
- c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
259
- c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
260
- c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
261
- c53.7,-170.3,84.5,-266.8,92.5,-289.5z
262
- M`+(1001+s)+" "+i+"h400000v"+(40+s)+"h-400000z"},le=function(s,i){return"M424,"+(2398+s+i)+`
263
- c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
264
- 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
265
- s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
266
- s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
267
- l`+s/4.223+" -"+s+`c4,-6.7,10,-10,18,-10 H400000
268
- v`+(40+s)+`H1014.6
269
- s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
270
- c-2,6,-10,9,-24,9
271
- c-8,0,-12,-0.7,-12,-2z M`+(1001+s)+" "+i+`
272
- h400000v`+(40+s)+"h-400000z"},ue=function(s,i){return"M473,"+(2713+s+i)+`
273
- c339.3,-1799.3,509.3,-2700,510,-2702 l`+s/5.298+" -"+s+`
274
- c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+s)+`H1017.7
275
- s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
276
- 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
277
- 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
278
- s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
279
- 606zM`+(1001+s)+" "+i+"h400000v"+(40+s)+"H1017.7z"},De=function(s){const i=s/2;return"M400000 "+s+" H0 L"+i+" 0 l65 45 L145 "+(s-80)+" H400000z"},Ce=function(s,i,l){const h=l-54-i-s;return"M702 "+(s+i)+"H400000"+(40+s)+`
280
- H742v`+h+`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
281
- h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
282
- c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
283
- 219 661 l218 661zM702 `+i+"H400000v"+(40+s)+"H742z"},Ee=function(s,i,l){i=1e3*i;let h="";switch(s){case"sqrtMain":h=Oe(i,me);break;case"sqrtSize1":h=ee(i,me);break;case"sqrtSize2":h=pe(i,me);break;case"sqrtSize3":h=le(i,me);break;case"sqrtSize4":h=ue(i,me);break;case"sqrtTall":h=Ce(i,me,l)}return h},Fe=function(s,i){switch(s){case"\u239C":return"M291 0 H417 V"+i+" H291z M291 0 H417 V"+i+" H291z";case"\u2223":return"M145 0 H188 V"+i+" H145z M145 0 H188 V"+i+" H145z";case"\u2225":return"M145 0 H188 V"+i+" H145z M145 0 H188 V"+i+" H145z"+("M367 0 H410 V"+i+" H367z M367 0 H410 V"+i+" H367z");case"\u239F":return"M457 0 H583 V"+i+" H457z M457 0 H583 V"+i+" H457z";case"\u23A2":return"M319 0 H403 V"+i+" H319z M319 0 H403 V"+i+" H319z";case"\u23A5":return"M263 0 H347 V"+i+" H263z M263 0 H347 V"+i+" H263z";case"\u23AA":return"M384 0 H504 V"+i+" H384z M384 0 H504 V"+i+" H384z";case"\u23D0":return"M312 0 H355 V"+i+" H312z M312 0 H355 V"+i+" H312z";case"\u2016":return"M257 0 H300 V"+i+" H257z M257 0 H300 V"+i+" H257z"+("M478 0 H521 V"+i+" H478z M478 0 H521 V"+i+" H478z");default:return""}},Be={doubleleftarrow:`M262 157
284
- 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
285
- 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
286
- 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
287
- 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
288
- 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
289
- -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
290
- -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
291
- m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
292
- -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
293
- 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
294
- -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
295
- -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
296
- -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
297
- 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
298
- -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
299
- 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
300
- -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
301
- 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
302
- 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
303
- 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
304
- l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
305
- -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
306
- 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
307
- 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
308
- 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
309
- -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
310
- 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
311
- 435 0h399565z`,leftgroupunder:`M400000 262
312
- 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
313
- 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
314
- -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
315
- -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
316
- -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
317
- 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
318
- -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
319
- -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
320
- m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
321
- 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
322
- 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
323
- -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
324
- 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
325
- -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
326
- 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
327
- -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
328
- -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
329
- 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
330
- M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
331
- M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
332
- -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
333
- 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
334
- 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
335
- M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
336
- 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
337
- -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
338
- 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
339
- 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
340
- 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
341
- 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
342
- 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
343
- -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
344
- -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
345
- 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
346
- 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
347
- -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
348
- m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
349
- 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
350
- -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
351
- 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
352
- 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
353
- -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
354
- m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
355
- 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
356
- -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
357
- 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
358
- 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
359
- -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
360
- -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
361
- 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
362
- -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
363
- 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
364
- 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
365
- 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
366
- -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
367
- 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
368
- 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
369
- -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
370
- -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
371
- 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
372
- -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
373
- 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
374
- 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
375
- 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
376
- -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
377
- -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
378
- 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
379
- 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
380
- -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
381
- 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
382
- 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
383
- -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
384
- 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
385
- 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
386
- 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
387
- -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
388
- -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
389
- 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
390
- -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
391
- -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
392
- -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
393
- 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
394
- 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
395
- 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
396
- 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
397
- -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
398
- 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
399
- -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
400
- 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
401
- 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
402
- -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
403
- -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
404
- 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
405
- 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
406
- 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
407
- -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
408
- 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
409
- 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
410
- -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
411
- -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
412
- 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
413
- 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
414
- -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
415
- 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
416
- 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
417
- -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
418
- -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
419
- H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
420
- 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
421
- 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
422
- -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
423
- -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
424
- -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,
425
- -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,
426
- -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,
427
- -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,
428
- -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
429
- c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
430
- 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
431
- 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
432
- 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
433
- 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
434
- c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
435
- M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
436
- -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
437
- 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
438
- -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
439
- -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
440
- -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
441
- 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
442
- c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
443
- 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
444
- c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
445
- c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
446
- M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
447
- 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,
448
- -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
449
- 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
450
- 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
451
- 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,
452
- 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,
453
- -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
454
- 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
455
- 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,
456
- -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
457
- 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
458
- M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Ne=function(s,i){switch(s){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+i+` v1759 h347 v-84
459
- H403z M403 1759 V0 H319 V1759 v`+i+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+i+` v1759 H0 v84 H347z
460
- M347 1759 V0 H263 V1759 v`+i+" v1759 h84z";case"vert":return"M145 15 v585 v"+i+` v585 c2.667,10,9.667,15,21,15
461
- c10,0,16.667,-5,20,-15 v-585 v`+-i+` v-585 c-2.667,-10,-9.667,-15,-21,-15
462
- c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+i+" v585 h43z";case"doublevert":return"M145 15 v585 v"+i+` v585 c2.667,10,9.667,15,21,15
463
- c10,0,16.667,-5,20,-15 v-585 v`+-i+` v-585 c-2.667,-10,-9.667,-15,-21,-15
464
- c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+i+` v585 h43z
465
- M367 15 v585 v`+i+` v585 c2.667,10,9.667,15,21,15
466
- c10,0,16.667,-5,20,-15 v-585 v`+-i+` v-585 c-2.667,-10,-9.667,-15,-21,-15
467
- c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+i+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+i+` v1715 h263 v84 H319z
468
- MM319 602 V0 H403 V602 v`+i+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+i+` v1799 H0 v-84 H319z
469
- MM319 602 V0 H403 V602 v`+i+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+i+` v602 h84z
470
- M403 1759 V0 H319 V1759 v`+i+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+i+` v602 h84z
471
- M347 1759 V0 h-84 V1759 v`+i+" 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
472
- 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,
473
- -36,557 l0,`+(i+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
474
- 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
475
- 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,
476
- -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
477
- l0,-`+(i+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
478
- -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,
479
- 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
480
- c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(i+9)+`
481
- 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
482
- 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
483
- 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
484
- c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
485
- l0,-`+(i+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
486
- -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.")}};var ze={"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]}};const Me={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]},Ge={\u00C5:"A",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function dt(s,i){ze[s]=i}function ut(s,i,l){if(!ze[i])throw new Error("Font metrics not found for font: "+i+".");let h=s.charCodeAt(0),y=ze[i][h];if(!y&&s[0]in Ge&&(h=Ge[s[0]].charCodeAt(0),y=ze[i][h]),!y&&l==="text"&&ie(h)&&(y=ze[i][77]),y)return{depth:y[0],height:y[1],italic:y[2],skew:y[3],width:y[4]}}const Pe={};function Le(s){let i;if(s>=5?i=0:s>=3?i=1:i=2,!Pe[i]){const l=Pe[i]={cssEmPerMu:Me.quad[i]/18};for(const h in Me)Me.hasOwnProperty(h)&&(l[h]=Me[h][i])}return Pe[i]}const Ve=[[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]],ft=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Je=function(s,i){return i.size<2?s:Ve[s-1][i.size-1]};class Xe{constructor(i){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=i.style,this.color=i.color,this.size=i.size||Xe.BASESIZE,this.textSize=i.textSize||this.size,this.phantom=!!i.phantom,this.font=i.font||"",this.fontFamily=i.fontFamily||"",this.fontWeight=i.fontWeight||"",this.fontShape=i.fontShape||"",this.sizeMultiplier=ft[this.size-1],this.maxSize=i.maxSize,this.minRuleThickness=i.minRuleThickness,this._fontMetrics=void 0}extend(i){const l={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(const h in i)i.hasOwnProperty(h)&&(l[h]=i[h]);return new Xe(l)}havingStyle(i){return this.style===i?this:this.extend({style:i,size:Je(this.textSize,i)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(i){return this.size===i&&this.textSize===i?this:this.extend({style:this.style.text(),size:i,textSize:i,sizeMultiplier:ft[i-1]})}havingBaseStyle(i){i=i||this.style.text();const l=Je(Xe.BASESIZE,i);return this.size===l&&this.textSize===Xe.BASESIZE&&this.style===i?this:this.extend({style:i,size:l})}havingBaseSizing(){let i;switch(this.style.id){case 4:case 5:i=3;break;case 6:case 7:i=1;break;default:i=6}return this.extend({style:this.style.text(),size:i})}withColor(i){return this.extend({color:i})}withPhantom(){return this.extend({phantom:!0})}withFont(i){return this.extend({font:i})}withTextFontFamily(i){return this.extend({fontFamily:i,font:""})}withTextFontWeight(i){return this.extend({fontWeight:i,font:""})}withTextFontShape(i){return this.extend({fontShape:i,font:""})}sizingClasses(i){return i.size!==this.size?["sizing","reset-size"+i.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Xe.BASESIZE?["sizing","reset-size"+this.size,"size"+Xe.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Le(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Xe.BASESIZE=6;var St=Xe;const bt={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},ct={ex:!0,em:!0,mu:!0},rt=function(s){return typeof s!="string"&&(s=s.unit),s in bt||s in ct||s==="ex"},$e=function(s,i){let l;if(s.unit in bt)l=bt[s.unit]/i.fontMetrics().ptPerEm/i.sizeMultiplier;else if(s.unit==="mu")l=i.fontMetrics().cssEmPerMu;else{let h;if(i.style.isTight()?h=i.havingStyle(i.style.text()):h=i,s.unit==="ex")l=h.fontMetrics().xHeight;else if(s.unit==="em")l=h.fontMetrics().quad;else throw new a("Invalid unit: '"+s.unit+"'");h!==i&&(l*=h.sizeMultiplier/i.sizeMultiplier)}return Math.min(s.number*l,i.maxSize)},de=function(s){return+s.toFixed(4)+"em"},it=function(s){return s.filter(i=>i).join(" ")},yt=function(s,i,l){if(this.classes=s||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=l||{},i){i.style.isTight()&&this.classes.push("mtight");const h=i.getColor();h&&(this.style.color=h)}},Dt=function(s){const i=document.createElement(s);i.className=it(this.classes);for(const l in this.style)this.style.hasOwnProperty(l)&&(i.style[l]=this.style[l]);for(const l in this.attributes)this.attributes.hasOwnProperty(l)&&i.setAttribute(l,this.attributes[l]);for(let l=0;l<this.children.length;l++)i.appendChild(this.children[l].toNode());return i},pt=/[\s"'>/=\x00-\x1f]/,Qt=function(s){let i="<"+s;this.classes.length&&(i+=' class="'+D.escape(it(this.classes))+'"');let l="";for(const h in this.style)this.style.hasOwnProperty(h)&&(l+=D.hyphenate(h)+":"+this.style[h]+";");l&&(i+=' style="'+D.escape(l)+'"');for(const h in this.attributes)if(this.attributes.hasOwnProperty(h)){if(pt.test(h))throw new a("Invalid attribute name '"+h+"'");i+=" "+h+'="'+D.escape(this.attributes[h])+'"'}i+=">";for(let h=0;h<this.children.length;h++)i+=this.children[h].toMarkup();return i+="</"+s+">",i};class gt{constructor(i,l,h,y){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,yt.call(this,i,h,y),this.children=l||[]}setAttribute(i,l){this.attributes[i]=l}hasClass(i){return this.classes.includes(i)}toNode(){return Dt.call(this,"span")}toMarkup(){return Qt.call(this,"span")}}class Zt{constructor(i,l,h,y){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,yt.call(this,l,y),this.children=h||[],this.setAttribute("href",i)}setAttribute(i,l){this.attributes[i]=l}hasClass(i){return this.classes.includes(i)}toNode(){return Dt.call(this,"a")}toMarkup(){return Qt.call(this,"a")}}class rr{constructor(i,l,h){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=l,this.src=i,this.classes=["mord"],this.style=h}hasClass(i){return this.classes.includes(i)}toNode(){const i=document.createElement("img");i.src=this.src,i.alt=this.alt,i.className="mord";for(const l in this.style)this.style.hasOwnProperty(l)&&(i.style[l]=this.style[l]);return i}toMarkup(){let i='<img src="'+D.escape(this.src)+'"'+(' alt="'+D.escape(this.alt)+'"'),l="";for(const h in this.style)this.style.hasOwnProperty(h)&&(l+=D.hyphenate(h)+":"+this.style[h]+";");return l&&(i+=' style="'+D.escape(l)+'"'),i+="'/>",i}}const nr={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"};class ht{constructor(i,l,h,y,E,N,P,Y){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=i,this.height=l||0,this.depth=h||0,this.italic=y||0,this.skew=E||0,this.width=N||0,this.classes=P||[],this.style=Y||{},this.maxFontSize=0;const ne=ye(this.text.charCodeAt(0));ne&&this.classes.push(ne+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=nr[this.text])}hasClass(i){return this.classes.includes(i)}toNode(){const i=document.createTextNode(this.text);let l=null;this.italic>0&&(l=document.createElement("span"),l.style.marginRight=de(this.italic)),this.classes.length>0&&(l=l||document.createElement("span"),l.className=it(this.classes));for(const h in this.style)this.style.hasOwnProperty(h)&&(l=l||document.createElement("span"),l.style[h]=this.style[h]);return l?(l.appendChild(i),l):i}toMarkup(){let i=!1,l="<span";this.classes.length&&(i=!0,l+=' class="',l+=D.escape(it(this.classes)),l+='"');let h="";this.italic>0&&(h+="margin-right:"+this.italic+"em;");for(const E in this.style)this.style.hasOwnProperty(E)&&(h+=D.hyphenate(E)+":"+this.style[E]+";");h&&(i=!0,l+=' style="'+D.escape(h)+'"');const y=D.escape(this.text);return i?(l+=">",l+=y,l+="</span>",l):y}}class gr{constructor(i,l){this.children=void 0,this.attributes=void 0,this.children=i||[],this.attributes=l||{}}toNode(){const i=document.createElementNS("http://www.w3.org/2000/svg","svg");for(const l in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,l)&&i.setAttribute(l,this.attributes[l]);for(let l=0;l<this.children.length;l++)i.appendChild(this.children[l].toNode());return i}toMarkup(){let i='<svg xmlns="http://www.w3.org/2000/svg"';for(const l in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,l)&&(i+=" "+l+'="'+D.escape(this.attributes[l])+'"');i+=">";for(let l=0;l<this.children.length;l++)i+=this.children[l].toMarkup();return i+="</svg>",i}}class or{constructor(i,l){this.pathName=void 0,this.alternate=void 0,this.pathName=i,this.alternate=l}toNode(){const i=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?i.setAttribute("d",this.alternate):i.setAttribute("d",Be[this.pathName]),i}toMarkup(){return this.alternate?'<path d="'+D.escape(this.alternate)+'"/>':'<path d="'+D.escape(Be[this.pathName])+'"/>'}}class Dr{constructor(i){this.attributes=void 0,this.attributes=i||{}}toNode(){const i=document.createElementNS("http://www.w3.org/2000/svg","line");for(const l in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,l)&&i.setAttribute(l,this.attributes[l]);return i}toMarkup(){let i="<line";for(const l in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,l)&&(i+=" "+l+'="'+D.escape(this.attributes[l])+'"');return i+="/>",i}}function ot(s){if(s instanceof ht)return s;throw new Error("Expected symbolNode but got "+String(s)+".")}function Er(s){if(s instanceof gt)return s;throw new Error("Expected span<HtmlDomNode> but got "+String(s)+".")}const kr={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Vt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Jt={math:{},text:{}};var Ot=Jt;function x(s,i,l,h,y,E){Jt[s][y]={font:i,group:l,replace:h},E&&h&&(Jt[s][h]=Jt[s][y])}const v="math",oe="text",A="main",L="ams",be="accent-token",xe="bin",ke="close",Ie="inner",J="mathord",ce="op-token",he="open",He="punct",W="rel",lt="spacing",re="textord";x(v,A,W,"\u2261","\\equiv",!0),x(v,A,W,"\u227A","\\prec",!0),x(v,A,W,"\u227B","\\succ",!0),x(v,A,W,"\u223C","\\sim",!0),x(v,A,W,"\u22A5","\\perp"),x(v,A,W,"\u2AAF","\\preceq",!0),x(v,A,W,"\u2AB0","\\succeq",!0),x(v,A,W,"\u2243","\\simeq",!0),x(v,A,W,"\u2223","\\mid",!0),x(v,A,W,"\u226A","\\ll",!0),x(v,A,W,"\u226B","\\gg",!0),x(v,A,W,"\u224D","\\asymp",!0),x(v,A,W,"\u2225","\\parallel"),x(v,A,W,"\u22C8","\\bowtie",!0),x(v,A,W,"\u2323","\\smile",!0),x(v,A,W,"\u2291","\\sqsubseteq",!0),x(v,A,W,"\u2292","\\sqsupseteq",!0),x(v,A,W,"\u2250","\\doteq",!0),x(v,A,W,"\u2322","\\frown",!0),x(v,A,W,"\u220B","\\ni",!0),x(v,A,W,"\u221D","\\propto",!0),x(v,A,W,"\u22A2","\\vdash",!0),x(v,A,W,"\u22A3","\\dashv",!0),x(v,A,W,"\u220B","\\owns"),x(v,A,He,".","\\ldotp"),x(v,A,He,"\u22C5","\\cdotp"),x(v,A,re,"#","\\#"),x(oe,A,re,"#","\\#"),x(v,A,re,"&","\\&"),x(oe,A,re,"&","\\&"),x(v,A,re,"\u2135","\\aleph",!0),x(v,A,re,"\u2200","\\forall",!0),x(v,A,re,"\u210F","\\hbar",!0),x(v,A,re,"\u2203","\\exists",!0),x(v,A,re,"\u2207","\\nabla",!0),x(v,A,re,"\u266D","\\flat",!0),x(v,A,re,"\u2113","\\ell",!0),x(v,A,re,"\u266E","\\natural",!0),x(v,A,re,"\u2663","\\clubsuit",!0),x(v,A,re,"\u2118","\\wp",!0),x(v,A,re,"\u266F","\\sharp",!0),x(v,A,re,"\u2662","\\diamondsuit",!0),x(v,A,re,"\u211C","\\Re",!0),x(v,A,re,"\u2661","\\heartsuit",!0),x(v,A,re,"\u2111","\\Im",!0),x(v,A,re,"\u2660","\\spadesuit",!0),x(v,A,re,"\xA7","\\S",!0),x(oe,A,re,"\xA7","\\S"),x(v,A,re,"\xB6","\\P",!0),x(oe,A,re,"\xB6","\\P"),x(v,A,re,"\u2020","\\dag"),x(oe,A,re,"\u2020","\\dag"),x(oe,A,re,"\u2020","\\textdagger"),x(v,A,re,"\u2021","\\ddag"),x(oe,A,re,"\u2021","\\ddag"),x(oe,A,re,"\u2021","\\textdaggerdbl"),x(v,A,ke,"\u23B1","\\rmoustache",!0),x(v,A,he,"\u23B0","\\lmoustache",!0),x(v,A,ke,"\u27EF","\\rgroup",!0),x(v,A,he,"\u27EE","\\lgroup",!0),x(v,A,xe,"\u2213","\\mp",!0),x(v,A,xe,"\u2296","\\ominus",!0),x(v,A,xe,"\u228E","\\uplus",!0),x(v,A,xe,"\u2293","\\sqcap",!0),x(v,A,xe,"\u2217","\\ast"),x(v,A,xe,"\u2294","\\sqcup",!0),x(v,A,xe,"\u25EF","\\bigcirc",!0),x(v,A,xe,"\u2219","\\bullet",!0),x(v,A,xe,"\u2021","\\ddagger"),x(v,A,xe,"\u2240","\\wr",!0),x(v,A,xe,"\u2A3F","\\amalg"),x(v,A,xe,"&","\\And"),x(v,A,W,"\u27F5","\\longleftarrow",!0),x(v,A,W,"\u21D0","\\Leftarrow",!0),x(v,A,W,"\u27F8","\\Longleftarrow",!0),x(v,A,W,"\u27F6","\\longrightarrow",!0),x(v,A,W,"\u21D2","\\Rightarrow",!0),x(v,A,W,"\u27F9","\\Longrightarrow",!0),x(v,A,W,"\u2194","\\leftrightarrow",!0),x(v,A,W,"\u27F7","\\longleftrightarrow",!0),x(v,A,W,"\u21D4","\\Leftrightarrow",!0),x(v,A,W,"\u27FA","\\Longleftrightarrow",!0),x(v,A,W,"\u21A6","\\mapsto",!0),x(v,A,W,"\u27FC","\\longmapsto",!0),x(v,A,W,"\u2197","\\nearrow",!0),x(v,A,W,"\u21A9","\\hookleftarrow",!0),x(v,A,W,"\u21AA","\\hookrightarrow",!0),x(v,A,W,"\u2198","\\searrow",!0),x(v,A,W,"\u21BC","\\leftharpoonup",!0),x(v,A,W,"\u21C0","\\rightharpoonup",!0),x(v,A,W,"\u2199","\\swarrow",!0),x(v,A,W,"\u21BD","\\leftharpoondown",!0),x(v,A,W,"\u21C1","\\rightharpoondown",!0),x(v,A,W,"\u2196","\\nwarrow",!0),x(v,A,W,"\u21CC","\\rightleftharpoons",!0),x(v,L,W,"\u226E","\\nless",!0),x(v,L,W,"\uE010","\\@nleqslant"),x(v,L,W,"\uE011","\\@nleqq"),x(v,L,W,"\u2A87","\\lneq",!0),x(v,L,W,"\u2268","\\lneqq",!0),x(v,L,W,"\uE00C","\\@lvertneqq"),x(v,L,W,"\u22E6","\\lnsim",!0),x(v,L,W,"\u2A89","\\lnapprox",!0),x(v,L,W,"\u2280","\\nprec",!0),x(v,L,W,"\u22E0","\\npreceq",!0),x(v,L,W,"\u22E8","\\precnsim",!0),x(v,L,W,"\u2AB9","\\precnapprox",!0),x(v,L,W,"\u2241","\\nsim",!0),x(v,L,W,"\uE006","\\@nshortmid"),x(v,L,W,"\u2224","\\nmid",!0),x(v,L,W,"\u22AC","\\nvdash",!0),x(v,L,W,"\u22AD","\\nvDash",!0),x(v,L,W,"\u22EA","\\ntriangleleft"),x(v,L,W,"\u22EC","\\ntrianglelefteq",!0),x(v,L,W,"\u228A","\\subsetneq",!0),x(v,L,W,"\uE01A","\\@varsubsetneq"),x(v,L,W,"\u2ACB","\\subsetneqq",!0),x(v,L,W,"\uE017","\\@varsubsetneqq"),x(v,L,W,"\u226F","\\ngtr",!0),x(v,L,W,"\uE00F","\\@ngeqslant"),x(v,L,W,"\uE00E","\\@ngeqq"),x(v,L,W,"\u2A88","\\gneq",!0),x(v,L,W,"\u2269","\\gneqq",!0),x(v,L,W,"\uE00D","\\@gvertneqq"),x(v,L,W,"\u22E7","\\gnsim",!0),x(v,L,W,"\u2A8A","\\gnapprox",!0),x(v,L,W,"\u2281","\\nsucc",!0),x(v,L,W,"\u22E1","\\nsucceq",!0),x(v,L,W,"\u22E9","\\succnsim",!0),x(v,L,W,"\u2ABA","\\succnapprox",!0),x(v,L,W,"\u2246","\\ncong",!0),x(v,L,W,"\uE007","\\@nshortparallel"),x(v,L,W,"\u2226","\\nparallel",!0),x(v,L,W,"\u22AF","\\nVDash",!0),x(v,L,W,"\u22EB","\\ntriangleright"),x(v,L,W,"\u22ED","\\ntrianglerighteq",!0),x(v,L,W,"\uE018","\\@nsupseteqq"),x(v,L,W,"\u228B","\\supsetneq",!0),x(v,L,W,"\uE01B","\\@varsupsetneq"),x(v,L,W,"\u2ACC","\\supsetneqq",!0),x(v,L,W,"\uE019","\\@varsupsetneqq"),x(v,L,W,"\u22AE","\\nVdash",!0),x(v,L,W,"\u2AB5","\\precneqq",!0),x(v,L,W,"\u2AB6","\\succneqq",!0),x(v,L,W,"\uE016","\\@nsubseteqq"),x(v,L,xe,"\u22B4","\\unlhd"),x(v,L,xe,"\u22B5","\\unrhd"),x(v,L,W,"\u219A","\\nleftarrow",!0),x(v,L,W,"\u219B","\\nrightarrow",!0),x(v,L,W,"\u21CD","\\nLeftarrow",!0),x(v,L,W,"\u21CF","\\nRightarrow",!0),x(v,L,W,"\u21AE","\\nleftrightarrow",!0),x(v,L,W,"\u21CE","\\nLeftrightarrow",!0),x(v,L,W,"\u25B3","\\vartriangle"),x(v,L,re,"\u210F","\\hslash"),x(v,L,re,"\u25BD","\\triangledown"),x(v,L,re,"\u25CA","\\lozenge"),x(v,L,re,"\u24C8","\\circledS"),x(v,L,re,"\xAE","\\circledR"),x(oe,L,re,"\xAE","\\circledR"),x(v,L,re,"\u2221","\\measuredangle",!0),x(v,L,re,"\u2204","\\nexists"),x(v,L,re,"\u2127","\\mho"),x(v,L,re,"\u2132","\\Finv",!0),x(v,L,re,"\u2141","\\Game",!0),x(v,L,re,"\u2035","\\backprime"),x(v,L,re,"\u25B2","\\blacktriangle"),x(v,L,re,"\u25BC","\\blacktriangledown"),x(v,L,re,"\u25A0","\\blacksquare"),x(v,L,re,"\u29EB","\\blacklozenge"),x(v,L,re,"\u2605","\\bigstar"),x(v,L,re,"\u2222","\\sphericalangle",!0),x(v,L,re,"\u2201","\\complement",!0),x(v,L,re,"\xF0","\\eth",!0),x(oe,A,re,"\xF0","\xF0"),x(v,L,re,"\u2571","\\diagup"),x(v,L,re,"\u2572","\\diagdown"),x(v,L,re,"\u25A1","\\square"),x(v,L,re,"\u25A1","\\Box"),x(v,L,re,"\u25CA","\\Diamond"),x(v,L,re,"\xA5","\\yen",!0),x(oe,L,re,"\xA5","\\yen",!0),x(v,L,re,"\u2713","\\checkmark",!0),x(oe,L,re,"\u2713","\\checkmark"),x(v,L,re,"\u2136","\\beth",!0),x(v,L,re,"\u2138","\\daleth",!0),x(v,L,re,"\u2137","\\gimel",!0),x(v,L,re,"\u03DD","\\digamma",!0),x(v,L,re,"\u03F0","\\varkappa"),x(v,L,he,"\u250C","\\@ulcorner",!0),x(v,L,ke,"\u2510","\\@urcorner",!0),x(v,L,he,"\u2514","\\@llcorner",!0),x(v,L,ke,"\u2518","\\@lrcorner",!0),x(v,L,W,"\u2266","\\leqq",!0),x(v,L,W,"\u2A7D","\\leqslant",!0),x(v,L,W,"\u2A95","\\eqslantless",!0),x(v,L,W,"\u2272","\\lesssim",!0),x(v,L,W,"\u2A85","\\lessapprox",!0),x(v,L,W,"\u224A","\\approxeq",!0),x(v,L,xe,"\u22D6","\\lessdot"),x(v,L,W,"\u22D8","\\lll",!0),x(v,L,W,"\u2276","\\lessgtr",!0),x(v,L,W,"\u22DA","\\lesseqgtr",!0),x(v,L,W,"\u2A8B","\\lesseqqgtr",!0),x(v,L,W,"\u2251","\\doteqdot"),x(v,L,W,"\u2253","\\risingdotseq",!0),x(v,L,W,"\u2252","\\fallingdotseq",!0),x(v,L,W,"\u223D","\\backsim",!0),x(v,L,W,"\u22CD","\\backsimeq",!0),x(v,L,W,"\u2AC5","\\subseteqq",!0),x(v,L,W,"\u22D0","\\Subset",!0),x(v,L,W,"\u228F","\\sqsubset",!0),x(v,L,W,"\u227C","\\preccurlyeq",!0),x(v,L,W,"\u22DE","\\curlyeqprec",!0),x(v,L,W,"\u227E","\\precsim",!0),x(v,L,W,"\u2AB7","\\precapprox",!0),x(v,L,W,"\u22B2","\\vartriangleleft"),x(v,L,W,"\u22B4","\\trianglelefteq"),x(v,L,W,"\u22A8","\\vDash",!0),x(v,L,W,"\u22AA","\\Vvdash",!0),x(v,L,W,"\u2323","\\smallsmile"),x(v,L,W,"\u2322","\\smallfrown"),x(v,L,W,"\u224F","\\bumpeq",!0),x(v,L,W,"\u224E","\\Bumpeq",!0),x(v,L,W,"\u2267","\\geqq",!0),x(v,L,W,"\u2A7E","\\geqslant",!0),x(v,L,W,"\u2A96","\\eqslantgtr",!0),x(v,L,W,"\u2273","\\gtrsim",!0),x(v,L,W,"\u2A86","\\gtrapprox",!0),x(v,L,xe,"\u22D7","\\gtrdot"),x(v,L,W,"\u22D9","\\ggg",!0),x(v,L,W,"\u2277","\\gtrless",!0),x(v,L,W,"\u22DB","\\gtreqless",!0),x(v,L,W,"\u2A8C","\\gtreqqless",!0),x(v,L,W,"\u2256","\\eqcirc",!0),x(v,L,W,"\u2257","\\circeq",!0),x(v,L,W,"\u225C","\\triangleq",!0),x(v,L,W,"\u223C","\\thicksim"),x(v,L,W,"\u2248","\\thickapprox"),x(v,L,W,"\u2AC6","\\supseteqq",!0),x(v,L,W,"\u22D1","\\Supset",!0),x(v,L,W,"\u2290","\\sqsupset",!0),x(v,L,W,"\u227D","\\succcurlyeq",!0),x(v,L,W,"\u22DF","\\curlyeqsucc",!0),x(v,L,W,"\u227F","\\succsim",!0),x(v,L,W,"\u2AB8","\\succapprox",!0),x(v,L,W,"\u22B3","\\vartriangleright"),x(v,L,W,"\u22B5","\\trianglerighteq"),x(v,L,W,"\u22A9","\\Vdash",!0),x(v,L,W,"\u2223","\\shortmid"),x(v,L,W,"\u2225","\\shortparallel"),x(v,L,W,"\u226C","\\between",!0),x(v,L,W,"\u22D4","\\pitchfork",!0),x(v,L,W,"\u221D","\\varpropto"),x(v,L,W,"\u25C0","\\blacktriangleleft"),x(v,L,W,"\u2234","\\therefore",!0),x(v,L,W,"\u220D","\\backepsilon"),x(v,L,W,"\u25B6","\\blacktriangleright"),x(v,L,W,"\u2235","\\because",!0),x(v,L,W,"\u22D8","\\llless"),x(v,L,W,"\u22D9","\\gggtr"),x(v,L,xe,"\u22B2","\\lhd"),x(v,L,xe,"\u22B3","\\rhd"),x(v,L,W,"\u2242","\\eqsim",!0),x(v,A,W,"\u22C8","\\Join"),x(v,L,W,"\u2251","\\Doteq",!0),x(v,L,xe,"\u2214","\\dotplus",!0),x(v,L,xe,"\u2216","\\smallsetminus"),x(v,L,xe,"\u22D2","\\Cap",!0),x(v,L,xe,"\u22D3","\\Cup",!0),x(v,L,xe,"\u2A5E","\\doublebarwedge",!0),x(v,L,xe,"\u229F","\\boxminus",!0),x(v,L,xe,"\u229E","\\boxplus",!0),x(v,L,xe,"\u22C7","\\divideontimes",!0),x(v,L,xe,"\u22C9","\\ltimes",!0),x(v,L,xe,"\u22CA","\\rtimes",!0),x(v,L,xe,"\u22CB","\\leftthreetimes",!0),x(v,L,xe,"\u22CC","\\rightthreetimes",!0),x(v,L,xe,"\u22CF","\\curlywedge",!0),x(v,L,xe,"\u22CE","\\curlyvee",!0),x(v,L,xe,"\u229D","\\circleddash",!0),x(v,L,xe,"\u229B","\\circledast",!0),x(v,L,xe,"\u22C5","\\centerdot"),x(v,L,xe,"\u22BA","\\intercal",!0),x(v,L,xe,"\u22D2","\\doublecap"),x(v,L,xe,"\u22D3","\\doublecup"),x(v,L,xe,"\u22A0","\\boxtimes",!0),x(v,L,W,"\u21E2","\\dashrightarrow",!0),x(v,L,W,"\u21E0","\\dashleftarrow",!0),x(v,L,W,"\u21C7","\\leftleftarrows",!0),x(v,L,W,"\u21C6","\\leftrightarrows",!0),x(v,L,W,"\u21DA","\\Lleftarrow",!0),x(v,L,W,"\u219E","\\twoheadleftarrow",!0),x(v,L,W,"\u21A2","\\leftarrowtail",!0),x(v,L,W,"\u21AB","\\looparrowleft",!0),x(v,L,W,"\u21CB","\\leftrightharpoons",!0),x(v,L,W,"\u21B6","\\curvearrowleft",!0),x(v,L,W,"\u21BA","\\circlearrowleft",!0),x(v,L,W,"\u21B0","\\Lsh",!0),x(v,L,W,"\u21C8","\\upuparrows",!0),x(v,L,W,"\u21BF","\\upharpoonleft",!0),x(v,L,W,"\u21C3","\\downharpoonleft",!0),x(v,A,W,"\u22B6","\\origof",!0),x(v,A,W,"\u22B7","\\imageof",!0),x(v,L,W,"\u22B8","\\multimap",!0),x(v,L,W,"\u21AD","\\leftrightsquigarrow",!0),x(v,L,W,"\u21C9","\\rightrightarrows",!0),x(v,L,W,"\u21C4","\\rightleftarrows",!0),x(v,L,W,"\u21A0","\\twoheadrightarrow",!0),x(v,L,W,"\u21A3","\\rightarrowtail",!0),x(v,L,W,"\u21AC","\\looparrowright",!0),x(v,L,W,"\u21B7","\\curvearrowright",!0),x(v,L,W,"\u21BB","\\circlearrowright",!0),x(v,L,W,"\u21B1","\\Rsh",!0),x(v,L,W,"\u21CA","\\downdownarrows",!0),x(v,L,W,"\u21BE","\\upharpoonright",!0),x(v,L,W,"\u21C2","\\downharpoonright",!0),x(v,L,W,"\u21DD","\\rightsquigarrow",!0),x(v,L,W,"\u21DD","\\leadsto"),x(v,L,W,"\u21DB","\\Rrightarrow",!0),x(v,L,W,"\u21BE","\\restriction"),x(v,A,re,"\u2018","`"),x(v,A,re,"$","\\$"),x(oe,A,re,"$","\\$"),x(oe,A,re,"$","\\textdollar"),x(v,A,re,"%","\\%"),x(oe,A,re,"%","\\%"),x(v,A,re,"_","\\_"),x(oe,A,re,"_","\\_"),x(oe,A,re,"_","\\textunderscore"),x(v,A,re,"\u2220","\\angle",!0),x(v,A,re,"\u221E","\\infty",!0),x(v,A,re,"\u2032","\\prime"),x(v,A,re,"\u25B3","\\triangle"),x(v,A,re,"\u0393","\\Gamma",!0),x(v,A,re,"\u0394","\\Delta",!0),x(v,A,re,"\u0398","\\Theta",!0),x(v,A,re,"\u039B","\\Lambda",!0),x(v,A,re,"\u039E","\\Xi",!0),x(v,A,re,"\u03A0","\\Pi",!0),x(v,A,re,"\u03A3","\\Sigma",!0),x(v,A,re,"\u03A5","\\Upsilon",!0),x(v,A,re,"\u03A6","\\Phi",!0),x(v,A,re,"\u03A8","\\Psi",!0),x(v,A,re,"\u03A9","\\Omega",!0),x(v,A,re,"A","\u0391"),x(v,A,re,"B","\u0392"),x(v,A,re,"E","\u0395"),x(v,A,re,"Z","\u0396"),x(v,A,re,"H","\u0397"),x(v,A,re,"I","\u0399"),x(v,A,re,"K","\u039A"),x(v,A,re,"M","\u039C"),x(v,A,re,"N","\u039D"),x(v,A,re,"O","\u039F"),x(v,A,re,"P","\u03A1"),x(v,A,re,"T","\u03A4"),x(v,A,re,"X","\u03A7"),x(v,A,re,"\xAC","\\neg",!0),x(v,A,re,"\xAC","\\lnot"),x(v,A,re,"\u22A4","\\top"),x(v,A,re,"\u22A5","\\bot"),x(v,A,re,"\u2205","\\emptyset"),x(v,L,re,"\u2205","\\varnothing"),x(v,A,J,"\u03B1","\\alpha",!0),x(v,A,J,"\u03B2","\\beta",!0),x(v,A,J,"\u03B3","\\gamma",!0),x(v,A,J,"\u03B4","\\delta",!0),x(v,A,J,"\u03F5","\\epsilon",!0),x(v,A,J,"\u03B6","\\zeta",!0),x(v,A,J,"\u03B7","\\eta",!0),x(v,A,J,"\u03B8","\\theta",!0),x(v,A,J,"\u03B9","\\iota",!0),x(v,A,J,"\u03BA","\\kappa",!0),x(v,A,J,"\u03BB","\\lambda",!0),x(v,A,J,"\u03BC","\\mu",!0),x(v,A,J,"\u03BD","\\nu",!0),x(v,A,J,"\u03BE","\\xi",!0),x(v,A,J,"\u03BF","\\omicron",!0),x(v,A,J,"\u03C0","\\pi",!0),x(v,A,J,"\u03C1","\\rho",!0),x(v,A,J,"\u03C3","\\sigma",!0),x(v,A,J,"\u03C4","\\tau",!0),x(v,A,J,"\u03C5","\\upsilon",!0),x(v,A,J,"\u03D5","\\phi",!0),x(v,A,J,"\u03C7","\\chi",!0),x(v,A,J,"\u03C8","\\psi",!0),x(v,A,J,"\u03C9","\\omega",!0),x(v,A,J,"\u03B5","\\varepsilon",!0),x(v,A,J,"\u03D1","\\vartheta",!0),x(v,A,J,"\u03D6","\\varpi",!0),x(v,A,J,"\u03F1","\\varrho",!0),x(v,A,J,"\u03C2","\\varsigma",!0),x(v,A,J,"\u03C6","\\varphi",!0),x(v,A,xe,"\u2217","*",!0),x(v,A,xe,"+","+"),x(v,A,xe,"\u2212","-",!0),x(v,A,xe,"\u22C5","\\cdot",!0),x(v,A,xe,"\u2218","\\circ",!0),x(v,A,xe,"\xF7","\\div",!0),x(v,A,xe,"\xB1","\\pm",!0),x(v,A,xe,"\xD7","\\times",!0),x(v,A,xe,"\u2229","\\cap",!0),x(v,A,xe,"\u222A","\\cup",!0),x(v,A,xe,"\u2216","\\setminus",!0),x(v,A,xe,"\u2227","\\land"),x(v,A,xe,"\u2228","\\lor"),x(v,A,xe,"\u2227","\\wedge",!0),x(v,A,xe,"\u2228","\\vee",!0),x(v,A,re,"\u221A","\\surd"),x(v,A,he,"\u27E8","\\langle",!0),x(v,A,he,"\u2223","\\lvert"),x(v,A,he,"\u2225","\\lVert"),x(v,A,ke,"?","?"),x(v,A,ke,"!","!"),x(v,A,ke,"\u27E9","\\rangle",!0),x(v,A,ke,"\u2223","\\rvert"),x(v,A,ke,"\u2225","\\rVert"),x(v,A,W,"=","="),x(v,A,W,":",":"),x(v,A,W,"\u2248","\\approx",!0),x(v,A,W,"\u2245","\\cong",!0),x(v,A,W,"\u2265","\\ge"),x(v,A,W,"\u2265","\\geq",!0),x(v,A,W,"\u2190","\\gets"),x(v,A,W,">","\\gt",!0),x(v,A,W,"\u2208","\\in",!0),x(v,A,W,"\uE020","\\@not"),x(v,A,W,"\u2282","\\subset",!0),x(v,A,W,"\u2283","\\supset",!0),x(v,A,W,"\u2286","\\subseteq",!0),x(v,A,W,"\u2287","\\supseteq",!0),x(v,L,W,"\u2288","\\nsubseteq",!0),x(v,L,W,"\u2289","\\nsupseteq",!0),x(v,A,W,"\u22A8","\\models"),x(v,A,W,"\u2190","\\leftarrow",!0),x(v,A,W,"\u2264","\\le"),x(v,A,W,"\u2264","\\leq",!0),x(v,A,W,"<","\\lt",!0),x(v,A,W,"\u2192","\\rightarrow",!0),x(v,A,W,"\u2192","\\to"),x(v,L,W,"\u2271","\\ngeq",!0),x(v,L,W,"\u2270","\\nleq",!0),x(v,A,lt,"\xA0","\\ "),x(v,A,lt,"\xA0","\\space"),x(v,A,lt,"\xA0","\\nobreakspace"),x(oe,A,lt,"\xA0","\\ "),x(oe,A,lt,"\xA0"," "),x(oe,A,lt,"\xA0","\\space"),x(oe,A,lt,"\xA0","\\nobreakspace"),x(v,A,lt,null,"\\nobreak"),x(v,A,lt,null,"\\allowbreak"),x(v,A,He,",",","),x(v,A,He,";",";"),x(v,L,xe,"\u22BC","\\barwedge",!0),x(v,L,xe,"\u22BB","\\veebar",!0),x(v,A,xe,"\u2299","\\odot",!0),x(v,A,xe,"\u2295","\\oplus",!0),x(v,A,xe,"\u2297","\\otimes",!0),x(v,A,re,"\u2202","\\partial",!0),x(v,A,xe,"\u2298","\\oslash",!0),x(v,L,xe,"\u229A","\\circledcirc",!0),x(v,L,xe,"\u22A1","\\boxdot",!0),x(v,A,xe,"\u25B3","\\bigtriangleup"),x(v,A,xe,"\u25BD","\\bigtriangledown"),x(v,A,xe,"\u2020","\\dagger"),x(v,A,xe,"\u22C4","\\diamond"),x(v,A,xe,"\u22C6","\\star"),x(v,A,xe,"\u25C3","\\triangleleft"),x(v,A,xe,"\u25B9","\\triangleright"),x(v,A,he,"{","\\{"),x(oe,A,re,"{","\\{"),x(oe,A,re,"{","\\textbraceleft"),x(v,A,ke,"}","\\}"),x(oe,A,re,"}","\\}"),x(oe,A,re,"}","\\textbraceright"),x(v,A,he,"{","\\lbrace"),x(v,A,ke,"}","\\rbrace"),x(v,A,he,"[","\\lbrack",!0),x(oe,A,re,"[","\\lbrack",!0),x(v,A,ke,"]","\\rbrack",!0),x(oe,A,re,"]","\\rbrack",!0),x(v,A,he,"(","\\lparen",!0),x(v,A,ke,")","\\rparen",!0),x(oe,A,re,"<","\\textless",!0),x(oe,A,re,">","\\textgreater",!0),x(v,A,he,"\u230A","\\lfloor",!0),x(v,A,ke,"\u230B","\\rfloor",!0),x(v,A,he,"\u2308","\\lceil",!0),x(v,A,ke,"\u2309","\\rceil",!0),x(v,A,re,"\\","\\backslash"),x(v,A,re,"\u2223","|"),x(v,A,re,"\u2223","\\vert"),x(oe,A,re,"|","\\textbar",!0),x(v,A,re,"\u2225","\\|"),x(v,A,re,"\u2225","\\Vert"),x(oe,A,re,"\u2225","\\textbardbl"),x(oe,A,re,"~","\\textasciitilde"),x(oe,A,re,"\\","\\textbackslash"),x(oe,A,re,"^","\\textasciicircum"),x(v,A,W,"\u2191","\\uparrow",!0),x(v,A,W,"\u21D1","\\Uparrow",!0),x(v,A,W,"\u2193","\\downarrow",!0),x(v,A,W,"\u21D3","\\Downarrow",!0),x(v,A,W,"\u2195","\\updownarrow",!0),x(v,A,W,"\u21D5","\\Updownarrow",!0),x(v,A,ce,"\u2210","\\coprod"),x(v,A,ce,"\u22C1","\\bigvee"),x(v,A,ce,"\u22C0","\\bigwedge"),x(v,A,ce,"\u2A04","\\biguplus"),x(v,A,ce,"\u22C2","\\bigcap"),x(v,A,ce,"\u22C3","\\bigcup"),x(v,A,ce,"\u222B","\\int"),x(v,A,ce,"\u222B","\\intop"),x(v,A,ce,"\u222C","\\iint"),x(v,A,ce,"\u222D","\\iiint"),x(v,A,ce,"\u220F","\\prod"),x(v,A,ce,"\u2211","\\sum"),x(v,A,ce,"\u2A02","\\bigotimes"),x(v,A,ce,"\u2A01","\\bigoplus"),x(v,A,ce,"\u2A00","\\bigodot"),x(v,A,ce,"\u222E","\\oint"),x(v,A,ce,"\u222F","\\oiint"),x(v,A,ce,"\u2230","\\oiiint"),x(v,A,ce,"\u2A06","\\bigsqcup"),x(v,A,ce,"\u222B","\\smallint"),x(oe,A,Ie,"\u2026","\\textellipsis"),x(v,A,Ie,"\u2026","\\mathellipsis"),x(oe,A,Ie,"\u2026","\\ldots",!0),x(v,A,Ie,"\u2026","\\ldots",!0),x(v,A,Ie,"\u22EF","\\@cdots",!0),x(v,A,Ie,"\u22F1","\\ddots",!0),x(v,A,re,"\u22EE","\\varvdots"),x(oe,A,re,"\u22EE","\\varvdots"),x(v,A,be,"\u02CA","\\acute"),x(v,A,be,"\u02CB","\\grave"),x(v,A,be,"\xA8","\\ddot"),x(v,A,be,"~","\\tilde"),x(v,A,be,"\u02C9","\\bar"),x(v,A,be,"\u02D8","\\breve"),x(v,A,be,"\u02C7","\\check"),x(v,A,be,"^","\\hat"),x(v,A,be,"\u20D7","\\vec"),x(v,A,be,"\u02D9","\\dot"),x(v,A,be,"\u02DA","\\mathring"),x(v,A,J,"\uE131","\\@imath"),x(v,A,J,"\uE237","\\@jmath"),x(v,A,re,"\u0131","\u0131"),x(v,A,re,"\u0237","\u0237"),x(oe,A,re,"\u0131","\\i",!0),x(oe,A,re,"\u0237","\\j",!0),x(oe,A,re,"\xDF","\\ss",!0),x(oe,A,re,"\xE6","\\ae",!0),x(oe,A,re,"\u0153","\\oe",!0),x(oe,A,re,"\xF8","\\o",!0),x(oe,A,re,"\xC6","\\AE",!0),x(oe,A,re,"\u0152","\\OE",!0),x(oe,A,re,"\xD8","\\O",!0),x(oe,A,be,"\u02CA","\\'"),x(oe,A,be,"\u02CB","\\`"),x(oe,A,be,"\u02C6","\\^"),x(oe,A,be,"\u02DC","\\~"),x(oe,A,be,"\u02C9","\\="),x(oe,A,be,"\u02D8","\\u"),x(oe,A,be,"\u02D9","\\."),x(oe,A,be,"\xB8","\\c"),x(oe,A,be,"\u02DA","\\r"),x(oe,A,be,"\u02C7","\\v"),x(oe,A,be,"\xA8",'\\"'),x(oe,A,be,"\u02DD","\\H"),x(oe,A,be,"\u25EF","\\textcircled");const et={"--":!0,"---":!0,"``":!0,"''":!0};x(oe,A,re,"\u2013","--",!0),x(oe,A,re,"\u2013","\\textendash"),x(oe,A,re,"\u2014","---",!0),x(oe,A,re,"\u2014","\\textemdash"),x(oe,A,re,"\u2018","`",!0),x(oe,A,re,"\u2018","\\textquoteleft"),x(oe,A,re,"\u2019","'",!0),x(oe,A,re,"\u2019","\\textquoteright"),x(oe,A,re,"\u201C","``",!0),x(oe,A,re,"\u201C","\\textquotedblleft"),x(oe,A,re,"\u201D","''",!0),x(oe,A,re,"\u201D","\\textquotedblright"),x(v,A,re,"\xB0","\\degree",!0),x(oe,A,re,"\xB0","\\degree"),x(oe,A,re,"\xB0","\\textdegree",!0),x(v,A,re,"\xA3","\\pounds"),x(v,A,re,"\xA3","\\mathsterling",!0),x(oe,A,re,"\xA3","\\pounds"),x(oe,A,re,"\xA3","\\textsterling",!0),x(v,L,re,"\u2720","\\maltese"),x(oe,L,re,"\u2720","\\maltese");const kt='0123456789/@."';for(let s=0;s<kt.length;s++){const i=kt.charAt(s);x(v,A,re,i,i)}const xr='0123456789!@*()-=+";:?/.,';for(let s=0;s<xr.length;s++){const i=xr.charAt(s);x(oe,A,re,i,i)}const _t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let s=0;s<_t.length;s++){const i=_t.charAt(s);x(v,A,J,i,i),x(oe,A,re,i,i)}x(v,L,re,"C","\u2102"),x(oe,L,re,"C","\u2102"),x(v,L,re,"H","\u210D"),x(oe,L,re,"H","\u210D"),x(v,L,re,"N","\u2115"),x(oe,L,re,"N","\u2115"),x(v,L,re,"P","\u2119"),x(oe,L,re,"P","\u2119"),x(v,L,re,"Q","\u211A"),x(oe,L,re,"Q","\u211A"),x(v,L,re,"R","\u211D"),x(oe,L,re,"R","\u211D"),x(v,L,re,"Z","\u2124"),x(oe,L,re,"Z","\u2124"),x(v,A,J,"h","\u210E"),x(oe,A,J,"h","\u210E");let st="";for(let s=0;s<_t.length;s++){const i=_t.charAt(s);st=String.fromCharCode(55349,56320+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,56372+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,56424+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,56580+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,56684+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,56736+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,56788+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,56840+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,56944+s),x(v,A,J,i,st),x(oe,A,re,i,st),s<26&&(st=String.fromCharCode(55349,56632+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,56476+s),x(v,A,J,i,st),x(oe,A,re,i,st))}st="\u{1D55C}",x(v,A,J,"k",st),x(oe,A,re,"k",st);for(let s=0;s<10;s++){const i=s.toString();st=String.fromCharCode(55349,57294+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,57314+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,57324+s),x(v,A,J,i,st),x(oe,A,re,i,st),st=String.fromCharCode(55349,57334+s),x(v,A,J,i,st),x(oe,A,re,i,st)}const Sn="\xD0\xDE\xFE";for(let s=0;s<Sn.length;s++){const i=Sn.charAt(s);x(v,A,J,i,i),x(oe,A,re,i,i)}const to=[["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"]],xo=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Ca=function(s,i){const l=s.charCodeAt(0),h=s.charCodeAt(1),y=(l-55296)*1024+(h-56320)+65536,E=i==="math"?0:1;if(119808<=y&&y<120484){const N=Math.floor((y-119808)/26);return[to[N][2],to[N][E]]}else if(120782<=y&&y<=120831){const N=Math.floor((y-120782)/10);return[xo[N][2],xo[N][E]]}else{if(y===120485||y===120486)return[to[0][2],to[0][E]];if(120486<y&&y<120782)return["",""];throw new a("Unsupported character: "+s)}};class pn{constructor(i){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=i,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(i){return this.classes.includes(i)}toNode(){const i=document.createDocumentFragment();for(let l=0;l<this.children.length;l++)i.appendChild(this.children[l].toNode());return i}toMarkup(){let i="";for(let l=0;l<this.children.length;l++)i+=this.children[l].toMarkup();return i}toText(){const i=l=>l.toText();return this.children.map(i).join("")}}const Qr=function(s,i,l){return Ot[l][s]&&Ot[l][s].replace&&(s=Ot[l][s].replace),{value:s,metrics:ut(s,i,l)}},jr=function(s,i,l,h,y){const E=Qr(s,i,l),N=E.metrics;s=E.value;let P;if(N){let Y=N.italic;(l==="text"||h&&h.font==="mathit")&&(Y=0),P=new ht(s,N.height,N.depth,Y,N.skew,N.width,y)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+s+"' in style '"+i+"' and mode '"+l+"'")),P=new ht(s,0,0,0,0,0,y);if(h){P.maxFontSize=h.sizeMultiplier,h.style.isTight()&&P.classes.push("mtight");const Y=h.getColor();Y&&(P.style.color=Y)}return P},wa=function(s,i,l,h){return h===void 0&&(h=[]),l.font==="boldsymbol"&&Qr(s,"Main-Bold",i).metrics?jr(s,"Main-Bold",i,l,h.concat(["mathbf"])):s==="\\"||Ot[i][s].font==="main"?jr(s,"Main-Regular",i,l,h):jr(s,"AMS-Regular",i,l,h.concat(["amsrm"]))},Ho=function(s,i,l,h,y){return y!=="textord"&&Qr(s,"Math-BoldItalic",i).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Co=function(s,i,l){const h=s.mode,y=s.text,E=["mord"],N=h==="math"||h==="text"&&i.font,P=N?i.font:i.fontFamily;let Y="",ne="";if(y.charCodeAt(0)===55349&&([Y,ne]=Ca(y,h)),Y.length>0)return jr(y,Y,h,i,E.concat(ne));if(P){let fe,ve;if(P==="boldsymbol"){const Se=Ho(y,h,i,E,l);fe=Se.fontName,ve=[Se.fontClass]}else N?(fe=Ln[P].fontName,ve=[P]):(fe=_n(P,i.fontWeight,i.fontShape),ve=[P,i.fontWeight,i.fontShape]);if(Qr(y,fe,h).metrics)return jr(y,fe,h,i,E.concat(ve));if(et.hasOwnProperty(y)&&fe.slice(0,10)==="Typewriter"){const Se=[];for(let We=0;We<y.length;We++)Se.push(jr(y[We],fe,h,i,E.concat(ve)));return Ut(Se)}}if(l==="mathord")return jr(y,"Math-Italic",h,i,E.concat(["mathnormal"]));if(l==="textord"){const fe=Ot[h][y]&&Ot[h][y].font;if(fe==="ams"){const ve=_n("amsrm",i.fontWeight,i.fontShape);return jr(y,ve,h,i,E.concat("amsrm",i.fontWeight,i.fontShape))}else if(fe==="main"||!fe){const ve=_n("textrm",i.fontWeight,i.fontShape);return jr(y,ve,h,i,E.concat(i.fontWeight,i.fontShape))}else{const ve=_n(fe,i.fontWeight,i.fontShape);return jr(y,ve,h,i,E.concat(ve,i.fontWeight,i.fontShape))}}else throw new Error("unexpected type: "+l+" in makeOrd")},Da=(s,i)=>{if(it(s.classes)!==it(i.classes)||s.skew!==i.skew||s.maxFontSize!==i.maxFontSize)return!1;if(s.classes.length===1){const l=s.classes[0];if(l==="mbin"||l==="mord")return!1}for(const l in s.style)if(s.style.hasOwnProperty(l)&&s.style[l]!==i.style[l])return!1;for(const l in i.style)if(i.style.hasOwnProperty(l)&&s.style[l]!==i.style[l])return!1;return!0},Ea=s=>{for(let i=0;i<s.length-1;i++){const l=s[i],h=s[i+1];l instanceof ht&&h instanceof ht&&Da(l,h)&&(l.text+=h.text,l.height=Math.max(l.height,h.height),l.depth=Math.max(l.depth,h.depth),l.italic=h.italic,s.splice(i+1,1),i--)}return s},wo=function(s){let i=0,l=0,h=0;for(let y=0;y<s.children.length;y++){const E=s.children[y];E.height>i&&(i=E.height),E.depth>l&&(l=E.depth),E.maxFontSize>h&&(h=E.maxFontSize)}s.height=i,s.depth=l,s.maxFontSize=h},Fr=function(s,i,l,h){const y=new gt(s,i,l,h);return wo(y),y},Bn=(s,i,l,h)=>new gt(s,i,l,h),ar=function(s,i,l){const h=Fr([s],[],i);return h.height=Math.max(l||i.fontMetrics().defaultRuleThickness,i.minRuleThickness),h.style.borderBottomWidth=de(h.height),h.maxFontSize=1,h},jt=function(s,i,l,h){const y=new Zt(s,i,l,h);return wo(y),y},Ut=function(s){const i=new pn(s);return wo(i),i},Tr=function(s,i){return s instanceof pn?Fr([],[s],i):s},Sr=function(s){if(s.positionType==="individualShift"){const l=s.children,h=[l[0]],y=-l[0].shift-l[0].elem.depth;let E=y;for(let N=1;N<l.length;N++){const P=-l[N].shift-E-l[N].elem.depth,Y=P-(l[N-1].elem.height+l[N-1].elem.depth);E=E+P,h.push({type:"kern",size:Y}),h.push(l[N])}return{children:h,depth:y}}let i;if(s.positionType==="top"){let l=s.positionData;for(let h=0;h<s.children.length;h++){const y=s.children[h];l-=y.type==="kern"?y.size:y.elem.height+y.elem.depth}i=l}else if(s.positionType==="bottom")i=-s.positionData;else{const l=s.children[0];if(l.type!=="elem")throw new Error('First child must have type "elem".');if(s.positionType==="shift")i=-l.elem.depth-s.positionData;else if(s.positionType==="firstBaseline")i=-l.elem.depth;else throw new Error("Invalid positionType "+s.positionType+".")}return{children:s.children,depth:i}},jn=function(s,i){const{children:l,depth:h}=Sr(s);let y=0;for(let We=0;We<l.length;We++){const Ze=l[We];if(Ze.type==="elem"){const Bt=Ze.elem;y=Math.max(y,Bt.maxFontSize,Bt.height)}}y+=2;const E=Fr(["pstrut"],[]);E.style.height=de(y);const N=[];let P=h,Y=h,ne=h;for(let We=0;We<l.length;We++){const Ze=l[We];if(Ze.type==="kern")ne+=Ze.size;else{const Bt=Ze.elem,zt=Ze.wrapperClasses||[],Mt=Ze.wrapperStyle||{},Kt=Fr(zt,[E,Bt],void 0,Mt);Kt.style.top=de(-y-ne-Bt.depth),Ze.marginLeft&&(Kt.style.marginLeft=Ze.marginLeft),Ze.marginRight&&(Kt.style.marginRight=Ze.marginRight),N.push(Kt),ne+=Bt.height+Bt.depth}P=Math.min(P,ne),Y=Math.max(Y,ne)}const fe=Fr(["vlist"],N);fe.style.height=de(Y);let ve;if(P<0){const We=Fr([],[]),Ze=Fr(["vlist"],[We]);Ze.style.height=de(-P);const Bt=Fr(["vlist-s"],[new ht("\u200B")]);ve=[Fr(["vlist-r"],[fe,Bt]),Fr(["vlist-r"],[Ze])]}else ve=[Fr(["vlist-r"],[fe])];const Se=Fr(["vlist-t"],ve);return ve.length===2&&Se.classes.push("vlist-t2"),Se.height=Y,Se.depth=-P,Se},Do=(s,i)=>{const l=Fr(["mspace"],[],i),h=$e(s,i);return l.style.marginRight=de(h),l},_n=function(s,i,l){let h="";switch(s){case"amsrm":h="AMS";break;case"textrm":h="Main";break;case"textsf":h="SansSerif";break;case"texttt":h="Typewriter";break;default:h=s}let y;return i==="textbf"&&l==="textit"?y="BoldItalic":i==="textbf"?y="Bold":i==="textit"?y="Italic":y="Regular",h+"-"+y},Ln={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"}},ro={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]};var ge={fontMap:Ln,makeSymbol:jr,mathsym:wa,makeSpan:Fr,makeSvgSpan:Bn,makeLineSpan:ar,makeAnchor:jt,makeFragment:Ut,wrapFragment:Tr,makeVList:jn,makeOrd:Co,makeGlue:Do,staticSvg:function(s,i){const[l,h,y]=ro[s],E=new or(l),N=new gr([E],{width:de(h),height:de(y),style:"width:"+de(h),viewBox:"0 0 "+1e3*h+" "+1e3*y,preserveAspectRatio:"xMinYMin"}),P=Bn(["overlay"],[N],i);return P.height=y,P.style.height=de(y),P.style.width=de(h),P},svgData:ro,tryCombineChars:Ea};const Yt={number:3,unit:"mu"},mn={number:4,unit:"mu"},Ct={number:5,unit:"mu"},$t={mord:{mop:Yt,mbin:mn,mrel:Ct,minner:Yt},mop:{mord:Yt,mop:Yt,mrel:Ct,minner:Yt},mbin:{mord:mn,mop:mn,mopen:mn,minner:mn},mrel:{mord:Ct,mop:Ct,mopen:Ct,minner:Ct},mopen:{},mclose:{mop:Yt,mbin:mn,mrel:Ct,minner:Yt},mpunct:{mord:Yt,mop:Yt,mrel:Ct,mopen:Yt,mclose:Yt,mpunct:Yt,minner:Yt},minner:{mord:Yt,mop:Yt,mbin:mn,mrel:Ct,mopen:Yt,mpunct:Yt,minner:Yt}},Nr={mord:{mop:Yt},mop:{mord:Yt,mop:Yt},mbin:{},mrel:{},mopen:{},mclose:{mop:Yt},mpunct:{},minner:{mop:Yt}},Kr={},Cr={},gn={};function Qe(s){let{type:i,names:l,props:h,handler:y,htmlBuilder:E,mathmlBuilder:N}=s;const P={type:i,numArgs:h.numArgs,argTypes:h.argTypes,allowedInArgument:!!h.allowedInArgument,allowedInText:!!h.allowedInText,allowedInMath:h.allowedInMath===void 0?!0:h.allowedInMath,numOptionalArgs:h.numOptionalArgs||0,infix:!!h.infix,primitive:!!h.primitive,handler:y};for(let Y=0;Y<l.length;++Y)Kr[l[Y]]=P;i&&(E&&(Cr[i]=E),N&&(gn[i]=N))}function qr(s){let{type:i,htmlBuilder:l,mathmlBuilder:h}=s;Qe({type:i,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:l,mathmlBuilder:h})}const An=function(s){return s.type==="ordgroup"&&s.body.length===1?s.body[0]:s},ur=function(s){return s.type==="ordgroup"?s.body:[s]},Hn=ge.makeSpan,Dg=["leftmost","mbin","mopen","mrel","mop","mpunct"],Eg=["rightmost","mrel","mclose","mpunct"],kg={display:q.DISPLAY,text:q.TEXT,script:q.SCRIPT,scriptscript:q.SCRIPTSCRIPT},Sg={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Or=function(s,i,l,h){h===void 0&&(h=[null,null]);const y=[];for(let ne=0;ne<s.length;ne++){const fe=Lt(s[ne],i);if(fe instanceof pn){const ve=fe.children;y.push(...ve)}else y.push(fe)}if(ge.tryCombineChars(y),!l)return y;let E=i;if(s.length===1){const ne=s[0];ne.type==="sizing"?E=i.havingSize(ne.size):ne.type==="styling"&&(E=i.havingStyle(kg[ne.style]))}const N=Hn([h[0]||"leftmost"],[],i),P=Hn([h[1]||"rightmost"],[],i),Y=l==="root";return Zs(y,(ne,fe)=>{const ve=fe.classes[0],Se=ne.classes[0];ve==="mbin"&&Eg.includes(Se)?fe.classes[0]="mord":Se==="mbin"&&Dg.includes(ve)&&(ne.classes[0]="mord")},{node:N},P,Y),Zs(y,(ne,fe)=>{const ve=el(fe),Se=el(ne),We=ve&&Se?ne.hasClass("mtight")?Nr[ve][Se]:$t[ve][Se]:null;if(We)return ge.makeGlue(We,E)},{node:N},P,Y),y},Zs=function(s,i,l,h,y){h&&s.push(h);let E=0;for(;E<s.length;E++){const N=s[E],P=gc(N);if(P){Zs(P.children,i,l,null,y);continue}const Y=!N.hasClass("mspace");if(Y){const ne=i(N,l.node);ne&&(l.insertAfter?l.insertAfter(ne):(s.unshift(ne),E++))}Y?l.node=N:y&&N.hasClass("newline")&&(l.node=Hn(["leftmost"])),l.insertAfter=(ne=>fe=>{s.splice(ne+1,0,fe),E++})(E)}h&&s.pop()},gc=function(s){return s instanceof pn||s instanceof Zt||s instanceof gt&&s.hasClass("enclosing")?s:null},Js=function(s,i){const l=gc(s);if(l){const h=l.children;if(h.length){if(i==="right")return Js(h[h.length-1],"right");if(i==="left")return Js(h[0],"left")}}return s},el=function(s,i){return s?(i&&(s=Js(s,i)),Sg[s.classes[0]]||null):null},ka=function(s,i){const l=["nulldelimiter"].concat(s.baseSizingClasses());return Hn(i.concat(l))},Lt=function(s,i,l){if(!s)return Hn();if(Cr[s.type]){let h=Cr[s.type](s,i);if(l&&i.size!==l.size){h=Hn(i.sizingClasses(l),[h],i);const y=i.sizeMultiplier/l.sizeMultiplier;h.height*=y,h.depth*=y}return h}else throw new a("Got group of unknown type: '"+s.type+"'")};function pi(s,i){const l=Hn(["base"],s,i),h=Hn(["strut"]);return h.style.height=de(l.height+l.depth),l.depth&&(h.style.verticalAlign=de(-l.depth)),l.children.unshift(h),l}function tl(s,i){let l=null;s.length===1&&s[0].type==="tag"&&(l=s[0].tag,s=s[0].body);const h=Or(s,i,"root");let y;h.length===2&&h[1].hasClass("tag")&&(y=h.pop());const E=[];let N=[];for(let ne=0;ne<h.length;ne++)if(N.push(h[ne]),h[ne].hasClass("mbin")||h[ne].hasClass("mrel")||h[ne].hasClass("allowbreak")){let fe=!1;for(;ne<h.length-1&&h[ne+1].hasClass("mspace")&&!h[ne+1].hasClass("newline");)ne++,N.push(h[ne]),h[ne].hasClass("nobreak")&&(fe=!0);fe||(E.push(pi(N,i)),N=[])}else h[ne].hasClass("newline")&&(N.pop(),N.length>0&&(E.push(pi(N,i)),N=[]),E.push(h[ne]));N.length>0&&E.push(pi(N,i));let P;l?(P=pi(Or(l,i,!0)),P.classes=["tag"],E.push(P)):y&&E.push(y);const Y=Hn(["katex-html"],E);if(Y.setAttribute("aria-hidden","true"),P){const ne=P.children[0];ne.style.height=de(Y.height+Y.depth),Y.depth&&(ne.style.verticalAlign=de(-Y.depth))}return Y}function vc(s){return new pn(s)}class nn{constructor(i,l,h){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=i,this.attributes={},this.children=l||[],this.classes=h||[]}setAttribute(i,l){this.attributes[i]=l}getAttribute(i){return this.attributes[i]}toNode(){const i=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(const l in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,l)&&i.setAttribute(l,this.attributes[l]);this.classes.length>0&&(i.className=it(this.classes));for(let l=0;l<this.children.length;l++)if(this.children[l]instanceof Fn&&this.children[l+1]instanceof Fn){let h=this.children[l].toText()+this.children[++l].toText();for(;this.children[l+1]instanceof Fn;)h+=this.children[++l].toText();i.appendChild(new Fn(h).toNode())}else i.appendChild(this.children[l].toNode());return i}toMarkup(){let i="<"+this.type;for(const l in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,l)&&(i+=" "+l+'="',i+=D.escape(this.attributes[l]),i+='"');this.classes.length>0&&(i+=' class ="'+D.escape(it(this.classes))+'"'),i+=">";for(let l=0;l<this.children.length;l++)i+=this.children[l].toMarkup();return i+="</"+this.type+">",i}toText(){return this.children.map(i=>i.toText()).join("")}}class Fn{constructor(i){this.text=void 0,this.text=i}toNode(){return document.createTextNode(this.text)}toMarkup(){return D.escape(this.toText())}toText(){return this.text}}class Bg{constructor(i){this.width=void 0,this.character=void 0,this.width=i,i>=.05555&&i<=.05556?this.character="\u200A":i>=.1666&&i<=.1667?this.character="\u2009":i>=.2222&&i<=.2223?this.character="\u2005":i>=.2777&&i<=.2778?this.character="\u2005\u200A":i>=-.05556&&i<=-.05555?this.character="\u200A\u2063":i>=-.1667&&i<=-.1666?this.character="\u2009\u2063":i>=-.2223&&i<=-.2222?this.character="\u205F\u2063":i>=-.2778&&i<=-.2777?this.character="\u2005\u2063":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);{const i=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return i.setAttribute("width",de(this.width)),i}}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+de(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Ke={MathNode:nn,TextNode:Fn,SpaceNode:Bg,newDocumentFragment:vc};const ln=function(s,i,l){return Ot[i][s]&&Ot[i][s].replace&&s.charCodeAt(0)!==55349&&!(et.hasOwnProperty(s)&&l&&(l.fontFamily&&l.fontFamily.slice(4,6)==="tt"||l.font&&l.font.slice(4,6)==="tt"))&&(s=Ot[i][s].replace),new Ke.TextNode(s)},rl=function(s){return s.length===1?s[0]:new Ke.MathNode("mrow",s)},nl=function(s,i){if(i.fontFamily==="texttt")return"monospace";if(i.fontFamily==="textsf")return i.fontShape==="textit"&&i.fontWeight==="textbf"?"sans-serif-bold-italic":i.fontShape==="textit"?"sans-serif-italic":i.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(i.fontShape==="textit"&&i.fontWeight==="textbf")return"bold-italic";if(i.fontShape==="textit")return"italic";if(i.fontWeight==="textbf")return"bold";const l=i.font;if(!l||l==="mathnormal")return null;const h=s.mode;if(l==="mathit")return"italic";if(l==="boldsymbol")return s.type==="textord"?"bold":"bold-italic";if(l==="mathbf")return"bold";if(l==="mathbb")return"double-struck";if(l==="mathsfit")return"sans-serif-italic";if(l==="mathfrak")return"fraktur";if(l==="mathscr"||l==="mathcal")return"script";if(l==="mathsf")return"sans-serif";if(l==="mathtt")return"monospace";let y=s.text;if(["\\imath","\\jmath"].includes(y))return null;Ot[h][y]&&Ot[h][y].replace&&(y=Ot[h][y].replace);const E=ge.fontMap[l].fontName;return ut(y,E,h)?ge.fontMap[l].variant:null};function ol(s){if(!s)return!1;if(s.type==="mi"&&s.children.length===1){const i=s.children[0];return i instanceof Fn&&i.text==="."}else if(s.type==="mo"&&s.children.length===1&&s.getAttribute("separator")==="true"&&s.getAttribute("lspace")==="0em"&&s.getAttribute("rspace")==="0em"){const i=s.children[0];return i instanceof Fn&&i.text===","}else return!1}const Zr=function(s,i,l){if(s.length===1){const E=ir(s[0],i);return l&&E instanceof nn&&E.type==="mo"&&(E.setAttribute("lspace","0em"),E.setAttribute("rspace","0em")),[E]}const h=[];let y;for(let E=0;E<s.length;E++){const N=ir(s[E],i);if(N instanceof nn&&y instanceof nn){if(N.type==="mtext"&&y.type==="mtext"&&N.getAttribute("mathvariant")===y.getAttribute("mathvariant")){y.children.push(...N.children);continue}else if(N.type==="mn"&&y.type==="mn"){y.children.push(...N.children);continue}else if(ol(N)&&y.type==="mn"){y.children.push(...N.children);continue}else if(N.type==="mn"&&ol(y))N.children=[...y.children,...N.children],h.pop();else if((N.type==="msup"||N.type==="msub")&&N.children.length>=1&&(y.type==="mn"||ol(y))){const P=N.children[0];P instanceof nn&&P.type==="mn"&&(P.children=[...y.children,...P.children],h.pop())}else if(y.type==="mi"&&y.children.length===1){const P=y.children[0];if(P instanceof Fn&&P.text==="\u0338"&&(N.type==="mo"||N.type==="mi"||N.type==="mn")){const Y=N.children[0];Y instanceof Fn&&Y.text.length>0&&(Y.text=Y.text.slice(0,1)+"\u0338"+Y.text.slice(1),h.pop())}}}h.push(N),y=N}return h},no=function(s,i,l){return rl(Zr(s,i,l))},ir=function(s,i){if(!s)return new Ke.MathNode("mrow");if(gn[s.type])return gn[s.type](s,i);throw new a("Got group of unknown type: '"+s.type+"'")};function bc(s,i,l,h,y){const E=Zr(s,l);let N;E.length===1&&E[0]instanceof nn&&["mrow","mtable"].includes(E[0].type)?N=E[0]:N=new Ke.MathNode("mrow",E);const P=new Ke.MathNode("annotation",[new Ke.TextNode(i)]);P.setAttribute("encoding","application/x-tex");const Y=new Ke.MathNode("semantics",[N,P]),ne=new Ke.MathNode("math",[Y]);ne.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),h&&ne.setAttribute("display","block");const fe=y?"katex":"katex-mathml";return ge.makeSpan([fe],[ne])}const yc=function(s){return new St({style:s.displayMode?q.DISPLAY:q.TEXT,maxSize:s.maxSize,minRuleThickness:s.minRuleThickness})},xc=function(s,i){if(i.displayMode){const l=["katex-display"];i.leqno&&l.push("leqno"),i.fleqn&&l.push("fleqn"),s=ge.makeSpan(l,[s])}return s},Ag=function(s,i,l){const h=yc(l);let y;if(l.output==="mathml")return bc(s,i,h,l.displayMode,!0);if(l.output==="html"){const E=tl(s,h);y=ge.makeSpan(["katex"],[E])}else{const E=bc(s,i,h,l.displayMode,!1),N=tl(s,h);y=ge.makeSpan(["katex"],[E,N])}return xc(y,l)},Fg=function(s,i,l){const h=yc(l),y=tl(s,h),E=ge.makeSpan(["katex"],[y]);return xc(E,l)},Ng={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},Og=function(s){const i=new Ke.MathNode("mo",[new Ke.TextNode(Ng[s.replace(/^\\/,"")])]);return i.setAttribute("stretchy","true"),i},$g={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]},Tg=function(s){return s.type==="ordgroup"?s.body.length:1};var Kn={encloseSpan:function(s,i,l,h,y){let E;const N=s.height+s.depth+l+h;if(/fbox|color|angl/.test(i)){if(E=ge.makeSpan(["stretchy",i],[],y),i==="fbox"){const P=y.color&&y.getColor();P&&(E.style.borderColor=P)}}else{const P=[];/^[bx]cancel$/.test(i)&&P.push(new Dr({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(i)&&P.push(new Dr({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));const Y=new gr(P,{width:"100%",height:de(N)});E=ge.makeSvgSpan([],[Y],y)}return E.height=N,E.style.height=de(N),E},mathMLnode:Og,svgSpan:function(s,i){function l(){let N=4e5;const P=s.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(P)){const Y=Tg(s.base);let ne,fe,ve;if(Y>5)P==="widehat"||P==="widecheck"?(ne=420,N=2364,ve=.42,fe=P+"4"):(ne=312,N=2340,ve=.34,fe="tilde4");else{const Ze=[1,1,2,2,3,3][Y];P==="widehat"||P==="widecheck"?(N=[0,1062,2364,2364,2364][Ze],ne=[0,239,300,360,420][Ze],ve=[0,.24,.3,.3,.36,.42][Ze],fe=P+Ze):(N=[0,600,1033,2339,2340][Ze],ne=[0,260,286,306,312][Ze],ve=[0,.26,.286,.3,.306,.34][Ze],fe="tilde"+Ze)}const Se=new or(fe),We=new gr([Se],{width:"100%",height:de(ve),viewBox:"0 0 "+N+" "+ne,preserveAspectRatio:"none"});return{span:ge.makeSvgSpan([],[We],i),minWidth:0,height:ve}}else{const Y=[],ne=$g[P],[fe,ve,Se]=ne,We=Se/1e3,Ze=fe.length;let Bt,zt;if(Ze===1){const Mt=ne[3];Bt=["hide-tail"],zt=[Mt]}else if(Ze===2)Bt=["halfarrow-left","halfarrow-right"],zt=["xMinYMin","xMaxYMin"];else if(Ze===3)Bt=["brace-left","brace-center","brace-right"],zt=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
487
- `+Ze+" children.");for(let Mt=0;Mt<Ze;Mt++){const Kt=new or(fe[Mt]),Ht=new gr([Kt],{width:"400em",height:de(We),viewBox:"0 0 "+N+" "+Se,preserveAspectRatio:zt[Mt]+" slice"}),cr=ge.makeSvgSpan([Bt[Mt]],[Ht],i);if(Ze===1)return{span:cr,minWidth:ve,height:We};cr.style.height=de(We),Y.push(cr)}return{span:ge.makeSpan(["stretchy"],Y,i),minWidth:ve,height:We}}}const{span:h,minWidth:y,height:E}=l();return h.height=E,h.style.height=de(E),y>0&&(h.style.minWidth=de(y)),h}};function Ft(s,i){if(!s||s.type!==i)throw new Error("Expected node of type "+i+", but got "+(s?"node of type "+s.type:String(s)));return s}function al(s){const i=mi(s);if(!i)throw new Error("Expected node of symbol group type, but got "+(s?"node of type "+s.type:String(s)));return i}function mi(s){return s&&(s.type==="atom"||Vt.hasOwnProperty(s.type))?s:null}const il=(s,i)=>{let l,h,y;s&&s.type==="supsub"?(h=Ft(s.base,"accent"),l=h.base,s.base=l,y=Er(Lt(s,i)),s.base=h):(h=Ft(s,"accent"),l=h.base);const E=Lt(l,i.havingCrampedStyle()),N=h.isShifty&&D.isCharacterBox(l);let P=0;if(N){const Se=D.getBaseElem(l),We=Lt(Se,i.havingCrampedStyle());P=ot(We).skew}const Y=h.label==="\\c";let ne=Y?E.height+E.depth:Math.min(E.height,i.fontMetrics().xHeight),fe;if(h.isStretchy)fe=Kn.svgSpan(h,i),fe=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:E},{type:"elem",elem:fe,wrapperClasses:["svg-align"],wrapperStyle:P>0?{width:"calc(100% - "+de(2*P)+")",marginLeft:de(2*P)}:void 0}]},i);else{let Se,We;h.label==="\\vec"?(Se=ge.staticSvg("vec",i),We=ge.svgData.vec[1]):(Se=ge.makeOrd({mode:h.mode,text:h.label},i,"textord"),Se=ot(Se),Se.italic=0,We=Se.width,Y&&(ne+=Se.depth)),fe=ge.makeSpan(["accent-body"],[Se]);const Ze=h.label==="\\textcircled";Ze&&(fe.classes.push("accent-full"),ne=E.height);let Bt=P;Ze||(Bt-=We/2),fe.style.left=de(Bt),h.label==="\\textcircled"&&(fe.style.top=".2em"),fe=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:E},{type:"kern",size:-ne},{type:"elem",elem:fe}]},i)}const ve=ge.makeSpan(["mord","accent"],[fe],i);return y?(y.children[0]=ve,y.height=Math.max(ve.height,y.height),y.classes[0]="mord",y):ve},Cc=(s,i)=>{const l=s.isStretchy?Kn.mathMLnode(s.label):new Ke.MathNode("mo",[ln(s.label,s.mode)]),h=new Ke.MathNode("mover",[ir(s.base,i),l]);return h.setAttribute("accent","true"),h},Mg=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(s=>"\\"+s).join("|"));Qe({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:(s,i)=>{const l=An(i[0]),h=!Mg.test(s.funcName),y=!h||s.funcName==="\\widehat"||s.funcName==="\\widetilde"||s.funcName==="\\widecheck";return{type:"accent",mode:s.parser.mode,label:s.funcName,isStretchy:h,isShifty:y,base:l}},htmlBuilder:il,mathmlBuilder:Cc}),Qe({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(s,i)=>{const l=i[0];let h=s.parser.mode;return h==="math"&&(s.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+s.funcName+" works only in text mode"),h="text"),{type:"accent",mode:h,label:s.funcName,isStretchy:!1,isShifty:!0,base:l}},htmlBuilder:il,mathmlBuilder:Cc}),Qe({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(s,i)=>{let{parser:l,funcName:h}=s;const y=i[0];return{type:"accentUnder",mode:l.mode,label:h,base:y}},htmlBuilder:(s,i)=>{const l=Lt(s.base,i),h=Kn.svgSpan(s,i),y=s.label==="\\utilde"?.12:0,E=ge.makeVList({positionType:"top",positionData:l.height,children:[{type:"elem",elem:h,wrapperClasses:["svg-align"]},{type:"kern",size:y},{type:"elem",elem:l}]},i);return ge.makeSpan(["mord","accentunder"],[E],i)},mathmlBuilder:(s,i)=>{const l=Kn.mathMLnode(s.label),h=new Ke.MathNode("munder",[ir(s.base,i),l]);return h.setAttribute("accentunder","true"),h}});const gi=s=>{const i=new Ke.MathNode("mpadded",s?[s]:[]);return i.setAttribute("width","+0.6em"),i.setAttribute("lspace","0.3em"),i};Qe({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(s,i,l){let{parser:h,funcName:y}=s;return{type:"xArrow",mode:h.mode,label:y,body:i[0],below:l[0]}},htmlBuilder(s,i){const l=i.style;let h=i.havingStyle(l.sup());const y=ge.wrapFragment(Lt(s.body,h,i),i),E=s.label.slice(0,2)==="\\x"?"x":"cd";y.classes.push(E+"-arrow-pad");let N;s.below&&(h=i.havingStyle(l.sub()),N=ge.wrapFragment(Lt(s.below,h,i),i),N.classes.push(E+"-arrow-pad"));const P=Kn.svgSpan(s,i),Y=-i.fontMetrics().axisHeight+.5*P.height;let ne=-i.fontMetrics().axisHeight-.5*P.height-.111;(y.depth>.25||s.label==="\\xleftequilibrium")&&(ne-=y.depth);let fe;if(N){const ve=-i.fontMetrics().axisHeight+N.height+.5*P.height+.111;fe=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:ne},{type:"elem",elem:P,shift:Y},{type:"elem",elem:N,shift:ve}]},i)}else fe=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:ne},{type:"elem",elem:P,shift:Y}]},i);return fe.children[0].children[0].children[1].classes.push("svg-align"),ge.makeSpan(["mrel","x-arrow"],[fe],i)},mathmlBuilder(s,i){const l=Kn.mathMLnode(s.label);l.setAttribute("minsize",s.label.charAt(0)==="x"?"1.75em":"3.0em");let h;if(s.body){const y=gi(ir(s.body,i));if(s.below){const E=gi(ir(s.below,i));h=new Ke.MathNode("munderover",[l,E,y])}else h=new Ke.MathNode("mover",[l,y])}else if(s.below){const y=gi(ir(s.below,i));h=new Ke.MathNode("munder",[l,y])}else h=gi(),h=new Ke.MathNode("mover",[l,h]);return h}});const Rg=ge.makeSpan;function wc(s,i){const l=Or(s.body,i,!0);return Rg([s.mclass],l,i)}function Dc(s,i){let l;const h=Zr(s.body,i);return s.mclass==="minner"?l=new Ke.MathNode("mpadded",h):s.mclass==="mord"?s.isCharacterBox?(l=h[0],l.type="mi"):l=new Ke.MathNode("mi",h):(s.isCharacterBox?(l=h[0],l.type="mo"):l=new Ke.MathNode("mo",h),s.mclass==="mbin"?(l.attributes.lspace="0.22em",l.attributes.rspace="0.22em"):s.mclass==="mpunct"?(l.attributes.lspace="0em",l.attributes.rspace="0.17em"):s.mclass==="mopen"||s.mclass==="mclose"?(l.attributes.lspace="0em",l.attributes.rspace="0em"):s.mclass==="minner"&&(l.attributes.lspace="0.0556em",l.attributes.width="+0.1111em")),l}Qe({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(s,i){let{parser:l,funcName:h}=s;const y=i[0];return{type:"mclass",mode:l.mode,mclass:"m"+h.slice(5),body:ur(y),isCharacterBox:D.isCharacterBox(y)}},htmlBuilder:wc,mathmlBuilder:Dc});const vi=s=>{const i=s.type==="ordgroup"&&s.body.length?s.body[0]:s;return i.type==="atom"&&(i.family==="bin"||i.family==="rel")?"m"+i.family:"mord"};Qe({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(s,i){let{parser:l}=s;return{type:"mclass",mode:l.mode,mclass:vi(i[0]),body:ur(i[1]),isCharacterBox:D.isCharacterBox(i[1])}}}),Qe({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(s,i){let{parser:l,funcName:h}=s;const y=i[1],E=i[0];let N;h!=="\\stackrel"?N=vi(y):N="mrel";const P={type:"op",mode:y.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:h!=="\\stackrel",body:ur(y)},Y={type:"supsub",mode:E.mode,base:P,sup:h==="\\underset"?null:E,sub:h==="\\underset"?E:null};return{type:"mclass",mode:l.mode,mclass:N,body:[Y],isCharacterBox:D.isCharacterBox(Y)}},htmlBuilder:wc,mathmlBuilder:Dc}),Qe({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(s,i){let{parser:l}=s;return{type:"pmb",mode:l.mode,mclass:vi(i[0]),body:ur(i[0])}},htmlBuilder(s,i){const l=Or(s.body,i,!0),h=ge.makeSpan([s.mclass],l,i);return h.style.textShadow="0.02em 0.01em 0.04px",h},mathmlBuilder(s,i){const l=Zr(s.body,i),h=new Ke.MathNode("mstyle",l);return h.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),h}});const Pg={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Ec=()=>({type:"styling",body:[],mode:"math",style:"display"}),kc=s=>s.type==="textord"&&s.text==="@",Ig=(s,i)=>(s.type==="mathord"||s.type==="atom")&&s.text===i;function zg(s,i,l){const h=Pg[s];switch(h){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return l.callFunction(h,[i[0]],[i[1]]);case"\\uparrow":case"\\downarrow":{const y=l.callFunction("\\\\cdleft",[i[0]],[]),E={type:"atom",text:h,mode:"math",family:"rel"},N=l.callFunction("\\Big",[E],[]),P=l.callFunction("\\\\cdright",[i[1]],[]),Y={type:"ordgroup",mode:"math",body:[y,N,P]};return l.callFunction("\\\\cdparent",[Y],[])}case"\\\\cdlongequal":return l.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{const y={type:"textord",text:"\\Vert",mode:"math"};return l.callFunction("\\Big",[y],[])}default:return{type:"textord",text:" ",mode:"math"}}}function jg(s){const i=[];for(s.gullet.beginGroup(),s.gullet.macros.set("\\cr","\\\\\\relax"),s.gullet.beginGroup();;){i.push(s.parseExpression(!1,"\\\\")),s.gullet.endGroup(),s.gullet.beginGroup();const E=s.fetch().text;if(E==="&"||E==="\\\\")s.consume();else if(E==="\\end"){i[i.length-1].length===0&&i.pop();break}else throw new a("Expected \\\\ or \\cr or \\end",s.nextToken)}let l=[];const h=[l];for(let E=0;E<i.length;E++){const N=i[E];let P=Ec();for(let Y=0;Y<N.length;Y++)if(!kc(N[Y]))P.body.push(N[Y]);else{l.push(P),Y+=1;const ne=al(N[Y]).text,fe=new Array(2);if(fe[0]={type:"ordgroup",mode:"math",body:[]},fe[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(ne)>-1))if("<>AV".indexOf(ne)>-1)for(let Se=0;Se<2;Se++){let We=!0;for(let Ze=Y+1;Ze<N.length;Ze++){if(Ig(N[Ze],ne)){We=!1,Y=Ze;break}if(kc(N[Ze]))throw new a("Missing a "+ne+" character to complete a CD arrow.",N[Ze]);fe[Se].body.push(N[Ze])}if(We)throw new a("Missing a "+ne+" character to complete a CD arrow.",N[Y])}else throw new a('Expected one of "<>AV=|." after @',N[Y]);const ve={type:"styling",body:[zg(ne,fe,s)],mode:"math",style:"display"};l.push(ve),P=Ec()}E%2===0?l.push(P):l.shift(),l=[],h.push(l)}s.gullet.endGroup(),s.gullet.endGroup();const y=new Array(h[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:h,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(h.length+1).fill([])}}Qe({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(s,i){let{parser:l,funcName:h}=s;return{type:"cdlabel",mode:l.mode,side:h.slice(4),label:i[0]}},htmlBuilder(s,i){const l=i.havingStyle(i.style.sup()),h=ge.wrapFragment(Lt(s.label,l,i),i);return h.classes.push("cd-label-"+s.side),h.style.bottom=de(.8-h.depth),h.height=0,h.depth=0,h},mathmlBuilder(s,i){let l=new Ke.MathNode("mrow",[ir(s.label,i)]);return l=new Ke.MathNode("mpadded",[l]),l.setAttribute("width","0"),s.side==="left"&&l.setAttribute("lspace","-1width"),l.setAttribute("voffset","0.7em"),l=new Ke.MathNode("mstyle",[l]),l.setAttribute("displaystyle","false"),l.setAttribute("scriptlevel","1"),l}}),Qe({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(s,i){let{parser:l}=s;return{type:"cdlabelparent",mode:l.mode,fragment:i[0]}},htmlBuilder(s,i){const l=ge.wrapFragment(Lt(s.fragment,i),i);return l.classes.push("cd-vert-arrow"),l},mathmlBuilder(s,i){return new Ke.MathNode("mrow",[ir(s.fragment,i)])}}),Qe({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(s,i){let{parser:l}=s;const h=Ft(i[0],"ordgroup").body;let y="";for(let P=0;P<h.length;P++){const Y=Ft(h[P],"textord");y+=Y.text}let E=parseInt(y),N;if(isNaN(E))throw new a("\\@char has non-numeric argument "+y);if(E<0||E>=1114111)throw new a("\\@char with invalid code point "+y);return E<=65535?N=String.fromCharCode(E):(E-=65536,N=String.fromCharCode((E>>10)+55296,(E&1023)+56320)),{type:"textord",mode:l.mode,text:N}}});const Sc=(s,i)=>{const l=Or(s.body,i.withColor(s.color),!1);return ge.makeFragment(l)},Bc=(s,i)=>{const l=Zr(s.body,i.withColor(s.color)),h=new Ke.MathNode("mstyle",l);return h.setAttribute("mathcolor",s.color),h};Qe({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(s,i){let{parser:l}=s;const h=Ft(i[0],"color-token").color,y=i[1];return{type:"color",mode:l.mode,color:h,body:ur(y)}},htmlBuilder:Sc,mathmlBuilder:Bc}),Qe({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(s,i){let{parser:l,breakOnTokenText:h}=s;const y=Ft(i[0],"color-token").color;l.gullet.macros.set("\\current@color",y);const E=l.parseExpression(!0,h);return{type:"color",mode:l.mode,color:y,body:E}},htmlBuilder:Sc,mathmlBuilder:Bc}),Qe({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(s,i,l){let{parser:h}=s;const y=h.gullet.future().text==="["?h.parseSizeGroup(!0):null,E=!h.settings.displayMode||!h.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:h.mode,newLine:E,size:y&&Ft(y,"size").value}},htmlBuilder(s,i){const l=ge.makeSpan(["mspace"],[],i);return s.newLine&&(l.classes.push("newline"),s.size&&(l.style.marginTop=de($e(s.size,i)))),l},mathmlBuilder(s,i){const l=new Ke.MathNode("mspace");return s.newLine&&(l.setAttribute("linebreak","newline"),s.size&&l.setAttribute("height",de($e(s.size,i)))),l}});const sl={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Ac=s=>{const i=s.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new a("Expected a control sequence",s);return i},_g=s=>{let i=s.gullet.popToken();return i.text==="="&&(i=s.gullet.popToken(),i.text===" "&&(i=s.gullet.popToken())),i},Fc=(s,i,l,h)=>{let y=s.gullet.macros.get(l.text);y==null&&(l.noexpand=!0,y={tokens:[l],numArgs:0,unexpandable:!s.gullet.isExpandable(l.text)}),s.gullet.macros.set(i,y,h)};Qe({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(s){let{parser:i,funcName:l}=s;i.consumeSpaces();const h=i.fetch();if(sl[h.text])return(l==="\\global"||l==="\\\\globallong")&&(h.text=sl[h.text]),Ft(i.parseFunction(),"internal");throw new a("Invalid token after macro prefix",h)}}),Qe({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(s){let{parser:i,funcName:l}=s,h=i.gullet.popToken();const y=h.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(y))throw new a("Expected a control sequence",h);let E=0,N;const P=[[]];for(;i.gullet.future().text!=="{";)if(h=i.gullet.popToken(),h.text==="#"){if(i.gullet.future().text==="{"){N=i.gullet.future(),P[E].push("{");break}if(h=i.gullet.popToken(),!/^[1-9]$/.test(h.text))throw new a('Invalid argument number "'+h.text+'"');if(parseInt(h.text)!==E+1)throw new a('Argument number "'+h.text+'" out of order');E++,P.push([])}else{if(h.text==="EOF")throw new a("Expected a macro definition");P[E].push(h.text)}let{tokens:Y}=i.gullet.consumeArg();return N&&Y.unshift(N),(l==="\\edef"||l==="\\xdef")&&(Y=i.gullet.expandTokens(Y),Y.reverse()),i.gullet.macros.set(y,{tokens:Y,numArgs:E,delimiters:P},l===sl[l]),{type:"internal",mode:i.mode}}}),Qe({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(s){let{parser:i,funcName:l}=s;const h=Ac(i.gullet.popToken());i.gullet.consumeSpaces();const y=_g(i);return Fc(i,h,y,l==="\\\\globallet"),{type:"internal",mode:i.mode}}}),Qe({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(s){let{parser:i,funcName:l}=s;const h=Ac(i.gullet.popToken()),y=i.gullet.popToken(),E=i.gullet.popToken();return Fc(i,h,E,l==="\\\\globalfuture"),i.gullet.pushToken(E),i.gullet.pushToken(y),{type:"internal",mode:i.mode}}});const Sa=function(s,i,l){const h=Ot.math[s]&&Ot.math[s].replace,y=ut(h||s,i,l);if(!y)throw new Error("Unsupported symbol "+s+" and font size "+i+".");return y},ll=function(s,i,l,h){const y=l.havingBaseStyle(i),E=ge.makeSpan(h.concat(y.sizingClasses(l)),[s],l),N=y.sizeMultiplier/l.sizeMultiplier;return E.height*=N,E.depth*=N,E.maxFontSize=y.sizeMultiplier,E},Nc=function(s,i,l){const h=i.havingBaseStyle(l),y=(1-i.sizeMultiplier/h.sizeMultiplier)*i.fontMetrics().axisHeight;s.classes.push("delimcenter"),s.style.top=de(y),s.height-=y,s.depth+=y},Lg=function(s,i,l,h,y,E){const N=ge.makeSymbol(s,"Main-Regular",y,h),P=ll(N,i,h,E);return l&&Nc(P,h,i),P},Hg=function(s,i,l,h){return ge.makeSymbol(s,"Size"+i+"-Regular",l,h)},Oc=function(s,i,l,h,y,E){const N=Hg(s,i,y,h),P=ll(ge.makeSpan(["delimsizing","size"+i],[N],h),q.TEXT,h,E);return l&&Nc(P,h,q.TEXT),P},ul=function(s,i,l){let h;return i==="Size1-Regular"?h="delim-size1":h="delim-size4",{type:"elem",elem:ge.makeSpan(["delimsizinginner",h],[ge.makeSpan([],[ge.makeSymbol(s,i,l)])])}},cl=function(s,i,l){const h=ze["Size4-Regular"][s.charCodeAt(0)]?ze["Size4-Regular"][s.charCodeAt(0)][4]:ze["Size1-Regular"][s.charCodeAt(0)][4],y=new or("inner",Fe(s,Math.round(1e3*i))),E=new gr([y],{width:de(h),height:de(i),style:"width:"+de(h),viewBox:"0 0 "+1e3*h+" "+Math.round(1e3*i),preserveAspectRatio:"xMinYMin"}),N=ge.makeSvgSpan([],[E],l);return N.height=i,N.style.height=de(i),N.style.width=de(h),{type:"elem",elem:N}},dl=.008,bi={type:"kern",size:-1*dl},Kg=["|","\\lvert","\\rvert","\\vert"],qg=["\\|","\\lVert","\\rVert","\\Vert"],$c=function(s,i,l,h,y,E){let N,P,Y,ne,fe="",ve=0;N=Y=ne=s,P=null;let Se="Size1-Regular";s==="\\uparrow"?Y=ne="\u23D0":s==="\\Uparrow"?Y=ne="\u2016":s==="\\downarrow"?N=Y="\u23D0":s==="\\Downarrow"?N=Y="\u2016":s==="\\updownarrow"?(N="\\uparrow",Y="\u23D0",ne="\\downarrow"):s==="\\Updownarrow"?(N="\\Uparrow",Y="\u2016",ne="\\Downarrow"):Kg.includes(s)?(Y="\u2223",fe="vert",ve=333):qg.includes(s)?(Y="\u2225",fe="doublevert",ve=556):s==="["||s==="\\lbrack"?(N="\u23A1",Y="\u23A2",ne="\u23A3",Se="Size4-Regular",fe="lbrack",ve=667):s==="]"||s==="\\rbrack"?(N="\u23A4",Y="\u23A5",ne="\u23A6",Se="Size4-Regular",fe="rbrack",ve=667):s==="\\lfloor"||s==="\u230A"?(Y=N="\u23A2",ne="\u23A3",Se="Size4-Regular",fe="lfloor",ve=667):s==="\\lceil"||s==="\u2308"?(N="\u23A1",Y=ne="\u23A2",Se="Size4-Regular",fe="lceil",ve=667):s==="\\rfloor"||s==="\u230B"?(Y=N="\u23A5",ne="\u23A6",Se="Size4-Regular",fe="rfloor",ve=667):s==="\\rceil"||s==="\u2309"?(N="\u23A4",Y=ne="\u23A5",Se="Size4-Regular",fe="rceil",ve=667):s==="("||s==="\\lparen"?(N="\u239B",Y="\u239C",ne="\u239D",Se="Size4-Regular",fe="lparen",ve=875):s===")"||s==="\\rparen"?(N="\u239E",Y="\u239F",ne="\u23A0",Se="Size4-Regular",fe="rparen",ve=875):s==="\\{"||s==="\\lbrace"?(N="\u23A7",P="\u23A8",ne="\u23A9",Y="\u23AA",Se="Size4-Regular"):s==="\\}"||s==="\\rbrace"?(N="\u23AB",P="\u23AC",ne="\u23AD",Y="\u23AA",Se="Size4-Regular"):s==="\\lgroup"||s==="\u27EE"?(N="\u23A7",ne="\u23A9",Y="\u23AA",Se="Size4-Regular"):s==="\\rgroup"||s==="\u27EF"?(N="\u23AB",ne="\u23AD",Y="\u23AA",Se="Size4-Regular"):s==="\\lmoustache"||s==="\u23B0"?(N="\u23A7",ne="\u23AD",Y="\u23AA",Se="Size4-Regular"):(s==="\\rmoustache"||s==="\u23B1")&&(N="\u23AB",ne="\u23A9",Y="\u23AA",Se="Size4-Regular");const We=Sa(N,Se,y),Ze=We.height+We.depth,Bt=Sa(Y,Se,y),zt=Bt.height+Bt.depth,Mt=Sa(ne,Se,y),Kt=Mt.height+Mt.depth;let Ht=0,cr=1;if(P!==null){const wr=Sa(P,Se,y);Ht=wr.height+wr.depth,cr=2}const zr=Ze+Kt+Ht,Wr=Math.max(0,Math.ceil((i-zr)/(cr*zt))),un=zr+Wr*cr*zt;let qo=h.fontMetrics().axisHeight;l&&(qo*=h.sizeMultiplier);const qt=un/2-qo,er=[];if(fe.length>0){const wr=un-Ze-Kt,vr=Math.round(un*1e3),cn=Ne(fe,Math.round(wr*1e3)),g4=new or(fe,cn),wd=(ve/1e3).toFixed(3)+"em",Dd=(vr/1e3).toFixed(3)+"em",v4=new gr([g4],{width:wd,height:Dd,viewBox:"0 0 "+ve+" "+vr}),Di=ge.makeSvgSpan([],[v4],h);Di.height=vr/1e3,Di.style.width=wd,Di.style.height=Dd,er.push({type:"elem",elem:Di})}else{if(er.push(ul(ne,Se,y)),er.push(bi),P===null){const wr=un-Ze-Kt+2*dl;er.push(cl(Y,wr,h))}else{const wr=(un-Ze-Kt-Ht)/2+2*dl;er.push(cl(Y,wr,h)),er.push(bi),er.push(ul(P,Se,y)),er.push(bi),er.push(cl(Y,wr,h))}er.push(bi),er.push(ul(N,Se,y))}const dr=h.havingBaseStyle(q.TEXT),hr=ge.makeVList({positionType:"bottom",positionData:qt,children:er},dr);return ll(ge.makeSpan(["delimsizing","mult"],[hr],dr),q.TEXT,h,E)},fl=80,hl=.08,pl=function(s,i,l,h,y){const E=Ee(s,h,l),N=new or(s,E),P=new gr([N],{width:"400em",height:de(i),viewBox:"0 0 400000 "+l,preserveAspectRatio:"xMinYMin slice"});return ge.makeSvgSpan(["hide-tail"],[P],y)},Wg=function(s,i){const l=i.havingBaseSizing(),h=Pc("\\surd",s*l.sizeMultiplier,Rc,l);let y=l.sizeMultiplier;const E=Math.max(0,i.minRuleThickness-i.fontMetrics().sqrtRuleThickness);let N,P=0,Y=0,ne=0,fe;return h.type==="small"?(ne=1e3+1e3*E+fl,s<1?y=1:s<1.4&&(y=.7),P=(1+E+hl)/y,Y=(1+E)/y,N=pl("sqrtMain",P,ne,E,i),N.style.minWidth="0.853em",fe=.833/y):h.type==="large"?(ne=(1e3+fl)*Ba[h.size],Y=(Ba[h.size]+E)/y,P=(Ba[h.size]+E+hl)/y,N=pl("sqrtSize"+h.size,P,ne,E,i),N.style.minWidth="1.02em",fe=1/y):(P=s+E+hl,Y=s+E,ne=Math.floor(1e3*s+E)+fl,N=pl("sqrtTall",P,ne,E,i),N.style.minWidth="0.742em",fe=1.056),N.height=Y,N.style.height=de(P),{span:N,advanceWidth:fe,ruleWidth:(i.fontMetrics().sqrtRuleThickness+E)*y}},Tc=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],Vg=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],Mc=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Ba=[0,1.2,1.8,2.4,3],Ug=function(s,i,l,h,y){if(s==="<"||s==="\\lt"||s==="\u27E8"?s="\\langle":(s===">"||s==="\\gt"||s==="\u27E9")&&(s="\\rangle"),Tc.includes(s)||Mc.includes(s))return Oc(s,i,!1,l,h,y);if(Vg.includes(s))return $c(s,Ba[i],!1,l,h,y);throw new a("Illegal delimiter: '"+s+"'")},Yg=[{type:"small",style:q.SCRIPTSCRIPT},{type:"small",style:q.SCRIPT},{type:"small",style:q.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Gg=[{type:"small",style:q.SCRIPTSCRIPT},{type:"small",style:q.SCRIPT},{type:"small",style:q.TEXT},{type:"stack"}],Rc=[{type:"small",style:q.SCRIPTSCRIPT},{type:"small",style:q.SCRIPT},{type:"small",style:q.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Xg=function(s){if(s.type==="small")return"Main-Regular";if(s.type==="large")return"Size"+s.size+"-Regular";if(s.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+s.type+"' here.")},Pc=function(s,i,l,h){const y=Math.min(2,3-h.style.size);for(let E=y;E<l.length&&l[E].type!=="stack";E++){const N=Sa(s,Xg(l[E]),"math");let P=N.height+N.depth;if(l[E].type==="small"){const Y=h.havingBaseStyle(l[E].style);P*=Y.sizeMultiplier}if(P>i)return l[E]}return l[l.length-1]},Ic=function(s,i,l,h,y,E){s==="<"||s==="\\lt"||s==="\u27E8"?s="\\langle":(s===">"||s==="\\gt"||s==="\u27E9")&&(s="\\rangle");let N;Mc.includes(s)?N=Yg:Tc.includes(s)?N=Rc:N=Gg;const P=Pc(s,i,N,h);return P.type==="small"?Lg(s,P.style,l,h,y,E):P.type==="large"?Oc(s,P.size,l,h,y,E):$c(s,i,l,h,y,E)};var qn={sqrtImage:Wg,sizedDelim:Ug,sizeToMaxHeight:Ba,customSizedDelim:Ic,leftRightDelim:function(s,i,l,h,y,E){const N=h.fontMetrics().axisHeight*h.sizeMultiplier,P=901,Y=5/h.fontMetrics().ptPerEm,ne=Math.max(i-N,l+N),fe=Math.max(ne/500*P,2*ne-Y);return Ic(s,fe,!0,h,y,E)}};const zc={"\\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}},Qg=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function yi(s,i){const l=mi(s);if(l&&Qg.includes(l.text))return l;throw l?new a("Invalid delimiter '"+l.text+"' after '"+i.funcName+"'",s):new a("Invalid delimiter type '"+s.type+"'",s)}Qe({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:(s,i)=>{const l=yi(i[0],s);return{type:"delimsizing",mode:s.parser.mode,size:zc[s.funcName].size,mclass:zc[s.funcName].mclass,delim:l.text}},htmlBuilder:(s,i)=>s.delim==="."?ge.makeSpan([s.mclass]):qn.sizedDelim(s.delim,s.size,i,s.mode,[s.mclass]),mathmlBuilder:s=>{const i=[];s.delim!=="."&&i.push(ln(s.delim,s.mode));const l=new Ke.MathNode("mo",i);s.mclass==="mopen"||s.mclass==="mclose"?l.setAttribute("fence","true"):l.setAttribute("fence","false"),l.setAttribute("stretchy","true");const h=de(qn.sizeToMaxHeight[s.size]);return l.setAttribute("minsize",h),l.setAttribute("maxsize",h),l}});function jc(s){if(!s.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Qe({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(s,i)=>{const l=s.parser.gullet.macros.get("\\current@color");if(l&&typeof l!="string")throw new a("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:s.parser.mode,delim:yi(i[0],s).text,color:l}}}),Qe({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(s,i)=>{const l=yi(i[0],s),h=s.parser;++h.leftrightDepth;const y=h.parseExpression(!1);--h.leftrightDepth,h.expect("\\right",!1);const E=Ft(h.parseFunction(),"leftright-right");return{type:"leftright",mode:h.mode,body:y,left:l.text,right:E.delim,rightColor:E.color}},htmlBuilder:(s,i)=>{jc(s);const l=Or(s.body,i,!0,["mopen","mclose"]);let h=0,y=0,E=!1;for(let Y=0;Y<l.length;Y++)l[Y].isMiddle?E=!0:(h=Math.max(l[Y].height,h),y=Math.max(l[Y].depth,y));h*=i.sizeMultiplier,y*=i.sizeMultiplier;let N;if(s.left==="."?N=ka(i,["mopen"]):N=qn.leftRightDelim(s.left,h,y,i,s.mode,["mopen"]),l.unshift(N),E)for(let Y=1;Y<l.length;Y++){const ne=l[Y].isMiddle;ne&&(l[Y]=qn.leftRightDelim(ne.delim,h,y,ne.options,s.mode,[]))}let P;if(s.right===".")P=ka(i,["mclose"]);else{const Y=s.rightColor?i.withColor(s.rightColor):i;P=qn.leftRightDelim(s.right,h,y,Y,s.mode,["mclose"])}return l.push(P),ge.makeSpan(["minner"],l,i)},mathmlBuilder:(s,i)=>{jc(s);const l=Zr(s.body,i);if(s.left!=="."){const h=new Ke.MathNode("mo",[ln(s.left,s.mode)]);h.setAttribute("fence","true"),l.unshift(h)}if(s.right!=="."){const h=new Ke.MathNode("mo",[ln(s.right,s.mode)]);h.setAttribute("fence","true"),s.rightColor&&h.setAttribute("mathcolor",s.rightColor),l.push(h)}return rl(l)}}),Qe({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(s,i)=>{const l=yi(i[0],s);if(!s.parser.leftrightDepth)throw new a("\\middle without preceding \\left",l);return{type:"middle",mode:s.parser.mode,delim:l.text}},htmlBuilder:(s,i)=>{let l;if(s.delim===".")l=ka(i,[]);else{l=qn.sizedDelim(s.delim,1,i,s.mode,[]);const h={delim:s.delim,options:i};l.isMiddle=h}return l},mathmlBuilder:(s,i)=>{const l=s.delim==="\\vert"||s.delim==="|"?ln("|","text"):ln(s.delim,s.mode),h=new Ke.MathNode("mo",[l]);return h.setAttribute("fence","true"),h.setAttribute("lspace","0.05em"),h.setAttribute("rspace","0.05em"),h}});const ml=(s,i)=>{const l=ge.wrapFragment(Lt(s.body,i),i),h=s.label.slice(1);let y=i.sizeMultiplier,E,N=0;const P=D.isCharacterBox(s.body);if(h==="sout")E=ge.makeSpan(["stretchy","sout"]),E.height=i.fontMetrics().defaultRuleThickness/y,N=-.5*i.fontMetrics().xHeight;else if(h==="phase"){const ne=$e({number:.6,unit:"pt"},i),fe=$e({number:.35,unit:"ex"},i),ve=i.havingBaseSizing();y=y/ve.sizeMultiplier;const Se=l.height+l.depth+ne+fe;l.style.paddingLeft=de(Se/2+ne);const We=Math.floor(1e3*Se*y),Ze=De(We),Bt=new gr([new or("phase",Ze)],{width:"400em",height:de(We/1e3),viewBox:"0 0 400000 "+We,preserveAspectRatio:"xMinYMin slice"});E=ge.makeSvgSpan(["hide-tail"],[Bt],i),E.style.height=de(Se),N=l.depth+ne+fe}else{/cancel/.test(h)?P||l.classes.push("cancel-pad"):h==="angl"?l.classes.push("anglpad"):l.classes.push("boxpad");let ne=0,fe=0,ve=0;/box/.test(h)?(ve=Math.max(i.fontMetrics().fboxrule,i.minRuleThickness),ne=i.fontMetrics().fboxsep+(h==="colorbox"?0:ve),fe=ne):h==="angl"?(ve=Math.max(i.fontMetrics().defaultRuleThickness,i.minRuleThickness),ne=4*ve,fe=Math.max(0,.25-l.depth)):(ne=P?.2:0,fe=ne),E=Kn.encloseSpan(l,h,ne,fe,i),/fbox|boxed|fcolorbox/.test(h)?(E.style.borderStyle="solid",E.style.borderWidth=de(ve)):h==="angl"&&ve!==.049&&(E.style.borderTopWidth=de(ve),E.style.borderRightWidth=de(ve)),N=l.depth+fe,s.backgroundColor&&(E.style.backgroundColor=s.backgroundColor,s.borderColor&&(E.style.borderColor=s.borderColor))}let Y;if(s.backgroundColor)Y=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:E,shift:N},{type:"elem",elem:l,shift:0}]},i);else{const ne=/cancel|phase/.test(h)?["svg-align"]:[];Y=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:E,shift:N,wrapperClasses:ne}]},i)}return/cancel/.test(h)&&(Y.height=l.height,Y.depth=l.depth),/cancel/.test(h)&&!P?ge.makeSpan(["mord","cancel-lap"],[Y],i):ge.makeSpan(["mord"],[Y],i)},gl=(s,i)=>{let l=0;const h=new Ke.MathNode(s.label.indexOf("colorbox")>-1?"mpadded":"menclose",[ir(s.body,i)]);switch(s.label){case"\\cancel":h.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":h.setAttribute("notation","downdiagonalstrike");break;case"\\phase":h.setAttribute("notation","phasorangle");break;case"\\sout":h.setAttribute("notation","horizontalstrike");break;case"\\fbox":h.setAttribute("notation","box");break;case"\\angl":h.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(l=i.fontMetrics().fboxsep*i.fontMetrics().ptPerEm,h.setAttribute("width","+"+2*l+"pt"),h.setAttribute("height","+"+2*l+"pt"),h.setAttribute("lspace",l+"pt"),h.setAttribute("voffset",l+"pt"),s.label==="\\fcolorbox"){const y=Math.max(i.fontMetrics().fboxrule,i.minRuleThickness);h.setAttribute("style","border: "+y+"em solid "+String(s.borderColor))}break;case"\\xcancel":h.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return s.backgroundColor&&h.setAttribute("mathbackground",s.backgroundColor),h};Qe({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(s,i,l){let{parser:h,funcName:y}=s;const E=Ft(i[0],"color-token").color,N=i[1];return{type:"enclose",mode:h.mode,label:y,backgroundColor:E,body:N}},htmlBuilder:ml,mathmlBuilder:gl}),Qe({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(s,i,l){let{parser:h,funcName:y}=s;const E=Ft(i[0],"color-token").color,N=Ft(i[1],"color-token").color,P=i[2];return{type:"enclose",mode:h.mode,label:y,backgroundColor:N,borderColor:E,body:P}},htmlBuilder:ml,mathmlBuilder:gl}),Qe({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(s,i){let{parser:l}=s;return{type:"enclose",mode:l.mode,label:"\\fbox",body:i[0]}}}),Qe({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(s,i){let{parser:l,funcName:h}=s;const y=i[0];return{type:"enclose",mode:l.mode,label:h,body:y}},htmlBuilder:ml,mathmlBuilder:gl}),Qe({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(s,i){let{parser:l}=s;return{type:"enclose",mode:l.mode,label:"\\angl",body:i[0]}}});const _c={};function Nn(s){let{type:i,names:l,props:h,handler:y,htmlBuilder:E,mathmlBuilder:N}=s;const P={type:i,numArgs:h.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:y};for(let Y=0;Y<l.length;++Y)_c[l[Y]]=P;E&&(Cr[i]=E),N&&(gn[i]=N)}const Lc={};function I(s,i){Lc[s]=i}class Jr{constructor(i,l,h){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=i,this.start=l,this.end=h}static range(i,l){return l?!i||!i.loc||!l.loc||i.loc.lexer!==l.loc.lexer?null:new Jr(i.loc.lexer,i.loc.start,l.loc.end):i&&i.loc}}class on{constructor(i,l){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=i,this.loc=l}range(i,l){return new on(l,Jr.range(this,i))}}function Hc(s){const i=[];s.consumeSpaces();let l=s.fetch().text;for(l==="\\relax"&&(s.consume(),s.consumeSpaces(),l=s.fetch().text);l==="\\hline"||l==="\\hdashline";)s.consume(),i.push(l==="\\hdashline"),s.consumeSpaces(),l=s.fetch().text;return i}const xi=s=>{if(!s.parser.settings.displayMode)throw new a("{"+s.envName+"} can be used only in display mode.")};function vl(s){if(s.indexOf("ed")===-1)return s.indexOf("*")===-1}function oo(s,i,l){let{hskipBeforeAndAfter:h,addJot:y,cols:E,arraystretch:N,colSeparationType:P,autoTag:Y,singleRow:ne,emptySingleRow:fe,maxNumCols:ve,leqno:Se}=i;if(s.gullet.beginGroup(),ne||s.gullet.macros.set("\\cr","\\\\\\relax"),!N){const cr=s.gullet.expandMacroAsText("\\arraystretch");if(cr==null)N=1;else if(N=parseFloat(cr),!N||N<0)throw new a("Invalid \\arraystretch: "+cr)}s.gullet.beginGroup();let We=[];const Ze=[We],Bt=[],zt=[],Mt=Y!=null?[]:void 0;function Kt(){Y&&s.gullet.macros.set("\\@eqnsw","1",!0)}function Ht(){Mt&&(s.gullet.macros.get("\\df@tag")?(Mt.push(s.subparse([new on("\\df@tag")])),s.gullet.macros.set("\\df@tag",void 0,!0)):Mt.push(!!Y&&s.gullet.macros.get("\\@eqnsw")==="1"))}for(Kt(),zt.push(Hc(s));;){let cr=s.parseExpression(!1,ne?"\\end":"\\\\");s.gullet.endGroup(),s.gullet.beginGroup(),cr={type:"ordgroup",mode:s.mode,body:cr},l&&(cr={type:"styling",mode:s.mode,style:l,body:[cr]}),We.push(cr);const zr=s.fetch().text;if(zr==="&"){if(ve&&We.length===ve){if(ne||P)throw new a("Too many tab characters: &",s.nextToken);s.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}s.consume()}else if(zr==="\\end"){Ht(),We.length===1&&cr.type==="styling"&&cr.body[0].body.length===0&&(Ze.length>1||!fe)&&Ze.pop(),zt.length<Ze.length+1&&zt.push([]);break}else if(zr==="\\\\"){s.consume();let Wr;s.gullet.future().text!==" "&&(Wr=s.parseSizeGroup(!0)),Bt.push(Wr?Wr.value:null),Ht(),zt.push(Hc(s)),We=[],Ze.push(We),Kt()}else throw new a("Expected & or \\\\ or \\cr or \\end",s.nextToken)}return s.gullet.endGroup(),s.gullet.endGroup(),{type:"array",mode:s.mode,addJot:y,arraystretch:N,body:Ze,cols:E,rowGaps:Bt,hskipBeforeAndAfter:h,hLinesBeforeRow:zt,colSeparationType:P,tags:Mt,leqno:Se}}function bl(s){return s.slice(0,1)==="d"?"display":"text"}const On=function(s,i){let l,h;const y=s.body.length,E=s.hLinesBeforeRow;let N=0,P=new Array(y);const Y=[],ne=Math.max(i.fontMetrics().arrayRuleWidth,i.minRuleThickness),fe=1/i.fontMetrics().ptPerEm;let ve=5*fe;s.colSeparationType&&s.colSeparationType==="small"&&(ve=.2778*(i.havingStyle(q.SCRIPT).sizeMultiplier/i.sizeMultiplier));const Se=s.colSeparationType==="CD"?$e({number:3,unit:"ex"},i):12*fe,We=3*fe,Ze=s.arraystretch*Se,Bt=.7*Ze,zt=.3*Ze;let Mt=0;function Kt(qt){for(let er=0;er<qt.length;++er)er>0&&(Mt+=.25),Y.push({pos:Mt,isDashed:qt[er]})}for(Kt(E[0]),l=0;l<s.body.length;++l){const qt=s.body[l];let er=Bt,dr=zt;N<qt.length&&(N=qt.length);const hr=new Array(qt.length);for(h=0;h<qt.length;++h){const cn=Lt(qt[h],i);dr<cn.depth&&(dr=cn.depth),er<cn.height&&(er=cn.height),hr[h]=cn}const wr=s.rowGaps[l];let vr=0;wr&&(vr=$e(wr,i),vr>0&&(vr+=zt,dr<vr&&(dr=vr),vr=0)),s.addJot&&(dr+=We),hr.height=er,hr.depth=dr,Mt+=er,hr.pos=Mt,Mt+=dr+vr,P[l]=hr,Kt(E[l+1])}const Ht=Mt/2+i.fontMetrics().axisHeight,cr=s.cols||[],zr=[];let Wr,un;const qo=[];if(s.tags&&s.tags.some(qt=>qt))for(l=0;l<y;++l){const qt=P[l],er=qt.pos-Ht,dr=s.tags[l];let hr;dr===!0?hr=ge.makeSpan(["eqn-num"],[],i):dr===!1?hr=ge.makeSpan([],[],i):hr=ge.makeSpan([],Or(dr,i,!0),i),hr.depth=qt.depth,hr.height=qt.height,qo.push({type:"elem",elem:hr,shift:er})}for(h=0,un=0;h<N||un<cr.length;++h,++un){let qt=cr[un]||{},er=!0;for(;qt.type==="separator";){if(er||(Wr=ge.makeSpan(["arraycolsep"],[]),Wr.style.width=de(i.fontMetrics().doubleRuleSep),zr.push(Wr)),qt.separator==="|"||qt.separator===":"){const wr=qt.separator==="|"?"solid":"dashed",vr=ge.makeSpan(["vertical-separator"],[],i);vr.style.height=de(Mt),vr.style.borderRightWidth=de(ne),vr.style.borderRightStyle=wr,vr.style.margin="0 "+de(-ne/2);const cn=Mt-Ht;cn&&(vr.style.verticalAlign=de(-cn)),zr.push(vr)}else throw new a("Invalid separator type: "+qt.separator);un++,qt=cr[un]||{},er=!1}if(h>=N)continue;let dr;(h>0||s.hskipBeforeAndAfter)&&(dr=D.deflt(qt.pregap,ve),dr!==0&&(Wr=ge.makeSpan(["arraycolsep"],[]),Wr.style.width=de(dr),zr.push(Wr)));let hr=[];for(l=0;l<y;++l){const wr=P[l],vr=wr[h];if(!vr)continue;const cn=wr.pos-Ht;vr.depth=wr.depth,vr.height=wr.height,hr.push({type:"elem",elem:vr,shift:cn})}hr=ge.makeVList({positionType:"individualShift",children:hr},i),hr=ge.makeSpan(["col-align-"+(qt.align||"c")],[hr]),zr.push(hr),(h<N-1||s.hskipBeforeAndAfter)&&(dr=D.deflt(qt.postgap,ve),dr!==0&&(Wr=ge.makeSpan(["arraycolsep"],[]),Wr.style.width=de(dr),zr.push(Wr)))}if(P=ge.makeSpan(["mtable"],zr),Y.length>0){const qt=ge.makeLineSpan("hline",i,ne),er=ge.makeLineSpan("hdashline",i,ne),dr=[{type:"elem",elem:P,shift:0}];for(;Y.length>0;){const hr=Y.pop(),wr=hr.pos-Ht;hr.isDashed?dr.push({type:"elem",elem:er,shift:wr}):dr.push({type:"elem",elem:qt,shift:wr})}P=ge.makeVList({positionType:"individualShift",children:dr},i)}if(qo.length===0)return ge.makeSpan(["mord"],[P],i);{let qt=ge.makeVList({positionType:"individualShift",children:qo},i);return qt=ge.makeSpan(["tag"],[qt],i),ge.makeFragment([P,qt])}},Zg={c:"center ",l:"left ",r:"right "},$n=function(s,i){const l=[],h=new Ke.MathNode("mtd",[],["mtr-glue"]),y=new Ke.MathNode("mtd",[],["mml-eqn-num"]);for(let ve=0;ve<s.body.length;ve++){const Se=s.body[ve],We=[];for(let Ze=0;Ze<Se.length;Ze++)We.push(new Ke.MathNode("mtd",[ir(Se[Ze],i)]));s.tags&&s.tags[ve]&&(We.unshift(h),We.push(h),s.leqno?We.unshift(y):We.push(y)),l.push(new Ke.MathNode("mtr",We))}let E=new Ke.MathNode("mtable",l);const N=s.arraystretch===.5?.1:.16+s.arraystretch-1+(s.addJot?.09:0);E.setAttribute("rowspacing",de(N));let P="",Y="";if(s.cols&&s.cols.length>0){const ve=s.cols;let Se="",We=!1,Ze=0,Bt=ve.length;ve[0].type==="separator"&&(P+="top ",Ze=1),ve[ve.length-1].type==="separator"&&(P+="bottom ",Bt-=1);for(let zt=Ze;zt<Bt;zt++)ve[zt].type==="align"?(Y+=Zg[ve[zt].align],We&&(Se+="none "),We=!0):ve[zt].type==="separator"&&We&&(Se+=ve[zt].separator==="|"?"solid ":"dashed ",We=!1);E.setAttribute("columnalign",Y.trim()),/[sd]/.test(Se)&&E.setAttribute("columnlines",Se.trim())}if(s.colSeparationType==="align"){const ve=s.cols||[];let Se="";for(let We=1;We<ve.length;We++)Se+=We%2?"0em ":"1em ";E.setAttribute("columnspacing",Se.trim())}else s.colSeparationType==="alignat"||s.colSeparationType==="gather"?E.setAttribute("columnspacing","0em"):s.colSeparationType==="small"?E.setAttribute("columnspacing","0.2778em"):s.colSeparationType==="CD"?E.setAttribute("columnspacing","0.5em"):E.setAttribute("columnspacing","1em");let ne="";const fe=s.hLinesBeforeRow;P+=fe[0].length>0?"left ":"",P+=fe[fe.length-1].length>0?"right ":"";for(let ve=1;ve<fe.length-1;ve++)ne+=fe[ve].length===0?"none ":fe[ve][0]?"dashed ":"solid ";return/[sd]/.test(ne)&&E.setAttribute("rowlines",ne.trim()),P!==""&&(E=new Ke.MathNode("menclose",[E]),E.setAttribute("notation",P.trim())),s.arraystretch&&s.arraystretch<1&&(E=new Ke.MathNode("mstyle",[E]),E.setAttribute("scriptlevel","1")),E},Kc=function(s,i){s.envName.indexOf("ed")===-1&&xi(s);const l=[],h=s.envName.indexOf("at")>-1?"alignat":"align",y=s.envName==="split",E=oo(s.parser,{cols:l,addJot:!0,autoTag:y?void 0:vl(s.envName),emptySingleRow:!0,colSeparationType:h,maxNumCols:y?2:void 0,leqno:s.parser.settings.leqno},"display");let N,P=0;const Y={type:"ordgroup",mode:s.mode,body:[]};if(i[0]&&i[0].type==="ordgroup"){let fe="";for(let ve=0;ve<i[0].body.length;ve++){const Se=Ft(i[0].body[ve],"textord");fe+=Se.text}N=Number(fe),P=N*2}const ne=!P;E.body.forEach(function(fe){for(let ve=1;ve<fe.length;ve+=2){const Se=Ft(fe[ve],"styling");Ft(Se.body[0],"ordgroup").body.unshift(Y)}if(ne)P<fe.length&&(P=fe.length);else{const ve=fe.length/2;if(N<ve)throw new a("Too many math in a row: "+("expected "+N+", but got "+ve),fe[0])}});for(let fe=0;fe<P;++fe){let ve="r",Se=0;fe%2===1?ve="l":fe>0&&ne&&(Se=1),l[fe]={type:"align",align:ve,pregap:Se,postgap:0}}return E.colSeparationType=ne?"align":"alignat",E};Nn({type:"array",names:["array","darray"],props:{numArgs:1},handler(s,i){const l=(mi(i[0])?[i[0]]:Ft(i[0],"ordgroup").body).map(function(y){const E=al(y).text;if("lcr".indexOf(E)!==-1)return{type:"align",align:E};if(E==="|")return{type:"separator",separator:"|"};if(E===":")return{type:"separator",separator:":"};throw new a("Unknown column alignment: "+E,y)}),h={cols:l,hskipBeforeAndAfter:!0,maxNumCols:l.length};return oo(s.parser,h,bl(s.envName))},htmlBuilder:On,mathmlBuilder:$n}),Nn({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(s){const i={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[s.envName.replace("*","")];let l="c";const h={hskipBeforeAndAfter:!1,cols:[{type:"align",align:l}]};if(s.envName.charAt(s.envName.length-1)==="*"){const N=s.parser;if(N.consumeSpaces(),N.fetch().text==="["){if(N.consume(),N.consumeSpaces(),l=N.fetch().text,"lcr".indexOf(l)===-1)throw new a("Expected l or c or r",N.nextToken);N.consume(),N.consumeSpaces(),N.expect("]"),N.consume(),h.cols=[{type:"align",align:l}]}}const y=oo(s.parser,h,bl(s.envName)),E=Math.max(0,...y.body.map(N=>N.length));return y.cols=new Array(E).fill({type:"align",align:l}),i?{type:"leftright",mode:s.mode,body:[y],left:i[0],right:i[1],rightColor:void 0}:y},htmlBuilder:On,mathmlBuilder:$n}),Nn({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(s){const i={arraystretch:.5},l=oo(s.parser,i,"script");return l.colSeparationType="small",l},htmlBuilder:On,mathmlBuilder:$n}),Nn({type:"array",names:["subarray"],props:{numArgs:1},handler(s,i){const l=(mi(i[0])?[i[0]]:Ft(i[0],"ordgroup").body).map(function(y){const E=al(y).text;if("lc".indexOf(E)!==-1)return{type:"align",align:E};throw new a("Unknown column alignment: "+E,y)});if(l.length>1)throw new a("{subarray} can contain only one column");let h={cols:l,hskipBeforeAndAfter:!1,arraystretch:.5};if(h=oo(s.parser,h,"script"),h.body.length>0&&h.body[0].length>1)throw new a("{subarray} can contain only one column");return h},htmlBuilder:On,mathmlBuilder:$n}),Nn({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(s){const i={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},l=oo(s.parser,i,bl(s.envName));return{type:"leftright",mode:s.mode,body:[l],left:s.envName.indexOf("r")>-1?".":"\\{",right:s.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:On,mathmlBuilder:$n}),Nn({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Kc,htmlBuilder:On,mathmlBuilder:$n}),Nn({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(s){["gather","gather*"].includes(s.envName)&&xi(s);const i={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:vl(s.envName),emptySingleRow:!0,leqno:s.parser.settings.leqno};return oo(s.parser,i,"display")},htmlBuilder:On,mathmlBuilder:$n}),Nn({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Kc,htmlBuilder:On,mathmlBuilder:$n}),Nn({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(s){xi(s);const i={autoTag:vl(s.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:s.parser.settings.leqno};return oo(s.parser,i,"display")},htmlBuilder:On,mathmlBuilder:$n}),Nn({type:"array",names:["CD"],props:{numArgs:0},handler(s){return xi(s),jg(s.parser)},htmlBuilder:On,mathmlBuilder:$n}),I("\\nonumber","\\gdef\\@eqnsw{0}"),I("\\notag","\\nonumber"),Qe({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(s,i){throw new a(s.funcName+" valid only within array environment")}});var qc=_c;Qe({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(s,i){let{parser:l,funcName:h}=s;const y=i[0];if(y.type!=="ordgroup")throw new a("Invalid environment name",y);let E="";for(let N=0;N<y.body.length;++N)E+=Ft(y.body[N],"textord").text;if(h==="\\begin"){if(!qc.hasOwnProperty(E))throw new a("No such environment: "+E,y);const N=qc[E],{args:P,optArgs:Y}=l.parseArguments("\\begin{"+E+"}",N),ne={mode:l.mode,envName:E,parser:l},fe=N.handler(ne,P,Y);l.expect("\\end",!1);const ve=l.nextToken,Se=Ft(l.parseFunction(),"environment");if(Se.name!==E)throw new a("Mismatch: \\begin{"+E+"} matched by \\end{"+Se.name+"}",ve);return fe}return{type:"environment",mode:l.mode,name:E,nameGroup:y}}});const Wc=(s,i)=>{const l=s.font,h=i.withFont(l);return Lt(s.body,h)},Vc=(s,i)=>{const l=s.font,h=i.withFont(l);return ir(s.body,h)},Uc={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Qe({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(s,i)=>{let{parser:l,funcName:h}=s;const y=An(i[0]);let E=h;return E in Uc&&(E=Uc[E]),{type:"font",mode:l.mode,font:E.slice(1),body:y}},htmlBuilder:Wc,mathmlBuilder:Vc}),Qe({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(s,i)=>{let{parser:l}=s;const h=i[0],y=D.isCharacterBox(h);return{type:"mclass",mode:l.mode,mclass:vi(h),body:[{type:"font",mode:l.mode,font:"boldsymbol",body:h}],isCharacterBox:y}}}),Qe({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(s,i)=>{let{parser:l,funcName:h,breakOnTokenText:y}=s;const{mode:E}=l,N=l.parseExpression(!0,y),P="math"+h.slice(1);return{type:"font",mode:E,font:P,body:{type:"ordgroup",mode:l.mode,body:N}}},htmlBuilder:Wc,mathmlBuilder:Vc});const Yc=(s,i)=>{let l=i;return s==="display"?l=l.id>=q.SCRIPT.id?l.text():q.DISPLAY:s==="text"&&l.size===q.DISPLAY.size?l=q.TEXT:s==="script"?l=q.SCRIPT:s==="scriptscript"&&(l=q.SCRIPTSCRIPT),l},yl=(s,i)=>{const l=Yc(s.size,i.style),h=l.fracNum(),y=l.fracDen();let E;E=i.havingStyle(h);const N=Lt(s.numer,E,i);if(s.continued){const Kt=8.5/i.fontMetrics().ptPerEm,Ht=3.5/i.fontMetrics().ptPerEm;N.height=N.height<Kt?Kt:N.height,N.depth=N.depth<Ht?Ht:N.depth}E=i.havingStyle(y);const P=Lt(s.denom,E,i);let Y,ne,fe;s.hasBarLine?(s.barSize?(ne=$e(s.barSize,i),Y=ge.makeLineSpan("frac-line",i,ne)):Y=ge.makeLineSpan("frac-line",i),ne=Y.height,fe=Y.height):(Y=null,ne=0,fe=i.fontMetrics().defaultRuleThickness);let ve,Se,We;l.size===q.DISPLAY.size||s.size==="display"?(ve=i.fontMetrics().num1,ne>0?Se=3*fe:Se=7*fe,We=i.fontMetrics().denom1):(ne>0?(ve=i.fontMetrics().num2,Se=fe):(ve=i.fontMetrics().num3,Se=3*fe),We=i.fontMetrics().denom2);let Ze;if(Y){const Kt=i.fontMetrics().axisHeight;ve-N.depth-(Kt+.5*ne)<Se&&(ve+=Se-(ve-N.depth-(Kt+.5*ne))),Kt-.5*ne-(P.height-We)<Se&&(We+=Se-(Kt-.5*ne-(P.height-We)));const Ht=-(Kt-.5*ne);Ze=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:P,shift:We},{type:"elem",elem:Y,shift:Ht},{type:"elem",elem:N,shift:-ve}]},i)}else{const Kt=ve-N.depth-(P.height-We);Kt<Se&&(ve+=.5*(Se-Kt),We+=.5*(Se-Kt)),Ze=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:P,shift:We},{type:"elem",elem:N,shift:-ve}]},i)}E=i.havingStyle(l),Ze.height*=E.sizeMultiplier/i.sizeMultiplier,Ze.depth*=E.sizeMultiplier/i.sizeMultiplier;let Bt;l.size===q.DISPLAY.size?Bt=i.fontMetrics().delim1:l.size===q.SCRIPTSCRIPT.size?Bt=i.havingStyle(q.SCRIPT).fontMetrics().delim2:Bt=i.fontMetrics().delim2;let zt,Mt;return s.leftDelim==null?zt=ka(i,["mopen"]):zt=qn.customSizedDelim(s.leftDelim,Bt,!0,i.havingStyle(l),s.mode,["mopen"]),s.continued?Mt=ge.makeSpan([]):s.rightDelim==null?Mt=ka(i,["mclose"]):Mt=qn.customSizedDelim(s.rightDelim,Bt,!0,i.havingStyle(l),s.mode,["mclose"]),ge.makeSpan(["mord"].concat(E.sizingClasses(i)),[zt,ge.makeSpan(["mfrac"],[Ze]),Mt],i)},xl=(s,i)=>{let l=new Ke.MathNode("mfrac",[ir(s.numer,i),ir(s.denom,i)]);if(!s.hasBarLine)l.setAttribute("linethickness","0px");else if(s.barSize){const y=$e(s.barSize,i);l.setAttribute("linethickness",de(y))}const h=Yc(s.size,i.style);if(h.size!==i.style.size){l=new Ke.MathNode("mstyle",[l]);const y=h.size===q.DISPLAY.size?"true":"false";l.setAttribute("displaystyle",y),l.setAttribute("scriptlevel","0")}if(s.leftDelim!=null||s.rightDelim!=null){const y=[];if(s.leftDelim!=null){const E=new Ke.MathNode("mo",[new Ke.TextNode(s.leftDelim.replace("\\",""))]);E.setAttribute("fence","true"),y.push(E)}if(y.push(l),s.rightDelim!=null){const E=new Ke.MathNode("mo",[new Ke.TextNode(s.rightDelim.replace("\\",""))]);E.setAttribute("fence","true"),y.push(E)}return rl(y)}return l};Qe({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(s,i)=>{let{parser:l,funcName:h}=s;const y=i[0],E=i[1];let N,P=null,Y=null,ne="auto";switch(h){case"\\dfrac":case"\\frac":case"\\tfrac":N=!0;break;case"\\\\atopfrac":N=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":N=!1,P="(",Y=")";break;case"\\\\bracefrac":N=!1,P="\\{",Y="\\}";break;case"\\\\brackfrac":N=!1,P="[",Y="]";break;default:throw new Error("Unrecognized genfrac command")}switch(h){case"\\dfrac":case"\\dbinom":ne="display";break;case"\\tfrac":case"\\tbinom":ne="text";break}return{type:"genfrac",mode:l.mode,continued:!1,numer:y,denom:E,hasBarLine:N,leftDelim:P,rightDelim:Y,size:ne,barSize:null}},htmlBuilder:yl,mathmlBuilder:xl}),Qe({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(s,i)=>{let{parser:l,funcName:h}=s;const y=i[0],E=i[1];return{type:"genfrac",mode:l.mode,continued:!0,numer:y,denom:E,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),Qe({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(s){let{parser:i,funcName:l,token:h}=s,y;switch(l){case"\\over":y="\\frac";break;case"\\choose":y="\\binom";break;case"\\atop":y="\\\\atopfrac";break;case"\\brace":y="\\\\bracefrac";break;case"\\brack":y="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:i.mode,replaceWith:y,token:h}}});const Gc=["display","text","script","scriptscript"],Xc=function(s){let i=null;return s.length>0&&(i=s,i=i==="."?null:i),i};Qe({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(s,i){let{parser:l}=s;const h=i[4],y=i[5],E=An(i[0]),N=E.type==="atom"&&E.family==="open"?Xc(E.text):null,P=An(i[1]),Y=P.type==="atom"&&P.family==="close"?Xc(P.text):null,ne=Ft(i[2],"size");let fe,ve=null;ne.isBlank?fe=!0:(ve=ne.value,fe=ve.number>0);let Se="auto",We=i[3];if(We.type==="ordgroup"){if(We.body.length>0){const Ze=Ft(We.body[0],"textord");Se=Gc[Number(Ze.text)]}}else We=Ft(We,"textord"),Se=Gc[Number(We.text)];return{type:"genfrac",mode:l.mode,numer:h,denom:y,continued:!1,hasBarLine:fe,barSize:ve,leftDelim:N,rightDelim:Y,size:Se}},htmlBuilder:yl,mathmlBuilder:xl}),Qe({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(s,i){let{parser:l,funcName:h,token:y}=s;return{type:"infix",mode:l.mode,replaceWith:"\\\\abovefrac",size:Ft(i[0],"size").value,token:y}}}),Qe({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(s,i)=>{let{parser:l,funcName:h}=s;const y=i[0],E=C(Ft(i[1],"infix").size),N=i[2],P=E.number>0;return{type:"genfrac",mode:l.mode,numer:y,denom:N,continued:!1,hasBarLine:P,barSize:E,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:yl,mathmlBuilder:xl});const Qc=(s,i)=>{const l=i.style;let h,y;s.type==="supsub"?(h=s.sup?Lt(s.sup,i.havingStyle(l.sup()),i):Lt(s.sub,i.havingStyle(l.sub()),i),y=Ft(s.base,"horizBrace")):y=Ft(s,"horizBrace");const E=Lt(y.base,i.havingBaseStyle(q.DISPLAY)),N=Kn.svgSpan(y,i);let P;if(y.isOver?(P=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:E},{type:"kern",size:.1},{type:"elem",elem:N}]},i),P.children[0].children[0].children[1].classes.push("svg-align")):(P=ge.makeVList({positionType:"bottom",positionData:E.depth+.1+N.height,children:[{type:"elem",elem:N},{type:"kern",size:.1},{type:"elem",elem:E}]},i),P.children[0].children[0].children[0].classes.push("svg-align")),h){const Y=ge.makeSpan(["mord",y.isOver?"mover":"munder"],[P],i);y.isOver?P=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:Y},{type:"kern",size:.2},{type:"elem",elem:h}]},i):P=ge.makeVList({positionType:"bottom",positionData:Y.depth+.2+h.height+h.depth,children:[{type:"elem",elem:h},{type:"kern",size:.2},{type:"elem",elem:Y}]},i)}return ge.makeSpan(["mord",y.isOver?"mover":"munder"],[P],i)};Qe({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(s,i){let{parser:l,funcName:h}=s;return{type:"horizBrace",mode:l.mode,label:h,isOver:/^\\over/.test(h),base:i[0]}},htmlBuilder:Qc,mathmlBuilder:(s,i)=>{const l=Kn.mathMLnode(s.label);return new Ke.MathNode(s.isOver?"mover":"munder",[ir(s.base,i),l])}}),Qe({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(s,i)=>{let{parser:l}=s;const h=i[1],y=Ft(i[0],"url").url;return l.settings.isTrusted({command:"\\href",url:y})?{type:"href",mode:l.mode,href:y,body:ur(h)}:l.formatUnsupportedCmd("\\href")},htmlBuilder:(s,i)=>{const l=Or(s.body,i,!1);return ge.makeAnchor(s.href,[],l,i)},mathmlBuilder:(s,i)=>{let l=no(s.body,i);return l instanceof nn||(l=new nn("mrow",[l])),l.setAttribute("href",s.href),l}}),Qe({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(s,i)=>{let{parser:l}=s;const h=Ft(i[0],"url").url;if(!l.settings.isTrusted({command:"\\url",url:h}))return l.formatUnsupportedCmd("\\url");const y=[];for(let N=0;N<h.length;N++){let P=h[N];P==="~"&&(P="\\textasciitilde"),y.push({type:"textord",mode:"text",text:P})}const E={type:"text",mode:l.mode,font:"\\texttt",body:y};return{type:"href",mode:l.mode,href:h,body:ur(E)}}}),Qe({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(s,i){let{parser:l}=s;return{type:"hbox",mode:l.mode,body:ur(i[0])}},htmlBuilder(s,i){const l=Or(s.body,i,!1);return ge.makeFragment(l)},mathmlBuilder(s,i){return new Ke.MathNode("mrow",Zr(s.body,i))}}),Qe({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(s,i)=>{let{parser:l,funcName:h,token:y}=s;const E=Ft(i[0],"raw").string,N=i[1];l.settings.strict&&l.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");let P;const Y={};switch(h){case"\\htmlClass":Y.class=E,P={command:"\\htmlClass",class:E};break;case"\\htmlId":Y.id=E,P={command:"\\htmlId",id:E};break;case"\\htmlStyle":Y.style=E,P={command:"\\htmlStyle",style:E};break;case"\\htmlData":{const ne=E.split(",");for(let fe=0;fe<ne.length;fe++){const ve=ne[fe].split("=");if(ve.length!==2)throw new a("Error parsing key-value for \\htmlData");Y["data-"+ve[0].trim()]=ve[1].trim()}P={command:"\\htmlData",attributes:Y};break}default:throw new Error("Unrecognized html command")}return l.settings.isTrusted(P)?{type:"html",mode:l.mode,attributes:Y,body:ur(N)}:l.formatUnsupportedCmd(h)},htmlBuilder:(s,i)=>{const l=Or(s.body,i,!1),h=["enclosing"];s.attributes.class&&h.push(...s.attributes.class.trim().split(/\s+/));const y=ge.makeSpan(h,l,i);for(const E in s.attributes)E!=="class"&&s.attributes.hasOwnProperty(E)&&y.setAttribute(E,s.attributes[E]);return y},mathmlBuilder:(s,i)=>no(s.body,i)}),Qe({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(s,i)=>{let{parser:l}=s;return{type:"htmlmathml",mode:l.mode,html:ur(i[0]),mathml:ur(i[1])}},htmlBuilder:(s,i)=>{const l=Or(s.html,i,!1);return ge.makeFragment(l)},mathmlBuilder:(s,i)=>no(s.mathml,i)});const Cl=function(s){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(s))return{number:+s,unit:"bp"};{const i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(s);if(!i)throw new a("Invalid size: '"+s+"' in \\includegraphics");const l={number:+(i[1]+i[2]),unit:i[3]};if(!rt(l))throw new a("Invalid unit: '"+l.unit+"' in \\includegraphics.");return l}};Qe({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(s,i,l)=>{let{parser:h}=s,y={number:0,unit:"em"},E={number:.9,unit:"em"},N={number:0,unit:"em"},P="";if(l[0]){const ne=Ft(l[0],"raw").string.split(",");for(let fe=0;fe<ne.length;fe++){const ve=ne[fe].split("=");if(ve.length===2){const Se=ve[1].trim();switch(ve[0].trim()){case"alt":P=Se;break;case"width":y=Cl(Se);break;case"height":E=Cl(Se);break;case"totalheight":N=Cl(Se);break;default:throw new a("Invalid key: '"+ve[0]+"' in \\includegraphics.")}}}}const Y=Ft(i[0],"url").url;return P===""&&(P=Y,P=P.replace(/^.*[\\/]/,""),P=P.substring(0,P.lastIndexOf("."))),h.settings.isTrusted({command:"\\includegraphics",url:Y})?{type:"includegraphics",mode:h.mode,alt:P,width:y,height:E,totalheight:N,src:Y}:h.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(s,i)=>{const l=$e(s.height,i);let h=0;s.totalheight.number>0&&(h=$e(s.totalheight,i)-l);let y=0;s.width.number>0&&(y=$e(s.width,i));const E={height:de(l+h)};y>0&&(E.width=de(y)),h>0&&(E.verticalAlign=de(-h));const N=new rr(s.src,s.alt,E);return N.height=l,N.depth=h,N},mathmlBuilder:(s,i)=>{const l=new Ke.MathNode("mglyph",[]);l.setAttribute("alt",s.alt);const h=$e(s.height,i);let y=0;if(s.totalheight.number>0&&(y=$e(s.totalheight,i)-h,l.setAttribute("valign",de(-y))),l.setAttribute("height",de(h+y)),s.width.number>0){const E=$e(s.width,i);l.setAttribute("width",de(E))}return l.setAttribute("src",s.src),l}}),Qe({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(s,i){let{parser:l,funcName:h}=s;const y=Ft(i[0],"size");if(l.settings.strict){const E=h[1]==="m",N=y.value.unit==="mu";E?(N||l.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+h+" supports only mu units, "+("not "+y.value.unit+" units")),l.mode!=="math"&&l.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+h+" works only in math mode")):N&&l.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+h+" doesn't support mu units")}return{type:"kern",mode:l.mode,dimension:y.value}},htmlBuilder(s,i){return ge.makeGlue(s.dimension,i)},mathmlBuilder(s,i){const l=$e(s.dimension,i);return new Ke.SpaceNode(l)}}),Qe({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(s,i)=>{let{parser:l,funcName:h}=s;const y=i[0];return{type:"lap",mode:l.mode,alignment:h.slice(5),body:y}},htmlBuilder:(s,i)=>{let l;s.alignment==="clap"?(l=ge.makeSpan([],[Lt(s.body,i)]),l=ge.makeSpan(["inner"],[l],i)):l=ge.makeSpan(["inner"],[Lt(s.body,i)]);const h=ge.makeSpan(["fix"],[]);let y=ge.makeSpan([s.alignment],[l,h],i);const E=ge.makeSpan(["strut"]);return E.style.height=de(y.height+y.depth),y.depth&&(E.style.verticalAlign=de(-y.depth)),y.children.unshift(E),y=ge.makeSpan(["thinbox"],[y],i),ge.makeSpan(["mord","vbox"],[y],i)},mathmlBuilder:(s,i)=>{const l=new Ke.MathNode("mpadded",[ir(s.body,i)]);if(s.alignment!=="rlap"){const h=s.alignment==="llap"?"-1":"-0.5";l.setAttribute("lspace",h+"width")}return l.setAttribute("width","0px"),l}}),Qe({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(s,i){let{funcName:l,parser:h}=s;const y=h.mode;h.switchMode("math");const E=l==="\\("?"\\)":"$",N=h.parseExpression(!1,E);return h.expect(E),h.switchMode(y),{type:"styling",mode:h.mode,style:"text",body:N}}}),Qe({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(s,i){throw new a("Mismatched "+s.funcName)}});const Zc=(s,i)=>{switch(i.style.size){case q.DISPLAY.size:return s.display;case q.TEXT.size:return s.text;case q.SCRIPT.size:return s.script;case q.SCRIPTSCRIPT.size:return s.scriptscript;default:return s.text}};Qe({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(s,i)=>{let{parser:l}=s;return{type:"mathchoice",mode:l.mode,display:ur(i[0]),text:ur(i[1]),script:ur(i[2]),scriptscript:ur(i[3])}},htmlBuilder:(s,i)=>{const l=Zc(s,i),h=Or(l,i,!1);return ge.makeFragment(h)},mathmlBuilder:(s,i)=>{const l=Zc(s,i);return no(l,i)}});const Jc=(s,i,l,h,y,E,N)=>{s=ge.makeSpan([],[s]);const P=l&&D.isCharacterBox(l);let Y,ne;if(i){const Se=Lt(i,h.havingStyle(y.sup()),h);ne={elem:Se,kern:Math.max(h.fontMetrics().bigOpSpacing1,h.fontMetrics().bigOpSpacing3-Se.depth)}}if(l){const Se=Lt(l,h.havingStyle(y.sub()),h);Y={elem:Se,kern:Math.max(h.fontMetrics().bigOpSpacing2,h.fontMetrics().bigOpSpacing4-Se.height)}}let fe;if(ne&&Y){const Se=h.fontMetrics().bigOpSpacing5+Y.elem.height+Y.elem.depth+Y.kern+s.depth+N;fe=ge.makeVList({positionType:"bottom",positionData:Se,children:[{type:"kern",size:h.fontMetrics().bigOpSpacing5},{type:"elem",elem:Y.elem,marginLeft:de(-E)},{type:"kern",size:Y.kern},{type:"elem",elem:s},{type:"kern",size:ne.kern},{type:"elem",elem:ne.elem,marginLeft:de(E)},{type:"kern",size:h.fontMetrics().bigOpSpacing5}]},h)}else if(Y){const Se=s.height-N;fe=ge.makeVList({positionType:"top",positionData:Se,children:[{type:"kern",size:h.fontMetrics().bigOpSpacing5},{type:"elem",elem:Y.elem,marginLeft:de(-E)},{type:"kern",size:Y.kern},{type:"elem",elem:s}]},h)}else if(ne){const Se=s.depth+N;fe=ge.makeVList({positionType:"bottom",positionData:Se,children:[{type:"elem",elem:s},{type:"kern",size:ne.kern},{type:"elem",elem:ne.elem,marginLeft:de(E)},{type:"kern",size:h.fontMetrics().bigOpSpacing5}]},h)}else return s;const ve=[fe];if(Y&&E!==0&&!P){const Se=ge.makeSpan(["mspace"],[],h);Se.style.marginRight=de(E),ve.unshift(Se)}return ge.makeSpan(["mop","op-limits"],ve,h)},ed=["\\smallint"],Ko=(s,i)=>{let l,h,y=!1,E;s.type==="supsub"?(l=s.sup,h=s.sub,E=Ft(s.base,"op"),y=!0):E=Ft(s,"op");const N=i.style;let P=!1;N.size===q.DISPLAY.size&&E.symbol&&!ed.includes(E.name)&&(P=!0);let Y;if(E.symbol){const ve=P?"Size2-Regular":"Size1-Regular";let Se="";if((E.name==="\\oiint"||E.name==="\\oiiint")&&(Se=E.name.slice(1),E.name=Se==="oiint"?"\\iint":"\\iiint"),Y=ge.makeSymbol(E.name,ve,"math",i,["mop","op-symbol",P?"large-op":"small-op"]),Se.length>0){const We=Y.italic,Ze=ge.staticSvg(Se+"Size"+(P?"2":"1"),i);Y=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:Y,shift:0},{type:"elem",elem:Ze,shift:P?.08:0}]},i),E.name="\\"+Se,Y.classes.unshift("mop"),Y.italic=We}}else if(E.body){const ve=Or(E.body,i,!0);ve.length===1&&ve[0]instanceof ht?(Y=ve[0],Y.classes[0]="mop"):Y=ge.makeSpan(["mop"],ve,i)}else{const ve=[];for(let Se=1;Se<E.name.length;Se++)ve.push(ge.mathsym(E.name[Se],E.mode,i));Y=ge.makeSpan(["mop"],ve,i)}let ne=0,fe=0;return(Y instanceof ht||E.name==="\\oiint"||E.name==="\\oiiint")&&!E.suppressBaseShift&&(ne=(Y.height-Y.depth)/2-i.fontMetrics().axisHeight,fe=Y.italic),y?Jc(Y,l,h,i,N,fe,ne):(ne&&(Y.style.position="relative",Y.style.top=de(ne)),Y)},Aa=(s,i)=>{let l;if(s.symbol)l=new nn("mo",[ln(s.name,s.mode)]),ed.includes(s.name)&&l.setAttribute("largeop","false");else if(s.body)l=new nn("mo",Zr(s.body,i));else{l=new nn("mi",[new Fn(s.name.slice(1))]);const h=new nn("mo",[ln("\u2061","text")]);s.parentIsSupSub?l=new nn("mrow",[l,h]):l=vc([l,h])}return l},Jg={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Qe({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:(s,i)=>{let{parser:l,funcName:h}=s,y=h;return y.length===1&&(y=Jg[y]),{type:"op",mode:l.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:y}},htmlBuilder:Ko,mathmlBuilder:Aa}),Qe({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(s,i)=>{let{parser:l}=s;const h=i[0];return{type:"op",mode:l.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ur(h)}},htmlBuilder:Ko,mathmlBuilder:Aa});const e4={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Qe({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(s){let{parser:i,funcName:l}=s;return{type:"op",mode:i.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:l}},htmlBuilder:Ko,mathmlBuilder:Aa}),Qe({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(s){let{parser:i,funcName:l}=s;return{type:"op",mode:i.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:l}},htmlBuilder:Ko,mathmlBuilder:Aa}),Qe({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler(s){let{parser:i,funcName:l}=s,h=l;return h.length===1&&(h=e4[h]),{type:"op",mode:i.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:h}},htmlBuilder:Ko,mathmlBuilder:Aa});const td=(s,i)=>{let l,h,y=!1,E;s.type==="supsub"?(l=s.sup,h=s.sub,E=Ft(s.base,"operatorname"),y=!0):E=Ft(s,"operatorname");let N;if(E.body.length>0){const P=E.body.map(ne=>{const fe=ne.text;return typeof fe=="string"?{type:"textord",mode:ne.mode,text:fe}:ne}),Y=Or(P,i.withFont("mathrm"),!0);for(let ne=0;ne<Y.length;ne++){const fe=Y[ne];fe instanceof ht&&(fe.text=fe.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}N=ge.makeSpan(["mop"],Y,i)}else N=ge.makeSpan(["mop"],[],i);return y?Jc(N,l,h,i,i.style,0,0):N};Qe({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(s,i)=>{let{parser:l,funcName:h}=s;const y=i[0];return{type:"operatorname",mode:l.mode,body:ur(y),alwaysHandleSupSub:h==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:td,mathmlBuilder:(s,i)=>{let l=Zr(s.body,i.withFont("mathrm")),h=!0;for(let N=0;N<l.length;N++){const P=l[N];if(!(P instanceof Ke.SpaceNode))if(P instanceof Ke.MathNode)switch(P.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{const Y=P.children[0];P.children.length===1&&Y instanceof Ke.TextNode?Y.text=Y.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):h=!1;break}default:h=!1}else h=!1}if(h){const N=l.map(P=>P.toText()).join("");l=[new Ke.TextNode(N)]}const y=new Ke.MathNode("mi",l);y.setAttribute("mathvariant","normal");const E=new Ke.MathNode("mo",[ln("\u2061","text")]);return s.parentIsSupSub?new Ke.MathNode("mrow",[y,E]):Ke.newDocumentFragment([y,E])}}),I("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),qr({type:"ordgroup",htmlBuilder(s,i){return s.semisimple?ge.makeFragment(Or(s.body,i,!1)):ge.makeSpan(["mord"],Or(s.body,i,!0),i)},mathmlBuilder(s,i){return no(s.body,i,!0)}}),Qe({type:"overline",names:["\\overline"],props:{numArgs:1},handler(s,i){let{parser:l}=s;const h=i[0];return{type:"overline",mode:l.mode,body:h}},htmlBuilder(s,i){const l=Lt(s.body,i.havingCrampedStyle()),h=ge.makeLineSpan("overline-line",i),y=i.fontMetrics().defaultRuleThickness,E=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:3*y},{type:"elem",elem:h},{type:"kern",size:y}]},i);return ge.makeSpan(["mord","overline"],[E],i)},mathmlBuilder(s,i){const l=new Ke.MathNode("mo",[new Ke.TextNode("\u203E")]);l.setAttribute("stretchy","true");const h=new Ke.MathNode("mover",[ir(s.body,i),l]);return h.setAttribute("accent","true"),h}}),Qe({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(s,i)=>{let{parser:l}=s;const h=i[0];return{type:"phantom",mode:l.mode,body:ur(h)}},htmlBuilder:(s,i)=>{const l=Or(s.body,i.withPhantom(),!1);return ge.makeFragment(l)},mathmlBuilder:(s,i)=>{const l=Zr(s.body,i);return new Ke.MathNode("mphantom",l)}}),Qe({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(s,i)=>{let{parser:l}=s;const h=i[0];return{type:"hphantom",mode:l.mode,body:h}},htmlBuilder:(s,i)=>{let l=ge.makeSpan([],[Lt(s.body,i.withPhantom())]);if(l.height=0,l.depth=0,l.children)for(let h=0;h<l.children.length;h++)l.children[h].height=0,l.children[h].depth=0;return l=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l}]},i),ge.makeSpan(["mord"],[l],i)},mathmlBuilder:(s,i)=>{const l=Zr(ur(s.body),i),h=new Ke.MathNode("mphantom",l),y=new Ke.MathNode("mpadded",[h]);return y.setAttribute("height","0px"),y.setAttribute("depth","0px"),y}}),Qe({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(s,i)=>{let{parser:l}=s;const h=i[0];return{type:"vphantom",mode:l.mode,body:h}},htmlBuilder:(s,i)=>{const l=ge.makeSpan(["inner"],[Lt(s.body,i.withPhantom())]),h=ge.makeSpan(["fix"],[]);return ge.makeSpan(["mord","rlap"],[l,h],i)},mathmlBuilder:(s,i)=>{const l=Zr(ur(s.body),i),h=new Ke.MathNode("mphantom",l),y=new Ke.MathNode("mpadded",[h]);return y.setAttribute("width","0px"),y}}),Qe({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(s,i){let{parser:l}=s;const h=Ft(i[0],"size").value,y=i[1];return{type:"raisebox",mode:l.mode,dy:h,body:y}},htmlBuilder(s,i){const l=Lt(s.body,i),h=$e(s.dy,i);return ge.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:l}]},i)},mathmlBuilder(s,i){const l=new Ke.MathNode("mpadded",[ir(s.body,i)]),h=s.dy.number+s.dy.unit;return l.setAttribute("voffset",h),l}}),Qe({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(s){let{parser:i}=s;return{type:"internal",mode:i.mode}}}),Qe({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(s,i,l){let{parser:h}=s;const y=l[0],E=Ft(i[0],"size"),N=Ft(i[1],"size");return{type:"rule",mode:h.mode,shift:y&&Ft(y,"size").value,width:E.value,height:N.value}},htmlBuilder(s,i){const l=ge.makeSpan(["mord","rule"],[],i),h=$e(s.width,i),y=$e(s.height,i),E=s.shift?$e(s.shift,i):0;return l.style.borderRightWidth=de(h),l.style.borderTopWidth=de(y),l.style.bottom=de(E),l.width=h,l.height=y+E,l.depth=-E,l.maxFontSize=y*1.125*i.sizeMultiplier,l},mathmlBuilder(s,i){const l=$e(s.width,i),h=$e(s.height,i),y=s.shift?$e(s.shift,i):0,E=i.color&&i.getColor()||"black",N=new Ke.MathNode("mspace");N.setAttribute("mathbackground",E),N.setAttribute("width",de(l)),N.setAttribute("height",de(h));const P=new Ke.MathNode("mpadded",[N]);return y>=0?P.setAttribute("height",de(y)):(P.setAttribute("height",de(y)),P.setAttribute("depth",de(-y))),P.setAttribute("voffset",de(y)),P}});function rd(s,i,l){const h=Or(s,i,!1),y=i.sizeMultiplier/l.sizeMultiplier;for(let E=0;E<h.length;E++){const N=h[E].classes.indexOf("sizing");N<0?Array.prototype.push.apply(h[E].classes,i.sizingClasses(l)):h[E].classes[N+1]==="reset-size"+i.size&&(h[E].classes[N+1]="reset-size"+l.size),h[E].height*=y,h[E].depth*=y}return ge.makeFragment(h)}const nd=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Qe({type:"sizing",names:nd,props:{numArgs:0,allowedInText:!0},handler:(s,i)=>{let{breakOnTokenText:l,funcName:h,parser:y}=s;const E=y.parseExpression(!1,l);return{type:"sizing",mode:y.mode,size:nd.indexOf(h)+1,body:E}},htmlBuilder:(s,i)=>{const l=i.havingSize(s.size);return rd(s.body,l,i)},mathmlBuilder:(s,i)=>{const l=i.havingSize(s.size),h=Zr(s.body,l),y=new Ke.MathNode("mstyle",h);return y.setAttribute("mathsize",de(l.sizeMultiplier)),y}}),Qe({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(s,i,l)=>{let{parser:h}=s,y=!1,E=!1;const N=l[0]&&Ft(l[0],"ordgroup");if(N){let Y="";for(let ne=0;ne<N.body.length;++ne)if(Y=N.body[ne].text,Y==="t")y=!0;else if(Y==="b")E=!0;else{y=!1,E=!1;break}}else y=!0,E=!0;const P=i[0];return{type:"smash",mode:h.mode,body:P,smashHeight:y,smashDepth:E}},htmlBuilder:(s,i)=>{const l=ge.makeSpan([],[Lt(s.body,i)]);if(!s.smashHeight&&!s.smashDepth)return l;if(s.smashHeight&&(l.height=0,l.children))for(let y=0;y<l.children.length;y++)l.children[y].height=0;if(s.smashDepth&&(l.depth=0,l.children))for(let y=0;y<l.children.length;y++)l.children[y].depth=0;const h=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l}]},i);return ge.makeSpan(["mord"],[h],i)},mathmlBuilder:(s,i)=>{const l=new Ke.MathNode("mpadded",[ir(s.body,i)]);return s.smashHeight&&l.setAttribute("height","0px"),s.smashDepth&&l.setAttribute("depth","0px"),l}}),Qe({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(s,i,l){let{parser:h}=s;const y=l[0],E=i[0];return{type:"sqrt",mode:h.mode,body:E,index:y}},htmlBuilder(s,i){let l=Lt(s.body,i.havingCrampedStyle());l.height===0&&(l.height=i.fontMetrics().xHeight),l=ge.wrapFragment(l,i);const h=i.fontMetrics().defaultRuleThickness;let y=h;i.style.id<q.TEXT.id&&(y=i.fontMetrics().xHeight);let E=h+y/4;const N=l.height+l.depth+E+h,{span:P,ruleWidth:Y,advanceWidth:ne}=qn.sqrtImage(N,i),fe=P.height-Y;fe>l.height+l.depth+E&&(E=(E+fe-l.height-l.depth)/2);const ve=P.height-l.height-E-Y;l.style.paddingLeft=de(ne);const Se=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l,wrapperClasses:["svg-align"]},{type:"kern",size:-(l.height+ve)},{type:"elem",elem:P},{type:"kern",size:Y}]},i);if(s.index){const We=i.havingStyle(q.SCRIPTSCRIPT),Ze=Lt(s.index,We,i),Bt=.6*(Se.height-Se.depth),zt=ge.makeVList({positionType:"shift",positionData:-Bt,children:[{type:"elem",elem:Ze}]},i),Mt=ge.makeSpan(["root"],[zt]);return ge.makeSpan(["mord","sqrt"],[Mt,Se],i)}else return ge.makeSpan(["mord","sqrt"],[Se],i)},mathmlBuilder(s,i){const{body:l,index:h}=s;return h?new Ke.MathNode("mroot",[ir(l,i),ir(h,i)]):new Ke.MathNode("msqrt",[ir(l,i)])}});const od={display:q.DISPLAY,text:q.TEXT,script:q.SCRIPT,scriptscript:q.SCRIPTSCRIPT};Qe({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(s,i){let{breakOnTokenText:l,funcName:h,parser:y}=s;const E=y.parseExpression(!0,l),N=h.slice(1,h.length-5);return{type:"styling",mode:y.mode,style:N,body:E}},htmlBuilder(s,i){const l=od[s.style],h=i.havingStyle(l).withFont("");return rd(s.body,h,i)},mathmlBuilder(s,i){const l=od[s.style],h=i.havingStyle(l),y=Zr(s.body,h),E=new Ke.MathNode("mstyle",y),N={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[s.style];return E.setAttribute("scriptlevel",N[0]),E.setAttribute("displaystyle",N[1]),E}});const t4=function(s,i){const l=s.base;return l?l.type==="op"?l.limits&&(i.style.size===q.DISPLAY.size||l.alwaysHandleSupSub)?Ko:null:l.type==="operatorname"?l.alwaysHandleSupSub&&(i.style.size===q.DISPLAY.size||l.limits)?td:null:l.type==="accent"?D.isCharacterBox(l.base)?il:null:l.type==="horizBrace"&&!s.sub===l.isOver?Qc:null:null};qr({type:"supsub",htmlBuilder(s,i){const l=t4(s,i);if(l)return l(s,i);const{base:h,sup:y,sub:E}=s,N=Lt(h,i);let P,Y;const ne=i.fontMetrics();let fe=0,ve=0;const Se=h&&D.isCharacterBox(h);if(y){const Ht=i.havingStyle(i.style.sup());P=Lt(y,Ht,i),Se||(fe=N.height-Ht.fontMetrics().supDrop*Ht.sizeMultiplier/i.sizeMultiplier)}if(E){const Ht=i.havingStyle(i.style.sub());Y=Lt(E,Ht,i),Se||(ve=N.depth+Ht.fontMetrics().subDrop*Ht.sizeMultiplier/i.sizeMultiplier)}let We;i.style===q.DISPLAY?We=ne.sup1:i.style.cramped?We=ne.sup3:We=ne.sup2;const Ze=i.sizeMultiplier,Bt=de(.5/ne.ptPerEm/Ze);let zt=null;if(Y){const Ht=s.base&&s.base.type==="op"&&s.base.name&&(s.base.name==="\\oiint"||s.base.name==="\\oiiint");(N instanceof ht||Ht)&&(zt=de(-N.italic))}let Mt;if(P&&Y){fe=Math.max(fe,We,P.depth+.25*ne.xHeight),ve=Math.max(ve,ne.sub2);const Ht=4*ne.defaultRuleThickness;if(fe-P.depth-(Y.height-ve)<Ht){ve=Ht-(fe-P.depth)+Y.height;const zr=.8*ne.xHeight-(fe-P.depth);zr>0&&(fe+=zr,ve-=zr)}const cr=[{type:"elem",elem:Y,shift:ve,marginRight:Bt,marginLeft:zt},{type:"elem",elem:P,shift:-fe,marginRight:Bt}];Mt=ge.makeVList({positionType:"individualShift",children:cr},i)}else if(Y){ve=Math.max(ve,ne.sub1,Y.height-.8*ne.xHeight);const Ht=[{type:"elem",elem:Y,marginLeft:zt,marginRight:Bt}];Mt=ge.makeVList({positionType:"shift",positionData:ve,children:Ht},i)}else if(P)fe=Math.max(fe,We,P.depth+.25*ne.xHeight),Mt=ge.makeVList({positionType:"shift",positionData:-fe,children:[{type:"elem",elem:P,marginRight:Bt}]},i);else throw new Error("supsub must have either sup or sub.");const Kt=el(N,"right")||"mord";return ge.makeSpan([Kt],[N,ge.makeSpan(["msupsub"],[Mt])],i)},mathmlBuilder(s,i){let l=!1,h,y;s.base&&s.base.type==="horizBrace"&&(y=!!s.sup,y===s.base.isOver&&(l=!0,h=s.base.isOver)),s.base&&(s.base.type==="op"||s.base.type==="operatorname")&&(s.base.parentIsSupSub=!0);const E=[ir(s.base,i)];s.sub&&E.push(ir(s.sub,i)),s.sup&&E.push(ir(s.sup,i));let N;if(l)N=h?"mover":"munder";else if(s.sub)if(s.sup){const P=s.base;P&&P.type==="op"&&P.limits&&i.style===q.DISPLAY||P&&P.type==="operatorname"&&P.alwaysHandleSupSub&&(i.style===q.DISPLAY||P.limits)?N="munderover":N="msubsup"}else{const P=s.base;P&&P.type==="op"&&P.limits&&(i.style===q.DISPLAY||P.alwaysHandleSupSub)||P&&P.type==="operatorname"&&P.alwaysHandleSupSub&&(P.limits||i.style===q.DISPLAY)?N="munder":N="msub"}else{const P=s.base;P&&P.type==="op"&&P.limits&&(i.style===q.DISPLAY||P.alwaysHandleSupSub)||P&&P.type==="operatorname"&&P.alwaysHandleSupSub&&(P.limits||i.style===q.DISPLAY)?N="mover":N="msup"}return new Ke.MathNode(N,E)}}),qr({type:"atom",htmlBuilder(s,i){return ge.mathsym(s.text,s.mode,i,["m"+s.family])},mathmlBuilder(s,i){const l=new Ke.MathNode("mo",[ln(s.text,s.mode)]);if(s.family==="bin"){const h=nl(s,i);h==="bold-italic"&&l.setAttribute("mathvariant",h)}else s.family==="punct"?l.setAttribute("separator","true"):(s.family==="open"||s.family==="close")&&l.setAttribute("stretchy","false");return l}});const ad={mi:"italic",mn:"normal",mtext:"normal"};qr({type:"mathord",htmlBuilder(s,i){return ge.makeOrd(s,i,"mathord")},mathmlBuilder(s,i){const l=new Ke.MathNode("mi",[ln(s.text,s.mode,i)]),h=nl(s,i)||"italic";return h!==ad[l.type]&&l.setAttribute("mathvariant",h),l}}),qr({type:"textord",htmlBuilder(s,i){return ge.makeOrd(s,i,"textord")},mathmlBuilder(s,i){const l=ln(s.text,s.mode,i),h=nl(s,i)||"normal";let y;return s.mode==="text"?y=new Ke.MathNode("mtext",[l]):/[0-9]/.test(s.text)?y=new Ke.MathNode("mn",[l]):s.text==="\\prime"?y=new Ke.MathNode("mo",[l]):y=new Ke.MathNode("mi",[l]),h!==ad[y.type]&&y.setAttribute("mathvariant",h),y}});const wl={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Dl={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};qr({type:"spacing",htmlBuilder(s,i){if(Dl.hasOwnProperty(s.text)){const l=Dl[s.text].className||"";if(s.mode==="text"){const h=ge.makeOrd(s,i,"textord");return h.classes.push(l),h}else return ge.makeSpan(["mspace",l],[ge.mathsym(s.text,s.mode,i)],i)}else{if(wl.hasOwnProperty(s.text))return ge.makeSpan(["mspace",wl[s.text]],[],i);throw new a('Unknown type of space "'+s.text+'"')}},mathmlBuilder(s,i){let l;if(Dl.hasOwnProperty(s.text))l=new Ke.MathNode("mtext",[new Ke.TextNode("\xA0")]);else{if(wl.hasOwnProperty(s.text))return new Ke.MathNode("mspace");throw new a('Unknown type of space "'+s.text+'"')}return l}});const id=()=>{const s=new Ke.MathNode("mtd",[]);return s.setAttribute("width","50%"),s};qr({type:"tag",mathmlBuilder(s,i){const l=new Ke.MathNode("mtable",[new Ke.MathNode("mtr",[id(),new Ke.MathNode("mtd",[no(s.body,i)]),id(),new Ke.MathNode("mtd",[no(s.tag,i)])])]);return l.setAttribute("width","100%"),l}});const sd={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},ld={"\\textbf":"textbf","\\textmd":"textmd"},r4={"\\textit":"textit","\\textup":"textup"},ud=(s,i)=>{const l=s.font;if(l){if(sd[l])return i.withTextFontFamily(sd[l]);if(ld[l])return i.withTextFontWeight(ld[l]);if(l==="\\emph")return i.fontShape==="textit"?i.withTextFontShape("textup"):i.withTextFontShape("textit")}else return i;return i.withTextFontShape(r4[l])};Qe({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(s,i){let{parser:l,funcName:h}=s;const y=i[0];return{type:"text",mode:l.mode,body:ur(y),font:h}},htmlBuilder(s,i){const l=ud(s,i),h=Or(s.body,l,!0);return ge.makeSpan(["mord","text"],h,l)},mathmlBuilder(s,i){const l=ud(s,i);return no(s.body,l)}}),Qe({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(s,i){let{parser:l}=s;return{type:"underline",mode:l.mode,body:i[0]}},htmlBuilder(s,i){const l=Lt(s.body,i),h=ge.makeLineSpan("underline-line",i),y=i.fontMetrics().defaultRuleThickness,E=ge.makeVList({positionType:"top",positionData:l.height,children:[{type:"kern",size:y},{type:"elem",elem:h},{type:"kern",size:3*y},{type:"elem",elem:l}]},i);return ge.makeSpan(["mord","underline"],[E],i)},mathmlBuilder(s,i){const l=new Ke.MathNode("mo",[new Ke.TextNode("\u203E")]);l.setAttribute("stretchy","true");const h=new Ke.MathNode("munder",[ir(s.body,i),l]);return h.setAttribute("accentunder","true"),h}}),Qe({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(s,i){let{parser:l}=s;return{type:"vcenter",mode:l.mode,body:i[0]}},htmlBuilder(s,i){const l=Lt(s.body,i),h=i.fontMetrics().axisHeight,y=.5*(l.height-h-(l.depth+h));return ge.makeVList({positionType:"shift",positionData:y,children:[{type:"elem",elem:l}]},i)},mathmlBuilder(s,i){return new Ke.MathNode("mpadded",[ir(s.body,i)],["vcenter"])}}),Qe({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(s,i,l){throw new a("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(s,i){const l=cd(s),h=[],y=i.havingStyle(i.style.text());for(let E=0;E<l.length;E++){let N=l[E];N==="~"&&(N="\\textasciitilde"),h.push(ge.makeSymbol(N,"Typewriter-Regular",s.mode,y,["mord","texttt"]))}return ge.makeSpan(["mord","text"].concat(y.sizingClasses(i)),ge.tryCombineChars(h),y)},mathmlBuilder(s,i){const l=new Ke.TextNode(cd(s)),h=new Ke.MathNode("mtext",[l]);return h.setAttribute("mathvariant","monospace"),h}});const cd=s=>s.body.replace(/ /g,s.star?"\u2423":"\xA0");var ao=Kr;const dd=`[ \r
488
- ]`,n4="\\\\[a-zA-Z@]+",o4="\\\\[^\uD800-\uDFFF]",a4="("+n4+")"+dd+"*",i4=`\\\\(
489
- |[ \r ]+
490
- ?)[ \r ]*`,El="[\u0300-\u036F]",s4=new RegExp(El+"+$"),l4="("+dd+"+)|"+(i4+"|")+"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(El+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(El+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+a4)+("|"+o4+")");class fd{constructor(i,l){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=i,this.settings=l,this.tokenRegex=new RegExp(l4,"g"),this.catcodes={"%":14,"~":13}}setCatcode(i,l){this.catcodes[i]=l}lex(){const i=this.input,l=this.tokenRegex.lastIndex;if(l===i.length)return new on("EOF",new Jr(this,l,l));const h=this.tokenRegex.exec(i);if(h===null||h.index!==l)throw new a("Unexpected character: '"+i[l]+"'",new on(i[l],new Jr(this,l,l+1)));const y=h[6]||h[3]||(h[2]?"\\ ":" ");if(this.catcodes[y]===14){const E=i.indexOf(`
491
- `,this.tokenRegex.lastIndex);return E===-1?(this.tokenRegex.lastIndex=i.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=E+1,this.lex()}return new on(y,new Jr(this,l,this.tokenRegex.lastIndex))}}class u4{constructor(i,l){i===void 0&&(i={}),l===void 0&&(l={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=l,this.builtins=i,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new a("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");const i=this.undefStack.pop();for(const l in i)i.hasOwnProperty(l)&&(i[l]==null?delete this.current[l]:this.current[l]=i[l])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(i){return this.current.hasOwnProperty(i)||this.builtins.hasOwnProperty(i)}get(i){return this.current.hasOwnProperty(i)?this.current[i]:this.builtins[i]}set(i,l,h){if(h===void 0&&(h=!1),h){for(let y=0;y<this.undefStack.length;y++)delete this.undefStack[y][i];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][i]=l)}else{const y=this.undefStack[this.undefStack.length-1];y&&!y.hasOwnProperty(i)&&(y[i]=this.current[i])}l==null?delete this.current[i]:this.current[i]=l}}var c4=Lc;I("\\noexpand",function(s){const i=s.popToken();return s.isExpandable(i.text)&&(i.noexpand=!0,i.treatAsRelax=!0),{tokens:[i],numArgs:0}}),I("\\expandafter",function(s){const i=s.popToken();return s.expandOnce(!0),{tokens:[i],numArgs:0}}),I("\\@firstoftwo",function(s){return{tokens:s.consumeArgs(2)[0],numArgs:0}}),I("\\@secondoftwo",function(s){return{tokens:s.consumeArgs(2)[1],numArgs:0}}),I("\\@ifnextchar",function(s){const i=s.consumeArgs(3);s.consumeSpaces();const l=s.future();return i[0].length===1&&i[0][0].text===l.text?{tokens:i[1],numArgs:0}:{tokens:i[2],numArgs:0}}),I("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),I("\\TextOrMath",function(s){const i=s.consumeArgs(2);return s.mode==="text"?{tokens:i[0],numArgs:0}:{tokens:i[1],numArgs:0}});const hd={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};I("\\char",function(s){let i=s.popToken(),l,h="";if(i.text==="'")l=8,i=s.popToken();else if(i.text==='"')l=16,i=s.popToken();else if(i.text==="`")if(i=s.popToken(),i.text[0]==="\\")h=i.text.charCodeAt(1);else{if(i.text==="EOF")throw new a("\\char` missing argument");h=i.text.charCodeAt(0)}else l=10;if(l){if(h=hd[i.text],h==null||h>=l)throw new a("Invalid base-"+l+" digit "+i.text);let y;for(;(y=hd[s.future().text])!=null&&y<l;)h*=l,h+=y,s.popToken()}return"\\@char{"+h+"}"});const kl=(s,i,l,h)=>{let y=s.consumeArg().tokens;if(y.length!==1)throw new a("\\newcommand's first argument must be a macro name");const E=y[0].text,N=s.isDefined(E);if(N&&!i)throw new a("\\newcommand{"+E+"} attempting to redefine "+(E+"; use \\renewcommand"));if(!N&&!l)throw new a("\\renewcommand{"+E+"} when command "+E+" does not yet exist; use \\newcommand");let P=0;if(y=s.consumeArg().tokens,y.length===1&&y[0].text==="["){let Y="",ne=s.expandNextToken();for(;ne.text!=="]"&&ne.text!=="EOF";)Y+=ne.text,ne=s.expandNextToken();if(!Y.match(/^\s*[0-9]+\s*$/))throw new a("Invalid number of arguments: "+Y);P=parseInt(Y),y=s.consumeArg().tokens}return N&&h||s.macros.set(E,{tokens:y,numArgs:P}),""};I("\\newcommand",s=>kl(s,!1,!0,!1)),I("\\renewcommand",s=>kl(s,!0,!1,!1)),I("\\providecommand",s=>kl(s,!0,!0,!0)),I("\\message",s=>{const i=s.consumeArgs(1)[0];return console.log(i.reverse().map(l=>l.text).join("")),""}),I("\\errmessage",s=>{const i=s.consumeArgs(1)[0];return console.error(i.reverse().map(l=>l.text).join("")),""}),I("\\show",s=>{const i=s.popToken(),l=i.text;return console.log(i,s.macros.get(l),ao[l],Ot.math[l],Ot.text[l]),""}),I("\\bgroup","{"),I("\\egroup","}"),I("~","\\nobreakspace"),I("\\lq","`"),I("\\rq","'"),I("\\aa","\\r a"),I("\\AA","\\r A"),I("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}"),I("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),I("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"),I("\u212C","\\mathscr{B}"),I("\u2130","\\mathscr{E}"),I("\u2131","\\mathscr{F}"),I("\u210B","\\mathscr{H}"),I("\u2110","\\mathscr{I}"),I("\u2112","\\mathscr{L}"),I("\u2133","\\mathscr{M}"),I("\u211B","\\mathscr{R}"),I("\u212D","\\mathfrak{C}"),I("\u210C","\\mathfrak{H}"),I("\u2128","\\mathfrak{Z}"),I("\\Bbbk","\\Bbb{k}"),I("\xB7","\\cdotp"),I("\\llap","\\mathllap{\\textrm{#1}}"),I("\\rlap","\\mathrlap{\\textrm{#1}}"),I("\\clap","\\mathclap{\\textrm{#1}}"),I("\\mathstrut","\\vphantom{(}"),I("\\underbar","\\underline{\\text{#1}}"),I("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),I("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),I("\\ne","\\neq"),I("\u2260","\\neq"),I("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),I("\u2209","\\notin"),I("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),I("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),I("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"),I("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"),I("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"),I("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"),I("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"),I("\u27C2","\\perp"),I("\u203C","\\mathclose{!\\mkern-0.8mu!}"),I("\u220C","\\notni"),I("\u231C","\\ulcorner"),I("\u231D","\\urcorner"),I("\u231E","\\llcorner"),I("\u231F","\\lrcorner"),I("\xA9","\\copyright"),I("\xAE","\\textregistered"),I("\uFE0F","\\textregistered"),I("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),I("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),I("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),I("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),I("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),I("\u22EE","\\vdots"),I("\\varGamma","\\mathit{\\Gamma}"),I("\\varDelta","\\mathit{\\Delta}"),I("\\varTheta","\\mathit{\\Theta}"),I("\\varLambda","\\mathit{\\Lambda}"),I("\\varXi","\\mathit{\\Xi}"),I("\\varPi","\\mathit{\\Pi}"),I("\\varSigma","\\mathit{\\Sigma}"),I("\\varUpsilon","\\mathit{\\Upsilon}"),I("\\varPhi","\\mathit{\\Phi}"),I("\\varPsi","\\mathit{\\Psi}"),I("\\varOmega","\\mathit{\\Omega}"),I("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),I("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),I("\\boxed","\\fbox{$\\displaystyle{#1}$}"),I("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),I("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),I("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),I("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),I("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");const pd={",":"\\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"};I("\\dots",function(s){let i="\\dotso";const l=s.expandAfterFuture().text;return l in pd?i=pd[l]:(l.slice(0,4)==="\\not"||l in Ot.math&&["bin","rel"].includes(Ot.math[l].group))&&(i="\\dotsb"),i});const Sl={")":!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};I("\\dotso",function(s){return s.future().text in Sl?"\\ldots\\,":"\\ldots"}),I("\\dotsc",function(s){const i=s.future().text;return i in Sl&&i!==","?"\\ldots\\,":"\\ldots"}),I("\\cdots",function(s){return s.future().text in Sl?"\\@cdots\\,":"\\@cdots"}),I("\\dotsb","\\cdots"),I("\\dotsm","\\cdots"),I("\\dotsi","\\!\\cdots"),I("\\dotsx","\\ldots\\,"),I("\\DOTSI","\\relax"),I("\\DOTSB","\\relax"),I("\\DOTSX","\\relax"),I("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),I("\\,","\\tmspace+{3mu}{.1667em}"),I("\\thinspace","\\,"),I("\\>","\\mskip{4mu}"),I("\\:","\\tmspace+{4mu}{.2222em}"),I("\\medspace","\\:"),I("\\;","\\tmspace+{5mu}{.2777em}"),I("\\thickspace","\\;"),I("\\!","\\tmspace-{3mu}{.1667em}"),I("\\negthinspace","\\!"),I("\\negmedspace","\\tmspace-{4mu}{.2222em}"),I("\\negthickspace","\\tmspace-{5mu}{.277em}"),I("\\enspace","\\kern.5em "),I("\\enskip","\\hskip.5em\\relax"),I("\\quad","\\hskip1em\\relax"),I("\\qquad","\\hskip2em\\relax"),I("\\tag","\\@ifstar\\tag@literal\\tag@paren"),I("\\tag@paren","\\tag@literal{({#1})}"),I("\\tag@literal",s=>{if(s.macros.get("\\df@tag"))throw new a("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),I("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),I("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),I("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),I("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),I("\\newline","\\\\\\relax"),I("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");const md=de(ze["Main-Regular"][84][1]-.7*ze["Main-Regular"][65][1]);I("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+md+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),I("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+md+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),I("\\hspace","\\@ifstar\\@hspacer\\@hspace"),I("\\@hspace","\\hskip #1\\relax"),I("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),I("\\ordinarycolon",":"),I("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),I("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),I("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),I("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),I("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),I("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),I("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),I("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),I("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),I("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),I("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),I("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),I("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),I("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),I("\u2237","\\dblcolon"),I("\u2239","\\eqcolon"),I("\u2254","\\coloneqq"),I("\u2255","\\eqqcolon"),I("\u2A74","\\Coloneqq"),I("\\ratio","\\vcentcolon"),I("\\coloncolon","\\dblcolon"),I("\\colonequals","\\coloneqq"),I("\\coloncolonequals","\\Coloneqq"),I("\\equalscolon","\\eqqcolon"),I("\\equalscoloncolon","\\Eqqcolon"),I("\\colonminus","\\coloneq"),I("\\coloncolonminus","\\Coloneq"),I("\\minuscolon","\\eqcolon"),I("\\minuscoloncolon","\\Eqcolon"),I("\\coloncolonapprox","\\Colonapprox"),I("\\coloncolonsim","\\Colonsim"),I("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),I("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),I("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),I("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),I("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"),I("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),I("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),I("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),I("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),I("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),I("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),I("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),I("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),I("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),I("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),I("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),I("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),I("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),I("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),I("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),I("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),I("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),I("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),I("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}"),I("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}"),I("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}"),I("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}"),I("\\imath","\\html@mathml{\\@imath}{\u0131}"),I("\\jmath","\\html@mathml{\\@jmath}{\u0237}"),I("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"),I("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"),I("\u27E6","\\llbracket"),I("\u27E7","\\rrbracket"),I("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),I("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),I("\u2983","\\lBrace"),I("\u2984","\\rBrace"),I("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}"),I("\u29B5","\\minuso"),I("\\darr","\\downarrow"),I("\\dArr","\\Downarrow"),I("\\Darr","\\Downarrow"),I("\\lang","\\langle"),I("\\rang","\\rangle"),I("\\uarr","\\uparrow"),I("\\uArr","\\Uparrow"),I("\\Uarr","\\Uparrow"),I("\\N","\\mathbb{N}"),I("\\R","\\mathbb{R}"),I("\\Z","\\mathbb{Z}"),I("\\alef","\\aleph"),I("\\alefsym","\\aleph"),I("\\Alpha","\\mathrm{A}"),I("\\Beta","\\mathrm{B}"),I("\\bull","\\bullet"),I("\\Chi","\\mathrm{X}"),I("\\clubs","\\clubsuit"),I("\\cnums","\\mathbb{C}"),I("\\Complex","\\mathbb{C}"),I("\\Dagger","\\ddagger"),I("\\diamonds","\\diamondsuit"),I("\\empty","\\emptyset"),I("\\Epsilon","\\mathrm{E}"),I("\\Eta","\\mathrm{H}"),I("\\exist","\\exists"),I("\\harr","\\leftrightarrow"),I("\\hArr","\\Leftrightarrow"),I("\\Harr","\\Leftrightarrow"),I("\\hearts","\\heartsuit"),I("\\image","\\Im"),I("\\infin","\\infty"),I("\\Iota","\\mathrm{I}"),I("\\isin","\\in"),I("\\Kappa","\\mathrm{K}"),I("\\larr","\\leftarrow"),I("\\lArr","\\Leftarrow"),I("\\Larr","\\Leftarrow"),I("\\lrarr","\\leftrightarrow"),I("\\lrArr","\\Leftrightarrow"),I("\\Lrarr","\\Leftrightarrow"),I("\\Mu","\\mathrm{M}"),I("\\natnums","\\mathbb{N}"),I("\\Nu","\\mathrm{N}"),I("\\Omicron","\\mathrm{O}"),I("\\plusmn","\\pm"),I("\\rarr","\\rightarrow"),I("\\rArr","\\Rightarrow"),I("\\Rarr","\\Rightarrow"),I("\\real","\\Re"),I("\\reals","\\mathbb{R}"),I("\\Reals","\\mathbb{R}"),I("\\Rho","\\mathrm{P}"),I("\\sdot","\\cdot"),I("\\sect","\\S"),I("\\spades","\\spadesuit"),I("\\sub","\\subset"),I("\\sube","\\subseteq"),I("\\supe","\\supseteq"),I("\\Tau","\\mathrm{T}"),I("\\thetasym","\\vartheta"),I("\\weierp","\\wp"),I("\\Zeta","\\mathrm{Z}"),I("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),I("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),I("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),I("\\bra","\\mathinner{\\langle{#1}|}"),I("\\ket","\\mathinner{|{#1}\\rangle}"),I("\\braket","\\mathinner{\\langle{#1}\\rangle}"),I("\\Bra","\\left\\langle#1\\right|"),I("\\Ket","\\left|#1\\right\\rangle");const gd=s=>i=>{const l=i.consumeArg().tokens,h=i.consumeArg().tokens,y=i.consumeArg().tokens,E=i.consumeArg().tokens,N=i.macros.get("|"),P=i.macros.get("\\|");i.macros.beginGroup();const Y=ve=>Se=>{s&&(Se.macros.set("|",N),y.length&&Se.macros.set("\\|",P));let We=ve;return!ve&&y.length&&Se.future().text==="|"&&(Se.popToken(),We=!0),{tokens:We?y:h,numArgs:0}};i.macros.set("|",Y(!1)),y.length&&i.macros.set("\\|",Y(!0));const ne=i.consumeArg().tokens,fe=i.expandTokens([...E,...ne,...l]);return i.macros.endGroup(),{tokens:fe.reverse(),numArgs:0}};I("\\bra@ket",gd(!1)),I("\\bra@set",gd(!0)),I("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),I("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),I("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),I("\\angln","{\\angl n}"),I("\\blue","\\textcolor{##6495ed}{#1}"),I("\\orange","\\textcolor{##ffa500}{#1}"),I("\\pink","\\textcolor{##ff00af}{#1}"),I("\\red","\\textcolor{##df0030}{#1}"),I("\\green","\\textcolor{##28ae7b}{#1}"),I("\\gray","\\textcolor{gray}{#1}"),I("\\purple","\\textcolor{##9d38bd}{#1}"),I("\\blueA","\\textcolor{##ccfaff}{#1}"),I("\\blueB","\\textcolor{##80f6ff}{#1}"),I("\\blueC","\\textcolor{##63d9ea}{#1}"),I("\\blueD","\\textcolor{##11accd}{#1}"),I("\\blueE","\\textcolor{##0c7f99}{#1}"),I("\\tealA","\\textcolor{##94fff5}{#1}"),I("\\tealB","\\textcolor{##26edd5}{#1}"),I("\\tealC","\\textcolor{##01d1c1}{#1}"),I("\\tealD","\\textcolor{##01a995}{#1}"),I("\\tealE","\\textcolor{##208170}{#1}"),I("\\greenA","\\textcolor{##b6ffb0}{#1}"),I("\\greenB","\\textcolor{##8af281}{#1}"),I("\\greenC","\\textcolor{##74cf70}{#1}"),I("\\greenD","\\textcolor{##1fab54}{#1}"),I("\\greenE","\\textcolor{##0d923f}{#1}"),I("\\goldA","\\textcolor{##ffd0a9}{#1}"),I("\\goldB","\\textcolor{##ffbb71}{#1}"),I("\\goldC","\\textcolor{##ff9c39}{#1}"),I("\\goldD","\\textcolor{##e07d10}{#1}"),I("\\goldE","\\textcolor{##a75a05}{#1}"),I("\\redA","\\textcolor{##fca9a9}{#1}"),I("\\redB","\\textcolor{##ff8482}{#1}"),I("\\redC","\\textcolor{##f9685d}{#1}"),I("\\redD","\\textcolor{##e84d39}{#1}"),I("\\redE","\\textcolor{##bc2612}{#1}"),I("\\maroonA","\\textcolor{##ffbde0}{#1}"),I("\\maroonB","\\textcolor{##ff92c6}{#1}"),I("\\maroonC","\\textcolor{##ed5fa6}{#1}"),I("\\maroonD","\\textcolor{##ca337c}{#1}"),I("\\maroonE","\\textcolor{##9e034e}{#1}"),I("\\purpleA","\\textcolor{##ddd7ff}{#1}"),I("\\purpleB","\\textcolor{##c6b9fc}{#1}"),I("\\purpleC","\\textcolor{##aa87ff}{#1}"),I("\\purpleD","\\textcolor{##7854ab}{#1}"),I("\\purpleE","\\textcolor{##543b78}{#1}"),I("\\mintA","\\textcolor{##f5f9e8}{#1}"),I("\\mintB","\\textcolor{##edf2df}{#1}"),I("\\mintC","\\textcolor{##e0e5cc}{#1}"),I("\\grayA","\\textcolor{##f6f7f7}{#1}"),I("\\grayB","\\textcolor{##f0f1f2}{#1}"),I("\\grayC","\\textcolor{##e3e5e6}{#1}"),I("\\grayD","\\textcolor{##d6d8da}{#1}"),I("\\grayE","\\textcolor{##babec2}{#1}"),I("\\grayF","\\textcolor{##888d93}{#1}"),I("\\grayG","\\textcolor{##626569}{#1}"),I("\\grayH","\\textcolor{##3b3e40}{#1}"),I("\\grayI","\\textcolor{##21242c}{#1}"),I("\\kaBlue","\\textcolor{##314453}{#1}"),I("\\kaGreen","\\textcolor{##71B307}{#1}");const vd={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class d4{constructor(i,l,h){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=l,this.expansionCount=0,this.feed(i),this.macros=new u4(c4,l.macros),this.mode=h,this.stack=[]}feed(i){this.lexer=new fd(i,this.settings)}switchMode(i){this.mode=i}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(i){this.stack.push(i)}pushTokens(i){this.stack.push(...i)}scanArgument(i){let l,h,y;if(i){if(this.consumeSpaces(),this.future().text!=="[")return null;l=this.popToken(),{tokens:y,end:h}=this.consumeArg(["]"])}else({tokens:y,start:l,end:h}=this.consumeArg());return this.pushToken(new on("EOF",h.loc)),this.pushTokens(y),new on("",Jr.range(l,h))}consumeSpaces(){for(;this.future().text===" ";)this.stack.pop()}consumeArg(i){const l=[],h=i&&i.length>0;h||this.consumeSpaces();const y=this.future();let E,N=0,P=0;do{if(E=this.popToken(),l.push(E),E.text==="{")++N;else if(E.text==="}"){if(--N,N===-1)throw new a("Extra }",E)}else if(E.text==="EOF")throw new a("Unexpected end of input in a macro argument, expected '"+(i&&h?i[P]:"}")+"'",E);if(i&&h)if((N===0||N===1&&i[P]==="{")&&E.text===i[P]){if(++P,P===i.length){l.splice(-P,P);break}}else P=0}while(N!==0||h);return y.text==="{"&&l[l.length-1].text==="}"&&(l.pop(),l.shift()),l.reverse(),{tokens:l,start:y,end:E}}consumeArgs(i,l){if(l){if(l.length!==i+1)throw new a("The length of delimiters doesn't match the number of args!");const y=l[0];for(let E=0;E<y.length;E++){const N=this.popToken();if(y[E]!==N.text)throw new a("Use of the macro doesn't match its definition",N)}}const h=[];for(let y=0;y<i;y++)h.push(this.consumeArg(l&&l[y+1]).tokens);return h}countExpansion(i){if(this.expansionCount+=i,this.expansionCount>this.settings.maxExpand)throw new a("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(i){const l=this.popToken(),h=l.text,y=l.noexpand?null:this._getExpansion(h);if(y==null||i&&y.unexpandable){if(i&&y==null&&h[0]==="\\"&&!this.isDefined(h))throw new a("Undefined control sequence: "+h);return this.pushToken(l),!1}this.countExpansion(1);let E=y.tokens;const N=this.consumeArgs(y.numArgs,y.delimiters);if(y.numArgs){E=E.slice();for(let P=E.length-1;P>=0;--P){let Y=E[P];if(Y.text==="#"){if(P===0)throw new a("Incomplete placeholder at end of macro body",Y);if(Y=E[--P],Y.text==="#")E.splice(P+1,1);else if(/^[1-9]$/.test(Y.text))E.splice(P,2,...N[+Y.text-1]);else throw new a("Not a valid argument number",Y)}}}return this.pushTokens(E),E.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){const i=this.stack.pop();return i.treatAsRelax&&(i.text="\\relax"),i}throw new Error}expandMacro(i){return this.macros.has(i)?this.expandTokens([new on(i)]):void 0}expandTokens(i){const l=[],h=this.stack.length;for(this.pushTokens(i);this.stack.length>h;)if(this.expandOnce(!0)===!1){const y=this.stack.pop();y.treatAsRelax&&(y.noexpand=!1,y.treatAsRelax=!1),l.push(y)}return this.countExpansion(l.length),l}expandMacroAsText(i){const l=this.expandMacro(i);return l&&l.map(h=>h.text).join("")}_getExpansion(i){const l=this.macros.get(i);if(l==null)return l;if(i.length===1){const y=this.lexer.catcodes[i];if(y!=null&&y!==13)return}const h=typeof l=="function"?l(this):l;if(typeof h=="string"){let y=0;if(h.indexOf("#")!==-1){const Y=h.replace(/##/g,"");for(;Y.indexOf("#"+(y+1))!==-1;)++y}const E=new fd(h,this.settings),N=[];let P=E.lex();for(;P.text!=="EOF";)N.push(P),P=E.lex();return N.reverse(),{tokens:N,numArgs:y}}return h}isDefined(i){return this.macros.has(i)||ao.hasOwnProperty(i)||Ot.math.hasOwnProperty(i)||Ot.text.hasOwnProperty(i)||vd.hasOwnProperty(i)}isExpandable(i){const l=this.macros.get(i);return l!=null?typeof l=="string"||typeof l=="function"||!l.unexpandable:ao.hasOwnProperty(i)&&!ao[i].primitive}}const bd=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Ci=Object.freeze({"\u208A":"+","\u208B":"-","\u208C":"=","\u208D":"(","\u208E":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1D62":"i","\u2C7C":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209A":"p","\u1D63":"r","\u209B":"s","\u209C":"t","\u1D64":"u","\u1D65":"v","\u2093":"x","\u1D66":"\u03B2","\u1D67":"\u03B3","\u1D68":"\u03C1","\u1D69":"\u03D5","\u1D6A":"\u03C7","\u207A":"+","\u207B":"-","\u207C":"=","\u207D":"(","\u207E":")","\u2070":"0","\xB9":"1","\xB2":"2","\xB3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1D2C":"A","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u2C7D":"V","\u1D42":"W","\u1D43":"a","\u1D47":"b","\u1D9C":"c","\u1D48":"d","\u1D49":"e","\u1DA0":"f","\u1D4D":"g",\u02B0:"h","\u2071":"i",\u02B2:"j","\u1D4F":"k",\u02E1:"l","\u1D50":"m",\u207F:"n","\u1D52":"o","\u1D56":"p",\u02B3:"r",\u02E2:"s","\u1D57":"t","\u1D58":"u","\u1D5B":"v",\u02B7:"w",\u02E3:"x",\u02B8:"y","\u1DBB":"z","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03D5","\u1D61":"\u03C7","\u1DBF":"\u03B8"}),Bl={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"},"\u0327":{text:"\\c"}},yd={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u1E09:"c\u0327\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u00E7:"c\u0327",\u010F:"d\u030C",\u1E0B:"d\u0307",\u1E11:"d\u0327",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u1E1D:"e\u0327\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u0229:"e\u0327",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u0123:"g\u0327",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u1E29:"h\u0327",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u0137:"k\u0327",\u013A:"l\u0301",\u013E:"l\u030C",\u013C:"l\u0327",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u0146:"n\u0327",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u0157:"r\u0327",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u015F:"s\u0327",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u0163:"t\u0327",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u1E08:"C\u0327\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u00C7:"C\u0327",\u010E:"D\u030C",\u1E0A:"D\u0307",\u1E10:"D\u0327",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u1E1C:"E\u0327\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u0228:"E\u0327",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u0122:"G\u0327",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u1E28:"H\u0327",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0136:"K\u0327",\u0139:"L\u0301",\u013D:"L\u030C",\u013B:"L\u0327",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u0145:"N\u0327",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u0156:"R\u0327",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u015E:"S\u0327",\u0164:"T\u030C",\u1E6A:"T\u0307",\u0162:"T\u0327",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"};class wi{constructor(i,l){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 d4(i,l,this.mode),this.settings=l,this.leftrightDepth=0}expect(i,l){if(l===void 0&&(l=!0),this.fetch().text!==i)throw new a("Expected '"+i+"', got '"+this.fetch().text+"'",this.fetch());l&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(i){this.mode=i,this.gullet.switchMode(i)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{const i=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),i}finally{this.gullet.endGroups()}}subparse(i){const l=this.nextToken;this.consume(),this.gullet.pushToken(new on("}")),this.gullet.pushTokens(i);const h=this.parseExpression(!1);return this.expect("}"),this.nextToken=l,h}parseExpression(i,l){const h=[];for(;;){this.mode==="math"&&this.consumeSpaces();const y=this.fetch();if(wi.endOfExpression.indexOf(y.text)!==-1||l&&y.text===l||i&&ao[y.text]&&ao[y.text].infix)break;const E=this.parseAtom(l);if(E){if(E.type==="internal")continue}else break;h.push(E)}return this.mode==="text"&&this.formLigatures(h),this.handleInfixNodes(h)}handleInfixNodes(i){let l=-1,h;for(let y=0;y<i.length;y++)if(i[y].type==="infix"){if(l!==-1)throw new a("only one infix operator per group",i[y].token);l=y,h=i[y].replaceWith}if(l!==-1&&h){let y,E;const N=i.slice(0,l),P=i.slice(l+1);N.length===1&&N[0].type==="ordgroup"?y=N[0]:y={type:"ordgroup",mode:this.mode,body:N},P.length===1&&P[0].type==="ordgroup"?E=P[0]:E={type:"ordgroup",mode:this.mode,body:P};let Y;return h==="\\\\abovefrac"?Y=this.callFunction(h,[y,i[l],E],[]):Y=this.callFunction(h,[y,E],[]),[Y]}else return i}handleSupSubscript(i){const l=this.fetch(),h=l.text;this.consume(),this.consumeSpaces();let y;do{var E;y=this.parseGroup(i)}while(((E=y)==null?void 0:E.type)==="internal");if(!y)throw new a("Expected group after '"+h+"'",l);return y}formatUnsupportedCmd(i){const l=[];for(let y=0;y<i.length;y++)l.push({type:"textord",mode:"text",text:i[y]});const h={type:"text",mode:this.mode,body:l};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[h]}}parseAtom(i){const l=this.parseGroup("atom",i);if((l==null?void 0:l.type)==="internal"||this.mode==="text")return l;let h,y;for(;;){this.consumeSpaces();const E=this.fetch();if(E.text==="\\limits"||E.text==="\\nolimits"){if(l&&l.type==="op"){const N=E.text==="\\limits";l.limits=N,l.alwaysHandleSupSub=!0}else if(l&&l.type==="operatorname")l.alwaysHandleSupSub&&(l.limits=E.text==="\\limits");else throw new a("Limit controls must follow a math operator",E);this.consume()}else if(E.text==="^"){if(h)throw new a("Double superscript",E);h=this.handleSupSubscript("superscript")}else if(E.text==="_"){if(y)throw new a("Double subscript",E);y=this.handleSupSubscript("subscript")}else if(E.text==="'"){if(h)throw new a("Double superscript",E);const N={type:"textord",mode:this.mode,text:"\\prime"},P=[N];for(this.consume();this.fetch().text==="'";)P.push(N),this.consume();this.fetch().text==="^"&&P.push(this.handleSupSubscript("superscript")),h={type:"ordgroup",mode:this.mode,body:P}}else if(Ci[E.text]){const N=bd.test(E.text),P=[];for(P.push(new on(Ci[E.text])),this.consume();;){const ne=this.fetch().text;if(!Ci[ne]||bd.test(ne)!==N)break;P.unshift(new on(Ci[ne])),this.consume()}const Y=this.subparse(P);N?y={type:"ordgroup",mode:"math",body:Y}:h={type:"ordgroup",mode:"math",body:Y}}else break}return h||y?{type:"supsub",mode:this.mode,base:l,sup:h,sub:y}:l}parseFunction(i,l){const h=this.fetch(),y=h.text,E=ao[y];if(!E)return null;if(this.consume(),l&&l!=="atom"&&!E.allowedInArgument)throw new a("Got function '"+y+"' with no arguments"+(l?" as "+l:""),h);if(this.mode==="text"&&!E.allowedInText)throw new a("Can't use function '"+y+"' in text mode",h);if(this.mode==="math"&&E.allowedInMath===!1)throw new a("Can't use function '"+y+"' in math mode",h);const{args:N,optArgs:P}=this.parseArguments(y,E);return this.callFunction(y,N,P,h,i)}callFunction(i,l,h,y,E){const N={funcName:i,parser:this,token:y,breakOnTokenText:E},P=ao[i];if(P&&P.handler)return P.handler(N,l,h);throw new a("No function handler for "+i)}parseArguments(i,l){const h=l.numArgs+l.numOptionalArgs;if(h===0)return{args:[],optArgs:[]};const y=[],E=[];for(let N=0;N<h;N++){let P=l.argTypes&&l.argTypes[N];const Y=N<l.numOptionalArgs;(l.primitive&&P==null||l.type==="sqrt"&&N===1&&E[0]==null)&&(P="primitive");const ne=this.parseGroupOfType("argument to '"+i+"'",P,Y);if(Y)E.push(ne);else if(ne!=null)y.push(ne);else throw new a("Null argument, please report this as a bug")}return{args:y,optArgs:E}}parseGroupOfType(i,l,h){switch(l){case"color":return this.parseColorGroup(h);case"size":return this.parseSizeGroup(h);case"url":return this.parseUrlGroup(h);case"math":case"text":return this.parseArgumentGroup(h,l);case"hbox":{const y=this.parseArgumentGroup(h,"text");return y!=null?{type:"styling",mode:y.mode,body:[y],style:"text"}:null}case"raw":{const y=this.parseStringGroup("raw",h);return y!=null?{type:"raw",mode:"text",string:y.text}:null}case"primitive":{if(h)throw new a("A primitive argument cannot be optional");const y=this.parseGroup(i);if(y==null)throw new a("Expected group as "+i,this.fetch());return y}case"original":case null:case void 0:return this.parseArgumentGroup(h);default:throw new a("Unknown group type as "+i,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(i,l){const h=this.gullet.scanArgument(l);if(h==null)return null;let y="",E;for(;(E=this.fetch()).text!=="EOF";)y+=E.text,this.consume();return this.consume(),h.text=y,h}parseRegexGroup(i,l){const h=this.fetch();let y=h,E="",N;for(;(N=this.fetch()).text!=="EOF"&&i.test(E+N.text);)y=N,E+=y.text,this.consume();if(E==="")throw new a("Invalid "+l+": '"+h.text+"'",h);return h.range(y,E)}parseColorGroup(i){const l=this.parseStringGroup("color",i);if(l==null)return null;const h=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(l.text);if(!h)throw new a("Invalid color: '"+l.text+"'",l);let y=h[0];return/^[0-9a-f]{6}$/i.test(y)&&(y="#"+y),{type:"color-token",mode:this.mode,color:y}}parseSizeGroup(i){let l,h=!1;if(this.gullet.consumeSpaces(),!i&&this.gullet.future().text!=="{"?l=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):l=this.parseStringGroup("size",i),!l)return null;!i&&l.text.length===0&&(l.text="0pt",h=!0);const y=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(l.text);if(!y)throw new a("Invalid size: '"+l.text+"'",l);const E={number:+(y[1]+y[2]),unit:y[3]};if(!rt(E))throw new a("Invalid unit: '"+E.unit+"'",l);return{type:"size",mode:this.mode,value:E,isBlank:h}}parseUrlGroup(i){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);const l=this.parseStringGroup("url",i);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),l==null)return null;const h=l.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:h}}parseArgumentGroup(i,l){const h=this.gullet.scanArgument(i);if(h==null)return null;const y=this.mode;l&&this.switchMode(l),this.gullet.beginGroup();const E=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();const N={type:"ordgroup",mode:this.mode,loc:h.loc,body:E};return l&&this.switchMode(y),N}parseGroup(i,l){const h=this.fetch(),y=h.text;let E;if(y==="{"||y==="\\begingroup"){this.consume();const N=y==="{"?"}":"\\endgroup";this.gullet.beginGroup();const P=this.parseExpression(!1,N),Y=this.fetch();this.expect(N),this.gullet.endGroup(),E={type:"ordgroup",mode:this.mode,loc:Jr.range(h,Y),body:P,semisimple:y==="\\begingroup"||void 0}}else if(E=this.parseFunction(l,i)||this.parseSymbol(),E==null&&y[0]==="\\"&&!vd.hasOwnProperty(y)){if(this.settings.throwOnError)throw new a("Undefined control sequence: "+y,h);E=this.formatUnsupportedCmd(y),this.consume()}return E}formLigatures(i){let l=i.length-1;for(let h=0;h<l;++h){const y=i[h],E=y.text;E==="-"&&i[h+1].text==="-"&&(h+1<l&&i[h+2].text==="-"?(i.splice(h,3,{type:"textord",mode:"text",loc:Jr.range(y,i[h+2]),text:"---"}),l-=2):(i.splice(h,2,{type:"textord",mode:"text",loc:Jr.range(y,i[h+1]),text:"--"}),l-=1)),(E==="'"||E==="`")&&i[h+1].text===E&&(i.splice(h,2,{type:"textord",mode:"text",loc:Jr.range(y,i[h+1]),text:E+E}),l-=1)}}parseSymbol(){const i=this.fetch();let l=i.text;if(/^\\verb[^a-zA-Z]/.test(l)){this.consume();let E=l.slice(5);const N=E.charAt(0)==="*";if(N&&(E=E.slice(1)),E.length<2||E.charAt(0)!==E.slice(-1))throw new a(`\\verb assertion failed --
492
- please report what input caused this bug`);return E=E.slice(1,-1),{type:"verb",mode:"text",body:E,star:N}}yd.hasOwnProperty(l[0])&&!Ot[this.mode][l[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+l[0]+'" used in math mode',i),l=yd[l[0]]+l.slice(1));const h=s4.exec(l);h&&(l=l.substring(0,h.index),l==="i"?l="\u0131":l==="j"&&(l="\u0237"));let y;if(Ot[this.mode][l]){this.settings.strict&&this.mode==="math"&&Sn.indexOf(l)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+l[0]+'" used in math mode',i);const E=Ot[this.mode][l].group,N=Jr.range(i);let P;if(kr.hasOwnProperty(E)){const Y=E;P={type:"atom",mode:this.mode,family:Y,loc:N,text:l}}else P={type:E,mode:this.mode,loc:N,text:l};y=P}else if(l.charCodeAt(0)>=128)this.settings.strict&&(ie(l.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+l[0]+'" used in math mode',i):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+l[0]+'"'+(" ("+l.charCodeAt(0)+")"),i)),y={type:"textord",mode:"text",loc:Jr.range(i),text:l};else return null;if(this.consume(),h)for(let E=0;E<h[0].length;E++){const N=h[0][E];if(!Bl[N])throw new a("Unknown accent ' "+N+"'",i);const P=Bl[N][this.mode]||Bl[N].text;if(!P)throw new a("Accent "+N+" unsupported in "+this.mode+" mode",i);y={type:"accent",mode:this.mode,loc:Jr.range(i),label:P,isStretchy:!1,isShifty:!0,base:y}}return y}}wi.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var Al=function(s,i){if(!(typeof s=="string"||s instanceof String))throw new TypeError("KaTeX can only parse string typed expression");const l=new wi(s,i);delete l.gullet.macros.current["\\df@tag"];let h=l.parse();if(delete l.gullet.macros.current["\\current@color"],delete l.gullet.macros.current["\\color"],l.gullet.macros.get("\\df@tag")){if(!i.displayMode)throw new a("\\tag works only in display equations");h=[{type:"tag",mode:"text",body:h,tag:l.subparse([new on("\\df@tag")])}]}return h};let xd=function(s,i,l){i.textContent="";const h=Fl(s,l).toNode();i.appendChild(h)};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."),xd=function(){throw new a("KaTeX doesn't work in quirks mode.")});const f4=function(s,i){return Fl(s,i).toMarkup()},h4=function(s,i){const l=new F(i);return Al(s,l)},Cd=function(s,i,l){if(l.throwOnError||!(s instanceof a))throw s;const h=ge.makeSpan(["katex-error"],[new ht(i)]);return h.setAttribute("title",s.toString()),h.setAttribute("style","color:"+l.errorColor),h},Fl=function(s,i){const l=new F(i);try{const h=Al(s,l);return Ag(h,s,l)}catch(h){return Cd(h,s,l)}};var p4={version:"0.16.25",render:xd,renderToString:f4,ParseError:a,SETTINGS_SCHEMA:p,__parse:h4,__renderToDomTree:Fl,__renderToHTMLTree:function(s,i){const l=new F(i);try{const h=Al(s,l);return Fg(h,s,l)}catch(h){return Cd(h,s,l)}},__setFontMetrics:dt,__defineSymbol:x,__defineFunction:Qe,__defineMacro:I,__domTree:{Span:gt,Anchor:Zt,SymbolNode:ht,SvgNode:gr,PathNode:or,LineNode:Dr}},m4=p4;return n=n.default,n})()})})(f0)),f0.exports}var gC=es.exports,Ep;function vC(){return Ep||(Ep=1,(function(e,t){(function(r,n){n(t,je,hC(),mC())})(gC,function(r,n,o,a){Object.defineProperty(r,"__esModule",{value:!0});function u(p,B){for(var F in B)Object.defineProperty(p,F,{enumerable:!0,get:B[F]})}u(r,{BlockMath:()=>C,InlineMath:()=>D}),n=d(n),o=c(o),a=c(a);function c(p){return p&&p.__esModule?p:{default:p}}function f(p){if(typeof WeakMap!="function")return null;var B=new WeakMap,F=new WeakMap;return(f=function(S){return S?F:B})(p)}function d(p,B){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var F=f(B);if(F&&F.has(p))return F.get(p);var S={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in p)if(M!=="default"&&Object.prototype.hasOwnProperty.call(p,M)){var _=O?Object.getOwnPropertyDescriptor(p,M):null;_&&(_.get||_.set)?Object.defineProperty(S,M,_):S[M]=p[M]}return S.default=p,F&&F.set(p,S),S}const m=(p,{displayMode:B})=>{const F=({children:S,errorColor:O,math:M,renderError:_})=>{const z=M??S,{html:K,error:$}=(0,n.useMemo)(()=>{try{return{html:a.default.renderToString(z,{displayMode:B,errorColor:O,throwOnError:!!_}),error:void 0}}catch(Q){if(Q instanceof a.default.ParseError||Q instanceof TypeError)return{error:Q};throw Q}},[z,O,_]);return $?_?_($):n.default.createElement(p,{html:`${$.message}`}):n.default.createElement(p,{html:K})};return F.propTypes={children:o.default.string,errorColor:o.default.string,math:o.default.string,renderError:o.default.func},F},b={html:o.default.string.isRequired},g=({html:p})=>n.default.createElement("div",{"data-testid":"react-katex",dangerouslySetInnerHTML:{__html:p}});g.propTypes=b;const w=({html:p})=>n.default.createElement("span",{"data-testid":"react-katex",dangerouslySetInnerHTML:{__html:p}});w.propTypes=b;const C=m(g,{displayMode:!0}),D=m(w,{displayMode:!1})})})(es,es.exports)),es.exports}var yg=vC();const bC=tr.span.attrs({className:"latex-inline-wrapper"})`
493
- display: inline-flex;
494
- align-items: baseline;
495
- column-gap: 4px;
496
- line-height: 1.2;
497
- color: ${({$color:e})=>e||"inherit"};
498
- `,yC=tr.span.attrs({className:"latex-inline-error"})`
499
- display: inline-flex;
500
- align-items: center;
501
- column-gap: 6px;
502
- padding: 2px 4px;
503
- border-radius: 4px;
504
- background: rgba(215, 58, 73, 0.08);
505
- color: #d73a49;
506
- font-size: 0.85em;
507
- `,xC=tr.span.attrs({className:"latex-inline-error-message"})`
508
- font-size: 0.75em;
509
- color: #d73a49;
510
- `,CC=({attributes:e,formula:t,styles:r})=>{var a;const n=xt(()=>(t||"").trim(),[t]),o=(a=r==null?void 0:r.text)==null?void 0:a.color;return n?Z.jsx(bC,{...e,$color:o,children:Z.jsx(yg.InlineMath,{math:n,errorColor:"#d73a49",renderError:u=>Z.jsxs(yC,{children:[Z.jsx("span",{children:n}),Z.jsx(xC,{children:u==null?void 0:u.message})]})})}):null},wC=tr.div.attrs({className:"latex-block-wrapper"})`
511
- width: 100%;
512
- display: flex;
513
- justify-content: center;
514
- align-items: center;
515
- margin: 1.25rem 0;
516
- padding: 0.75rem;
517
- border-radius: 8px;
518
- background: rgba(2, 132, 199, 0.05);
519
- color: ${({$textColor:e})=>e||"inherit"};
520
- `,DC=tr.div.attrs({className:"latex-block-error"})`
521
- display: flex;
522
- flex-direction: column;
523
- width: 100%;
524
- gap: 6px;
525
- padding: 0.75rem;
526
- background: rgba(215, 58, 73, 0.08);
527
- border: 1px dashed #d73a49;
528
- border-radius: 8px;
529
- font-size: 0.9rem;
530
- color: #d73a49;
531
- `,EC=tr.span.attrs({className:"latex-block-error-title"})`
532
- font-weight: 600;
533
- `,kC=tr.code.attrs({className:"latex-block-error-formula"})`
534
- font-size: 0.85rem;
535
- color: #d73a49;
536
- overflow-x: auto;
537
- `,SC=({attributes:e,formula:t,styles:r})=>{var a;const n=xt(()=>(t||"").trim(),[t]),o=(a=r==null?void 0:r.text)==null?void 0:a.color;return n?Z.jsx(wC,{...e,$textColor:o,children:Z.jsx(yg.BlockMath,{math:n,errorColor:"#d73a49",renderError:u=>Z.jsxs(DC,{children:[Z.jsx(EC,{children:"\u516C\u5F0F\u6E32\u67D3\u5931\u8D25"}),Z.jsx(kC,{children:n}),Z.jsx("span",{children:u==null?void 0:u.message})]})})}):null},BC=e=>{var a,u,c,f,d,m,b,g;const{styles:t}=e,{element:r,children:n,attributes:o}=e;switch(r.type){case"paragraph":return Z.jsx("div",{...o,style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(a=t==null?void 0:t.text)==null?void 0:a.color} !important`,margin:"0 0 0.75rem 0"},children:n});case"heading-one":return Z.jsx("h1",{...o,style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(u=t==null?void 0:t.text)==null?void 0:u.color} !important`},children:n});case"heading-two":return Z.jsx("h2",{...o,style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(c=t==null?void 0:t.text)==null?void 0:c.color} !important`},children:n});case"heading-three":return Z.jsx("h3",{...o,style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(f=t==null?void 0:t.text)==null?void 0:f.color} !important`},children:n});case"bulleted-list":return Z.jsx("ul",{...o,children:n});case"numbered-list":return Z.jsx("ol",{...o,children:n});case"list-item":return Z.jsx("li",{...o,children:n});case"table":return Z.jsx("div",{className:"table-container",children:Z.jsx("table",{...o,children:Z.jsx("tbody",{children:n})})});case"table-row":return Z.jsx("tr",{...o,children:n});case"table-cell":return r.header?Z.jsx("th",{...o,children:n}):Z.jsx("td",{...o,children:n});case"block-quote":return Z.jsx("blockquote",{...o,style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(d=t==null?void 0:t.text)==null?void 0:d.color} !important`},children:n});case"code-block":return Z.jsx("pre",{...o,children:Z.jsx("code",{style:{color:`${(m=t==null?void 0:t.text)==null?void 0:m.color} !important`},children:n})});case"think":const w=e.extraProps||{},C=w.isCollapsed!==void 0?w.isCollapsed:Object.values(w)[1]===!0,D={...w,isCollapsed:C};return Z.jsx(cC,{attributes:o,styles:t,extraProps:D,children:n});case"template":return Z.jsx(vg,{...o,element:r,children:n,styles:t});case"latex-inline":return Z.jsx(CC,{attributes:o,formula:r.formula,styles:t});case"latex-block":return Z.jsx(SC,{attributes:o,formula:r.formula,styles:t});case"retrieve-sql-data":const p=(B=>{if(!B)return null;try{const F=typeof B=="string"?JSON.parse(B):B;return{queryReplyPairList:[{reply:{databaseReference:Array.isArray(F)?F[0]:F}}]}}catch(F){return console.error("Failed to parse databaseReference:",F),null}})(((b=e.extraProps)==null?void 0:b.databaseReference)||e.databaseReference);return Z.jsx(bg,{...o,element:r,children:n,styles:t,eventsEmit:e.eventsEmit,dataSource:p||void 0,tagIndex:1});case"image":return console.log("\u6E32\u67D3\u56FE\u7247\u5143\u7D20:",{url:r.url,alt:r.alt}),Z.jsx("img",{...o,src:r.url,alt:r.alt||"",style:{maxWidth:"100%",height:"auto",borderRadius:"0.5rem",margin:"1rem 0",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",transition:"transform 0.2s ease-in-out",display:"block"},onError:B=>{const F=B.target;F.style.display="none",console.warn("\u56FE\u7247\u52A0\u8F7D\u5931\u8D25:",r.url)}});case"iframe":return console.log("\u6E32\u67D3iframe\u5143\u7D20:",{src:r.src,width:r.width,height:r.height}),Z.jsx("iframe",{...o,src:r.src,width:r.width||"100%",height:r.height||"400",frameBorder:r.frameborder||"0",title:r.title||"",style:{width:r.width||"100%",height:r.height||"400px",border:"none",borderRadius:"0.5rem",margin:"1rem 0",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",display:"block"},onError:B=>{const F=B.target;F.style.display="none",console.warn("iframe\u52A0\u8F7D\u5931\u8D25:",r.src)}});default:return Z.jsx("div",{...o,className:"mb-4",style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(g=t==null?void 0:t.text)==null?void 0:g.color} !important`},children:n})}},AC=e=>{var u,c,f,d,m,b;const{attributes:t,children:r,leaf:n,styles:o}=e;(u=o==null?void 0:o.text)!=null&&u.color&&console.log("renderLeaf - \u63A5\u6536\u5230\u7684\u6587\u672C\u989C\u8272:",o.text.color);let a=r;if(n.retrive){const g=n.fromtype==="0",w=n.fromtype==="1",C=n.fromtype==="2",D=n.text||"";let p=D,B="#e6f7ff",F="#1890ff",S="#bae7ff";return g?(p=`${D}`,B="#e6f7ff",F="#1890ff",S="#bae7ff"):w?(p=`${D}`,B="#f6ffed",F="#52c41a",S="#d9f7be"):C&&(p=`${D}`,B="#E7F8FB",F="#10BBD9",S="#E7F8FB"),a=Z.jsx("span",{...t,style:{display:"inline-block",background:B,color:F,height:24,width:24,borderRadius:3,padding:"1px 9px",margin:"0 2px",fontWeight:600,fontSize:10,lineHeight:"22px",cursor:"pointer",verticalAlign:"middle"},onClick:()=>{e.onRetriveTagClick&&e.onRetriveTagClick(n,t)},onMouseEnter:O=>O.currentTarget.style.background=S,onMouseLeave:O=>O.currentTarget.style.background=B,children:p}),a}if(n.code)a=Z.jsx("code",{...t,style:{color:`${(c=o==null?void 0:o.text)==null?void 0:c.color} !important`},children:a});else{const g=[n.bold&&"bold",n.italic&&"italic",n.underline&&"underline",n.strikethrough&&"strikethrough"].filter(Boolean).join(" "),w={color:`${(f=o==null?void 0:o.text)==null?void 0:f.color} !important`,fontSize:(d=o==null?void 0:o.text)==null?void 0:d.fontSize,lineHeight:(m=o==null?void 0:o.text)==null?void 0:m.lineHeight,letterSpacing:o==null?void 0:o.letterSpacing};a=Z.jsx("span",{...t,className:g,style:w,children:a})}return n.link&&(a=Z.jsx("a",{href:n.link,target:"_blank",rel:"noopener noreferrer",className:"link",style:{color:`${(b=o==null?void 0:o.text)==null?void 0:b.color} !important`},children:a})),a},vu=tr.div.attrs({className:"unified-rich-text-container"})`
538
-
539
-
540
- & > * + * {
541
- margin-top: ${e=>{var t;return((t=e.theme)==null?void 0:t.margin)||"0.5rem"}};
542
- }
543
-
544
- /* 标题样式 */
545
- & h1 {
546
- font-size: ${e=>e.$size==="sm"?"20px":"32px"};
547
- font-weight: 600;
548
- margin: 24px 0 16px 0;
549
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
550
- border-bottom: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
551
- padding-bottom: 8px;
552
- }
553
-
554
- & h2 {
555
- font-size: ${e=>e.$size==="sm"?"18px":"24px"};
556
- font-weight: 600;
557
- margin: 24px 0 16px 0;
558
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
559
- border-bottom: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
560
- padding-bottom: 6px;
561
- }
562
-
563
- & h3 {
564
- font-size: ${e=>e.$size==="sm"?"16px":"20px"};
565
- font-weight: 600;
566
- margin: 24px 0 16px 0;
567
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
568
- }
569
-
570
- /* 段落样式 */
571
- & p {
572
- font-size: ${e=>e.$size==="sm"?"14px":"16px"};
573
- margin: 16px 0;
574
- line-height: 1.6;
575
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
576
- }
577
-
578
- /* 列表样式 - GitHub 风格简约设计 */
579
- & ul, & ol {
580
- margin: 16px 0;
581
- padding-left: 24px;
582
- line-height: 1.6;
583
- }
584
-
585
- & ul {
586
- list-style-type: disc;
587
- }
588
-
589
- & ol {
590
- list-style-type: decimal;
591
- }
592
-
593
- & li {
594
- margin: 4px 0;
595
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
596
- }
597
-
598
- /* 嵌套列表 */
599
- & ul ul, & ol ol, & ul ol, & ol ul {
600
- margin: 8px 0;
601
- }
602
-
603
- /* 引用块样式 */
604
- & blockquote {
605
- font-size: ${e=>e.$size==="sm"?"14px":"16px"};
606
- border-left: 4px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
607
- padding: 0 16px;
608
- margin: 16px 0;
609
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textSecondary)||"#656d76"}};
610
- background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
611
- }
612
-
613
- /* 行内代码样式 */
614
- & code {
615
- font-size: 0.875em;
616
- background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
617
- padding: 0.125em 0.25em;
618
- border-radius: 6px;
619
- font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
620
- color: #d73a49;
621
- }
622
-
623
- /* 代码块样式 */
624
- & pre {
625
- background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
626
- padding: 16px;
627
- border-radius: 6px;
628
- overflow-x: auto;
629
- margin: 16px 0;
630
- border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
631
- }
632
-
633
- & pre code {
634
- background-color: transparent;
635
- padding: 0;
636
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
637
- }
638
-
639
- /* 表格样式 */
640
- & table {
641
- width: 100%;
642
- border-collapse: collapse;
643
- border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
644
- margin: 16px 0;
645
- }
646
-
647
- & th, & td {
648
- border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
649
- padding: 8px 12px;
650
- text-align: left;
651
- }
652
-
653
- & th {
654
- background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
655
- font-weight: 600;
656
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
657
- }
658
-
659
- & tr:nth-child(even) {
660
- background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
661
- }
662
-
663
- & td {
664
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
665
- }
666
-
667
- /* 图片样式 */
668
- & img {
669
- max-width: 100%;
670
- height: auto;
671
- border-radius: 6px;
672
- margin: 16px 0;
673
- }
674
-
675
- /* 链接样式 */
676
- & a {
677
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.primaryColor)||"#0969da"}};
678
- text-decoration: none;
679
-
680
- &:hover {
681
- text-decoration: underline;
682
- }
683
- }
684
-
685
- /* 文本样式 */
686
- & strong {
687
- font-weight: 600;
688
- }
689
-
690
- & em {
691
- font-style: italic;
692
- }
693
-
694
- & u {
695
- text-decoration: underline;
696
- }
697
-
698
- & s {
699
- text-decoration: line-through;
700
- }
701
-
702
- /* 分割线样式 */
703
- & hr {
704
- border: none;
705
- border-top: 1px solid #d0d7de;
706
- margin: 24px 0;
707
- }
708
-
709
- /* 思考容器样式 */
710
- & .think-container {
711
-
712
-
713
- }
714
-
715
- & .think-header {
716
-
717
- }
718
-
719
- & .think-icon {
720
-
721
- }
722
-
723
- & .think-title {
724
- font-weight: 600;
725
- color: #24292f;
726
- font-size: 14px;
727
- }
728
-
729
- & .think-text {
730
- color: #86909C;
731
- font-size: 14px;
732
- line-height: 1.6;
733
- }
734
-
735
- /* 召回标签样式 */
736
- & .retrive-tag {
737
- display: inline-block;
738
- background: #e6f7ff;
739
- color: #1890ff;
740
- border: 1px solid rgba(114, 187, 255, 0.3);
741
- border-radius: 6px;
742
- padding: 2px 6px;
743
- margin: 0 2px;
744
- font-weight: 500;
745
- font-size: 12px;
746
- line-height: 1.4;
747
- cursor: pointer;
748
- vertical-align: middle;
749
- transition: background-color 0.2s ease;
750
- }
751
-
752
- & .retrive-tag:hover {
753
- background: #bae7ff;
754
- }
755
- `;function xg(e){return e.map(t=>!t.children||t.children.length===0?{...t,children:[{text:""}]}:{...t,children:t.children.map(r=>typeof r=="object"&&"type"in r?xg([r])[0]:r)})}const kp="__rtext_escaped_dollar__";function Ss(e){if(!e)return"";try{return decodeURIComponent(e)}catch(t){return console.warn("Failed to decode LaTeX formula:",e,t),e}}function FC(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function NC(e){const t=new Map;let r=e||"";if(!r)return{content:r,placeholders:t};let n=0;r=r.replace(/\\\$/g,kp);const o=(c,f)=>{const d=`RTEXT_LATEX_PLACEHOLDER_${n++}_${c.toUpperCase()}`;return t.set(d,{type:c,formula:(f||"").trim()}),d},a=/\$\$([\s\S]+?)\$\$/g;r=r.replace(a,(c,f)=>o("block",f));const u=new RegExp("(?<!\\\\)\\$(?!\\$)([\\s\\S]+?)(?<!\\\\)\\$(?!\\$)","g");return r=r.replace(u,(c,f)=>o("inline",f)),r=r.replace(new RegExp(kp,"g"),"\\$"),{content:r,placeholders:t}}function OC(e,t){if(!e||t.size===0)return e;let r=e;return t.forEach((n,o)=>{const a=n.type==="block"?"latex-block":"latex-inline",u=encodeURIComponent(n.formula),c=`<${a} data-formula="${u}"></${a}>`;r=r.replace(new RegExp(FC(o),"g"),c)}),r}function Cg(e,t){const r=(t==null?void 0:t.disabledTags)||[];console.log("\u{1F50D} deserializeMarkdown \u5F00\u59CB\u5904\u7406:",{markdownLength:e.length,basePath:t==null?void 0:t.basePath,hasImgTags:e.includes("<img"),hasMarkdownImages:e.includes("![")});function n(d){var m;if(d.indexOf("<think>")>-1)if(d.indexOf("</think>")>-1){const b=/<think>([\s\S]*?)<\/think>([\s\S]*)/s,g=d.match(b);return g?{thinkContent:g[1],content:g[2],finish:!0}:{thinkContent:"",content:d,finish:!0}}else{const b=/<think>(.*?)(?=<|\s*$)/s;return{thinkContent:((m=d.match(b))==null?void 0:m[1])||"",content:""}}else return{thinkContent:"",content:d}}const{thinkContent:o,content:a,finish:u}=n(e||"");let c=[],f=0;if(!r.includes("think")&&o){const d=o.split(/\n+/).map(m=>m.trim()).filter(Boolean).flatMap(m=>{if(/<retrive-tag/i.test(m)){const b=document.createElement("div");return b.innerHTML=m,Sp(b,t==null?void 0:t.basePath)}else return[{type:"paragraph",children:[{text:m}]}]});c.push({type:"think",id:`think-${f++}`,thinkContent:o,finish:u,children:d})}if(a){const{content:d,placeholders:m}=NC(a);let b=d;r.includes("retrive")||(b=b.replace(/\[retrive-tag([^\]]*)\]\[([^\]]+)\]\[\/retrive-tag\]/g,(C,D,p)=>`<retrive-tag${D?" "+D.trim():""}>${p}</retrive-tag>`)),r.includes("retrieve-sql-data")||(b=b.replace(/<retrieve-sql-data\s+id="([^"]+)"\s*\/?>/g,(C,D)=>`<retrieve-sql-data id="${D}"></retrieve-sql-data>`)),Wt.setOptions({gfm:!0,breaks:!0,pedantic:!1});const g=Wt(b);let w=typeof g=="string"?g:"";if(w=OC(w,m),console.log("\u{1F4DD} marked \u89E3\u6790\u540E\u7684 HTML:",{htmlLength:w.length,hasImgTags:w.includes("<img"),basePath:t==null?void 0:t.basePath,htmlContent:w}),typeof g=="string"){const C=document.createElement("div");C.innerHTML=w,console.log("\u{1F527} \u521B\u5EFA DOM \u5143\u7D20\uFF0C\u51C6\u5907\u89E3\u6790:",{childNodesCount:C.childNodes.length,basePath:t==null?void 0:t.basePath,allElements:Array.from(C.querySelectorAll("*")).map(p=>p.tagName),imgElements:Array.from(C.querySelectorAll("img")).map(p=>({src:p.src,alt:p.alt}))});const D=Sp(C,t==null?void 0:t.basePath);console.log("\u2705 deserializeHtmlNode \u89E3\u6790\u7ED3\u679C:",{partLength:D.length,hasImageElements:D.some(p=>p.type==="image")}),D&&D.length>0&&(c=c.concat(D))}}return!c||c.length===0?[{type:"paragraph",children:[{text:""}]}]:xg(c)}function Sp(e,t){const r=[];return console.log("\u{1F3AF} deserializeHtmlNode \u5F00\u59CB\u89E3\u6790:",{nodeType:e.nodeType,nodeName:e.nodeName,basePath:t,childNodesCount:e.childNodes.length}),((n,o)=>(o.forEach(a=>{var u;if(a.nodeType===Node.ELEMENT_NODE){const c=a;switch(console.log("\u{1F50D} \u5904\u7406\u5143\u7D20\u8282\u70B9:",{tagName:c.tagName,isImg:c.tagName==="IMG",src:c.getAttribute("src"),basePath:t}),c.tagName.toLowerCase()){case"p":n.push({type:"paragraph",children:Mr(c,t)});break;case"h1":n.push({type:"heading-one",children:Mr(c,t)});break;case"h2":n.push({type:"heading-two",children:Mr(c,t)});break;case"h3":n.push({type:"heading-three",children:Mr(c,t)});break;case"ul":n.push({type:"bulleted-list",children:Array.from(c.children).map(d=>({type:"list-item",children:Mr(d)}))});break;case"ol":const f={type:"numbered-list",children:Array.from(c.children).map(d=>({type:"list-item",children:Mr(d)}))};n.push(f);break;case"li":n.push({type:"list-item",children:Mr(c,t)});break;case"pre":{const d=c.querySelector("code");d?n.push({type:"code-block",children:Mr(d)}):n.push({type:"code-block",children:Mr(c,t)});break}case"code":{c.closest("pre")||n.push({type:"paragraph",children:Mr(c,t)});break}case"retrive-tag":{const d=Mr(c,t);d.length>0&&n.push({type:"paragraph",children:d});break}case"retrieve-sql-data":{const d=c.getAttribute("id")||"";n.push({type:"retrieve-sql-data",id:d,children:[{text:""}]});break}case"blockquote":n.push({type:"block-quote",children:Mr(c,t)});break;case"table":n.push($C(c));break;case"img":{const d=c.getAttribute("src")||"",m=c.getAttribute("alt")||"";let b=d;if(t)if(d.startsWith("./"))b=d.replace(/^\.\//,t+"/");else if(d.startsWith("../")){const g=t.substring(0,t.lastIndexOf("/"));b=d.replace(/^\.\.\//,g+"/")}else!d.startsWith("/")&&!d.startsWith("http")&&(b=`${t}/${d}`);console.log("\u56FE\u7247\u8DEF\u5F84\u5904\u7406:",{src:d,basePath:t,processedSrc:b}),n.push({type:"image",url:b,alt:m,children:[{text:""}]});break}case"iframe":{const d=c.getAttribute("src")||"",m=c.getAttribute("width")||"100%",b=c.getAttribute("height")||"400",g=c.getAttribute("frameborder")||"0",w=c.getAttribute("title")||"";let C=d;if(t)if(d.startsWith("./"))C=d.replace(/^\.\//,t+"/");else if(d.startsWith("../")){const D=t.substring(0,t.lastIndexOf("/"));C=d.replace(/^\.\.\//,D+"/")}else!d.startsWith("/")&&!d.startsWith("http")&&(C=`${t}/${d}`);console.log("iframe\u8DEF\u5F84\u5904\u7406:",{src:d,basePath:t,processedSrc:C}),n.push({type:"iframe",src:C,width:m,height:b,frameborder:g,title:w,children:[{text:""}]});break}case"latex-inline":{const d=Ss(c.getAttribute("data-formula"));n.push({type:"latex-inline",formula:d,children:[{text:""}]});break}case"latex-block":{const d=Ss(c.getAttribute("data-formula"));n.push({type:"latex-block",formula:d,children:[{text:""}]});break}case"think-block":n.push({type:"think",children:Mr(c)});break;default:n.push({type:"paragraph",children:Mr(c,t)});break}}else a.nodeType===Node.TEXT_NODE&&((u=a.textContent)!=null&&u.trim())&&n.push({type:"paragraph",children:[{text:a.textContent}]})}),n))(r,e.childNodes),r}function Mr(e,t){const r=[];function n(a){const u=[];let c="",f=!1,d=!1,m=0;for(;m<a.length;)a.startsWith("**",m)?(c&&(u.push({text:c,code:!0,bold:f,italic:d}),c=""),f=!f,m+=2):a.startsWith("*",m)?(c&&(u.push({text:c,code:!0,bold:f,italic:d}),c=""),d=!d,m+=1):(c+=a[m],m+=1);return c&&u.push({text:c,code:!0,bold:f,italic:d}),u}function o(a,u={}){var c,f;if(a.nodeType===Node.TEXT_NODE){const d=(c=a.textContent)==null?void 0:c.trim();return d?u.code?n(d):[{text:d,...u}]:[]}if(a.nodeType===Node.ELEMENT_NODE){const d=a,m={...u};switch(d.tagName.toLowerCase()){case"em":case"i":m.italic=!0;break;case"strong":case"b":m.bold=!0;break;case"code":d.closest("pre")||(m.code=!0);break;case"del":case"s":m.strikethrough=!0;break;case"u":m.underline=!0;break;case"a":m.link=d.getAttribute("href")||void 0;break;case"retrive-tag":{const g={};for(const{name:w,value:C}of Array.from(d.attributes))g[w]=C;return[{text:d.textContent||""||"[0]",retrive:!0,...g}]}case"retrieve-sql-data":return[{type:"retrieve-sql-data",id:d.getAttribute("id")||"",children:[{text:""}]}];case"img":{const g=d.getAttribute("src")||"",w=d.getAttribute("alt")||"";console.log("\u{1F50D} deserializeChildren \u5904\u7406\u5D4C\u5957\u56FE\u7247:",{src:g,alt:w,basePath:t});let C=g;if(t)if(g.startsWith("./"))C=g.replace(/^\.\//,t+"/");else if(g.startsWith("../")){const D=t.substring(0,t.lastIndexOf("/"));C=g.replace(/^\.\.\//,D+"/")}else!g.startsWith("/")&&!g.startsWith("http")&&(C=`${t}/${g}`);return console.log("\u{1F50D} deserializeChildren \u56FE\u7247\u8DEF\u5F84\u8F6C\u6362:",{src:g,processedSrc:C}),[{type:"image",url:C,alt:w,children:[{text:""}]}]}case"iframe":{const g=d.getAttribute("src")||"",w=d.getAttribute("width")||"100%",C=d.getAttribute("height")||"400",D=d.getAttribute("frameborder")||"0",p=d.getAttribute("title")||"";console.log("\u{1F50D} deserializeChildren \u5904\u7406\u5D4C\u5957iframe:",{src:g,width:w,height:C,basePath:t});let B=g;if(t)if(g.startsWith("./"))B=g.replace(/^\.\//,t+"/");else if(g.startsWith("../")){const F=t.substring(0,t.lastIndexOf("/"));B=g.replace(/^\.\.\//,F+"/")}else!g.startsWith("/")&&!g.startsWith("http")&&(B=`${t}/${g}`);return console.log("\u{1F50D} deserializeChildren iframe\u8DEF\u5F84\u8F6C\u6362:",{src:g,processedSrc:B}),[{type:"iframe",src:B,width:w,height:C,frameborder:D,title:p,children:[{text:""}]}]}case"latex-inline":return[{type:"latex-inline",formula:Ss(d.getAttribute("data-formula")),children:[{text:""}]}];case"latex-block":return[{type:"latex-block",formula:Ss(d.getAttribute("data-formula")),children:[{text:""}]}]}if(d.childNodes.length===0&&((f=d.textContent)!=null&&f.trim()))return m.code?n(d.textContent):[{text:d.textContent,...m}];let b=[];for(const g of Array.from(d.childNodes))b=b.concat(o(g,m));return b}return[]}for(const a of Array.from(e.childNodes))r.push(...o(a));return r}function $C(e){const t=[],r=e.querySelector("thead"),n=e.querySelector("tbody");if(!r&&!n){const o=Array.from(e.querySelectorAll("tr"));o.length>0&&(t.push({type:"table-row",children:Array.from(o[0].children).map(a=>({type:"table-cell",header:!0,children:Mr(a)}))}),o.slice(1).forEach(a=>{t.push({type:"table-row",children:Array.from(a.children).map(u=>({type:"table-cell",header:!1,children:Mr(u)}))})}))}else{if(r){const o=r.querySelector("tr");o&&t.push({type:"table-row",children:Array.from(o.querySelectorAll("th")).map(a=>({type:"table-cell",header:!0,children:Mr(a)}))})}n&&Array.from(n.querySelectorAll("tr")).forEach(o=>{t.push({type:"table-row",children:Array.from(o.querySelectorAll("td")).map(a=>({type:"table-cell",header:!1,children:Mr(a)}))})})}return{type:"table",children:t}}const TC=tr.div.attrs({className:"unified-rich-text-container"})`
756
- border: ${e=>e.$isEditing?"1px solid #dee2e6":"none"};
757
- border-radius: ${e=>{var t;return((t=e.theme)==null?void 0:t.borderRadius)||"4px"}};
758
- background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"transparent"}};
759
- min-height: ${e=>{var t;return((t=e.theme)==null?void 0:t.minHeight)||"200px"}};
760
- overflow: hidden;
761
- transition: all 0.2s ease-in-out;
762
- padding-top: 14px;
763
- ${e=>{var t,r;return e.$isEditing&&`
764
- &:focus-within {
765
- border-color: ${((t=e.theme)==null?void 0:t.primaryColor)||"#007bff"};
766
- box-shadow: 0 0 0 2px ${((r=e.theme)==null?void 0:r.primaryColor)||"#007bff"}20;
767
- }
768
- `}}
769
- `,bu=tr.div.attrs({className:"unified-rich-text-editable-container"})`
770
- padding: ${e=>{var t;return((t=e.theme)==null?void 0:t.padding)||"0rem 1rem"}};
771
- min-height: inherit;
772
- outline: none;
773
-
774
- & > * + * {
775
- margin-top: ${e=>{var t;return((t=e.theme)==null?void 0:t.margin)||"0.5rem"}};
776
- }
777
- `,Bp=(e,t)=>t<0?e:`${e.slice(0,t)}\\${e.slice(t)}`,Ap=(e,t)=>{if(!e)return-1;const r=t.length;let n=-1;for(let o=0;o<e.length;o++){if(e[o]==="\\"){o+=1;continue}if(r===2){if(e.startsWith("$$",o)){n===-1?n=o:n=-1,o+=1;continue}}else if(r===1&&e[o]==="$"){if(e[o+1]==="$"){o+=1;continue}n===-1?n=o:n=-1}}return n},MC=e=>{const t=e||"";if(!t)return{content:"",hasPendingLatex:!1};let r=t,n=!1;const o=[],a=Ap(t,"$$");a!==-1&&(r=Bp(r,a),o.push(a),n=!0);const u=Ap(t,"$");if(u!==-1){const c=o.filter(f=>f<=u).length;r=Bp(r,u+c),n=!0}return{content:r,hasPendingLatex:n}};var Bs=(e=>(e.SLATE="slate",e.MARKDOWN="markdown",e.HTML="html",e.TEXT="text",e))(Bs||{});const mc=({dataSource:e,isEditing:t=!1,placeholder:r="\u5F00\u59CB\u8F93\u5165...",basePath:n,size:o="sm",theme:a={},onChange:u,onFocus:c,onBlur:f,renderElement:d,renderLeaf:m,onRetriveTagClick:b,eventsEmit:g,extraProps:w={},className:C,style:D,styles:p,enableTemplateInput:B=!1,disabledTags:F=[]})=>{const S=Os(),O=xt(()=>{var ie,me,Oe,ee,pe,le,ue,De,Ce;return{primaryColor:((ie=S==null?void 0:S.colors)==null?void 0:ie.primary)||(a==null?void 0:a.primaryColor)||"#007bff",secondaryColor:((me=S==null?void 0:S.colors)==null?void 0:me.secondary)||(a==null?void 0:a.secondaryColor)||"#6c757d",backgroundColor:((Oe=S==null?void 0:S.colors)==null?void 0:Oe.background)||(a==null?void 0:a.backgroundColor)||"transparent",textColor:((ee=S==null?void 0:S.colors)==null?void 0:ee.text)||(a==null?void 0:a.textColor)||"#24292f",borderColor:((pe=S==null?void 0:S.colors)==null?void 0:pe.border)||(a==null?void 0:a.borderColor)||"#dee2e6",disabledBackground:((le=S==null?void 0:S.colors)==null?void 0:le.disabledBackground)||(a==null?void 0:a.disabledBackground)||"#f8f9fa",hoverBackground:(a==null?void 0:a.hoverBackground)||"rgba(0,0,0,0.06)",borderRadius:((ue=S==null?void 0:S.space)==null?void 0:ue.radius)||(a==null?void 0:a.borderRadius)||"4px",padding:((De=S==null?void 0:S.space)==null?void 0:De.padding)||(a==null?void 0:a.padding)||"0rem 1rem",margin:((Ce=S==null?void 0:S.space)==null?void 0:Ce.margin)||(a==null?void 0:a.margin)||"0.5rem",minHeight:(a==null?void 0:a.minHeight)||"200px",baseFontSize:(a==null?void 0:a.baseFontSize)||(o==="md"?14:12),...a}},[S,a,o]),M=It();if(!M.current){const ie=uy(),me=Dx(ie),{isInline:Oe}=me;me.isInline=le=>!F.includes("template")&&le.type==="template"?!0:Oe(le);const{isVoid:ee}=me;me.isVoid=le=>!F.includes("template")&&le.type==="template"?!0:ee(le);const pe=le=>{if(!(B&&!F.includes("template")))return le;const{insertText:ue,insertData:De}=le,Ce=()=>{const Ee=/<template>([^<]*)<\/template>/g,Fe=Array.from(T.nodes(le,{match:Be=>nt.isText(Be)&&Ee.test(Be.text)}));if(Fe.length!==0)for(const Be of Fe){const[Ne,ze]=Be,Me=Ne.text||"",Ge=[];let dt=0,ut;for(Ee.lastIndex=0;(ut=Ee.exec(Me))!==null;){if(ut.index>dt){const Pe=Me.slice(dt,ut.index);Pe&&Ge.push({text:Pe})}Ge.push({type:"template",placeholder:(ut[1]||"").trim(),value:"",style:"blue",fieldId:`template-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,children:[{text:""}],inline:!0}),dt=ut.index+ut[0].length}if(dt<Me.length){const Pe=Me.slice(dt);Pe&&Ge.push({text:Pe})}_e.removeNodes(le,{at:ze}),_e.insertNodes(le,Ge,{at:ze})}};return le.insertText=Ee=>{ue(Ee),Ce()},le.insertData=Ee=>{const Fe=Ee.getData("text/plain");if(Fe&&/<template>[\s\S]*?<\/template>/.test(Fe)){ue(Fe),Ce();return}return De(Ee)},le};M.current=pe(me)}const _=M.current,[z,K]=Pt(()=>e.type==="slate"?e.content||[{type:"paragraph",children:[{text:""}]}]:[{type:"paragraph",children:[{text:""}]}]),[$,Q]=Pt(0);lr(()=>{if(e.type==="slate"){console.log("UnifiedRichText: dataSource.content \u53D8\u5316:",e.content);const ie=e.content||[{type:"paragraph",children:[{text:""}]}];console.log("UnifiedRichText: \u8BBE\u7F6E\u65B0\u7684 value:",ie),K(ie),Q(me=>me+1)}},[e.type,e.content]);const V=It(void 0),X=xt(()=>{if(e.type!=="markdown")return{content:"",hasPendingLatex:!1};const ie=typeof e.content=="string"?e.content:JSON.stringify(e.content||"");return MC(ie)},[e.type,e.content]);lr(()=>{if(e.type!=="markdown")return;const ie=X.content;V.current!==ie&&(V.current=ie,Q(me=>me+1))},[e.type,X.content]);const G=xt(()=>e.type!=="markdown"?w:{...w||{},hasPendingLatex:X.hasPendingLatex},[w,e.type,X.hasPendingLatex]),j=It("");lr(()=>{if(e.type!=="markdown")return;const ie=JSON.stringify(G||{});ie!==j.current&&(j.current=ie,Q(me=>me+1))},[G,e.type]);const H=mt(ie=>{console.log("UnifiedRichText: \u5185\u5BB9\u53D8\u5316:",ie),ie&&Array.isArray(ie)?(K(ie),u==null||u(ie,"slate")):console.log("UnifiedRichText: \u5FFD\u7565\u65E0\u6548\u7684\u5185\u5BB9\u53D8\u5316:",ie)},[u]),U=xt(()=>{const ie=O==null?void 0:O.baseFontSize;return typeof ie=="number"&&!Number.isNaN(ie)?ie:o==="md"?14:12},[O,o]),R=mt(ie=>{const me={...ie,size:o,styles:p,eventsEmit:g,extraProps:G};return d?d(me):BC(me)},[d,o,p,g,G]),te=mt(ie=>{const me={...ie,styles:p,onRetriveTagClick:b};return m?m(me):AC(me)},[m,p,b]);lr(()=>(window.copyCodeFromData=ie=>{const me=ie.getAttribute("data-code");if(!me){console.error("No code content found");return}const Oe=me.replace(/\\n/g,`
778
- `).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\'/g,"'").replace(/\\\\/g,"\\").replace(/&quot;/g,'"');navigator.clipboard.writeText(Oe).then(()=>{const ee=ie.innerHTML;ie.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#2da44e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20,6 9,17 4,12"></polyline></svg>',ie.classList.add("copied"),setTimeout(()=>{ie.innerHTML=ee,ie.classList.remove("copied")},2e3)}).catch(ee=>{console.error("\u590D\u5236\u5931\u8D25:",ee);const pe=ie.innerHTML;ie.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',ie.style.background="#d73a49",ie.style.borderColor="#d73a49",ie.style.color="white",setTimeout(()=>{ie.innerHTML=pe,ie.style.background="",ie.style.borderColor="",ie.style.color=""},2e3)})},()=>{delete window.copyCodeFromData}),[]);const q=xt(()=>{var ie,me;if(e.type!=="markdown")return null;try{console.log("\u{1F50D} UnifiedRichText processing Markdown content:",{contentLength:(ie=X.content)==null?void 0:ie.length,basePath:n,hasImages:(me=X.content)==null?void 0:me.includes("![")});const Oe=Cg(X.content||"",{basePath:n});if(console.log("\u{1F3AF} Deserialized Slate content:",{slateLength:Oe.length,hasImageElements:Oe.some(Ce=>Ce.type==="image"),imageElements:Oe.filter(Ce=>Ce.type==="image")}),Oe&&Oe.length>0)return Z.jsx(vu,{theme:O,$size:o,children:Z.jsx(lu,{editor:_,initialValue:Oe,onChange:()=>{},children:Z.jsx(bu,{theme:O,children:Z.jsx(su,{renderElement:R,renderLeaf:te,readOnly:!0,style:{minHeight:"inherit",outline:"none",border:"none",background:"transparent",fontSize:`${U}px`}})})},$)});const ee={breaks:!0,gfm:!0,headerIds:!0,mangle:!1,sanitize:!1,pedantic:!1,smartLists:!0,smartypants:!0};let pe=Wt(X.content||"",ee);pe=pe.replace(/<table([^>]*)>/g,'<div class="table-container"><table$1>'),pe=pe.replace(/<\/table>/g,"</table></div>"),pe=pe.replace(/<pre><code([^>]*)>([\s\S]*?)<\/code><\/pre>/g,(Ce,Ee,Fe)=>{const Be=Fe.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/"/g,"&quot;");return`<pre><code${Ee}>${Fe}</code><button class="code-copy-btn" data-code="${Be}" onclick="copyCodeFromData(this)" title="\u590D\u5236\u4EE3\u7801"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></button></pre>`});const le=(O==null?void 0:O.disabledBackground)||(O==null?void 0:O.backgroundColor)||"#ffffff",ue=(Ce,Ee)=>Ce.startsWith("#")?`${Ce}${Math.round(Ee*255).toString(16).padStart(2,"0")}`:Ce,De=`
779
- <style>
780
- .table-container{ overflow:auto; border:1px solid ${(O==null?void 0:O.borderColor)||"#e5e7eb"}; border-radius: 6px; background:${(O==null?void 0:O.backgroundColor)||"transparent"} !important; }
781
- .table-container table{ background:${(O==null?void 0:O.backgroundColor)||"transparent"} !important; color:${(O==null?void 0:O.textColor)||"#24292f"} !important; }
782
- .table-container th{ background:${(O==null?void 0:O.disabledBackground)||"#f6f8fa"} !important; color:${(O==null?void 0:O.textColor)||"#24292f"} !important; }
783
- .table-container td{ color:${(O==null?void 0:O.textColor)||"#24292f"} !important; background:${(O==null?void 0:O.backgroundColor)||"transparent"} !important; }
784
- .table-container tr:nth-child(even) td{ background:${(O==null?void 0:O.disabledBackground)||"#f6f8fa"} !important; }
785
- pre{ position:relative; background:${le}; border:1px solid ${(O==null?void 0:O.borderColor)||"#e5e7eb"}; border-radius:6px; padding:12px 36px 12px 12px; color:${(O==null?void 0:O.textColor)||"#e5e7eb"}; }
786
- pre::before{ content:''; position:absolute; inset:0; border-radius:6px; pointer-events:none; background: linear-gradient(90deg, ${ue("#22c55e",.25)}, ${ue("#f59e0b",.25)}, ${ue("#ef4444",.25)}); opacity: .45; mix-blend-mode: overlay; }
787
- pre .code-copy-btn{ position:absolute; top:8px; right:8px; background:transparent; border:1px solid ${(O==null?void 0:O.borderColor)||"#e5e7eb"}; color:${(O==null?void 0:O.textColor)||"#24292f"}; border-radius:6px; padding:2px 6px; cursor:pointer; }
788
- pre .code-copy-btn:hover{ background:${(O==null?void 0:O.hoverBackground)||"rgba(0,0,0,0.06)"}; }
789
- </style>
790
- `;return Z.jsx("div",{style:{padding:(O==null?void 0:O.padding)||"1rem",fontSize:`${U}px`,lineHeight:1.6,color:(O==null?void 0:O.textColor)||"#24292f"},"data-pending-latex":X.hasPendingLatex||void 0,dangerouslySetInnerHTML:{__html:De+pe}})}catch(Oe){return console.error("Markdown parsing error:",Oe),Z.jsx("div",{children:e.content})}},[e,O,_,$,R,te,U,X]),se=xt(()=>e.type!=="html"?null:Z.jsx("div",{style:{padding:(O==null?void 0:O.padding)||"1rem",fontSize:`${U}px`,lineHeight:1.6,color:(O==null?void 0:O.textColor)||"#24292f"},dangerouslySetInnerHTML:{__html:e.content||""}}),[e,O,U]),ye=xt(()=>e.type!=="text"?null:Z.jsx("div",{style:{padding:(O==null?void 0:O.padding)||"1rem",fontSize:`${U}px`,lineHeight:1.6,color:(O==null?void 0:O.textColor)||"#24292f"},children:Z.jsx("span",{children:e.content||""})}),[e,O,U]),we=()=>{switch(e.type){case"markdown":return q;case"html":return se;case"text":return ye;case"slate":default:return t?Z.jsx(vu,{theme:O,$size:o,children:Z.jsx(lu,{editor:_,initialValue:z,onChange:H,children:Z.jsx(bu,{theme:O,children:Z.jsx(su,{renderElement:R,renderLeaf:te,placeholder:r,readOnly:!1,onFocus:c,onBlur:f,style:{minHeight:"inherit",outline:"none",fontSize:`${U}px`}})})},$)}):Z.jsx(vu,{theme:O,$size:o,children:Z.jsx(lu,{editor:_,initialValue:z,onChange:()=>{},children:Z.jsx(bu,{theme:O,children:Z.jsx(su,{renderElement:R,renderLeaf:te,readOnly:!0,style:{minHeight:"inherit",outline:"none",border:"none",background:"transparent",fontSize:`${U}px`}})})},$)})}};return Z.jsx(TC,{theme:O,$isEditing:t,className:C,style:D,children:we()})};var h0={exports:{}},RC=h0.exports,Fp;function PC(){return Fp||(Fp=1,(function(e,t){(function(r,n){e.exports=n()})(RC,(function(){var r=1e3,n=6e4,o=36e5,a="millisecond",u="second",c="minute",f="hour",d="day",m="week",b="month",g="quarter",w="year",C="date",D="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,B=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,F={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var H=["th","st","nd","rd"],U=j%100;return"["+j+(H[(U-20)%10]||H[U]||H[0])+"]"}},S=function(j,H,U){var R=String(j);return!R||R.length>=H?j:""+Array(H+1-R.length).join(U)+j},O={s:S,z:function(j){var H=-j.utcOffset(),U=Math.abs(H),R=Math.floor(U/60),te=U%60;return(H<=0?"+":"-")+S(R,2,"0")+":"+S(te,2,"0")},m:function j(H,U){if(H.date()<U.date())return-j(U,H);var R=12*(U.year()-H.year())+(U.month()-H.month()),te=H.clone().add(R,b),q=U-te<0,se=H.clone().add(R+(q?-1:1),b);return+(-(R+(U-te)/(q?te-se:se-te))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:b,y:w,w:m,d,D:C,h:f,m:c,s:u,ms:a,Q:g}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},M="en",_={};_[M]=F;var z="$isDayjsObject",K=function(j){return j instanceof X||!(!j||!j[z])},$=function j(H,U,R){var te;if(!H)return M;if(typeof H=="string"){var q=H.toLowerCase();_[q]&&(te=q),U&&(_[q]=U,te=q);var se=H.split("-");if(!te&&se.length>1)return j(se[0])}else{var ye=H.name;_[ye]=H,te=ye}return!R&&te&&(M=te),te||!R&&M},Q=function(j,H){if(K(j))return j.clone();var U=typeof H=="object"?H:{};return U.date=j,U.args=arguments,new X(U)},V=O;V.l=$,V.i=K,V.w=function(j,H){return Q(j,{locale:H.$L,utc:H.$u,x:H.$x,$offset:H.$offset})};var X=(function(){function j(U){this.$L=$(U.locale,null,!0),this.parse(U),this.$x=this.$x||U.x||{},this[z]=!0}var H=j.prototype;return H.parse=function(U){this.$d=(function(R){var te=R.date,q=R.utc;if(te===null)return new Date(NaN);if(V.u(te))return new Date;if(te instanceof Date)return new Date(te);if(typeof te=="string"&&!/Z$/i.test(te)){var se=te.match(p);if(se){var ye=se[2]-1||0,we=(se[7]||"0").substring(0,3);return q?new Date(Date.UTC(se[1],ye,se[3]||1,se[4]||0,se[5]||0,se[6]||0,we)):new Date(se[1],ye,se[3]||1,se[4]||0,se[5]||0,se[6]||0,we)}}return new Date(te)})(U),this.init()},H.init=function(){var U=this.$d;this.$y=U.getFullYear(),this.$M=U.getMonth(),this.$D=U.getDate(),this.$W=U.getDay(),this.$H=U.getHours(),this.$m=U.getMinutes(),this.$s=U.getSeconds(),this.$ms=U.getMilliseconds()},H.$utils=function(){return V},H.isValid=function(){return this.$d.toString()!==D},H.isSame=function(U,R){var te=Q(U);return this.startOf(R)<=te&&te<=this.endOf(R)},H.isAfter=function(U,R){return Q(U)<this.startOf(R)},H.isBefore=function(U,R){return this.endOf(R)<Q(U)},H.$g=function(U,R,te){return V.u(U)?this[R]:this.set(te,U)},H.unix=function(){return Math.floor(this.valueOf()/1e3)},H.valueOf=function(){return this.$d.getTime()},H.startOf=function(U,R){var te=this,q=!!V.u(R)||R,se=V.p(U),ye=function(ue,De){var Ce=V.w(te.$u?Date.UTC(te.$y,De,ue):new Date(te.$y,De,ue),te);return q?Ce:Ce.endOf(d)},we=function(ue,De){return V.w(te.toDate()[ue].apply(te.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(De)),te)},ie=this.$W,me=this.$M,Oe=this.$D,ee="set"+(this.$u?"UTC":"");switch(se){case w:return q?ye(1,0):ye(31,11);case b:return q?ye(1,me):ye(0,me+1);case m:var pe=this.$locale().weekStart||0,le=(ie<pe?ie+7:ie)-pe;return ye(q?Oe-le:Oe+(6-le),me);case d:case C:return we(ee+"Hours",0);case f:return we(ee+"Minutes",1);case c:return we(ee+"Seconds",2);case u:return we(ee+"Milliseconds",3);default:return this.clone()}},H.endOf=function(U){return this.startOf(U,!1)},H.$set=function(U,R){var te,q=V.p(U),se="set"+(this.$u?"UTC":""),ye=(te={},te[d]=se+"Date",te[C]=se+"Date",te[b]=se+"Month",te[w]=se+"FullYear",te[f]=se+"Hours",te[c]=se+"Minutes",te[u]=se+"Seconds",te[a]=se+"Milliseconds",te)[q],we=q===d?this.$D+(R-this.$W):R;if(q===b||q===w){var ie=this.clone().set(C,1);ie.$d[ye](we),ie.init(),this.$d=ie.set(C,Math.min(this.$D,ie.daysInMonth())).$d}else ye&&this.$d[ye](we);return this.init(),this},H.set=function(U,R){return this.clone().$set(U,R)},H.get=function(U){return this[V.p(U)]()},H.add=function(U,R){var te,q=this;U=Number(U);var se=V.p(R),ye=function(me){var Oe=Q(q);return V.w(Oe.date(Oe.date()+Math.round(me*U)),q)};if(se===b)return this.set(b,this.$M+U);if(se===w)return this.set(w,this.$y+U);if(se===d)return ye(1);if(se===m)return ye(7);var we=(te={},te[c]=n,te[f]=o,te[u]=r,te)[se]||1,ie=this.$d.getTime()+U*we;return V.w(ie,this)},H.subtract=function(U,R){return this.add(-1*U,R)},H.format=function(U){var R=this,te=this.$locale();if(!this.isValid())return te.invalidDate||D;var q=U||"YYYY-MM-DDTHH:mm:ssZ",se=V.z(this),ye=this.$H,we=this.$m,ie=this.$M,me=te.weekdays,Oe=te.months,ee=te.meridiem,pe=function(De,Ce,Ee,Fe){return De&&(De[Ce]||De(R,q))||Ee[Ce].slice(0,Fe)},le=function(De){return V.s(ye%12||12,De,"0")},ue=ee||function(De,Ce,Ee){var Fe=De<12?"AM":"PM";return Ee?Fe.toLowerCase():Fe};return q.replace(B,(function(De,Ce){return Ce||(function(Ee){switch(Ee){case"YY":return String(R.$y).slice(-2);case"YYYY":return V.s(R.$y,4,"0");case"M":return ie+1;case"MM":return V.s(ie+1,2,"0");case"MMM":return pe(te.monthsShort,ie,Oe,3);case"MMMM":return pe(Oe,ie);case"D":return R.$D;case"DD":return V.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return pe(te.weekdaysMin,R.$W,me,2);case"ddd":return pe(te.weekdaysShort,R.$W,me,3);case"dddd":return me[R.$W];case"H":return String(ye);case"HH":return V.s(ye,2,"0");case"h":return le(1);case"hh":return le(2);case"a":return ue(ye,we,!0);case"A":return ue(ye,we,!1);case"m":return String(we);case"mm":return V.s(we,2,"0");case"s":return String(R.$s);case"ss":return V.s(R.$s,2,"0");case"SSS":return V.s(R.$ms,3,"0");case"Z":return se}return null})(De)||se.replace(":","")}))},H.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},H.diff=function(U,R,te){var q,se=this,ye=V.p(R),we=Q(U),ie=(we.utcOffset()-this.utcOffset())*n,me=this-we,Oe=function(){return V.m(se,we)};switch(ye){case w:q=Oe()/12;break;case b:q=Oe();break;case g:q=Oe()/3;break;case m:q=(me-ie)/6048e5;break;case d:q=(me-ie)/864e5;break;case f:q=me/o;break;case c:q=me/n;break;case u:q=me/r;break;default:q=me}return te?q:V.a(q)},H.daysInMonth=function(){return this.endOf(b).$D},H.$locale=function(){return _[this.$L]},H.locale=function(U,R){if(!U)return this.$L;var te=this.clone(),q=$(U,R,!0);return q&&(te.$L=q),te},H.clone=function(){return V.w(this.$d,this)},H.toDate=function(){return new Date(this.valueOf())},H.toJSON=function(){return this.isValid()?this.toISOString():null},H.toISOString=function(){return this.$d.toISOString()},H.toString=function(){return this.$d.toUTCString()},j})(),G=X.prototype;return Q.prototype=G,[["$ms",a],["$s",u],["$m",c],["$H",f],["$W",d],["$M",b],["$y",w],["$D",C]].forEach((function(j){G[j[1]]=function(H){return this.$g(H,j[0],j[1])}})),Q.extend=function(j,H){return j.$i||(j(H,X,Q),j.$i=!0),Q},Q.locale=$,Q.isDayjs=K,Q.unix=function(j){return Q(1e3*j)},Q.en=_[M],Q.Ls=_,Q.p={},Q}))})(h0)),h0.exports}var IC=PC();const zC=js(IC);/**
791
- * @license lucide-react v0.456.0 - ISC
792
- *
793
- * This source code is licensed under the ISC license.
794
- * See the LICENSE file in the root directory of this source tree.
795
- */const jC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wg=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
796
- * @license lucide-react v0.456.0 - ISC
797
- *
798
- * This source code is licensed under the ISC license.
799
- * See the LICENSE file in the root directory of this source tree.
800
- */var _C={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
801
- * @license lucide-react v0.456.0 - ISC
802
- *
803
- * This source code is licensed under the ISC license.
804
- * See the LICENSE file in the root directory of this source tree.
805
- */const LC=vo(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:u,...c},f)=>ts("svg",{ref:f,..._C,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:wg("lucide",o),...c},[...u.map(([d,m])=>ts(d,m)),...Array.isArray(a)?a:[a]]));/**
806
- * @license lucide-react v0.456.0 - ISC
807
- *
808
- * This source code is licensed under the ISC license.
809
- * See the LICENSE file in the root directory of this source tree.
810
- */const Xr=(e,t)=>{const r=vo(({className:n,...o},a)=>ts(LC,{ref:a,iconNode:t,className:wg(`lucide-${jC(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
811
- * @license lucide-react v0.456.0 - ISC
812
- *
813
- * This source code is licensed under the ISC license.
814
- * See the LICENSE file in the root directory of this source tree.
815
- */const Ii=Xr("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
816
- * @license lucide-react v0.456.0 - ISC
817
- *
818
- * This source code is licensed under the ISC license.
819
- * See the LICENSE file in the root directory of this source tree.
820
- */const HC=Xr("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
821
- * @license lucide-react v0.456.0 - ISC
822
- *
823
- * This source code is licensed under the ISC license.
824
- * See the LICENSE file in the root directory of this source tree.
825
- */const zi=Xr("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
826
- * @license lucide-react v0.456.0 - ISC
827
- *
828
- * This source code is licensed under the ISC license.
829
- * See the LICENSE file in the root directory of this source tree.
830
- */const KC=Xr("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
831
- * @license lucide-react v0.456.0 - ISC
832
- *
833
- * This source code is licensed under the ISC license.
834
- * See the LICENSE file in the root directory of this source tree.
835
- */const qC=Xr("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
836
- * @license lucide-react v0.456.0 - ISC
837
- *
838
- * This source code is licensed under the ISC license.
839
- * See the LICENSE file in the root directory of this source tree.
840
- */const WC=Xr("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
841
- * @license lucide-react v0.456.0 - ISC
842
- *
843
- * This source code is licensed under the ISC license.
844
- * See the LICENSE file in the root directory of this source tree.
845
- */const VC=Xr("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);/**
846
- * @license lucide-react v0.456.0 - ISC
847
- *
848
- * This source code is licensed under the ISC license.
849
- * See the LICENSE file in the root directory of this source tree.
850
- */const UC=Xr("MessageSquareDot",[["path",{d:"M11.7 3H5a2 2 0 0 0-2 2v16l4-4h12a2 2 0 0 0 2-2v-2.7",key:"uodpkb"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
851
- * @license lucide-react v0.456.0 - ISC
852
- *
853
- * This source code is licensed under the ISC license.
854
- * See the LICENSE file in the root directory of this source tree.
855
- */const YC=Xr("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
856
- * @license lucide-react v0.456.0 - ISC
857
- *
858
- * This source code is licensed under the ISC license.
859
- * See the LICENSE file in the root directory of this source tree.
860
- */const GC=Xr("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
861
- * @license lucide-react v0.456.0 - ISC
862
- *
863
- * This source code is licensed under the ISC license.
864
- * See the LICENSE file in the root directory of this source tree.
865
- */const XC=Xr("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
866
- * @license lucide-react v0.456.0 - ISC
867
- *
868
- * This source code is licensed under the ISC license.
869
- * See the LICENSE file in the root directory of this source tree.
870
- */const QC=Xr("Share",[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]]);/**
871
- * @license lucide-react v0.456.0 - ISC
872
- *
873
- * This source code is licensed under the ISC license.
874
- * See the LICENSE file in the root directory of this source tree.
875
- */const ZC=Xr("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
876
- * @license lucide-react v0.456.0 - ISC
877
- *
878
- * This source code is licensed under the ISC license.
879
- * See the LICENSE file in the root directory of this source tree.
880
- */const JC=Xr("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
881
- * @license lucide-react v0.456.0 - ISC
882
- *
883
- * This source code is licensed under the ISC license.
884
- * See the LICENSE file in the root directory of this source tree.
885
- */const ew=Xr("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function yu(e,t,r=18){var u;const n=(e||"").toLowerCase(),o=((u=t==null?void 0:t.theme)==null?void 0:u.icons)||{},a=(c,f,d)=>{const m=[c,...d||[]];for(const b of m){const g=o[b];if(g){if(je.isValidElement(g))return g;if(typeof g=="string")return Z.jsx("img",{src:g,alt:b,style:{width:r,height:r}})}}return Z.jsx(rs,{type:f,size:r})};return["png","jpg","jpeg","gif","bmp","webp","svg","ico"].includes(n)?a("image","Files/tupian_color",["png","jpg","jpeg"]):n==="pdf"?a("pdf","Files/pdf_color"):["doc","docx"].includes(n)?a("docx","Files/docx_color",["doc"]):["xls","xlsx","xlsm","xlsb","xltx","xltm","xlt","xlam"].includes(n)?a("sheets","Files/xls_color",["excel","xls","xlsx"]):n==="csv"?a("csv","Files/csv_color",["sheets","excel"]):["ppt","pptx"].includes(n)?a("pptx","Files/ppt_color",["ppt"]):n==="txt"||n==="md"?a("txt","Files/txt_color",["md"]):["zip","rar","7z"].includes(n)?a("archive","Files/yasuobao_color",["zip","rar"]):["odt","ods","odp","odf"].includes(n)?a("odt","Files/odt_color"):["html","htm","url"].includes(n)?a("html","Files/lianjie_color",["htm","url"]):n==="json"?a("json","Files/unknow_color"):Z.jsx(rs,{type:"Files/unknow_color",size:r})}function Go(e){let t=[];for(const r of e)r.retrive===!0&&t.push(r),Array.isArray(r.children)&&(t=t.concat(Go(r.children)));return t}function tw(e){const t=[],r=/<retrive-tag[^>]*image_urls=['"]([^'"]+)['"][^>]*>/g;let n;for(;n=r.exec(e);){const a=n[1].split(";").map(u=>u.trim()).filter(Boolean);t.push(...a)}const o=/\[retrive-tag[^\]]*image_urls=['"]([^'"]+)['"][^\]]*\]\[[^\]]+\]\[\/retrive-tag\]/g;for(;n=o.exec(e);){const a=n[1].split(";").map(u=>u.trim()).filter(Boolean);t.push(...a)}return Array.from(new Set(t))}function ji(e){if(e==null)return null;const t=Number(e);return Number.isNaN(t)?null:t}function rw(e){const t=[];let r=1;const n=o=>{o.forEach(a=>{(a==null?void 0:a.type)==="retrieve-sql-data"&&(a!=null&&a.id)&&t.push({id:String(a.id),index:r++}),Array.isArray(a==null?void 0:a.children)&&a.children.length&&n(a.children)})};return Array.isArray(e)&&e.length&&n(e),t}const nw=tr.div.attrs({className:"chat-message-container"})`
886
- display: flex;
887
- flex-direction: column;
888
- margin-bottom: 0.5rem;
889
- animation: fadeIn 0.3s ease-in-out;
890
- width: 100%;
891
- text-wrap: wrap;
892
-
893
- ${e=>e.$align==="right"&&`
894
- align-items: flex-end;
895
- `}
896
-
897
- ${e=>e.$align==="center"&&`
898
- align-items: center;
899
- `}
900
-
901
- @keyframes fadeIn {
902
- from { opacity: 0; transform: translateY(10px); }
903
- to { opacity: 1; transform: translateY(0); }
904
- }
905
- `,ow=tr.div.attrs({className:"chat-message-header"})`
906
- display: flex;
907
- align-items: center;
908
- gap: 0.25rem;
909
- margin-bottom: 0.5rem;
910
- width: 100%;
911
-
912
- ${e=>e.$isUser&&`
913
- flex-direction: row-reverse;
914
- justify-content: end;
915
- `}
916
- `,aw=tr.div.attrs({className:"chat-message-avatar"})`
917
- background: ${e=>e.$src?`url('${e.$src}') center/cover no-repeat`:"var(--avatar-bg, #e5e7eb)"};
918
- border-radius: 50%;
919
- width: 2rem;
920
- height: 2rem;
921
- flex-shrink: 0;
922
- display: flex;
923
- align-items: center;
924
- justify-content: center;
925
- font-size: 1rem;
926
- `,iw=tr.div.attrs({className:"chat-message-content"})`
927
- width: 100%;
928
- .message-time {
929
- font-size: 0.75rem;
930
- color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.disabled)||"#6b7280"}};
931
- }
932
-
933
- .message-card {
934
- background: ${e=>e.$isUser?"linear-gradient(180deg, #E3ECFF 0%, #EEEBFF 100%)":"#ffffff"};
935
- border: 1px solid ${e=>(e.$isUser,"transparent")};
936
- border-radius: 0.5rem;
937
- padding-top: 12px;
938
- padding-bottom: 12px;
939
- overflow: hidden;
940
- max-width: ${e=>e.$isUser?"fit-content":"100%"};
941
- margin-left: ${e=>e.$isUser?"auto":"0"};
942
- margin-right: ${e=>e.$isUser?"40px":"0"};
943
- padding: 0.25rem 1.8rem;
944
- .message-text {
945
- width: 100%;
946
- line-height: 1.6;
947
- white-space: pre-wrap !important; /* 保留换行和空格格式,使用 !important 确保优先级 */
948
- border-radius: 0.5rem;
949
- min-height: ${e=>e.$isUser?"auto":"40px"};
950
- font-size: 0.875rem;
951
-
952
- /* 确保子元素也继承 white-space 属性 */
953
- & > * {
954
- white-space: pre-wrap !important;
955
- }
956
- }
957
- }
958
- `,sw=tr.div.attrs({className:"chat-message-actions-container"})`
959
- margin-top: 0.5rem;
960
- display: flex;
961
- padding: 0.5rem;
962
- align-items: center;
963
-
964
- gap: 0.75rem;
965
-
966
- button {
967
- display: flex;
968
- align-items: center;
969
- gap: 0.25rem;
970
- font-size: 0.875rem;
971
- color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.disabled)||"#6b7280"}};
972
- background: none;
973
- border: none;
974
- cursor: pointer;
975
- transition: color 0.2s;
976
-
977
- &:hover {
978
- color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.primary)||"#3b82f6"}};
979
- }
980
-
981
- &.active {
982
- color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.primary)||"#3b82f6"}} !important;
983
- }
984
- }
985
- `,lw=tr.div.attrs({className:"chat-message-follow-up-container"})`
986
- margin-top: 1rem;
987
- padding: 0 2.9rem;
988
-
989
- border-radius: 0.5rem;
990
-
991
- @keyframes followUpIn {
992
- from {
993
- opacity: 0;
994
- transform: translateY(6px);
995
- }
996
- to {
997
- opacity: 1;
998
- transform: translateY(0);
999
- }
1000
- }
1001
-
1002
- .follow-up-title {
1003
- font-size: 0.875rem;
1004
- font-weight: 600;
1005
- color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.text)||"#374151"}};
1006
- margin-bottom: 0.75rem;
1007
- }
1008
-
1009
- .follow-up-list {
1010
- display: flex;
1011
- flex-direction: column;
1012
- gap: 0.5rem;
1013
- }
1014
-
1015
- .follow-up-item {
1016
- width: fit-content;
1017
- background: #ffffff;
1018
- border: 1px solid #e5e7eb;
1019
- border-radius: 0.375rem;
1020
- padding: 0.75rem 1rem;
1021
- cursor: pointer;
1022
- transition: all 0.2s ease;
1023
- text-align: left;
1024
- color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.text)||"#374151"}};
1025
- font-size: 0.875rem;
1026
- line-height: 1.4;
1027
- opacity: 0;
1028
- transform: translateY(6px);
1029
- animation: followUpIn 280ms ease forwards;
1030
- animation-play-state: running;
1031
-
1032
- &:hover {
1033
- background: #e5e7eb;
1034
- border-color: #d1d5db;
1035
- }
1036
-
1037
- &:active {
1038
- transform: translateY(1px);
1039
- }
1040
- }
1041
- `,_i=tr.div.attrs({className:"chat-message-reference-container"})`
1042
-
1043
- padding: 1rem;
1044
- background: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.background)||"#ffffff"}};
1045
-
1046
- border-radius: 0.5rem;
1047
-
1048
-
1049
- .reference-title {
1050
- font-size: 0.875rem;
1051
- font-weight: 600;
1052
- color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.text)||"#374151"}};
1053
- margin-bottom: 0.75rem;
1054
- }
1055
-
1056
- .reference-list {
1057
- display: flex;
1058
- flex-direction: column;
1059
- gap: 0.5rem;
1060
- }
1061
-
1062
- .reference-item {
1063
- background: #ffffff;
1064
-
1065
- border-radius: 0.375rem;
1066
- padding: 0.75rem 0;
1067
- display: flex;
1068
- align-items: center;
1069
- gap: 0.5rem;
1070
-
1071
- .file-icon {
1072
- width: 2rem;
1073
- height: 2rem;
1074
- background: #e2e8f0;
1075
- border-radius: 0.25rem;
1076
- display: flex;
1077
- align-items: center;
1078
- justify-content: center;
1079
- font-size: 0.75rem;
1080
- color: #64748b;
1081
- }
1082
-
1083
- .file-info {
1084
- flex: 1;
1085
-
1086
- .file-name {
1087
- font-size: 0.875rem;
1088
- font-weight: 500;
1089
- color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.text)||"#374151"}};
1090
- margin-bottom: 0.25rem;
1091
- }
1092
-
1093
- .file-meta {
1094
- font-size: 0.75rem;
1095
- color: #64748b;
1096
- }
1097
- }
1098
-
1099
- .file-score {
1100
- font-size: 0.75rem;
1101
- color: #059669;
1102
- font-weight: 500;
1103
- }
1104
- }
1105
- `,uw=tr.div.attrs({className:"chat-message-image-preview-modal"})`
1106
- position: fixed;
1107
- top: 0;
1108
- left: 0;
1109
- right: 0;
1110
- bottom: 0;
1111
- background: rgba(0, 0, 0, 0.8);
1112
- display: ${e=>e.$show?"flex":"none"};
1113
- align-items: center;
1114
- justify-content: center;
1115
- z-index: 1000;
1116
- cursor: pointer;
1117
-
1118
- .modal-content {
1119
- max-width: 90vw;
1120
- max-height: 90vh;
1121
- position: relative;
1122
- cursor: default;
1123
- display: flex;
1124
- flex-direction: column;
1125
- align-items: center;
1126
- }
1127
-
1128
- .modal-image {
1129
- max-width: 100%;
1130
- max-height: calc(90vh - 60px);
1131
- object-fit: contain;
1132
- border-radius: 8px;
1133
- }
1134
-
1135
- .modal-close {
1136
- margin-top: 16px;
1137
- background: rgba(255, 255, 255, 0.3);
1138
- border: none;
1139
- border-radius: 20px;
1140
- padding: 8px 20px;
1141
- display: flex;
1142
- align-items: center;
1143
- justify-content: center;
1144
- cursor: pointer;
1145
- font-size: 14px;
1146
- color: #333;
1147
- font-weight: 500;
1148
- transition: all 0.2s ease;
1149
-
1150
- &:hover {
1151
- background: rgba(255, 255, 255, 1);
1152
- transform: translateY(-1px);
1153
- }
1154
- }
1155
- `,xu=tr.div.attrs({className:"chat-message-image-gallery-container"})`
1156
-
1157
- padding:0rem 0.5rem;
1158
- background: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.background)||"#ffffff"}};
1159
-
1160
- .gallery-grid {
1161
- display: grid;
1162
- grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
1163
- gap: 0.75rem;
1164
- }
1165
-
1166
- .gallery-item {
1167
- position: relative;
1168
- aspect-ratio: 1;
1169
- border-radius: 0.375rem;
1170
- overflow: hidden;
1171
- cursor: pointer;
1172
- transition: transform 0.2s ease, box-shadow 0.2s ease;
1173
- border: 2px solid transparent;
1174
-
1175
- &:hover {
1176
- transform: translateY(-2px);
1177
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1178
- border-color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.primary)||"#3b82f6"}};
1179
- }
1180
-
1181
- .gallery-image {
1182
- width: 100%;
1183
- height: 100%;
1184
- object-fit: cover;
1185
- background: #f3f4f6;
1186
- }
1187
-
1188
- .gallery-overlay {
1189
- position: absolute;
1190
- bottom: 0;
1191
- left: 0;
1192
- right: 0;
1193
- background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
1194
- color: white;
1195
- padding: 0.5rem;
1196
- font-size: 0.75rem;
1197
- text-align: center;
1198
- opacity: 0;
1199
- transition: opacity 0.2s ease;
1200
- }
1201
-
1202
- &:hover .gallery-overlay {
1203
- opacity: 1;
1204
- }
1205
- }
1206
- `,Ew=({is_download:e,content:t,contentType:r="plainText",align:n="left",displayStatus:o="ready",avatar:a,isUser:u=!1,userAvatar:c,aiAvatar:f,date:d,time:m,timestamp:b,showTime:g=!0,errorMessage:w,styles:C,reference:D,webReference:p,databaseReference:B,graphReference:F,filePaths:S,currentFiles:O,fileManagerData:M,audioUrl:_,feedbackResult:z,queryId:K,defaultAnswer:$,isWelcome:Q=!1,isLast:V=!1,respTime:X,tokens:G,resultType:j,followUpQuestions:H=[],tools:U={},eventsEmit:R,referenceMode:te="list"})=>{lr(()=>{console.log("isUser",u),console.log("isLast",V)},[V,u]);const q=Os(),se=xt(()=>{var v,oe,A,L,be,xe,ke,Ie,J,ce,he;return{colors:{primary:((v=q==null?void 0:q.colors)==null?void 0:v.primary)||"#3b82f6",background:((oe=q==null?void 0:q.colors)==null?void 0:oe.background)||"#ffffff",userBackground:((A=q==null?void 0:q.colors)==null?void 0:A.primary)||"#3b82f6",border:((L=q==null?void 0:q.colors)==null?void 0:L.border)||"#e5e7eb",text:((be=q==null?void 0:q.colors)==null?void 0:be.text)||"#374151",disabled:((xe=q==null?void 0:q.colors)==null?void 0:xe.disabled)||"#6b7280",info:((ke=q==null?void 0:q.colors)==null?void 0:ke.info)||"#3b82f6",warning:((Ie=q==null?void 0:q.colors)==null?void 0:Ie.warning)||"#f59e0b",error:((J=q==null?void 0:q.colors)==null?void 0:J.error)||"#ef4444",...(ce=C==null?void 0:C.theme)==null?void 0:ce.colors},icons:{aiAvatar:f||"/vite.svg",userAvatar:c||"/default-user-avatar.png",...(he=C==null?void 0:C.theme)==null?void 0:he.icons}}},[q,C,f,c]),ye=xt(()=>{const v=m||d||b;return!v||!g?null:zC(v).format("YY-MM-DD HH:mm:ss")},[m,d,b,g]),[we,ie]=Pt([]),[me,Oe]=Pt(null),[ee,pe]=Pt(!1),[le,ue]=Pt(!1),[De,Ce]=Pt(!1),[Ee,Fe]=Pt(!1),[Be,Ne]=Pt(!1),ze=()=>{const v={processing:{text:"AI \u6B63\u5728\u601D\u8003...",icon:"\u{1F4AD}"},thinking:{text:"\u6DF1\u5EA6\u601D\u8003\u4E2D",icon:"\u{1F4AD}"},uploading:{text:"\u6587\u4EF6\u4E0A\u4F20\u4E2D...",icon:"\u{1F4E4}"},analyzing:{text:"\u77E5\u8BC6\u89E3\u6790\u4E2D...",icon:"\u{1F50D}"},error:{text:w||"\u62B1\u6B49\uFF0C\u672C\u6B21\u8BF7\u6C42\u51FA\u9519\u4E86\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",icon:"\u274C"},initializing:{text:"\u6B63\u5728\u521D\u59CB\u5316...",icon:"\u2699\uFE0F"},ready:{text:"\u601D\u8003\u5B8C\u6210",icon:Z.jsx(rs,{type:"rag/think",size:16})}}[o]||{text:"\u5904\u7406\u4E2D...",icon:"\u{1F4AD}"},oe=X?`(\u7528\u65F6 ${Math.round(X/1e3)} \u79D2)`:"";return Z.jsx("div",{className:"think-header",children:Z.jsx("div",{className:"think-header-left ml-[16px]",children:Z.jsxs("div",{className:"flex items-center gap-x-1 bg-[#F5F7FA] p-2 rounded w-full",children:[Z.jsx("div",{className:"think-icon",children:v.icon}),Z.jsx("div",{className:"think-title",children:v.text}),oe&&Z.jsx("div",{className:"think-time",children:oe}),Dt&&Z.jsx("button",{className:"think-collapse-btn ml-2 cursor-pointer",title:"\u6536\u8D77/\u5C55\u5F00",onClick:()=>{Ne(!Be)},children:Z.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:Be?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"},children:Z.jsx("path",{d:"m18 15-6-6-6 6"})})})]})})})},[Me,Ge]=Pt([]),[dt,ut]=Pt(null),Pe=xt(()=>{try{if(!D)return[];const v=JSON.parse(D);return Array.isArray(v)?v:[]}catch{return[]}},[D]),Le=(v,oe)=>{var ke,Ie,J;const A=((ke=v==null?void 0:v.metadata)==null?void 0:ke.source)||(v==null?void 0:v.file_path)||(v==null?void 0:v.path)||(v==null?void 0:v.convertedFilePath)||(v==null?void 0:v.parsedFilePath)||"",L=((Ie=v==null?void 0:v.metadata)==null?void 0:Ie.title)||(v==null?void 0:v.file_name)||"",be=((J=v==null?void 0:v.metadata)==null?void 0:J.id)||(v==null?void 0:v.id)||(v==null?void 0:v.file_id)||"",xe=Pe.find(ce=>{var lt,re,et;const he=((lt=ce==null?void 0:ce.metadata)==null?void 0:lt.source)||(ce==null?void 0:ce.file_path)||(ce==null?void 0:ce.path)||(ce==null?void 0:ce.convertedFilePath)||(ce==null?void 0:ce.parsedFilePath)||"",He=((re=ce==null?void 0:ce.metadata)==null?void 0:re.title)||(ce==null?void 0:ce.file_name)||"",W=((et=ce==null?void 0:ce.metadata)==null?void 0:et.id)||(ce==null?void 0:ce.id)||"";return be&&W&&String(be)===String(W)||A&&he&&he===A||L&&He&&He===L});if(xe){const ce=(xe!=null&&xe.references&&Array.isArray(xe.references)?xe.references:[xe]).find(he=>String(he.order_num)===String(oe)||String(he.id)===String(oe));if(ce)return ce}for(const ce of Pe){if(ce!=null&&ce.references&&Array.isArray(ce.references)){const he=ce.references.find(He=>String(He.order_num)===String(oe)||String(He.id)===String(oe));if(he)return he}if(String(ce.order_num)===String(oe)||String(ce.id)===String(oe))return ce}return null},Ve=(v,oe)=>{function A(Ie,J){for(const ce of Ie){if(ce.references&&Array.isArray(ce.references)){const he=ce.references.find(He=>String(He.order_num)===String(J)||String(He.id)===String(J));if(he)return he}if(String(ce.order_num)===String(J)||String(ce.id)===String(J))return ce}return null}let L=[];try{D&&(L=JSON.parse(D))}catch(Ie){console.error("Failed to parse reference:",Ie)}const be=A(L,v.id),xe=Ie=>{if(typeof t!="string")return;const J=new RegExp(`\\[retrive-tag[^\\]]*id=['"]${Ie}['"][^\\]]*\\]\\[([^\\]]+)\\]\\\\/retrive-tag\\]`,"g").exec(t);if(J&&J[1]){const ce=Number(J[1]);return Number.isNaN(ce)?void 0:ce}},ke={tagInfo:{id:v==null?void 0:v.id,index:xe(String(v==null?void 0:v.id)),image_urls:(v==null?void 0:v.imageUrls)||(v==null?void 0:v.image_urls)||[]},fromtype:String((v==null?void 0:v.fromtype)??""),leaf:v,attributes:oe,referenceDoc:be||void 0};if(String(v==null?void 0:v.fromtype)==="2"&&F)try{const Ie=JSON.parse(F||"[]"),J=(Array.isArray(Ie)?Ie:[]).find(ce=>{if(Array.isArray(ce==null?void 0:ce.traceNodes))return ce.traceNodes.some(He=>String(He==null?void 0:He.id)===String(v.id));const he=String(v.id||"").split("_")[0];return String(ce==null?void 0:ce.id)===he});J&&(ke.graph={id:J.id,graphName:J.graphName,fetchUrl:J.fetchUrl,cyphers:J.cyphers},ke.traceNode=Array.isArray(J.traceNodes)?J.traceNodes.find(ce=>String(ce==null?void 0:ce.id)===String(v.id)):void 0)}catch{}R==null||R("action_retrive_tag",ke),R==null||R("retrive_tag:click",ke)},ft=v=>{if(console.log("ChatMessageAdapter received retrieve-sql-data:request-data:",v),console.log("databaseReference available:",!!B),v.id&&B){console.log("Sending retrieve-sql-data:data-response with databaseReference"),console.log("databaseReference data:",B);const oe=new CustomEvent("retrieve-sql-data:data-response",{detail:{id:v.id,databaseReference:B}});console.log("Dispatching event:",oe),window.dispatchEvent(oe)}else console.log("Cannot send response - missing id or databaseReference")};je.useEffect(()=>{const v=oe=>{ft(oe.detail)};return window.addEventListener("retrieve-sql-data:request-data",v),()=>{window.removeEventListener("retrieve-sql-data:request-data",v)}},[B]),je.useEffect(()=>{const v=oe=>{Je(oe.detail)};return window.addEventListener("rtext_pagination_click",v),()=>{window.removeEventListener("rtext_pagination_click",v)}},[dt]);const Je=v=>{if(console.log("ChatMessageAdapter received rtext_pagination_click:",v),v.replacePredataFunction&&dt){const oe={...dt,rows:dt.rows};v.replacePredataFunction(oe)}R==null||R("rtext_pagination_click",v)},Xe=It(new Map),St=It(1),bt=It(""),ct=It({0:1,1:1,2:1,3:1}),rt=xt(()=>{if(typeof t=="string"){let v=t;const oe=[];return K&&K!==bt.current&&(Xe.current.clear(),St.current=1,ct.current={0:1,1:1,2:1,3:1},bt.current=K),r==="stream"&&(v=v.replace(/\[retrive-tag([^\]]*)\]\[([^\]]+)\]\[\/retrive-tag\]/g,(A,L)=>{const be=L.match(/id=['"]([^'"]+)['"]/),xe=L.match(/fromType=['"]([^'"]+)['"]/);if(be){const ke=be[1],Ie=xe?xe[1]:"0";if(!Xe.current.has(ke)){const ce=ct.current,he=Ie==="1"?"1":Ie==="2"?"2":Ie==="3"?"3":"0",He=ce[he]??1;Xe.current.set(ke,He),ce[he]=He+1,ct.current=ce}const J=Xe.current.get(ke);return`[retrive-tag${L}][${J}][/retrive-tag]`}return A})),v=v.replace(/\[retrive-tag[^\]]*fromType=['"]0['"][^\]]*\]\[([^\]]+)\]\[\/retrive-tag\]/g,A=>{const L=A.match(/image_urls=['"]([^'"]+)['"]/);if(L){const be=L[1].split(";").map(xe=>xe.trim()).filter(Boolean);oe.push(...be)}return A}),oe.length>0&&ie(oe),v}return t},[t,r,K]),$e=xt(()=>{if(typeof rt=="string")try{return Cg(rt)}catch(v){return console.error("Failed to deserialize markdown:",v),[]}return[]},[rt]),de=mt(v=>{if(!(!v||typeof rt!="string"))try{const oe=new RegExp(`\\[retrive-tag[^\\]]*id=['"]${v}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`,"g").exec(rt);if(oe&&oe[1]){const A=Number(oe[1]);return Number.isNaN(A)?oe[1]:A}}catch{}},[rt]),it=xt(()=>rw($e||[]),[$e]),yt=xt(()=>{const v={};return it.forEach(oe=>{oe!=null&&oe.id&&!v[oe.id]&&(v[oe.id]=oe.index)}),v},[it]);lr(()=>{try{r==="stream"&&B&&(v=>{try{const oe=typeof v=="string"?JSON.parse(v):v;return oe?Array.isArray(oe)?oe:[oe]:[]}catch{return[]}})(B).forEach(v=>{const oe=v==null?void 0:v.id;if(!oe)return;const A=new CustomEvent("retrieve-sql-data:data-response",{detail:{id:oe,databaseReference:v}});window.dispatchEvent(A)})}catch{}},[r,B]);const Dt=xt(()=>{if(!Array.isArray($e))return!1;const v=A=>{for(const L of A)if(L.type==="think"||Array.isArray(L.children)&&v(L.children))return!0;return!1},oe=v($e);return console.log("Think detection:",{slateContent:$e,hasThinkElement:oe,displayStatus:o,isUser:u}),oe},[$e,o,u]),pt=xt(()=>({databaseReference:B,...Dt&&{isThinkCollapsed:Be}}),[B,Dt,Be]),Qt=xt(()=>a||(u?se.icons.userAvatar:se.icons.aiAvatar),[a,u,se.icons]),gt=xt(()=>typeof t=="string"?t:Array.isArray(t)?t.map(v=>typeof v=="string"?v:v.text||"").join(""):$||"",[t,$]),Zt=()=>{if(Q)return null;const v=[{key:"copy",show:U.copy!==!1,icon:KC,label:"\u590D\u5236",onClick:()=>R==null?void 0:R("chatbox:copy",{content:gt})},{key:"like",show:U.like!==!1,icon:JC,label:"\u8D5E",onClick:()=>R==null?void 0:R("chatbox:like",{result:z,queryId:K}),active:z===1},{key:"dislike",show:U.dislike!==!1,icon:ZC,label:"\u8E29",onClick:()=>R==null?void 0:R("chatbox:dislike",{result:z,queryId:K}),active:z===0},{key:"repeat",show:!u&&V,icon:XC,label:"\u91CD\u590D",onClick:()=>R==null?void 0:R("chatbox:repeat",{content:t,queryId:K,filePaths:S,audioUrl:_})},{key:"forward",show:U.forward,icon:QC,label:"\u8F6C\u53D1",onClick:()=>R==null?void 0:R("chatbox:forward",{content:gt,queryId:K})},{key:"delete",show:U.delete,icon:ew,label:"\u5220\u9664",onClick:()=>R==null?void 0:R("chatbox:delete",{queryId:K})},{key:"edit",show:U.edit,icon:YC,label:"\u7F16\u8F91",onClick:()=>R==null?void 0:R("chatbox:edit",{content:gt,queryId:K})}];return Z.jsxs("div",{style:{padding:"0 2.9rem"},className:"flex justify-between items-center",children:[Z.jsx(sw,{$theme:se,children:v.filter(oe=>oe.show).map(oe=>{const A=oe.icon;return Z.jsx(os,{title:oe.label,placement:"top",children:Z.jsx("button",{className:oe.active?"active":"",onClick:oe.onClick,children:Z.jsx(A,{size:18})})},oe.key)})}),!u&&o=="ready"&&!Q&&Z.jsxs("div",{className:"text-[10px] text-[#888888]",children:["\u672C\u6B21\u56DE\u7B54\u603B\u8BA1\u6D88\u8017"," ",Z.jsx("span",{style:{color:se.colors.primary},children:G||0})," ","tokens, \u7B49\u5F85\u603B\u8BA1\u8017\u65F6"," ",Z.jsx("span",{style:{color:se.colors.primary},children:Math.round((X||0)/1e3)}),"\u79D2"]})]})},rr=xt(()=>{if(!D)return[];let v=[];try{const be=JSON.parse(D);v=Array.isArray(be)?be:[]}catch{return[]}let oe=v.map(be=>{var xe;try{const ke=be.metadata||{};let Ie="";ke.type==="video"&&ke.source_name&&typeof ke.source_name=="string"?Ie=ke.source_name:be.name&&typeof be.name=="string"?Ie=be.name:be.file_name&&typeof be.file_name=="string"?Ie=be.file_name:ke.title&&typeof ke.title=="string"?Ie=ke.title:ke.source&&typeof ke.source=="string"?Ie=ke.source.split("/").pop()||"":be.order_num?Ie=String(be.order_num):Ie="\u672A\u77E5\u6587\u6863";let J="pdf";if(ke.type&&typeof ke.type=="string")J=ke.type.toLowerCase();else if(be.name&&typeof be.name=="string"){const re=be.name.split(".").pop();re&&(J=re.toLowerCase())}else if(ke.source&&typeof ke.source=="string"){const re=ke.source.split(".").pop();re&&(J=re.toLowerCase())}else if(be.file_path&&typeof be.file_path=="string"){const re=be.file_path.split(".").pop();re&&(J=re.toLowerCase())}const ce=be.parsedFilePath||ke.file_path||be.file_path||be.convertedFilePath||ke.link||ke.source_link||"",{metadata:he,...He}=be,W=ke.source||"",lt=ji(be.score??ke.score);return{file_id:ke.id||be.uid||"",file_name:Ie,file_type:J,path:ce,score:lt,tags:[],parsedFilePath:be.parsedFilePath,source:W,...He}}catch(ke){console.warn("\u89E3\u6790\u5F15\u7528\u6587\u6863\u65F6\u51FA\u9519:",ke,be);const{metadata:Ie,...J}=be,ce=((xe=be.metadata)==null?void 0:xe.source)||be.file_path||be.convertedFilePath||"",he=ji(be.score);return{file_id:be.uid||"",file_name:be.name||"\u672A\u77E5\u6587\u6863",file_type:"unknown",path:be.convertedFilePath||be.file_path||"",score:he,tags:[],parsedFilePath:be.parsedFilePath,source:ce,...J}}});const A=Go($e||[]);if(A&&A.length){const be=A.filter(ke=>ke.fromtype==="0"),xe=A.filter(ke=>ke.fromtype==="3");oe=oe.map(ke=>{const Ie=be.map(ce=>{var lt;const he=v.find(re=>String(re.order_num)===String(ce.id));if(!he||!((lt=he==null?void 0:he.metadata)!=null&&lt.source))return null;const He=ke.source||"",W=he.metadata.source||"";return He&&W&&He!==W?null:{id:ce.id||"",index:de(String(ce.id))||ce.indexId||"",image_urls:ce.imageUrls?Array.isArray(ce.imageUrls)?ce.imageUrls:[ce.imageUrls]:ce.image_urls?ce.image_urls.split(";").map(re=>re.trim()).filter(Boolean):[],metadata:he.metadata||{},order_num:he.order_num,parsedFilePath:he.parsedFilePath}}).filter(ce=>ce!==null),J=xe.map(ce=>{var lt;const he=v.find(re=>String(re.order_num)===String(ce.id));if(!he||!((lt=he==null?void 0:he.metadata)!=null&&lt.source))return null;const He=ke.source||"",W=he.metadata.source||"";return He&&W&&He!==W?null:{id:ce.id||"",index:de(String(ce.id))||ce.indexId||"",image_urls:ce.imageUrls?Array.isArray(ce.imageUrls)?ce.imageUrls:[ce.imageUrls]:ce.image_urls?ce.image_urls.split(";").map(re=>re.trim()).filter(Boolean):[],metadata:he.metadata||{},order_num:he.order_num,parsedFilePath:he.parsedFilePath}}).filter(ce=>ce!==null);return{...ke,tags:[...Ie,...J]}})}const L=new Map;return oe.filter(be=>{const xe=(be==null?void 0:be.source)||be.file_name;return xe?L.has(xe)?!1:(L.set(xe,!0),!0):!0}).sort((be,xe)=>Number((xe==null?void 0:xe.score)??0)-Number((be==null?void 0:be.score)??0))},[D,$e,rt,de]),nr=xt(()=>{if(!p)return[];let v=[];try{const L=JSON.parse(p);v=Array.isArray(L)?L:[]}catch{return[]}if(!(v!=null&&v.length))return[];let oe=v.map(L=>{var xe,ke,Ie;const be=(L==null?void 0:L.score)??((xe=L==null?void 0:L.metadata)==null?void 0:xe.score);return{link:(ke=L==null?void 0:L.metadata)==null?void 0:ke.link,file_name:(Ie=L==null?void 0:L.metadata)==null?void 0:Ie.title,score:ji(be),tags:[]}});const A=Go($e||[]);if(A&&A.length){const L=A.filter(be=>be.fromtype==="1");oe=oe.map(be=>{const xe=L.map(ke=>{var J;const Ie=v.find(ce=>String(ce.order_num)===String(ke.id));return!Ie||!((J=Ie==null?void 0:Ie.metadata)!=null&&J.title)||Ie.metadata.title!==be.file_name?null:{id:ke.id||"",index:de(String(ke.id))||ke.indexId||"",image_urls:ke.imageUrls?Array.isArray(ke.imageUrls)?ke.imageUrls:[ke.imageUrls]:ke.image_urls?ke.image_urls.split(";").map(ce=>ce.trim()).filter(Boolean):[],metadata:Ie.metadata||{},order_num:Ie.order_num}}).filter(ke=>ke!==null);return{...be,tags:xe}})}return oe.sort((L,be)=>Number((be==null?void 0:be.score)??0)-Number((L==null?void 0:L.score)??0))},[p,$e,rt,de]),ht=xt(()=>{if(console.log("[ChatMessageAdapter] parseGraphReferenceData - graphReference:",F,"type:",typeof F),!F)return console.log("[ChatMessageAdapter] graphReference \u4E3A\u7A7A\uFF0C\u8FD4\u56DE\u7A7A\u6570\u7EC4"),[];let v=[];try{if(typeof F=="string"){if(F==="[]"||F==="null"||F.trim()==="")return console.log("[ChatMessageAdapter] graphReference \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u8FD4\u56DE\u7A7A\u6570\u7EC4"),[];const L=JSON.parse(F);v=Array.isArray(L)?L:[],console.log("[ChatMessageAdapter] \u89E3\u6790\u5B57\u7B26\u4E32\u683C\u5F0F\u6210\u529F\uFF0Crefs.length:",v.length)}else if(Array.isArray(F))v=F,console.log("[ChatMessageAdapter] graphReference \u662F\u6570\u7EC4\u683C\u5F0F\uFF0Crefs.length:",v.length);else if(typeof F=="object"&&F!==null)v=[F],console.log("[ChatMessageAdapter] graphReference \u662F\u5BF9\u8C61\u683C\u5F0F\uFF0C\u8F6C\u6362\u4E3A\u6570\u7EC4\uFF0Crefs.length:",v.length);else return console.warn("[ChatMessageAdapter] graphReference \u683C\u5F0F\u4E0D\u652F\u6301:",typeof F,F),[]}catch(L){return console.error("[ChatMessageAdapter] Failed to parse graphReference:",L,F),[]}let oe=v.map((L,be)=>{const{metadata:xe,...ke}=L;return{id:L.id||`graph-${be}`,graphName:L.graphName||`\u56FE\u8C31${be+1}`,tags:[],...ke}});const A=Go($e||[]);if(A&&A.length){const L=A.filter(be=>be.fromtype==="2");oe=oe.map(be=>{let xe=[];Array.isArray(be.traceNodes)&&be.traceNodes.length>0?xe=be.traceNodes.map((J,ce)=>({id:J.id,index:de(String(J.id))??ce+1,image_urls:[],metadata:J.metadata||{},...J})):xe=L.filter(J=>String(J.id)===String(be.id)).map(J=>({id:J.id||"",index:de(String(J.id))||J.indexId||"",image_urls:J.imageUrls?Array.isArray(J.imageUrls)?J.imageUrls:[J.imageUrls]:J.image_urls?J.image_urls.split(";").map(ce=>ce.trim()).filter(Boolean):[],metadata:{}}));const ke=new Set,Ie=xe.filter(J=>ke.has(String(J.id))?!1:(ke.add(String(J.id)),!0)).sort((J,ce)=>Number(J.index)-Number(ce.index));return{...be,tags:Ie}})}return oe},[F,$e,rt,de]),gr=xt(()=>{const v=[...Go($e||[]).filter(oe=>oe.imageUrls&&Array.isArray(oe.imageUrls)).flatMap(oe=>oe.imageUrls),...we];return Array.from(new Set(v))},[$e,we]),or=xt(()=>typeof t!="string"?[]:tw(t),[t]),Dr=xt(()=>Array.from(new Set([...gr||[],...or||[]])),[gr,or]),ot=xt(()=>{var v,oe,A,L,be,xe,ke,Ie;if(!B)return null;try{const J=typeof B=="string"?JSON.parse(B):B;if(Array.isArray(J)&&J.length>0){const ce=J[0];if(ce.retrieveSqlData)return{dataFetchUrl:ce.retrieveSqlData.fetchUrl||"/index/knowledgeBase/file/stream",databaseName:ce.retrieveSqlData.databaseName||"\u6570\u636E\u5E93",tableName:ce.retrieveSqlData.tableName||"\u6570\u636E\u8868",total:ce.retrieveSqlData.total||0,type:ce.retrieveSqlData.type||"COLLECTION",preData:{columns:((oe=(v=ce.retrieveSqlData.preData)==null?void 0:v[0])==null?void 0:oe.columns)||[],rows:((L=(A=ce.retrieveSqlData.preData)==null?void 0:A[0])==null?void 0:L.data)||[]}}}return J.retrieveSqlData?{dataFetchUrl:J.retrieveSqlData.fetchUrl||"/index/knowledgeBase/file/stream",databaseName:J.retrieveSqlData.databaseName||"\u6570\u636E\u5E93",tableName:J.retrieveSqlData.tableName||"\u6570\u636E\u8868",total:J.retrieveSqlData.total||0,type:J.retrieveSqlData.type||"COLLECTION",preData:{columns:((xe=(be=J.retrieveSqlData.preData)==null?void 0:be[0])==null?void 0:xe.columns)||[],rows:((Ie=(ke=J.retrieveSqlData.preData)==null?void 0:ke[0])==null?void 0:Ie.data)||[]}}:{dataFetchUrl:J.dataFetchUrl||"/index/knowledgeBase/file/stream",databaseName:J.databaseName||"\u6570\u636E\u5E93",tableName:J.tableName||"\u6570\u636E\u8868",total:J.total||0,type:J.type||"COLLECTION",preData:J.preData||{columns:[],rows:[]}}}catch(J){return console.error("Failed to parse databaseReference:",J),null}},[B]),Er=v=>{const{dataSourceType:oe,databaseName:A,businessTableName:L,tableName:be}=v;return oe==="DataTable"?`${A||"\u6570\u636E\u5E93"} - ${L||"\u6570\u636E\u8868"}`:oe==="DirectDB"?`${A||"\u6570\u636E\u5E93"} - ${be||"\u6570\u636E\u8868"}`:A||L||be||"\u6570\u636E\u5E93"};je.useEffect(()=>{ut(null),ie([])},[K]),je.useEffect(()=>{var A;const v=L=>{try{const be=typeof L=="string"?JSON.parse(L):L;return be?Array.isArray(be)?be:[be]:[]}catch(be){return console.error("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] normalizeDbReferenceList \u5931\u8D25:",be),[]}},oe=(L,be)=>{if(!Array.isArray(L))return[];const xe=be!=null&&be.id?String(be.id):void 0,ke=xe?de(xe):void 0,Ie=xe?yt[xe]:void 0,J=ke??Ie??(be==null?void 0:be.referenceIndex)??void 0,ce=xe&&J!==void 0?[{id:xe,index:J}]:[];return L.map(he=>{var He,W,lt,re;return{...he,id:he.id||xe||he.tableName,referenceId:xe,referenceIndex:J,tags:ce,fetchUrl:he.fetchUrl||((He=be==null?void 0:be.retrieveSqlData)==null?void 0:He.fetchUrl)||(ot==null?void 0:ot.dataFetchUrl)||"",databaseName:he.databaseName||((W=be==null?void 0:be.retrieveSqlData)==null?void 0:W.databaseName)||(ot==null?void 0:ot.databaseName)||"",tableName:he.tableName||((lt=be==null?void 0:be.retrieveSqlData)==null?void 0:lt.tableName)||(ot==null?void 0:ot.tableName)||"",dataSourceType:he.dataSourceType||((re=be==null?void 0:be.retrieveSqlData)==null?void 0:re.type)||(ot==null?void 0:ot.type)||"DataTable"}})};if(B){const L=v(B),be=[];if(L.forEach(xe=>{var ke,Ie,J;if(Array.isArray(xe==null?void 0:xe.retrieveTableDataList)&&xe.retrieveTableDataList.length)be.push(...oe(xe.retrieveTableDataList,xe));else if(Array.isArray((J=(Ie=(ke=xe==null?void 0:xe.retrieveSqlData)==null?void 0:ke.preData)==null?void 0:Ie[0])==null?void 0:J.data)&&xe.retrieveSqlData.preData[0].data.length){const ce={businessTableName:xe.retrieveSqlData.tableName||"\u6570\u636E\u8868",databaseName:xe.retrieveSqlData.databaseName||(ot==null?void 0:ot.databaseName)||"\u6570\u636E\u5E93",tableName:xe.retrieveSqlData.tableName||(ot==null?void 0:ot.tableName)||"\u6570\u636E\u8868",fetchUrl:xe.retrieveSqlData.fetchUrl||(ot==null?void 0:ot.dataFetchUrl)||"",dataSourceType:xe.retrieveSqlData.type||"DirectDB",total:xe.retrieveSqlData.total};be.push(...oe([ce],xe))}}),be.length>0){Ge(be);return}if((A=ot==null?void 0:ot.preData)!=null&&A.rows){const xe=oe(ot.preData.rows,{});Ge(xe);return}console.warn("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] \u672A\u627E\u5230\u53EF\u7528\u7684\u6570\u636E\u5E93\u6570\u636E")}else console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] databaseReference \u4E0D\u5B58\u5728\uFF0C\u6E05\u7A7A databaseData");Ge([])},[B,ot,K,yt,de]);const kr=mt(()=>{try{const v=Array.isArray(rr)?rr:[],oe=Array.isArray(nr)?nr:[],A=Array.isArray(ht)?ht:[],L=Dr,be=Go($e||[]),xe=He=>typeof rt!="string"?!1:new RegExp(`\\[retrive-tag[^\\]]*id=['"]${He}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`,"g").test(rt),ke=He=>{const W=new Map;return He.forEach(lt=>{if(lt.id){const re=String(lt.id);if(!W.has(re))W.set(re,lt);else{const et=W.get(re),kt=Number(lt.index)||0,xr=Number(et.index)||0;(kt<xr||kt===xr&&!et.index)&&W.set(re,lt)}}}),Array.from(W.values())},Ie=v.map(He=>({...He,tags:ke((He.tags||[]).filter(W=>W.id&&xe(String(W.id))))})),J=oe.map(He=>({...He,tags:ke((He.tags||[]).filter(W=>W.id&&xe(String(W.id))))})),ce=A.map(He=>({...He,tags:ke((He.tags||[]).filter(W=>W.id&&xe(String(W.id))))})),he=Me&&Me.length>0?Me.map(He=>({id:He.id||He.tableName||He.referenceId||"",databaseName:He.databaseName||(ot==null?void 0:ot.databaseName)||"",tableName:He.tableName||(ot==null?void 0:ot.tableName)||"",fetchUrl:He.fetchUrl||(ot==null?void 0:ot.dataFetchUrl)||"",score:ji(He.score),tags:He.tags||[],referenceIndex:He.referenceIndex,metadata:He.metadata?{...He.metadata,data:void 0,dataList:void 0,rows:void 0,preData:void 0}:{}})):[];return{queryId:K,knowledgeRefs:Ie,webRefs:J,graphRefs:ce,databaseRefs:he,images:L,raw:{reference:D,webReference:p,graphReference:F,databaseReference:B,retriveNodes:be}}}catch{return{queryId:K,knowledgeRefs:[],webRefs:[],graphRefs:[],databaseRefs:[],images:[],raw:{reference:D,webReference:p,graphReference:F,databaseReference:B,retriveNodes:[]}}}},[rr,nr,ht,ot,Me,Dr,$e,K,D,p,F,B,rt]),Vt=xt(()=>{if(!u)return[];if(Array.isArray(O))return O;if(typeof O=="string"&&O)try{return JSON.parse(O)}catch{return[]}return[]},[u,O]),Jt=()=>{if(!u||Vt.length===0)return null;const v=J=>{if(!J)return"";if(typeof J=="string"&&(J.includes("KB")||J.includes("MB")||J.includes("GB")||J.includes("B")))return J;const ce=typeof J=="string"?parseFloat(J)||0:J;return ce<1024?`${ce}B`:ce<1024*1024?`${(ce/1024).toFixed(1)}KB`:`${(ce/1024/1024).toFixed(1)}MB`},oe=J=>J!=null&&J.status&&(String(J.status).toLowerCase()==="uploading"||String(J.status).toLowerCase()==="parsing")?!1:!!(J!=null&&J.url||J!=null&&J.filePath||J!=null&&J.convertedFilePath),A=Vt.filter(J=>{const ce=(J.name||"").split(".").pop()||"";return["image","jpg","jpeg","png","gif","bmp","webp"].includes(ce.toLowerCase())}),L=Vt.filter(J=>{const ce=(J.name||"").split(".").pop()||"";return!["image","jpg","jpeg","png","gif","bmp","webp"].includes(ce.toLowerCase())}),be=A.filter(oe),xe=A.filter(J=>!oe(J)),ke=L.filter(oe),Ie=L.filter(J=>!oe(J));return ke.length+Ie.length,Z.jsxs("div",{className:"mt-4 mb-4",style:{width:"100%",paddingLeft:u?"0":"1.8rem",paddingRight:u?"1.8rem":"0",display:"flex",flexDirection:"column",alignItems:u?"flex-end":"flex-start"},children:[(be.length>0||xe.length>0)&&Z.jsx(xu,{$theme:se,children:Z.jsxs("div",{className:"gallery-grid",style:{direction:"rtl"},children:[xe.map((J,ce)=>{var he;return Z.jsx("div",{className:"gallery-item",style:{background:"#f5f6fa",display:"flex",alignItems:"center",justifyContent:"center"},children:Z.jsx("div",{className:"animate-spin",style:{width:24,height:24,border:"2px solid #d1d5db",borderTopColor:((he=se.colors)==null?void 0:he.primary)||"#3b82f6",borderRadius:"9999px"}})},`pending-img-${ce}`)}),be.map(J=>Z.jsxs("div",{className:"gallery-item",onClick:()=>{Oe(J.url||J.filePath||null),R==null||R("reference_file:click",{...J,file:J.name,file_type:J.file_type||"image",url:J.url||J.filePath,parse_url:J.parseUrl||J.convertedFilePath,retrieve_tags:J.retrieveTags||[],file_id:J.uid||J.file_id,parsed_file_type:J.parsed_file_type||"image",references:J,type:J.type||"image",isUploadFile:!0,pdfPages:J.pdfPages||0})},children:[Z.jsx("img",{src:J.url||J.filePath,alt:J.name,className:"gallery-image",onError:ce=>{const he=ce.target;he.style.display="none"}}),Z.jsx("div",{className:"gallery-overlay",children:J.name})]},J.uid||J.name))]})}),(ke.length>0||Ie.length>0)&&Z.jsx("div",{style:{display:"flex",flexDirection:"column",marginTop:"6px",alignItems:u?"flex-end":"flex-start",width:"100%"},children:Z.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"flex-end",direction:"ltr",paddingLeft:u?"0":"0.5rem",paddingRight:u?"0.5rem":"0",justifyContent:"flex-end",width:"100%",maxWidth:"100%"},children:[Ie.map((J,ce)=>{const he=(J.name||"").split(".").pop()||"",He=yu(he,C,18);return Z.jsxs("div",{className:"group gap-x-3 items-center file-display-card relative flex w-[240px] bg-white border border-gray-200 rounded-lg shadow-sm px-3 py-2.5 transition-all",children:[Z.jsx("div",{className:"pt-0.5 flex-shrink-0",style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:Z.jsx("div",{style:{transform:"scale(1.2)",transformOrigin:"center"},children:He})}),Z.jsx("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:Z.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[Z.jsx("div",{style:{height:"13px",borderRadius:"4px",backgroundColor:"#d1d5db",width:"140px"}}),Z.jsx("div",{style:{height:"12px",borderRadius:"4px",backgroundColor:"#d1d5db",width:"40px"}})]})})]},`pending-doc-${J.uid||ce}`)}),ke.map(J=>{var lt;const ce=(J.name||"").split(".").pop()||"",he=J.size??((lt=J.file)==null?void 0:lt.size)??J.fileSize,He=v(he),W=yu(ce,C,18);return Z.jsxs("div",{className:"group gap-x-3 items-center file-display-card relative flex w-[240px] min-h-[56px] bg-white border border-gray-200 rounded-lg shadow-sm px-3 py-2.5 transition-all hover:shadow-md hover:border-blue-300",style:{cursor:"pointer"},title:J.name,onClick:()=>{R==null||R("reference_file:click",{...J,file:J.name,file_type:J.file_type||ce,url:J.url||J.filePath,parse_url:J.parseUrl||J.convertedFilePath,retrieve_tags:J.retrieveTags||[],file_id:J.uid||J.file_id,parsed_file_type:J.parsed_file_type||ce,references:J,type:J.type||"file",isUploadFile:!0,pdfPages:J.pdfPages||0})},children:[Z.jsx("div",{style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:Z.jsx("div",{style:{transform:"scale(1.65)",marginBottom:"4px",transformOrigin:"center"},children:W})}),Z.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[Z.jsx("div",{className:"flex",children:Z.jsx("div",{className:"flex items-center justify-between gap-1.5",children:Z.jsx("span",{className:"text-[13px] font-medium truncate max-w-[140px]",title:J.name,children:J.name})})}),Z.jsx("div",{className:" text-[12px] text-gray-400 whitespace-nowrap",children:He})]})]},J.uid||J.name)})]})})]})},Ot=()=>{var ce;if(u)return null;console.log("[ChatMessageAdapter] renderReferences \u5F00\u59CB - referenceMode:",te),console.log("[ChatMessageAdapter] renderReferences - graphReference \u539F\u59CB\u503C:",F),console.log("[ChatMessageAdapter] renderReferences - parseGraphReferenceData:",ht);const v=Array.isArray(rr)?rr:[],oe=Array.isArray(nr)?nr:[],A=Array.isArray(ht)?ht:[];console.log("[ChatMessageAdapter] renderReferences - knowledgeList:",v.length,"webList:",oe.length,"graphList:",A.length),console.log("[ChatMessageAdapter] renderReferences - graphList \u8BE6\u60C5:",A);const L=v.length>0&&j!==5,be=oe.length>0,xe=A.length>0;console.log("[ChatMessageAdapter] renderReferences - hasKnowledgeRefs:",L,"hasWebRefs:",be,"hasGraphRefs:",xe);const ke=Dr.length>0,Ie=Me&&Me.length>0,J=L||be||xe||ke||Ie;if(console.log("[ChatMessageAdapter] renderReferences - hasAny:",J),console.log("[\u5F15\u7528\u6E32\u67D3] databaseReference:",B),console.log("[\u5F15\u7528\u6E32\u67D3] databaseData:",Me),console.log("[\u5F15\u7528\u6E32\u67D3] databaseData.length:",Me==null?void 0:Me.length),console.log("[\u5F15\u7528\u6E32\u67D3] hasDatabaseRefs:",Ie),te==="button"){if(console.log("[ChatMessageAdapter] referenceMode === button, hasAny:",J),!J)return console.log("[ChatMessageAdapter] hasAny \u4E3A false\uFF0C\u4E0D\u6E32\u67D3\u5F15\u7528"),null;const he=L&&(v==null?void 0:v.length)||0,He=be&&(oe==null?void 0:oe.length)||0,W=xe&&(A==null?void 0:A.length)||0,lt=Ie&&(Me==null?void 0:Me.length)||0;let re=he+He+W+lt;return re===0&&ke&&(re=1),Z.jsxs(Z.Fragment,{children:[ke&&Z.jsx(xu,{$theme:se,children:Z.jsx("div",{className:"gallery-grid",children:Dr.map((et,kt)=>Z.jsxs("div",{className:"gallery-item",onClick:()=>{Oe(et),R==null||R("reference_file:click",{file:`\u56FE${kt+1}`,file_type:"image",url:et,parse_url:et,retrieve_tags:[],references:{url:et},type:"image",isUploadFile:!1})},children:[Z.jsx("img",{src:et,alt:`\u56FE${kt+1}`,className:"gallery-image",onError:xr=>{const _t=xr.target;_t.style.display="none"}}),Z.jsxs("div",{className:"gallery-overlay",children:["\u56FE",kt+1]})]},et+kt))})}),Z.jsx("div",{style:{padding:"6px 2.9rem"},children:Z.jsxs("button",{style:{cursor:"pointer",color:((ce=se.colors)==null?void 0:ce.textDisabled)||"#86909C"},className:"text-sm flex items-center gap-x-1 px-3 py-1 rounded border border-gray-200 hover:border-blue-300 transition-colors",onClick:()=>{const et=kr();R==null||R("references:click",et)},onMouseEnter:et=>{var kt;et.currentTarget.style.color=((kt=se.colors)==null?void 0:kt.primary)||"#3b82f6"},onMouseLeave:et=>{var kt;et.currentTarget.style.color=((kt=se.colors)==null?void 0:kt.textDisabled)||"#86909C"},children:[Z.jsx(VC,{size:16}),Z.jsxs("span",{children:["\u77E5\u8BC6\u6EAF\u6E90",re?` ${re}`:""]}),Z.jsx(HC,{size:16})]})})]})}return J?Z.jsxs(Z.Fragment,{children:[ke&&Z.jsx(xu,{$theme:se,children:Z.jsx("div",{className:"gallery-grid",children:Dr.map((he,He)=>Z.jsxs("div",{className:"gallery-item",onClick:()=>{Oe(he),R==null||R("reference_file:click",{file:`\u56FE${He+1}`,file_type:"image",url:he,parse_url:he,retrieve_tags:[],references:{url:he},type:"image",isUploadFile:!1})},children:[Z.jsx("img",{src:he,alt:`\u56FE${He+1}`,className:"gallery-image",onError:W=>{const lt=W.target;lt.style.display="none"}}),Z.jsxs("div",{className:"gallery-overlay",children:["\u56FE",He+1]})]},he+He))})}),L&&Z.jsxs(_i,{$theme:se,children:[Z.jsx("div",{className:"reference-title justify-between items-center flex",children:Z.jsxs("div",{className:"flex items-center gap-2",children:[Z.jsx("span",{className:"text-[#374151]",children:"\u77E5\u8BC6\u5E93\u6587\u6863\u5F15\u7528"}),Z.jsx("span",{className:"text-[#b4b4b4] text-xs",children:` (${v.length})`}),v.length>2&&Z.jsx("div",{onClick:()=>pe(!ee),className:"cursor-pointer hover:text-[#86909C] transition-colors",children:ee?Z.jsx(zi,{size:16,className:"text-[#b4b4b4]"}):Z.jsx(Ii,{size:16,className:"text-[#b4b4b4]"})})]})}),Z.jsx("div",{className:"reference-list",children:(ee?v:v.slice(0,2)).map((he,He)=>he&&Z.jsx("div",{className:"reference-item",children:Z.jsxs("div",{className:"file-info flex items-end gap-2",children:[Z.jsx("div",{className:"flex-shrink-0",children:(()=>{const W=he.file_type||(he.file_name||"").split(".").pop()||"pdf",lt=(he.file_name||"").split(".").pop()||"file";return W==="video"||["mp4","avi","mov","wmv","flv","webm","mkv"].includes(W)?Z.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center bg-red-100",children:Z.jsx(GC,{size:16,className:"text-red-600"})}):Z.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center",children:yu(lt,C,16)})})()}),Z.jsx("div",{className:"flex-1 min-w-0",children:Z.jsx("div",{className:"text-sm w-[250px] font-medium text-gray-900 truncate hover:text-blue-600 cursor-pointer",onClick:W=>{W.stopPropagation(),R==null||R("knowledge_referenceFile_title:click",{data:{...he,file_type:he.file_type,file_name:he.file_name,metadata:he.metadata,parsedFilePath:he.parsedFilePath}})},children:he.file_name})}),Z.jsx("div",{className:"flex items-center gap-1",children:(()=>{const W=new Set,lt=(he.tags||[]).filter(et=>W.has(et.id)?!1:(W.add(et.id),!0)).sort((et,kt)=>Number(et.index)-Number(kt.index)),re=et=>{if(typeof rt!="string")return et;const kt=new RegExp(`\\[retrive-tag[^\\]]*id=['"]${et}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`,"g").exec(rt);return kt?kt[1]:et};return lt.slice(0,10).map(et=>Z.jsx("span",{className:"w-6 h-6 bg-[#e6f7ff] text-[#1890ff] rounded text-xs font-medium flex items-center justify-center cursor-pointer hover:bg-orange-200 transition-colors",onClick:kt=>{kt.stopPropagation();const xr=Le(he,et.id),_t=he.file_type==="video"?"3":"0";R==null||R("retrive_tag:click",{tagInfo:xr||he,fromtype:_t,leaf:{id:et.id,fromtype:_t},attributes:{}})},children:re(et.id)},et.id))})()}),typeof he.score=="number"&&Z.jsxs("div",{className:"text-sm text-gray-600",children:["\u5206\u6570: ",Number(he.score).toFixed(2)]}),he.file_type!=="video"&&Z.jsxs("div",{className:"flex items-center gap-2",children:[Z.jsx(WC,{size:16,className:"text-gray-400 hover:text-blue-600 transition-colors",style:{cursor:e?"pointer":"not-allowed"},onClick:W=>{e&&(W.stopPropagation(),R==null||R("referenceFile_download",{data:{...he,file_type:he.file_type,file_name:he.file_name,metadata:he.metadata,parsedFilePath:he.parsedFilePath}}))}}),Z.jsx("div",{className:"w-px h-4 bg-gray-300"}),Z.jsx(UC,{size:16,className:"text-gray-400 hover:text-blue-600 transition-colors",onClick:W=>{W.stopPropagation(),R==null||R("referenceFile_filechat",{data:{...he,file_type:he.file_type,file_name:he.file_name,metadata:he.metadata,parsedFilePath:he.parsedFilePath}})}})]})]})},he.file_id||He))})]}),Ie&&Z.jsxs(_i,{$theme:se,children:[Z.jsx("div",{className:"reference-title justify-between items-center flex",children:Z.jsxs("div",{className:"flex items-center gap-2",children:[Z.jsx("span",{className:"text-[#374151]",children:"\u6570\u636E\u5E93\u5F15\u7528"}),Z.jsx("span",{className:"text-[#b4b4b4] text-xs",children:` (${Me.length||0})`}),Me.length>2&&Z.jsx("div",{onClick:()=>Ce(!De),className:"cursor-pointer hover:text-[#86909C] transition-colors",children:De?Z.jsx(zi,{size:16,className:"text-[#b4b4b4]"}):Z.jsx(Ii,{size:16,className:"text-[#b4b4b4]"})})]})}),Z.jsx("div",{className:"reference-list",children:(De?Me:Me.slice(0,2)).map((he,He)=>Z.jsx("div",{className:"reference-item",children:Z.jsxs("div",{className:"file-info flex items-end gap-2",children:[Z.jsx("div",{className:"flex-shrink-0",children:Z.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center",children:Z.jsx(qC,{size:20,className:"text-blue-600"})})}),Z.jsx("div",{className:"flex-1 min-w-0",children:Z.jsx("div",{className:"text-sm w-[250px] font-medium text-gray-900 truncate hover:text-blue-600 cursor-pointer",onClick:W=>{W.stopPropagation(),R==null||R("database_referenceFile_title:click",{data:{...he,file_type:"database",file_name:Er(he),metadata:he,parsedFilePath:he.fetchUrl||(ot==null?void 0:ot.dataFetchUrl)||"",file:he.databaseName||"database",url:he.fetchUrl||(ot==null?void 0:ot.dataFetchUrl)||"",parse_url:he.fetchUrl||(ot==null?void 0:ot.dataFetchUrl)||"",retrieve_tags:he.tags||[],references:he,type:"database",isUploadFile:!1}})},children:Er(he)})}),Z.jsx("div",{className:"flex items-center gap-1",children:(Array.isArray(he.tags)&&he.tags.length?he.tags:[{id:he.referenceId||`database-${He}`,index:he.referenceIndex??He+1}]).map(W=>Z.jsx("span",{className:"w-6 h-6 bg-orange-100 text-orange-600 rounded text-xs font-medium flex items-center justify-center cursor-pointer hover:bg-orange-200 transition-colors",children:W.index??He+1},`${W.id||"database"}-${W.index}`))}),typeof he.score=="number"&&Z.jsxs("div",{className:"text-sm text-gray-600",children:["\u5206\u6570: ",Number(he.score).toFixed(2)]})]})},he.tableName||He))})]}),be&&Z.jsxs(_i,{$theme:se,children:[Z.jsx("div",{className:"reference-title justify-between items-center flex",children:Z.jsxs("div",{className:"flex items-center gap-2",children:[Z.jsx("span",{className:"text-[#374151]",children:"\u4E92\u8054\u7F51\u641C\u7D22\u5F15\u7528"}),Z.jsx("span",{className:"text-[#b4b4b4] text-xs",children:` (${oe.length})`}),oe.length>2&&Z.jsx("div",{onClick:()=>ue(!le),className:"cursor-pointer hover:text-[#86909C] transition-colors",children:le?Z.jsx(zi,{size:16,className:"text-[#b4b4b4]"}):Z.jsx(Ii,{size:16,className:"text-[#b4b4b4]"})})]})}),Z.jsx("div",{className:"reference-list",children:(le?oe:oe.slice(0,2)).map((he,He)=>Z.jsx("div",{className:"reference-item",children:Z.jsxs("div",{className:"file-info flex items-end gap-2",children:[Z.jsx("div",{className:"flex-shrink-0",children:Z.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center",children:Z.jsx(rs,{type:"rag/netretrive",size:32,className:"text-green-600"})})}),Z.jsx("div",{className:"flex-1 min-w-0",children:Z.jsx("div",{className:"text-sm w-[250px] font-medium text-gray-900 truncate hover:text-blue-600 cursor-pointer",onClick:W=>{W.stopPropagation(),R==null||R("web_referenceFile_title:click",{data:{...he,file_type:he.file_type,file_name:he.file_name,metadata:he.metadata,parsedFilePath:he.parsedFilePath,file:he.file_name,url:he.link,parse_url:he.link,retrieve_tags:he.tags||[],references:he,type:"file",isUploadFile:!1}})},children:he.file_name})}),Z.jsx("div",{className:"flex items-center gap-1",children:(()=>{const W=new Set,lt=(he.tags||[]).filter(et=>W.has(et.id)?!1:(W.add(et.id),!0)).sort((et,kt)=>Number(et.index)-Number(kt.index)),re=et=>{if(typeof rt!="string")return et;const kt=new RegExp(`\\[retrive-tag[^\\]]*id=['"]${et}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`,"g").exec(rt);return kt?kt[1]:et};return lt.slice(0,1).map(et=>Z.jsx("span",{className:"w-6 h-6 bg-[#f6ffed] text-[#52c41a] rounded text-xs font-medium flex items-center justify-center cursor-pointer hover:bg-orange-200 transition-colors",onClick:kt=>{kt.stopPropagation();const xr=Le(he,et.id);R==null||R("retrive_tag:click",{tagInfo:xr||he,fromtype:"1",leaf:{id:et.id,fromtype:"1"},attributes:{}})},children:re(et.id)},et.id))})()}),typeof he.score=="number"&&Z.jsxs("div",{className:"text-sm text-gray-600",children:["\u5206\u6570: ",Number(he.score).toFixed(2)]})]})},(he.link||"")+He))})]}),xe&&Z.jsxs(_i,{$theme:se,children:[Z.jsx("div",{className:"reference-title justify-between items-center flex",children:Z.jsxs("div",{className:"flex items-center gap-2",children:[Z.jsx("span",{className:"text-[#374151]",children:"\u56FE\u8C31\u5F15\u7528"}),Z.jsx("span",{className:"text-[#b4b4b4] text-xs",children:` (${A.length})`}),A.length>2&&Z.jsx("div",{onClick:()=>Fe(!Ee),className:"cursor-pointer hover:text-[#86909C] transition-colors",children:Ee?Z.jsx(zi,{size:16,className:"text-[#b4b4b4]"}):Z.jsx(Ii,{size:16,className:"text-[#b4b4b4]"})})]})}),Z.jsx("div",{className:"reference-list",children:(Ee?A:A.slice(0,2)).map((he,He)=>Z.jsx("div",{className:"reference-item",children:Z.jsxs("div",{className:"file-info flex items-end gap-2",children:[Z.jsx("div",{className:"flex-shrink-0",children:Z.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center",children:Z.jsx("div",{className:"w-6 h-6 bg-purple-100 text-purple-600 rounded text-xs font-medium flex items-center justify-center",children:"\u56FE"})})}),Z.jsx("div",{className:"flex-1 min-w-0",children:Z.jsx("div",{className:"text-sm w-[250px] font-medium text-gray-900 truncate",children:he.graphName||`\u56FE\u8C31${He+1}`})}),Z.jsx("div",{className:"flex items-center gap-1",children:(()=>{const W=new Set,lt=(he.tags||[]).filter(et=>W.has(et.id)?!1:(W.add(et.id),!0)).sort((et,kt)=>Number(et.index)-Number(kt.index)),re=et=>{if(typeof rt!="string")return null;const kt=new RegExp(`\\[retrive-tag[^\\]]*id=['"]${et}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`,"g").exec(rt);return kt?kt[1]??null:null};return lt.map(et=>({tag:et,num:re(et.id)})).filter(et=>et.num!==null&&et.num!==void 0&&et.num!=="").slice(0,10).map(({tag:et,num:kt})=>Z.jsx("span",{className:"w-6 h-6 bg-purple-100 text-purple-600 rounded text-xs font-medium flex items-center justify-center cursor-pointer hover:bg-purple-200 transition-colors",onClick:xr=>{xr.stopPropagation();const _t=Array.isArray(he.traceNodes)?he.traceNodes.find(st=>String(st==null?void 0:st.id)===String(et.id)):void 0;R==null||R("retrive_tag:click",{tagInfo:{id:et.id,index:et.index,image_urls:et.image_urls||[]},fromtype:"2",graph:{id:he.id,graphName:he.graphName,fetchUrl:he.fetchUrl,cyphers:he.cyphers},traceNode:_t})},children:kt},et.id))})()})]})},he.id||He))})]})]}):null},x=()=>u||!V||!H||H.length===0?null:Z.jsx(lw,{$theme:se,children:Z.jsx("div",{className:"follow-up-list",children:H.map((v,oe)=>Z.jsx("div",{className:"follow-up-item",style:{animationDelay:`${oe*260}ms`},onClick:()=>{R==null||R("chatbox:follow_up_question_click",{question:v,queryId:K})},children:v},`${String(v)}-${oe}`))})});return Z.jsxs(nw,{$align:n,$isUser:u,children:[Z.jsxs(ow,{$isUser:u,children:[Z.jsx(aw,{$src:Qt,$isUser:u}),ye&&Z.jsx("div",{className:"message-time px-2 text-sm text-[#888888]",children:ye})]}),Jt(),Z.jsx(iw,{$isUser:u,$theme:se,children:Z.jsx("div",{className:"message-card",children:Z.jsx("div",{className:"message-text",children:r==="stream"?Z.jsxs(Z.Fragment,{children:[!u&&ze(),Z.jsx(mc,{dataSource:{type:Bs.MARKDOWN,content:rt},styles:{letterSpacing:C==null?void 0:C.letterSpacing,lineHeight:C==null?void 0:C.lineHeight,templateField:C==null?void 0:C.templateField,text:C==null?void 0:C.text},theme:{...C==null?void 0:C.theme,baseFontSize:16,minHeight:"60px"},onRetriveTagClick:Ve,eventsEmit:R,extraProps:pt},`md-${(rt||"").length}-think-${Be}`)]}):Z.jsx("div",{style:{whiteSpace:"pre-wrap"},children:gt})})})}),Ot(),!u&&Zt(),x(),typeof document<"u"&&E4(Z.jsx(uw,{$show:me!==null,onClick:()=>Oe(null),children:me&&Z.jsxs("div",{className:"modal-content",onClick:v=>v.stopPropagation(),children:[Z.jsx("img",{src:me,alt:"\u9884\u89C8\u56FE\u7247",className:"modal-image"}),Z.jsx("button",{className:"modal-close",onClick:()=>Oe(null),children:"\u5173\u95ED"})]})}),document.body)]})},cw=tr.div`
1207
- position: relative;
1208
- width: 100%;
1209
- height: 100%;
1210
- overflow: ${e=>e.$isVirtualized?"hidden":"auto"};
1211
- background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"#ffffff"}};
1212
- border-radius: ${e=>{var t;return((t=e.theme)==null?void 0:t.borderRadius)||"8px"}};
1213
-
1214
- /* 自定义滚动条 */
1215
- &::-webkit-scrollbar {
1216
- width: 8px;
1217
- }
1218
-
1219
- &::-webkit-scrollbar-track {
1220
- background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarTrack)||"#f1f1f1"}};
1221
- border-radius: 4px;
1222
- }
1223
-
1224
- &::-webkit-scrollbar-thumb {
1225
- background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarThumb)||"#c1c1c1"}};
1226
- border-radius: 4px;
1227
-
1228
- &:hover {
1229
- background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarThumbHover)||"#a8a8a8"}};
1230
- }
1231
- }
1232
- `,dw=tr.div`
1233
- position: relative;
1234
- width: 100%;
1235
- height: 100%;
1236
- overflow: auto;
1237
- background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"#ffffff"}};
1238
-
1239
- /* 自定义滚动条 */
1240
- &::-webkit-scrollbar {
1241
- width: 8px;
1242
- }
1243
-
1244
- &::-webkit-scrollbar-track {
1245
- background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarTrack)||"#f1f1f1"}};
1246
- border-radius: 4px;
1247
- }
1248
-
1249
- &::-webkit-scrollbar-thumb {
1250
- background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarThumb)||"#c1c1c1"}};
1251
- border-radius: 4px;
1252
-
1253
- &:hover {
1254
- background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarThumbHover)||"#a8a8a8"}};
1255
- }
1256
- }
1257
- `,Np=tr.div`
1258
- padding: ${e=>{var t;return((t=e.theme)==null?void 0:t.padding)||"1rem"}};
1259
- min-height: ${e=>e.height||"auto"};
1260
-
1261
- /* 富文本内容样式增强 */
1262
- & h1, & h2, & h3, & h4, & h5, & h6 {
1263
- scroll-margin-top: 2rem;
1264
- }
1265
-
1266
- & img {
1267
- max-width: 100%;
1268
- height: auto;
1269
- border-radius: 0.5rem;
1270
- margin: 1rem 0;
1271
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
1272
- transition: transform 0.2s ease-in-out;
1273
-
1274
- &:hover {
1275
- transform: scale(1.02);
1276
- }
1277
- }
1278
-
1279
- /* 表格样式 - 主题感知 */
1280
- & .table-container {
1281
- overflow: auto;
1282
- border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#e5e7eb"}};
1283
- border-radius: 6px;
1284
- margin: 1rem 0;
1285
- background: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"transparent"}};
1286
- }
1287
-
1288
- & .table-container table {
1289
- width: 100%;
1290
- border-collapse: collapse;
1291
- background: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"transparent"}};
1292
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
1293
- }
1294
-
1295
- & .table-container th,
1296
- & .table-container td {
1297
- border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#e5e7eb"}};
1298
- padding: 8px 12px;
1299
- text-align: left;
1300
- }
1301
-
1302
- & .table-container th {
1303
- background: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
1304
- font-weight: 600;
1305
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
1306
- }
1307
-
1308
- & .table-container td {
1309
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
1310
- }
1311
-
1312
- & .table-container tr:nth-child(even) {
1313
- background: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
1314
- }
1315
-
1316
- & pre {
1317
- position: relative;
1318
-
1319
- &::before {
1320
- content: '';
1321
- position: absolute;
1322
- top: 0;
1323
- left: 0;
1324
- right: 0;
1325
- height: 2px;
1326
- background: linear-gradient(90deg, #007bff, #28a745, #ffc107, #dc3545);
1327
- border-radius: 2px 2px 0 0;
1328
- }
1329
- }
1330
-
1331
- & blockquote {
1332
- position: relative;
1333
-
1334
- &::before {
1335
- content: '"';
1336
- position: absolute;
1337
- top: -0.5rem;
1338
- left: -1rem;
1339
- font-size: 3rem;
1340
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.primaryColor)||"#007bff"}};
1341
- opacity: 0.3;
1342
- }
1343
- }
1344
-
1345
-
1346
- `,fw=tr.div`
1347
- display: flex;
1348
- align-items: center;
1349
- justify-content: center;
1350
- padding: 2rem;
1351
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#6c757d"}};
1352
- font-size: 0.875rem;
1353
-
1354
- &::before {
1355
- content: '';
1356
- width: 20px;
1357
- height: 20px;
1358
- border: 2px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#dee2e6"}};
1359
- border-top: 2px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.primaryColor)||"#007bff"}};
1360
- border-radius: 50%;
1361
- animation: spin 1s linear infinite;
1362
- margin-right: 0.5rem;
1363
- }
1364
-
1365
- @keyframes spin {
1366
- 0% { transform: rotate(0deg); }
1367
- 100% { transform: rotate(360deg); }
1368
- }
1369
- `,hw=tr.div`
1370
- display: flex;
1371
- flex-direction: column;
1372
- align-items: center;
1373
- justify-content: center;
1374
- padding: 3rem;
1375
- color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#6c757d"}};
1376
- text-align: center;
1377
-
1378
- &::before {
1379
- content: '📄';
1380
- font-size: 3rem;
1381
- margin-bottom: 1rem;
1382
- }
1383
- `,pw=({dataSource:e,enableVirtualScroll:t=!1,itemHeight:r=200,preloadCount:n=5,enableSegmentedLoading:o=!1,onLoadMore:a,isLoadingMore:u=!1,size:c="sm",basePath:f,theme:d={},onChange:m,onScroll:b,onScrollToTop:g,onScrollToBottom:w,onSegmentClick:C,className:D,style:p,height:B="100%"})=>{const F=Os(),S=xt(()=>{var De,Ce,Ee,Fe,Be,Ne,ze,Me,Ge;return{primaryColor:(d==null?void 0:d.primaryColor)||((De=F==null?void 0:F.colors)==null?void 0:De.primary)||"#007bff",secondaryColor:(d==null?void 0:d.secondaryColor)||((Ce=F==null?void 0:F.colors)==null?void 0:Ce.secondary)||"#6c757d",backgroundColor:(d==null?void 0:d.backgroundColor)||((Ee=F==null?void 0:F.colors)==null?void 0:Ee.background)||"#ffffff",textColor:(d==null?void 0:d.textColor)||((Fe=F==null?void 0:F.colors)==null?void 0:Fe.text)||"#24292f",borderColor:(d==null?void 0:d.borderColor)||((Be=F==null?void 0:F.colors)==null?void 0:Be.border)||"#dee2e6",disabledBackground:(d==null?void 0:d.disabledBackground)||((Ne=F==null?void 0:F.colors)==null?void 0:Ne.disabledBackground)||"#f8f9fa",hoverBackground:(d==null?void 0:d.hoverBackground)||((ze=F==null?void 0:F.colors)==null?void 0:ze.hoverBackground)||"#e9ecef",borderRadius:(d==null?void 0:d.borderRadius)||((Me=F==null?void 0:F.space)==null?void 0:Me.radius)||"8px",padding:(d==null?void 0:d.padding)||((Ge=F==null?void 0:F.space)==null?void 0:Ge.padding)||"1rem",scrollbarTrack:(d==null?void 0:d.scrollbarTrack)||"#f1f1f1",scrollbarThumb:(d==null?void 0:d.scrollbarThumb)||"#c1c1c1",scrollbarThumbHover:(d==null?void 0:d.scrollbarThumbHover)||"#a8a8a8",...d}},[F,d]),O=It(0);O.current+=1,console.log("[Markdownit] render count:",O.current);const[M,_]=Pt([]),[z,K]=Pt({start:0,end:10}),[$,Q]=Pt(0),[V,X]=Pt(0),[G,j]=Pt(!1),[H,U]=Pt(!1),[R,te]=Pt(!1),q=It(null),se=It(null),ye=It(null),we=xt(()=>Array.isArray(e)?e:[{id:"single",content:e.content,type:e.type,timestamp:Date.now()}],[e]);lr(()=>{console.log("[Markdownit] setSegments by processedData, len:",Array.isArray(we)?we.length:"n/a"),_(we)},[we]);const ie=xt(()=>t?`${M.length*r}px`:"auto",[M.length,r,t]),me=xt(()=>{if(!t)return M;const De=Math.max(0,z.start-n),Ce=Math.min(M.length,z.end+n);return M.slice(De,Ce).map((Ee,Fe)=>({...Ee,virtualIndex:De+Fe}))},[M,z,t,n]),Oe=mt(De=>{const{scrollTop:Ce,scrollHeight:Ee,clientHeight:Fe}=De.currentTarget;console.log("[Markdownit] onScroll fired",{newScrollTop:Ce,scrollHeight:Ee,clientHeight:Fe});const Be=!t&&!b&&!g&&!w&&!o;if(console.log("[Markdownit] passiveOnly:",Be),Be||Q(Ne=>Ne!==Ce?(console.log("[Markdownit] setScrollTop:",Ce),Ce):Ne),t&&!Be){const Ne=Math.floor(Ce/r),ze=Math.min(M.length,Ne+Math.ceil(V/r)+1);K(Me=>Me.start!==Ne||Me.end!==ze?(console.log("[Markdownit] setVisibleRange:",{start:Ne,end:ze}),{start:Ne,end:ze}):Me)}if(!Be){const Ne=Ce<=10;Ne!==H&&(console.log("[Markdownit] isAtTop ->",Ne),U(Ne),Ne&&g&&(console.log("[Markdownit] onScrollToTop callback"),g()))}if(!Be){const Ne=Ce+Fe>=Ee-10;Ne!==R&&(console.log("[Markdownit] isAtBottom ->",Ne),te(Ne),Ne&&w&&(console.log("[Markdownit] onScrollToBottom callback"),w()))}b&&(console.log("[Markdownit] onScroll callback ->",{newScrollTop:Ce,scrollHeight:Ee}),b(Ce,Ee)),o&&a&&!G&&!u&&Ee-Ce-V<100&&ee()},[t,r,M.length,V,o,a,G,u,H,R,g,w,b]),ee=mt(async()=>{if(!(!a||G||u)){j(!0);try{const De=M[M.length-1],Ce=await a(De.id);_(Ee=>[...Ee,...Ce])}catch(De){console.error("Failed to load more segments:",De)}finally{j(!1)}}},[a,M,G,u]);lr(()=>{const De=()=>{q.current&&X(q.current.clientHeight)};return De(),window.addEventListener("resize",De),()=>window.removeEventListener("resize",De)},[]);const pe=mt((De,Ce)=>{const Ee={type:De.type,content:De.content},Fe=t?{position:"absolute",top:`${(De.virtualIndex||Ce)*r}px`,left:0,right:0,height:`${r}px`}:{};return Z.jsx("div",{style:Fe,onClick:()=>C==null?void 0:C(De.id,De),className:C?"cursor-pointer hover:bg-gray-50":"",children:Z.jsx(mc,{dataSource:Ee,isEditing:!1,size:c,basePath:f,theme:S,onChange:m,style:{border:"none",background:"transparent",minHeight:t?`${r}px`:"auto",padding:"0.5rem"}})},De.id)},[t,r,S,m,C]),le=()=>(console.log("[Markdownit] renderContent segments.len:",M.length,"enableVirtualScroll:",t),M.length===0?Z.jsxs(hw,{theme:S,children:[Z.jsx("h3",{children:"\u6682\u65E0\u5185\u5BB9"}),Z.jsx("p",{children:"\u8BF7\u6DFB\u52A0\u4E00\u4E9B\u5185\u5BB9\u6765\u5F00\u59CB"})]}):t?Z.jsx("div",{ref:ye,style:{height:ie,position:"relative"},children:me.map(pe)}):Z.jsx("div",{ref:ye,children:M.map(pe)})),ue=()=>!G&&!u?null:Z.jsx(fw,{theme:S,children:u?"\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9...":"\u52A0\u8F7D\u4E2D..."});return Z.jsx(cw,{ref:q,theme:S,$isVirtualized:t,className:D,style:{height:B,...p},children:t?Z.jsx(dw,{ref:se,theme:S,onScroll:Oe,children:Z.jsx(Np,{theme:S,height:ie,children:le()})}):Z.jsxs(Np,{theme:S,onScroll:Oe,children:[le(),ue()]})})},kw=e=>{const{onRendered:t}=e;return lr(()=>{if(!t)return;const r=requestAnimationFrame(()=>{const n=document.querySelector('[data-markdownit-root="1"]');n&&(console.log("[Markdownit _onRendered] fired"),t(n))});return()=>cancelAnimationFrame(r)},[e.dataSource,e.enableVirtualScroll,t]),Z.jsx("div",{"data-markdownit-root":"1",children:Z.jsx(pw,{...e})})};tr.div`
1384
- background: #f6f8fa;
1385
- border: 1px solid #d0d7de;
1386
- border-radius: 6px;
1387
- padding: 16px;
1388
- margin-bottom: 20px;
1389
- `;tr.p`
1390
- margin: 0 0 16px 0;
1391
- color: #656d76;
1392
- font-size: 14px;
1393
- line-height: 1.5;
1394
- `;const Op=e=>{if(!e||e.trim()==="")return[{type:"paragraph",children:[{text:""}]}];const t=/<template\b([^>]*)>([\s\S]*?)<\/template>/g,r=[];let n=0,o,a=0;for(console.log("\u5F00\u59CB\u89E3\u6790\u6A21\u677F\u5B57\u7B26\u4E32:",e);(o=t.exec(e))!==null;){const u=o[0],c=o[1]||"",f=(o[2]||"").trim(),d=o.index,m=d+u.length;if(d>n){const B=e.slice(n,d);B.trim()!==""&&(r.push({text:B}),console.log("\u6DFB\u52A0\u6587\u672C\u5143\u7D20:",{text:B}))}const b=B=>{const F=new RegExp(`${B}\\s*=\\s*(["'])((?:\\\\.|[^\\
1395
- ])*?)\\1`,"i"),S=c.match(F);return S?S[2]:void 0},g=/\S/.test(c),w=b("key"),C=b("placeholder"),D=w||`template-${Date.now()}-${a++}`,p={type:"template",key:D,placeholder:g?C||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9":f||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9",value:g?f:"",style:"blue",fieldId:D,children:[{text:""}],inline:!0};r.push(p),console.log("\u6DFB\u52A0template\u5143\u7D20:",p),n=m}if(n<e.length){const u=e.slice(n);u.trim()!==""&&(r.push({text:u}),console.log("\u6DFB\u52A0\u6700\u540E\u6587\u672C\u5143\u7D20:",{text:u}))}return r.length===0&&(e.trim()===""?r.push({text:""}):r.push({text:e}),console.log("\u6CA1\u6709\u627E\u5230template\u6807\u7B7E\uFF0C\u8FD4\u56DE\u539F\u59CB\u6587\u672C")),r.length>0&&r[0].type!=="paragraph"?[{type:"paragraph",children:r}]:(console.log("\u89E3\u6790\u5B8C\u6210\uFF0C\u7ED3\u679C:",r),r)},Cu=e=>{if(!e||e.length===0)return"";const t=e[0];if(!t.children)return t.text||"";let r="",n="";return console.log("\u8F6C\u6362Slate\u6570\u636E:",JSON.stringify(e,null,2)),t.children.forEach(o=>{if(console.log("\u5904\u7406\u5B50\u5143\u7D20:",o),o.type==="template"){const a=o.key||o.fieldId||"",u=o.placeholder||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9",c=o.value||"",f=` key="${String(a)}" placeholder="${String(u)}"`;r+=`<template${f}>${c}</template>`,n=c||u}else if(o.text!==void 0){const a=o.text||"";a.trim()!==""?a!==n?(console.log(`\u627E\u5230\u6587\u672C\u5143\u7D20: ${a}`),r+=a,n=a):console.log("\u8DF3\u8FC7\u91CD\u590D\u6587\u672C\u5143\u7D20"):console.log("\u8DF3\u8FC7\u7A7A\u6587\u672C\u5143\u7D20")}else{console.log("\u672A\u77E5\u5143\u7D20\u7C7B\u578B:",o);const a=o.text||"";a.trim()!==""&&a!==n&&(r+=a,n=a)}}),console.log("\u8F6C\u6362\u7ED3\u679C:",r),r},mw=e=>{if(!e||e.length===0)return"";const t=e[0];if(!t.children)return t.text||"";let r="";return t.children.forEach(n=>{n.text!==void 0?r+=n.text:n.type==="template"&&(r+=n.value||n.placeholder||"")}),r},gw=e=>{if(!e||e.length===0)return"";const t=e[0];if(!t.children)return t.text||"";let r="";return t.children.forEach(n=>{n.text!==void 0?r+=n.text:n.type==="template"&&(r+=`\`\`\`template\`\`\`
1396
- ${n.value||n.placeholder}\`\`\`
1397
- \`\`\`
1398
- `)}),r},vw=e=>{if(!e||e.length===0)return"";const t=e[0];if(!t.children)return t.text||"";let r="";return t.children.forEach(n=>{if(n.text!==void 0)r+=n.text;else if(n.type==="template"){const o=n.key||n.fieldId||"",a=n.placeholder||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9",u=n.value||"",c=` key="${String(o)}" placeholder="${String(a)}"`;r+=`<template${c}>${u}</template>`}}),r},Sw=({data:e,onChange:t,size:r="sm",styles:n={},onGetData:o})=>{var w,C,D,p,B,F,S,O,M,_,z,K,$,Q,V,X,G,j,H,U,R,te,q,se,ye,we,ie,me,Oe,ee,pe,le,ue,De,Ce,Ee,Fe,Be,Ne,ze,Me,Ge,dt,ut,Pe,Le,Ve,ft,Je,Xe,St,bt;const a=Os(),u={theme:{colors:{primary:((w=a==null?void 0:a.colors)==null?void 0:w.primary)||"#055AFF",secondary:((C=a==null?void 0:a.colors)==null?void 0:C.secondary)||"#84ADFF",background:((D=a==null?void 0:a.colors)==null?void 0:D.background)||"#E5EEFF",text:((p=a==null?void 0:a.colors)==null?void 0:p.text)||"#055AFF",border:((B=a==null?void 0:a.colors)==null?void 0:B.border)||"#84ADFF",success:((F=a==null?void 0:a.colors)==null?void 0:F.success)||"#008000",warning:((S=a==null?void 0:a.colors)==null?void 0:S.warning)||"#FFA500",error:((O=a==null?void 0:a.colors)==null?void 0:O.error)||"#FF0000",info:((M=a==null?void 0:a.colors)==null?void 0:M.info)||"#0000FF",disabled:((_=a==null?void 0:a.colors)==null?void 0:_.disabled)||"#808080",disabledBackground:((z=a==null?void 0:a.colors)==null?void 0:z.disabledBackground)||"#F5F5F5",disabledText:((K=a==null?void 0:a.colors)==null?void 0:K.disabledText)||"#808080",shadow:(($=a==null?void 0:a.colors)==null?void 0:$.shadow)||"0 1px 3px rgba(0, 0, 0, 0.12)",appBackground:((Q=a==null?void 0:a.colors)==null?void 0:Q.appBackground)||"transparent",listBackground:((V=a==null?void 0:a.colors)==null?void 0:V.listBackground)||"#f9f9f9",dashboardBackground:((X=a==null?void 0:a.colors)==null?void 0:X.dashboardBackground)||"#ffffff",textSecondary:((G=a==null?void 0:a.colors)==null?void 0:G.textSecondary)||"#6b7280"},space:{sidebar:((j=a==null?void 0:a.space)==null?void 0:j.sidebar)||"260px",size:((H=a==null?void 0:a.space)==null?void 0:H.size)||"12px",radius:((U=a==null?void 0:a.space)==null?void 0:U.radius)||"6px",padding:((R=a==null?void 0:a.space)==null?void 0:R.padding)||"16px",margin:((te=a==null?void 0:a.space)==null?void 0:te.margin)||"20px",shadow:((q=a==null?void 0:a.space)==null?void 0:q.shadow)||"0 2px 8px rgba(0,0,0,0.1)",lineHeight:((se=a==null?void 0:a.space)==null?void 0:se.lineHeight)||"1.6"},icons:(a==null?void 0:a.icons)||{},fonts:{body:{size:((we=(ye=a==null?void 0:a.fonts)==null?void 0:ye.body)==null?void 0:we.size)||"14px",weight:((me=(ie=a==null?void 0:a.fonts)==null?void 0:ie.body)==null?void 0:me.weight)||"normal",family:((ee=(Oe=a==null?void 0:a.fonts)==null?void 0:Oe.body)==null?void 0:ee.family)||"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:((le=(pe=a==null?void 0:a.fonts)==null?void 0:pe.heading)==null?void 0:le.size)||"16px",weight:((De=(ue=a==null?void 0:a.fonts)==null?void 0:ue.heading)==null?void 0:De.weight)||"600",family:((Ee=(Ce=a==null?void 0:a.fonts)==null?void 0:Ce.heading)==null?void 0:Ee.family)||"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:((Fe=a==null?void 0:a.others)==null?void 0:Fe.baseFontWeight)||"normal"}},mode:(a==null?void 0:a.mode)||"light"},c={backgroundColor:((Be=a==null?void 0:a.colors)==null?void 0:Be.background)||"#E5EEFF",borderColor:((Ne=a==null?void 0:a.colors)==null?void 0:Ne.border)||"#84ADFF",borderRadius:((ze=a==null?void 0:a.space)==null?void 0:ze.radius)||"6px",padding:((Me=a==null?void 0:a.space)==null?void 0:Me.padding)||"8px 12px",margin:"2px",fontSize:((dt=(Ge=a==null?void 0:a.fonts)==null?void 0:Ge.body)==null?void 0:dt.size)||"14px",fontWeight:((Pe=(ut=a==null?void 0:a.fonts)==null?void 0:ut.body)==null?void 0:Pe.weight)||"500",minWidth:"30px",textColor:((Le=a==null?void 0:a.colors)==null?void 0:Le.text)||"#84ADFF"},f={...u,...n,theme:{...u.theme,...n==null?void 0:n.theme,colors:{...(Ve=u.theme)==null?void 0:Ve.colors,...(ft=n==null?void 0:n.theme)==null?void 0:ft.colors},space:{...(Je=u.theme)==null?void 0:Je.space,...(Xe=n==null?void 0:n.theme)==null?void 0:Xe.space},fonts:{...(St=u.theme)==null?void 0:St.fonts,...(bt=n==null?void 0:n.theme)==null?void 0:bt.fonts}},templateField:{...c,...n==null?void 0:n.templateField}},[d,m]=Pt(()=>Op(e));lr(()=>{console.log("\u6570\u636E\u53D8\u5316\uFF0C\u540C\u6B65\u5230\u5185\u90E8\u72B6\u6001:",e);const ct=Op(e);console.log("\u65B0\u7684Slate\u6570\u636E:",ct),m(ct)},[e]),lr(()=>{console.log("slateData \u72B6\u6001\u53D8\u5316:",d)},[d]);const b=mt((ct,rt)=>{if(rt===Bs.SLATE&&ct){console.log("\u7F16\u8F91\u5668\u5185\u5BB9\u53D8\u5316:",ct),m(ct);const $e=Cu(ct);console.log("\u8F6C\u6362\u540E\u7684\u6A21\u677F\u5B57\u7B26\u4E32:",$e),t==null||t($e)}},[t]),g=mt(ct=>{if(!d||d.length===0)return"";switch(ct){case"pure_string":return mw(d);case"string":return Cu(d);case"markdown":return gw(d);case"html":return vw(d);default:return Cu(d)}},[d]);return lr(()=>{o==null||o(g)},[g,o]),Z.jsx(mc,{dataSource:{type:Bs.SLATE,content:d},isEditing:!0,placeholder:"\u5F00\u59CB\u7F16\u8F91\u6A21\u7248...",onChange:b,size:"md",styles:f,enableTemplateInput:!0})};export{Ew as $,N0 as D,eo as F,Sw as I,_0 as T,Bs as X,kw as j};