PageSourceSearch

https://www.superdoc.dev/assets/index-a-U7ruuJ.js

js superdoc.dev collected 2026-10-04 06:55:09 UTC 2,216,766 bytes, 666 lines download raw bytes

vendor: 14,545 bytes, lines 1-33
1var WH=Object.defineProperty;var s6=e=>{throw TypeError(e)};var KH=(e,t,n)=>t in e?WH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ao=(e,t,n)=>KH(e,typeof t!="symbol"?t+"":t,n),bS=(e,t,n)=>t.has(e)||s6("Cannot "+n);var Ae=(e,t,n)=>(bS(e,t,"read from private field"),n?n.call(e):t.get(e)),Cn=(e,t,n)=>t.has(e)?s6("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ot=(e,t,n,r)=>(bS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ye=(e,t,n)=>(bS(e,t,"access private method"),n);var Ew=(e,t,n,r)=>({set _(i){Ot(e,t,i,n)},get _(){return Ae(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function a2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wS={exports:{}},qv={};/**
2 * @license React
3 * react-jsx-runtime.production.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var a6;function YH(){if(a6)return qv;a6=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var l in i)l!=="key"&&(o[l]=i[l])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:s,ref:i!==void 0?i:null,props:o}}return qv.Fragment=t,qv.jsx=n,qv.jsxs=n,qv}var l6;function XH(){return l6||(l6=1,wS.exports=YH()),wS.exports}var _=XH(),xS={exports:{}},Wv={},kS={exports:{}},_S={};/**
10 * @license React
11 * scheduler.production.js
12 *
13 * Copyright (c) Meta Platforms, Inc. and affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var c6;function ZH(){return c6||(c6=1,(function(e){function t(U,q){var Q=U.length;U.push(q);e:for(;0<Q;){var re=Q-1>>>1,ne=U[re];if(0<i(ne,q))U[re]=q,U[Q]=ne,Q=re;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var q=U[0],Q=U.pop();if(Q!==q){U[0]=Q;e:for(var re=0,ne=U.length,J=ne>>>1;re<J;){var ge=2*(re+1)-1,le=U[ge],ve=ge+1,Ee=U[ve];if(0>i(le,Q))ve<ne&&0>i(Ee,le)?(U[re]=Ee,U[ve]=Q,re=ve):(U[re]=le,U[ge]=Q,re=ge);else if(ve<ne&&0>i(Ee,Q))U[re]=Ee,U[ve]=Q,re=ve;else break e}}return q}function i(U,q){var Q=U.sortIndex-q.sortIndex;return Q!==0?Q:U.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],d=[],f=1,p=null,m=3,y=!1,b=!1,k=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function I(U){for(var q=n(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=U)r(d),q.sortIndex=q.expirationTime,t(u,q);else break;q=n(d)}}function D(U){if(k=!1,I(U),!b)if(n(u)!==null)b=!0,P||(P=!0,M());else{var q=n(d);q!==null&&W(D,q.startTime-U)}}var P=!1,V=-1,ee=5,F=-1;function H(){return S?!0:!(e.unstable_now()-F<ee)}function te(){if(S=!1,P){var U=e.unstable_now();F=U;var q=!0;try{e:{b=!1,k&&(k=!1,T(V),V=-1),y=!0;var Q=m;try{t:{for(I(U),p=n(u);p!==null&&!(p.expirationTime>U&&H());){var re=p.callback;if(typeof re=="function"){p.callback=null,m=p.priorityLevel;var ne=re(p.expirationTime<=U);if(U=e.unstable_now(),typeof ne=="function"){p.callback=ne,I(U),q=!0;break t}p===n(u)&&r(u),I(U)}else r(u);p=n(u)}if(p!==null)q=!0;else{var J=n(d);J!==null&&W(D,J.startTime-U),q=!1}}break e}finally{p=null,m=Q,y=!1}q=void 0}}finally{q?M():P=!1}}}var M;if(typeof C=="function")M=function(){C(te)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,L=Z.port2;Z.port1.onmessage=te,M=function(){L.postMessage(null)}}else M=function(){x(te,0)};function W(U,q){V=x(function(){U(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(U){switch(m){case 1:case 2:case 3:var q=3;break;default:q=m}var Q=m;m=q;try{return U()}finally{m=Q}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(U,q){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var Q=m;m=U;try{return q()}finally{m=Q}},e.unstable_scheduleCallback=function(U,q,Q){var re=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?re+Q:re):Q=re,U){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=Q+ne,U={id:f++,callback:q,priorityLevel:U,startTime:Q,expirationTime:ne,sortIndex:-1},Q>re?(U.sortIndex=Q,t(d,U),n(u)===null&&U===n(d)&&(k?(T(V),V=-1):k=!0,W(D,Q-re))):(U.sortIndex=ne,t(u,U),b||y||(b=!0,P||(P=!0,M()))),U},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(U){var q=m;return function(){var Q=m;m=q;try{return U.apply(this,arguments)}finally{m=Q}}}})(_S)),_S}var u6;function QH(){return u6||(u6=1,kS.exports=ZH()),kS.exports}var CS={exports:{}},$r={};/**
18 * @license React
19 * react.production.js
20 *
21 * Copyright (c) Meta Platforms, Inc. and affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */var d6;function JH(){if(d6)return $r;d6=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function y(J){return J===null||typeof J!="object"?null:(J=m&&J[m]||J["@@iterator"],typeof J=="function"?J:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,S={};function x(J,ge,le){this.props=J,this.context=ge,this.refs=S,this.updater=le||b}x.prototype.isReactComponent={},x.prototype.setState=function(J,ge){if(typeof J!="object"&&typeof J!="function"&&J!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,J,ge,"setState")},x.prototype.forceUpdate=function(J){this.updater.enqueueForceUpdate(this,J,"forceUpdate")};function T(){}T.prototype=x.prototype;function C(J,ge,le){this.props=J,this.context=ge,this.refs=S,this.updater=le||b}var I=C.prototype=new T;I.constructor=C,k(I,x.prototype),I.isPureReactComponent=!0;var D=Array.isArray;function P(){}var V={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function F(J,ge,le){var ve=le.ref;return{$$typeof:e,type:J,key:ge,ref:ve!==void 0?ve:null,props:le}}function H(J,ge){return F(J.type,ge,J.props)}function te(J){return typeof J=="object"&&J!==null&&J.$$typeof===e}function M(J){var ge={"=":"=0",":":"=2"};return"$"+J.replace(/[=:]/g,function(le){return ge[le]})}var Z=/\/+/g;function L(J,ge){return typeof J=="object"&&J!==null&&J.key!=null?M(""+J.key):ge.toString(36)}function W(J){switch(J.status){case"fulfilled":return J.value;case"rejected":throw J.reason;default:switch(typeof J.status=="string"?J.then(P,P):(J.status="pending",J.then(function(ge){J.status==="pending"&&(J.status="fulfilled",J.value=ge)},function(ge){J.status==="pending"&&(J.status="rejected",J.reason=ge)})),J.status){case"fulfilled":return J.value;case"rejected":throw J.reason}}throw J}function U(J,ge,le,ve,Ee){var st=typeof J;(st==="undefined"||st==="boolean")&&(J=null);var At=!1;if(J===null)At=!0;else switch(st){case"bigint":case"string":case"number":At=!0;break;case"object":switch(J.$$typeof){case e:case t:At=!0;break;case f:return At=J._init,U(At(J._payload),ge,le,ve,Ee)}}if(At)return Ee=Ee(J),At=ve===""?"."+L(J,0):ve,D(Ee)?(le="",At!=null&&(le=At.replace(Z,"$&/")+"/"),U(Ee,ge,le,"",function(Be){return Be})):Ee!=null&&(te(Ee)&&(Ee=H(Ee,le+(Ee.key==null||J&&J.key===Ee.key?"":(""+Ee.key).replace(Z,"$&/")+"/")+At)),ge.push(Ee)),1;At=0;var yt=ve===""?".":ve+":";if(D(J))for(var Ge=0;Ge<J.length;Ge++)ve=J[Ge],st=yt+L(ve,Ge),At+=U(ve,ge,le,st,Ee);else if(Ge=y(J),typeof Ge=="function")for(J=Ge.call(J),Ge=0;!(ve=J.next()).done;)ve=ve.value,st=yt+L(ve,Ge++),At+=U(ve,ge,le,st,Ee);else if(st==="object"){if(typeof J.then=="function")return U(W(J),ge,le,ve,Ee);throw ge=String(J),Error("Objects are not valid as a React child (found: "+(ge==="[object Object]"?"object with keys {"+Object.keys(J).join(", ")+"}":ge)+"). If you meant to render a collection of children, use an array instead.")}return At}function q(J,ge,le){if(J==null)return J;var ve=[],Ee=0;return U(J,ve,"","",function(st){return ge.call(le,st,Ee++)}),ve}function Q(J){if(J._status===-1){var ge=J._result;ge=ge(),ge.then(function(le){(J._status===0||J._status===-1)&&(J._status=1,J._result=le)},function(le){(J._status===0||J._status===-1)&&(J._status=2,J._result=le)}),J._status===-1&&(J._status=0,J._result=ge)}if(J._status===1)return J._result.default;throw J._result}var re=typeof reportError=="function"?reportError:function(J){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ge=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof J=="object"&&J!==null&&typeof J.message=="string"?String(J.message):String(J),error:J});if(!window.dispatchEvent(ge))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",J);return}console.error(J)},ne={map:q,forEach:function(J,ge,le){q(J,function(){ge.apply(this,arguments)},le)},count:function(J){var ge=0;return q(J,function(){ge++}),ge},toArray:function(J){return q(J,function(ge){return ge})||[]},only:function(J){if(!te(J))throw Error("React.Children.only expected to receive a single React element child.");return J}};return $r.Activity=p,$r.Children=ne,$r.Component=x,$r.Fragment=n,$r.Profiler=i,$r.PureComponent=C,$r.StrictMode=r,$r.Suspense=u,$r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,$r.__COMPILER_RUNTIME={__proto__:null,c:function(J){return V.H.useMemoCache(J)}},$r.cache=function(J){return function(){return J.apply(null,arguments)}},$r.cacheSignal=function(){return null},$r.cloneElement=function(J,ge,le){if(J==null)throw Error("The argument must be a React element, but you passed "+J+".");var ve=k({},J.props),Ee=J.key;if(ge!=null)for(st in ge.key!==void 0&&(Ee=""+ge.key),ge)!ee.call(ge,st)||st==="key"||st==="__self"||st==="__source"||st==="ref"&&ge.ref===void 0||(ve[st]=ge[st]);var st=arguments.length-2;if(st===1)ve.children=le;else if(1<st){for(var At=Array(st),yt=0;yt<st;yt++)At[yt]=arguments[yt+2];ve.children=At}return F(J.type,Ee,ve)},$r.createContext=function(J){return J={$$typeof:s,_currentValue:J,_currentValue2:J,_threadCount:0,Provider:null,Consumer:null},J.Provider=J,J.Consumer={$$typeof:o,_context:J},J},$r.createElement=function(J,ge,le){var ve,Ee={},st=null;if(ge!=null)for(ve in ge.key!==void 0&&(st=""+ge.key),ge)ee.call(ge,ve)&&ve!=="key"&&ve!=="__self"&&ve!=="__source"&&(Ee[ve]=ge[ve]);var At=arguments.length-2;if(At===1)Ee.children=le;else if(1<At){for(var yt=Array(At),Ge=0;Ge<At;Ge++)yt[Ge]=arguments[Ge+2];Ee.children=yt}if(J&&J.defaultProps)for(ve in At=J.defaultProps,At)Ee[ve]===void 0&&(Ee[ve]=At[ve]);return F(J,st,Ee)},$r.createRef=function(){return{current:null}},$r.forwardRef=function(J){return{$$typeof:l,render:J}},$r.isValidElement=te,$r.lazy=function(J){return{$$typeof:f,_payload:{_status:-1,_result:J},_init:Q}},$r.memo=function(J,ge){return{$$typeof:d,type:J,compare:ge===void 0?null:ge}},$r.startTransition=function(J){var ge=V.T,le={};V.T=le;try{var ve=J(),Ee=V.S;Ee!==null&&Ee(le,ve),typeof ve=="object"&&ve!==null&&typeof ve.then=="function"&&ve.then(P,re)}catch(st){re(st)}finally{ge!==null&&le.types!==null&&(ge.types=le.types),V.T=ge}},$r.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},$r.use=function(J){return V.H.use(J)},$r.useActionState=function(J,ge,le){return V.H.useActionState(J,ge,le)},$r.useCallback=function(J,ge){return V.H.useCallback(J,ge)},$r.useContext=function(J){return V.H.useContext(J)},$r.useDebugValue=function(){},$r.useDeferredValue=function(J,ge){return V.H.useDeferredValue(J,ge)},$r.useEffect=function(J,ge){return V.H.useEffect(J,ge)},$r.useEffectEvent=function(J){return V.H.useEffectEvent(J)},$r.useId=function(){return V.H.useId()},$r.useImperativeHandle=function(J,ge,le){return V.H.useImperativeHandle(J,ge,le)},$r.useInsertionEffect=function(J,ge){return V.H.useInsertionEffect(J,ge)},$r.useLayoutEffect=function(J,ge){return V.H.useLayoutEffect(J,ge)},$r.useMemo=function(J,ge){return V.H.useMemo(J,ge)},$r.useOptimistic=function(J,ge){return V.H.useOptimistic(J,ge)},$r.useReducer=function(J,ge,le){return V.H.useReducer(J,ge,le)},$r.useRef=function(J){return V.H.useRef(J)},$r.useState=function(J){return V.H.useState(J)},$r.useSyncExternalStore=function(J,ge,le){return V.H.useSyncExternalStore(J,ge,le)},$r.useTransition=function(){return V.H.useTransition()},$r.version="19.2.7",$r}var f6;function RA(){return f6||(f6=1,CS.exports=JH()),CS.exports}var SS={exports:{}},Ha={};/**
26 * @license React
27 * react-dom.production.js
28 *
29 * Copyright (c) Meta Platforms, Inc. and affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var h6;
vendor: 6,519 bytes, lines 33-41
33function e$(){if(h6)return Ha;h6=1;var e=RA();function t(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)d+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(u,d,f){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:u,containerInfo:d,implementation:f}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ha.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ha.createPortal=function(u,d){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(u,d,null,f)},Ha.flushSync=function(u){var d=s.T,f=r.p;try{if(s.T=null,r.p=2,u)return u()}finally{s.T=d,r.p=f,r.d.f()}},Ha.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},Ha.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Ha.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var f=d.as,p=l(f,d.crossOrigin),m=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;f==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:m,fetchPriority:y}):f==="script"&&r.d.X(u,{crossOrigin:p,integrity:m,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ha.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var f=l(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},Ha.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var f=d.as,p=l(f,d.crossOrigin);r.d.L(u,f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ha.preloadModule=function(u,d){if(typeof u=="string")if(d){var f=l(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},Ha.requestFormReset=function(u){r.d.r(u)},Ha.unstable_batchedUpdates=function(u,d){return u(d)},Ha.useFormState=function(u,d,f){return s.H.useFormState(u,d,f)},Ha.useFormStatus=function(){return s.H.useHostTransitionStatus()},Ha.version="19.2.7",Ha}var p6;function t$(){if(p6)return SS.exports;p6=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),SS.exports=e$(),SS.exports}/**
34 * @license React
35 * react-dom-client.production.js
36 *
37 * Copyright (c) Meta Platforms, Inc. and affiliates.
38 *
39 * This source code is licensed under the MIT license found in the
40 * LICENSE file in the root directory of this source tree.
41 */var m6;function n$(){if(m6)return Wv;m6=1;var e=QH(),t=RA(),n=t$();function r(a){var c="https://react.dev/errors/"+a;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var c=a,h=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(h=c.return),a=c.return;while(a)}return c.tag===3?h:null}function s(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function l(a){if(a.tag===31){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function u(a){if(o(a)!==a)throw Error(r(188))}function d(a){var c=a.alternate;if(!c){if(c=o(a),c===null)throw Error(r(188));return c!==a?null:a}for(var h=a,g=c;;){var E=h.return;if(E===null)break;var O=E.alternate;if(O===null){if(g=E.return,g!==null){h=g;continue}break}if(E.child===O.child){for(O=E.child;O;){if(O===h)return u(E),a;if(O===g)return u(E),c;O=O.sibling}throw Error(r(188))}if(h.return!==g.return)h=E,g=O;else{for(var ae=!1,_e=E.child;_e;){if(_e===h){ae=!0,h=E,g=O;break}if(_e===g){ae=!0,g=E,h=O;break}_e=_e.sibling}if(!ae){for(_e=O.child;_e;){if(_e===h){ae=!0,h=O,g=E;break}if(_e===g){ae=!0,g=O,h=E;break}_e=_e.sibling}if(!ae)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?a:c}function f(a){var c=a.tag;if(c===5||c===26||c===27||c===6)return a;for(a=a.child;a!==null;){if(c=f(a),c!==null)return c;a=a.sibling}return null}var p=Object.assign,m=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),C=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function M(a){return a===null||typeof a!="object"?null:(a=te&&a[te]||a["@@iterator"],typeof a=="function"?a:null)}var Z=Symbol.for("react.client.reference");function L(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===Z?null:a.displayName||a.name||null;
vendor: 9,286 bytes, lines 41-48
41if(typeof a=="string")return a;switch(a){case k:return"Fragment";case x:return"Profiler";case S:return"StrictMode";case D:return"Suspense";case P:return"SuspenseList";case F:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case b:return"Portal";case C:return a.displayName||"Context";case T:return(a._context.displayName||"Context")+".Consumer";case I:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case V:return c=a.displayName||null,c!==null?c:L(a.type)||"Memo";case ee:c=a._payload,a=a._init;try{return L(a(c))}catch{}}return null}var W=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},re=[],ne=-1;function J(a){return{current:a}}function ge(a){0>ne||(a.current=re[ne],re[ne]=null,ne--)}function le(a,c){ne++,re[ne]=a.current,a.current=c}var ve=J(null),Ee=J(null),st=J(null),At=J(null);function yt(a,c){switch(le(st,c),le(Ee,a),le(ve,null),c.nodeType){case 9:case 11:a=(a=c.documentElement)&&(a=a.namespaceURI)?II(a):0;break;default:if(a=c.tagName,c=c.namespaceURI)c=II(c),a=RI(c,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}ge(ve),le(ve,a)}function Ge(){ge(ve),ge(Ee),ge(st)}function Be(a){a.memoizedState!==null&&le(At,a);var c=ve.current,h=RI(c,a.type);c!==h&&(le(Ee,a),le(ve,h))}function he(a){Ee.current===a&&(ge(ve),ge(Ee)),At.current===a&&(ge(At),Vv._currentValue=Q)}var Oe,ye;function B(a){if(Oe===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);Oe=c&&c[1]||"",ye=-1<h.stack.indexOf(`
42    at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
43`+Oe+a+ye}var be=!1;function ie(a,c){if(!a||be)return"";be=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(c){var on=function(){throw Error()};if(Object.defineProperty(on.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(on,[])}catch(Gt){var Pt=Gt}Reflect.construct(a,[],on)}else{try{on.call()}catch(Gt){Pt=Gt}a.call(on.prototype)}}else{try{throw Error()}catch(Gt){Pt=Gt}(on=a())&&typeof on.catch=="function"&&on.catch(function(){})}}catch(Gt){if(Gt&&Pt&&typeof Gt.stack=="string")return[Gt.stack,Pt.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=g.DetermineComponentFrameRoot(),ae=O[0],_e=O[1];if(ae&&_e){var rt=ae.split(`
44`),Mt=_e.split(`
45`);for(E=g=0;g<rt.length&&!rt[g].includes("DetermineComponentFrameRoot");)g++;for(;E<Mt.length&&!Mt[E].includes("DetermineComponentFrameRoot");)E++;if(g===rt.length||E===Mt.length)for(g=rt.length-1,E=Mt.length-1;1<=g&&0<=E&&rt[g]!==Mt[E];)E--;for(;1<=g&&0<=E;g--,E--)if(rt[g]!==Mt[E]){if(g!==1||E!==1)do if(g--,E--,0>E||rt[g]!==Mt[E]){var Qt=`
46`+rt[g].replace(" at new "," at ");return a.displayName&&Qt.includes("<anonymous>")&&(Qt=Qt.replace("<anonymous>",a.displayName)),Qt}while(1<=g&&0<=E);break}}}finally{be=!1,Error.prepareStackTrace=h}return(h=a?a.displayName||a.name:"")?B(h):""}function fe(a,c){switch(a.tag){case 26:case 27:case 5:return B(a.type);case 16:return B("Lazy");case 13:return a.child!==c&&c!==null?B("Suspense Fallback"):B("Suspense");case 19:return B("SuspenseList");case 0:case 15:return ie(a.type,!1);case 11:return ie(a.type.render,!1);case 1:return ie(a.type,!0);case 31:return B("Activity");default:return""}}function ue(a){try{var c="",h=null;do c+=fe(a,h),h=a,a=a.return;while(a);return c}catch(g){return`
47Error generating stack: `+g.message+`
48`+g.stack}}var Ce=Object.prototype.hasOwnProperty,Ue=e.unstable_scheduleCallback,K=e.unstable_cancelCallback,oe=e.unstable_shouldYield,Fe=e.unstable_requestPaint,Le=e.unstable_now,tt=e.unstable_getCurrentPriorityLevel,De=e.unstable_ImmediatePriority,Pe=e.unstable_UserBlockingPriority,mt=e.unstable_NormalPriority,xt=e.unstable_LowPriority,de=e.unstable_IdlePriority,z=e.log,Y=e.unstable_setDisableYieldValue,me=null,Ve=null;function lt(a){if(typeof z=="function"&&Y(a),Ve&&typeof Ve.setStrictMode=="function")try{Ve.setStrictMode(me,a)}catch{}}var gt=Math.clz32?Math.clz32:br,dn=Math.log,Hn=Math.LN2;function br(a){return a>>>=0,a===0?32:31-(dn(a)/Hn|0)|0}var ur=256,tr=262144,Br=4194304;function Lr(a){var c=a&42;if(c!==0)return c;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function $e(a,c,h){var g=a.pendingLanes;if(g===0)return 0;var E=0,O=a.suspendedLanes,ae=a.pingedLanes;a=a.warmLanes;var _e=g&134217727;return _e!==0?(g=_e&~O,g!==0?E=Lr(g):(ae&=_e,ae!==0?E=Lr(ae):h||(h=_e&~a,h!==0&&(E=Lr(h))))):(_e=g&~O,_e!==0?E=Lr(_e):ae!==0?E=Lr(ae):h||(h=g&~a,h!==0&&(E=Lr(h)))),E===0?0:c!==0&&c!==E&&(c&O)===0&&(O=E&-E,h=c&-c,O>=h||O===32&&(h&4194048)!==0)?c:E}function Bt(a,c){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&c)===0}function hn(a,c){switch(a){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pn(){var a=Br;return Br<<=1,(Br&62914560)===0&&(Br=4194304),a}function jn(a){for(var c=[],h=0;31>h;h++)c.push(a);return c}function Lt(a,c){a.pendingLanes|=c,c!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function St(a,c,h,g,E,O){var ae=a.pendingLanes;a.pendingLanes=h,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=h,a.entangledLanes&=h,a.errorRecoveryDisabledLanes&=h,a.shellSuspendCounter=0;var _e=a.entanglements,rt=a.expirationTimes,Mt=a.hiddenUpdates;for(h=ae&~h;0<h;){var Qt=31-gt(h),on=1<<Qt;_e[Qt]=0,rt[Qt]=-1;var Pt=Mt[Qt];if(Pt!==null)for(Mt[Qt]=null,Qt=0;Qt<Pt.length;Qt++){var Gt=Pt[Qt];Gt!==null&&(Gt.lane&=-536870913)}h&=~on}g!==0&&Te(a,g,0),O!==0&&E===0&&a.tag!==0&&(a.suspendedLanes|=O&~(ae&~c))}function Te(a,c,h){a.pendingLanes|=c,a.suspendedLanes&=~c;var g=31-gt(c);a.entangledLanes|=c,a.entanglements[g]=a.entanglements[g]|1073741824|h&261930}function qe(a,c){var h=a.entangledLanes|=c;for(a=a.entanglements;h;){var g=31-gt(h),E=1<<g;E&c|a[g]&c&&(a[g]|=c),h&=~E}}function it(a,c){var h=c&-c;return h=(h&42)!==0?1:Et(h),(h&(a.suspendedLanes|c))!==0?0:h}function Et(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function $t(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function sn(){var a=q.p;return a!==0?a:(a=window.event,a===void 0?32:JI(a.type))}function Tn(a,c){var h=q.p;try{return q.p=a,c()}finally{q.p=h}}var kn=Math.random().toString(36).slice(2),rn="__reactFiber$"+kn,Wn="__reactProps$"+kn,qr="__reactContainer$"+kn,Yr="__reactEvents$"+kn,gi="__reactListeners$"+kn,Jn="__reactHandles$"+kn,Tr="__reactResources$"+kn,zr="__reactMarker$"+kn;function Kn(a){delete a[rn],delete a[Wn],delete a[Yr],delete a[gi],delete a[Jn]}function Gn(a){var c=a[rn];if(c)return c;for(var h=a.parentNode;h;){if(c=h[qr]||h[rn]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(a=BI(a);a!==null;){if(h=a[rn])return h;a=BI(a)}return c}a=h,h=a.parentNode}return null}function ni(a){if(a=a[rn]||a[qr]){var c=a.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return a}return null}function Di(a){var c=a.tag;if(c===5||c===26||c===27||c===6)return a.stateNode;throw Error(r(33))}function Ro(a){var c=a[Tr];return c||(c=a[Tr]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function Si(a){a[zr]=!0}var Gs=new Set,Oo={};function Hi(a,c){cn(a,c),cn(a+"Capture",c)}function cn(a,c){for(Oo[a]=c,a=0;a<c.length;a++)Gs.add(c[a])}var Fn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),dr={},rr={};function je(a){return Ce.call(rr,a)?!0:Ce.call(dr,a)?!1:Fn.test(a)?rr[a]=!0:(dr[a]=!0,!1)}
vendor: 6,359 bytes, line 48
48function Je(a,c,h){if(je(c))if(h===null)a.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":a.removeAttribute(c);return;case"boolean":var g=c.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){a.removeAttribute(c);return}}a.setAttribute(c,""+h)}}function Ut(a,c,h){if(h===null)a.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttribute(c,""+h)}}function un(a,c,h,g){if(g===null)a.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttributeNS(c,h,""+g)}}function Xt(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Zn(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Bi(a,c,h){var g=Object.getOwnPropertyDescriptor(a.constructor.prototype,c);if(!a.hasOwnProperty(c)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,O=g.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return E.call(this)},set:function(ae){h=""+ae,O.call(this,ae)}}),Object.defineProperty(a,c,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(ae){h=""+ae},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function ri(a){if(!a._valueTracker){var c=Zn(a)?"checked":"value";a._valueTracker=Bi(a,c,""+a[c])}}function ot(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return a&&(g=Zn(a)?a.checked?"true":"false":a.value),a=g,a!==h?(c.setValue(a),!0):!1}function jt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var gr=/[\n"\\]/g;function $n(a){return a.replace(gr,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Pr(a,c,h,g,E,O,ae,_e){a.name="",ae!=null&&typeof ae!="function"&&typeof ae!="symbol"&&typeof ae!="boolean"?a.type=ae:a.removeAttribute("type"),c!=null?ae==="number"?(c===0&&a.value===""||a.value!=c)&&(a.value=""+Xt(c)):a.value!==""+Xt(c)&&(a.value=""+Xt(c)):ae!=="submit"&&ae!=="reset"||a.removeAttribute("value"),c!=null?jr(a,ae,Xt(c)):h!=null?jr(a,ae,Xt(h)):g!=null&&a.removeAttribute("value"),E==null&&O!=null&&(a.defaultChecked=!!O),E!=null&&(a.checked=E&&typeof E!="function"&&typeof E!="symbol"),_e!=null&&typeof _e!="function"&&typeof _e!="symbol"&&typeof _e!="boolean"?a.name=""+Xt(_e):a.removeAttribute("name")}function ui(a,c,h,g,E,O,ae,_e){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(a.type=O),c!=null||h!=null){if(!(O!=="submit"&&O!=="reset"||c!=null)){ri(a);return}h=h!=null?""+Xt(h):"",c=c!=null?""+Xt(c):h,_e||c===a.value||(a.value=c),a.defaultValue=c}g=g??E,g=typeof g!="function"&&typeof g!="symbol"&&!!g,a.checked=_e?a.checked:!!g,a.defaultChecked=!!g,ae!=null&&typeof ae!="function"&&typeof ae!="symbol"&&typeof ae!="boolean"&&(a.name=ae),ri(a)}function jr(a,c,h){c==="number"&&jt(a.ownerDocument)===a||a.defaultValue===""+h||(a.defaultValue=""+h)}function Zr(a,c,h,g){if(a=a.options,c){c={};for(var E=0;E<h.length;E++)c["$"+h[E]]=!0;for(h=0;h<a.length;h++)E=c.hasOwnProperty("$"+a[h].value),a[h].selected!==E&&(a[h].selected=E),E&&g&&(a[h].defaultSelected=!0)}else{for(h=""+Xt(h),c=null,E=0;E<a.length;E++){if(a[E].value===h){a[E].selected=!0,g&&(a[E].defaultSelected=!0);return}c!==null||a[E].disabled||(c=a[E])}c!==null&&(c.selected=!0)}}function ro(a,c,h){if(c!=null&&(c=""+Xt(c),c!==a.value&&(a.value=c),h==null)){a.defaultValue!==c&&(a.defaultValue=c);return}a.defaultValue=h!=null?""+Xt(h):""}function Go(a,c,h,g){if(c==null){if(g!=null){if(h!=null)throw Error(r(92));if(W(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),c=h}h=Xt(c),a.defaultValue=h,g=a.textContent,g===h&&g!==""&&g!==null&&(a.value=g),ri(a)}function er(a,c){if(c){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=c;return}}a.textContent=c}var is=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function di(a,c,h){var g=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?a.setProperty(c,""):c==="float"?a.cssFloat="":a[c]="":g?a.setProperty(c,h):typeof h!="number"||h===0||is.has(c)?c==="float"?a.cssFloat=h:a[c]=(""+h).trim():a[c]=h+"px"}function Hr(a,c,h){if(c!=null&&typeof c!="object")throw Error(r(62));if(a=a.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||c!=null&&c.hasOwnProperty(g)||(g.indexOf("--")===0?a.setProperty(g,""):g==="float"?a.cssFloat="":a[g]="");for(var E in c)g=c[E],c.hasOwnProperty(E)&&h[E]!==g&&di(a,E,g)}else for(var O in c)c.hasOwnProperty(O)&&di(a,O,c[O])}function No(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mo=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
48dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ti=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function _o(a){return Ti.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function yn(){}var Nn=null;function yr(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var fr=null,Ri=null;function Co(a){var c=ni(a);if(c&&(a=c.stateNode)){var h=a[Wn]||null;e:switch(a=c.stateNode,c.type){case"input":if(Pr(a,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),c=h.name,h.type==="radio"&&c!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+$n(""+c)+'"][type="radio"]'),c=0;c<h.length;c++){var g=h[c];if(g!==a&&g.form===a.form){var E=g[Wn]||null;if(!E)throw Error(r(90));Pr(g,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(c=0;c<h.length;c++)g=h[c],g.form===a.form&&ot(g)}break e;case"textarea":ro(a,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&Zr(a,!!h.multiple,c,!1)}}}var uu=!1;function nc(a,c,h){if(uu)return a(c,h);uu=!0;try{var g=a(c);return g}finally{if(uu=!1,(fr!==null||Ri!==null)&&(iw(),fr&&(c=fr,a=Ri,Ri=fr=null,Co(c),a)))for(c=0;c<a.length;c++)Co(a[c])}}function Oa(a,c){var h=a.stateNode;if(h===null)return null;var g=h[Wn]||null;if(g===null)return null;h=g[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(r(231,c,typeof h));return h}var ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ys=!1;if(ta)try{var du={};Object.defineProperty(du,"passive",{get:function(){ys=!0}
vendor: 7,559 bytes, line 48
48}),window.addEventListener("test",du,du),window.removeEventListener("test",du,du)}catch{ys=!1}var na=null,Gu=null,Ja=null;function Na(){if(Ja)return Ja;var a,c=Gu,h=c.length,g,E="value"in na?na.value:na.textContent,O=E.length;for(a=0;a<h&&c[a]===E[a];a++);var ae=h-a;for(g=1;g<=ae&&c[h-g]===E[O-g];g++);return Ja=E.slice(a,1<g?1-g:void 0)}function Oc(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function Ts(){return!0}function fu(){return!1}function qo(a){function c(h,g,E,O,ae){this._reactName=h,this._targetInst=E,this.type=g,this.nativeEvent=O,this.target=ae,this.currentTarget=null;for(var _e in a)a.hasOwnProperty(_e)&&(h=a[_e],this[_e]=h?h(O):O[_e]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?Ts:fu,this.isPropagationStopped=fu,this}return p(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Ts)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Ts)},persist:function(){},isPersistent:Ts}),c}var Ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Il=qo(Ei),Rl=p({},Ei,{view:0,detail:0}),bh=qo(Rl),hu,Nc,vs,el=p({},Rl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ra,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==vs&&(vs&&a.type==="mousemove"?(hu=a.screenX-vs.screenX,Nc=a.screenY-vs.screenY):Nc=hu=0,vs=a),hu)},movementY:function(a){return"movementY"in a?a.movementY:Nc}}),Mc=qo(el),So=p({},el,{dataTransfer:0}),Xd=qo(So),Zd=p({},Rl,{relatedTarget:0}),rc=qo(Zd),qu=p({},Ei,{animationName:0,elapsedTime:0,pseudoElement:0}),Qd=qo(qu),Dc=p({},Ei,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),sm=qo(Dc),Jd=p({},Ei,{data:0}),ic=qo(Jd),Wu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ma={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ku={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ef(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=Ku[a])?!!c[a]:!1}function ra(){return ef}var wh=p({},Rl,{key:function(a){if(a.key){var c=Wu[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=Oc(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Ma[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ra,charCode:function(a){return a.type==="keypress"?Oc(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Oc(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),am=qo(wh),tf=p({},el,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yu=qo(tf),xh=p({},Rl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ra}),nf=qo(xh),kh=p({},Ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),pu=qo(kh),_h=p({},el,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),rf=qo(_h),Ch=p({},Ei,{newState:0,oldState:0}),lm=qo(Ch),Sh=[9,13,27,32],bs=ta&&"CompositionEvent"in window,Lc=null;ta&&"documentMode"in document&&(Lc=document.documentMode);var Xu=ta&&"TextEvent"in window&&!Lc,of=ta&&(!bs||Lc&&8<Lc&&11>=Lc),sf=" ",mu=!1;function af(a,c){switch(a){case"keyup":return Sh.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eh(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Pc=!1;function Ah(a,c){switch(a){case"compositionend":return Eh(c);case"keypress":return c.which!==32?null:(mu=!0,sf);case"textInput":return a=c.data,a===sf&&mu?null:a;default:return null}}function Th(a,c){if(Pc)return a==="compositionend"||!bs&&af(a,c)?(a=Na(),Ja=Gu=na=null,Pc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return of&&c.locale!=="ko"?null:c.data;default:return null}}var lf={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tl(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!lf[a.type]:c==="textarea"}function nl(a,c,h,g){fr?Ri?Ri.push(g):Ri=[g]:fr=g,c=dw(c,"onChange"),0<c.length&&(h=new Il("onChange","change",null,h,g),a.push({event:h,listeners:c}))}var gu=null,Ol=null;function Ih(a){_I(a,0)}function yu(a){var c=Di(a);if(ot(c))return a}function cf(a,c){if(a==="change")return c}var ya=!1;if(ta){var Da;if(ta){var io="oninput"in document;if(!io){var Rh=document.createElement("div");Rh.setAttribute("oninput","return;"),io=typeof Rh.oninput=="function"}Da=io}else Da=!1;ya=Da&&(!document.documentMode||9<document.documentMode)}function Zu(){gu&&(gu.detachEvent("onpropertychange",oc),Ol=gu=null)}function oc(a){if(a.propertyName==="value"&&yu(Ol)){var c=[];nl(c,Ol,a,yr(a)),nc(Ih,c)}}function Oh(a,c,h){a==="focusin"?(Zu(),gu=c,Ol=h,gu.attachEvent("onpropertychange",oc)):a==="focusout"&&Zu()}function sc(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return yu(Ol)}function uf(a,c){if(a==="click")return yu(c)}function R(a,c){if(a==="input"||a==="change")return yu(c)}function X(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var pe=typeof Object.is=="function"?Object.is:X;function xe(a,c){if(pe(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var h=Object.keys(a),g=Object.keys(c);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var E=h[g];if(!Ce.call(c,E)||!pe(a[E],c[E]))return!1}return!0}function ke(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Me(a,c){var h=ke(a);a=0;for(var g;h;){if(h.nodeType===3){if(g=a+h.textContent.length,a<=c&&g>=c)return{node:h,offset:c-a};a=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=ke(h)}}function He(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?He(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function Ie(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;
vendor: 21,313 bytes, line 48
48for(var c=jt(a.document);c instanceof a.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)a=c.contentWindow;else break;c=jt(a.document)}return c}function Xe(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}var Ke=ta&&"documentMode"in document&&11>=document.documentMode,wt=null,ct=null,vt=null,Ft=!1;function Zt(a,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Ft||wt==null||wt!==jt(g)||(g=wt,"selectionStart"in g&&Xe(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),vt&&xe(vt,g)||(vt=g,g=dw(ct,"onSelect"),0<g.length&&(c=new Il("onSelect","select",null,c,h),a.push({event:c,listeners:g}),c.target=wt)))}function an(a,c){var h={};return h[a.toLowerCase()]=c.toLowerCase(),h["Webkit"+a]="webkit"+c,h["Moz"+a]="moz"+c,h}var Kt={animationend:an("Animation","AnimationEnd"),animationiteration:an("Animation","AnimationIteration"),animationstart:an("Animation","AnimationStart"),transitionrun:an("Transition","TransitionRun"),transitionstart:an("Transition","TransitionStart"),transitioncancel:an("Transition","TransitionCancel"),transitionend:an("Transition","TransitionEnd")},tn={},Bn={};ta&&(Bn=document.createElement("div").style,"AnimationEvent"in window||(delete Kt.animationend.animation,delete Kt.animationiteration.animation,delete Kt.animationstart.animation),"TransitionEvent"in window||delete Kt.transitionend.transition);function Rn(a){if(tn[a])return tn[a];if(!Kt[a])return a;var c=Kt[a],h;for(h in c)if(c.hasOwnProperty(h)&&h in Bn)return tn[a]=c[h];return a}var Fr=Rn("animationend"),kr=Rn("animationiteration"),ir=Rn("animationstart"),ii=Rn("transitionrun"),Do=Rn("transitionstart"),En=Rn("transitioncancel"),ws=Rn("transitionend"),Nl=new Map,Ml="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ml.push("scrollEnd");function xs(a,c){Nl.set(a,c),Hi(c,[a])}var fn=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},_r=[],Eo=0,La=0;function rl(){for(var a=Eo,c=La=Eo=0;c<a;){var h=_r[c];_r[c++]=null;var g=_r[c];_r[c++]=null;var E=_r[c];_r[c++]=null;var O=_r[c];if(_r[c++]=null,g!==null&&E!==null){var ae=g.pending;ae===null?E.next=E:(E.next=ae.next,ae.next=E),g.pending=E}O!==0&&df(h,E,O)}}function il(a,c,h,g){_r[Eo++]=a,_r[Eo++]=c,_r[Eo++]=h,_r[Eo++]=g,La|=g,a.lanes|=g,a=a.alternate,a!==null&&(a.lanes|=g)}function Bc(a,c,h,g){return il(a,c,h,g),jc(a)}function va(a,c){return il(a,null,null,c),jc(a)}function df(a,c,h){a.lanes|=h;var g=a.alternate;g!==null&&(g.lanes|=h);for(var E=!1,O=a.return;O!==null;)O.childLanes|=h,g=O.alternate,g!==null&&(g.childLanes|=h),O.tag===22&&(a=O.stateNode,a===null||a._visibility&1||(E=!0)),a=O,O=O.return;return a.tag===3?(O=a.stateNode,E&&c!==null&&(E=31-gt(h),a=O.hiddenUpdates,g=a[E],g===null?a[E]=[c]:g.push(c),c.lane=h|536870912),O):null}function jc(a){if(50<Lv)throw Lv=0,HC=null,Error(r(185));for(var c=a.return;c!==null;)a=c,c=a.return;return a.tag===3?a.stateNode:null}var ol={};function ks(a,c,h,g){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wi(a,c,h,g){return new ks(a,c,h,g)}function Dl(a){return a=a.prototype,!(!a||!a.isReactComponent)}function go(a,c){var h=a.alternate;return h===null?(h=Wi(a.tag,c,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=c,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&65011712,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,c=a.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h.refCleanup=a.refCleanup,h}function ac(a,c){a.flags&=65011714;var h=a.alternate;return h===null?(a.childLanes=0,a.lanes=c,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=h.childLanes,a.lanes=h.lanes,a.child=h.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=h.memoizedProps,a.memoizedState=h.memoizedState,a.updateQueue=h.updateQueue,a.type=h.type,c=h.dependencies,a.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),a}function ia(a,c,h,g,E,O){var ae=0;if(g=a,typeof a=="function")Dl(a)&&(ae=1);else if(typeof a=="string")ae=LH(a,h,ve.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case F:return a=Wi(31,h,c,E),a.elementType=F,a.lanes=O,a;case k:return Is(h.children,E,O,c);case S:ae=8,E|=24;break;case x:return a=Wi(12,h,c,E|2),a.elementType=x,a.lanes=O,a;case D:return a=Wi(13,h,c,E),a.elementType=D,a.lanes=O,a;case P:return a=Wi(19,h,c,E),a.elementType=P,a.lanes=O,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case C:ae=10;break e;case T:ae=9;break e;case I:ae=11;break e;case V:ae=14;break e;case ee:ae=16,g=null;break e}ae=29,h=Error(r(130,a===null?"null":typeof a,"")),g=null}return c=Wi(ae,h,c,E),c.elementType=a,c.type=g,c.lanes=O,c}function Is(a,c,h,g){return a=Wi(7,a,g,c),a.lanes=h,a}function Ll(a,c,h){return a=Wi(6,a,null,c),a.lanes=h,a}function lc(a){var c=Wi(18,null,null,0);return c.stateNode=a,c}function cc(a,c,h){return c=Wi(4,a.children!==null?a.children:[],a.key,c),c.lanes=h,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}var oa=new WeakMap;function oo(a,c){if(typeof a=="object"&&a!==null){var h=oa.get(a);return h!==void 0?h:(c={value:a,source:c,stack:ue(c)},oa.set(a,c),c)}return{value:a,source:c,stack:ue(c)}}var sa=[],Wo=0,Pl=null,$=0,se=[],ze=0,We=null,bt=1,Jt="";function vn(a,c){sa[Wo++]=$,sa[Wo++]=Pl,Pl=a,$=c}function qn(a,c,h){se[ze++]=bt,se[ze++]=Jt,se[ze++]=We,We=a;var g=bt;a=Jt;var E=32-gt(g)-1;g&=~(1<<E),h+=1;var O=32-gt(c)+E;if(30<O){var ae=E-E%5;O=(g&(1<<ae)-1).toString(32),g>>=ae,E-=ae,bt=1<<32-gt(c)+E|h<<E|g,Jt=O+a}else bt=1<<O|h<<E|g,Jt=a}function Cr(a){a.return!==null&&(vn(a,1),qn(a,1,0))}function ln(a){for(;a===Pl;)Pl=sa[--Wo],sa[Wo]=null,$=sa[--Wo],sa[Wo]=null;for(;a===We;)We=se[--ze],se[ze]=null,Jt=se[--ze],se[ze]=null,bt=se[--ze],se[ze]=null}function lr(a,c){se[ze++]=bt,se[ze++]=Jt,se[ze++]=We,bt=c.id,Jt=c.overflow,We=a}var wr=null,pn=null,Rt=!1,Nr=null,Sr=!1,Qr=Error(r(519));function oi(a){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ti(oo(c,a)),Qr}function Ki(a){var c=a.stateNode,h=a.type,g=a.memoizedProps;switch(c[rn]=a,c[Wn]=g,h){case"dialog":pi("cancel",c),pi("close",c);break;case"iframe":case"object":case"embed":pi("load",c);break;case"video":case"audio":for(h=0;h<Bv.length;h++)pi(Bv[h],c);break;case"source":pi("error",c);break;case"img":case"image":case"link":pi("error",c),pi("load",c);break;case"details":pi("toggle",c);break;case"input":pi("invalid",c),ui(c,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":pi("invalid",c);break;case"textarea":pi("invalid",c),Go(c,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||g.suppressHydrationWarning===!0||AI(c.textContent,h)?(g.popover!=null&&(pi("beforetoggle",c),pi("toggle",c)),g.onScroll!=null&&pi("scroll",c),g.onScrollEnd!=null&&pi("scrollend",c),g.onClick!=null&&(c.onclick=yn),c=!0):c=!1,c||oi(a,!0)}function $i(a){for(wr=a.return;wr;)switch(wr.tag){case 5:case 31:case 13:Sr=!1;return;case 27:case 3:Sr=!0;return;default:wr=wr.return}}function Gi(a){if(a!==wr)return!1;if(!Rt)return $i(a),Rt=!0,!1;var c=a.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=a.type,h=!(h!=="form"&&h!=="button")||iS(a.type,a.memoizedProps)),h=!h),h&&pn&&oi(a),$i(a),c===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));pn=PI(a)}else if(c===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));pn=PI(a)}else c===27?(c=pn,np(a.type)?(a=cS,cS=null,pn=a):pn=c):pn=wr?Hc(a.stateNode.nextSibling):null;return!0}function Mr(){pn=wr=null,Rt=!1}function qs(){var a=Nr;return a!==null&&(Gl===null?Gl=a:Gl.push.apply(Gl,a),Nr=null),a}function ti(a){Nr===null?Nr=[a]:Nr.push(a)}var so=J(null),Ji=null,Ws=null;function ba(a,c,h){le(so,c._currentValue),c._currentValue=h}function wa(a){a._currentValue=so.current,ge(so)}function Bl(a,c,h){for(;a!==null;){var g=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),a===h)break;a=a.return}}function Fc(a,c,h,g){var E=a.child;for(E!==null&&(E.return=a);E!==null;){var O=E.dependencies;if(O!==null){var ae=E.child;O=O.firstContext;e:for(;O!==null;){var _e=O;O=E;for(var rt=0;rt<c.length;rt++)if(_e.context===c[rt]){O.lanes|=h,_e=O.alternate,_e!==null&&(_e.lanes|=h),Bl(O.return,h,a),g||(ae=null);break e}O=_e.next}}else if(E.tag===18){if(ae=E.return,ae===null)throw Error(r(341));ae.lanes|=h,O=ae.alternate,O!==null&&(O.lanes|=h),Bl(ae,h,a),ae=null}else ae=E.child;if(ae!==null)ae.return=E;else for(ae=E;ae!==null;){if(ae===a){ae=null;break}if(E=ae.sibling,E!==null){E.return=ae.return,ae=E;break}ae=ae.return}E=ae}}function Xr(a,c,h,g){a=null;for(var E=c,O=!1;E!==null;){if(!O){if((E.flags&524288)!==0)O=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var ae=E.alternate;if(ae===null)throw Error(r(387));if(ae=ae.memoizedProps,ae!==null){var _e=E.type;pe(E.pendingProps.value,ae.value)||(a!==null?a.push(_e):a=[_e])}}else if(E===At.current){if(ae=E.alternate,ae===null)throw Error(r(387));ae.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(a!==null?a.push(Vv):a=[Vv])}E=E.return}a!==null&&Fc(c,a,h,g),c.flags|=262144}function sl(a){for(a=a.firstContext;a!==null;){if(!pe(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function al(a){Ji=a,Ws=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function os(a){return Mh(Ji,a)}function Nh(a,c){return Ji===null&&al(a),Mh(a,c)}function Mh(a,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},Ws===null){if(a===null)throw Error(r(308));Ws=c,a.dependencies={lanes:0,firstContext:c},a.flags|=524288}else Ws=Ws.next=c;return h}var Mg=typeof AbortController<"u"?AbortController:function(){var a=[],c=this.signal={aborted:!1,addEventListener:function(h,g){a.push(g)}};this.abort=function(){c.aborted=!0,a.forEach(function(h){return h()})}},Dg=e.unstable_scheduleCallback,sv=e.unstable_NormalPriority,fi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ko(){return{controller:new Mg,data:new Map,refCount:0}}function xa(a){a.refCount--,a.refCount===0&&Dg(sv,function(){a.controller.abort()})}var uc=null,Qu=0,jl=0,Yo=null;function Lg(a,c){if(uc===null){var h=uc=[];Qu=0,jl=YC(),Yo={status:"pending",value:void 0,then:function(g){h.push(g)}}}return Qu++,c.then(Dh,Dh),c}function Dh(){if(--Qu===0&&uc!==null){Yo!==null&&(Yo.status="fulfilled");var a=uc;uc=null,jl=0,Yo=null;for(var c=0;c<a.length;c++)(0,a[c])()}}function mn(a,c){var h=[],g={status:"pending",value:null,reason:null,then:function(E){h.push(E)}};return a.then(function(){g.status="fulfilled",g.value=c;for(var E=0;E<h.length;E++)(0,h[E])(c)},function(E){for(g.status="rejected",g.reason=E,E=0;E<h.length;E++)(0,h[E])(void 0)}),g}var Mn=U.S;U.S=function(a,c){ZT=Le(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&Lg(a,c),Mn!==null&&Mn(a,c)};var cr=J(null);function si(){var a=cr.current;return a!==null?a:lo.pooledCache}function Oi(a,c){c===null?le(cr,cr.current):le(cr,c.pool)}function Er(){var a=si();return a===null?null:{parent:fi._currentValue,pool:a}}var Lo=Error(r(460)),aa=Error(r(474)),zc=Error(r(542)),ll={then:function(){}};function ff(a){return a=a.status,a==="fulfilled"||a==="rejected"}function ss(a,c,h){switch(h=a[h],h===void 0?a.push(c):h!==c&&(c.then(yn,yn),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw a=c.reason,M2(a),a;default:if(typeof c.status=="string")c.then(yn,yn);else{if(a=lo,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=c,a.status="pending",a.then(function(g){if(c.status==="pending"){var E=c;E.status="fulfilled",E.value=g}},function(g){if(c.status==="pending"){var E=c;E.status="rejected",E.reason=g}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw a=c.reason,M2(a),a}throw Pa=c,Lo}}function hf(a){try{var c=a._init;return c(a._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Pa=h,Lo):h}}var Pa=null;function N2(){if(Pa===null)throw Error(r(459));var a=Pa;return Pa=null,a}function M2(a){if(a===Lo||a===zc)throw Error(r(483))}var Ju=null,cm=0;function Pg(a){var c=cm;return cm+=1,Ju===null&&(Ju=[]),ss(Ju,a,c)}function um(a,c){c=c.props.ref,a.ref=c!==void 0?c:null}function Bg(a,c){throw c.$$typeof===m?Error(r(525)):(a=Object.prototype.toString.call(c),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a)))}function D2(a){function c(Ct,ft){if(a){var Nt=Ct.deletions;Nt===null?(Ct.deletions=[ft],Ct.flags|=16):Nt.push(ft)}}function h(Ct,ft){if(!a)return null;for(;ft!==null;)c(Ct,ft),ft=ft.sibling;return null}function g(Ct){for(var ft=new Map;Ct!==null;)Ct.key!==null?ft.set(Ct.key,Ct):ft.set(Ct.index,Ct),Ct=Ct.sibling;return ft}function E(Ct,ft){return Ct=go(Ct,ft),Ct.index=0,Ct.sibling=null,Ct}function O(Ct,ft,Nt){return Ct.index=Nt,a?(Nt=Ct.alternate,Nt!==null?(Nt=Nt.index,Nt<ft?(Ct.flags|=67108866,ft):Nt):(Ct.flags|=67108866,ft)):(Ct.flags|=1048576,ft)}function ae(Ct){return a&&Ct.alternate===null&&(Ct.flags|=67108866),Ct}function _e(Ct,ft,Nt,nn){return ft===null||ft.tag!==6?(ft=Ll(Nt,Ct.mode,nn),ft.return=Ct,ft):(ft=E(ft,Nt),ft.return=Ct,ft)}function rt(Ct,ft,Nt,nn){var xr=Nt.type;return xr===k?Qt(Ct,ft,Nt.props.children,nn,Nt.key):ft!==null&&(ft.elementType===xr||typeof xr=="object"&&xr!==null&&xr.$$typeof===ee&&hf(xr)===ft.type)?(ft=E(ft,Nt.props),um(ft,Nt),ft.return=Ct,ft):(ft=ia(Nt.type,Nt.key,Nt.props,null,Ct.mode,nn),um(ft,Nt),ft.return=Ct,ft)}function Mt(Ct,ft,Nt,nn){return ft===null||ft.tag!==4||ft.stateNode.containerInfo!==Nt.containerInfo||ft.stateNode.implementation!==Nt.implementation?(ft=cc(Nt,Ct.mode,nn),ft.return=Ct,ft):(ft=E(ft,Nt.children||[]),ft.return=Ct,ft)}function Qt(Ct,ft,Nt,nn,xr){return ft===null||ft.tag!==7?(ft=Is(Nt,Ct.mode,nn,xr),ft.return=Ct,ft):(ft=E(ft,Nt),ft.return=Ct,ft)}function on(Ct,ft,Nt){if(typeof ft=="string"&&ft!==""||typeof ft=="number"||typeof ft=="bigint")return ft=Ll(""+ft,Ct.mode,Nt),ft.return=Ct,ft;if(typeof ft=="object"&&ft!==null){switch(ft.$$typeof){case y:return Nt=ia(ft.type,ft.key,ft.props,null,Ct.mode,Nt),um(Nt,ft),Nt.return=Ct,Nt;case b:return ft=cc(ft,Ct.mode,Nt),ft.return=Ct,ft;case ee:return ft=hf(ft),on(Ct,ft,Nt)}if(W(ft)||M(ft))return ft=Is(ft,Ct.mode,Nt,null),ft.return=Ct,ft;if(typeof ft.then=="function")return on(Ct,Pg(ft),Nt);if(ft.$$typeof===C)return on(Ct,Nh(Ct,ft),Nt);Bg(Ct,ft)}return null}function Pt(Ct,ft,Nt,nn){var xr=ft!==null?ft.key:null;if(typeof Nt=="string"&&Nt!==""||typeof Nt=="number"||typeof Nt=="bigint")return xr!==null?null:_e(Ct,ft,""+Nt,nn);if(typeof Nt=="object"&&Nt!==null){switch(Nt.$$typeof){case y:return Nt.key===xr?rt(Ct,ft,Nt,nn):null;case b:return Nt.key===xr?Mt(Ct,ft,Nt,nn):null;case ee:return Nt=hf(Nt),Pt(Ct,ft,Nt,nn)}if(W(Nt)||M(Nt))return xr!==null?null:Qt(Ct,ft,Nt,nn,null);if(typeof Nt.then=="function")return Pt(Ct,ft,Pg(Nt),nn);if(Nt.$$typeof===C)return Pt(Ct,ft,Nh(Ct,Nt),nn);Bg(Ct,Nt)}return null}function Gt(Ct,ft,Nt,nn,xr){if(typeof nn=="string"&&nn!==""||typeof nn=="number"||typeof nn=="bigint")return Ct=Ct.get(Nt)||null,_e(ft,Ct,""+nn,xr);if(typeof nn=="object"&&nn!==null){switch(nn.$$typeof){case y:return Ct=Ct.get(nn.key===null?Nt:nn.key)||null,rt(ft,Ct,nn,xr);case b:return Ct=Ct.get(nn.key===null?Nt:nn.key)||null,Mt(ft,Ct,nn,xr);case ee:return nn=hf(nn),Gt(Ct,ft,Nt,nn,xr)}if(W(nn)||M(nn))return Ct=Ct.get(Nt)||null,Qt(ft,Ct,nn,xr,null);if(typeof nn.then=="function")return Gt(Ct,ft,Nt,Pg(nn),xr);if(nn.$$typeof===C)return Gt(Ct,ft,Nt,Nh(ft,nn),xr);Bg(ft,nn)}return null}function Qn(Ct,ft,Nt,nn){for(var xr=null,Li=null,ar=ft,Jr=ft=0,wi=null;ar!==null&&Jr<Nt.length;Jr++){ar.index>Jr?(wi=ar,ar=null):wi=ar.sibling;var Pi=Pt(Ct,ar,Nt[Jr],nn);if(Pi===null){ar===null&&(ar=wi);break}a&&ar&&Pi.alternate===null&&c(Ct,ar),ft=O(Pi,ft,Jr),Li===null?xr=Pi:Li.sibling=Pi,Li=Pi,ar=wi}if(Jr===Nt.length)return h(Ct,ar),Rt&&vn(Ct,Jr),xr;if(ar===null){for(;Jr<Nt.length;Jr++)ar=on(Ct,Nt[Jr],nn),ar!==null&&(ft=O(ar,ft,Jr),Li===null?xr=ar:Li.sibling=ar,Li=ar);return Rt&&vn(Ct,Jr),xr}for(ar=g(ar);Jr<Nt.length;Jr++)wi=Gt(ar,Ct,Jr,Nt[Jr],nn),wi!==null&&(a&&wi.alternate!==null&&ar.delete(wi.key===null?Jr:wi.key),ft=O(wi,ft,Jr),Li===null?xr=wi:Li.sibling=wi,Li=wi);return a&&ar.forEach(function(ap){return c(Ct,ap)}),Rt&&vn(Ct,Jr),xr}function Ir(Ct,ft,Nt,nn){if(Nt==null)throw Error(r(151));for(var xr=null,Li=null,ar=ft,Jr=ft=0,wi=null,Pi=Nt.next();ar!==null&&!Pi.done;Jr++,Pi=Nt.next()){ar.index>Jr?(wi=ar,ar=null):wi=ar.sibling;var ap=Pt(Ct,ar,Pi.value,nn);if(ap===null){ar===null&&(ar=wi);break}a&&ar&&ap.alternate===null&&c(Ct,ar),ft=O(ap,ft,Jr),Li===null?xr=ap:Li.sibling=ap,Li=ap,ar=wi}if(Pi.done)return h(Ct,ar),Rt&&vn(Ct,Jr),xr;if(ar===null){for(;!Pi.done;Jr++,Pi=Nt.next())Pi=on(Ct,Pi.value,nn),Pi!==null&&(ft=O(Pi,ft,Jr),Li===null?xr=Pi:Li.sibling=Pi,Li=Pi);return Rt&&vn(Ct,Jr),xr}for(ar=g(ar);!Pi.done;Jr++,Pi=Nt.next())Pi=Gt(ar,Ct,Jr,Pi.value,nn),Pi!==null&&(a&&Pi.alternate!==null&&ar.delete(Pi.key===null?Jr:Pi.key),ft=O(Pi,ft,Jr),Li===null?xr=Pi:Li.sibling=Pi,Li=Pi);return a&&ar.forEach(function(qH){return c(Ct,qH)}),Rt&&vn(Ct,Jr),xr}function to(Ct,ft,Nt,nn){if(typeof Nt=="object"&&Nt!==null&&Nt.type===k&&Nt.key===null&&(Nt=Nt.props.children),typeof Nt=="object"&&Nt!==null){switch(Nt.$$typeof){case y:e:{for(var xr=Nt.key;ft!==null;){if(ft.key===xr){if(xr=Nt.type,xr===k){if(ft.tag===7){h(Ct,ft.sibling),nn=E(ft,Nt.props.children),nn.return=Ct,Ct=nn;break e}}else if(ft.elementType===xr||typeof xr=="object"&&xr!==null&&xr.$$typeof===ee&&hf(xr)===ft.type){h(Ct,ft.sibling),nn=E(ft,Nt.props),um(nn,Nt),nn.return=Ct,Ct=nn;break e}h(Ct,ft);break}else c(Ct,ft);ft=ft.sibling}Nt.type===k?(nn=Is(Nt.props.children,Ct.mode,nn,Nt.key),nn.return=Ct,Ct=nn):(nn=ia(Nt.type,Nt.key,Nt.props,null,Ct.mode,nn),um(nn,Nt),nn.return=Ct,Ct=nn)}return ae(Ct);case b:e:{for(xr=Nt.key;ft!==null;){if(ft.key===xr)if(ft.tag===4&&ft.stateNode.containerInfo===Nt.containerInfo&&ft.stateNode.implementation===Nt.implementation){h(Ct,ft.sibling),nn=E(ft,Nt.children||[]),nn.return=Ct,Ct=nn;break e}else{h(Ct,ft);break}else c(Ct,ft);ft=ft.sibling}nn=cc(Nt,Ct.mode,nn),nn.return=Ct,Ct=nn}return ae(Ct);case ee:return Nt=hf(Nt),to(Ct,ft,Nt,nn)}if(W(Nt))return Qn(Ct,ft,Nt,nn);if(M(Nt)){if(xr=M(Nt),typeof xr!="function")throw Error(r(150));return Nt=xr.call(Nt),Ir(Ct,ft,Nt,nn)}if(typeof Nt.then=="function")return to(Ct,ft,Pg(Nt),nn);if(Nt.$$typeof===C)return to(Ct,ft,Nh(Ct,Nt),nn);Bg(Ct,Nt)}return typeof Nt=="string"&&Nt!==""||typeof Nt=="number"||typeof Nt=="bigint"?(Nt=""+Nt,ft!==null&&ft.tag===6?(h(Ct,ft.sibling),nn=E(ft,Nt),nn.return=Ct,Ct=nn):(h(Ct,ft),nn=Ll(Nt,Ct.mode,nn),nn.return=Ct,Ct=nn),ae(Ct)):h(Ct,ft)}return function(Ct,ft,Nt,nn){try{cm=0;var xr=to(Ct,ft,Nt,nn);return Ju=null,xr}catch(ar){if(ar===Lo||ar===zc)throw ar;var Li=Wi(29,ar,null,Ct.mode);return Li.lanes=nn,Li.return=Ct,Li}finally{}}}var pf=D2(!0),Lh=D2(!1),ed=!1;function av(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jg(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function td(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}
vendor: 4,524 bytes, line 48
48function nd(a,c,h){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(Fi&2)!==0){var E=g.pending;return E===null?c.next=c:(c.next=E.next,E.next=c),g.pending=c,c=jc(a),df(a,null,h),c}return il(a,g,c,h),jc(a)}function dm(a,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var g=c.lanes;g&=a.pendingLanes,h|=g,c.lanes=h,qe(a,h)}}function lv(a,c){var h=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var E=null,O=null;if(h=h.firstBaseUpdate,h!==null){do{var ae={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};O===null?E=O=ae:O=O.next=ae,h=h.next}while(h!==null);O===null?E=O=c:O=O.next=c}else E=O=c;h={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:O,shared:g.shared,callbacks:g.callbacks},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=c}var Fg=!1;function fm(){if(Fg){var a=Yo;if(a!==null)throw a}}function hm(a,c,h,g){Fg=!1;var E=a.updateQueue;ed=!1;var O=E.firstBaseUpdate,ae=E.lastBaseUpdate,_e=E.shared.pending;if(_e!==null){E.shared.pending=null;var rt=_e,Mt=rt.next;rt.next=null,ae===null?O=Mt:ae.next=Mt,ae=rt;var Qt=a.alternate;Qt!==null&&(Qt=Qt.updateQueue,_e=Qt.lastBaseUpdate,_e!==ae&&(_e===null?Qt.firstBaseUpdate=Mt:_e.next=Mt,Qt.lastBaseUpdate=rt))}if(O!==null){var on=E.baseState;ae=0,Qt=Mt=rt=null,_e=O;do{var Pt=_e.lane&-536870913,Gt=Pt!==_e.lane;if(Gt?(bi&Pt)===Pt:(g&Pt)===Pt){Pt!==0&&Pt===jl&&(Fg=!0),Qt!==null&&(Qt=Qt.next={lane:0,tag:_e.tag,payload:_e.payload,callback:null,next:null});e:{var Qn=a,Ir=_e;Pt=c;var to=h;switch(Ir.tag){case 1:if(Qn=Ir.payload,typeof Qn=="function"){on=Qn.call(to,on,Pt);break e}on=Qn;break e;case 3:Qn.flags=Qn.flags&-65537|128;case 0:if(Qn=Ir.payload,Pt=typeof Qn=="function"?Qn.call(to,on,Pt):Qn,Pt==null)break e;on=p({},on,Pt);break e;case 2:ed=!0}}Pt=_e.callback,Pt!==null&&(a.flags|=64,Gt&&(a.flags|=8192),Gt=E.callbacks,Gt===null?E.callbacks=[Pt]:Gt.push(Pt))}else Gt={lane:Pt,tag:_e.tag,payload:_e.payload,callback:_e.callback,next:null},Qt===null?(Mt=Qt=Gt,rt=on):Qt=Qt.next=Gt,ae|=Pt;if(_e=_e.next,_e===null){if(_e=E.shared.pending,_e===null)break;Gt=_e,_e=Gt.next,Gt.next=null,E.lastBaseUpdate=Gt,E.shared.pending=null}}while(!0);Qt===null&&(rt=on),E.baseState=rt,E.firstBaseUpdate=Mt,E.lastBaseUpdate=Qt,O===null&&(E.shared.lanes=0),Zh|=ae,a.lanes=ae,a.memoizedState=on}}function cv(a,c){if(typeof a!="function")throw Error(r(191,a));a.call(c)}function L2(a,c){var h=a.callbacks;if(h!==null)for(a.callbacks=null,a=0;a<h.length;a++)cv(h[a],c)}var Ph=J(null),zg=J(0);function P2(a,c){a=Sf,le(zg,a),le(Ph,c),Sf=a|c.baseLanes}function uv(){le(zg,Sf),le(Ph,Ph.current)}function dv(){Sf=zg.current,ge(Ph),ge(zg)}var cl=J(null),Ba=null;function Fl(a){var c=a.alternate;le(Xo,Xo.current&1),le(cl,a),Ba===null&&(c===null||Ph.current!==null||c.memoizedState!==null)&&(Ba=a)}function Bh(a){le(Xo,Xo.current),le(cl,a),Ba===null&&(Ba=a)}function B2(a){a.tag===22?(le(Xo,Xo.current),le(cl,a),Ba===null&&(Ba=a)):rd()}function rd(){le(Xo,Xo.current),le(cl,cl.current)}function ka(a){ge(cl),Ba===a&&(Ba=null),ge(Xo)}var Xo=J(0);function pm(a){for(var c=a;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||aS(h)||lS(h)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var vu=0,Ur=null,ji=null,Zo=null,mf=!1,jh=!1,id=!1,Ug=0,od=0,bu=null,Vg=0;function Po(){throw Error(r(321))}function fv(a,c){if(c===null)return!1;for(var h=0;h<c.length&&h<a.length;h++)if(!pe(a[h],c[h]))return!1;return!0}function mm(a,c,h,g,E,O){return vu=O,Ur=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,U.H=a===null||a.memoizedState===null?Rs:yi,id=!1,O=h(g,E),id=!1,jh&&(O=Hg(c,h,g,E)),j2(a),O}function j2(a){U.H=Ks;var c=ji!==null&&ji.next!==null;if(vu=0,Zo=ji=Ur=null,mf=!1,od=0,bu=null,c)throw Error(r(300));a===null||Qo||(a=a.dependencies,a!==null&&sl(a)&&(Qo=!0))}function Hg(a,c,h,g){Ur=a;var E=0;do{if(jh&&(bu=null),od=0,jh=!1,25<=E)throw Error(r(301));if(E+=1,Zo=ji=null,a.updateQueue!=null){var O=a.updateQueue;O.lastEffect=null,O.events=null,O.stores=null,O.memoCache!=null&&(O.memoCache.index=0)}U.H=zl,O=c(h,g)}while(jh);return O}
vendor: 17,550 bytes, line 48
48function OC(){var a=U.H,c=a.useState()[0];return c=typeof c.then=="function"?Fh(c):c,a=a.useState()[0],(ji!==null?ji.memoizedState:null)!==a&&(Ur.flags|=1024),c}function wu(){var a=Ug!==0;return Ug=0,a}function gm(a,c,h){c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~h}function hv(a){if(mf){for(a=a.memoizedState;a!==null;){var c=a.queue;c!==null&&(c.pending=null),a=a.next}mf=!1}vu=0,Zo=ji=Ur=null,jh=!1,od=Ug=0,bu=null}function la(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zo===null?Ur.memoizedState=Zo=a:Zo=Zo.next=a,Zo}function Bo(){if(ji===null){var a=Ur.alternate;a=a!==null?a.memoizedState:null}else a=ji.next;var c=Zo===null?Ur.memoizedState:Zo.next;if(c!==null)Zo=c,ji=a;else{if(a===null)throw Ur.alternate===null?Error(r(467)):Error(r(310));ji=a,a={memoizedState:ji.memoizedState,baseState:ji.baseState,baseQueue:ji.baseQueue,queue:ji.queue,next:null},Zo===null?Ur.memoizedState=Zo=a:Zo=Zo.next=a}return Zo}function gf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fh(a){var c=od;return od+=1,bu===null&&(bu=[]),a=ss(bu,a,c),c=Ur,(Zo===null?c.memoizedState:Zo.next)===null&&(c=c.alternate,U.H=c===null||c.memoizedState===null?Rs:yi),a}function sd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Fh(a);if(a.$$typeof===C)return os(a)}throw Error(r(438,String(a)))}function pv(a){var c=null,h=Ur.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var g=Ur.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(c={data:g.data.map(function(E){return E.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=gf(),Ur.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(a),g=0;g<a;g++)h[g]=H;return c.index++,h}function ja(a,c){return typeof c=="function"?c(a):c}function yf(a){var c=Bo();return mv(c,ji,a)}function mv(a,c,h){var g=a.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var E=a.baseQueue,O=g.pending;if(O!==null){if(E!==null){var ae=E.next;E.next=O.next,O.next=ae}c.baseQueue=E=O,g.pending=null}if(O=a.baseState,E===null)a.memoizedState=O;else{c=E.next;var _e=ae=null,rt=null,Mt=c,Qt=!1;do{var on=Mt.lane&-536870913;if(on!==Mt.lane?(bi&on)===on:(vu&on)===on){var Pt=Mt.revertLane;if(Pt===0)rt!==null&&(rt=rt.next={lane:0,revertLane:0,gesture:null,action:Mt.action,hasEagerState:Mt.hasEagerState,eagerState:Mt.eagerState,next:null}),on===jl&&(Qt=!0);else if((vu&Pt)===Pt){Mt=Mt.next,Pt===jl&&(Qt=!0);continue}else on={lane:0,revertLane:Mt.revertLane,gesture:null,action:Mt.action,hasEagerState:Mt.hasEagerState,eagerState:Mt.eagerState,next:null},rt===null?(_e=rt=on,ae=O):rt=rt.next=on,Ur.lanes|=Pt,Zh|=Pt;on=Mt.action,id&&h(O,on),O=Mt.hasEagerState?Mt.eagerState:h(O,on)}else Pt={lane:on,revertLane:Mt.revertLane,gesture:Mt.gesture,action:Mt.action,hasEagerState:Mt.hasEagerState,eagerState:Mt.eagerState,next:null},rt===null?(_e=rt=Pt,ae=O):rt=rt.next=Pt,Ur.lanes|=on,Zh|=on;Mt=Mt.next}while(Mt!==null&&Mt!==c);if(rt===null?ae=O:rt.next=_e,!pe(O,a.memoizedState)&&(Qo=!0,Qt&&(h=Yo,h!==null)))throw h;a.memoizedState=O,a.baseState=ae,a.baseQueue=rt,g.lastRenderedState=O}return E===null&&(g.lanes=0),[a.memoizedState,g.dispatch]}function Fa(a){var c=Bo(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=a;var g=h.dispatch,E=h.pending,O=c.memoizedState;if(E!==null){h.pending=null;var ae=E=E.next;do O=a(O,ae.action),ae=ae.next;while(ae!==E);pe(O,c.memoizedState)||(Qo=!0),c.memoizedState=O,c.baseQueue===null&&(c.baseState=O),h.lastRenderedState=O}return[O,g]}function $g(a,c,h){var g=Ur,E=Bo(),O=Rt;if(O){if(h===void 0)throw Error(r(407));h=h()}else h=c();var ae=!pe((ji||E).memoizedState,h);if(ae&&(E.memoizedState=h,Qo=!0),E=E.queue,$h(F2.bind(null,g,E,a),[a]),E.getSnapshot!==c||ae||Zo!==null&&Zo.memoizedState.tag&1){if(g.flags|=2048,Hh(9,{destroy:void 0},yv.bind(null,g,E,h,c),null),lo===null)throw Error(r(349));O||(vu&127)!==0||gv(g,c,h)}return h}function gv(a,c,h){a.flags|=16384,a={getSnapshot:c,value:h},c=Ur.updateQueue,c===null?(c=gf(),Ur.updateQueue=c,c.stores=[a]):(h=c.stores,h===null?c.stores=[a]:h.push(a))}function yv(a,c,h,g){c.value=h,c.getSnapshot=g,z2(c)&&vv(a)}function F2(a,c,h){return h(function(){z2(c)&&vv(a)})}function z2(a){var c=a.getSnapshot;a=a.value;try{var h=c();return!pe(a,h)}catch{return!0}}function vv(a){var c=va(a,2);c!==null&&ql(c,a,2)}function zh(a){var c=la();if(typeof a=="function"){var h=a;if(a=h(),id){lt(!0);try{h()}finally{lt(!1)}}}return c.memoizedState=c.baseState=a,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:a},c}function U2(a,c,h,g){return a.baseState=h,mv(a,ji,typeof g=="function"?g:ja)}function ym(a,c,h,g,E){if(ul(a))throw Error(r(485));if(a=c.action,a!==null){var O={payload:E,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(ae){O.listeners.push(ae)}};U.T!==null?h(!0):O.isTransition=!1,g(O),h=c.pending,h===null?(O.next=c.pending=O,vm(c,O)):(O.next=h.next,c.pending=h.next=O)}}function vm(a,c){var h=c.action,g=c.payload,E=a.state;if(c.isTransition){var O=U.T,ae={};U.T=ae;try{var _e=h(E,g),rt=U.S;rt!==null&&rt(ae,_e),ad(a,c,_e)}catch(Mt){Uh(a,c,Mt)}finally{O!==null&&ae.types!==null&&(O.types=ae.types),U.T=O}}else try{O=h(E,g),ad(a,c,O)}catch(Mt){Uh(a,c,Mt)}}function ad(a,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){Gg(a,c,g)},function(g){return Uh(a,c,g)}):Gg(a,c,h)}function Gg(a,c,h){c.status="fulfilled",c.value=h,Vh(c),a.state=h,c=a.pending,c!==null&&(h=c.next,h===c?a.pending=null:(h=h.next,c.next=h,vm(a,h)))}function Uh(a,c,h){var g=a.pending;if(a.pending=null,g!==null){g=g.next;do c.status="rejected",c.reason=h,Vh(c),c=c.next;while(c!==g)}a.action=null}function Vh(a){a=a.listeners;for(var c=0;c<a.length;c++)(0,a[c])()}function bm(a,c){return c}function V2(a,c){if(Rt){var h=lo.formState;if(h!==null){e:{var g=Ur;if(Rt){if(pn){t:{for(var E=pn,O=Sr;E.nodeType!==8;){if(!O){E=null;break t}if(E=Hc(E.nextSibling),E===null){E=null;break t}}O=E.data,E=O==="F!"||O==="F"?E:null}if(E){pn=Hc(E.nextSibling),g=E.data==="F!";break e}}oi(g)}g=!1}g&&(c=h[0])}}return h=la(),h.memoizedState=h.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bm,lastRenderedState:c},h.queue=g,h=Cm.bind(null,Ur,g),g.dispatch=h,g=zh(!1),O=qh.bind(null,Ur,!1,g.queue),g=la(),E={state:c,dispatch:null,action:a,pending:null},g.queue=E,h=ym.bind(null,Ur,E,O,h),E.dispatch=h,g.memoizedState=a,[c,h,!1]}function H2(a){var c=Bo();return qg(c,ji,a)}function qg(a,c,h){if(c=mv(a,c,bm)[0],a=yf(ja)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var g=Fh(c)}catch(ae){throw ae===Lo?zc:ae}else g=c;c=Bo();var E=c.queue,O=E.dispatch;return h!==c.memoizedState&&(Ur.flags|=2048,Hh(9,{destroy:void 0},bv.bind(null,E,h),null)),[g,O,a]}function bv(a,c){a.action=c}function Wg(a){var c=Bo(),h=ji;if(h!==null)return qg(c,h,a);Bo(),c=c.memoizedState,h=Bo();var g=h.queue.dispatch;return h.memoizedState=a,[c,g,!1]}function Hh(a,c,h,g){return a={tag:a,create:h,deps:g,inst:c,next:null},c=Ur.updateQueue,c===null&&(c=gf(),Ur.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=a.next=a:(g=h.next,h.next=a,a.next=g,c.lastEffect=a),a}function wm(){return Bo().memoizedState}function xm(a,c,h,g){var E=la();Ur.flags|=a,E.memoizedState=Hh(1|c,{destroy:void 0},h,g===void 0?null:g)}function vf(a,c,h,g){var E=Bo();g=g===void 0?null:g;var O=E.memoizedState.inst;ji!==null&&g!==null&&fv(g,ji.memoizedState.deps)?E.memoizedState=Hh(c,O,h,g):(Ur.flags|=a,E.memoizedState=Hh(1|c,O,h,g))}function $2(a,c){xm(8390656,8,a,c)}function $h(a,c){vf(2048,8,a,c)}function NC(a){Ur.flags|=4;var c=Ur.updateQueue;if(c===null)c=gf(),Ur.updateQueue=c,c.events=[a];else{var h=c.events;h===null?c.events=[a]:h.push(a)}}function wv(a){var c=Bo().memoizedState;return NC({ref:c,nextImpl:a}),function(){if((Fi&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function G2(a,c){return vf(4,2,a,c)}function Kg(a,c){return vf(4,4,a,c)}function xv(a,c){if(typeof c=="function"){a=a();var h=c(a);return function(){typeof h=="function"?h():c(null)}}if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function bf(a,c,h){h=h!=null?h.concat([a]):null,vf(4,4,xv.bind(null,c,a),h)}function km(){}function kv(a,c){var h=Bo();c=c===void 0?null:c;var g=h.memoizedState;return c!==null&&fv(c,g[1])?g[0]:(h.memoizedState=[a,c],a)}function _m(a,c){var h=Bo();c=c===void 0?null:c;var g=h.memoizedState;if(c!==null&&fv(c,g[1]))return g[0];if(g=a(),id){lt(!0);try{a()}finally{lt(!1)}}return h.memoizedState=[g,c],g}function Yg(a,c,h){return h===void 0||(vu&1073741824)!==0&&(bi&261930)===0?a.memoizedState=c:(a.memoizedState=h,a=JT(),Ur.lanes|=a,Zh|=a,h)}function q2(a,c,h,g){return pe(h,c)?h:Ph.current!==null?(a=Yg(a,h,g),pe(a,c)||(Qo=!0),a):(vu&42)===0||(vu&1073741824)!==0&&(bi&261930)===0?(Qo=!0,a.memoizedState=h):(a=JT(),Ur.lanes|=a,Zh|=a,c)}function W2(a,c,h,g,E){var O=q.p;q.p=O!==0&&8>O?O:8;var ae=U.T,_e={};U.T=_e,qh(a,!1,c,h);try{var rt=E(),Mt=U.S;if(Mt!==null&&Mt(_e,rt),rt!==null&&typeof rt=="object"&&typeof rt.then=="function"){var Qt=mn(rt,g);sr(a,c,Qt,gc(a))}else sr(a,c,g,gc(a))}catch(on){sr(a,c,{then:function(){},status:"rejected",reason:on},gc())}finally{q.p=O,ae!==null&&_e.types!==null&&(ae.types=_e.types),U.T=ae}}function Xg(){}function Zg(a,c,h,g){if(a.tag!==5)throw Error(r(476));var E=_v(a).queue;W2(a,E,c,Q,h===null?Xg:function(){return Gh(a),h(g)})}function _v(a){var c=a.memoizedState;if(c!==null)return c;c={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:Q},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:h},next:null},a.memoizedState=c,a=a.alternate,a!==null&&(a.memoizedState=c),c}function Gh(a){var c=_v(a);c.next===null&&(c=a.alternate.memoizedState),sr(a,c.next.queue,{},gc())}function Cv(){return os(Vv)}function K2(){return Bo().memoizedState}function Y2(){return Bo().memoizedState}function MC(a){for(var c=a.return;c!==null;){switch(c.tag){case 24:case 3:var h=gc();a=td(h);var g=nd(c,a,h);g!==null&&(ql(g,c,h),dm(g,c,h)),c={cache:Ko()},a.payload=c;return}c=c.return}}function DC(a,c,h){var g=gc();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ul(a)?za(c,h):(h=Bc(a,c,h,g),h!==null&&(ql(h,a,g),Wh(h,c,g)))}function Cm(a,c,h){var g=gc();sr(a,c,h,g)}function sr(a,c,h,g){var E={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(ul(a))za(c,E);else{var O=a.alternate;if(a.lanes===0&&(O===null||O.lanes===0)&&(O=c.lastRenderedReducer,O!==null))try{var ae=c.lastRenderedState,_e=O(ae,h);if(E.hasEagerState=!0,E.eagerState=_e,pe(_e,ae))return il(a,c,E,0),lo===null&&rl(),!1}catch{}finally{}if(h=Bc(a,c,E,g),h!==null)return ql(h,a,g),Wh(h,c,g),!0}return!1}function qh(a,c,h,g){if(g={lane:2,revertLane:YC(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},ul(a)){if(c)throw Error(r(479))}else c=Bc(a,h,g,2),c!==null&&ql(c,a,2)}function ul(a){var c=a.alternate;return a===Ur||c!==null&&c===Ur}function za(a,c){jh=mf=!0;var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}function Wh(a,c,h){if((h&4194048)!==0){var g=c.lanes;g&=a.pendingLanes,h|=g,c.lanes=h,qe(a,h)}}var Ks={readContext:os,use:sd,useCallback:Po,useContext:Po,useEffect:Po,useImperativeHandle:Po,useLayoutEffect:Po,useInsertionEffect:Po,useMemo:Po,useReducer:Po,useRef:Po,useState:Po,useDebugValue:Po,useDeferredValue:Po,useTransition:Po,useSyncExternalStore:Po,useId:Po,useHostTransitionStatus:Po,useFormState:Po,useActionState:Po,useOptimistic:Po,useMemoCache:Po,useCacheRefresh:Po};Ks.useEffectEvent=Po;var Rs={readContext:os,use:sd,useCallback:function(a,c){return la().memoizedState=[a,c===void 0?null:c],a},useContext:os,useEffect:$2,useImperativeHandle:function(a,c,h){h=h!=null?h.concat([a]):null,xm(4194308,4,xv.bind(null,c,a),h)},useLayoutEffect:function(a,c){return xm(4194308,4,a,c)},useInsertionEffect:function(a,c){xm(4,2,a,c)},useMemo:function(a,c){var h=la();c=c===void 0?null:c;var g=a();if(id){lt(!0);try{a()}finally{lt(!1)}}return h.memoizedState=[g,c],g},useReducer:function(a,c,h){var g=la();if(h!==void 0){var E=h(c);if(id){lt(!0);try{h(c)}finally{lt(!1)}}}else E=c;return g.memoizedState=g.baseState=E,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:E},g.queue=a,a=a.dispatch=DC.bind(null,Ur,a),[g.memoizedState,a]},useRef:function(a){var c=la();return a={current:a},c.memoizedState=a},useState:function(a){a=zh(a);var c=a.queue,h=Cm.bind(null,Ur,c);return c.dispatch=h,[a.memoizedState,h]},useDebugValue:km,useDeferredValue:function(a,c){var h=la();return Yg(h,a,c)},useTransition:function(){var a=zh(!1);return a=W2.bind(null,Ur,a.queue,!0,!1),la().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,c,h){var g=Ur,E=la();if(Rt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),lo===null)throw Error(r(349));(bi&127)!==0||gv(g,c,h)}E.memoizedState=h;var O={value:h,getSnapshot:c};return E.queue=O,$2(F2.bind(null,g,O,a),[a]),g.flags|=2048,Hh(9,{destroy:void 0},yv.bind(null,g,O,h,c),null),h},useId:function(){var a=la(),c=lo.identifierPrefix;if(Rt){var h=Jt,g=bt;h=(g&~(1<<32-gt(g)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Ug++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=Vg++,c="_"+c+"r_"+h.toString(32)+"_";return a.memoizedState=c},useHostTransitionStatus:Cv,useFormState:V2,useActionState:V2,useOptimistic:function(a){var c=la();c.memoizedState=c.baseState=a;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=qh.bind(null,Ur,!0,h),h.dispatch=c,[a,c]},useMemoCache:pv,useCacheRefresh:function(){return la().memoizedState=MC.bind(null,Ur)},useEffectEvent:function(a){var c=la(),h={impl:a};return c.memoizedState=h,function(){if((Fi&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},yi={readContext:os,use:sd,useCallback:kv,useContext:os,useEffect:$h,useImperativeHandle:bf,useInsertionEffect:G2,useLayoutEffect:Kg,useMemo:_m,useReducer:yf,useRef:wm,useState:function(){return yf(ja)},useDebugValue:km,useDeferredValue:function(a,c){var h=Bo();return q2(h,ji.memoizedState,a,c)},useTransition:function(){var a=yf(ja)[0],c=Bo().memoizedState;return[typeof a=="boolean"?a:Fh(a),c]},useSyncExternalStore:$g,useId:K2,useHostTransitionStatus:Cv,useFormState:H2,useActionState:H2,useOptimistic:function(a,c){var h=Bo();return U2(h,ji,a,c)},useMemoCache:pv,useCacheRefresh:Y2};yi.useEffectEvent=wv;var zl={readContext:os,use:sd,useCallback:kv,useContext:os,useEffect:$h,useImperativeHandle:bf,useInsertionEffect:G2,useLayoutEffect:Kg,useMemo:_m,useReducer:Fa,useRef:wm,useState:function(){return Fa(ja)},useDebugValue:km,useDeferredValue:function(a,c){var h=Bo();return ji===null?Yg(h,a,c):q2(h,ji.memoizedState,a,c)},useTransition:function(){var a=Fa(ja)[0],c=Bo().memoizedState;return[typeof a=="boolean"?a:Fh(a),c]},useSyncExternalStore:$g,useId:K2,useHostTransitionStatus:Cv,useFormState:Wg,useActionState:Wg,useOptimistic:function(a,c){var h=Bo();return ji!==null?U2(h,ji,a,c):(h.baseState=a,[a,h.queue.dispatch])},useMemoCache:pv,useCacheRefresh:Y2};zl.useEffectEvent=wv;function Ua(a,c,h,g){c=a.memoizedState,h=h(g,c),h=h==null?c:p({},c,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var xu={enqueueSetState:function(a,c,h){a=a._reactInternals;var g=gc(),E=td(g);E.payload=c,h!=null&&(E.callback=h),c=nd(a,E,g),c!==null&&(ql(c,a,g),dm(c,a,g))},enqueueReplaceState:function(a,c,h){a=a._reactInternals;var g=gc(),E=td(g);E.tag=1,E.payload=c,h!=null&&(E.callback=h),c=nd(a,E,g),c!==null&&(ql(c,a,g),dm(c,a,g))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var h=gc(),g=td(h);g.tag=2,c!=null&&(g.callback=c),c=nd(a,g,h),c!==null&&(ql(c,a,h),dm(c,a,h))}};function wf(a,c,h,g,E,O,ae){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,O,ae):c.prototype&&c.prototype.isPureReactComponent?!xe(h,g)||!xe(E,O):!0}function Kh(a,c,h,g){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,g),c.state!==a&&xu.enqueueReplaceState(c,c.state,null)}function ld(a,c){var h=c;if("ref"in c){h={};for(var g in c)g!=="ref"&&(h[g]=c[g])}if(a=a.defaultProps){h===c&&(h=p({},h));for(var E in a)h[E]===void 0&&(h[E]=a[E])}return h}function X2(a){fn(a)}function Z2(a){console.error(a)}function Qg(a){fn(a)}function Ul(a,c){try{var h=a.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(g){setTimeout(function(){throw g})}}function Jg(a,c,h){try{var g=a.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function _s(a,c,h){return h=td(h),h.tag=3,h.payload={element:null},h.callback=function(){Ul(a,c)},h}function Os(a){return a=td(a),a.tag=3,a}function as(a,c,h,g){var E=h.type.getDerivedStateFromError;if(typeof E=="function"){var O=g.value;a.payload=function(){return E(O)},a.callback=function(){Jg(c,h,g)}}var ae=h.stateNode;ae!==null&&typeof ae.componentDidCatch=="function"&&(a.callback=function(){Jg(c,h,g),typeof E!="function"&&(Qh===null?Qh=new Set([this]):Qh.add(this));var _e=g.stack;this.componentDidCatch(g.value,{componentStack:_e!==null?_e:""})})}function dc(a,c,h,g,E){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(c=
vendor: 11,846 bytes, line 48
48h.alternate,c!==null&&Xr(c,h,E,!0),h=cl.current,h!==null){switch(h.tag){case 31:case 13:return Ba===null?ow():h.alternate===null&&us===0&&(us=3),h.flags&=-257,h.flags|=65536,h.lanes=E,g===ll?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([g]):c.add(g),qC(a,g,E)),!1;case 22:return h.flags|=65536,g===ll?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([g]):h.add(g)),qC(a,g,E)),!1}throw Error(r(435,h.tag))}return qC(a,g,E),ow(),!1}if(Rt)return c=cl.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=E,g!==Qr&&(a=Error(r(422),{cause:g}),ti(oo(a,h)))):(g!==Qr&&(c=Error(r(423),{cause:g}),ti(oo(c,h))),a=a.current.alternate,a.flags|=65536,E&=-E,a.lanes|=E,g=oo(g,h),E=_s(a.stateNode,g,E),lv(a,E),us!==4&&(us=2)),!1;var O=Error(r(520),{cause:g});if(O=oo(O,h),Dv===null?Dv=[O]:Dv.push(O),us!==4&&(us=2),c===null)return!0;g=oo(g,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,a=E&-E,h.lanes|=a,a=_s(h.stateNode,g,a),lv(h,a),!1;case 1:if(c=h.type,O=h.stateNode,(h.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Qh===null||!Qh.has(O))))return h.flags|=65536,E&=-E,h.lanes|=E,E=Os(E),as(E,a,h,g),lv(h,E),!1}h=h.return}while(h!==null);return!1}var cd=Error(r(461)),Qo=!1;function ls(a,c,h,g){c.child=a===null?Lh(c,null,h,g):pf(c,a.child,h,g)}function Sv(a,c,h,g,E){h=h.render;var O=c.ref;if("ref"in g){var ae={};for(var _e in g)_e!=="ref"&&(ae[_e]=g[_e])}else ae=g;return al(c),g=mm(a,c,h,ae,O,E),_e=wu(),a!==null&&!Qo?(gm(a,c,E),Dt(a,c,E)):(Rt&&_e&&Cr(c),c.flags|=1,ls(a,c,g,E),c.child)}function Vl(a,c,h,g,E){if(a===null){var O=h.type;return typeof O=="function"&&!Dl(O)&&O.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=O,Ev(a,c,O,g,E)):(a=ia(h.type,null,g,c,c.mode,E),a.ref=c.ref,a.return=c,c.child=a)}if(O=a.child,!Ht(a,E)){var ae=O.memoizedProps;if(h=h.compare,h=h!==null?h:xe,h(ae,g)&&a.ref===c.ref)return Dt(a,c,E)}return c.flags|=1,a=go(O,g),a.ref=c.ref,a.return=c,c.child=a}function Ev(a,c,h,g,E){if(a!==null){var O=a.memoizedProps;if(xe(O,g)&&a.ref===c.ref)if(Qo=!1,c.pendingProps=g=O,Ht(a,E))(a.flags&131072)!==0&&(Qo=!0);else return c.lanes=a.lanes,Dt(a,c,E)}return w(a,c,h,g,E)}function Sm(a,c,h,g){var E=g.children,O=a!==null?a.memoizedState:null;if(a===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((c.flags&128)!==0){if(O=O!==null?O.baseLanes|h:h,a!==null){for(g=c.child=a.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~O}else g=0,c.child=null;return Am(a,c,O,h,g)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},a!==null&&Oi(c,O!==null?O.cachePool:null),O!==null?P2(c,O):uv(),B2(c);else return g=c.lanes=536870912,Am(a,c,O!==null?O.baseLanes|h:h,h,g)}else O!==null?(Oi(c,O.cachePool),P2(c,O),rd(),c.memoizedState=null):(a!==null&&Oi(c,null),uv(),rd());return ls(a,c,E,h),c.child}function Em(a,c){return a!==null&&a.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function Am(a,c,h,g,E){var O=si();return O=O===null?null:{parent:fi._currentValue,pool:O},c.memoizedState={baseLanes:h,cachePool:O},a!==null&&Oi(c,null),uv(),B2(c),a!==null&&Xr(a,c,g,!0),c.childLanes=E,null}function Av(a,c){return c=ht({mode:c.mode,children:c.children},a.mode),c.ref=a.ref,a.child=c,c.return=a,c}function LC(a,c,h){return pf(c,a.child,null,h),a=Av(c,c.pendingProps),a.flags|=2,ka(c),c.memoizedState=null,a}function e0(a,c,h){var g=c.pendingProps,E=(c.flags&128)!==0;if(c.flags&=-129,a===null){if(Rt){if(g.mode==="hidden")return a=Av(c,g),c.lanes=536870912,Em(null,a);if(Bh(c),(a=pn)?(a=LI(a,Sr),a=a!==null&&a.data==="&"?a:null,a!==null&&(c.memoizedState={dehydrated:a,treeContext:We!==null?{id:bt,overflow:Jt}:null,retryLane:536870912,hydrationErrors:null},h=lc(a),h.return=c,c.child=h,wr=c,pn=null)):a=null,a===null)throw oi(c);return c.lanes=536870912,null}return Av(c,g)}var O=a.memoizedState;if(O!==null){var ae=O.dehydrated;if(Bh(c),E)if(c.flags&256)c.flags&=-257,c=LC(a,c,h);else if(c.memoizedState!==null)c.child=a.child,c.flags|=128,c=null;else throw Error(r(558));else if(Qo||Xr(a,c,h,!1),E=(h&a.childLanes)!==0,Qo||E){if(g=lo,g!==null&&(ae=it(g,h),ae!==0&&ae!==O.retryLane))throw O.retryLane=ae,va(a,ae),ql(g,a,ae),cd;ow(),c=LC(a,c,h)}else a=O.treeContext,pn=Hc(ae.nextSibling),wr=c,Rt=!0,Nr=null,Sr=!1,a!==null&&lr(c,a),c=Av(c,g),c.flags|=4096;return c}return a=go(a.child,{mode:g.mode,children:g.children}),a.ref=c.ref,c.child=a,a.return=c,a}function v(a,c){var h=c.ref;if(h===null)a!==null&&a.ref!==null&&(c.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(a===null||a.ref!==h)&&(c.flags|=4194816)}}function w(a,c,h,g,E){return al(c),h=mm(a,c,h,g,void 0,E),g=wu(),a!==null&&!Qo?(gm(a,c,E),Dt(a,c,E)):(Rt&&g&&Cr(c),c.flags|=1,ls(a,c,h,E),c.child)}function A(a,c,h,g,E,O){return al(c),c.updateQueue=null,h=Hg(c,g,h,E),j2(a),g=wu(),a!==null&&!Qo?(gm(a,c,O),Dt(a,c,O)):(Rt&&g&&Cr(c),c.flags|=1,ls(a,c,h,O),c.child)}function N(a,c,h,g,E){if(al(c),c.stateNode===null){var O=ol,ae=h.contextType;typeof ae=="object"&&ae!==null&&(O=os(ae)),O=new h(g,O),c.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=xu,c.stateNode=O,O._reactInternals=c,O=c.stateNode,O.props=g,O.state=c.memoizedState,O.refs={},av(c),ae=h.contextType,O.context=typeof ae=="object"&&ae!==null?os(ae):ol,O.state=c.memoizedState,ae=h.getDerivedStateFromProps,typeof ae=="function"&&(Ua(c,h,ae,g),O.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(ae=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),ae!==O.state&&xu.enqueueReplaceState(O,O.state,null),hm(c,g,O,E),fm(),O.state=c.memoizedState),typeof O.componentDidMount=="function"&&(c.flags|=4194308),g=!0}else if(a===null){O=c.stateNode;var _e=c.memoizedProps,rt=ld(h,_e);O.props=rt;var Mt=O.context,Qt=h.contextType;ae=ol,typeof Qt=="object"&&Qt!==null&&(ae=os(Qt));var on=h.getDerivedStateFromProps;Qt=typeof on=="function"||typeof O.getSnapshotBeforeUpdate=="function",_e=c.pendingProps!==_e,Qt||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(_e||Mt!==ae)&&Kh(c,O,g,ae),ed=!1;var Pt=c.memoizedState;O.state=Pt,hm(c,g,O,E),fm(),Mt=c.memoizedState,_e||Pt!==Mt||ed?(typeof on=="function"&&(Ua(c,h,on,g),Mt=c.memoizedState),(rt=ed||wf(c,h,rt,g,Pt,Mt,ae))?(Qt||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(c.flags|=4194308)):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=Mt),O.props=g,O.state=Mt,O.context=ae,g=rt):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{O=c.stateNode,jg(a,c),ae=c.memoizedProps,Qt=ld(h,ae),O.props=Qt,on=c.pendingProps,Pt=O.context,Mt=h.contextType,rt=ol,typeof Mt=="object"&&Mt!==null&&(rt=os(Mt)),_e=h.getDerivedStateFromProps,(Mt=typeof _e=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(ae!==on||Pt!==rt)&&Kh(c,O,g,rt),ed=!1,Pt=c.memoizedState,O.state=Pt,hm(c,g,O,E),fm();var Gt=c.memoizedState;ae!==on||Pt!==Gt||ed||a!==null&&a.dependencies!==null&&sl(a.dependencies)?(typeof _e=="function"&&(Ua(c,h,_e,g),Gt=c.memoizedState),(Qt=ed||wf(c,h,Qt,g,Pt,Gt,rt)||a!==null&&a.dependencies!==null&&sl(a.dependencies))?(Mt||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(g,Gt,rt),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(g,Gt,rt)),typeof O.componentDidUpdate=="function"&&(c.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof O.componentDidUpdate!="function"||ae===a.memoizedProps&&Pt===a.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||ae===a.memoizedProps&&Pt===a.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=Gt),O.props=g,O.state=Gt,O.context=rt,g=Qt):(typeof O.componentDidUpdate!="function"||ae===a.memoizedProps&&Pt===a.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||ae===a.memoizedProps&&Pt===a.memoizedState||(c.flags|=1024),g=!1)}return O=g,v(a,c),g=(c.flags&128)!==0,O||g?(O=c.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:O.render(),c.flags|=1,a!==null&&g?(c.child=pf(c,a.child,null,E),c.child=pf(c,null,h,E)):ls(a,c,h,E),c.memoizedState=O.state,a=c.child):a=Dt(a,c,E),a}function j(a,c,h,g){return Mr(),c.flags|=256,ls(a,c,h,g),c.child}var G={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ce(a){return{baseLanes:a,cachePool:Er()}}function we(a,c,h){return a=a!==null?a.childLanes&~h:0,c&&(a|=mc),a}function Re(a,c,h){var g=c.pendingProps,E=!1,O=(c.flags&128)!==0,ae;if((ae=O)||(ae=a!==null&&a.memoizedState===null?!1:(Xo.current&2)!==0),ae&&(E=!0,c.flags&=-129),ae=(c.flags&32)!==0,c.flags&=-33,a===null){if(Rt){if(E?Fl(c):rd(),(a=pn)?(a=LI(a,Sr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(c.memoizedState={dehydrated:a,treeContext:We!==null?{id:bt,overflow:Jt}:null,retryLane:536870912,hydrationErrors:null},h=lc(a),h.return=c,c.child=h,wr=c,pn=null)):a=null,a===null)throw oi(c);return lS(a)?c.lanes=32:c.lanes=536870912,null}var _e=g.children;return g=g.fallback,E?(rd(),E=c.mode,_e=ht({mode:"hidden",children:_e},E),g=Is(g,E,h,null),_e.return=c,g.return=c,_e.sibling=g,c.child=_e,g=c.child,g.memoizedState=ce(h),g.childLanes=we(a,ae,h),c.memoizedState=G,Em(null,g)):(Fl(c),nt(c,_e))}var rt=a.memoizedState;if(rt!==null&&(_e=rt.dehydrated,_e!==null)){if(O)c.flags&256?(Fl(c),c.flags&=-257,c=pt(a,c,h)):c.memoizedState!==null?(rd(),c.child=a.child,c.flags|=128,c=null):(rd(),_e=g.fallback,E=c.mode,g=ht({mode:"visible",children:g.children},E),_e=Is(_e,E,h,null),_e.flags|=2,g.return=c,_e.return=c,g.sibling=_e,c.child=g,pf(c,a.child,null,h),g=c.child,g.memoizedState=ce(h),g.childLanes=we(a,ae,h),c.memoizedState=G,c=Em(null,g));else if(Fl(c),lS(_e)){if(ae=_e.nextSibling&&_e.nextSibling.dataset,ae)var Mt=ae.dgst;ae=Mt,g=Error(r(419)),g.stack="",g.digest=ae,ti({value:g,source:null,stack:null}),c=pt(a,c,h)}else if(Qo||Xr(a,c,h,!1),ae=(h&a.childLanes)!==0,Qo||ae){if(ae=lo,ae!==null&&(g=it(ae,h),g!==0&&g!==rt.retryLane))throw rt.retryLane=g,va(a,g),ql(ae,a,g),cd;aS(_e)||ow(),c=pt(a,c,h)}else aS(_e)?(c.flags|=192,c.child=a.child,c=null):(a=rt.treeContext,pn=Hc(_e.nextSibling),wr=c,Rt=!0,Nr=null,Sr=!1,a!==null&&lr(c,a),c=nt(c,g.children),c.flags|=4096);return c}return E?(rd(),_e=g.fallback,E=c.mode,rt=a.child,Mt=rt.sibling,g=go(rt,{mode:"hidden",children:g.children}),g.subtreeFlags=rt.subtreeFlags&65011712,Mt!==null?_e=go(Mt,_e):(_e=Is(_e,E,h,null),_e.flags|=2),_e.return=c,g.return=c,g.sibling=_e,c.child=g,Em(null,g),g=c.child,_e=a.child.memoizedState,_e===null?_e=ce(h):(E=_e.cachePool,E!==null?(rt=fi._currentValue,E=E.parent!==rt?{parent:rt,pool:rt}:E):E=Er(),_e={baseLanes:_e.baseLanes|h,cachePool:E}),g.memoizedState=_e,g.childLanes=we(a,ae,h),c.memoizedState=G,Em(a.child,g)):(Fl(c),h=a.child,a=h.sibling,h=go(h,{mode:"visible",children:g.children}),h.return=c,h.sibling=null,a!==null&&(ae=c.deletions,ae===null?(c.deletions=[a],c.flags|=16):ae.pu
vendor: 6,182 bytes, line 48
48sh(a)),c.child=h,c.memoizedState=null,h)}function nt(a,c){return c=ht({mode:"visible",children:c},a.mode),c.return=a,a.child=c}function ht(a,c){return a=Wi(22,a,null,c),a.lanes=0,a}function pt(a,c,h){return pf(c,a.child,null,h),a=nt(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function It(a,c,h){a.lanes|=c;var g=a.alternate;g!==null&&(g.lanes|=c),Bl(a.return,c,h)}function Vt(a,c,h,g,E,O){var ae=a.memoizedState;ae===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:E,treeForkCount:O}:(ae.isBackwards=c,ae.rendering=null,ae.renderingStartTime=0,ae.last=g,ae.tail=h,ae.tailMode=E,ae.treeForkCount=O)}function zt(a,c,h){var g=c.pendingProps,E=g.revealOrder,O=g.tail;g=g.children;var ae=Xo.current,_e=(ae&2)!==0;if(_e?(ae=ae&1|2,c.flags|=128):ae&=1,le(Xo,ae),ls(a,c,g,h),g=Rt?$:0,!_e&&a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&It(a,h,c);else if(a.tag===19)It(a,h,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(E){case"forwards":for(h=c.child,E=null;h!==null;)a=h.alternate,a!==null&&pm(a)===null&&(E=h),h=h.sibling;h=E,h===null?(E=c.child,c.child=null):(E=h.sibling,h.sibling=null),Vt(c,!1,E,h,O,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,E=c.child,c.child=null;E!==null;){if(a=E.alternate,a!==null&&pm(a)===null){c.child=E;break}a=E.sibling,E.sibling=h,h=E,E=a}Vt(c,!0,h,null,O,g);break;case"together":Vt(c,!1,null,null,void 0,g);break;default:c.memoizedState=null}return c.child}function Dt(a,c,h){if(a!==null&&(c.dependencies=a.dependencies),Zh|=c.lanes,(h&c.childLanes)===0)if(a!==null){if(Xr(a,c,h,!1),(h&c.childLanes)===0)return null}else return null;if(a!==null&&c.child!==a.child)throw Error(r(153));if(c.child!==null){for(a=c.child,h=go(a,a.pendingProps),c.child=h,h.return=c;a.sibling!==null;)a=a.sibling,h=h.sibling=go(a,a.pendingProps),h.return=c;h.sibling=null}return c.child}function Ht(a,c){return(a.lanes&c)!==0?!0:(a=a.dependencies,!!(a!==null&&sl(a)))}function qt(a,c,h){switch(c.tag){case 3:yt(c,c.stateNode.containerInfo),ba(c,fi,a.memoizedState.cache),Mr();break;case 27:case 5:Be(c);break;case 4:yt(c,c.stateNode.containerInfo);break;case 10:ba(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Bh(c),null;break;case 13:var g=c.memoizedState;if(g!==null)return g.dehydrated!==null?(Fl(c),c.flags|=128,null):(h&c.child.childLanes)!==0?Re(a,c,h):(Fl(c),a=Dt(a,c,h),a!==null?a.sibling:null);Fl(c);break;case 19:var E=(a.flags&128)!==0;if(g=(h&c.childLanes)!==0,g||(Xr(a,c,h,!1),g=(h&c.childLanes)!==0),E){if(g)return zt(a,c,h);c.flags|=128}if(E=c.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),le(Xo,Xo.current),g)break;return null;case 22:return c.lanes=0,Sm(a,c,h,c.pendingProps);case 24:ba(c,fi,a.memoizedState.cache)}return Dt(a,c,h)}function Tt(a,c,h){if(a!==null)if(a.memoizedProps!==c.pendingProps)Qo=!0;else{if(!Ht(a,h)&&(c.flags&128)===0)return Qo=!1,qt(a,c,h);Qo=(a.flags&131072)!==0}else Qo=!1,Rt&&(c.flags&1048576)!==0&&qn(c,$,c.index);switch(c.lanes=0,c.tag){case 16:e:{var g=c.pendingProps;if(a=hf(c.elementType),c.type=a,typeof a=="function")Dl(a)?(g=ld(a,g),c.tag=1,c=N(null,c,a,g,h)):(c.tag=0,c=w(null,c,a,g,h));else{if(a!=null){var E=a.$$typeof;if(E===I){c.tag=11,c=Sv(null,c,a,g,h);break e}else if(E===V){c.tag=14,c=Vl(null,c,a,g,h);break e}}throw c=L(a)||a,Error(r(306,c,""))}}return c;case 0:return w(a,c,c.type,c.pendingProps,h);case 1:return g=c.type,E=ld(g,c.pendingProps),N(a,c,g,E,h);case 3:e:{if(yt(c,c.stateNode.containerInfo),a===null)throw Error(r(387));g=c.pendingProps;var O=c.memoizedState;E=O.element,jg(a,c),hm(c,g,null,h);var ae=c.memoizedState;if(g=ae.cache,ba(c,fi,g),g!==O.cache&&Fc(c,[fi],h,!0),fm(),g=ae.element,O.isDehydrated)if(O={element:g,isDehydrated:!1,cache:ae.cache},c.updateQueue.baseState=O,c.memoizedState=O,c.flags&256){c=j(a,c,g,h);break e}else if(g!==E){E=oo(Error(r(424)),c),ti(E),c=j(a,c,g,h);break e}else{switch(a=c.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(pn=Hc(a.firstChild),wr=c,Rt=!0,Nr=null,Sr=!0,h=Lh(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Mr(),g===E){c=Dt(a,c,h);break e}ls(a,c,g,h)}c=c.child}return c;case 26:return v(a,c),a===null?(h=UI(c.type,null,c.pendingProps,null))?c.memoizedState=h:Rt||(h=c.type,a=c.pendingProps,g=fw(st.current).createElement(h),g[rn]=c,g[Wn]=a,_a(g,h,a),Si(g),c.stateNode=g):c.memoizedState=UI(c.type,a.memoizedProps,c.pendingProps,a.memoizedState),null;case 27:return Be(c),a===null&&Rt&&(g=c.stateNode=jI(c.type,c.pendingProps,st.current),wr=c,Sr=!0,E=pn,np(c.type)?(cS=E,pn=Hc(g.firstChild)):pn=E),ls(a,c,c.pendingProps.children,h),v(a,c),a===null&&(c.flags|=4194304),c.child;case 5:return a===null&&Rt&&((E=g=pn)&&(g=kH(g,c.type,c.pendingProps,Sr),g!==null?(c.stateNode=g,wr=c,pn=Hc(g.firstChild),Sr=!1,E=!0):E=!1),E||oi(c)),Be(c),E=c.type,O=c.pendingProps,ae=a!==null?a.memoizedProps:null,g=O.children,iS(E,O)?g=null:ae!==null&&iS(E,ae)&&(c.flags|=32),c.memoizedState!==null&&(E=mm(a,c,OC,null,null,h),Vv._currentValue=E),v(a,c),ls(a,c,g,h),c.child;case 6:return a===null&&Rt&&((a=h=pn)&&(h=_H(h,c.pendingProps,Sr),h!==null?(c.stateNode=h,wr=c,pn=null,a=!0):a=!1),a||oi(c)),null;case 13:return Re(a,c,h);case 4:return yt(c,c.stateNode.containerInfo),g=c.pendingProps,a===null?c.child=pf(c,null,g,h):ls(a,c,g,h),c.child;case 11:return Sv(a,c,c.type,c.pendingProps,h);case 7:return ls(a,c,c.pendingProps,h),c.child;case 8:return ls(a,c,c.pendingProps.children,h),c.child;case 12:return ls(a,c,c.pendingProps.children,h),c.child;case 10:return g=c.pendingProps,ba(c,c.type,g.value),ls(a,c,g.children,h),c.child;case 9:return E=c.type._context,g=c.pendingProps.children,al(c),E=os(E),g=g(E),c.flags|=1,ls(a,c,g,h),c.child;case 14:return Vl(a,c,c.type,c.pendingProps,h);case 15:return Ev(a,c,c.type,c.pendingProps,h);case 19:return zt(a,c,h);case 31:return e0(a,c,h);case 22:return Sm(a,c,h,c.pendingProps);
vendor: 9,037 bytes, line 48
48case 24:return al(c),g=os(fi),a===null?(E=si(),E===null&&(E=lo,O=Ko(),E.pooledCache=O,O.refCount++,O!==null&&(E.pooledCacheLanes|=h),E=O),c.memoizedState={parent:g,cache:E},av(c),ba(c,fi,E)):((a.lanes&h)!==0&&(jg(a,c),hm(c,null,null,h),fm()),E=a.memoizedState,O=c.memoizedState,E.parent!==g?(E={parent:g,cache:g},c.memoizedState=E,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=E),ba(c,fi,g)):(g=O.cache,ba(c,fi,g),g!==E.cache&&Fc(c,[fi],h,!0))),ls(a,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function Wt(a){a.flags|=4}function kt(a,c,h,g,E){if((c=(a.mode&32)!==0)&&(c=!1),c){if(a.flags|=16777216,(E&335544128)===E)if(a.stateNode.complete)a.flags|=8192;else if(rI())a.flags|=8192;else throw Pa=ll,aa}else a.flags&=-16777217}function xn(a,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!qI(c))if(rI())a.flags|=8192;else throw Pa=ll,aa}function or(a,c){c!==null&&(a.flags|=4),a.flags&16384&&(c=a.tag!==22?Pn():536870912,a.lanes|=c,s0|=c)}function hr(a,c){if(!Rt)switch(a.tailMode){case"hidden":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function Yn(a){var c=a.alternate!==null&&a.alternate.child===a.child,h=0,g=0;if(c)for(var E=a.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=a,E=E.sibling;else for(E=a.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=g,a.childLanes=h,c}function vi(a,c,h){var g=c.pendingProps;switch(ln(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yn(c),null;case 1:return Yn(c),null;case 3:return h=c.stateNode,g=null,a!==null&&(g=a.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),wa(fi),Ge(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(a===null||a.child===null)&&(Gi(c)?Wt(c):a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,qs())),Yn(c),null;case 26:var E=c.type,O=c.memoizedState;return a===null?(Wt(c),O!==null?(Yn(c),xn(c,O)):(Yn(c),kt(c,E,null,g,h))):O?O!==a.memoizedState?(Wt(c),Yn(c),xn(c,O)):(Yn(c),c.flags&=-16777217):(a=a.memoizedProps,a!==g&&Wt(c),Yn(c),kt(c,E,a,g,h)),null;case 27:if(he(c),h=st.current,E=c.type,a!==null&&c.stateNode!=null)a.memoizedProps!==g&&Wt(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return Yn(c),null}a=ve.current,Gi(c)?Ki(c):(a=jI(E,g,h),c.stateNode=a,Wt(c))}return Yn(c),null;case 5:if(he(c),E=c.type,a!==null&&c.stateNode!=null)a.memoizedProps!==g&&Wt(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return Yn(c),null}if(O=ve.current,Gi(c))Ki(c);else{var ae=fw(st.current);switch(O){case 1:O=ae.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:O=ae.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":O=ae.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":O=ae.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":O=ae.createElement("div"),O.innerHTML="<script><\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof g.is=="string"?ae.createElement("select",{is:g.is}):ae.createElement("select"),g.multiple?O.multiple=!0:g.size&&(O.size=g.size);break;default:O=typeof g.is=="string"?ae.createElement(E,{is:g.is}):ae.createElement(E)}}O[rn]=c,O[Wn]=g;e:for(ae=c.child;ae!==null;){if(ae.tag===5||ae.tag===6)O.appendChild(ae.stateNode);else if(ae.tag!==4&&ae.tag!==27&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===c)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===c)break e;ae=ae.return}ae.sibling.return=ae.return,ae=ae.sibling}c.stateNode=O;e:switch(_a(O,E,g),E){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Wt(c)}}return Yn(c),kt(c,c.type,a===null?null:a.memoizedProps,c.pendingProps,h),null;case 6:if(a&&c.stateNode!=null)a.memoizedProps!==g&&Wt(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(r(166));if(a=st.current,Gi(c)){if(a=c.stateNode,h=c.memoizedProps,g=null,E=wr,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}a[rn]=c,a=!!(a.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||AI(a.nodeValue,h)),a||oi(c,!0)}else a=fw(a).createTextNode(g),a[rn]=c,c.stateNode=a}return Yn(c),null;case 31:if(h=c.memoizedState,a===null||a.memoizedState!==null){if(g=Gi(c),h!==null){if(a===null){if(!g)throw Error(r(318));if(a=c.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[rn]=c}else Mr(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Yn(c),a=!1}else h=qs(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=h),a=!0;if(!a)return c.flags&256?(ka(c),c):(ka(c),null);if((c.flags&128)!==0)throw Error(r(558))}return Yn(c),null;case 13:if(g=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(E=Gi(c),g!==null&&g.dehydrated!==null){if(a===null){if(!E)throw Error(r(318));if(E=c.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[rn]=c}else Mr(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Yn(c),E=!1}else E=qs(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=E),E=!0;if(!E)return c.flags&256?(ka(c),c):(ka(c),null)}return ka(c),(c.flags&128)!==0?(c.lanes=h,c):(h=g!==null,a=a!==null&&a.memoizedState!==null,h&&(g=c.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),O=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(O=g.memoizedState.cachePool.pool),O!==E&&(g.flags|=2048)),h!==a&&h&&(c.child.flags|=8192),or(c,c.updateQueue),Yn(c),null);case 4:return Ge(),a===null&&JC(c.stateNode.containerInfo),Yn(c),null;case 10:return wa(c.type),Yn(c),null;case 19:if(ge(Xo),g=c.memoizedState,g===null)return Yn(c),null;if(E=(c.flags&128)!==0,O=g.rendering,O===null)if(E)hr(g,!1);else{if(us!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(O=pm(a),O!==null){for(c.flags|=128,hr(g,!1),a=O.updateQueue,c.updateQueue=a,or(c,a),c.subtreeFlags=0,a=h,h=c.child;h!==null;)ac(h,a),h=h.sibling;return le(Xo,Xo.current&1|2),Rt&&vn(c,g.treeForkCount),c.child}a=a.sibling}g.tail!==null&&Le()>nw&&(c.flags|=128,E=!0,hr(g,!1),c.lanes=4194304)}else{if(!E)if(a=pm(O),a!==null){if(c.flags|=128,E=!0,a=a.updateQueue,c.updateQueue=a,or(c,a),hr(g,!0),g.tail===null&&g.tailMode==="hidden"&&!O.alternate&&!Rt)return Yn(c),null}else 2*Le()-g.renderingStartTime>nw&&h!==536870912&&(c.flags|=128,E=!0,hr(g,!1),c.lanes=4194304);g.isBackwards?(O.sibling=c.child,c.child=O):(a=g.last,a!==null?a.sibling=O:c.child=O,g.last=O)}return g.tail!==null?(a=g.tail,g.rendering=a,g.tail=a.sibling,g.renderingStartTime=Le(),a.sibling=null,h=Xo.current,le(Xo,E?h&1|2:h&1),Rt&&vn(c,g.treeForkCount),a):(Yn(c),null);case 22:case 23:return ka(c),dv(),g=c.memoizedState!==null,a!==null?a.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(h&536870912)!==0&&(c.flags&128)===0&&(Yn(c),c.subtreeFlags&6&&(c.flags|=8192)):Yn(c),h=c.updateQueue,h!==null&&or(c,h.retryQueue),h=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048),a!==null&&ge(cr),null;case 24:return h=null,a!==null&&(h=a.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),wa(fi),Yn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function Yi(a,c){switch(ln(c),c.tag){case 1:return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return wa(fi),Ge(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 26:case 27:case 5:return he(c),null;case 31:if(c.memoizedState!==null){if(ka(c),c.alternate===null)throw Error(r(340));Mr()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 13:if(ka(c),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Mr()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return ge(Xo),null;case 4:return Ge(),null;case 10:return wa(c.type),null;case 22:case 23:return ka(c),dv(),a!==null&&ge(cr),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 24:return wa(fi),null;case 25:return null;default:return null}}function Cs(a,c){switch(ln(c),c.tag){case 3:wa(fi),Ge();break;case 26:case 27:case 5:he(c);break;case 4:Ge();break;case 31:c.memoizedState!==null&&ka(c);break;case 13:ka(c);break;case 19:ge(Xo);break;case 10:wa(c.type);break;case 22:case 23:ka(c),dv(),a!==null&&ge(cr);break;case 24:wa(fi)}}function Ns(a,c){try{var h=c.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var E=g.next;h=E;do{if((h.tag&a)===a){g=void 0;var O=h.create,ae=h.inst;
vendor: 17,518 bytes, line 48
48g=O(),ae.destroy=g}h=h.next}while(h!==E)}}catch(_e){Qi(c,c.return,_e)}}function Xi(a,c,h){try{var g=c.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var O=E.next;g=O;do{if((g.tag&a)===a){var ae=g.inst,_e=ae.destroy;if(_e!==void 0){ae.destroy=void 0,E=c;var rt=h,Mt=_e;try{Mt()}catch(Qt){Qi(E,rt,Qt)}}}g=g.next}while(g!==O)}}catch(Qt){Qi(c,c.return,Qt)}}function Jo(a){var c=a.updateQueue;if(c!==null){var h=a.stateNode;try{L2(c,h)}catch(g){Qi(a,a.return,g)}}}function cs(a,c,h){h.props=ld(a.type,a.memoizedProps),h.state=a.memoizedState;try{h.componentWillUnmount()}catch(g){Qi(a,c,g)}}function Ss(a,c){try{var h=a.ref;if(h!==null){switch(a.tag){case 26:case 27:case 5:var g=a.stateNode;break;case 30:g=a.stateNode;break;default:g=a.stateNode}typeof h=="function"?a.refCleanup=h(g):h.current=g}}catch(E){Qi(a,c,E)}}function Ms(a,c){var h=a.ref,g=a.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(E){Qi(a,c,E)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(E){Qi(a,c,E)}else h.current=null}function Yh(a){var c=a.type,h=a.memoizedProps,g=a.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(E){Qi(a,a.return,E)}}function t0(a,c,h){try{var g=a.stateNode;gH(g,a.type,h,c),g[Wn]=c}catch(E){Qi(a,a.return,E)}}function xf(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&np(a.type)||a.tag===4}function n0(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||xf(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&np(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Tm(a,c,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(a,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(a),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=yn));else if(g!==4&&(g===27&&np(a.type)&&(h=a.stateNode,c=null),a=a.child,a!==null))for(Tm(a,c,h),a=a.sibling;a!==null;)Tm(a,c,h),a=a.sibling}function Uc(a,c,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?h.insertBefore(a,c):h.appendChild(a);else if(g!==4&&(g===27&&np(a.type)&&(h=a.stateNode),a=a.child,a!==null))for(Uc(a,c,h),a=a.sibling;a!==null;)Uc(a,c,h),a=a.sibling}function Tv(a){var c=a.stateNode,h=a.memoizedProps;try{for(var g=a.type,E=c.attributes;E.length;)c.removeAttributeNode(E[0]);_a(c,g,h),c[rn]=a,c[Wn]=h}catch(O){Qi(a,a.return,O)}}var Vc=!1,es=!1,fc=!1,Iv=typeof WeakSet=="function"?WeakSet:Set,ts=null;function Q2(a,c){if(a=a.containerInfo,nS=bw,a=Ie(a),Xe(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var E=g.anchorOffset,O=g.focusNode;g=g.focusOffset;try{h.nodeType,O.nodeType}catch{h=null;break e}var ae=0,_e=-1,rt=-1,Mt=0,Qt=0,on=a,Pt=null;t:for(;;){for(var Gt;on!==h||E!==0&&on.nodeType!==3||(_e=ae+E),on!==O||g!==0&&on.nodeType!==3||(rt=ae+g),on.nodeType===3&&(ae+=on.nodeValue.length),(Gt=on.firstChild)!==null;)Pt=on,on=Gt;for(;;){if(on===a)break t;if(Pt===h&&++Mt===E&&(_e=ae),Pt===O&&++Qt===g&&(rt=ae),(Gt=on.nextSibling)!==null)break;on=Pt,Pt=on.parentNode}on=Gt}h=_e===-1||rt===-1?null:{start:_e,end:rt}}else h=null}h=h||{start:0,end:0}}else h=null;for(rS={focusedElem:a,selectionRange:h},bw=!1,ts=c;ts!==null;)if(c=ts,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,ts=a;else for(;ts!==null;){switch(c=ts,O=c.alternate,a=c.flags,c.tag){case 0:if((a&4)!==0&&(a=c.updateQueue,a=a!==null?a.events:null,a!==null))for(h=0;h<a.length;h++)E=a[h],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&O!==null){a=void 0,h=c,E=O.memoizedProps,O=O.memoizedState,g=h.stateNode;try{var Qn=ld(h.type,E);a=g.getSnapshotBeforeUpdate(Qn,O),g.__reactInternalSnapshotBeforeUpdate=a}catch(Ir){Qi(h,h.return,Ir)}}break;case 3:if((a&1024)!==0){if(a=c.stateNode.containerInfo,h=a.nodeType,h===9)sS(a);else if(h===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":sS(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=c.sibling,a!==null){a.return=c.return,ts=a;break}ts=c.return}}function hc(a,c,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:_f(a,h),g&4&&Ns(5,h);break;case 1:if(_f(a,h),g&4)if(a=h.stateNode,c===null)try{a.componentDidMount()}catch(ae){Qi(h,h.return,ae)}else{var E=ld(h.type,c.memoizedProps);c=c.memoizedState;try{a.componentDidUpdate(E,c,a.__reactInternalSnapshotBeforeUpdate)}catch(ae){Qi(h,h.return,ae)}}g&64&&Jo(h),g&512&&Ss(h,h.return);break;case 3:if(_f(a,h),g&64&&(a=h.updateQueue,a!==null)){if(c=null,h.child!==null)switch(h.child.tag){case 27:case 5:c=h.child.stateNode;break;case 1:c=h.child.stateNode}try{L2(a,c)}catch(ae){Qi(h,h.return,ae)}}break;case 27:c===null&&g&4&&Tv(h);case 26:case 5:_f(a,h),c===null&&g&4&&Yh(h),g&512&&Ss(h,h.return);break;case 12:_f(a,h);break;case 31:_f(a,h),g&4&&VT(a,h);break;case 13:_f(a,h),g&4&&HT(a,h),g&64&&(a=h.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(h=iH.bind(null,h),CH(a,h))));break;case 22:if(g=h.memoizedState!==null||Vc,!g){c=c!==null&&c.memoizedState!==null||es,E=Vc;var O=es;Vc=g,(es=c)&&!O?Cf(a,h,(h.subtreeFlags&8772)!==0):_f(a,h),Vc=E,es=O}break;case 30:break;default:_f(a,h)}}function Rv(a){var c=a.alternate;c!==null&&(a.alternate=null,Rv(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&Kn(c)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var ao=null,Va=!1;function kf(a,c,h){for(h=h.child;h!==null;)UT(a,c,h),h=h.sibling}function UT(a,c,h){if(Ve&&typeof Ve.onCommitFiberUnmount=="function")try{Ve.onCommitFiberUnmount(me,h)}catch{}switch(h.tag){case 26:es||Ms(h,c),kf(a,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:es||Ms(h,c);var g=ao,E=Va;np(h.type)&&(ao=h.stateNode,Va=!1),kf(a,c,h),Fv(h.stateNode),ao=g,Va=E;break;case 5:es||Ms(h,c);case 6:if(g=ao,E=Va,ao=null,kf(a,c,h),ao=g,Va=E,ao!==null)if(Va)try{(ao.nodeType===9?ao.body:ao.nodeName==="HTML"?ao.ownerDocument.body:ao).removeChild(h.stateNode)}catch(O){Qi(h,c,O)}else try{ao.removeChild(h.stateNode)}catch(O){Qi(h,c,O)}break;case 18:ao!==null&&(Va?(a=ao,MI(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,h.stateNode),p0(a)):MI(ao,h.stateNode));break;case 4:g=ao,E=Va,ao=h.stateNode.containerInfo,Va=!0,kf(a,c,h),ao=g,Va=E;break;case 0:case 11:case 14:case 15:Xi(2,h,c),es||Xi(4,h,c),kf(a,c,h);break;case 1:es||(Ms(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"&&cs(h,c,g)),kf(a,c,h);break;case 21:kf(a,c,h);break;case 22:es=(g=es)||h.memoizedState!==null,kf(a,c,h),es=g;break;default:kf(a,c,h)}}function VT(a,c){if(c.memoizedState===null&&(a=c.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{p0(a)}catch(h){Qi(c,c.return,h)}}}function HT(a,c){if(c.memoizedState===null&&(a=c.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{p0(a)}catch(h){Qi(c,c.return,h)}}function XV(a){switch(a.tag){case 31:case 13:case 19:var c=a.stateNode;return c===null&&(c=a.stateNode=new Iv),c;case 22:return a=a.stateNode,c=a._retryCache,c===null&&(c=a._retryCache=new Iv),c;default:throw Error(r(435,a.tag))}}function J2(a,c){var h=XV(a);c.forEach(function(g){if(!h.has(g)){h.add(g);var E=oH.bind(null,a,g);g.then(E,E)}})}function Hl(a,c){var h=c.deletions;if(h!==null)for(var g=0;g<h.length;g++){var E=h[g],O=a,ae=c,_e=ae;e:for(;_e!==null;){switch(_e.tag){case 27:if(np(_e.type)){ao=_e.stateNode,Va=!1;break e}break;case 5:ao=_e.stateNode,Va=!1;break e;case 3:case 4:ao=_e.stateNode.containerInfo,Va=!0;break e}_e=_e.return}if(ao===null)throw Error(r(160));UT(O,ae,E),ao=null,Va=!1,O=E.alternate,O!==null&&(O.return=null),E.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)$T(c,a),c=c.sibling}var ku=null;function $T(a,c){var h=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Hl(c,a),$l(a),g&4&&(Xi(3,a,a.return),Ns(3,a),Xi(5,a,a.return));break;case 1:Hl(c,a),$l(a),g&512&&(es||h===null||Ms(h,h.return)),g&64&&Vc&&(a=a.updateQueue,a!==null&&(g=a.callbacks,g!==null&&(h=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var E=ku;if(Hl(c,a),$l(a),g&512&&(es||h===null||Ms(h,h.return)),g&4){var O=h!==null?h.memoizedState:null;if(g=a.memoizedState,h===null)if(g===null)if(a.stateNode===null){e:{g=a.type,h=a.memoizedProps,E=E.ownerDocument||E;t:switch(g){case"title":O=E.getElementsByTagName("title")[0],(!O||O[zr]||O[rn]||O.namespaceURI==="http://www.w3.org/2000/svg"||O.hasAttribute("itemprop"))&&(O=E.createElement(g),E.head.insertBefore(O,E.querySelector("head > title"))),_a(O,g,h),O[rn]=a,Si(O),g=O;break e;case"link":var ae=$I("link","href",E).get(g+(h.href||""));if(ae){for(var _e=0;_e<ae.length;_e++)if(O=ae[_e],O.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&O.getAttribute("rel")===(h.rel==null?null:h.rel)&&O.getAttribute("title")===(h.title==null?null:h.title)&&O.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){ae.splice(_e,1);break t}}O=E.createElement(g),_a(O,g,h),E.head.appendChild(O);break;case"meta":if(ae=$I("meta","content",E).get(g+(h.content||""))){for(_e=0;_e<ae.length;_e++)if(O=ae[_e],O.getAttribute("content")===(h.content==null?null:""+h.content)&&O.getAttribute("name")===(h.name==null?null:h.name)&&O.getAttribute("property")===(h.property==null?null:h.property)&&O.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&O.getAttribute("charset")===(h.charSet==null?null:h.charSet)){ae.splice(_e,1);break t}}O=E.createElement(g),_a(O,g,h),E.head.appendChild(O);break;default:throw Error(r(468,g))}O[rn]=a,Si(O),g=O}a.stateNode=g}else GI(E,a.type,a.stateNode);else a.stateNode=HI(E,g,a.memoizedProps);else O!==g?(O===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):O.count--,g===null?GI(E,a.type,a.stateNode):HI(E,g,a.memoizedProps)):g===null&&a.stateNode!==null&&t0(a,a.memoizedProps,h.memoizedProps)}break;case 27:Hl(c,a),$l(a),g&512&&(es||h===null||Ms(h,h.return)),h!==null&&g&4&&t0(a,a.memoizedProps,h.memoizedProps);break;case 5:if(Hl(c,a),$l(a),g&512&&(es||h===null||Ms(h,h.return)),a.flags&32){E=a.stateNode;try{er(E,"")}catch(Qn){Qi(a,a.return,Qn)}}g&4&&a.stateNode!=null&&(E=a.memoizedProps,t0(a,E,h!==null?h.memoizedProps:E)),g&1024&&(fc=!0);break;case 6:if(Hl(c,a),$l(a),g&4){if(a.stateNode===null)throw Error(r(162));g=a.memoizedProps,h=a.stateNode;try{h.nodeValue=g}catch(Qn){Qi(a,a.return,Qn)}}break;case 3:if(mw=null,E=ku,ku=hw(c.containerInfo),Hl(c,a),ku=E,$l(a),g&4&&h!==null&&h.memoizedState.isDehydrated)try{p0(c.containerInfo)}catch(Qn){Qi(a,a.return,Qn)}fc&&(fc=!1,GT(a));break;case 4:g=ku,ku=hw(a.stateNode.containerInfo),Hl(c,a),$l(a),ku=g;break;case 12:Hl(c,a),$l(a);break;case 31:Hl(c,a),$l(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,J2(a,g)));break;case 13:Hl(c,a),$l(a),a.child.flags&8192&&a.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(tw=Le()),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,J2(a,g)));break;case 22:E=a.memoizedState!==null;var rt=h!==null&&h.memoizedState!==null,Mt=Vc,Qt=es;if(Vc=Mt||E,es=Qt||rt,Hl(c,a),es=Qt,Vc=Mt,$l(a),g&8192)e:for(c=a.stateNode,c._visibility=E?c._visibility&-2:c._visibility|1,E&&(h===null||rt||Vc||es||Im(a)),h=null,c=a;;){if(c.tag===5||c.tag===26){if(h===null){rt=h=c;try{if(O=rt.stateNode,E)ae=O.style,typeof ae.setProperty=="function"?ae.setProperty("display","none","important"):ae.display="none";else{_e=rt.stateNode;var on=rt.memoizedProps.style,Pt=on!=null&&on.hasOwnProperty("display")?on.display:null;_e.style.display=Pt==null||typeof Pt=="boolean"?"":(""+Pt).trim()}}catch(Qn){Qi(rt,rt.return,Qn)}}}else if(c.tag===6){if(h===null){rt=c;try{rt.stateNode.nodeValue=E?"":rt.memoizedProps}catch(Qn){Qi(rt,rt.return,Qn)}}}else if(c.tag===18){if(h===null){rt=c;try{var Gt=rt.stateNode;E?DI(Gt,!0):DI(rt.stateNode,!1)}catch(Qn){Qi(rt,rt.return,Qn)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===a)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break e;for(;c.sibling===null;){if(c.return===null||c.return===a)break e;h===c&&(h=null),c=c.return}h===c&&(h=null),c.sibling.return=c.return,c=c.sibling}g&4&&(g=a.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,J2(a,h))));break;case 19:Hl(c,a),$l(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,J2(a,g)));break;case 30:break;case 21:break;default:Hl(c,a),$l(a)}}function $l(a){var c=a.flags;if(c&2){try{for(var h,g=a.return;g!==null;){if(xf(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var E=h.stateNode,O=n0(a);Uc(a,O,E);break;case 5:var ae=h.stateNode;h.flags&32&&(er(ae,""),h.flags&=-33);var _e=n0(a);Uc(a,_e,ae);break;case 3:case 4:var rt=h.stateNode.containerInfo,Mt=n0(a);Tm(a,Mt,rt);break;default:throw Error(r(161))}}catch(Qt){Qi(a,a.return,Qt)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function GT(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var c=a;GT(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),a=a.sibling}}function _f(a,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)hc(a,c.alternate,c),c=c.sibling}function Im(a){for(a=a.child;a!==null;){var c=a;switch(c.tag){case 0:case 11:case 14:case 15:Xi(4,c,c.return),Im(c);break;case 1:Ms(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&cs(c,c.return,h),Im(c);break;case 27:Fv(c.stateNode);case 26:case 5:Ms(c,c.return),Im(c);break;case 22:c.memoizedState===null&&Im(c);break;case 30:Im(c);break;default:Im(c)}a=a.sibling}}function Cf(a,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var g=c.alternate,E=a,O=c,ae=O.flags;switch(O.tag){case 0:case 11:case 15:Cf(E,O,h),Ns(4,O);break;case 1:if(Cf(E,O,h),g=O,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(Mt){Qi(g,g.return,Mt)}if(g=O,E=g.updateQueue,E!==null){var _e=g.stateNode;try{var rt=E.shared.hiddenCallbacks;if(rt!==null)for(E.shared.hiddenCallbacks=null,E=0;E<rt.length;E++)cv(rt[E],_e)}catch(Mt){Qi(g,g.return,Mt)}}h&&ae&64&&Jo(O),Ss(O,O.return);break;case 27:Tv(O);case 26:case 5:Cf(E,O,h),h&&g===null&&ae&4&&Yh(O),Ss(O,O.return);break;case 12:Cf(E,O,h);break;case 31:Cf(E,O,h),h&&ae&4&&VT(E,O);break;case 13:Cf(E,O,h),h&&ae&4&&HT(E,O);break;case 22:O.memoizedState===null&&Cf(E,O,h),Ss(O,O.return);break;case 30:break;default:Cf(E,O,h)}c=c.sibling}}function PC(a,c){var h=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),a=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(a=c.memoizedState.cachePool.pool),a!==h&&(a!=null&&a.refCount++,h!=null&&xa(h))}function BC(a,c){a=null,c.alternate!==null&&(a=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==a&&(c.refCount++,a!=null&&xa(a))}function _u(a,c,h,g){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)qT(a,c,h,g),c=c.sibling}function qT(a,c,h,g){var E=c.flags;switch(c.tag){case 0:case 11:case 15:_u(a,c,h,g),E&2048&&Ns(9,c);break;case 1:_u(a,c,h,g);break;case 3:_u(a,c,h,g),E&2048&&(a=null,c.alternate!==null&&(a=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==a&&(c.refCount++,a!=null&&xa(a)));break;case 12:if(E&2048){_u(a,c,h,g),a=c.stateNode;try{var O=c.memoizedProps,ae=O.id,_e=O.onPostCommit;typeof _e=="function"&&_e(ae,c.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(rt){Qi(c,c.return,rt)}}else _u(a,c,h,g);break;case 31:_u(a,c,h,g);break;case 13:_u(a,c,h,g);break;case 23:break;case 22:O=c.stateNode,ae=c.alternate,c.memoizedState!==null?O._visibility&2?_u(a,c,h,g):Ov(a,c):O._visibility&2?_u(a,c,h,g):(O._visibility|=2,r0(a,c,h,g,(c.subtreeFlags&10256)!==0||!1)),E&2048&&PC(ae,c);break;case 24:_u(a,c,h,g),E&2048&&BC(c.alternate,c);break;default:_u(a,c,h,g)}}function r0(a,c,h,g,E){for(E=E&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var O=a,ae=c,_e=h,rt=g,Mt=ae.flags;switch(ae.tag){case 0:case 11:case 15:r0(O,ae,_e,rt,E),Ns(8,ae);break;case 23:break;case 22:var Qt=ae.stateNode;ae.memoizedState!==null?Qt._visibility&2?r0(O,ae,_e,rt,E):Ov(O,ae):(Qt._visibility|=2,r0(O,ae,_e,rt,E)),E&&Mt&2048&&PC(ae.alternate,ae);break;case 24:r0(O,ae,_e,rt,E),E&&Mt&2048&&BC(ae.alternate,ae);break;default:r0(O,ae,_e,rt,E)}c=c.sibling}}function Ov(a,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=a,g=c,E=g.flags;switch(g.tag){case 22:Ov(h,g),E&2048&&PC(g.alternate,g);break;case 24:Ov(h,g),E&2048&&BC(g.alternate,g);break;default:Ov(h,g)}c=c.sibling}}var Nv=8192;function i0(a,c,h){if(a.subtreeFlags&Nv)for(a=a.child;a!==null;)WT(a,c,h),a=a.sibling}function WT(a,c,h){switch(a.tag){case 26:i0(a,c,h),a.flags&Nv&&a.memoizedState!==null&&PH(h,ku,a.memoizedState,a.memoizedProps);break;case 5:i0(a,c,h);break;case 3:case 4:var g=ku;ku=hw(a.stateNode.containerInfo),i0(a,c,h),ku=g;break;case 22:a.memoizedState===null&&(g=a.alternate,g!==null&&g.memoizedState!==null?(g=Nv,Nv=16777216,i0(a,c,h),Nv=g):i0(a,c,h));break;default:i0(a,c,h)}}function KT(a){var c=a.alternate;if(c!==null&&(a=c.child,a!==null)){c.child=null;do c=a.sibling,a.sibling=null,a=c;while(a!==null)}}
vendor: 17,538 bytes, line 48
48function Mv(a){var c=a.deletions;if((a.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var g=c[h];ts=g,XT(g,a)}KT(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)YT(a),a=a.sibling}function YT(a){switch(a.tag){case 0:case 11:case 15:Mv(a),a.flags&2048&&Xi(9,a,a.return);break;case 3:Mv(a);break;case 12:Mv(a);break;case 22:var c=a.stateNode;a.memoizedState!==null&&c._visibility&2&&(a.return===null||a.return.tag!==13)?(c._visibility&=-3,ew(a)):Mv(a);break;default:Mv(a)}}function ew(a){var c=a.deletions;if((a.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var g=c[h];ts=g,XT(g,a)}KT(a)}for(a=a.child;a!==null;){switch(c=a,c.tag){case 0:case 11:case 15:Xi(8,c,c.return),ew(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,ew(c));break;default:ew(c)}a=a.sibling}}function XT(a,c){for(;ts!==null;){var h=ts;switch(h.tag){case 0:case 11:case 15:Xi(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:xa(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,ts=g;else e:for(h=a;ts!==null;){g=ts;var E=g.sibling,O=g.return;if(Rv(g),g===h){ts=null;break e}if(E!==null){E.return=O,ts=E;break e}ts=O}}}var ZV={getCacheForType:function(a){var c=os(fi),h=c.data.get(a);return h===void 0&&(h=a(),c.data.set(a,h)),h},cacheSignal:function(){return os(fi).controller.signal}},QV=typeof WeakMap=="function"?WeakMap:Map,Fi=0,lo=null,hi=null,bi=0,Zi=0,pc=null,Xh=!1,o0=!1,jC=!1,Sf=0,us=0,Zh=0,Rm=0,FC=0,mc=0,s0=0,Dv=null,Gl=null,zC=!1,tw=0,ZT=0,nw=1/0,rw=null,Qh=null,Ys=0,Jh=null,a0=null,Ef=0,UC=0,VC=null,QT=null,Lv=0,HC=null;function gc(){return(Fi&2)!==0&&bi!==0?bi&-bi:U.T!==null?YC():sn()}function JT(){if(mc===0)if((bi&536870912)===0||Rt){var a=tr;tr<<=1,(tr&3932160)===0&&(tr=262144),mc=a}else mc=536870912;return a=cl.current,a!==null&&(a.flags|=32),mc}function ql(a,c,h){(a===lo&&(Zi===2||Zi===9)||a.cancelPendingCommit!==null)&&(l0(a,0),ep(a,bi,mc,!1)),Lt(a,h),((Fi&2)===0||a!==lo)&&(a===lo&&((Fi&2)===0&&(Rm|=h),us===4&&ep(a,bi,mc,!1)),ud(a))}function eI(a,c,h){if((Fi&6)!==0)throw Error(r(327));var g=!h&&(c&127)===0&&(c&a.expiredLanes)===0||Bt(a,c),E=g?tH(a,c):GC(a,c,!0),O=g;do{if(E===0){o0&&!g&&ep(a,c,0,!1);break}else{if(h=a.current.alternate,O&&!JV(h)){E=GC(a,c,!1),O=!1;continue}if(E===2){if(O=c,a.errorRecoveryDisabledLanes&O)var ae=0;else ae=a.pendingLanes&-536870913,ae=ae!==0?ae:ae&536870912?536870912:0;if(ae!==0){c=ae;e:{var _e=a;E=Dv;var rt=_e.current.memoizedState.isDehydrated;if(rt&&(l0(_e,ae).flags|=256),ae=GC(_e,ae,!1),ae!==2){if(jC&&!rt){_e.errorRecoveryDisabledLanes|=O,Rm|=O,E=4;break e}O=Gl,Gl=E,O!==null&&(Gl===null?Gl=O:Gl.push.apply(Gl,O))}E=ae}if(O=!1,E!==2)continue}}if(E===1){l0(a,0),ep(a,c,0,!0);break}e:{switch(g=a,O=E,O){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:ep(g,c,mc,!Xh);break e;case 2:Gl=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(E=tw+300-Le(),10<E)){if(ep(g,c,mc,!Xh),$e(g,0,!0)!==0)break e;Ef=c,g.timeoutHandle=OI(tI.bind(null,g,h,Gl,rw,zC,c,mc,Rm,s0,Xh,O,"Throttled",-0,0),E);break e}tI(g,h,Gl,rw,zC,c,mc,Rm,s0,Xh,O,null,-0,0)}}break}while(!0);ud(a)}function tI(a,c,h,g,E,O,ae,_e,rt,Mt,Qt,on,Pt,Gt){if(a.timeoutHandle=-1,on=c.subtreeFlags,on&8192||(on&16785408)===16785408){on={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},WT(c,O,on);var Qn=(O&62914560)===O?tw-Le():(O&4194048)===O?ZT-Le():0;if(Qn=BH(on,Qn),Qn!==null){Ef=O,a.cancelPendingCommit=Qn(cI.bind(null,a,c,O,h,g,E,ae,_e,rt,Qt,on,null,Pt,Gt)),ep(a,O,ae,!Mt);return}}cI(a,c,O,h,g,E,ae,_e,rt)}function JV(a){for(var c=a;;){var h=c.tag;if((h===0||h===11||h===15)&&c.flags&16384&&(h=c.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var E=h[g],O=E.getSnapshot;E=E.value;try{if(!pe(O(),E))return!1}catch{return!1}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ep(a,c,h,g){c&=~FC,c&=~Rm,a.suspendedLanes|=c,a.pingedLanes&=~c,g&&(a.warmLanes|=c),g=a.expirationTimes;for(var E=c;0<E;){var O=31-gt(E),ae=1<<O;g[O]=-1,E&=~ae}h!==0&&Te(a,h,c)}function iw(){return(Fi&6)===0?(Pv(0),!1):!0}function $C(){if(hi!==null){if(Zi===0)var a=hi.return;else a=hi,Ws=Ji=null,hv(a),Ju=null,cm=0,a=hi;for(;a!==null;)Cs(a.alternate,a),a=a.return;hi=null}}function l0(a,c){var h=a.timeoutHandle;h!==-1&&(a.timeoutHandle=-1,bH(h)),h=a.cancelPendingCommit,h!==null&&(a.cancelPendingCommit=null,h()),Ef=0,$C(),lo=a,hi=h=go(a.current,null),bi=c,Zi=0,pc=null,Xh=!1,o0=Bt(a,c),jC=!1,s0=mc=FC=Rm=Zh=us=0,Gl=Dv=null,zC=!1,(c&8)!==0&&(c|=c&32);var g=a.entangledLanes;if(g!==0)for(a=a.entanglements,g&=c;0<g;){var E=31-gt(g),O=1<<E;c|=a[E],g&=~O}return Sf=c,rl(),h}function nI(a,c){Ur=null,U.H=Ks,c===Lo||c===zc?(c=N2(),Zi=3):c===aa?(c=N2(),Zi=4):Zi=c===cd?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,pc=c,hi===null&&(us=1,Ul(a,oo(c,a.current)))}function rI(){var a=cl.current;return a===null?!0:(bi&4194048)===bi?Ba===null:(bi&62914560)===bi||(bi&536870912)!==0?a===Ba:!1}function iI(){var a=U.H;return U.H=Ks,a===null?Ks:a}function oI(){var a=U.A;return U.A=ZV,a}function ow(){us=4,Xh||(bi&4194048)!==bi&&cl.current!==null||(o0=!0),(Zh&134217727)===0&&(Rm&134217727)===0||lo===null||ep(lo,bi,mc,!1)}function GC(a,c,h){var g=Fi;Fi|=2;var E=iI(),O=oI();(lo!==a||bi!==c)&&(rw=null,l0(a,c)),c=!1;var ae=us;e:do try{if(Zi!==0&&hi!==null){var _e=hi,rt=pc;switch(Zi){case 8:$C(),ae=6;break e;case 3:case 2:case 9:case 6:cl.current===null&&(c=!0);var Mt=Zi;if(Zi=0,pc=null,c0(a,_e,rt,Mt),h&&o0){ae=0;break e}break;default:Mt=Zi,Zi=0,pc=null,c0(a,_e,rt,Mt)}}eH(),ae=us;break}catch(Qt){nI(a,Qt)}while(!0);return c&&a.shellSuspendCounter++,Ws=Ji=null,Fi=g,U.H=E,U.A=O,hi===null&&(lo=null,bi=0,rl()),ae}function eH(){for(;hi!==null;)sI(hi)}function tH(a,c){var h=Fi;Fi|=2;var g=iI(),E=oI();lo!==a||bi!==c?(rw=null,nw=Le()+500,l0(a,c)):o0=Bt(a,c);e:do try{if(Zi!==0&&hi!==null){c=hi;var O=pc;t:switch(Zi){case 1:Zi=0,pc=null,c0(a,c,O,1);break;case 2:case 9:if(ff(O)){Zi=0,pc=null,aI(c);break}c=function(){Zi!==2&&Zi!==9||lo!==a||(Zi=7),ud(a)},O.then(c,c);break e;case 3:Zi=7;break e;case 4:Zi=5;break e;case 7:ff(O)?(Zi=0,pc=null,aI(c)):(Zi=0,pc=null,c0(a,c,O,7));break;case 5:var ae=null;switch(hi.tag){case 26:ae=hi.memoizedState;case 5:case 27:var _e=hi;if(ae?qI(ae):_e.stateNode.complete){Zi=0,pc=null;var rt=_e.sibling;if(rt!==null)hi=rt;else{var Mt=_e.return;Mt!==null?(hi=Mt,sw(Mt)):hi=null}break t}}Zi=0,pc=null,c0(a,c,O,5);break;case 6:Zi=0,pc=null,c0(a,c,O,6);break;case 8:$C(),us=6;break e;default:throw Error(r(462))}}nH();break}catch(Qt){nI(a,Qt)}while(!0);return Ws=Ji=null,U.H=g,U.A=E,Fi=h,hi!==null?0:(lo=null,bi=0,rl(),us)}function nH(){for(;hi!==null&&!oe();)sI(hi)}function sI(a){var c=Tt(a.alternate,a,Sf);a.memoizedProps=a.pendingProps,c===null?sw(a):hi=c}function aI(a){var c=a,h=c.alternate;switch(c.tag){case 15:case 0:c=A(h,c,c.pendingProps,c.type,void 0,bi);break;case 11:c=A(h,c,c.pendingProps,c.type.render,c.ref,bi);break;case 5:hv(c);default:Cs(h,c),c=hi=ac(c,Sf),c=Tt(h,c,Sf)}a.memoizedProps=a.pendingProps,c===null?sw(a):hi=c}function c0(a,c,h,g){Ws=Ji=null,hv(c),Ju=null,cm=0;var E=c.return;try{if(dc(a,E,c,h,bi)){us=1,Ul(a,oo(h,a.current)),hi=null;return}}catch(O){if(E!==null)throw hi=E,O;us=1,Ul(a,oo(h,a.current)),hi=null;return}c.flags&32768?(Rt||g===1?a=!0:o0||(bi&536870912)!==0?a=!1:(Xh=a=!0,(g===2||g===9||g===3||g===6)&&(g=cl.current,g!==null&&g.tag===13&&(g.flags|=16384))),lI(c,a)):sw(c)}function sw(a){var c=a;do{if((c.flags&32768)!==0){lI(c,Xh);return}a=c.return;var h=vi(c.alternate,c,Sf);if(h!==null){hi=h;return}if(c=c.sibling,c!==null){hi=c;return}hi=c=a}while(c!==null);us===0&&(us=5)}function lI(a,c){do{var h=Yi(a.alternate,a);if(h!==null){h.flags&=32767,hi=h;return}if(h=a.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(a=a.sibling,a!==null)){hi=a;return}hi=a=h}while(a!==null);us=6,hi=null}function cI(a,c,h,g,E,O,ae,_e,rt){a.cancelPendingCommit=null;do aw();while(Ys!==0);if((Fi&6)!==0)throw Error(r(327));if(c!==null){if(c===a.current)throw Error(r(177));if(O=c.lanes|c.childLanes,O|=La,St(a,h,O,ae,_e,rt),a===lo&&(hi=lo=null,bi=0),a0=c,Jh=a,Ef=h,UC=O,VC=E,QT=g,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,sH(mt,function(){return pI(),null})):(a.callbackNode=null,a.callbackPriority=0),g=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||g){g=U.T,U.T=null,E=q.p,q.p=2,ae=Fi,Fi|=4;try{Q2(a,c,h)}finally{Fi=ae,q.p=E,U.T=g}}Ys=1,uI(),dI(),fI()}}function uI(){if(Ys===1){Ys=0;var a=Jh,c=a0,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=U.T,U.T=null;var g=q.p;q.p=2;var E=Fi;Fi|=4;try{$T(c,a);var O=rS,ae=Ie(a.containerInfo),_e=O.focusedElem,rt=O.selectionRange;if(ae!==_e&&_e&&_e.ownerDocument&&He(_e.ownerDocument.documentElement,_e)){if(rt!==null&&Xe(_e)){var Mt=rt.start,Qt=rt.end;if(Qt===void 0&&(Qt=Mt),"selectionStart"in _e)_e.selectionStart=Mt,_e.selectionEnd=Math.min(Qt,_e.value.length);else{var on=_e.ownerDocument||document,Pt=on&&on.defaultView||window;if(Pt.getSelection){var Gt=Pt.getSelection(),Qn=_e.textContent.length,Ir=Math.min(rt.start,Qn),to=rt.end===void 0?Ir:Math.min(rt.end,Qn);!Gt.extend&&Ir>to&&(ae=to,to=Ir,Ir=ae);var Ct=Me(_e,Ir),ft=Me(_e,to);if(Ct&&ft&&(Gt.rangeCount!==1||Gt.anchorNode!==Ct.node||Gt.anchorOffset!==Ct.offset||Gt.focusNode!==ft.node||Gt.focusOffset!==ft.offset)){var Nt=on.createRange();Nt.setStart(Ct.node,Ct.offset),Gt.removeAllRanges(),Ir>to?(Gt.addRange(Nt),Gt.extend(ft.node,ft.offset)):(Nt.setEnd(ft.node,ft.offset),Gt.addRange(Nt))}}}}for(on=[],Gt=_e;Gt=Gt.parentNode;)Gt.nodeType===1&&on.push({element:Gt,left:Gt.scrollLeft,top:Gt.scrollTop});for(typeof _e.focus=="function"&&_e.focus(),_e=0;_e<on.length;_e++){var nn=on[_e];nn.element.scrollLeft=nn.left,nn.element.scrollTop=nn.top}}bw=!!nS,rS=nS=null}finally{Fi=E,q.p=g,U.T=h}}a.current=c,Ys=2}}function dI(){if(Ys===2){Ys=0;var a=Jh,c=a0,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=U.T,U.T=null;var g=q.p;q.p=2;var E=Fi;Fi|=4;try{hc(a,c.alternate,c)}finally{Fi=E,q.p=g,U.T=h}}Ys=3}}function fI(){if(Ys===4||Ys===3){Ys=0,Fe();var a=Jh,c=a0,h=Ef,g=QT;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Ys=5:(Ys=0,a0=Jh=null,hI(a,a.pendingLanes));var E=a.pendingLanes;if(E===0&&(Qh=null),$t(h),c=c.stateNode,Ve&&typeof Ve.onCommitFiberRoot=="function")try{Ve.onCommitFiberRoot(me,c,void 0,(c.current.flags&128)===128)}catch{}if(g!==null){c=U.T,E=q.p,q.p=2,U.T=null;try{for(var O=a.onRecoverableError,ae=0;ae<g.length;ae++){var _e=g[ae];O(_e.value,{componentStack:_e.stack})}}finally{U.T=c,q.p=E}}(Ef&3)!==0&&aw(),ud(a),E=a.pendingLanes,(h&261930)!==0&&(E&42)!==0?a===HC?Lv++:(Lv=0,HC=a):Lv=0,Pv(0)}}function hI(a,c){(a.pooledCacheLanes&=c)===0&&(c=a.pooledCache,c!=null&&(a.pooledCache=null,xa(c)))}function aw(){return uI(),dI(),fI(),pI()}function pI(){if(Ys!==5)return!1;var a=Jh,c=UC;UC=0;var h=$t(Ef),g=U.T,E=q.p;try{q.p=32>h?32:h,U.T=null,h=VC,VC=null;var O=Jh,ae=Ef;if(Ys=0,a0=Jh=null,Ef=0,(Fi&6)!==0)throw Error(r(331));var _e=Fi;if(Fi|=4,YT(O.current),qT(O,O.current,ae,h),Fi=_e,Pv(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot=="function")try{Ve.onPostCommitFiberRoot(me,O)}catch{}return!0}finally{q.p=E,U.T=g,hI(a,c)}}function mI(a,c,h){c=oo(h,c),c=_s(a.stateNode,c,2),a=nd(a,c,2),a!==null&&(Lt(a,2),ud(a))}function Qi(a,c,h){if(a.tag===3)mI(a,a,h);else for(;c!==null;){if(c.tag===3){mI(c,a,h);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Qh===null||!Qh.has(g))){a=oo(h,a),h=Os(2),g=nd(c,h,2),g!==null&&(as(h,g,c,a),Lt(g,2),ud(g));break}}c=c.return}}function qC(a,c,h){var g=a.pingCache;if(g===null){g=a.pingCache=new QV;var E=new Set;g.set(c,E)}else E=g.get(c),E===void 0&&(E=new Set,g.set(c,E));E.has(h)||(jC=!0,E.add(h),a=rH.bind(null,a,c,h),c.then(a,a))}function rH(a,c,h){var g=a.pingCache;g!==null&&g.delete(c),a.pingedLanes|=a.suspendedLanes&h,a.warmLanes&=~h,lo===a&&(bi&h)===h&&(us===4||us===3&&(bi&62914560)===bi&&300>Le()-tw?(Fi&2)===0&&l0(a,0):FC|=h,s0===bi&&(s0=0)),ud(a)}function gI(a,c){c===0&&(c=Pn()),a=va(a,c),a!==null&&(Lt(a,c),ud(a))}function iH(a){var c=a.memoizedState,h=0;c!==null&&(h=c.retryLane),gI(a,h)}function oH(a,c){var h=0;switch(a.tag){case 31:case 13:var g=a.stateNode,E=a.memoizedState;E!==null&&(h=E.retryLane);break;case 19:g=a.stateNode;break;case 22:g=a.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(c),gI(a,h)}function sH(a,c){return Ue(a,c)}var lw=null,u0=null,WC=!1,cw=!1,KC=!1,tp=0;function ud(a){a!==u0&&a.next===null&&(u0===null?lw=u0=a:u0=u0.next=a),cw=!0,WC||(WC=!0,lH())}function Pv(a,c){if(!KC&&cw){KC=!0;do for(var h=!1,g=lw;g!==null;){if(a!==0){var E=g.pendingLanes;if(E===0)var O=0;else{var ae=g.suspendedLanes,_e=g.pingedLanes;O=(1<<31-gt(42|a)+1)-1,O&=E&~(ae&~_e),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(h=!0,wI(g,O))}else O=bi,O=$e(g,g===lo?O:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(O&3)===0||Bt(g,O)||(h=!0,wI(g,O));g=g.next}while(h);KC=!1}}function aH(){yI()}function yI(){cw=WC=!1;var a=0;tp!==0&&vH()&&(a=tp);for(var c=Le(),h=null,g=lw;g!==null;){var E=g.next,O=vI(g,c);O===0?(g.next=null,h===null?lw=E:h.next=E,E===null&&(u0=h)):(h=g,(a!==0||(O&3)!==0)&&(cw=!0)),g=E}Ys!==0&&Ys!==5||Pv(a),tp!==0&&(tp=0)}function vI(a,c){for(var h=a.suspendedLanes,g=a.pingedLanes,E=a.expirationTimes,O=a.pendingLanes&-62914561;0<O;){var ae=31-gt(O),_e=1<<ae,rt=E[ae];rt===-1?((_e&h)===0||(_e&g)!==0)&&(E[ae]=hn(_e,c)):rt<=c&&(a.expiredLanes|=_e),O&=~_e}if(c=lo,h=bi,h=$e(a,a===c?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g=a.callbackNode,h===0||a===c&&(Zi===2||Zi===9)||a.cancelPendingCommit!==null)return g!==null&&g!==null&&K(g),a.callbackNode=null,a.callbackPriority=0;if((h&3)===0||Bt(a,h)){if(c=h&-h,c===a.callbackPriority)return c;switch(g!==null&&K(g),$t(h)){case 2:case 8:h=Pe;break;case 32:h=mt;break;case 268435456:h=de;break;default:h=mt}return g=bI.bind(null,a),h=Ue(h,g),a.callbackPriority=c,a.callbackNode=h,c}return g!==null&&g!==null&&K(g),a.callbackPriority=2,a.callbackNode=null,2}function bI(a,c){if(Ys!==0&&Ys!==5)return a.callbackNode=null,a.callbackPriority=0,null;var h=a.callbackNode;if(aw()&&a.callbackNode!==h)return null;var g=bi;return g=$e(a,a===lo?g:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g===0?null:(eI(a,g,c),vI(a,Le()),a.callbackNode!=null&&a.callbackNode===h?bI.bind(null,a):null)}function wI(a,c){if(aw())return null;eI(a,c,!0)}function lH(){wH(function(){(Fi&6)!==0?Ue(De,aH):yI()})}function YC(){if(tp===0){var a=jl;a===0&&(a=ur,ur<<=1,(ur&261888)===0&&(ur=256)),tp=a}return tp}function xI(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:_o(""+a)}function kI(a,c){var h=c.ownerDocument.createElement("input");return h.name=c.name,h.value=c.value,a.id&&h.setAttribute("form",a.id),c.parentNode.insertBefore(h,c),a=new FormData(a),h.parentNode.removeChild(h),a}function cH(a,c,h,g,E){if(c==="submit"&&h&&h.stateNode===E){var O=xI((E[Wn]||null).action),ae=g.submitter;ae&&(c=(c=ae[Wn]||null)?xI(c.formAction):ae.getAttribute("formAction"),c!==null&&(O=c,ae=null));var _e=new Il("action","action",null,g,E);a.push({event:_e,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(tp!==0){var rt=ae?kI(E,ae):new FormData(E);Zg(h,{pending:!0,data:rt,method:E.method,action:O},null,rt)}}else typeof O=="function"&&(_e.preventDefault(),rt=ae?kI(E,ae):new FormData(E),Zg(h,{pending:!0,data:rt,method:E.method,action:O},O,rt))},currentTarget:E}]})}}for(var XC=0;XC<Ml.length;XC++){var ZC=Ml[XC],uH=ZC.toLowerCase(),dH=ZC[0].toUpperCase()+ZC.slice(1);xs(uH,"on"+dH)}xs(Fr,"onAnimationEnd"),xs(kr,"onAnimationIteration"),xs(ir,"onAnimationStart"),xs("dblclick","onDoubleClick"),xs("focusin","onFocus"),xs("focusout","onBlur"),xs(ii,"onTransitionRun"),xs(Do,"onTransitionStart"),xs(En,"onTransitionCancel"),xs(ws,"onTransitionEnd"),cn("onMouseEnter",["mouseout","mouseover"]),cn("onMouseLeave",["mouseout","mouseover"]),cn("onPointerEnter",["pointerout","pointerover"]),cn("onPointerLeave",["pointerout","pointerover"]),Hi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bv="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),fH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bv));function _I(a,c){c=(c&4)!==0;for(var h=0;h<a.length;h++){var g=a[h],E=g.event;g=g.listeners;e:{var O=void 0;if(c)for(var ae=g.length-1;0<=ae;ae--){var _e=g[ae],rt=_e.instance,Mt=_e.currentTarget;if(_e=_e.listener,rt!==O&&E.isPropagationStopped())break e;O=_e,E.currentTarget=Mt;try{O(E)}catch(Qt){fn(Qt)}
vendor: 4,158 bytes, line 48
48E.currentTarget=null,O=rt}else for(ae=0;ae<g.length;ae++){if(_e=g[ae],rt=_e.instance,Mt=_e.currentTarget,_e=_e.listener,rt!==O&&E.isPropagationStopped())break e;O=_e,E.currentTarget=Mt;try{O(E)}catch(Qt){fn(Qt)}E.currentTarget=null,O=rt}}}}function pi(a,c){var h=c[Yr];h===void 0&&(h=c[Yr]=new Set);var g=a+"__bubble";h.has(g)||(CI(c,a,2,!1),h.add(g))}function QC(a,c,h){var g=0;c&&(g|=4),CI(h,a,g,c)}var uw="_reactListening"+Math.random().toString(36).slice(2);function JC(a){if(!a[uw]){a[uw]=!0,Gs.forEach(function(h){h!=="selectionchange"&&(fH.has(h)||QC(h,!1,a),QC(h,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[uw]||(c[uw]=!0,QC("selectionchange",!1,c))}}function CI(a,c,h,g){switch(JI(c)){case 2:var E=zH;break;case 8:E=UH;break;default:E=pS}h=E.bind(null,c,h,a),E=void 0,!ys||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(E=!0),g?E!==void 0?a.addEventListener(c,h,{capture:!0,passive:E}):a.addEventListener(c,h,!0):E!==void 0?a.addEventListener(c,h,{passive:E}):a.addEventListener(c,h,!1)}function eS(a,c,h,g,E){var O=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var ae=g.tag;if(ae===3||ae===4){var _e=g.stateNode.containerInfo;if(_e===E)break;if(ae===4)for(ae=g.return;ae!==null;){var rt=ae.tag;if((rt===3||rt===4)&&ae.stateNode.containerInfo===E)return;ae=ae.return}for(;_e!==null;){if(ae=Gn(_e),ae===null)return;if(rt=ae.tag,rt===5||rt===6||rt===26||rt===27){g=O=ae;continue e}_e=_e.parentNode}}g=g.return}nc(function(){var Mt=O,Qt=yr(h),on=[];e:{var Pt=Nl.get(a);if(Pt!==void 0){var Gt=Il,Qn=a;switch(a){case"keypress":if(Oc(h)===0)break e;case"keydown":case"keyup":Gt=am;break;case"focusin":Qn="focus",Gt=rc;break;case"focusout":Qn="blur",Gt=rc;break;case"beforeblur":case"afterblur":Gt=rc;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Gt=Mc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Gt=Xd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Gt=nf;break;case Fr:case kr:case ir:Gt=Qd;break;case ws:Gt=pu;break;case"scroll":case"scrollend":Gt=bh;break;case"wheel":Gt=rf;break;case"copy":case"cut":case"paste":Gt=sm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Gt=Yu;break;case"toggle":case"beforetoggle":Gt=lm}var Ir=(c&4)!==0,to=!Ir&&(a==="scroll"||a==="scrollend"),Ct=Ir?Pt!==null?Pt+"Capture":null:Pt;Ir=[];for(var ft=Mt,Nt;ft!==null;){var nn=ft;if(Nt=nn.stateNode,nn=nn.tag,nn!==5&&nn!==26&&nn!==27||Nt===null||Ct===null||(nn=Oa(ft,Ct),nn!=null&&Ir.push(jv(ft,nn,Nt))),to)break;ft=ft.return}0<Ir.length&&(Pt=new Gt(Pt,Qn,null,h,Qt),on.push({event:Pt,listeners:Ir}))}}if((c&7)===0){e:{if(Pt=a==="mouseover"||a==="pointerover",Gt=a==="mouseout"||a==="pointerout",Pt&&h!==Nn&&(Qn=h.relatedTarget||h.fromElement)&&(Gn(Qn)||Qn[qr]))break e;if((Gt||Pt)&&(Pt=Qt.window===Qt?Qt:(Pt=Qt.ownerDocument)?Pt.defaultView||Pt.parentWindow:window,Gt?(Qn=h.relatedTarget||h.toElement,Gt=Mt,Qn=Qn?Gn(Qn):null,Qn!==null&&(to=o(Qn),Ir=Qn.tag,Qn!==to||Ir!==5&&Ir!==27&&Ir!==6)&&(Qn=null)):(Gt=null,Qn=Mt),Gt!==Qn)){if(Ir=Mc,nn="onMouseLeave",Ct="onMouseEnter",ft="mouse",(a==="pointerout"||a==="pointerover")&&(Ir=Yu,nn="onPointerLeave",Ct="onPointerEnter",ft="pointer"),to=Gt==null?Pt:Di(Gt),Nt=Qn==null?Pt:Di(Qn),Pt=new Ir(nn,ft+"leave",Gt,h,Qt),Pt.target=to,Pt.relatedTarget=Nt,nn=null,Gn(Qt)===Mt&&(Ir=new Ir(Ct,ft+"enter",Qn,h,Qt),Ir.target=Nt,Ir.relatedTarget=to,nn=Ir),to=nn,Gt&&Qn)t:{for(Ir=hH,Ct=Gt,ft=Qn,Nt=0,nn=Ct;nn;nn=Ir(nn))Nt++;nn=0;for(var xr=ft;xr;xr=Ir(xr))nn++;for(;0<Nt-nn;)Ct=Ir(Ct),Nt--;for(;0<nn-Nt;)ft=Ir(ft),nn--;for(;Nt--;){if(Ct===ft||ft!==null&&Ct===ft.alternate){Ir=Ct;break t}Ct=Ir(Ct),ft=Ir(ft)}Ir=null}else Ir=null;Gt!==null&&SI(on,Pt,Gt,Ir,!1),Qn!==null&&to!==null&&SI(on,to,Qn,Ir,!0)}}e:{if(Pt=Mt?Di(Mt):window,Gt=Pt.nodeName&&Pt.nodeName.toLowerCase(),Gt==="select"||Gt==="input"&&Pt.type==="file")var Li=cf;else if(tl(Pt))if(ya)Li=R;else{Li=sc;var ar=Oh}
vendor: 17,302 bytes, lines 48-49
48else Gt=Pt.nodeName,!Gt||Gt.toLowerCase()!=="input"||Pt.type!=="checkbox"&&Pt.type!=="radio"?Mt&&No(Mt.elementType)&&(Li=cf):Li=uf;if(Li&&(Li=Li(a,Mt))){nl(on,Li,h,Qt);break e}ar&&ar(a,Pt,Mt),a==="focusout"&&Mt&&Pt.type==="number"&&Mt.memoizedProps.value!=null&&jr(Pt,"number",Pt.value)}switch(ar=Mt?Di(Mt):window,a){case"focusin":(tl(ar)||ar.contentEditable==="true")&&(wt=ar,ct=Mt,vt=null);break;case"focusout":vt=ct=wt=null;break;case"mousedown":Ft=!0;break;case"contextmenu":case"mouseup":case"dragend":Ft=!1,Zt(on,h,Qt);break;case"selectionchange":if(Ke)break;case"keydown":case"keyup":Zt(on,h,Qt)}var Jr;if(bs)e:{switch(a){case"compositionstart":var wi="onCompositionStart";break e;case"compositionend":wi="onCompositionEnd";break e;case"compositionupdate":wi="onCompositionUpdate";break e}wi=void 0}else Pc?af(a,h)&&(wi="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(wi="onCompositionStart");wi&&(of&&h.locale!=="ko"&&(Pc||wi!=="onCompositionStart"?wi==="onCompositionEnd"&&Pc&&(Jr=Na()):(na=Qt,Gu="value"in na?na.value:na.textContent,Pc=!0)),ar=dw(Mt,wi),0<ar.length&&(wi=new ic(wi,a,null,h,Qt),on.push({event:wi,listeners:ar}),Jr?wi.data=Jr:(Jr=Eh(h),Jr!==null&&(wi.data=Jr)))),(Jr=Xu?Ah(a,h):Th(a,h))&&(wi=dw(Mt,"onBeforeInput"),0<wi.length&&(ar=new ic("onBeforeInput","beforeinput",null,h,Qt),on.push({event:ar,listeners:wi}),ar.data=Jr)),cH(on,a,Mt,h,Qt)}_I(on,c)})}function jv(a,c,h){return{instance:a,listener:c,currentTarget:h}}function dw(a,c){for(var h=c+"Capture",g=[];a!==null;){var E=a,O=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||O===null||(E=Oa(a,h),E!=null&&g.unshift(jv(a,E,O)),E=Oa(a,c),E!=null&&g.push(jv(a,E,O))),a.tag===3)return g;a=a.return}return[]}function hH(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function SI(a,c,h,g,E){for(var O=c._reactName,ae=[];h!==null&&h!==g;){var _e=h,rt=_e.alternate,Mt=_e.stateNode;if(_e=_e.tag,rt!==null&&rt===g)break;_e!==5&&_e!==26&&_e!==27||Mt===null||(rt=Mt,E?(Mt=Oa(h,O),Mt!=null&&ae.unshift(jv(h,Mt,rt))):E||(Mt=Oa(h,O),Mt!=null&&ae.push(jv(h,Mt,rt)))),h=h.return}ae.length!==0&&a.push({event:c,listeners:ae})}var pH=/\r\n?/g,mH=/\u0000|\uFFFD/g;function EI(a){return(typeof a=="string"?a:""+a).replace(pH,`
49`).replace(mH,"")}function AI(a,c){return c=EI(c),EI(a)===c}function eo(a,c,h,g,E,O){switch(h){case"children":typeof g=="string"?c==="body"||c==="textarea"&&g===""||er(a,g):(typeof g=="number"||typeof g=="bigint")&&c!=="body"&&er(a,""+g);break;case"className":Ut(a,"class",g);break;case"tabIndex":Ut(a,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Ut(a,h,g);break;case"style":Hr(a,g,O);break;case"data":if(c!=="object"){Ut(a,"data",g);break}case"src":case"href":if(g===""&&(c!=="a"||h!=="href")){a.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(h);break}g=_o(""+g),a.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){a.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof O=="function"&&(h==="formAction"?(c!=="input"&&eo(a,c,"name",E.name,E,null),eo(a,c,"formEncType",E.formEncType,E,null),eo(a,c,"formMethod",E.formMethod,E,null),eo(a,c,"formTarget",E.formTarget,E,null)):(eo(a,c,"encType",E.encType,E,null),eo(a,c,"method",E.method,E,null),eo(a,c,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(h);break}g=_o(""+g),a.setAttribute(h,g);break;case"onClick":g!=null&&(a.onclick=yn);break;case"onScroll":g!=null&&pi("scroll",a);break;case"onScrollEnd":g!=null&&pi("scrollend",a);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(E.children!=null)throw Error(r(60));a.innerHTML=h}}break;case"multiple":a.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":a.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){a.removeAttribute("xlink:href");break}h=_o(""+g),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,""+g):a.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,""):a.removeAttribute(h);break;case"capture":case"download":g===!0?a.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,g):a.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?a.setAttribute(h,g):a.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?a.removeAttribute(h):a.setAttribute(h,g);break;case"popover":pi("beforetoggle",a),pi("toggle",a),Je(a,"popover",g);break;case"xlinkActuate":un(a,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":un(a,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":un(a,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":un(a,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":un(a,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":un(a,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":un(a,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":un(a,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":un(a,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Je(a,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=Mo.get(h)||h,Je(a,h,g))}}function tS(a,c,h,g,E,O){switch(h){case"style":Hr(a,g,O);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(E.children!=null)throw Error(r(60));a.innerHTML=h}}break;case"children":typeof g=="string"?er(a,g):(typeof g=="number"||typeof g=="bigint")&&er(a,""+g);break;case"onScroll":g!=null&&pi("scroll",a);break;case"onScrollEnd":g!=null&&pi("scrollend",a);break;case"onClick":g!=null&&(a.onclick=yn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Oo.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(E=h.endsWith("Capture"),c=h.slice(2,E?h.length-7:void 0),O=a[Wn]||null,O=O!=null?O[h]:null,typeof O=="function"&&a.removeEventListener(c,O,E),typeof g=="function")){typeof O!="function"&&O!==null&&(h in a?a[h]=null:a.hasAttribute(h)&&a.removeAttribute(h)),a.addEventListener(c,g,E);break e}h in a?a[h]=g:g===!0?a.setAttribute(h,""):Je(a,h,g)}}}function _a(a,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":pi("error",a),pi("load",a);var g=!1,E=!1,O;for(O in h)if(h.hasOwnProperty(O)){var ae=h[O];if(ae!=null)switch(O){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:eo(a,c,O,ae,h,null)}}E&&eo(a,c,"srcSet",h.srcSet,h,null),g&&eo(a,c,"src",h.src,h,null);return;case"input":pi("invalid",a);var _e=O=ae=E=null,rt=null,Mt=null;for(g in h)if(h.hasOwnProperty(g)){var Qt=h[g];if(Qt!=null)switch(g){case"name":E=Qt;break;case"type":ae=Qt;break;case"checked":rt=Qt;break;case"defaultChecked":Mt=Qt;break;case"value":O=Qt;break;case"defaultValue":_e=Qt;break;case"children":case"dangerouslySetInnerHTML":if(Qt!=null)throw Error(r(137,c));break;default:eo(a,c,g,Qt,h,null)}}ui(a,O,_e,rt,Mt,ae,E,!1);return;case"select":pi("invalid",a),g=ae=O=null;for(E in h)if(h.hasOwnProperty(E)&&(_e=h[E],_e!=null))switch(E){case"value":O=_e;break;case"defaultValue":ae=_e;break;case"multiple":g=_e;default:eo(a,c,E,_e,h,null)}c=O,h=ae,a.multiple=!!g,c!=null?Zr(a,!!g,c,!1):h!=null&&Zr(a,!!g,h,!0);return;case"textarea":pi("invalid",a),O=E=g=null;for(ae in h)if(h.hasOwnProperty(ae)&&(_e=h[ae],_e!=null))switch(ae){case"value":g=_e;break;case"defaultValue":E=_e;break;case"children":O=_e;break;case"dangerouslySetInnerHTML":if(_e!=null)throw Error(r(91));break;default:eo(a,c,ae,_e,h,null)}Go(a,g,E,O);return;case"option":for(rt in h)if(h.hasOwnProperty(rt)&&(g=h[rt],g!=null))switch(rt){case"selected":a.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:eo(a,c,rt,g,h,null)}return;case"dialog":pi("beforetoggle",a),pi("toggle",a),pi("cancel",a),pi("close",a);break;case"iframe":case"object":pi("load",a);break;case"video":case"audio":for(g=0;g<Bv.length;g++)pi(Bv[g],a);break;case"image":pi("error",a),pi("load",a);break;case"details":pi("toggle",a);break;case"embed":case"source":case"link":pi("error",a),pi("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Mt in h)if(h.hasOwnProperty(Mt)&&(g=h[Mt],g!=null))switch(Mt){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:eo(a,c,Mt,g,h,null)}return;default:if(No(c)){for(Qt in h)h.hasOwnProperty(Qt)&&(g=h[Qt],g!==void 0&&tS(a,c,Qt,g,h,void 0));return}}for(_e in h)h.hasOwnProperty(_e)&&(g=h[_e],g!=null&&eo(a,c,_e,g,h,null))}function gH(a,c,h,g){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,O=null,ae=null,_e=null,rt=null,Mt=null,Qt=null;for(Gt in h){var on=h[Gt];if(h.hasOwnProperty(Gt)&&on!=null)switch(Gt){case"checked":break;case"value":break;case"defaultValue":rt=on;default:g.hasOwnProperty(Gt)||eo(a,c,Gt,null,g,on)}}for(var Pt in g){var Gt=g[Pt];if(on=h[Pt],g.hasOwnProperty(Pt)&&(Gt!=null||on!=null))switch(Pt){case"type":O=Gt;break;case"name":E=Gt;break;case"checked":Mt=Gt;break;case"defaultChecked":Qt=Gt;break;case"value":ae=Gt;break;case"defaultValue":_e=Gt;break;case"children":case"dangerouslySetInnerHTML":if(Gt!=null)throw Error(r(137,c));break;default:Gt!==on&&eo(a,c,Pt,Gt,g,on)}}Pr(a,ae,_e,rt,Mt,Qt,O,E);return;case"select":Gt=ae=_e=Pt=null;for(O in h)if(rt=h[O],h.hasOwnProperty(O)&&rt!=null)switch(O){case"value":break;case"multiple":Gt=rt;default:g.hasOwnProperty(O)||eo(a,c,O,null,g,rt)}for(E in g)if(O=g[E],rt=h[E],g.hasOwnProperty(E)&&(O!=null||rt!=null))switch(E){case"value":Pt=O;break;case"defaultValue":_e=O;break;case"multiple":ae=O;default:O!==rt&&eo(a,c,E,O,g,rt)}c=_e,h=ae,g=Gt,Pt!=null?Zr(a,!!h,Pt,!1):!!g!=!!h&&(c!=null?Zr(a,!!h,c,!0):Zr(a,!!h,h?[]:"",!1));return;case"textarea":Gt=Pt=null;for(_e in h)if(E=h[_e],h.hasOwnProperty(_e)&&E!=null&&!g.hasOwnProperty(_e))switch(_e){case"value":break;case"children":break;default:eo(a,c,_e,null,g,E)}for(ae in g)if(E=g[ae],O=h[ae],g.hasOwnProperty(ae)&&(E!=null||O!=null))switch(ae){case"value":Pt=E;break;case"defaultValue":Gt=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==O&&eo(a,c,ae,E,g,O)}ro(a,Pt,Gt);return;case"option":for(var Qn in h)if(Pt=h[Qn],h.hasOwnProperty(Qn)&&Pt!=null&&!g.hasOwnProperty(Qn))switch(Qn){case"selected":a.selected=!1;break;default:eo(a,c,Qn,null,g,Pt)}for(rt in g)if(Pt=g[rt],Gt=h[rt],g.hasOwnProperty(rt)&&Pt!==Gt&&(Pt!=null||Gt!=null))switch(rt){case"selected":a.selected=Pt&&typeof Pt!="function"&&typeof Pt!="symbol";break;default:eo(a,c,rt,Pt,g,Gt)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ir in h)Pt=h[Ir],h.hasOwnProperty(Ir)&&Pt!=null&&!g.hasOwnProperty(Ir)&&eo(a,c,Ir,null,g,Pt);for(Mt in g)if(Pt=g[Mt],Gt=h[Mt],g.hasOwnProperty(Mt)&&Pt!==Gt&&(Pt!=null||Gt!=null))switch(Mt){case"children":case"dangerouslySetInnerHTML":if(Pt!=null)throw Error(r(137,c));break;default:eo(a,c,Mt,Pt,g,Gt)}return;default:if(No(c)){for(var to in h)Pt=h[to],h.hasOwnProperty(to)&&Pt!==void 0&&!g.hasOwnProperty(to)&&tS(a,c,to,void 0,g,Pt);for(Qt in g)Pt=g[Qt],Gt=h[Qt],!g.hasOwnProperty(Qt)||Pt===Gt||Pt===void 0&&Gt===void 0||tS(a,c,Qt,Pt,g,Gt);return}}for(var Ct in h)Pt=h[Ct],h.hasOwnProperty(Ct)&&Pt!=null&&!g.hasOwnProperty(Ct)&&eo(a,c,Ct,null,g,Pt);for(on in g)Pt=g[on],Gt=h[on],!g.hasOwnProperty(on)||Pt===Gt||Pt==null&&Gt==null||eo(a,c,on,Pt,g,Gt)}function TI(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yH(){if(typeof performance.getEntriesByType=="function"){for(var a=0,c=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var E=h[g],O=E.transferSize,ae=E.initiatorType,_e=E.duration;if(O&&_e&&TI(ae)){for(ae=0,_e=E.responseEnd,g+=1;g<h.length;g++){var rt=h[g],Mt=rt.startTime;if(Mt>_e)break;var Qt=rt.transferSize,on=rt.initiatorType;Qt&&TI(on)&&(rt=rt.responseEnd,ae+=Qt*(rt<_e?1:(_e-Mt)/(rt-Mt)))}if(--g,c+=8*(O+ae)/(E.duration/1e3),a++,10<a)break}}if(0<a)return c/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var nS=null,rS=null;function fw(a){return a.nodeType===9?a:a.ownerDocument}function II(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function RI(a,c){if(a===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&c==="foreignObject"?0:a}function iS(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var oS=null;function vH(){var a=window.event;return a&&a.type==="popstate"?a===oS?!1:(oS=a,!0):(oS=null,!1)}var OI=typeof setTimeout=="function"?setTimeout:void 0,bH=typeof clearTimeout=="function"?clearTimeout:void 0,NI=typeof Promise=="function"?Promise:void 0,wH=typeof queueMicrotask=="function"?queueMicrotask:typeof NI<"u"?function(a){return NI.resolve(null).then(a).catch(xH)}:OI;function xH(a){setTimeout(function(){throw a})}function np(a){return a==="head"}function MI(a,c){var h=c,g=0;do{var E=h.nextSibling;if(a.removeChild(h),E&&E.nodeType===8)if(h=E.data,h==="/$"||h==="/&"){if(g===0){a.removeChild(E),p0(c);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")Fv(a.ownerDocument.documentElement);else if(h==="head"){h=a.ownerDocument.head,Fv(h);for(var O=h.firstChild;O;){var ae=O.nextSibling,_e=O.nodeName;O[zr]||_e==="SCRIPT"||_e==="STYLE"||_e==="LINK"&&O.rel.toLowerCase()==="stylesheet"||h.removeChild(O),O=ae}}else h==="body"&&Fv(a.ownerDocument.body);h=E}while(h);p0(c)}function DI(a,c){var h=a;a=0;do{var g=h.nextSibling;if(h.nodeType===1?c?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(c?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(a===0)break;a--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||a++;h=g}while(h)}function sS(a){var c=a.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var h=c;switch(c=c.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":sS(h),Kn(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}a.removeChild(h)}}function kH(a,c,h,g){for(;a.nodeType===1;){var E=h;if(a.nodeName.toLowerCase()!==c.toLowerCase()){if(!g&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(g){if(!a[zr])switch(c){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(O=a.getAttribute("rel"),O==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(O!==E.rel||a.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||a.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||a.getAttribute("title")!==(E.title==null?null:E.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(O=a.getAttribute("src"),(O!==(E.src==null?null:E.src)||a.getAttribute("type")!==(E.type==null?null:E.type)||a.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&O&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(c==="input"&&a.type==="hidden"){var O=E.name==null?null:""+E.name;if(E.type==="hidden"&&a.getAttribute("name")===O)return a}else return a;
vendor: 11,359 bytes, line 49
49if(a=Hc(a.nextSibling),a===null)break}return null}function _H(a,c,h){if(c==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=Hc(a.nextSibling),a===null))return null;return a}function LI(a,c){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=Hc(a.nextSibling),a===null))return null;return a}function aS(a){return a.data==="$?"||a.data==="$~"}function lS(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function CH(a,c){var h=a.ownerDocument;if(a.data==="$~")a._reactRetry=c;else if(a.data!=="$?"||h.readyState!=="loading")c();else{var g=function(){c(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),a._reactRetry=g}}function Hc(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return a}var cS=null;function PI(a){a=a.nextSibling;for(var c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"||h==="/&"){if(c===0)return Hc(a.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}a=a.nextSibling}return null}function BI(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(c===0)return a;c--}else h!=="/$"&&h!=="/&"||c++}a=a.previousSibling}return null}function jI(a,c,h){switch(c=fw(h),a){case"html":if(a=c.documentElement,!a)throw Error(r(452));return a;case"head":if(a=c.head,!a)throw Error(r(453));return a;case"body":if(a=c.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Fv(a){for(var c=a.attributes;c.length;)a.removeAttributeNode(c[0]);Kn(a)}var $c=new Map,FI=new Set;function hw(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Af=q.d;q.d={f:SH,r:EH,D:AH,C:TH,L:IH,m:RH,X:NH,S:OH,M:MH};function SH(){var a=Af.f(),c=iw();return a||c}function EH(a){var c=ni(a);c!==null&&c.tag===5&&c.type==="form"?Gh(c):Af.r(a)}var d0=typeof document>"u"?null:document;function zI(a,c,h){var g=d0;if(g&&typeof c=="string"&&c){var E=$n(c);E='link[rel="'+a+'"][href="'+E+'"]',typeof h=="string"&&(E+='[crossorigin="'+h+'"]'),FI.has(E)||(FI.add(E),a={rel:a,crossOrigin:h,href:c},g.querySelector(E)===null&&(c=g.createElement("link"),_a(c,"link",a),Si(c),g.head.appendChild(c)))}}function AH(a){Af.D(a),zI("dns-prefetch",a,null)}function TH(a,c){Af.C(a,c),zI("preconnect",a,c)}function IH(a,c,h){Af.L(a,c,h);var g=d0;if(g&&a&&c){var E='link[rel="preload"][as="'+$n(c)+'"]';c==="image"&&h&&h.imageSrcSet?(E+='[imagesrcset="'+$n(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(E+='[imagesizes="'+$n(h.imageSizes)+'"]')):E+='[href="'+$n(a)+'"]';var O=E;switch(c){case"style":O=f0(a);break;case"script":O=h0(a)}$c.has(O)||(a=p({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:a,as:c},h),$c.set(O,a),g.querySelector(E)!==null||c==="style"&&g.querySelector(zv(O))||c==="script"&&g.querySelector(Uv(O))||(c=g.createElement("link"),_a(c,"link",a),Si(c),g.head.appendChild(c)))}}function RH(a,c){Af.m(a,c);var h=d0;if(h&&a){var g=c&&typeof c.as=="string"?c.as:"script",E='link[rel="modulepreload"][as="'+$n(g)+'"][href="'+$n(a)+'"]',O=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=h0(a)}if(!$c.has(O)&&(a=p({rel:"modulepreload",href:a},c),$c.set(O,a),h.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Uv(O)))return}g=h.createElement("link"),_a(g,"link",a),Si(g),h.head.appendChild(g)}}}function OH(a,c,h){Af.S(a,c,h);var g=d0;if(g&&a){var E=Ro(g).hoistableStyles,O=f0(a);c=c||"default";var ae=E.get(O);if(!ae){var _e={loading:0,preload:null};if(ae=g.querySelector(zv(O)))_e.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":c},h),(h=$c.get(O))&&uS(a,h);var rt=ae=g.createElement("link");Si(rt),_a(rt,"link",a),rt._p=new Promise(function(Mt,Qt){rt.onload=Mt,rt.onerror=Qt}),rt.addEventListener("load",function(){_e.loading|=1}),rt.addEventListener("error",function(){_e.loading|=2}),_e.loading|=4,pw(ae,c,g)}ae={type:"stylesheet",instance:ae,count:1,state:_e},E.set(O,ae)}}}function NH(a,c){Af.X(a,c);var h=d0;if(h&&a){var g=Ro(h).hoistableScripts,E=h0(a),O=g.get(E);O||(O=h.querySelector(Uv(E)),O||(a=p({src:a,async:!0},c),(c=$c.get(E))&&dS(a,c),O=h.createElement("script"),Si(O),_a(O,"link",a),h.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},g.set(E,O))}}function MH(a,c){Af.M(a,c);var h=d0;if(h&&a){var g=Ro(h).hoistableScripts,E=h0(a),O=g.get(E);O||(O=h.querySelector(Uv(E)),O||(a=p({src:a,async:!0,type:"module"},c),(c=$c.get(E))&&dS(a,c),O=h.createElement("script"),Si(O),_a(O,"link",a),h.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},g.set(E,O))}}function UI(a,c,h,g){var E=(E=st.current)?hw(E):null;if(!E)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=f0(h.href),h=Ro(E).hoistableStyles,g=h.get(c),g||(g={type:"style",instance:null,count:0,state:null},h.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){a=f0(h.href);var O=Ro(E).hoistableStyles,ae=O.get(a);if(ae||(E=E.ownerDocument||E,ae={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(a,ae),(O=E.querySelector(zv(a)))&&!O._p&&(ae.instance=O,ae.state.loading=5),$c.has(a)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},$c.set(a,h),O||DH(E,a,h,ae.state))),c&&g===null)throw Error(r(528,""));return ae}if(c&&g!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=h0(h),h=Ro(E).hoistableScripts,g=h.get(c),g||(g={type:"script",instance:null,count:0,state:null},h.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function f0(a){return'href="'+$n(a)+'"'}function zv(a){return'link[rel="stylesheet"]['+a+"]"}function VI(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function DH(a,c,h,g){a.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=a.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),_a(c,"link",h),Si(c),a.head.appendChild(c))}function h0(a){return'[src="'+$n(a)+'"]'}function Uv(a){return"script[async]"+a}function HI(a,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var g=a.querySelector('style[data-href~="'+$n(h.href)+'"]');if(g)return c.instance=g,Si(g),g;var E=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(a.ownerDocument||a).createElement("style"),Si(g),_a(g,"style",E),pw(g,h.precedence,a),c.instance=g;case"stylesheet":E=f0(h.href);var O=a.querySelector(zv(E));if(O)return c.state.loading|=4,c.instance=O,Si(O),O;g=VI(h),(E=$c.get(E))&&uS(g,E),O=(a.ownerDocument||a).createElement("link"),Si(O);var ae=O;return ae._p=new Promise(function(_e,rt){ae.onload=_e,ae.onerror=rt}),_a(O,"link",g),c.state.loading|=4,pw(O,h.precedence,a),c.instance=O;case"script":return O=h0(h.src),(E=a.querySelector(Uv(O)))?(c.instance=E,Si(E),E):(g=h,(E=$c.get(O))&&(g=p({},h),dS(g,E)),a=a.ownerDocument||a,E=a.createElement("script"),Si(E),_a(E,"link",g),a.head.appendChild(E),c.instance=E);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,pw(g,h.precedence,a));return c.instance}function pw(a,c,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,O=E,ae=0;ae<g.length;ae++){var _e=g[ae];if(_e.dataset.precedence===c)O=_e;else if(O!==E)break}O?O.parentNode.insertBefore(a,O.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(a,c.firstChild))}function uS(a,c){a.crossOrigin==null&&(a.crossOrigin=c.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=c.referrerPolicy),a.title==null&&(a.title=c.title)}function dS(a,c){a.crossOrigin==null&&(a.crossOrigin=c.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=c.referrerPolicy),a.integrity==null&&(a.integrity=c.integrity)}var mw=null;function $I(a,c,h){if(mw===null){var g=new Map,E=mw=new Map;E.set(h,g)}else E=mw,g=E.get(h),g||(g=new Map,E.set(h,g));if(g.has(a))return g;for(g.set(a,null),h=h.getElementsByTagName(a),E=0;E<h.length;E++){var O=h[E];if(!(O[zr]||O[rn]||a==="link"&&O.getAttribute("rel")==="stylesheet")&&O.namespaceURI!=="http://www.w3.org/2000/svg"){var ae=O.getAttribute(c)||"";ae=a+ae;var _e=g.get(ae);_e?_e.push(O):g.set(ae,[O])}}return g}function GI(a,c,h){a=a.ownerDocument||a,a.head.insertBefore(h,c==="title"?a.querySelector("head > title"):null)}function LH(a,c,h){if(h===1||c.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return a=c.disabled,typeof c.precedence=="string"&&a==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function qI(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function PH(a,c,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var E=f0(g.href),O=c.querySelector(zv(E));if(O){c=O._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(a.count++,a=gw.bind(a),c.then(a,a)),h.state.loading|=4,h.instance=O,Si(O);return}O=c.ownerDocument||c,g=VI(g),(E=$c.get(E))&&uS(g,E),O=O.createElement("link"),Si(O);var ae=O;ae._p=new Promise(function(_e,rt){ae.onload=_e,ae.onerror=rt}),_a(O,"link",g),h.instance=O}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(a.count++,h=gw.bind(a),c.addEventListener("load",h),c.addEventListener("error",h))}}var fS=0;function BH(a,c){return a.stylesheets&&a.count===0&&vw(a,a.stylesheets),0<a.count||0<a.imgCount?function(h){var g=setTimeout(function(){if(a.stylesheets&&vw(a,a.stylesheets),a.unsuspend){var O=a.unsuspend;a.unsuspend=null,O()}},6e4+c);0<a.imgBytes&&fS===0&&(fS=62500*yH());var E=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&vw(a,a.stylesheets),a.unsuspend)){var O=a.unsuspend;a.unsuspend=null,O()}},(a.imgBytes>fS?50:800)+c);return a.unsuspend=h,function(){a.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function gw(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vw(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var yw=null;function vw(a,c){a.stylesheets=null,a.unsuspend!==null&&(a.count++,yw=new Map,c.forEac
vendor: 9,910 bytes, line 49
49h(jH,a),yw=null,gw.call(a))}function jH(a,c){if(!(c.state.loading&4)){var h=yw.get(a);if(h)var g=h.get(null);else{h=new Map,yw.set(a,h);for(var E=a.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O<E.length;O++){var ae=E[O];(ae.nodeName==="LINK"||ae.getAttribute("media")!=="not all")&&(h.set(ae.dataset.precedence,ae),g=ae)}g&&h.set(null,g)}E=c.instance,ae=E.getAttribute("data-precedence"),O=h.get(ae)||g,O===g&&h.set(null,E),h.set(ae,E),this.count++,g=gw.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),O?O.parentNode.insertBefore(E,O.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(E,a.firstChild)),c.state.loading|=4}}var Vv={$$typeof:C,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function FH(a,c,h,g,E,O,ae,_e,rt){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=jn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jn(0),this.hiddenUpdates=jn(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=O,this.onRecoverableError=ae,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=rt,this.incompleteTransitions=new Map}function WI(a,c,h,g,E,O,ae,_e,rt,Mt,Qt,on){return a=new FH(a,c,h,ae,rt,Mt,Qt,on,_e),c=1,O===!0&&(c|=24),O=Wi(3,null,null,c),a.current=O,O.stateNode=a,c=Ko(),c.refCount++,a.pooledCache=c,c.refCount++,O.memoizedState={element:g,isDehydrated:h,cache:c},av(O),a}function KI(a){return a?(a=ol,a):ol}function YI(a,c,h,g,E,O){E=KI(E),g.context===null?g.context=E:g.pendingContext=E,g=td(c),g.payload={element:h},O=O===void 0?null:O,O!==null&&(g.callback=O),h=nd(a,g,c),h!==null&&(ql(h,a,c),dm(h,a,c))}function XI(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<c?h:c}}function hS(a,c){XI(a,c),(a=a.alternate)&&XI(a,c)}function ZI(a){if(a.tag===13||a.tag===31){var c=va(a,67108864);c!==null&&ql(c,a,67108864),hS(a,67108864)}}function QI(a){if(a.tag===13||a.tag===31){var c=gc();c=Et(c);var h=va(a,c);h!==null&&ql(h,a,c),hS(a,c)}}var bw=!0;function zH(a,c,h,g){var E=U.T;U.T=null;var O=q.p;try{q.p=2,pS(a,c,h,g)}finally{q.p=O,U.T=E}}function UH(a,c,h,g){var E=U.T;U.T=null;var O=q.p;try{q.p=8,pS(a,c,h,g)}finally{q.p=O,U.T=E}}function pS(a,c,h,g){if(bw){var E=mS(g);if(E===null)eS(a,c,g,ww,h),e6(a,g);else if(HH(E,a,c,h,g))g.stopPropagation();else if(e6(a,g),c&4&&-1<VH.indexOf(a)){for(;E!==null;){var O=ni(E);if(O!==null)switch(O.tag){case 3:if(O=O.stateNode,O.current.memoizedState.isDehydrated){var ae=Lr(O.pendingLanes);if(ae!==0){var _e=O;for(_e.pendingLanes|=2,_e.entangledLanes|=2;ae;){var rt=1<<31-gt(ae);_e.entanglements[1]|=rt,ae&=~rt}ud(O),(Fi&6)===0&&(nw=Le()+500,Pv(0))}}break;case 31:case 13:_e=va(O,2),_e!==null&&ql(_e,O,2),iw(),hS(O,2)}if(O=mS(g),O===null&&eS(a,c,g,ww,h),O===E)break;E=O}E!==null&&g.stopPropagation()}else eS(a,c,g,null,h)}}function mS(a){return a=yr(a),gS(a)}var ww=null;function gS(a){if(ww=null,a=Gn(a),a!==null){var c=o(a);if(c===null)a=null;else{var h=c.tag;if(h===13){if(a=s(c),a!==null)return a;a=null}else if(h===31){if(a=l(c),a!==null)return a;a=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null)}}return ww=a,null}function JI(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(tt()){case De:return 2;case Pe:return 8;case mt:case xt:return 32;case de:return 268435456;default:return 32}default:return 32}}var yS=!1,rp=null,ip=null,op=null,Hv=new Map,$v=new Map,sp=[],VH="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function e6(a,c){switch(a){case"focusin":case"focusout":rp=null;break;case"dragenter":case"dragleave":ip=null;break;case"mouseover":case"mouseout":op=null;break;case"pointerover":case"pointerout":Hv.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":$v.delete(c.pointerId)}}function Gv(a,c,h,g,E,O){return a===null||a.nativeEvent!==O?(a={blockedOn:c,domEventName:h,eventSystemFlags:g,nativeEvent:O,targetContainers:[E]},c!==null&&(c=ni(c),c!==null&&ZI(c)),a):(a.eventSystemFlags|=g,c=a.targetContainers,E!==null&&c.indexOf(E)===-1&&c.push(E),a)}function HH(a,c,h,g,E){switch(c){case"focusin":return rp=Gv(rp,a,c,h,g,E),!0;case"dragenter":return ip=Gv(ip,a,c,h,g,E),!0;case"mouseover":return op=Gv(op,a,c,h,g,E),!0;case"pointerover":var O=E.pointerId;return Hv.set(O,Gv(Hv.get(O)||null,a,c,h,g,E)),!0;case"gotpointercapture":return O=E.pointerId,$v.set(O,Gv($v.get(O)||null,a,c,h,g,E)),!0}return!1}function t6(a){var c=Gn(a.target);if(c!==null){var h=o(c);if(h!==null){if(c=h.tag,c===13){if(c=s(h),c!==null){a.blockedOn=c,Tn(a.priority,function(){QI(h)});return}}else if(c===31){if(c=l(h),c!==null){a.blockedOn=c,Tn(a.priority,function(){QI(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function xw(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var h=mS(a.nativeEvent);if(h===null){h=a.nativeEvent;var g=new h.constructor(h.type,h);Nn=g,h.target.dispatchEvent(g),Nn=null}else return c=ni(h),c!==null&&ZI(c),a.blockedOn=h,!1;c.shift()}return!0}function n6(a,c,h){xw(a)&&h.delete(c)}function $H(){yS=!1,rp!==null&&xw(rp)&&(rp=null),ip!==null&&xw(ip)&&(ip=null),op!==null&&xw(op)&&(op=null),Hv.forEach(n6),$v.forEach(n6)}function kw(a,c){a.blockedOn===c&&(a.blockedOn=null,yS||(yS=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,$H)))}var _w=null;function r6(a){_w!==a&&(_w=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){_w===a&&(_w=null);for(var c=0;c<a.length;c+=3){var h=a[c],g=a[c+1],E=a[c+2];if(typeof g!="function"){if(gS(g||h)===null)continue;break}var O=ni(h);O!==null&&(a.splice(c,3),c-=3,Zg(O,{pending:!0,data:E,method:h.method,action:g},g,E))}}))}function p0(a){function c(rt){return kw(rt,a)}rp!==null&&kw(rp,a),ip!==null&&kw(ip,a),op!==null&&kw(op,a),Hv.forEach(c),$v.forEach(c);for(var h=0;h<sp.length;h++){var g=sp[h];g.blockedOn===a&&(g.blockedOn=null)}for(;0<sp.length&&(h=sp[0],h.blockedOn===null);)t6(h),h.blockedOn===null&&sp.shift();if(h=(a.ownerDocument||a).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var E=h[g],O=h[g+1],ae=E[Wn]||null;if(typeof O=="function")ae||r6(h);else if(ae){var _e=null;if(O&&O.hasAttribute("formAction")){if(E=O,ae=O[Wn]||null)_e=ae.formAction;else if(gS(E)!==null)continue}else _e=ae.action;typeof _e=="function"?h[g+1]=_e:(h.splice(g,3),g-=3),r6(h)}}}function i6(){function a(O){O.canIntercept&&O.info==="react-transition"&&O.intercept({handler:function(){return new Promise(function(ae){return E=ae})},focusReset:"manual",scroll:"manual"})}function c(){E!==null&&(E(),E=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var O=navigation.currentEntry;O&&O.url!=null&&navigation.navigate(O.url,{state:O.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,E=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),E!==null&&(E(),E=null)}}}function vS(a){this._internalRoot=a}Cw.prototype.render=vS.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(r(409));var h=c.current,g=gc();YI(h,g,a,c,null,null)},Cw.prototype.unmount=vS.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;YI(a.current,2,null,a,null,null),iw(),c[qr]=null}};function Cw(a){this._internalRoot=a}Cw.prototype.unstable_scheduleHydration=function(a){if(a){var c=sn();a={blockedOn:null,target:a,priority:c};for(var h=0;h<sp.length&&c!==0&&c<sp[h].priority;h++);sp.splice(h,0,a),h===0&&t6(a)}};var o6=t.version;if(o6!=="19.2.7")throw Error(r(527,o6,"19.2.7"));q.findDOMNode=function(a){var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=d(c),a=a!==null?f(a):null,a=a===null?null:a.stateNode,a};var GH={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};
49if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sw=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sw.isDisabled&&Sw.supportsFiber)try{me=Sw.inject(GH),Ve=Sw}catch{}}return Wv.createRoot=function(a,c){if(!i(a))throw Error(r(299));var h=!1,g="",E=X2,O=Z2,ae=Qg;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(E=c.onUncaughtError),c.onCaughtError!==void 0&&(O=c.onCaughtError),c.onRecoverableError!==void 0&&(ae=c.onRecoverableError)),c=WI(a,1,!1,null,null,h,g,null,E,O,ae,i6),a[qr]=c.current,JC(a),new vS(c)},Wv.hydrateRoot=function(a,c,h){if(!i(a))throw Error(r(299));var g=!1,E="",O=X2,ae=Z2,_e=Qg,rt=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(E=h.identifierPrefix),h.onUncaughtError!==void 0&&(O=h.onUncaughtError),h.onCaughtError!==void 0&&(ae=h.onCaughtError),h.onRecoverableError!==void 0&&(_e=h.onRecoverableError),h.formState!==void 0&&(rt=h.formState)),c=WI(a,1,!0,c,h??null,g,E,rt,O,ae,_e,i6),c.context=KI(null),h=c.current,g=gc(),g=Et(g),E=td(g),E.callback=null,nd(h,E,g),h=g,c.current.lanes=h,Lt(c,h),ud(c),a[qr]=c.current,JC(a),new Cw(c)},Wv.version="19.2.7",Wv}var g6;function r$(){if(g6)return xS.exports;g6=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),xS.exports=n$(),xS.exports}var i$=r$();const o$=a2(i$);var Se=RA();const sg=a2(Se);/**
50 * react-router v7.18.1
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */var OA=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,XM=/^[\\/]{2}/;function s$(e,t){return t+e.replace(/\\/g,"/")}var y6="popstate";function v6(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function a$(e={}){function t(r,i){var d;let o=(d=i.state)==null?void 0:d.masked,{pathname:s,search:l,hash:u}=o||r.location;return C4("",{pathname:s,search:l,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default",o?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:p1(i)}return c$(t,n,null,e)}function ns(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function jd(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function l$(){return Math.random().toString(36).substring(2,10)}function b6(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function C4(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Uy(t):t,state:n,key:t&&t.key||r||l$(),mask:i}}function p1({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Uy(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function c$(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,l="POP",u=null,d=f();d==null&&(d=0,s.replaceState({...s.state,idx:d},""));function f(){return(s.state||{idx:null}).idx}function p(){l="POP";let S=f(),x=S==null?null:S-d;d=S,u&&u({action:l,location:k.location,delta:x})}function m(S,x){l="PUSH";let T=v6(S)?S:C4(k.location,S,x);d=f()+1;let C=b6(T,d),I=k.createHref(T.mask||T);try{s.pushState(C,"",I)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(I)}o&&u&&u({action:l,location:k.location,delta:1})}function y(S,x){l="REPLACE";let T=v6(S)?S:C4(k.location,S,x);d=f();let C=b6(T,d),I=k.createHref(T.mask||T);s.replaceState(C,"",I),o&&u&&u({action:l,location:k.location,delta:0})}function b(S){return u$(i,S)}let k={get action(){return l},get location(){return e(i,s)},listen(S){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(y6,p),u=S,()=>{i.removeEventListener(y6,p),u=null}},createHref(S){return t(i,S)},createURL:b,encodeLocation(S){let x=b(S);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:m,replace:y,go(S){return s.go(S)}};return k}function u$(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),ns(r,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:p1(t);return i=i.replace(/ $/,"%20"),!n&&XM.test(i)&&(i=r+i),new URL(i,r)}function ZM(e,t,n="/"){return d$(e,t,n,!1)}function d$(e,t,n,r,i){let o=typeof t=="string"?Uy(t):t,s=ih(o.pathname||"/",n);if(s==null)return null;let l=f$(e),u=null,d=_$(s);for(let f=0;u==null&&f<l.length;++f)u=k$(l[f],d,r);return u}function f$(e){let t=QM(e);return h$(t),t}function QM(e,t=[],n=[],r="",i=!1){let o=(s,l,u=i,d)=>{let f={relativePath:d===void 0?s.path||"":d,caseSensitive:s.caseSensitive===!0,childrenIndex:l,route:s};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&u)return;ns(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}
58" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let p=Bu([r,f.relativePath]),m=n.concat(f);s.children&&s.children.length>0&&(ns(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),QM(s.children,t,m,p,u)),!(s.path==null&&!s.index)&&t.push({path:p,score:w$(p,s.index),routesMeta:m.map((y,b)=>{let[k,S]=tD(y.relativePath,y.caseSensitive,b===m.length-1);return{...y,matcher:k,compiledParams:S}})})};return e.forEach((s,l)=>{var u;if(s.path===""||!((u=s.path)!=null&&u.includes("?")))o(s,l);else for(let d of JM(s.path))o(s,l,!0,d)}),t}function JM(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=JM(r.join("/")),l=[];return l.push(...s.map(u=>u===""?o:[o,u].join("/"))),i&&l.push(...s),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function h$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:x$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var p$=/^:[\w-]+$/,m$=3,g$=2,y$=1,v$=10,b$=-2,w6=e=>e==="*";function w$(e,t){let n=e.split("/"),r=n.length;return n.some(w6)&&(r+=b$),t&&(r+=g$),n.filter(i=>!w6(i)).reduce((i,o)=>i+(p$.test(o)?m$:o===""?y$:v$),r)}function x$(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function k$(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",s=[];for(let l=0;l<r.length;++l){let u=r[l],d=l===r.length-1,f=o==="/"?t:t.slice(o.length)||"/",p={path:u.relativePath,caseSensitive:u.caseSensitive,end:d},m=u.matcher&&u.compiledParams?eD(p,f,u.matcher,u.compiledParams):uk(p,f),y=u.route;if(!m&&d&&n&&!r[r.length-1].route.index&&(m=uk({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!m)return null;
58Object.assign(i,m.params),s.push({params:i,pathname:Bu([o,m.pathname]),pathnameBase:E$(Bu([o,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(o=Bu([o,m.pathnameBase]))}return s}function uk(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=tD(e.path,e.caseSensitive,e.end);return eD(e,t,n,r)}function eD(e,t,n,r){let i=t.match(n);if(!i)return null;let o=i[0],s=o.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((d,{paramName:f,isOptional:p},m)=>{if(f==="*"){let b=l[m]||"";s=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const y=l[m];return p&&!y?d[f]=void 0:d[f]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:s,pattern:e}}function tD(e,t=!1,n=!0){jd(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,u,d,f)=>{if(r.push({paramName:l,isOptional:u!=null}),u){let p=f.charAt(d+s.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function _$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return jd(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ih(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function C$(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Uy(e):e,o;return n?(n=rD(n),n.startsWith("/")?o=x6(n.substring(1),"/"):o=x6(n,t)):o=t,{pathname:o,search:A$(r),hash:T$(i)}}function x6(e,t){let n=dk(t).split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function ES(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function S$(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function nD(e){let t=S$(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function NA(e,t,n,r=!1){let i;typeof e=="string"?i=Uy(e):(i={...e},ns(!i.pathname||!i.pathname.includes("?"),ES("?","pathname","search",i)),ns(!i.pathname||!i.pathname.includes("#"),ES("#","pathname","hash",i)),ns(!i.search||!i.search.includes("#"),ES("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,l;if(s==null)l=n;else{let p=t.length-1;if(!r&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;i.pathname=m.join("/")}l=p>=0?t[p]:"/"}let u=C$(i,l),d=s&&s!=="/"&&s.endsWith("/"),f=(o||s===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||f)&&(u.pathname+="/"),u}var rD=e=>e.replace(/[\\/]{2,}/g,"/"),Bu=e=>rD(e.join("/")),dk=e=>e.replace(/\/+$/,""),E$=e=>dk(e).replace(/^\/*/,"/"),A$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,T$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,I$=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function R$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function O$(e){let t=e.map(n=>n.route.path).filter(Boolean);return Bu(t)||"/"}var iD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function oD(e,t){let n=e;if(typeof n!="string"||!OA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(iD)try{let o=new URL(window.location.href),s=XM.test(n)?new URL(s$(n,o.protocol)):new URL(n),l=ih(s.pathname,t);s.origin===o.origin&&l!=null?n=l+s.search+s.hash:i=!0}catch{jd(!1,`<Link to="${n}">
58 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var sD=["POST","PUT","PATCH","DELETE"];new Set(sD);var N$=["GET",...sD];new Set(N$);var M$=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function D$(e){try{return M$.includes(new URL(e).protocol)}catch{return!1}}var Vy=Se.createContext(null);Vy.displayName="DataRouter";var __=Se.createContext(null);__.displayName="DataRouterState";var aD=Se.createContext(!1);function L$(){return Se.useContext(aD)}var lD=Se.createContext({isTransitioning:!1});lD.displayName="ViewTransition";var P$=Se.createContext(new Map);P$.displayName="Fetchers";var B$=Se.createContext(null);B$.displayName="Await";var lu=Se.createContext(null);lu.displayName="Navigation";var l2=Se.createContext(null);l2.displayName="Location";var Vu=Se.createContext({outlet:null,matches:[],isDataRoute:!1});Vu.displayName="Route";var MA=Se.createContext(null);MA.displayName="RouteError";var cD="REACT_ROUTER_ERROR",j$="REDIRECT",F$="ROUTE_ERROR_RESPONSE";function z$(e){if(e.startsWith(`${cD}:${j$}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function U$(e){if(e.startsWith(`${cD}:${F$}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new I$(t.status,t.statusText,t.data)}catch{}}function V$(e,{relative:t}={}){ns(c2(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=Se.useContext(lu),{hash:i,pathname:o,search:s}=u2(e,{relative:t}),l=o;return n!=="/"&&(l=o==="/"?n:Bu([n,o])),r.createHref({pathname:l,search:s,hash:i})}function c2(){return Se.useContext(l2)!=null}function Gd(){return ns(c2(),"useLocation() may be used only in the context of a <Router> component."),Se.useContext(l2).location}var uD="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function dD(e){Se.useContext(lu).static||Se.useLayoutEffect(e)}function H$(){let{isDataRoute:e}=Se.useContext(Vu);return e?oG():$$()}function $$(){ns(c2(),"useNavigate() may be used only in the context of a <Router> component.");let e=Se.useContext(Vy),{basename:t,navigator:n}=Se.useContext(lu),{matches:r}=Se.useContext(Vu),{pathname:i}=Gd(),o=JSON.stringify(nD(r)),s=Se.useRef(!1);return dD(()=>{s.current=!0}),Se.useCallback((u,d={})=>{if(jd(s.current,uD),!s.current)return;if(typeof u=="number"){n.go(u);return}let f=NA(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Bu([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,o,i,e])}var G$=Se.createContext(null);function q$(e){let t=Se.useContext(Vu).outlet;return Se.useMemo(()=>t&&Se.createElement(G$.Provider,{value:e},t),[t,e])}function W$(){let{matches:e}=Se.useContext(Vu),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function u2(e,{relative:t}={}){let{matches:n}=Se.useContext(Vu),{pathname:r}=Gd(),i=JSON.stringify(nD(n));return Se.useMemo(()=>NA(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function K$(e,t){return fD(e,t)}function fD(e,t,n){var S;ns(c2(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=Se.useContext(lu),{matches:i}=Se.useContext(Vu),o=i[i.length-1],s=o?o.params:{},l=o?o.pathname:"/",u=o?o.pathnameBase:"/",d=o&&o.route;{let x=d&&d.path||"";pD(l,!d||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${x}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
60Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}/*`}">.`)}let f=Gd(),p;if(t){let x=typeof t=="string"?Uy(t):t;ns(u==="/"||((S=x.pathname)==null?void 0:S.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${x.pathname}" was given in the \`location\` prop.`),p=x}else p=f;let m=p.pathname||"/",y=m;if(u!=="/"){let x=u.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(x.length).join("/")}let b=n&&n.state.matches.length?n.state.matches.map(x=>Object.assign(x,{route:n.manifest[x.route.id]||x.route})):ZM(e,{pathname:y});jd(d||b!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),jd(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=J$(b&&b.map(x=>Object.assign({},x,{params:Object.assign({},s,x.params),pathname:Bu([u,r.encodeLocation?r.encodeLocation(x.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?u:Bu([u,r.encodeLocation?r.encodeLocation(x.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathnameBase])})),i,n);return t&&k?Se.createElement(l2.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},k):k}function Y$(){let e=iG(),t=R$(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=Se.createElement(Se.Fragment,null,Se.createElement("p",null,"💿 Hey developer 👋"),Se.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",Se.createElement("code",{style:o},"ErrorBoundary")," or"," ",Se.createElement("code",{style:o},"errorElement")," prop on your route.")),Se.createElement(Se.Fragment,null,Se.createElement("h2",null,"Unexpected Application 
60Error!"),Se.createElement("h3",{style:{fontStyle:"italic"}},t),n?Se.createElement("pre",{style:i},n):null,s)}var X$=Se.createElement(Y$,null),hD=class extends Se.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=U$(e.digest);n&&(e=n)}let t=e!==void 0?Se.createElement(Vu.Provider,{value:this.props.routeContext},Se.createElement(MA.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?Se.createElement(Z$,{error:e},t):t}};hD.contextType=aD;var AS=new WeakMap;function Z$({children:e,error:t}){let{basename:n}=Se.useContext(lu);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=z$(t.digest);if(r){let i=AS.get(t);if(i)throw i;let o=oD(r.location,n),s=o.absoluteURL||o.to;if(D$(s))throw new Error("Invalid redirect location");if(iD&&!AS.get(t))if(o.isExternal||r.reloadDocument)window.location.href=s;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw AS.set(t,l),l}return Se.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s}`})}}return e}function Q$({routeContext:e,match:t,children:n}){let r=Se.useContext(Vy);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),Se.createElement(Vu.Provider,{value:e},n)}function J$(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,o=r==null?void 0:r.errors;if(o!=null){let f=i.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);ns(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let s=!1,l=-1;if(n&&r){s=r.renderFallback;for(let f=0;f<i.length;f++){let p=i[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(l=f),p.route.id){let{loaderData:m,errors:y}=r,b=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||b){n.isStatic&&(s=!0),l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}}let u=n==null?void 0:n.onError,d=r&&u?(f,p)=>{var m,y;u(f,{location:r.location,params:((y=(m=r.matches)==null?void 0:m[0])==null?void 0:y.params)??{},pattern:O$(r.matches),errorInfo:p})}:void 0;return i.reduceRight((f,p,m)=>{let y,b=!1,k=null,S=null;r&&(y=o&&p.route.id?o[p.route.id]:void 0,k=p.route.errorElement||X$,s&&(l<0&&m===0?(pD("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):l===m&&(b=!0,S=p.route.hydrateFallbackElement||null)));let x=t.concat(i.slice(0,m+1)),T=()=>{let C;return y?C=k:b?C=S:p.route.Component?C=Se.createElement(p.route.Component,null):p.route.element?C=p.route.element:C=f,Se.createElement(Q$,{match:p,routeContext:{outlet:f,matches:x,isDataRoute:r!=null},children:C})};return r&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?Se.createElement(hD,{location:r.location,revalidation:r.revalidation,component:k,error:y,children:T(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:d}):T()},null)}function DA(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function eG(e){let t=Se.useContext(Vy);return ns(t,DA(e)),t}function tG(e){let t=Se.useContext(__);return ns(t,DA(e)),t}function nG(e){let t=Se.useContext(Vu);return ns(t,DA(e)),t}function LA(e){let t=nG(e),n=t.matches[t.matches.length-1];return ns(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function rG(){return LA("useRouteId")}function iG(){var r;let e=Se.useContext(MA),t=tG("useRouteError"),n=LA("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function oG(){let{router:e}=eG("useNavigate"),t=LA("useNavigate"),n=Se.useRef(!1);return dD(()=>{n.current=!0}),Se.useCallback(async(i,o={})=>{jd(n.current,uD),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var k6={};
60function pD(e,t,n){!t&&!k6[e]&&(k6[e]=!0,jd(!1,n))}Se.memo(sG);function sG({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:o}){return fD(e,void 0,{manifest:t,state:r,isStatic:i,onError:o})}function aG(e){return q$(e.context)}function bb(e){ns(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function lG({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1,useTransitions:s}){ns(!c2(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),u=Se.useMemo(()=>({basename:l,navigator:i,static:o,useTransitions:s,future:{}}),[l,i,o,s]);typeof n=="string"&&(n=Uy(n));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:y="default",mask:b}=n,k=Se.useMemo(()=>{let S=ih(d,l);return S==null?null:{location:{pathname:S,search:f,hash:p,state:m,key:y,mask:b},navigationType:r}},[l,d,f,p,m,y,r,b]);return jd(k!=null,`<Router basename="${l}"> is not able to match the URL "${d}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:Se.createElement(lu.Provider,{value:u},Se.createElement(l2.Provider,{children:t,value:k}))}function cG({children:e,location:t}){return K$(S4(e),t)}function S4(e,t=[]){let n=[];return Se.Children.forEach(e,(r,i)=>{if(!Se.isValidElement(r))return;let o=[...t,i];if(r.type===Se.Fragment){n.push.apply(n,S4(r.props.children,o));return}ns(r.type===bb,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ns(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=S4(r.props.children,o)),n.push(s)}),n}var Tx="get",Ix="application/x-www-form-urlencoded";function C_(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function uG(e){return C_(e)&&e.tagName.toLowerCase()==="button"}function dG(e){return C_(e)&&e.tagName.toLowerCase()==="form"}function fG(e){return C_(e)&&e.tagName.toLowerCase()==="input"}function hG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pG(e,t){return e.button===0&&(!t||t==="_self")&&!hG(e)}var Aw=null;function mG(){if(Aw===null)try{new FormData(document.createElement("form"),0),Aw=!1}catch{Aw=!0}return Aw}var gG=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function TS(e){return e!=null&&!gG.has(e)?(jd(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ix}"`),null):e}function yG(e,t){let n,r,i,o,s;if(dG(e)){let l=e.getAttribute("action");r=l?ih(l,t):null,n=e.getAttribute("method")||Tx,i=TS(e.getAttribute("enctype"))||Ix,o=new FormData(e)}else if(uG(e)||fG(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(r=u?ih(u,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Tx,i=TS(e.getAttribute("formenctype"))||TS(l.getAttribute("enctype"))||Ix,o=new FormData(l,e),!mG()){let{name:d,type:f,value:p}=e;if(f==="image"){let m=d?`${d}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else d&&o.append(d,p)}}else{if(C_(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Tx,r=null,i=Ix,s=e}return o&&i==="text/plain"&&(s=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function PA(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mD(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&ih(i.pathname,t)==="/"?i.pathname=`${dk(t)}/_root.${r}`:i.pathname=`${dk(i.pathname)}.${r}`,i}async function vG(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.
60isSpaMode,window.location.reload(),new Promise(()=>{})}}function bG(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function wG(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let s=await vG(o,n);return s.links?s.links():[]}return[]}));return CG(r.flat(1).filter(bG).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function _6(e,t,n,r,i,o){let s=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,l=(u,d)=>{var f;return n[d].pathname!==u.pathname||((f=n[d].route.path)==null?void 0:f.endsWith("*"))&&n[d].params["*"]!==u.params["*"]};return o==="assets"?t.filter((u,d)=>s(u,d)||l(u,d)):o==="data"?t.filter((u,d)=>{var p;let f=r.routes[u.route.id];if(!f||!f.hasLoader)return!1;if(s(u,d)||l(u,d))return!0;if(u.route.shouldRevalidate){let m=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function xG(e,t,{includeHydrateFallback:n}={}){return kG(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function kG(e){return[...new Set(e)]}function _G(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function CG(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(_G(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function BA(){let e=Se.useContext(Vy);return PA(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function SG(){let e=Se.useContext(__);return PA(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var jA=Se.createContext(void 0);jA.displayName="FrameworkContext";function S_(){let e=Se.useContext(jA);return PA(e,"You must render this element inside a <HydratedRouter> element"),e}function EG(e,t){let n=Se.useContext(jA),[r,i]=Se.useState(!1),[o,s]=Se.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:d,onMouseLeave:f,onTouchStart:p}=t,m=Se.useRef(null);Se.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let k=x=>{x.forEach(T=>{s(T.isIntersecting)})},S=new IntersectionObserver(k,{threshold:.5});return m.current&&S.observe(m.current),()=>{S.disconnect()}}},[e]),Se.useEffect(()=>{if(r){let k=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(k)}}},[r]);let y=()=>{i(!0)},b=()=>{i(!1),s(!1)};return n?e!=="intent"?[o,m,{}]:[o,m,{onFocus:Kv(l,y),onBlur:Kv(u,b),onMouseEnter:Kv(d,y),onMouseLeave:Kv(f,b),onTouchStart:Kv(p,y)}]:[!1,m,{}]}function Kv(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function AG({page:e,...t}){let n=L$(),{nonce:r}=S_(),{router:i}=BA(),o=Se.useMemo(()=>ZM(i.routes,e,i.basename),[i.routes,e,i.basename]);return o?(t.nonce==null&&r&&(t={...t,nonce:r}),n?Se.createElement(IG,{page:e,matches:o,...t}):Se.createElement(RG,{page:e,matches:o,...t})):null}function TG(e){let{manifest:t,routeModules:n}=S_(),[r,i]=Se.useState([]);return Se.useEffect(()=>{let o=!1;return wG(e,t,n).then(s=>{o||i(s)}),()=>{o=!0}},[e,t,n]),r}function IG({page:e,matches:t,...n}){let r=Gd(),{future:i}=S_(),{basename:o}=BA(),s=Se.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let l=mD(e,o,i.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,d=[];for(let f of t)typeof f.route.shouldRevalidate=="function"?u=!0:d.push(f.route.id);return u&&d.length>0&&l.searchParams.set("_routes",d.join(",")),[l.pathname+l.search]},[o,i.v8_trailingSlashAwareDataRequests,e,r,t]);return Se.createElement(Se.Fragment,null,s.map(l=>Se.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...n})))}function RG({page:e,matches:t,...n}){let r=Gd(),{future:i,manifest:o,routeModules:s}=S_(),{basename:l}=BA(),{loaderData:u,matches:d}=SG(),f=Se.useMemo(()=>_6(e,t,d,o,r,"data"),[e,t,d,o,r]),p=Se.useMemo(()=>_6(e,t,d,o,r,"assets"),[e,t,d,o,r]),m=Se.useMemo(()=>
60{if(e===r.pathname+r.search+r.hash)return[];let k=new Set,S=!1;if(t.forEach(T=>{var I;let C=o.routes[T.route.id];!C||!C.hasLoader||(!f.some(D=>D.route.id===T.route.id)&&T.route.id in u&&((I=s[T.route.id])!=null&&I.shouldRevalidate)||C.hasClientLoader?S=!0:k.add(T.route.id))}),k.size===0)return[];let x=mD(e,l,i.v8_trailingSlashAwareDataRequests,"data");return S&&k.size>0&&x.searchParams.set("_routes",t.filter(T=>k.has(T.route.id)).map(T=>T.route.id).join(",")),[x.pathname+x.search]},[l,i.v8_trailingSlashAwareDataRequests,u,r,o,f,t,e,s]),y=Se.useMemo(()=>xG(p,o),[p,o]),b=TG(p);return Se.createElement(Se.Fragment,null,m.map(k=>Se.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...n})),y.map(k=>Se.createElement("link",{key:k,rel:"modulepreload",href:k,...n})),b.map(({key:k,link:S})=>Se.createElement("link",{key:k,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function OG(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var NG=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{NG&&(window.__reactRouterVersion="7.18.1")}catch{}function MG({basename:e,children:t,useTransitions:n,window:r}){let i=Se.useRef();i.current==null&&(i.current=a$({window:r,v5Compat:!0}));let o=i.current,[s,l]=Se.useState({action:o.action,location:o.location}),u=Se.useCallback(d=>{n===!1?l(d):Se.startTransition(()=>l(d))},[n]);return Se.useLayoutEffect(()=>o.listen(u),[o,u]),Se.createElement(lG,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,useTransitions:n})}var zp=Se.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:s,mask:l,state:u,target:d,to:f,preventScrollReset:p,viewTransition:m,defaultShouldRevalidate:y,...b},k){let{basename:S,navigator:x,useTransitions:T}=Se.useContext(lu),C=typeof f=="string"&&OA.test(f),I=oD(f,S);f=I.to;let D=V$(f,{relative:i}),P=Gd(),V=null;if(l){let W=NA(l,[],P.mask?P.mask.pathname:"/",!0);S!=="/"&&(W.pathname=W.pathname==="/"?S:Bu([S,W.pathname])),V=x.createHref(W)}let[ee,F,H]=EG(r,b),te=BG(f,{replace:s,mask:l,state:u,target:d,preventScrollReset:p,relative:i,viewTransition:m,defaultShouldRevalidate:y,useTransitions:T});function M(W){t&&t(W),W.defaultPrevented||te(W)}let Z=!(I.isExternal||o),L=Se.createElement("a",{...b,...H,href:(Z?V:void 0)||I.absoluteURL||D,onClick:Z?M:t,ref:OG(k,F),target:d,"data-discover":!C&&n==="render"?"true":void 0});return ee&&!C?Se.createElement(Se.Fragment,null,L,Se.createElement(AG,{page:D})):L});zp.displayName="Link";var DG=Se.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:s,viewTransition:l,children:u,...d},f){let p=u2(s,{relative:d.relative}),m=Gd(),y=Se.useContext(__),{navigator:b,basename:k}=Se.useContext(lu),S=y!=null&&VG(p)&&l===!0,x=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,T=m.pathname,C=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(T=T.toLowerCase(),C=C?C.toLowerCase():null,x=x.toLowerCase()),C&&k&&(C=ih(C,k)||C);const I=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let D=T===x||!i&&T.startsWith(x)&&T.charAt(I)==="/",P=C!=null&&(C===x||!i&&C.startsWith(x)&&C.charAt(x.length)==="/"),V={isActive:D,isPending:P,isTransitioning:S},ee=D?t:void 0,F;typeof r=="function"?F=r(V):F=[r,D?"active":null,P?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let H=typeof o=="function"?o(V):o;return Se.createElement(zp,{...d,"aria-current":ee,className:F,ref:f,style:H,to:s,viewTransition:l},typeof u=="function"?u(V):u)});DG.displayName="NavLink";var LG=Se.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:s=Tx,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...y},b)=>{let{useTransitions:k}=Se.useContext(lu),S=zG(),x=UG(l,{relative:d}),T=s.toLowerCase()==="get"?"get":"post",C=typeof l=="string"&&OA.test(l),I=D=>{if(u&&u(D),D.defaultPrevented)return;D.preventDefault();let P=D.nativeEvent.submitter,V=(P==null?void 0:P.getAttribute("formmethod"))||s,ee=()=>S(P||D.currentTarget,{fetcherKey:t,method:V,navigate:n,replace:i,state:o,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});k&&n!==!1?Se.startTransition(()=>ee()):ee()};return Se.createElement("form",{ref:b,method:T,action:x,onSubmit:r?u:I,...y,"data-discover":!C&&e==="render"?"true":void 0})});LG.displayName="Form";function PG(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function gD(e){let t=Se.useContext(Vy);return ns(t,PG(e)),t}function BG(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:o,relative:s,viewTransition:l,defaultShouldRevalidate:u,useTransitions:d}={}){let f=H$(),p=Gd(),m=u2(e,{relative:s});return Se.useCallback(y=>{if(pG(y,t)){y.preventDefault();let b=n!==void 0?n:p1(p)===p1(m),k=()=>f(e,{replace:b,mask:r,state:i,preventScrollReset:o,relative:s,viewTransition:l,defaultShouldRevalidate:u});d?Se.startTransition(()=>k()):k()}},[p,f,m,n,r,i,t,e,o,s,l,u,d])}var jG=0,FG=()=>`__${String(++jG)}__`;function zG(){let{router:e}
60=gD("useSubmit"),{basename:t}=Se.useContext(lu),n=rG(),r=e.fetch,i=e.navigate;return Se.useCallback(async(o,s={})=>{let{action:l,method:u,encType:d,formData:f,body:p}=yG(o,t);if(s.navigate===!1){let m=s.fetcherKey||FG();await r(m,n,s.action||l,{defaultShouldRevalidate:s.defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:f,body:p,formMethod:s.method||u,formEncType:s.encType||d,flushSync:s.flushSync})}else await i(s.action||l,{defaultShouldRevalidate:s.defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:f,body:p,formMethod:s.method||u,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[r,i,t,n])}function UG(e,{relative:t}={}){let{basename:n}=Se.useContext(lu),r=Se.useContext(Vu);ns(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...u2(e||".",{relative:t})},s=Gd();if(e==null){o.search=s.search;let l=new URLSearchParams(o.search),u=l.getAll("index");if(u.some(f=>f==="")){l.delete("index"),u.filter(p=>p).forEach(p=>l.append("index",p));let f=l.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Bu([n,o.pathname])),p1(o)}function VG(e,{relative:t}={}){let n=Se.useContext(lD);ns(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=gD("useViewTransitionState"),i=u2(e,{relative:t});if(!n.isTransitioning)return!1;let o=ih(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=ih(n.nextLocation.pathname,r)||n.nextLocation.pathname;return uk(i.pathname,s)!=null||uk(i.pathname,o)!=null}/**
61 * @license lucide-react v0.563.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const yD=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
66 * @license lucide-react v0.563.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const HG=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
71 * @license lucide-react v0.563.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const $G=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
76 * @license lucide-react v0.563.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const C6=e=>{const t=$G(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
81 * @license lucide-react v0.563.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */var GG={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"};/**
86 * @license lucide-react v0.563.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const qG=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
91 * @license lucide-react v0.563.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const WG=Se.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...l},u)=>Se.createElement("svg",{ref:u,...GG,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yD("lucide",i),...!o&&!qG(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,f])=>Se.createElement(d,f)),...Array.isArray(o)?o:[o]]));/**
96 * @license lucide-react v0.563.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const zn=(e,t)=>{const n=Se.forwardRef(({className:r,...i},o)=>Se.createElement(WG,{ref:o,iconNode:t,className:yD(`lucide-${HG(C6(e))}`,`lucide-${e}`,r),...i}));return n.displayName=C6(e),n};/**
101 * @license lucide-react v0.563.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const KG=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],d2=zn("arrow-right",KG);/**
106 * @license lucide-react v0.563.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const YG=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],vD=zn("arrow-up",YG);/**
111 * @license lucide-react v0.563.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const XG=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]],ZG=zn("atom",XG);/**
116 * @license lucide-react v0.563.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const QG=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],f2=zn("book-open",QG);/**
121 * @license lucide-react v0.563.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const JG=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],S6=zn("book",JG);/**
126 * @license lucide-react v0.563.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const eq=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Jf=zn("bot",eq);/**
131 * @license lucide-react v0.563.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const tq=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],nq=zn("briefcase",tq);/**
136 * @license lucide-react v0.563.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const rq=[["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5",key:"1glfrc"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}]],iq=zn("calendar-plus",rq);/**
141 * @license lucide-react v0.563.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const oq=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],sq=zn("chart-no-axes-column",oq);/**
146 * @license lucide-react v0.563.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const aq=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],E_=zn("check",aq);/**
151 * @license lucide-react v0.563.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const lq=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],A_=zn("chevron-down",lq);/**
156 * @license lucide-react v0.563.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const cq=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],uq=zn("chevron-left",cq);/**
161 * @license lucide-react v0.563.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const dq=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],fq=zn("chevron-right",dq);/**
166 * @license lucide-react v0.563.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const hq=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],pq=zn("chevrons-up-down",hq);/**
171 * @license lucide-react v0.563.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const mq=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],dl=zn("circle-check-big",mq);/**
176 * @license lucide-react v0.563.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const gq=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],wb=zn("circle-check",gq);/**
181 * @license lucide-react v0.563.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const yq=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],vq=zn("clipboard-copy",yq);/**
186 * @license lucide-react v0.563.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const bq=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],wq=zn("code-xml",bq);/**
191 * @license lucide-react v0.563.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const xq=[["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"}]],bD=zn("copy",xq);/**
196 * @license lucide-react v0.563.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const kq=[["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"}]],_q=zn("database",kq);/**
201 * @license lucide-react v0.563.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const Cq=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],FA=zn("download",Cq);/**
206 * @license lucide-react v0.563.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const Sq=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Eq=zn("external-link",Sq);/**
211 * @license lucide-react v0.563.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const Aq=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],Tq=zn("file-down",Aq);/**
216 * @license lucide-react v0.563.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const Iq=[["path",{d:"m18.226 5.226-2.52-2.52A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-.351",key:"1k2beg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]],Rq=zn("file-pen-line",Iq);/**
221 * @license lucide-react v0.563.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const Oq=[["path",{d:"M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1",key:"likhh7"}],["path",{d:"M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1",key:"17ky3x"}],["path",{d:"M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z",key:"1hyeo0"}]],Nq=zn("file-stack",Oq);/**
226 * @license lucide-react v0.563.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const Mq=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Kp=zn("file-text",Mq);/**
231 * @license lucide-react v0.563.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const Dq=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],wD=zn("flask-conical",Dq);/**
236 * @license lucide-react v0.563.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const Lq=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],ky=zn("github",Lq);/**
241 * @license lucide-react v0.563.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const Pq=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Bq=zn("globe",Pq);/**
246 * @license lucide-react v0.563.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const jq=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],Fq=zn("heart",jq);/**
251 * @license lucide-react v0.563.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const zq=[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]],Uq=zn("highlighter",zq);
255/**
256 * @license lucide-react v0.563.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const Vq=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Hq=zn("history",Vq);/**
261 * @license lucide-react v0.563.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const $q=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],xD=zn("info",$q);/**
266 * @license lucide-react v0.563.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const Gq=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],qq=zn("languages",Gq);/**
271 * @license lucide-react v0.563.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const Wq=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Kq=zn("layers",Wq);/**
276 * @license lucide-react v0.563.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const Yq=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],Xq=zn("layout-template",Yq);/**
281 * @license lucide-react v0.563.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const Zq=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],E6=zn("link",Zq);/**
286 * @license lucide-react v0.563.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const Qq=[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]],Jq=zn("linkedin",Qq);/**
291 * @license lucide-react v0.563.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const eW=[["path",{d:"M16 5H3",key:"m91uny"}],["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 19H3",key:"zzsher"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]],tW=zn("list-plus",eW);/**
296 * @license lucide-react v0.563.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const nW=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fk=zn("loader-circle",nW);/**
301 * @license lucide-react v0.563.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const rW=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],iW=zn("lock",rW);/**
306 * @license lucide-react v0.563.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const oW=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],sW=zn("menu",oW);
310/**
311 * @license lucide-react v0.563.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const aW=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],lW=zn("message-square-text",aW);/**
316 * @license lucide-react v0.563.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const cW=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],A6=zn("moon",cW);/**
321 * @license lucide-react v0.563.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const uW=[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]],dW=zn("paintbrush",uW);/**
326 * @license lucide-react v0.563.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const fW=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],kD=zn("palette",fW);/**
331 * @license lucide-react v0.563.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const hW=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],pW=zn("panels-top-left",hW);/**
336 * @license lucide-react v0.563.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const mW=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],_D=zn("pen-line",mW);/**
341 * @license lucide-react v0.563.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const gW=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],yW=zn("play",gW);/**
346 * @license lucide-react v0.563.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const vW=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],bW=zn("puzzle",vW);/**
351 * @license lucide-react v0.563.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const wW=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M7 12h.01",key:"eqddd0"}]],xW=zn("rectangle-ellipsis",wW);/**
356 * @license lucide-react v0.563.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const kW=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3
360kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],T_=zn("rocket",kW);/**
361 * @license lucide-react v0.563.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const _W=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],IS=zn("scale",_W);/**
366 * @license lucide-react v0.563.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const CW=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],CD=zn("search",CW);/**
371 * @license lucide-react v0.563.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const SW=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],EW=zn("server",SW);/**
376 * @license lucide-react v0.563.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const AW=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],TW=zn("settings",AW);/**
381 * @license lucide-react v0.563.0 - ISC
382 *
383 * This source code is licensed under the ISC license.
384 * See the LICENSE file in the root directory of this source tree.
385 */const IW=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Hb=zn("shield",IW);/**
386 * @license lucide-react v0.563.0 - ISC
387 *
388 * This source code is licensed under the ISC license.
389 * See the LICENSE file in the root directory of this source tree.
390 */const RW=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}
390],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],h2=zn("sparkles",RW);/**
391 * @license lucide-react v0.563.0 - ISC
392 *
393 * This source code is licensed under the ISC license.
394 * See the LICENSE file in the root directory of this source tree.
395 */const OW=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],SD=zn("star",OW);/**
396 * @license lucide-react v0.563.0 - ISC
397 *
398 * This source code is licensed under the ISC license.
399 * See the LICENSE file in the root directory of this source tree.
400 */const NW=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],T6=zn("sun",NW);/**
401 * @license lucide-react v0.563.0 - ISC
402 *
403 * This source code is licensed under the ISC license.
404 * See the LICENSE file in the root directory of this source tree.
405 */const MW=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],ED=zn("table-2",MW);/**
406 * @license lucide-react v0.563.0 - ISC
407 *
408 * This source code is licensed under the ISC license.
409 * See the LICENSE file in the root directory of this source tree.
410 */const DW=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],RS=zn("target",DW);/**
411 * @license lucide-react v0.563.0 - ISC
412 *
413 * This source code is licensed under the ISC license.
414 * See the LICENSE file in the root directory of this source tree.
415 */const LW=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],PW=zn("terminal",LW);/**
416 * @license lucide-react v0.563.0 - ISC
417 *
418 * This source code is licensed under the ISC license.
419 * See the LICENSE file in the root directory of this source tree.
420 */const BW=[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]],jW=zn("twitter",BW);/**
421 * @license lucide-react v0.563.0 - ISC
422 *
423 * This source code is licensed under the ISC license.
424 * See the LICENSE file in the root directory of this source tree.
425 */const FW=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],zW=zn("unplug",FW);/**
426 * @license lucide-react v0.563.0 - ISC
427 *
428 * This source code is licensed under the ISC license.
429 * See the LICENSE file in the root directory of this source tree.
430 */const UW=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],VW=zn("upload",UW);/**
431 * @license lucide-react v0.563.0 - ISC
432 *
433 * This source code is licensed under the ISC license.
434 * See the LICENSE file in the root directory of this source tree.
435 */const HW=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],$W=zn("user-plus",HW);/**
436 * @license lucide-react v0.563.0 - ISC
437 *
438 * This source code is licensed under the ISC license.
439 * See the LICENSE file in the root directory of this source tree.
440 */const GW=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],qW=zn("users-round",GW);/**
441 * @license lucide-react v0.563.0 - ISC
442 *
443 * This source code is licensed under the ISC license.
444 * See the LICENSE file in the root directory of this source tree.
445 */const WW=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],AD=zn("users",WW);/**
446 * @license lucide-react v0.563.0 - ISC
447 *
448 * This source code is licensed under the ISC license.
449 * See the LICENSE file in the root directory of this source tree.
450 */const KW=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],hk=zn("wrench",KW);/**
451 * @license lucide-react v0.563.0 - ISC
452 *
453 * This source code is licensed under the ISC license.
454 * See the LICENSE file in the root directory of this source tree.
455 */const YW=[["path",{d:"M18 6 6 18",key:"1bl5f8"}
455],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gg=zn("x",YW);/**
456 * @license lucide-react v0.563.0 - ISC
457 *
458 * This source code is licensed under the ISC license.
459 * See the LICENSE file in the root directory of this source tree.
460 */const XW=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],I_=zn("zap",XW),ZW=({onDismiss:e})=>_.jsxs("div",{className:"fixed top-0 left-0 right-0 bg-brand-500 text-white text-xs sm:text-sm z-[60]",id:"announcement-banner",children:[_.jsxs("a",{href:"/changelog/2026-03-22-document-engine",className:"flex items-center justify-center gap-1.5 sm:gap-2 px-3 sm:px-4 py-2 sm:py-2.5 hover:bg-brand-600 transition-colors no-underline text-white",children:[_.jsxs("span",{className:"font-medium",children:[_.jsx("span",{className:"hidden sm:inline",children:"Introducing Document Engine — edit DOCX files from code, CLI, SDKs, or AI agents"}),_.jsx("span",{className:"sm:hidden",children:"Document Engine — edit DOCX from code, CLIs, or AI agents"})]}),_.jsx(d2,{className:"w-3 h-3 sm:w-3.5 sm:h-3.5 flex-shrink-0"})]}),e&&_.jsx("button",{type:"button",onClick:t=>{t.preventDefault(),e()},className:"absolute right-3 top-1/2 -translate-y-1/2 p-1 text-white/70 hover:text-white transition-colors","aria-label":"Dismiss announcement",children:_.jsx(gg,{className:"w-3.5 h-3.5"})})]}),QW=[{label:"Features",href:"#features"},{label:"Examples",href:"#examples"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"/changelog"}],I6=({className:e})=>_.jsxs("svg",{className:e,role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[_.jsx("title",{children:"Discord"}),_.jsx("path",{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 00-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.419-2.1568 2.419zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.419-2.1568 2.419z"})]}),TD=({isDark:e,toggleTheme:t,bannerVisible:n})=>{const[r,i]=Se.useState(!1),[o,s]=Se.useState("1,072");Se.useEffect(()=>{fetch("https://api.github.com/repos/superdoc/docx-editor").then(f=>f.json()).then(f=>{typeof(f==null?void 0:f.stargazers_count)=="number"&&s(f.stargazers_count.toLocaleString())}).catch(()=>{})},[]);const u=Gd().pathname.startsWith("/changelog"),d=QW.map(f=>({...f,href:f.href.startsWith("#")&&u?`/${f.href}`:f.href}));return _.jsxs("nav",{className:`fixed left-0 right-0 z-50 glass-nav border-b border-slate-200 dark:border-white/5 transition-all duration-300 ${n?"top-[32px] sm:top-[40px]":"top-0"}`,children:[_.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:_.jsxs("div",{className:"flex items-center justify-between h-16",children:[_.jsxs("button",{type:"button",onClick:()=>{window.location.href="/"},className:"flex items-center gap-2 cursor-pointer group","aria-label":"Reload page",children:[_.jsx("img",{src:"/logo.jpg",alt:"SuperDoc logo",className:"w-[36px] h-[40px] transition-transform duration-200 group-hover:scale-105"}),_.jsx("span",{className:"text-brand-500 dark:text-brand-400 font-bold text-xl tracking-tight",children:"SuperDoc"})]}),_.jsx("div",{className:"hidden lg:flex items-center space-x-6 lg:space-x-8",children:d.map(f=>{const p=f.href==="/changelog"&&u;return _.jsx("a",{href:f.href,className:`text-sm font-medium transition-colors ${p?"text-slate-900 dark:text-white font-semibold":"text-slate-600 dar
460k:text-slate-400 hover:text-slate-900 dark:hover:text-white"}`,children:f.label},f.label)})}),_.jsxs("div",{className:"hidden lg:flex items-center gap-3",children:[_.jsx("button",{onClick:t,className:"p-2 text-slate-500 hover:text-slate-900 dark:text-slate-400 dark:hover:text-white transition-colors","aria-label":"Toggle theme",children:e?_.jsx(T6,{className:"w-5 h-5"}):_.jsx(A6,{className:"w-5 h-5"})}),_.jsxs("a",{href:"https://github.com/superdoc/docx-editor",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 px-3 py-2 min-w-[78px] text-sm font-medium text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-white transition-colors rounded-lg hover:bg-slate-100 dark:hover:bg-white/5",children:[_.jsx(ky,{className:"w-5 h-5"}),_.jsx("div",{className:"min-w-[25px]",children:o})]}),_.jsxs("a",{href:"https://docs.superdoc.dev/",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 px-3 py-2 text-sm font-medium text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-white transition-colors rounded-lg hover:bg-slate-100 dark:hover:bg-white/5",children:[_.jsx(S6,{className:"w-5 h-5"}),_.jsx("span",{children:"Docs"})]}),_.jsxs("a",{href:"https://discord.com/invite/b9UuaZRyaB",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 px-3 py-2 text-sm font-medium text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-white transition-colors rounded-lg hover:bg-slate-100 dark:hover:bg-white/5",children:[_.jsx(I6,{className:"w-5 h-5"}),_.jsx("span",{children:"Discord"})]}),_.jsxs("a",{href:"https://meetings.hubspot.com/josh-superdoc/talk-to-an-engineer",target:"_blank",rel:"noreferrer",className:"bg-white dark:bg-dark-800 text-slate-800 dark:text-white border border-slate-200 dark:border-white/10 px-5 py-2 rounded-full text-sm font-semibold hover:bg-slate-50 dark:hover:bg-dark-700 hover:border-brand-500/40 dark:hover:border-brand-400/40 transition-colors shadow-sm ml-2",children:[_.jsx("span",{className:"max-[1074px]:hidden",children:"Talk to an engineer"}),_.jsx("span",{className:"hidden max-[1074px]:inline",children:"Book a chat"})]})]}),_.jsxs("div",{className:"lg:hidden flex items-center gap-4",children:[_.jsx("button",{onClick:t,className:"text-slate-500 dark:text-slate-400",children:e?_.jsx(T6,{className:"w-5 h-5"}):_.jsx(A6,{className:"w-5 h-5"})}),_.jsx("button",{onClick:()=>i(!r),className:"text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white p-2",children:r?_.jsx(gg,{className:"w-6 h-6"}):_.jsx(sW,{className:"w-6 h-6"})})]})]})}),r&&_.jsx("div",{className:"lg:hidden bg-white dark:bg-dark-900 border-b border-slate-200 dark:border-white/5 absolute w-full px-4 pt-2 pb-6 shadow-2xl",children:_.jsxs("div",{className:"space-y-3",children:[d.map(f=>_.jsx("a",{href:f.href,className:"block text-base font-medium text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white py-2",onClick:()=>i(!1),children:f.label},f.label)),_.jsxs("div",{className:"pt-4 flex flex-col gap-3",children:[_.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[_.jsxs("a",{href:"https://github.com/superdoc/docx-editor",target:"_blank",rel:"noreferrer",className:"flex items-center justify-center gap-2 px-3 py-2 min-w-[78px] text-sm font-medium text-slate-600 dark:text-slate-300 bg-slate-100 dark:bg-white/5 rounded-lg",children:[_.jsx(ky,{className:"w-4 h-4"}),_.jsx("div",{className:"min-w-[35px]",children:o})]}),_.jsxs("a",{href:"https://docs.superdoc.dev/",target:"_blank",rel:"noreferrer",className:"flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium text-slate-600 dark:text-slate-300 bg-slate-100 dark:bg-white/5 rounded-lg",children:[_.jsx(S6,{className:"w-4 h-4"}),"Docs"]}),_.jsxs("a",{href:"https://discord.com/invite/b9UuaZRyaB",target:"_blank",rel:"noreferrer",className:"flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium text-slate-600 dark:text-slate-300 bg-slate-100 dark:bg-white/5 rounded-lg col-span-2",children:[_.jsx(I6,{className:"w-4 h-4"}),"Discord"]})]}),_.jsxs("a",{href:"https://meetings.hubspot.com/josh-superdoc/talk-to-an-engineer",target:"_blank",rel:"noreferrer",className:"w-full bg-brand-500 text-white px-4 py-2 rounded-lg text-sm font-bold hover:bg-brand-600 transition-colors text-center",children:[_.jsx("span",{className:"max-[1074px]:hidden",children:"Talk to an engineer"}),_.jsx("span",{className:"hidden max-[1074px]:inline",children:"Book a chat"})]})]})]})})]})},JW="modulepreload",eK=function(e){return"/"+e},R6={},ag=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let s=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=s(n.map(d=>{if(d=eK(d),d in R6)return;R6[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;
460const m=document.createElement("link");if(m.rel=f?"stylesheet":JW,f||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((y,b)=>{m.addEventListener("load",y),m.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return i.then(s=>{for(const l of s||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};var tK=Object.create,ID=Object.defineProperty,nK=Object.getOwnPropertyDescriptor,rK=Object.getOwnPropertyNames,iK=Object.getPrototypeOf,oK=Object.prototype.hasOwnProperty,zA=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}},RD=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),sK=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=rK(t),o=0,s=i.length,l;o<s;o++)l=i[o],!oK.call(e,l)&&l!==n&&ID(e,l,{get:(u=>t[u]).bind(null,l),enumerable:!(r=nK(t,l))||r.enumerable});return e},OD=(e,t,n)=>(n=e!=null?tK(iK(e)):{},sK(ID(n,"default",{value:e,enumerable:!0}),e)),Tw=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")}),aK="data:application/octet-stream;base64,UEsDBBQAAAAIAAAAIQAykW9XXwEAAKUFAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbLWUTWsCMRBA74X+hyVXcaM9lFJcPfTj2BZqf0BMZndDk5mQjLr++7Jql1KsC1Uve0nmvRdYZjJrvMtWEJMlLMQ4H4kMUJOxWBXiY/48vBNZYoVGOUIoxAaSmE2vrybzTYCUNd5hKkTNHO6lTLoGr1JOAbDxrqToFaecYiWD0p+qAnkzGt1KTciAPOSWIaaTRyjV0nH21DDgriSCSyJ72F1sXYVQITirFVtCuULzyzLcG/IIbnsn1TakQeOdkAcN7cnfgv3c6wpitAayNxX5RXkohFxTNNKQXnpAzo9jDnRSWVoN3XxLC5E0pGSx8i7vTryyOOjrwKVfQLRYnT+kQ/dGJN44SOcv2HH79cBssbpEwJ7cm7CGxfvFKn7Ae0NKQp6rhYPzZ3To3giuwcPuOz65Y4s5pjSk3yKFJDXFfzz7e2+008MQKUBke/yv64wqhJPfB+1KMmAOuOV2yU6/AFBLAwQUAAAACAAAACEAAAAAAAIAAAAAAAAACQAAAGRvY1Byb3BzLwMAUEsDBBQAAAAIAAAAIQCGoakSbgEAAM0CAAAQAAAAZG9jUHJvcHMvYXBwLnhtbJ2STWvcMBCG74X+B+N7LG8PoYRZhbIm9NCPBTvJeZDGtoikEZI2rP99sd3dddtbb/M+mnnnA8Hj2dninWIy7PflrqrLgrxibfywL5+7p7vPZZEyeo2WPe3LiVL5KD9+gGPkQDEbSsXZWZ/25ZhzeBAiqZEcpooD+bOzPUeHOVUcB8F9bxQ1rE6OfBaf6vpe0DmT16TvwtWwXB0f3vP/mmpW83zppZsCpVJCRy5YzCR/zJW20pwdiCuFjjPazjiSNYibgCMOlOQOxBrAK0ed5pw1gMOIEVWmuMCNgi8hWKMwG/byu1GRE/e5+LkMW8zVILYp0LBqSZ2iydNstZXwzXhaGqwBHDHiEDGMC9woaBVaOkQOskebCMQNwIFdQD/J9hQoNqxAXMjc4C09h46b+Rq/S/+Em1VfTR7bgIr+WnrDoR0xkm5YXQe5Avg6BYp2dj+M6AfSl5x/H+Yzvqy/U+7uq7qu6+VuFwbi9g/lL1BLAwQUAAAACAAAACEAhRXCKnABAAD7AgAAEQAAAGRvY1Byb3BzL2NvcmUueG1snZJNT+MwEIbvSPsfIt8TO2EXIStNJRZxWqSVKFrEzYyHYhp/yOOS9N+vkrQpFT1x88w888741dTL3rbZB0Yy3i1YWQiWoQOvjVsv2OPqLr9mGSXltGq9wwXbIbFl8+OihiDBR/wbfcCYDFLW29aRhLBgbykFyTnBG1pFhQ/oetu++mhVosLHNQ8KNmqNvBLiiltMSquk+CCYh1mR7SU1zJJhG9tRQAPHFi26RLwsSn5kE0ZLZxvGyifSmrQLeBY9FGe6JzODXdcV3eWIVkKU/On+z8P41dy4wStA1tQaZDKpxabmx6cGSduXd4Q0pedAg4SIKvnYPGwDxlsP2QopZY+EcUQP5cH4De46HzU1NT+JNEiNBNGEZLybRpwkIMhWUbr32rwa1De7s9O+UkNjxA8zXElTjcQc1nvLpw1RZz0ZORl7qPy7/H27umNNJaqfeVnl5dWqqqT4JYV4HpY86T8K2v0C31Y8CEw+nZ5r8x9QSwMEFAAAAAgAAAAhAAAAAAACAAAAAAAAAAYAAABfcmVscy8DAFBLAwQUAAAACAAAACEAHpEat+kAAABOAgAACwAAAF9yZWxzLy5yZWxzrZLBSgMxEIbvgu8Q5t6dbQURabYXEXoTWR9gSGZ3Q5NMSKJu314ERRdq6cHr8PPNN8O/3c3BqzfOxUnUsG5aUByNWBdHDS/94+oOVKkULXmJrOHIBXbd9dX2mT1VJ7FMLhU1Bx+LhqnWdI9YzMSBSiOJ4xz8IDlQLY3kEROZA42Mm7a9xfybAd2CqfZWQ97bG1D9MfElbBkGZ/hBzGvgWE+sQJ4rR8t2lbIkztVxAdVTHrlqsGKesqSClFIzBw942mhzudHf12LgSpYqoZHM530+E+eE1v/5omXix+ZdskX7Nf62wUULug9QSwMEFAAAAAgAAAAhAAAAAAACAAAAAAAAAAUAAAB3b3JkLwMAUEsDBBQAAAAIAAAAIQDscNBiEwIAALQHAAASAAAAd29yZC9mb250VGFibGUueG1svZPNbqMwEIDvlfoOlu8Nw0/SFIVUbbeR9rKHVfcBHGOCtf5BthPI268wECmkuy3tqnCwGWY+jz/D6r6RAh2YsVyrDIczwIgpqnOudhn+9bK5WWJkHVE5EVqxDB+Zxffr66tVnRZaOYsaKZRNJc1w6VyVBoGlJZPEznTFVCNFoY0kzs602QWSmN/76oZqWRHHt1xwdwwigAW+vkII9SzzHpQuCk7ZN033kinnIYFhgjiulS15Zc+Q9XuQtTZ5ZTRl1nK1k6KDSsLVOStMLmiSU6OtLtyMatn35nlBBCH4mRQjynwaJXqdsqCsmQZa9qCAsuYCxvNpsMUJxvMx7GNtjSn5fhInioeO2qEtHwNt7vJyGnM4waCtJY6UxJYXWDZtv/MT8yhZg5Gk6fed0oZsBctwHSaoDufIg1F3Mu2AuhNHwz6QN4TXXTP9T4nqVBHJMvzCJbPoB6vRTy2JGtL61IoobVmI6vRARIah3egCYphDAnOIIIYEB+cltCTGMncqgXFCQSQXx+G98auOUiruaDlkHIjh7Y7HSZbvUJ3u7RYy/AwA0fNmg7tImOEnALhdzh/7SNR24q+7PhKfItBGqOf4x7DjUM855Qyrr4LO4F98Pum94cy0Rt90eQsx3Hmnrcvk0y6lzpn5t8yCNyz/iMkk/mqTD4YT8abDR1hA4h1292cd2ppb+3++x4evtjhM7foPUEsDBBQAAAAIAAAAIQCWFrgr0gIAAIgLAAARAAAAd29yZC9kb2N1bWVudC54bWyllt1u2yAUx+8n7R0s7huM7TiJVbfSmq3qxaRq3R6AALFRDVhA4mRPP2HHH5unKnaugONzfvw5B458/3gShXdk2nAlU4AWPvCYJIpymaXg189vd2vgGYslxYWSLAVnZsDjw+dP9
4601VCFTkIJq13EoU0SVWSFOTWlgmEhuRMYLMQnGhl1N4uiBJQ7fecMFgpTWHgI7+elVoRZgyX2ROWR2zABUdO19GoxhWXmQNGkORYW3bqGWgyZAk3cD0GBTNAyIcBGqPCyagYOlUjUDQLhPwxaTmP9J/DxfNIwZi0mkcKx6T1PNLoOonxBVclkydR7JUW2JqF0hkUWL8fyjuiRIkt3/GC2zMMfD9uMZjL9xmKuHzvCCKkkwkrKBRlRUhbikrBQcvkEn/XxTvpSRN/GboIVly3beCjDWQnWxjbxuprcteEby+Npc4a1KzAlitpcl523UHMpQls8xZy/CgBR1GArrOh6LbWtm3K0AOvkX+pnSga5R8TkX9FNR2ii7hGwt97tkoE5rLfeFZqBslFy2mAYASICTtNY6wvDEj61+04nE7jxB2H0wFnnpgBgB4mIYKw1eEGFz5gGWppPg3X1gi6WGxxjk0+JLJpB1x2uLMY5LvMbntUz1odyp7Gb6O99O21ktMO6Mf/VrA0t4l5y3HJgCdI8pJJpfGuYCmoUORVaOnVFfCa6+oGr3kBXltrr75Anuta4OG+SnaKnt1YehWKkhJr/EJTEKFNHMUrBGqrZSfrrH603KxXmyXwqkQbTn+kwPeDMNyuvnSmV+2MIfKjp6+dccv2+FDYsfvrwBk6GYYR+6qv5dfCs7ffXuU6FgqCyHeOeQrQch35DbLMvmNHtKpMAYoaF82z3PbLnbJWiX5dsP3ga84wZToFq6Be7pWyg2V2sPXysh1RhfGqxJSYsManNlNFnrUrSVJwyV65JXkKwrj+Cttz19OmIrD/hX74A1BLAwQUAAAACAAAACEAyudliigEAAC+DAAAEQAAAHdvcmQvc2V0dGluZ3MueG1stVfbbttGEH0v0H8g+FxZXF4kmTAd6No4sJoictDnFTmUFt4LMbs0rRT994KXldSaCKQEfuLynJkzs5eZJe8+vAruvABqpmTikhvPdUCmKmNyl7hfn1aDietoQ2VGuZKQuAfQ7of7X3+5q2INxjC5086r4FLHIk3cvTFFPBzqdA+C6htVgHwVPFcoqNE3CndDQfG5LAapEgU1bMs4M4eh73kjt5NRiVuijDuJgWApKq1yU7vEKs9ZCt3DeuAlcVuXhUpLAdI0EYcInBqmpN6zQls18aNqgpq9FXn53iReBLd2FfEumG6lMDt6XJJe7VCgSkFrJneC2wSZPAUO3wgdY9+kSnRTbKSGvke8ZnSeeXSdgP9GYJTC63Uak05jmMLruQ7LrtMZHXVYdqbzY8mcCWTlVRJ+YPOoH7X7mZbOTLa/Ts7u0bD2pYbuqd6fK8J1E4yOcgdxWm/NLzmBLfXItkjxcH78RBo/7KRCuuWQuBUJnYpETpOd025l/XDa0+HYdXCaxXXv76r4m1LCqeICMAVpEpf4njusi
460QKVyjeGGnCqWBfAedPDUg5Uuk4V75AKQdEijU8GOS25eaLbjVGFU8UvlCfu2Eqme4o0NYCbgqZM7uZKGlTc2mXqD2XmShQIWnceTV87jTZtj3SqWFIBifufvrdWGdSZlcgu3xnXRifRecj/B1IvgMgyeKoXemMOHFZKmg37BlOZfSq1YTlLm+73Exl8LwGQdeTPBcinQwEroKZE0O8UrNmJFWfFmiEqfJAZSPNuwVieA4I0jBpYl9wwVFWzzh+BZoDvFbfU8JfCzPdI8IQ0fZ4pY5T4eCj2IH9yJ5vzPjw/vqhZpu3gi1LmaOr5QbAYz9pMa/YSJiBeOF/2MiNvRfp9pmHgBb3MnCxI2M9Ek9m8jwlvwxGZ9jGjyF+GUR8znfmTYNLHzGZkHPUy83kwD1a9zNJb9M9nOffH497cVre+d7vsdqfbExHXnxp/oh3Vhe2I1mNOxRYZddb1x8iwttji84xJy28hVwjnzKbcWnIwaAktKOcrpKklvBbPmC4WkDdjvqa4O+l2FtiLZpB/OmrVXRvwd1Rl0bIV0qItWGtCwrDzZNI8MmFxXW431ktSPJxRpcw+v2CzTqflqWKzB9E0vkfaFFJjC3LwddMVGsdNXSSwpkXR1tp2RxKXs93ekLo8DEncjOJz87Ld+R3nN5zfcs0LTeuZkcTtBifMt9iZXWCx4ISFFgtPWGSx6ISNLDaqsf2hAORMPifucVjjueJcVZB9PPFvIHsJpkxQvjmI7eluu2k5zrTZQEGRGoWW+63hSBhnKn2o7+uwxYPpNFpMvXFLR831aZpWxeTuC+QzqiHrOOsata5/j0beiJD5ZBBOlreD5TgMBxMyux2Mx96YBCviBxPvn64O7I/H/b9QSwMEFAAAAAgAAAAhANuFbMNjBAAAlx0AABIAAAB3b3JkL251bWJlcmluZy54bWzNmctu4zYUhvcF+g6CgC5jkbrbiDJIMkmRwXRQdFJ0TUu0RYQXgaR82c7L9BH6WPMKBWVLdiJPKslO45USkufT4c9zpD/K5YcVo9YCS0UET2w4AraFeSoywueJ/efj/UVsW0ojniEqOE7sNVb2h6uff7pcTnjJplgSPrdWjHI1WRZpYudaFxPHUWmOGVIjRlIplJjpUSqYI2YzkmJnKWTmuACC6qdCihQrRfj8FvEFUvYWl6660TKJloTPDdB30hxJjVc7BuwNCZyxE7dB7gAQBI4L2yivNyp0TFYtkD8IBEGbFAwjHdhcOIzktknRMJLXJsXDSK1yYu0CFwXmK0ZnQjKk1UjIucOQfCqLi1SwAmkyJZToteMCENYYRPjTgIwIf2oIzMt6EyKHiQxTL6spIrFLySfb+Ism3qQ+2cRvL00Ept1u6wI4dvBKU6XrWNlFu034R5GWDHNdqeZITJEmgqucFM3TgQ2lMaTzGrJ4TYAFo3bzZIP+cY+2j5tj2AG7pL89O0Y3mb9OhKDDaRpEE9Elhef3rDNhiPDdjQdJsycuDPoB3BYgTPGqHyPeMpx0192GQ7J+nLDhkGyPMyyZPUBW9kK4Xp2HuZjwPZbKdJb3w9Vn5JhYpFGOVL5PxP02GDS4NdvTu5gf11S/SlEWOxo5jvawe7wueb8NgvDlCRbquGS+5qjAtsXSycOcC4mmFCf2EvrWEgZWdQLWplzNxdp0gFWftVUVkGWeWvbV5XKCpkpLlOovJbOe/faQJTawDXMisdJImsGNp7ueaSxvJEZPZomhcGXuNlkgmtgwhG54AyLbMTOspJp8xgtMH9cFrtfk66kk2W9mjpq5zVrNClqvCODdrX8H4s0MXZgJQhd0k9REFzRNbOCDMQAAVjlUOTZJbOJ4ye5ZMzgtKcW6IT7iVTP1/ds/zfintB6leLZdXvwuzYVws00znNiRW2WSIz6vDLEXArPWaRbL7eVecK2MuColJLG/rtlU0Cr0mqvnA4TrxM7wDJVUb2EVxakSe6kEbCnhVSOYa6TJApsVRysj+uoCfX+YMLeilARL6wte7qnzYjRV7YX9VHNbqgWnV+37t7/76ubCcJhufxE+N3+TqT3Vno/1E8g70GBvIFDvhnPj+L07zj/LjvNCcNYdF5xpx/meex4dF55pxwXAf++Oi86y44IoPOuOi8+040I/fq+Oc5652/+0vnCI9Q3iCEDv5vo463t3F/owuvW7WN/7jseY4ZQwRA+e4y9wdGLv29GuwvHAoqRiieVnrDWWh3fkjk7tWjt6SXhzzJb+EAzxwzvyDu1Iknnew1DCuMOWvAM1NmxLr9acPzq1/evo2N6u6ILRqY1bRzv1ZkUX9i+6lqfqVHTh/1N00ejUDqijaXm7ootHp/YuHR3FmxXduH/RtWzFD4qu7QF49e7ne+988+FskpXVZ7VqEADoR+PQffm57KF57df34geY7iGmHwcBjHwIf8yE+0xn7x+qV/8CUEsDBBQAAAAIAAAAIQC+fnZiWAEAANADAAAUAAAAd29yZC93ZWJTZXR0aW5ncy54bWyd019LwzAQAPB3we8Q8r6lnduQsm4gMvFFBPUDZOmtDeZyJclM56eXdn+s7GX16ULgftwfbrFq0LAvcF6TzXk6TjgDq6jQtsz5x/t6dM+ZD9IW0pCFnO/B89Xy9mYRswibNwhB29KzBo31GaqcVyHUmRBeVYDSj6kG26DZkkMZ/JhcKVC6z109UoS1DHqjjQ57MUmSOT8y7hqFtlut4JHUDsGGLl84MDJosr7StT9p8RotkitqRwq817ZEc/BQantm0ukFhFo58rQNY0V4rKijxCRJk+6F5heYDQMmF8BcQTPMuD8aQkHTd3QxzJmfHV30nP8V0wOK3SBicneqow1tes/yRSiqYdxpR6LNlUFW0ld9EYY1ODtze2znjSp7Li05uTGQ85hOWUxnrIPZYQttYIfFslMLrJsLXy5iRnXQqL9hTe7BUfTgRPstjaH4+vIklgvx5w6XP1BLAwQUAAAACAAAACEAP6/hZjkOAAANpgAADwAAAHdvcmQvc3R5bGVzLnhtbO1dXXPiOBZ936r9Dy6eZh66AUk2kBp6Kkl3b7o2/TFDeudZ2AI0sSXWFk0yv35L/gCDLbDRhUl3baUqCcb3SNa551q6sqVffn2KQucbixMuxbjTf93rOEz4MuBiPu58fXj/athxEkVFQEMp2LjzzJLOr2/++Y9f1leJeg5Z4jxFoUiuIn/cWSi1vOp2E3/BIpq8lksmnqJwJuOIquS1jOfdiMaPq+UrX0ZLqviUh1w9d1Gv53VymLgJipzNuM/eSn8VMaFS+27MQqq4FMmCL5MCbd0EbS3jYBlLnyUJF/MozPAiysUGpk8qQBH3Y5nImXrtyyivUQrVRb1+L/0vCrcAbjsAVAHwfPbUDmOYY3R99lTG4UE7HG+Dw4MSzmmVKQEEq1YQCBf10H+0eQkrCVSwaAdXcNTVtlTRBU0WZUTW7gLdDdxzpNs78q8+zIWM6TRk4866T5x133VSYCdjQf9xMmKd4hKctF06b35ZXwXSf8tmdBWqRH+Mv8T5x/xT+ue9FCpx1lc08Tkfd65jTsOOs75iNFHXCacPCxaxcSfiQsZ31yLh+suF/qd0sp+MOw88Yonzia2d32VEhfPTjQyendvJz52uLuiRxcJZX32j4biDskPJX5sDpDhym+wfC6mYF8eYePV1Uq5d6dCUB3zcofGryXVq2CdXIZ9TtYpZ4uhPKUIWiOLgVgrFntSKhvrkbt4e3f1WWm4+ZWftNWlIFRNqkkWx9VXAZvfSf2TBRFHFxp1eJzv49cOXmMuYq+dxZzTKD05YxO94EDBROlEseMD+WDDxNWHB9vhv79Nokx/w5UqocQcPvJTmMAnePflsqWOXs74SVPP1SRuk3Kz4tvDU/L8FWD9v4Dr7BaM6gDv9fYhRawikLZLS1dZjrvauvd+6IHypgsilCnIvVZB3qYIGlypoeKmCRucuiIuAPWVCrBZTQT2Gg4BwMBAOAcJxgXA8IJwBEM4QCGdkjaOkb/LCkrPj0Sm46Ey4+Ey45Ey47plwvTPhDs6EOzwT7ugMuFlXy/kgAiaUtcpmUiohFXN099QajQohVTqqhcHTNz0Wg1wkAEwW2fIbsTWaT9PPxz3EtbufKz2gc+TMmfG5HpxYV5yJbyyUS+bQIIhZAggYM7WKBZxPx2zGYiZ8BunYcKAhF8wRq2gK4JtLOgfDYiIAbr4CESQobByartRCi4QDOHVE/VgC9FkoWHy454kCAXFuVmHIgLA+wbhYioVgYDAMDIGBcSE5g2qiHA2DohFQNBfSP6HaLUfDoGgEFM2+3R64Ctl+r6PfPHd3G8oEIuBN+Fyk+VNrpDxn6nyhMZ3HdLlwdNr5aE+rdTlpyvkB4p62QYLq16cuorPOXKwYLBqUuDZ4GBiPAOPZS+wjSxLdQbuDGc9MVlNVK9rmo4IJDVdZh9ZebVQxQAG853ECJoN6WAAP/qS7s3dAXb1tLREgFgaPSqDVyyEBahlK/xEmDN89L1kccvFojfRehqFcswAOcaJimflaWfIINZb8u2i5oAlPKhDNb/XFEwzOR7q0vqAvIeUChrd3ryLKQweuB3H38PHeeZBLPczUDQMDeCOVkhEYZp4J/OkPNv0ZpoLXfizFM9DVXgOlh1KwW66AWL2VARDSWzbjgoPcQ1O8f7PnqaRxAIP2JWbZQ0OKASFOaLQMobT1vGTrmEOkZVO8/9CY67wQlKgeQMBKacNkNf2T+Qqgfg5IZujzSqX5x7Sr24eFQ7Bw9l2ElE1nwrX/AlzsDhyChYO62NuQJgn3wa62wEPAeNDXS6DwZCjj2SqEa8ACEEEDY
460jjAVSQSyCtO8RAwHvT1EmA8FwjvXzEPwMhIwRAkGIYEI5BgoAR4kGADSLAhEBhQF6AEhiDBMCQYgQRzIcE8SLABJBiUn+G3DpvNmK/gbjElSAQPCXejEYpFSxnT+BkI8l3I5hQgQZqhfYnlTL9NIkX2EDdEd3Y1VZCd7QwOiuQ/2BSsahoLsl4AGVEahlIC5da2N5yaZ9eOmaWvc0BkCn22kGHAYsM1HRwvT5bU59XUafPJkns+Xyhnsthk+8swXu+oZTFg3zE7XmBdm3vo4DRTwFdRUdHqyxQebm6MKsbkuPG2J7Fj6Ta0rJbpHbfc9pJ3LAcNLatlDhta4orl6OAsWfxY6wiDQ/6zGeMZnG/Qb2JcWyxqYlnnggPcVCrOte/r2YL+iZox2zcTj9m+jYrMKG3kZEZprCszxCGB/c6+8aQ2R31k/nvz9EQl7pPGkfO3lVSVaWrU/KWuD0IxkTCnFgc3n7jaiTLmdmwcbswQjeOOGaJxADJDNIpERvNWIcmM0jg2mSEaBykzROtohSyjFbKMVggkWiGQaIXsoxU6vTtghmgtVGQvVGQvVGQnVAQiVGQvVGQvVGQvVGwpVGwpVAwiVAwiVGwvVGwvVGwvVGwvVGwvVGwnVAwiVGwvVGwvVGwvVGIpVGIpVAIiVAIiVGIvVGIvVGIvVGIvVGIvVGInVAIiVGIvVGIvVGIvVNdSqK6lUF0QobogQnXtheraC9W1F6prL1TXXqiunVBdEKG69kJ17YXq2gvVsxSqZylUD0SoHohQPXuhevZC9eyF6tkL1bMXqmcnVA9EqJ69UD17oXqthJpPUZoes++3z3oan9hv8Z5PVqnfy69y7+RQ+61rZcZq/i7CjZSPTu2Lhxg3B+HTkMs0Rf18fBmFQeuJz8+3h9/wabCMR9NLyd+FSOdMK+CkqWUlp0JQQ8vKII/ghpaVXichDS0rt0FyKOimuiweSpkvKvNZpNfMuG8w95qZV5t40Myw2sLDZobVBh41M3QdHZz3rd2G7eRtni+tIPSbIQzMCKgVV8bcfmPSzAhN2TMjNKXRjNCKTyNMe2LNUK0ZNkOdRjWyphpZU42sqUYwVCM4qhEc1QiIamxNNbamGltTjWGoxnBUYziqMRDVxJpqYk01saaawFBN4KgmcFQTIKpda6pda6pda6pdGKpdOKpdOKpdIKo9a6o9a6o9a6o9GKo9OKo9OKq9VlSnWZTTR0sl83adsJJhuxtyybBdcC4ZnjBaKlmfOFoqIZw4WqpyddpoqUzaaaOlMnunjZbKNJ42WqrwedpoqZbY00ZLtQyfNloyU42sqUbWVCNrqhEM1QiOagRHNQKiGltTja2pxtZUYxiqMRzVGI5qDEQ1saaaWFNNrKkmMFQTOKoJHNUEiGrXmmrXmmrXmmoXhmoXjmoXjmoXiGrPmmrPmmrPmmoPhmoPjmoPjup2o6WPTIAsATWJaKwcuPXi7miyUNR+ccKvImaJDL+xwIG91PtWV9nd3f7qTbGdn7O+Us/LdAX00utKQbYCbA6Ynvgh2GxTpY11TYp9vvLDaYXz6dqsxNTwSFEb8HyuuF+B325ulZYwpQkLPou6woVeGLHmuHaI4nhRzO2Cxtm3W1ctzhntX8v6Kk70Bm7Z170ewvjt4CY7a5ltzfbI2PITe1Ld4sM9FyzJ9knLXqDVu57pNcXYuIO99N0rOlMsHneGuWpltmrT/bdwU1JOXV5G7S5wxZZv9M/Slm/7+8HpL9/lxzZbwtVa+okqHb7hAc8q52uVb+r1ngy81DfSk9MIMO7QVP/bw/qhFP2cwfv9DeSKyebyBnKkt7e12ynOg4zOgyCdBzVwnq0ss/N2RHlm9+o3dK/+j+leGFXdKztm6V7Y6F4Y0r3wD+Je6LB7HXOiS7gKGtZsZTkEcBVidBUC6SrkhbvKsOwpxOgp+DyewrPftwmI31h6hGv0CBfSI9wfwyPIy4wdlj7gGX3Ag/QB74X7gJl29+KBwB3pn30n0DstbV3ggesdfK89AA8YGD1gAOkBg+/WA7wLCP/CnA+NnA8hOR++KM6rzA4urm000D9NeH4L0ecbGXkeQfI8euE8Dy+gYHhm/QWNqZ8vqG7If+UbI21W9km3Rdrn3LB7koGvfjO+zPVWxUrrhjqnWdqDibt8sXaTQzX2KDUNM6rVNPwgtEOt8z3ss5oGT7RTnHjLwvAjzc6WS/OpIZup7Nt+b1jz/TTbEsJoH6dzB0aA7m5lupuLMLd3tklk/lKLMU+aLhlWbe5sKTHLlm7ow/4qUTJK07379dvJge7X8q5ItzrbOLMXuGp1YMy0HglV5uDz/3Rna0rRQUoREKWo3d3nx2fYJuPYkmF8kGEMxDA+F8Pfe9KvJVvkIFsEiC3y0ti6dOKtJSvuQVZcIFbcH01D4Dx4B3nwgHjwviN1wGcmWlIyOEjJAIiSwYuWxt9OwvAgCUMgEobfkS7OPN4/TsnoICUjIEpGL1oXl0qnZQtb7Ld1dhQij5YiHUqi9XsnPAC0TXLvTYz7evuKJ7WiYb6S/ot56GJb5fSyXhXX/chiUe0sb8KjV+0+u8CBcEtRrRvYyq3kS2b2X+aw9fKc1Yt0s4n2PkGbLyCkWoAdVGv/BLWKVZT9w8Pq81CbLyua7nu9Fzg/VfGKvvt3jHl3yDK5ha10d93L7A0vvM94ZsrqNZttA7DPTHYUQq0p0iGpopHVjbX+AbR+sXjfn36BowexLK5V6oFOJunpnyYcQo+Htw1XS46tZkoMmzk5KpiLtly9A+vpk+2+GvtttbftxjGPrjYFJie4J0+nuvRElV4jr0Gfr6G7bC46Xzhus5rd/mVXlrtr5yg1HtHqhnrcOy74nFXeFvWBbnc3FIiAVy7uUNzDpwwoljdBaYI0PS/hYp7vq/2XfkbOyaIjSzutTt7sJ+bHN1OpZy6pu72yYy9G4CKylzU29NLapDO72SeQ4P+35kMrfnTQdW1vBzsiOeKxL073B2Pkdm1NUwNuz7CNksWcX6soOc1KzVsriWgY3tJlAjXFtduldOtbtPgvefM/UEsDBBQAAAAIAAAAIQAAAAAAAgAAAAAAAAALAAAAd29yZC90aGVtZS8DAFBLAwQUAAAACAAAACEAZ4D8tJEGAADNIAAAFQAAAHdvcmQvdGhlbWUvdGhlbWUxLnhtbO1Zz4/bNha+L9D/gdDd0Q9LsjSIpvDPpslMEmQmWfT4RqIlxhQpkPTMGEWAIj3tZYEFukUvBXrroVhsgS3Qopf+MQEa7Hb/iIVkjy3adJO0k90AO/bBJvV9j5/eeyQfyNvvX5YUnWMhCWeJ5d5yLIRZyjPC8sR6fDrpRBaSClgGlDOcWAssrfcP3/vDbThQBS4xuiwpkweQWIVS1YFty7TAJchbvMLssqRTLkpQ8hYXuZ0JuCAsL6ntOU5ol0CYhRiUOLEeTKckxei0NmkdXhkfU1xipmTdkVJxkjYjthkNNpu59Y9cyCEV6BxoYl0QlvGLU3ypLERBqiEVieU0H8s+vG2vSVTt4bZ4k+az4q0I2cxreCI/WxOdsRf57tq+t7S/ixtH9XdtrwFAmmK20tLGukHoRN4K2wIt/xpsxz23q+Nb9ru79uNw4PkavrvB+7vvOInHo0DD+xt8sIPvO94g7mr4YIMPd/D+uN/zxhq+ARWUsNkuOuxFUbhCryFTTu8Y4XEYOr3RCr5B2a3sWvKZ2pdrJTzlYsKZaoILijCkFhWeQooTq18pLtGIyIrCwkIVMC5xYjme6zqO4zve+tt4HA4wtNjLrlTudNV6kEwFqVRi3a2AWS3Izz/88OL5dy+ef//i009fPP87OiJ5oQy8O8DyNu+Xr//y7y8/Qf/6x1e/fPZXM1628S//9qeXP/70a+aVJuvzb19+9+3PX/z5n998ZoD3BZy14aekxBLdxxfoES+BmQbAZ+LNGKcFkDajz3IJDGqOAT1WhYa+vwAKBtwA6358IgjLTMAP5k81wSeFmCtiAN4rSg14zDkdcGF8p3v1WG0vzFluHlzM27hHAOemsYdbUR7PqwKXxGRyWGBN5kMKTEGOGVaofsZnGBtoHxGi+fWYpIJLPlXoI4IGQIwuOSVnyky6Q0qgsABzvDXfHD9BA05N5kf4XEcCy4GaTGKqufEDmCsojYqhpG3kEajCJPJkIVLN4VIJYDmmHI0zLKWJ80AsNLn3gBJz2I/potSRQpGZCXkEnLeRIz4bFlBWRs2EFW3sh3LGOQX0kCujCK7PkLrNKQG2N9xPCFZvNrcfk7wwJ0j9ZC5MUwJzfT4u6BQwMy5OpbbE9gUxZsdgnmupfYQxhQvIMEaPPzThecXNou8WmOV3sMk3d0HP1brNsMSoKW4MgSVSS9kTnPM9eo4XWwvPAlgJYp/l+zM9ZcZngpTGfKXpTFtKiagnrVnEA1nCa1l9WICWVnVbVnvmGHvTOXayEE9/Awe/MYcLeG3fnALF5oQ5BYKOsJkyN1Pq6dTQ5kbeVJ+0mzDYW0VPSdgrKqD/TeXz1mqe66929i0o2zXOPtx2ZTPkIiPvfmEzgjl7iFlxU9fc1DX/l3XNvvl8U83cVDM31cx/rZrZFDB2+7CnsVLuPfmZEkpP1ILiI9mUPpJTkk0IpU2jIa0PmqpiSMVqOA2XC2j+I8HVH4kqTgqocGK5zQi5XJnOJaq4TCzH2mu7Kb7m5THPVud47tXZJhxIUJt+J1j3K8LUsjfsbQ5C1+abVi7bAoLG6OuLaA2mi+gaRPS6ryfCda5LRWxQEbm/psJuRYUShqA+Fg/8pSIkU6A4q+O05F9F99ojvc+Z+mt7hteL/WuLtCailW66iFYaFpDh7e5rjnUcm0PtGWX0orcRa3t3baBMb6GLxAq7gWOhFKrEmlJQFkrLKkssWa9UQHOWWKlaOfq3rCyVkGoEsljCmkfL9y+JwgJRUiZW1A4DZRttrtdz3l1xsfPuec7eDjKeTnGq9vRsmkdSLY0Yn/5OcN3gc4XFSZFdoDM6F48gS6yg59YOzIhUa29mRLSSe+PFreVqNRW1G6DNFAVaFbDaUdqL+RLe/F/Lab1Ho3T7rWyTC8/yyXXsuq8mbS2aezaQ3t5V7O1t8i1VXbOqwLjWxdErdonfvyG0pEVmaV2ztH17xzUWBK3hwu4r9ojr3g22s9Zu1ZVNa+dym589xaka4SnMqZLLA7JLJWB4dS25XAma3qvV5VKhuSCJ9bET9P2hFww7ThSMO37XdzpR0O92+kHQdceB64wG3jPr8LYqSjdYjj2BktDF6u6+6d+5vy+vSu1bKS9t3tTBdkNu7u9db//9PSJZYn0cepO4Gw/CTtztTzr+aBB14mE46IzCYW8
4600GQ2DKJ48s9B5A/b73aEfjqNO6A6HHT90avlR3On5ntf3e/1o7PefrXyNL9XV75V7G12H/wFQSwMEFAAAAAgAAAAhAAAAAAACAAAAAAAAAAsAAAB3b3JkL19yZWxzLwMAUEsDBBQAAAAIAAAAIQCzvosd/gAAALYDAAAcAAAAd29yZC9fcmVscy9kb2N1bWVudC54bWwucmVsc63TsU7DMBAG4B2Jd7BuJ04KVAg16YKQukJ4ACe5OBb2ObKvkLw9UlHbVFQRQ8b7h///BnuzHZwVXxii8ZRDlqQgkGrfGNI5fJSvd08gIitqlPWEOYwYYVvc3mze0Co2nmJn+igGZynm0DH3z1LGukOnYuJ7pMHZ1genOCY+aNmr+lNplKs0Xcsw7YDiolPsmhzCrrkHUY49/qfbt62p8cXXe4fEVyZkRGZDOoIoVdDIORyTZHAW5HXCalECjxangMM9N58tOU97V2EwpM+CUzSHWC+J4A4dngGH8zfM5gyPSxpaT1yqyk4cp2gO8bAk4hur9z9PchIeIfLitxU/UEsBAhQAFAAAAAgAAAAhADKRb1dfAQAApQUAABMAAAAAAAAAAAAAAAAAAAAAAFtDb250ZW50X1R5cGVzXS54bWxQSwECFAAUAAAACAAAACEAAAAAAAIAAAAAAAAACQAAAAAAAAAAAAAAAACQAQAAZG9jUHJvcHMvUEsBAhQAFAAAAAgAAAAhAIahqRJuAQAAzQIAABAAAAAAAAAAAAAAAAAAuQEAAGRvY1Byb3BzL2FwcC54bWxQSwECFAAUAAAACAAAACEAhRXCKnABAAD7AgAAEQAAAAAAAAAAAAAAAABVAwAAZG9jUHJvcHMvY29yZS54bWxQSwECFAAUAAAACAAAACEAAAAAAAIAAAAAAAAABgAAAAAAAAAAAAAAAAD0BAAAX3JlbHMvUEsBAhQAFAAAAAgAAAAhAB6RGrfpAAAATgIAAAsAAAAAAAAAAAAAAAAAGgUAAF9yZWxzLy5yZWxzUEsBAhQAFAAAAAgAAAAhAAAAAAACAAAAAAAAAAUAAAAAAAAAAAAAAAAALAYAAHdvcmQvUEsBAhQAFAAAAAgAAAAhAOxw0GITAgAAtAcAABIAAAAAAAAAAAAAAAAAUQYAAHdvcmQvZm9udFRhYmxlLnhtbFBLAQIUABQAAAAIAAAAIQCWFrgr0gIAAIgLAAARAAAAAAAAAAAAAAAAAJQIAAB3b3JkL2RvY3VtZW50LnhtbFBLAQIUABQAAAAIAAAAIQDK52WKKAQAAL4MAAARAAAAAAAAAAAAAAAAAJULAAB3b3JkL3NldHRpbmdzLnhtbFBLAQIUABQAAAAIAAAAIQDbhWzDYwQAAJcdAAASAAAAAAAAAAAAAAAAAOwPAAB3b3JkL251bWJlcmluZy54bWxQSwECFAAUAAAACAAAACEAvn52YlgBAADQAwAAFAAAAAAAAAAAAAAAAAB/FAAAd29yZC93ZWJTZXR0aW5ncy54bWxQSwECFAAUAAAACAAAACEAP6/hZjkOAAANpgAADwAAAAAAAAAAAAAAAAAJFgAAd29yZC9zdHlsZXMueG1sUEsBAhQAFAAAAAgAAAAhAAAAAAACAAAAAAAAAAsAAAAAAAAAAAAAAAAAbyQAAHdvcmQvdGhlbWUvUEsBAhQAFAAAAAgAAAAhAGeA/LSRBgAAzSAAABUAAAAAAAAAAAAAAAAAmiQAAHdvcmQvdGhlbWUvdGhlbWUxLnhtbFBLAQIUABQAAAAIAAAAIQAAAAAAAgAAAAAAAAALAAAAAAAAAAAAAAAAAF4rAAB3b3JkL19yZWxzL1BLAQIUABQAAAAIAAAAIQCzvosd/gAAALYDAAAcAAAAAAAAAAAAAAAAAIkrAAB3b3JkL19yZWxzL2RvY3VtZW50LnhtbC5yZWxzUEsFBgAAAAARABEAEQQAAMEsAAAAAA==",lK="__SUPERDOC_V2_BROWSER_RUNTIME__";function mr(){var t;const e=(t=globalThis[lK])==null?void 0:t.vue;if(!e)throw new Error("SuperDoc rendering runtime is unavailable; initialize SuperDoc before rendering built-in surfaces.");return e}function R_(e){return new Proxy({},{get(t,n){return mr()[e][n]},set(t,n,r){return mr()[e][n]=r,!0},has(t,n){return n in mr()[e]},ownKeys(){return Reflect.ownKeys(mr()[e])},getOwnPropertyDescriptor(t,n){const r=Object.getOwnPropertyDescriptor(mr()[e],n);return r?{...r,configurable:!0}:void 0}})}function m1(e,t){return typeof e=="function"?{name:e.name,...t,setup:e}:e}var ND=new Proxy((e,t)=>mr().Transition(e,t),{get(e,t){return mr().Transition[t]},set(e,t,n){return mr().Transition[t]=n,!0},has(e,t){return t in mr().Transition}}),Dr=Symbol.for("v-fgt"),Hy=R_("Teleport");function dt(...e){return mr().computed(...e)}function UA(...e){return mr().createApp(...e)}function ei(...e){return mr().createBlock(...e)}function gn(...e){return mr().createCommentVNode(...e)}function ut(...e){return mr().createElementBlock(...e)}function et(...e){return mr().createElementVNode(...e)}function cK(...e){return mr().createStaticVNode(...e)}function Md(...e){return mr().createTextVNode(...e)}function wo(...e){return mr().createVNode(...e)}function uK(...e){return mr().defineAsyncComponent(...e)}function MD(...e){return mr().effectScope(...e)}function fh(...e){return mr().getCurrentInstance(...e)}function dK(...e){return mr().getCurrentScope(...e)}function Ps(...e){return mr().h(...e)}function fK(...e){return mr().hasInjectionContext(...e)}function VA(...e){return mr().inject(...e)}function O_(...e){return mr().isReactive(...e)}function _y(...e){return mr().isRef(...e)}function Us(...e){return mr().markRaw(...e)}function g1(...e){return mr().mergeProps(...e)}function Sn(...e){return mr().nextTick(...e)}function Wr(...e){return mr().normalizeClass(...e)}function DD(...e){return mr().normalizeProps(...e)}function Ai(...e){return mr().normalizeStyle(...e)}function hK(...e){return mr().onActivated(...e)}function Hs(...e){return mr().onBeforeUnmount(...e)}function pK(...e){return mr().onDeactivated(...e)}function po(...e){return mr().onMounted(...e)}function mK(...e){return mr().onScopeDispose(...e)}function Ze(...e){return mr().openBlock(...e)}function Sl(...e){return mr().reactive(...e)}function Ne(...e){return mr().ref(...e)}function ki(...e){return mr().renderList(...e)}function y1(...e){return mr().renderSlot(...e)}function gK(...e){return mr().resolveDirective(...e)}function LD(...e){return mr().resolveDynamicComponent(...e)}function Zs(...e){return mr().shallowRef(...e)}function Un(...e){return mr().toDisplayString(...e)}function au(...e){return mr().toRaw(...e)}function $b(...e){return mr().toRef(...e)}function O6(...e){return mr().toRefs(...e)}function Yt(...e){return mr().unref(...e)}function yK(...e){return mr().useAttrs(...e)}function vK(...e){return mr().useSlots(...e)}var N6=R_("vModelCheckbox"),bK=R_("vModelSelect"),yg=R_("vModelText");function pr(...e){return mr().watch(...e)}function vl(...e){return mr().withCtx(...e)}function Lu(...e){return mr().withDirectives(...e)}function Nd(...e){return mr().withKeys(...e)}function Gr(...e){return mr().withModifiers(...e)}var li=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},v1=new WeakMap,wK=0,M6=["documentId","generation","actionId","commandId","operation","source","origin","outcome","ph
460ase","success","changed","dryRun","revision","txId","direction","inputType","inputKind","editableCommandKind","dataLength","isComposing","hasRangeSelection","durationMs","elapsedMs","code","reason","failureSource","diagnosticCode","diagnosticStage","internalCode","severity","status","state","beforeHello","remoteGeneration","changedStoryIds","changedPartUris","reviewChanged","saveId","byteLength","targetCommitSequence","paintedCommitSequence","paintedRenderInputEpoch","health","commitSequence","documentEpoch","renderInputEpoch","layoutEpoch","renderEpoch","hasCommitEvent","input","receipt","result","failure","selection","target","selectionTarget","start","end","from","to","offset","blockId","nodeId","kind","story","storyType","id","empty","activeMarks","affectedStories","inserted","updated","removed","invalidatedRefs","remappedRefs","textRangeShifts","insertedLength","deletedLength","renderCommit","snapshot","lifecycle","workerFailure","timing","selectionBefore","selectionAfter"],xK=["text","data","message","errorMessage","quotedText","value"];function lp(e,t){var n;if(!(!e||typeof e!="object"))return(n=Object.getOwnPropertyDescriptor(e,t))==null?void 0:n.value}function D6(e,t,n){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0&&e<=n?e:t}var kK=class{constructor(e,t){this.version=t,this.sessionId=`interaction-${++wK}`,this.slots=[],this.head=0,this.count=0,this.sequence=0,this.actions=0,this.bytes=0,this.evicted=0,this.truncated=0,this.failures=0,this.closed=!1,this.cleanups=[];const n=lp(lp(e,"diagnostics"),"history");this.enabled=lp(n,"enabled")!==!1,this.captureContent=lp(n,"captureContent")===!0,this.maxEvents=D6(lp(n,"maxEvents"),500,1e4),this.maxBytes=D6(lp(n,"maxBytes"),1048576,16777216)}record(e,t){if(!(!this.enabled||this.closed))try{let n=!1,r=128;const i=(u,d=0)=>{if(--r<0||d>5){n=!0;return}if(u===null||typeof u=="boolean")return u;if(typeof u=="number")return Number.isFinite(u)?u:void 0;if(typeof u=="string")return u.length>512&&(n=!0),u.slice(0,512);if(!u||typeof u!="object")return;if(Array.isArray(u)){const p=Math.min(u.length,16);u.length>p&&(n=!0);const m=[];for(let y=0;y<p&&r>0;y++)m.push(i(lp(u,String(y)),d+1)??null);return m}const f={};for(const p of this.captureContent?[...M6,...xK]:M6){if(r<=0){n=!0;break}const m=lp(u,p);if(m===void 0)continue;const y=i(m,d+1);y!==void 0&&(f[p]=y)}return f},o=i(t())??{};if(e==="selection:changed"){const u=JSON.stringify(o);if(u===this.lastSelection)return;this.lastSelection=u}else this.lastSelection=void 0;const s={sequence:++this.sequence,observedAt:Date.now(),type:e,data:o,truncated:n};let l=JSON.stringify(s);if(l.length*2>Math.min(8192,this.maxBytes)&&(s.data={},s.truncated=!0,l=JSON.stringify(s)),s.truncated&&this.truncated++,l.length*2>this.maxBytes){this.evicted++;return}for(;this.count&&(this.count>=this.maxEvents||this.bytes+l.length*2>this.maxBytes);){const u=this.slots[this.head];this.bytes-=u.length*2,this.slots[this.head]=void 0,this.head=(this.head+1)%this.maxEvents,this.count--,this.evicted++}this.slots[(this.head+this.count)%this.maxEvents]=l,this.count++,this.bytes+=l.length*2}catch{this.failures++}}action(){return this.enabled&&!this.closed?`${this.sessionId}:${++this.actions}`:void 0}snapshot(){const e=[];try{for(let n=0;n<this.count;n++)e.push(JSON.parse(this.slots[(this.head+n)%this.maxEvents]))}catch{this.failures++}let t="unknown";try{t=this.version()}catch{this.failures++}return{schemaVersion:1,sessionId:this.sessionId,version:t,enabled:this.enabled,events:e,retainedBytes:this.bytes,evictedEvents:this.evicted,truncatedEvents:this.truncated,captureFailures:this.failures}}clear(){this.slots=[],this.head=0,this.count=0,this.bytes=0,this.evicted=0,this.truncated=0,this.failures=0,this.lastSelection=void 0}attach(e){if(this.enabled)for(const t of["keydown","beforeinput","compositionstart","compositionend","paste","cut","drop"]){const n=r=>this.record(`input:${t}`,()=>{var o;const i=r;if(r.type==="keydown"){const s=r;return{inputKind:["Backspace","Delete","Enter","Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(s.key)?s.key:"key",dataLength:s.key.length===1?1:void 0,isComposing:s.isComposing}}return{inputType:i.inputType,dataLength:(o=i.data)==null?void 0:o.length,isComposing:i.isComposing,...this.captureContent?{data:i.data}:{}}});try{e.addEventListener(t,n,!0),this.cleanups.push(()=>e.removeEventListener(t,n,!0))}catch{this.failures++}}}close(){this.closed=!0;for(const e of this.cleanups)try{e()}catch{this.failures++}this.cleanups=[]}},PD=()=>({schemaVersion:1,sessionId:"unavailable",version:"unknown",enabled:!1,events:[],retainedBytes:0,evictedEvents:0,truncatedEvents:0,captureFailures:1}),_K=Object.freeze({getSnapshot:PD,clear(){}});function CK(e,t,n,r){try{const i=new kK(t,n);v1.set(e,i),i.attach(r);const o=Object.freeze({getSnapshot:()=>{try{return i.snapshot()}catch{return PD()}},clear:()=>{try{i.clear()}catch{}}});return i.record("instance:created",()=>({})),o}catch{return _K}}
460function b1(e,t,n){var r;try{e&&((r=v1.get(e))==null||r.record(t,n))}catch{}}function SK(e,t,n){try{const r=v1.get(e),i=r==null?void 0:r.action();return i&&(r==null||r.record(t,()=>({...n(),actionId:i}))),i}catch{return}}function EK(e){var t;try{(t=v1.get(e))==null||t.close(),v1.delete(e)}catch{}}var AK={BLOCK_SDT_LABEL:"superdoc-structured-content__label"},TK=e=>{if(!e)return{kind:"unknown"};if(e==="body")return{kind:"body"};const t=e.indexOf(":"),n=t===-1?e:e.slice(0,t),r=t===-1?void 0:e.slice(t+1);switch(n){case"body":case"header":case"footer":case"footnote":case"endnote":case"textbox":return r?{kind:n,id:r}:{kind:n};default:return{kind:"unknown"}}};function IK(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null||Array.isArray(e)!==Array.isArray(t))return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}var BD=".png,.jpg,.jpeg,image/png,image/jpeg",jD=new Set(["image/png","image/jpeg","image/jpg"]),RK=/\.(png|jpe?g)$/i;function FD(e){if(!e)return!1;const t=typeof e.type=="string"?e.type.toLowerCase():"";return t?jD.has(t):RK.test(String(e.name??""))}function HA(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(OK(String(r.result),e)),r.onerror=()=>n(r.error??new Error("image-read-failed")),r.readAsDataURL(e)})}function OK(e,t){const n=/^data:([^;,]*);base64,/.exec(e);if(!n)return e;const r=n[1].toLowerCase();if(jD.has(r))return e;const i=String((t==null?void 0:t.name)??""),o=/\.jpe?g$/i.test(i)?"image/jpeg":/\.png$/i.test(i)?"image/png":null;return o?`data:${o};base64,${e.slice(n[0].length)}`:e}async function NK(e,t){if(typeof t=="function"){const n=await t(e);if(typeof n!="string"||n.trim()==="")throw new Error("handleImageUpload returned an empty result");return n.startsWith("data:")?n:MK(n,e)}return HA(e)}async function MK(e,t){const n=await fetch(e);if(!n.ok)throw new Error(`image fetch failed: ${n.status}`);const r=await n.blob(),i=(/\.(?:png|jpe?g)(?:$|[?#])/i.test(e)?e.split(/[?#]/)[0]:"")||(t==null?void 0:t.name)||"";return HA(i?Object.assign(r,{name:i}):r)}function DK({ownerDocument:e=document,onPick:t,onError:n}={}){var i;const r=e.createElement("input");return r.type="file",r.accept=BD,r.hidden=!0,r.tabIndex=-1,r.setAttribute("data-superdoc-image-picker","true"),r.setAttribute("aria-hidden","true"),r.addEventListener("change",()=>{const o=r.files&&r.files[0];if(r.value="",!!o){if(!FD(o)){n==null||n(new Error(`unsupported image type: ${o.type||o.name}`));return}try{const s=t==null?void 0:t(o);s&&typeof s.then=="function"&&s.catch(l=>n==null?void 0:n(l))}catch(s){n==null||n(s)}}}),(i=e.body)==null||i.appendChild(r),{input:r,open(){r.click()},destroy(){r.remove()}}}var LK={class:"sd-watermark__body"},PK={class:"sd-watermark__settings"},BK=["disabled"],jK={class:"sd-watermark__field"},FK=["value"],zK=["value"],UK={class:"sd-watermark__field"},VK=["value"],HK=["disabled"],$K={class:"sd-watermark__selection-list"},GK=["value","checked","onChange"],qK=["disabled"],WK={key:0,class:"sd-watermark__notice"},KK={key:1,class:"sd-watermark__notice"},YK=["disabled"],XK={class:"sd-watermark__types"},ZK=["name","value","checked","onChange"],QK={class:"sd-watermark__field"},JK=["value"],eY={class:"sd-watermark__presets","aria-label":"Text presets"},tY=["onClick"],nY={class:"sd-watermark__font-row"},rY={class:"sd-watermark__field"},iY=["value"],oY=["value"],sY={class:"sd-watermark__field sd-watermark__size"},aY=["list","value"],lY=["id"],cY=["value"],uY={class:"sd-watermark__styles"},dY=["aria-pressed"],fY=["aria-pressed"],hY={class:"sd-watermark__field sd-watermark__font-color"},pY={class:"sd-watermark__color"},mY=["value"],gY=["value"],yY={class:"sd-watermark__picture"},vY=["src"],bY=["accept"],wY={class:"sd-watermark__field"},xY=["value"],kY={key:0,value:"custom",disabled:""},_Y=["value"],CY={class:"sd-watermark__check"},SY=["checked"],EY={class:"sd-watermark__check"},AY=["checked"],TY={key:2,class:"sd-watermark__field sd-watermark__transparency"},IY=["for"],RY={class:"sd-watermark__range"},OY=["id","value"],NY=["value"],MY={key:3,class:"sd-watermark__orientation"},DY=["name","value","checked","onChange"],LY={key:4,class:"sd-watermark__notice"},PY={key:5,class:"sd-watermark__notice"},BY=["aria-busy"],jY={class:"sd-watermark__page"},FY=["src","width","height"],zY={key:1},UY={class:"sd-watermark__impact"},VY={key:0,class:"sd-watermark__impact-details"},HY={key:0,class:"sd-watermark__error",role:"alert"},$Y=["disabled"],GY={class:"sd-watermark__footer sd-dialog-footer"},qY={role:"status","aria-live":"polite"},WY={class:"sd-watermark__actions"},KY=["disabled"],YY=li(m1({__name:"WatermarkSurface",props:{model:{},surfaceId:{default:""},mode:{},request:{},resolve:{},close:{type:Function,default:()=>{}}},setup(e){const t=e,n=Zs(t.model.getSnapshot()),r=Ne(null),i=Ne(!1),o=Ne("");let s=0,l;const u=["DRAFT","CONFIDENTIAL","DO NOT COPY"],d=[{value:"none",label:"No watermark"},{value:"text",label:"Text"},{value:"picture",label:"Picture"}],f=dt(()=>n.value.phase==="loading"||n.value.phase==="applying"),p=dt(()=>!f.value&&!n.value.readonlyReason),m=dt(()=>n.value.canApply&&!f.value&&!i.value&&!n.value.stale),y=dt(()=>o.value||n.value.error),b=dt(()=>i.value?"Preparing picture…":n.value.phase==="loading"?"Loading watermarks…":n.value.phase==="applying"?"Applying changes; closing will not cancel them.":n.value.phase==="previewing"?"Updating preview…":n.value.dirty?"Changes apply when you choose Apply":"No changes"),k=dt(()=>{const{fonts:ee,draft:F}=n.value;return ee.some(H=>H.value===F.fontFamily)?ee:[{value:F.fontFamily,label:F.fontFamily},...ee]});function S(){s+=1,i.value=!1}function x(ee){p.value&&(o.value="",t.model.patchDraft(ee))}function T(ee,F){const H=ee.target.value;S(),t.model.setScope(F==="section"?H||null:n.value.sectionId,F==="variant"?H:n.value.variant)}function C(ee,F){S();const H=new Set(n.value.selectedIds);F.target.checked?H.add(ee):H.delete(ee),t.model.selectWatermarks([...H])}async function I(ee){var M;const F=ee.target,H=(M=F.files)==null?void 0:M[0];
460if(F.value="",!H||!p.value)return;if(S(),o.value="",!FD(H)){o.value="Choose a PNG or JPEG picture.";return}const te=s;i.value=!0;try{const Z=await HA(H);if(te!==s)return;x({src:Z,pictureName:H.name,kind:"picture"})}catch{te===s&&(o.value="The picture could not be read. Choose it again.")}finally{te===s&&(i.value=!1)}}async function D(){if(m.value)try{await t.model.apply()}catch{o.value="The watermark could not be applied. Try again."}}async function P(){S(),o.value="";try{await t.model.reload()}catch{o.value="Watermarks could not be loaded. Try again."}}function V(){S(),t.close("user-cancelled")}return pr([()=>n.value.draft.kind,()=>n.value.sectionId,()=>n.value.variant,()=>n.value.selectedIds.join("\0")],S),po(()=>{l=t.model.subscribe(ee=>{n.value=ee}),n.value=t.model.getSnapshot()}),Hs(()=>{S(),l==null||l()}),(ee,F)=>{var H;return Ze(),ut("form",{class:"sd-watermark sd-dialog-content",onSubmit:Gr(D,["prevent"])},[et("header",{class:"sd-watermark__header sd-dialog-header"},[F[17]||(F[17]=et("h2",null,"Watermark",-1)),et("button",{type:"button",class:"sd-dialog-close","aria-label":"Close watermark dialog",onClick:V},[...F[16]||(F[16]=[et("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true"},[et("path",{d:"m4 4 8 8m0-8-8 8",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])])]),et("div",LK,[et("div",PK,[et("fieldset",{class:"sd-watermark__scope",disabled:f.value},[F[22]||(F[22]=et("legend",{class:"sd-watermark__sr-only"},"Watermark scope",-1)),et("label",jK,[F[19]||(F[19]=et("span",null,"Apply to",-1)),et("select",{"aria-label":"Apply to",value:n.value.sectionId??"",onChange:F[0]||(F[0]=te=>T(te,"section"))},[F[18]||(F[18]=et("option",{value:""},"Entire document",-1)),(Ze(!0),ut(Dr,null,ki(n.value.sections,te=>(Ze(),ut("option",{key:te.id,value:te.id},Un(te.label),9,zK))),128))],40,FK)]),et("label",UK,[F[21]||(F[21]=et("span",null,"Page type",-1)),et("select",{"aria-label":"Page type",value:n.value.variant,onChange:F[1]||(F[1]=te=>T(te,"variant"))},[...F[20]||(F[20]=[et("option",{value:"all"},"All applicable",-1),et("option",{value:"default"},"Default",-1),et("option",{value:"first"},"First",-1),et("option",{value:"even"},"Even",-1)])],40,VK)])],8,BK),n.value.items.length>1?(Ze(),ut("fieldset",{key:0,class:"sd-watermark__selection",disabled:f.value},[F[23]||(F[23]=et("legend",null,"Watermarks to edit",-1)),et("div",$K,[(Ze(!0),ut(Dr,null,ki(n.value.items,te=>(Ze(),ut("label",{key:te.id,class:"sd-watermark__check"},[et("input",{type:"checkbox",value:te.id,checked:n.value.selectedIds.includes(te.id),onChange:M=>C(te.id,M)},null,40,GK),et("span",null,[Md(Un(te.label),1),et("small",null,Un(te.locations),1)])]))),128))]),et("button",{type:"button",disabled:!p.value,onClick:F[2]||(F[2]=te=>e.model.selectWatermarks([]))},"Add watermark",8,qK),n.value.selectedIds.length>1?(Ze(),ut("p",WK," Applying uses the settings below for all "+Un(n.value.selectedIds.length)+" selected copies. ",1)):gn("",!0)],8,HK)):gn("",!0),n.value.readonlyReason?(Ze(),ut("p",KK,Un(n.value.readonlyReason),1)):gn("",!0),et("fieldset",{class:Wr(["sd-watermark__draft",{"sd-watermark__draft--text":n.value.draft.kind==="text"}]),disabled:!p.value},[F[40]||(F[40]=et("legend",{class:"sd-watermark__sr-only"},"Watermark settings",-1)),et("fieldset",XK,[F[24]||(F[24]=et("legend",{class:"sd-watermark__sr-only"},"Watermark type",-1)),(Ze(),ut(Dr,null,ki(d,te=>et("label",{key:te.value,class:Wr({"is-selected":n.value.draft.kind===te.value})},[et("input",{type:"radio",name:`watermark-type-${e.surfaceId}`,value:te.value,checked:n.value.draft.kind===te.value,onChange:M=>x({kind:te.value})},null,40,ZK),et("span",null,Un(te.value==="none"&&n.value.items.length>1&&n.value.selectedIds.length?"Remove selected":te.label),1)],2)),64))]),n.value.draft.kind==="text"?(Ze(),ut(Dr,{key:0},[et("label",QK,[F[25]||(F[25]=et("span",null,"Text",-1)),et("input",{"aria-label":"Watermark text",type:"text",value:n.value.draft.text,onInput:F[3]||(F[3]=te=>x({text:te.target.value}))},null,40,JK)]),et("div",eY,[(Ze(),ut(Dr,null,ki(u,te=>et("button",{key:te,type:"button",onClick:M=>x({text:te})},Un(te),9,tY)),64))]),et("div",nY,[et("label",rY,[F[26]||(F[26]=et("span",null,"Font",-1)),et("select",{"aria-label":"Font",value:n.value.draft.fontFamily,onChange:F[4]||(F[4]=te=>
460x({fontFamily:te.target.value}))},[(Ze(!0),ut(Dr,null,ki(k.value,te=>(Ze(),ut("option",{key:te.value,value:te.value},Un(te.label),9,oY))),128))],40,iY)]),et("label",sY,[F[28]||(F[28]=et("span",null,"Size (pt)",-1)),et("input",{"aria-label":"Font size",list:`watermark-sizes-${e.surfaceId}`,value:n.value.draft.fontSize==="auto"?"Auto":n.value.draft.fontSize,onChange:F[5]||(F[5]=te=>x({fontSize:te.target.value.toLowerCase()==="auto"?"auto":Number(te.target.value)}))},null,40,aY),et("datalist",{id:`watermark-sizes-${e.surfaceId}`},[F[27]||(F[27]=et("option",{value:"Auto"},null,-1)),(Ze(),ut(Dr,null,ki([24,36,48,72,96],te=>et("option",{key:te,value:te},null,8,cY)),64))],8,lY)]),et("div",uY,[et("button",{type:"button","aria-label":"Bold","aria-pressed":n.value.draft.bold,onClick:F[6]||(F[6]=te=>x({bold:!n.value.draft.bold}))},[...F[29]||(F[29]=[et("b",null,"B",-1)])],8,dY),et("button",{type:"button","aria-label":"Italic","aria-pressed":n.value.draft.italic,onClick:F[7]||(F[7]=te=>x({italic:!n.value.draft.italic}))},[...F[30]||(F[30]=[et("i",null,"I",-1)])],8,fY)])]),et("label",hY,[F[31]||(F[31]=et("span",null,"Font color",-1)),et("span",pY,[et("input",{type:"color","aria-label":"Choose font color",value:n.value.draft.color,onInput:F[8]||(F[8]=te=>x({color:te.target.value}))},null,40,mY),et("input",{type:"text","aria-label":"Font color",value:n.value.draft.color,spellcheck:"false",onInput:F[9]||(F[9]=te=>x({color:te.target.value}))},null,40,gY)])])],64)):gn("",!0),n.value.draft.kind==="picture"?(Ze(),ut(Dr,{key:1},[et("div",yY,[n.value.draft.src?(Ze(),ut("img",{key:0,src:n.value.draft.src,alt:"Selected picture"},null,8,vY)):gn("",!0),et("div",null,[et("strong",null,Un(n.value.draft.pictureName||"No picture selected"),1),F[32]||(F[32]=et("small",null,"PNG or JPEG",-1))]),et("button",{type:"button",onClick:F[10]||(F[10]=te=>{var M;return(M=r.value)==null?void 0:M.click()})},Un(n.value.draft.pictureName?"Replace picture":"Choose picture"),1),et("input",{ref_key:"fileInput",ref:r,type:"file",accept:Yt(BD),"aria-label":"Choose watermark picture",hidden:"",onChange:I},null,40,bY)]),et("label",wY,[F[34]||(F[34]=et("span",null,"Scale",-1)),et("select",{"aria-label":"Picture scale",value:n.value.draft.customSize?"custom":n.value.draft.scalePercent,onChange:F[11]||(F[11]=te=>x({scalePercent:te.target.value==="auto"?"auto":Number(te.target.value)}))},[n.value.draft.customSize?(Ze(),ut("option",kY,"Custom size retained")):gn("",!0),F[33]||(F[33]=et("option",{value:"auto"},"Auto",-1)),(Ze(),ut(Dr,null,ki([50,100,150,200,500],te=>et("option",{key:te,value:te},Un(te)+"%",9,_Y)),64))],40,xY)]),et("label",CY,[et("input",{type:"checkbox",checked:n.value.draft.lockAspectRatio,onChange:F[12]||(F[12]=te=>x({lockAspectRatio:te.target.checked}))},null,40,SY),F[35]||(F[35]=et("span",null,"Preserve aspect ratio",-1))]),et("label",EY,[et("input",{type:"checkbox",checked:n.value.draft.washout,onChange:F[13]||(F[13]=te=>x({washout:te.target.checked}))},null,40,AY),F[36]||(F[36]=et("span",null,[Md("Washout"),et("small",null,"Lighten the picture's colors.")],-1))])],64)):gn("",!0),n.value.draft.kind!=="none"?(Ze(),ut("div",TY,[et("label",{for:`watermark-transparency-${e.surfaceId}`},"Transparency",8,IY),et("div",RY,[et("input",{id:`watermark-transparency-${e.surfaceId}`,type:"range",min:"0",max:"100",step:"1","aria-label":"Transparency",value:n.value.draft.transparency,onInput:F[14]||(F[14]=te=>x({transparency:Number(te.target.value)}))},null,40,OY),et("label",null,[et("input",{type:"number",min:"0",max:"100",step:"any","aria-label":"Transparency percentage",value:n.value.draft.transparency,onInput:F[15]||(F[15]=te=>x({transparency:Number(te.target.value)}))},null,40,NY),F[37]||(F[37]=et("span",null,"%",-1))])]),F[38]||(F[38]=et("small",null,"0% opaque, 100% transparent",-1))])):gn("",!0),n.value.draft.kind!=="none"?(Ze(),ut("fieldset",MY,[F[39]||(F[39]=et("legend",null,"Orientation",-1)),(Ze(),ut(Dr,null,ki(["horizontal","diagonal"],te=>et("label",{key:te},[et("input",{type:"radio",name:`watermark-orientation-${e.surfaceId}`,value:te,checked:!n.value.draft.customOrientation&&n.value.draft.orientation===te,onChange:M=>x({orientation:te})},null,40,DY),et("span",null,Un(te==="horizontal"?"Horizontal":"Diagonal"),1)])),64))])):gn("",!0),n.value.draft.customPlacement?(Ze(),ut("p",LY,"Custom placement retained.")):gn("",!0),n.value.draft.kind==="none"?(Ze(),ut("p",PY,Un(n.value.selectedIds.length?"The selected watermark will be removed when you apply.":"Choose Text or Picture to add a watermark."),1)):gn("",!0)],10,YK)]),et("aside",{class:"sd-watermark__preview","aria-label":"Watermark preview","aria-busy":n.value.phase==="previewing"},[F[41]||(F[41]=et("h3",null,"Preview",-1)),et("div",jY,[n.value.preview?(Ze(),ut("img",{key:0,src:n.value.preview.url,width:n.value.preview.width,height:n.value.preview.height,alt:"Watermark on a 
460sample page"},null,8,FY)):(Ze(),ut("p",zY,Un(n.value.phase==="loading"||n.value.phase==="previewing"?"Preparing preview…":n.value.draft.kind==="none"?"No watermark in this preview":"Preview unavailable"),1))]),F[42]||(F[42]=et("p",{class:"sd-watermark__caption"},"Preview at the selected page size",-1)),et("p",UY,Un(n.value.impact),1),(H=n.value.impactDetails)!=null&&H.length?(Ze(),ut("details",VY,[et("summary",null,"View "+Un(n.value.impactDetails.length)+" affected locations",1),et("ul",null,[(Ze(!0),ut(Dr,null,ki(n.value.impactDetails,te=>(Ze(),ut("li",{key:te},Un(te),1))),128))])])):gn("",!0)],8,BY)]),y.value||n.value.stale?(Ze(),ut("div",HY,[et("p",null,Un(y.value||"The document changed. Review the latest state before applying."),1),n.value.stale||n.value.error?(Ze(),ut("button",{key:0,type:"button",disabled:f.value,onClick:P}," Review latest state ",8,$Y)):gn("",!0)])):gn("",!0),et("footer",GY,[et("p",qY,Un(b.value),1),et("div",WY,[et("button",{type:"button",class:"sd-dialog-secondary",onClick:V},"Cancel"),et("button",{type:"submit",class:"sd-watermark__apply sd-dialog-primary",disabled:!m.value},Un(n.value.phase==="applying"?"Applying…":n.value.draft.kind==="none"?n.value.items.length>1?"Remove selected watermark":"Remove watermark":"Apply watermark"),9,KY)])])],32)}}}),[["__scopeId","data-v-df56c82c"]]);function XY(e){let t=null,n=!1;return{component:YY,captureFocusReturn(){var u,d;const r=(u=e==null?void 0:e())==null?void 0:u.ownerDocument,i=r==null?void 0:r.activeElement,o=(i==null?void 0:i.closest('[data-sd-part="toolbar-item"]'))??(i==null?void 0:i.querySelector('[data-sd-part="toolbar-item"]')),s=(d=o==null?void 0:o.closest('[data-sd-part="toolbar"]'))==null?void 0:d.parentElement,l=o==null?void 0:o.querySelector('[data-item="btn-watermark"], [data-item="btn-overflow"]');return async f=>{var m;if(await Sn(),n||!f()||!l||i!=null&&i.isConnected||!(s!=null&&s.isConnected)||(r==null?void 0:r.activeElement)!==(r==null?void 0:r.body))return;const p=s.querySelector('[data-sd-part="toolbar"]');for(const y of["watermark","overflow"]){const b=(m=p==null?void 0:p.querySelector(`[data-item="btn-${y}"]`))==null?void 0:m.closest('[data-sd-part="toolbar-item"]');if(b instanceof HTMLElement&&b.getClientRects().length&&b.getAttribute("aria-disabled")!=="true"){b.focus({preventScroll:!0});return}}}},mount(){const r=e==null?void 0:e();n||t||!(r!=null&&r.ownerDocument)||(t=r.ownerDocument.createElement("div"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap"}),r.appendChild(t))},announce(r){!n&&t&&(t.textContent=r)},destroy(){n=!0,t==null||t.remove(),t=null}}}function zD(e){const t=(e==null?void 0:e.rotationDegrees)!=null&&![0,315].includes(e.rotationDegrees);return{customOrientation:t,customPlacement:!!(t||(e==null?void 0:e.behindText)===!1||e!=null&&e.horizontal&&(e.horizontal.alignment!=="center"||e.horizontal.offsetPt)||e!=null&&e.vertical&&(e.vertical.alignment!=="center"||e.vertical.offsetPt))}}function Iw(e){const t=e==null?void 0:e.watermark,n=t!=null&&t.placement?structuredClone(t.placement):void 0,r=(t==null?void 0:t.kind)==="picture"?t:void 0,i=(t==null?void 0:t.kind)==="text"?t:void 0,o=(n==null?void 0:n.rotationDegrees)??(r||(i==null?void 0:i.orientation)==="horizontal"?0:315);return{kind:(t==null?void 0:t.kind)??"none",geometryKind:(t==null?void 0:t.kind)??null,text:(i==null?void 0:i.text)??"DRAFT",fontFamily:(i==null?void 0:i.fontFamily)??"Calibri",fontSize:(i==null?void 0:i.fontSizePt)??"auto",bold:(i==null?void 0:i.bold)??!1,italic:(i==null?void 0:i.italic)??!1,color:(i==null?void 0:i.color)??"#C0C0C0",transparency:(1-((t==null?void 0:t.opacity)??.5))*100,orientation:o===0?"horizontal":"diagonal",scalePercent:(r==null?void 0:r.scalePercent)??"auto",washout:(r==null?void 0:r.washout)??!0,lockAspectRatio:(r==null?void 0:r.lockAspectRatio)??!0,pictureName:r?"Image in this document":"",sourceWatermarkId:r?e==null?void 0:e.watermarkId:void 0,widthPt:r==null?void 0:r.widthPt,heightPt:r==null?void 0:r.heightPt,placement:n,...zD(n),customSize:!!(r&&((n==null?void 0:n.widthPt)!=null||r.widthPt!=null))}}function ZY(e,t){const n={...e,...t};if(t.kind&&t.kind!=="none"&&(t.kind!==e.geometryKind&&(n.placement=void 0,n.widthPt=void 0,n.heightPt=void 0,n.customSize=!1,n.orientation=t.kind==="picture"?"horizontal":"diagonal"),n.geometryKind=t.kind),t.orientation!==void 0&&(n.placement={...n.placement,rotationDegrees:t.orientation==="diagonal"?315:0}),t.scalePercent!==void 0||t.src!==void 0){const{widthPt:r,heightPt:i,...o}=n.placement??{};n.placement=Object.keys(o).length?o:void 0,n.widthPt=void 0,n.heightPt=void 0,n.customSize=!1}return{...n,...zD(n.placement)}}function QY(e){return e.kind==="none"?null:!Number.isFinite(e.transparency)||e.transparency<0||e.transparency>100?"Transparency must be between 0 and 100%.":e.kind==="picture"?e.src||e.sourceWatermarkId?null:"Choose a picture.":e.text.trim()?e.fontSize!=="auto"&&(!Number.isFinite(e.fontSize)||e.fontSize<=0)?"Enter a positive font size or choose Auto.":/^#[\da-f]{6}$/i.test(e.color)?e.fontFamily.trim()?null:"Choose a font.":"Enter a six-digit hex color.":"Enter watermark text."}function L6(e){const t={opacity:1-e.transparency/100,...e.placement?{placement:e.placement}:{}};if(e.kind==="text")return{kind:"text",text:e.text,fontFamily:e.fontFamily,fontSizePt:e.fontSize,bold:e.bold,italic:e.italic,color:e.color,orientation:e.orientation,...t};if(e.kind!=="picture")throw new Error("A removal has no watermark input.");return{kind:"picture",...e.src?{src:e.src}:{source:{kind:"existing",watermarkId:e.sourceWatermarkId}},scalePercent:e.scalePercent,washout:e.washout,lockAspectRatio:e.lockAspectRatio,...e.widthPt!=null?{widthPt:e.widthPt}:{},...e.heightPt!=null?{heightPt:e.heightPt}:{},...t}}var JY={default:"Default pages",first:"First page",even:"Even pages"},Rw="The document changed while this dialog was open. Review the latest watermark before applying.";
460function P6(e,t,n){return e.filter(r=>t==null||r.address.sectionId===t).flatMap(r=>(n==="all"?["default",...r.titlePage?["first"]:[],...r.oddEvenHeadersFooters?["even"]:[]]:[n]).map(i=>({kind:"headerFooterSlot",section:r.address,headerFooterKind:"header",variant:i})))}function B6(e){return`${e.section.sectionId}:${e.variant}`}function Ow(e){return e instanceof Error?e.message:"The watermark could not be updated. Try again."}function eX(e){const t=XY(e.getContainer),n={...e,announce:u=>{var d;t.announce(u),(d=e.announce)==null||d.call(e,u)}};let r=null,i=!1,o=0;function s(){const u=r;r=null,u==null||u.dispose(),u==null||u.handle.close()}function l(){var y,b,k,S;if(i)return{ok:!1,reason:"not-ready"};const u=e.getEditor();if(!u)return{ok:!1,reason:"not-ready"};if(!((b=(y=u.doc)==null?void 0:y.watermarks)!=null&&b.list)||!((k=u.doc.sections)!=null&&k.list))return{ok:!1,reason:"document-api-unavailable"};if(!e.openSurface||!u.doc.watermarks.apply||!((S=u.host)!=null&&S.watermarkPreview))return{ok:!1,reason:"operation-unavailable"};const d=++o,f=t.captureFocusReturn();s(),t.mount();const p=tX(u,n,()=>{(r==null?void 0:r.handle)===m&&s()});let m;try{m=e.openSurface({mode:"dialog",ariaLabel:"Watermark",component:t.component,props:{model:p.model},dialog:{maxWidth:700}})}catch{return p.dispose(),{ok:!1,reason:"operation-unavailable"}}return r={handle:m,dispose:p.dispose},m.result.then(x=>{p.dispose(),(r==null?void 0:r.handle)===m&&(r=null),(x.status==="closed"||x.status==="submitted")&&f(()=>!i&&d===o&&r===null)}),p.model.reload(),{ok:!0}}return{open:l,close:s,destroy(){i=!0,s(),t.destroy()}}}function tX(e,t,n){var H,te;const r=new Set;let i=!0,o=0,s,l=[],u=[],d="",f=JSON.stringify(Iw()),p=null,m={phase:"loading",draft:Iw(),sections:[],sectionId:null,variant:"all",items:[],selectedIds:[],fonts:[...t.getFonts()],dirty:!1,canApply:!1,error:null,stale:!1,readonlyReason:null,impact:"",impactDetails:[],preview:null};const y=M=>i&&M===o&&t.getEditor()===e,b=()=>t.getMode()==="editing";function k(M){if(i){m={...m,...M};for(const Z of r)Z(m)}}function S(){return clearTimeout(s),p=null,++o}function x(M){const Z=u.find(W=>W.address.sectionId===M.section.sectionId),L=M.variant==="first"?!(Z!=null&&Z.titlePage):M.variant==="even"?!(Z!=null&&Z.oddEvenHeadersFooters):!1;return`Section ${((Z==null?void 0:Z.index)??0)+1}, ${JY[M.variant].toLowerCase()}${L?" (inactive)":""}`}function T(){if(m.sectionId==null&&m.variant==="all")return l;const M=new Set(P6(u,m.sectionId,m.variant).map(B6));return l.filter(Z=>Z.effectiveIn.some(L=>M.has(B6(L))))}function C(){k({items:T().map(M=>({id:M.watermarkId,label:M.watermark.kind==="text"?M.watermark.text:"Picture watermark",locations:M.effectiveIn.map(x).join("; ")}))})}function I(){const M=m.sectionId==null&&m.variant==="all"?{kind:"document"}:{kind:"headerFooterSlots",slots:P6(u,m.sectionId,m.variant)};if(m.draft.kind==="none")return{target:M,action:"remove",watermarkIds:m.selectedIds};const Z=L6(m.draft);if(m.selectedIds.length)return{target:M,action:"replace",watermarkIds:m.selectedIds,watermark:Z};if("source"in Z)throw new Error("Select the existing picture watermark in this scope, or choose a new picture.");return{target:M,action:"insert",watermark:Z}}function D(M){var L,W;if(M.success)return!1;const Z=((L=M.failure)==null?void 0:L.code)==="REVISION_MISMATCH";return k({stale:Z,phase:"editing",canApply:!1,error:Z?Rw:((W=M.failure)==null?void 0:W.message)??"The watermark could not be updated."}),!0}async function P(M){var Z;try{const L=QY(m.draft);if(L){k({phase:"editing",error:L,canApply:!1,preview:null});return}const W=m.draft.kind==="none"&&!m.selectedIds.length?null:I(),U=m.draft.kind==="none"?null:await e.host.watermarkPreview({watermark:L6(m.draft),sectionId:m.sectionId??((Z=u[0])==null?void 0:Z.address.sectionId),expectedRevision:d});if(!y(M))return;if(!W||!m.dirty||!b()){k({phase:"editing",preview:U,canApply:!1,error:null});return}const q=await e.doc.watermarks.apply(W,{expectedRevision:d,dryRun:!0});if(!y(M))return;if(!q.success){D(q);return}p=W;const Q=q.affectedSlots.map(x);k({phase:"editing",preview:U,error:null,canApply:Q.length>0&&!m.stale&&b(),impact:Q.length?`Changes: ${Q.length>3?`${Q.length} page locations`:Q.join("; ")}. Other locations stay as they are.`:"No matching watermark will change.",impactDetails:Q.length>3?Q:[]})}catch(L){y(M)&&k({phase:"editing",error:Ow(L),canApply:!1,preview:null})}}function V(){const M=S();k({phase:"previewing",canApply:!1,error:null,impact:"",impactDetails:[],preview:null}),s=setTimeout(()=>{P(M)},120)}const ee={getSnapshot:()=>m,subscribe(M){return r.add(M),M(m),()=>{r.delete(M)}},async reload(){const M=S();k({phase:"loading",canApply:!1,stale:!1,error:null,impactDetails:[],preview:null});try{const[Z,L]=await Promise.all([e.doc.watermarks.list(),e.doc.sections.list()]);if(!y(M))return;if(Z.items.length!==Z.total||L.items.length!==L.total)throw new Error("The complete watermark scope could not be loaded.");if(L.evaluatedRevision&&L.evaluatedRevision!==Z.evaluatedRevision)throw new Error(Rw);l=Z.items,u=L.items,d=Z.evaluatedRevision;const W=T(),U=W.length===1?W[0]:void 0,q=Iw(U);f=JSON.stringify(q),k({draft:q,dirty:!1,selectedIds:U?[U.watermarkId]:[],sections:u.map(Q=>({id:Q.address.sectionId,label:`Section ${Q.index+1}`})),readonlyReason:b()?null:t.getMode()==="suggesting"?"Watermarks cannot be changed in Suggesting mode.":"This document is read-only.",impact:W.length>1?"Select the watermark copies you want to edit, or add a new watermark.":""}),C(),await P(M)}catch(Z){y(M)&&k({phase:"editing",error:Ow(Z),canApply:!1})}}
460,patchDraft(M){if(!i||m.phase==="loading"||m.phase==="applying"||!b())return;const Z=ZY(m.draft,M);k({draft:Z,dirty:JSON.stringify(Z)!==f}),V()},setScope(M,Z){if(!i||m.phase==="loading"||m.phase==="applying"||M!=null&&!u.some(q=>q.address.sectionId===M))return;k({sectionId:M,variant:Z}),C();const L=T(),W=new Set(L.map(q=>q.watermarkId));let U=m.selectedIds.filter(q=>W.has(q));m.dirty&&m.draft.kind==="none"&&!U.length&&L.length===1&&(U=[L[0].watermarkId]),k({selectedIds:U}),m.dirty?V():ee.selectWatermarks(L.length===1?[L[0].watermarkId]:[])},selectWatermarks(M){if(!i||m.phase==="loading"||m.phase==="applying")return;const Z=T(),L=[...new Set(M)].filter(U=>Z.some(q=>q.watermarkId===U)),W=Iw(Z.find(U=>U.watermarkId===L[0]));f=JSON.stringify(W),k({selectedIds:L,draft:W,dirty:!1}),V()},async apply(){var L,W,U,q;if(!i||!m.canApply||!p||!b()||t.getEditor()!==e)return;const M=p,Z=S();k({phase:"applying",canApply:!1,error:null}),(L=t.announce)==null||L.call(t,"Applying watermark changes. Closing the dialog will not cancel them.");try{const Q=await e.doc.watermarks.apply(M,{expectedRevision:d});if(!y(Z)){(W=t.announce)==null||W.call(t,Q.success?"Watermark updated.":"The watermark could not be updated.");return}if(D(Q))return;(U=t.announce)==null||U.call(t,M.action==="remove"?"Watermark removed.":"Watermark updated."),n()}catch(Q){y(Z)?k({phase:"editing",error:Ow(Q),canApply:!1}):(q=t.announce)==null||q.call(t,Ow(Q))}}},F=(te=(H=e.host)==null?void 0:H.events)==null?void 0:te.subscribe(M=>{if(!(!i||m.phase==="applying")){if(M.type==="collaboration:document-replaced"){S(),k({phase:"editing",stale:!0,canApply:!1,error:Rw});return}["document:mutated","mutation:committed","collaboration:remote-changed"].includes(M.type)&&(S(),m.dirty?k({phase:"editing",stale:!0,canApply:!1,error:Rw}):s=setTimeout(()=>{ee.reload()},120))}});return{model:ee,dispose(){i=!1,S(),F==null||F(),r.clear()}}}function nX(e){if(!e||typeof e!="object")return{};const t={};e.fonts&&(t.rFonts={ascii:e.fonts.ascii,hAnsi:e.fonts.hAnsi,eastAsia:e.fonts.eastAsia,cs:e.fonts.cs,asciiTheme:e.fonts.asciiTheme,hAnsiTheme:e.fonts.hAnsiTheme,eastAsiaTheme:e.fonts.eastAsiaTheme,csTheme:e.fonts.csTheme,hint:e.fonts.hint}),e.fontFamily!=null&&(t.fontFamily=e.fontFamily),e.lang&&(t.lang={val:e.lang.val,eastAsia:e.lang.eastAsia,bidi:e.lang.bidi}),e.fontSize!=null&&(t.fontSize=e.fontSize),e.fontSizeCs!=null&&(t.fontSizeCs=e.fontSizeCs);const n=pk(e.color);n!=null&&(t.color=n),e.highlight!=null&&(t.highlight=e.highlight);const r=iX(e.shading);r&&(t.shading=r),e.cs!=null&&(t.cs=e.cs),e.rtl!=null&&(t.rtl=e.rtl),e.bold!=null&&(t.bold=e.bold),e.boldCs!=null&&(t.bCs=e.boldCs),e.italic!=null&&(t.italic=e.italic),e.italicCs!=null&&(t.iCs=e.italicCs);const i=rX(e.underline);i!==void 0&&(t.underline=i),e.strikethrough!=null&&(t.strike=e.strikethrough),e.doubleStrikethrough!=null&&(t.dstrike=e.doubleStrikethrough),e.caps!=null&&(t.caps=e.caps),e.smallCaps!=null&&(t.smallCaps=e.smallCaps),e.outline!=null&&(t.outline=e.outline),e.shadow!=null&&(t.shadow=e.shadow),e.emboss!=null&&(t.emboss=e.emboss),e.imprint!=null&&(t.imprint=e.imprint),e.verticalAlign!=null&&(t.vertAlign=e.verticalAlign),e.characterSpacing!=null&&(t.letterSpacing=e.characterSpacing),e.characterScale!=null&&(t.charScale=e.characterScale),e.kern!=null&&(t.kerning=e.kern),e.baselineShift!=null&&(t.position=e.baselineShift),e.fitTextWidth!=null&&(t.fitText={val:e.fitTextWidth}),e.vanish!=null&&(t.vanish=e.vanish),e.webHidden!=null&&(t.webHidden=e.webHidden),e.specVanish!=null&&(t.specVanish=e.specVanish);const o=oX(e.border);return o&&(t.border=o),t}function pk(e){if(e){if(typeof e=="string")return e;if(e.model==="rgb")return e.value;if(e.model==="auto")return"auto"}}function rX(e){var n,r;if(e==null)return;const t={};return e.style!=null&&(t.style=e.style),((n=e.color)==null?void 0:n.model)==="rgb"&&(t.color=e.color.value),((r=e.color)==null?void 0:r.model)==="theme"&&(t.themeColor=e.color.theme),Object.keys(t).length>0?t:!0}function iX(e){if(!e)return;const t={},n=pk(e.fill);n!=null&&(t.fill=n);const r=pk(e.color);return r!=null&&(t.color=r),e.pattern!=null&&(t.val=e.pattern),Object.keys(t).length>0?t:void 0}function oX(e){if(!e)return;const t={};
460e.style!=null&&(t.val=e.style),e.width!=null&&(t.sz=e.width),e.space!=null&&(t.space=e.space);const n=pk(e.color);return n!=null&&(t.color=n),Object.keys(t).length>0?t:void 0}function Um(e){const t=(e==null?void 0:e.selectionTarget)??(e==null?void 0:e.target);if(!e||!t)return"";try{return JSON.stringify(t)}catch{return String(t)}}function UD(e){if((e==null?void 0:e.type)!=="mutation:committed")return null;const t=e.origin==="history"?e.result:e.receipt;if(!t||typeof t!="object")return null;const n=new Set,r=new Set,i=[],o=(u,d)=>{(u==null?void 0:u.kind)!=="entity"||u.entityType!=="trackedChange"||typeof u.entityId=="string"&&u.entityId.length>0&&d.add(u.entityId)},s=u=>(u==null?void 0:u.kind)!=="entity"||u.entityType!=="trackedChange"?null:typeof u.entityId=="string"&&u.entityId.length>0?u.entityId:null;if(Array.isArray(t.inserted)&&t.inserted.forEach(u=>o(u,n)),Array.isArray(t.updated)&&t.updated.forEach(u=>o(u,n)),Array.isArray(t.trackedChangeRefs)&&t.trackedChangeRefs.forEach(u=>o(u,n)),Array.isArray(t.trackedChanges)&&t.trackedChanges.forEac
460h(u=>o(u,n)),Array.isArray(t.steps)){for(const u of t.steps)if(Array.isArray(u==null?void 0:u.trackedChangeIds))for(const d of u.trackedChangeIds)typeof d=="string"&&d.length>0&&n.add(d)}if(Array.isArray(t.removed)&&t.removed.forEach(u=>o(u,r)),Array.isArray(t.invalidatedRefs)&&t.invalidatedRefs.forEach(u=>o(u,r)),Array.isArray(t.remappedRefs))for(const u of t.remappedRefs){const d=s(u==null?void 0:u.from),f=s(u==null?void 0:u.to);d&&r.add(d),f&&n.add(f),d&&f&&d!==f&&i.push({from:d,to:f})}for(const u of r)n.delete(u);const l=lX(e,t);return n.size===0&&r.size===0&&!l?null:{upsertIds:n,removedIds:r,remappedPairs:i,reconcileMode:"targeted",...l?{allResolved:l}:{}}}function sX(e){const t=new Set;if((e==null?void 0:e.type)!=="mutation:committed")return t;const n=e.origin==="history"?e.result:e.receipt;if(!Array.isArray(n==null?void 0:n.invalidatedRefs))return t;for(const r of n.invalidatedRefs)(r==null?void 0:r.kind)==="entity"&&r.entityType==="comment"&&typeof r.entityId=="string"&&r.entityId&&t.add(r.entityId);return t}function aX({event:e,commentsStore:t,superdoc:n,documentId:r}={}){var o;const i=sX(e);return i.size===0?{ok:!0,removedIds:[]}:((o=t==null?void 0:t.dropCommentsFromMutationImpact)==null?void 0:o.call(t,{superdoc:n,documentId:r,removedIds:i}))??{ok:!0,removedIds:[]}}function lX(e,t){const n=e==null?void 0:e.trackedChangeAllResolved;return(e==null?void 0:e.origin)==="history"||!n||n.schemaVersion!==1||n.targetKind!=="all"||n.decision!=="accept"&&n.decision!=="reject"||n.remainingLogicalCount!==0||typeof n.catalogRevision!="string"||!n.catalogRevision||typeof n.sourceCoverageRevision!="string"||!n.sourceCoverageRevision||!Number.isSafeInteger(n.logicalTargetCount)||n.logicalTargetCount<=0||!Number.isSafeInteger(n.physicalCarrierCount)||n.physicalCarrierCount<n.logicalTargetCount||typeof n.txId!="string"||n.txId!==t.txId||typeof n.documentEpoch!="string"||!Number.isSafeInteger(n.commitSequence)||typeof n.packagePreviousRevision!="string"||typeof n.packageNextRevision!="string"||n.packagePreviousRevision===n.packageNextRevision?null:n}var cX=new Set(["insert-text","replace-text","plain-text-paste","delete-backward","delete-forward","text.insert","text.replace","text.pastePlain","text.deleteBackward","text.deleteForward","structural.enter","structural:enter-split-paragraph","structural:enter-insert-paragraph-before","structural:enter-insert-paragraph-after","structural:shift-enter-line-break","structural:backspace-boundary-merge-with-previous","structural:delete-boundary-merge-with-next","backspace:boundary-merge-with-previous","backspace:list-remove","backspace:list-outdent"]),uX=e=>(e==null?void 0:e.type)!=="mutation:committed"||e.origin!=="command"?!1:cX.has(e.editableCommandKind),en={notReady:"not-ready",documentApiUnavailable:"document-api-unavailable",documentReadonly:"document-readonly",trackedChangeDecisionsDisabled:"tracked-change-decisions-disabled",selectionRequired:"selection-required",rangeSelectionRequired:"range-selection-required",contextUnavailable:"context-unavailable",geometryUnavailable:"geometry-unavailable",targetUnresolved:"target-unresolved",targetNotVisible:"target-not-visible",commandUnsupported:"command-unsupported",commandDeferred:"command-deferred",tableContextUnavailable:"table-context-unavailable",operationUnavailable:"operation-unavailable",bulkDecisionsDisabled:"bulk-decisions-disabled",hostCapabilityUnavailable:"host-capability-unavailable",historyEmpty:"history-empty",searchUnavailable:"search-unavailable",searchInvalidPattern:"search-invalid-pattern",searchTruncated:"search-truncated",replaceUnsupported:"replace-unsupported",contentControlLocked:"content-control-locked",permissionDenied:"permission-denied"},j6={bulletList:"bullet-list",numberedList:"numbered-list"};function F6(e){const t=n=>typeof n=="string"?n.replace(/\s*pt$/i,"").trim():n;if(typeof e=="string")return t(e);if(e&&typeof e=="object"&&"value"in e){const n=e;return{...n,value:t(n.value)}}return e}function dX(e){const t=(n,r)=>!r&&n>0&&n<=5?n*100:n;if(typeof e=="string"){const n=e.includes("%"),r=Number.parseFloat(e.replace("%","").trim());return Number.isFinite(r)?t(r,n):e}return typeof e=="number"&&Number.isFinite(e)?t(e,!1):e}function fX(e){const t=e&&typeof e=="object"&&"value"in e?e.value:e;if(t==="in"||t==="cm")return t;if(typeof t=="string"){const n=t.trim().toLowerCase();if(n==="in"||n==="inch"||n==="inches")return"in";if(n==="cm"||n==="centimeter"||n==="centimeters"||n==="centimetre"||n==="centimetres")return"cm"}return t}function z6(e){const t=n=>{if(n===null)return null;
460if(typeof n!="string")return n;const r=n.trim();return r===""?n:/^#[0-9a-fA-F]{6}$/.test(r)?r:/^[0-9a-fA-F]{6}$/.test(r)?`#${r}`:r};if(e&&typeof e=="object"&&"value"in e){const n=e;return{...n,value:t(n.value)}}return t(e)}function $A(e,t){if(e&&typeof e=="object"){const n=e;for(const r of t)if(r in n)return n[r]}return e}function hX(e){const t=$A(e,["alignment","value"]);if(typeof t!="string")return t;const n=t.trim().toLowerCase();return n==="justified"||n==="both"?"justify":n}var pX=new Set(["left","center","right"]),mX=new Set(["decimal","lowerLetter","upperLetter","lowerRoman","upperRoman","numberInDash","hebrew1","hebrew2"]);function VD(e){if(e.kind!==void 0&&e.kind!=="header"&&e.kind!=="footer")return null;const t=e.position??(e.kind==="header"?"top":e.kind==="footer"?"bottom":void 0);if(t!==void 0)return t!=="top"&&t!=="bottom"?null:t==="top"?"header":"footer"}function HD(e){return e!=null&&typeof e!="object"?null:e??{}}function gX(e){const t=HD(e);if(!t)return null;const n=VD(t);return n===null||t.alignment!==void 0&&!pX.has(t.alignment)||t.showOnFirstPage!==void 0&&typeof t.showOnFirstPage!="boolean"||t.format!==void 0&&!mX.has(t.format)||t.start!==void 0&&t.start!==null&&(typeof t.start!="number"||!Number.isInteger(t.start)||t.start<0)?null:{kind:n??"footer",...t.alignment!==void 0?{alignment:t.alignment}:{},...t.showOnFirstPage!==void 0?{showOnFirstPage:t.showOnFirstPage}:{},...t.format!==void 0?{format:t.format}:{},...t.start!==void 0?{start:t.start}:{}}}function yX(e){const t=HD(e);if(!t)return null;const n=VD(t);return n===null?null:n?{kind:n}:{}}function vX(e){const t=$A(e,["line","lineHeight","value"]),n=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t.trim()):NaN;return!Number.isFinite(n)||n<=0?t:n<=10?Math.round(n*240):Math.round(n)}function bX(e){if(e&&typeof e=="object"&&"role"in e)return e;const t=$A(e,["styleId","value","style"]);return typeof t=="string"?t.trim():t}function wX(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e.mode;if(typeof t=="string")return t}return e}var xX=en.commandUnsupported,dd=en.tableContextUnavailable,$D=[{id:"bold",family:"inline marks",disposition:"routed",mutates:!0,docRoute:"format.bold",activeMark:"bold",inline:{key:"bold",kind:"toggle"}},{id:"italic",family:"inline marks",disposition:"routed",mutates:!0,docRoute:"format.italic",activeMark:"italic",inline:{key:"italic",kind:"toggle"}},{id:"underline",family:"inline marks",disposition:"routed",mutates:!0,docRoute:"format.underline",activeMark:"underline",inline:{key:"underline",kind:"toggle"}},{id:"strikethrough",family:"inline marks",disposition:"routed",mutates:!0,docRoute:"format.strikethrough",activeMark:"strikethrough",inline:{key:"strike",kind:"toggle"}},{id:"font-family",family:"fonts",disposition:"routed",mutates:!0,docRoute:"format.fontFamily",aliases:["setFontFamily"],inline:{key:"fontFamily",kind:"value-string"}},{id:"font-size",family:"fonts",disposition:"routed",mutates:!0,docRoute:"format.fontSize",aliases:["setFontSize"],normalizePayload:F6,inline:{key:"fontSize",kind:"value-number"}},{id:"setFontFamily",family:"fonts",disposition:"routed",mutates:!0,docRoute:"format.fontFamily",aliasOf:"font-family",inline:{key:"fontFamily",kind:"value-string"}},{id:"setFontSize",family:"fonts",disposition:"routed",mutates:!0,docRoute:"format.fontSize",aliasOf:"font-size",normalizePayload:F6,inline:{key:"fontSize",kind:"value-number"}},{id:"undo",family:"history",disposition:"routed",mutates:!0,docRoute:"history.undo"},{id:"redo",family:"history",disposition:"routed",mutates:!0,docRoute:"history.redo"},{id:"acceptChange",family:"tracked changes",disposition:"routed",mutates:!0,trackDecision:{kind:"accept",scope:"id"},aliases:["track-changes-accept-selection"]},{id:"rejectChange",family:"tracked changes",disposition:"routed",mutates:!0,trackDecision:{kind:"reject",scope:"id"},aliases:["track-changes-reject-selection"]},{id:"acceptAllChanges",family:"tracked changes (bulk)",disposition:"routed",mutates:!0,trackDecision:{kind:"accept",scope:"all"}},{id:"rejectAllChanges",family:"tracked changes (bulk)",disposition:"routed",mutates:!0,trackDecision:{kind:"reject",scope:"all"}},{id:"track-changes-accept-selection",family:"tracked changes",disposition:"routed",mutates:!0,trackDecision:{kind:"accept",scope:"id"},aliasOf:"acceptChange"},{id:"track-changes-reject-selection",family:"tracked changes",disposition:"routed",mutates:!0,trackDecision:{kind:"reject",scope:"id"},aliasOf:"rejectChange"}
460,{id:"zoom",family:"zoom",disposition:"routed",mutates:!1,instanceRoute:"setZoom",valueFrom:"zoom",normalizePayload:dX},{id:"zoom-fit-width",family:"zoom",disposition:"routed",mutates:!1,instanceRoute:"setZoomMode",fixedArg:"fit-width",valueFrom:"zoom"},{id:"document-mode",family:"document",disposition:"routed",mutates:!1,instanceRoute:"setDocumentMode",valueFrom:"documentMode",normalizePayload:wX},{id:"measurement-unit",family:"measurement",disposition:"routed",mutates:!1,instanceRoute:"setMeasurementUnit",valueFrom:"measurementUnit",normalizePayload:fX},{id:"text-color",family:"color",disposition:"routed",mutates:!0,docRoute:"format.color",inline:{key:"color",kind:"value-string"},normalizePayload:z6},{id:"highlight-color",family:"color",disposition:"routed",mutates:!0,docRoute:"format.highlight",inline:{key:"highlight",kind:"value-string"},normalizePayload:z6},{id:"link",family:"links",disposition:"routed",mutates:!0,docRoute:"hyperlinks.wrap",activeMark:"link",link:{kind:"link"}},{id:"text-align",family:"paragraph",disposition:"routed",mutates:!0,docRoute:"format.paragraph.setAlignment",blockParagraph:{kind:"alignment"},normalizePayload:hX},{id:"line-height",family:"paragraph",disposition:"routed",mutates:!0,docRoute:"format.paragraph.setSpacing",blockParagraph:{kind:"spacing-line"},normalizePayload:vX},{id:"linked-style",family:"paragraph",disposition:"routed",mutates:!0,docRoute:"styles.paragraph.setStyle",blockParagraph:{kind:"style"},normalizePayload:bX},{id:"bullet-list",family:"lists",disposition:"routed",mutates:!0,docRoute:"lists.apply",list:{mode:"toggle-seed",seed:"bullet"}},{id:"numbered-list",family:"lists",disposition:"routed",mutates:!0,docRoute:"lists.apply",list:{mode:"toggle-seed",seed:"ordered"}},{id:"indent-increase",family:"lists/indent",disposition:"routed",mutates:!0,docRoute:"lists.indent",list:{mode:"indent"}},{id:"indent-decrease",family:"lists/indent",disposition:"routed",mutates:!0,docRoute:"lists.outdent",list:{mode:"outdent"}},{id:"direction-ltr",family:"direction",disposition:"routed",mutates:!0,docRoute:"format.paragraph.setDirection",blockParagraph:{kind:"direction",fixedValue:"ltr"}},{id:"direction-rtl",family:"direction",disposition:"routed",mutates:!0,docRoute:"format.paragraph.setDirection",blockParagraph:{kind:"direction",fixedValue:"rtl"}},{id:"clear-formatting",family:"formatting",disposition:"routed",mutates:!0,docRoute:"format.apply",inline:{key:"*",kind:"clear"}},{id:"image",family:"media",disposition:"routed",mutates:!0,docRoute:"create.image",create:{kind:"image"}},{id:"table-of-contents-insert",family:"TOC",disposition:"routed",mutates:!0,docRoute:"create.tableOfContents",create:{kind:"toc"}},{id:"table-insert",family:"tables",disposition:"routed",mutates:!0,docRoute:"create.table",create:{kind:"table"}},{id:"page-number-insert",family:"fields",disposition:"routed",mutates:!0,docRoute:"fields.insert",field:{instruction:"PAGE"}},{id:"page-numbers-apply",family:"fields",disposition:"routed",mutates:!0,docRoute:"headerFooters.pageNumbers.set",pageNumbers:"set",normalizePayload:gX},{id:"page-numbers-remove",family:"fields",disposition:"routed",mutates:!0,docRoute:"headerFooters.pageNumbers.remove",pageNumbers:"remove",normalizePayload:yX},{id:"table-add-row-before",family:"tables",disposition:"routed",mutates:!0,docRoute:"tables.insertRow",table:{action:"insert-row-before",op:"insertRow"},reason:dd},{id:"table-add-row-after",family:"tables",disposition:"routed",mutates:!0,docRoute:"tables.insertRow",table:{action:"insert-row-after",op:"insertRow"},reason:dd},{id:"table-delete-row",family:"tables",disposition:"routed",mutates:!0,docRoute:"tables.deleteRow",table:{action:"delete-row",op:"deleteRow"},reason:dd},{id:"table-add-column-before",family:"tables",disposition:"routed",mutates:!0,docRoute:"tables.insertColumn",table:{action:"insert-column-before",op:"insertColumn"},reason:dd},{id:"table-add-column-after",family:"tables",disposition:"routed",mutates:!0,docRoute:"tables.insertColumn",table:{action:"insert-column-after",op:"insertColumn"},reason:dd},{id:"table-delete-column",family:"tables",disposition:"routed",mutates:!0,docRoute:"tables.deleteColumn",table:{action:"delete-column",op:"deleteColumn"},reason:dd},{id:"table-delete",family:"tables",disposition:"routed",mutates:!0,docRoute:"tables.delete",table:{action:"delete-table",op:"delete"},reason:dd},{id:"table-merge-cells",family:"tables",disposition:"routed",mutates:!0,docRoute:"tables.mergeCells",table:{action:"merge-cells",op:"mergeCells"},reason:dd},{id:"table-split-cell",family:"tables",disposition:"routed",mutates:!0,docRoute:"tables.splitCell",table:{action:"split-cell",op:"splitCell",requiresCell:!0},reason:dd},{id:"table-remove-borders",family:"tables",disposition:"routed",mutates:!0,docRoute:"tables.setBorders",table:{action:"remove-borders",o
460p:"setBorders"},reason:dd},{id:"ruler",family:"UI chrome",disposition:"routed",mutates:!1,instanceRoute:"toggleRuler",valueFrom:"ruler"},{id:"formatting-marks",family:"UI chrome",disposition:"routed",mutates:!1,instanceRoute:"toggleFormattingMarks",valueFrom:"formattingMarks"},{id:"copy-format",family:"formatting",disposition:"routed",mutates:!1},{id:"table-fix",family:"tables",disposition:"unsupported",mutates:!0,reason:xX}],kX=new Map($D.map(e=>[e.id,e])),_X=$D.map(e=>e.id);function R0(e){return kX.get(e)??null}function GD(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function CX(e){const t=[],n=i=>{i&&!t.includes(i)&&t.push(i)};n(e.getAttribute("data-track-change-preferred-target-id"));const r=e.getAttribute("data-track-change-ids");if(r)for(const i of GD(r))n(i);return n(e.getAttribute("data-track-change-id")),t}function U6(e,t){if(!e||typeof e.getAttribute!="function")return[];const n=[],r=new Set;let i=[],o=null,s=null,l=e;for(;l;){const u=l;o??(o=u.getAttribute("data-story-key"));const d=CX(u),f=d.length>0?u.getAttribute("data-story-key"):null;for(const S of d){const x=`trackedChange:${S}`;if(!r.has(x)){r.add(x);const T={type:"trackedChange",id:S};f&&(T.storyKey=f),n.push(T),i.push(T)}}const p=u.getAttribute("data-layout-story");if(s??(s=p),p&&i.length>0){for(const S of i)S.story=p;i=[]}const m=u.getAttribute("data-citation-id");if(m){const S=`citation:${m}`;r.has(S)||(r.add(S),n.push({type:"citation",id:m}))}const y=u.getAttribute("data-comment-ids");if(y)for(const S of GD(y)){const x=`comment:${S}`;r.has(x)||(r.add(x),n.push({type:"comment",id:S}))}const b=u.getAttribute("data-sdt-type"),k=u.getAttribute("data-sdt-id");if(k&&b==="structuredContent"){const S=`contentControl:${k}`;if(!r.has(S)){r.add(S);const x=u.getAttribute("data-sdt-scope"),T=u.getAttribute("data-sdt-tag"),C={type:"contentControl",id:k};o&&(C.storyKey=o),s?C.story=s:i.push(C),(x==="block"||x==="inline")&&(C.scope=x),T&&(C.tag=T),n.push(C)}}if(t&&l===t)break;l=l.parentElement}return n}function SX(e){var r,i;const t=(r=e==null?void 0:e.directionContext)==null?void 0:r.inlineDirection;if(t!=null)return t;const n=(i=e==null?void 0:e.paragraphProperties)==null?void 0:i.rightToLeft;if(n===!0)return"rtl";if(n===!1)return"ltr"}var EX=Object.freeze(["checkpoint-geometry","section-numbering","font-style-inputs","notes","furniture","flowing-anchors","non-flowing-page-anchors","convergence","source-topology"]);new Set(EX);var ca=()=>({oneOf:[{type:"boolean"},{type:"null"}]}),cp=()=>({oneOf:[{type:"string",minLength:1},{type:"null"}]}),m0=()=>({oneOf:[{type:"number"},{type:"null"}]}),g0=e=>({oneOf:[{type:"object",properties:e,additionalProperties:!1,minProperties:1},{type:"null"}]}),AX={type:"object",properties:{style:{oneOf:[{type:"string",minLength:1},{type:"null"}]},color:{oneOf:[{type:"string",minLength:1},{type:"null"}]},themeColor:{oneOf:[{type:"string",minLength:1},{type:"null"}]}},additionalProperties:!1,minProperties:1},TX={type:"object",properties:{id:{type:"number"},val:{type:"boolean"}},required:["id"],additionalProperties:!1},IX=()=>({oneOf:[{type:"boolean"},{type:"null"},AX]}),RX=()=>({oneOf:[{type:"array",items:TX,minItems:1},{type:"null"}]});function mk(e,t){return{storage:"mark",markName:e,textStyleAttr:t}}function OX(e){return{storage:"runAttribute",nodeName:"run",runPropertyKey:e}}var OS=(e,t,n)=>({key:e,type:"boolean",ooxmlElement:t,storage:"mark",tracked:!0,carrier:mk(n),schema:ca()}),Om=(e,t,n,r,i)=>({key:e,type:t,ooxmlElement:n,storage:"mark",tracked:!0,carrier:mk("textStyle",i??e),schema:r}),zi=(e,t,n,r,i)=>({key:e,type:t,ooxmlElement:n,storage:"runAttribute",tracked:!1,carrier:OX(i??e),schema:r}),gk=[OS("bold","w:b","bold"),OS("italic","w:i","italic"),OS("strike","w:strike","strike"),{key:"underline",type:"object",ooxmlElement:"w:u",storage:"mark",tracked:!0,carrier:mk("underline"),schema:IX()},{key:"highlight",type:"string",ooxmlElement:"w:highlight",storage:"mark",tracked:!0,carrier:mk("highlight"),schema:cp()},Om("color","string","w:color",cp()),Om("fontSize","number","w:sz",m0()),Om("fontFamily","string","w:rFonts",cp()),Om("letterSpacing","number","w:spacing",m0()),Om("vertAlign","string","w:vertAlign",{oneOf:[{enum:["superscript","subscript","baseline"]},{type:"null"}]}),Om("position","number","w:position",m0()),zi("dstrike","boolean","w:dstrike",ca()),zi("smallCaps","boolean","w:smallCaps",ca()),Om("caps","boolean","w:caps",ca(),"textTransform"),zi("shading","object","w:shd",g0({fill:{oneOf:[{type:"string",minLength:1},{type:"null"}]},color:{oneOf:[{type:"string",minLength:1},{type:"null"}]},val:{oneOf:[{type:"string",minLength:1},{type:"null"}]}})),zi("border","object","w:bdr",g0({val:{oneOf:[{type:"string",minLength:1},{type:"null"}]},sz:{oneOf:[{type:"number"},{type:"null"}]},color:{oneOf:[{type:"string",minLength:1},{type:"null"}]},space:{oneOf:[{type:"number"},{type:"null"}]}}),"borders"),zi("outline","boolean","w:outline",ca()),zi("shadow","boolean","w:shadow",ca()),zi("emboss","boolean","w:emboss",ca()),zi("imprint","boolean","w:imprint",ca()),zi("charScale","number","w:w",m0(),"w"),zi("kerning","number","w:kern",m0(),"kern"),zi("vanish","boolean","w:vanish",ca()),zi("webHidden","boolean","w:webHidden",ca()),zi("specVanish","boolean","w:specVanish",ca()),zi("rtl","boolean","w:rtl",ca()),zi("cs","boolean","w:cs",ca()),zi("bCs","boolean","w:bCs",ca(),"boldCs"),zi("iCs","boolean","w:iCs",ca(),"italicCs"),zi("eastAsianLayout","object","w:eastAsianLayout",g0({id:{oneOf:[{type:"string",minLength:1},{type:"null"}]},combine:{oneOf:[{type:"boolean"},{type:"null"}]},combineBrackets:{oneOf:[{type:"string",minLength:1},{type:"null"}]},vert:{oneOf:[{type:"boolean"},{type:"null"}]},vertCompress:{oneOf:[{type:"boolean"},{type:"null"}]}})),zi("em","string","w:em",cp()),zi("fitText","object","w:fitText",g0({val:{oneOf:[{type:"number"},{type:"null"}]},id:{oneOf:[{type:"string",minLength:1},{type:"null"}]}}
460)),zi("snapToGrid","boolean","w:snapToGrid",ca()),zi("lang","object","w:lang",g0({val:{oneOf:[{type:"string",minLength:1},{type:"null"}]},eastAsia:{oneOf:[{type:"string",minLength:1},{type:"null"}]},bidi:{oneOf:[{type:"string",minLength:1},{type:"null"}]}})),zi("oMath","boolean","w:oMath",ca()),zi("rStyle","string","w:rStyle",cp(),"styleId"),zi("rFonts","object","w:rFonts",g0({ascii:{oneOf:[{type:"string",minLength:1},{type:"null"}]},hAnsi:{oneOf:[{type:"string",minLength:1},{type:"null"}]},eastAsia:{oneOf:[{type:"string",minLength:1},{type:"null"}]},cs:{oneOf:[{type:"string",minLength:1},{type:"null"}]},asciiTheme:{oneOf:[{type:"string",minLength:1},{type:"null"}]},hAnsiTheme:{oneOf:[{type:"string",minLength:1},{type:"null"}]},eastAsiaTheme:{oneOf:[{type:"string",minLength:1},{type:"null"}]},csTheme:{oneOf:[{type:"string",minLength:1},{type:"null"}]},hint:{oneOf:[{type:"string",minLength:1},{type:"null"}]}}),"fontFamily"),zi("fontSizeCs","number","w:szCs",m0()),zi("ligatures","string","w14:ligatures",cp()),zi("numForm","string","w14:numForm",cp()),zi("numSpacing","string","w14:numSpacing",cp()),zi("stylisticSets","array","w14:stylisticSets",RX()),zi("contextualAlternates","boolean","w14:cntxtAlts",ca())];new Set(gk.map(e=>e.key));var NX=Object.fromEntries(gk.map(e=>[e.key,e]));gk.filter(e=>e.storage==="mark").map(e=>e.key),gk.filter(e=>e.storage==="runAttribute").map(e=>e.key);var yk=new WeakMap,qD=new WeakMap;function MX(e,t,n){let r=yk.get(e);r||(r=new WeakMap,yk.set(e,r)),r.set(t,n)}var WD=new WeakMap;function DX(e){var t;return((t=WD.get(e))==null?void 0:t())??Promise.resolve(null)}function G0(e,t,n){var r;return((r=qD.get(e))==null?void 0:r(t,n))??e.commands.executeAsync(t,n)}function Tf(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Rx(){const e=globalThis;return{sink:typeof e.__superdocV2BenchPipelineTiming=="function"?e.__superdocV2BenchPipelineTiming:null,workerContext:e.__superdocV2BenchWorkerMessageContext??null}}function NS(e){const{sink:t}=Rx();if(t)try{t(e)}catch{}}var E4=new WeakMap;function LX(e){let t=E4.get(e);return t||(t={refCount:0,generation:0,abortController:new AbortController,inFlight:null,activeMutationTokens:new Set},E4.set(e,t)),t.refCount+=1,t}function PX(e,t){t.refCount=Math.max(0,t.refCount-1),!(t.refCount>0)&&(t.abortController.abort("ui-controller-destroyed"),t.inFlight=null,t.activeMutationTokens.clear(),E4.delete(e))}var BX=new Set(Object.values(en));function Ox(e,t){return typeof e=="string"&&BX.has(e)?e:t}function MS(e){if(e&&typeof e=="object"&&e.ok===!1){const t=e.reason;return t==="host-not-ready"||t==="host-disposed"||t==="editing-mount-required"?{ok:!1,reason:en.notReady}:{ok:!1,reason:Ox(t,en.targetUnresolved)}}return{ok:!0}}var jX=["document-replaced","editorCreate","active-editor-change","document-mode-change","zoomChange","measurement-unit-change","viewport-change","fonts-changed"],FX={[j6.bulletList]:"bullet",[j6.numberedList]:"ordered"};function V6(e){return FX[e]??null}var zX={disc:"disc",circle:"circle",square:"square",decimal:"decimal","decimal-paren":"decimalParenthesis","upper-roman":"upperRoman","lower-roman":"lowerRoman","upper-alpha":"upperLetter","upper-alpha-paren":"upperLetterParenthesis","lower-alpha":"lowerLetter","lower-alpha-paren":"lowerLetterParenthesis"};function UX(e){const t=zX[e];return t?{preset:t,behavior:"toggleStyle"}:{}}var VX={status:"ready",empty:!0,target:null,selectionTarget:null,activeMarks:[],activeCommentIds:[],activeChangeIds:[],quotedText:""},HX=[{key:"contentControls",match:"exact",note:"full-document SDT catalog parse (the measured during-load cliff)"},{key:"contentControls:inRange:",match:"prefix",note:"same adapter load() as the catalog, issued per settled selection"},{key:"hyperlinks:",match:"prefix",note:"per-block hyperlink list over the loading story"},{key:"styles:catalog:",match:"prefix",note:"WordStyleModel recompile from package bytes"},{key:"comments",match:"exact",note:"audited: full comments list; stale-served during load"},{key:"trackChanges",match:"exact",note:"audited: shared all-story tracked-changes catalog; stale-served during load"},{key:"trackChanges:all",match:"exact",note:"audited: current-token validation over the shared all-story catalog; consumers fail closed on non-ready"},{key:"tables",match:"exact",note:"reserved: full tables catalog"},{key:"sections",match:"exact",note:"reserved: full sections list"}],$X=new Set(["/word/comments.xml","/word/commentsExtended.xml","/word/commentsIds.xml"]);function GX(e){return HX.some(t=>t.match==="exact"?t.key===e:e.startsWith(t.key))}var H6={ready:0,stale:1,pending:2};function up(...e){let t="ready";for(const n of e)H6[n]>H6[t]&&(t=n);return t}function Dn(e,t){if(typeof e!="function")return t;try{const n=e();return n===void 0?t:n}catch{return t}}function zo(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function jo(e,t){if(!e)return null;const n=t.split(".");let r=e;for(const i of n){if(r==null)return null;r=r[i]}return typeof r=="function"?r:null}function no(e,t="CAPABILITY_UNAVAILABLE"){return{success:!1,failure:{code:t,message:e}}}function Yv(e,t){return{success:!1,failure:{code:"PARTIAL_LINK_EDIT",message:"Hyperlink target was updated, but display text replacement failed."},applied:{href:!0,text:!1},hyperlinkResult:e,textResult:t}}function Gb(e){if(!e||typeof e!="object")return null;const t=e.target;return t&&typeof t=="object"?t:null}function A4(e){if(!e||typeof e!="object")return!1;const t=e,n=o=>
460{if(!o||typeof o!="object")return!1;const s=o;return s.kind==="text"&&typeof s.blockId=="string"&&typeof s.offset=="number"},r=o=>{if(!o||typeof o!="object")return!1;const s=o,l=s.range;return typeof s.blockId=="string"&&typeof(l==null?void 0:l.start)=="number"&&typeof l.end=="number"};if(Array.isArray(t.segments)){const o=t.segments[0],s=t.segments[t.segments.length-1];return r(o)&&r(s)}if(t.kind==="selection")return n(t.start)&&n(t.end);if(t.kind!=="text"||typeof t.blockId!="string")return!1;const i=t.range;return typeof(i==null?void 0:i.start)=="number"&&typeof i.end=="number"}function $6(e,t){if(!e||typeof e!="object")return null;const n=Gb(e),r=e,i=r.navigationTarget&&typeof r.navigationTarget=="object"?r.navigationTarget:null;if((i==null?void 0:i.kind)==="block"&&typeof i.blockId=="string"&&i.blockId.length>0){const o={kind:"text",blockId:i.blockId,range:{start:0,end:0},...i.story&&typeof i.story=="object"?{story:i.story}:{},...r.address&&typeof r.address=="object"?{address:r.address}:{}};if(t!=null&&t.preferStableBlock||!A4(n))return o}return n}function co(e){if(!e||typeof e!="object")return"story:body";const t=e,n=typeof t.storyType=="string"?t.storyType:"body";switch(n){case"body":return"story:body";case"headerFooterPart":return`story:headerFooterPart:${typeof t.refId=="string"?t.refId:""}`;case"headerFooterSlot":return JSON.stringify({storyType:n,section:t.section??null,headerFooterKind:t.headerFooterKind??null,variant:t.variant??null,resolution:t.resolution??"effective",onWrite:t.onWrite??"materializeIfInherited"});case"footnote":return`story:footnote:${typeof t.noteId=="string"?t.noteId:""}`;case"endnote":return`story:endnote:${typeof t.noteId=="string"?t.noteId:""}`;case"textbox":return`story:textbox:${typeof t.textboxId=="string"?t.textboxId:""}`;default:return JSON.stringify(t)}}function p2(e){if(!e||typeof e!="object")return null;const t=e,n=t.address&&typeof t.address=="object"?t.address:null;if(n!=null&&n.story&&typeof n.story=="object")return n.story;if(t.storyLocator&&typeof t.storyLocator=="object")return t.storyLocator;if(t.trackedChangeStory&&typeof t.trackedChangeStory=="object")return t.trackedChangeStory;const r=Gb(e);if(!r||typeof r!="object")return null;const i=r;if(i.story&&typeof i.story=="object")return i.story;const o=i.address&&typeof i.address=="object"?i.address:null;return o!=null&&o.story&&typeof o.story=="object"?o.story:null}function vc(e,t,n){return Es(e)!==t?!1:n?co(p2(e))===co(n):!0}function Xv(e){const t=p2(e);if(!(!t||co(t)===co(null)))return t}function G6(e){if(typeof e!="string"||e.length===0)return;const t=TK(e);switch(t.kind){case"body":return;case"footnote":return t.id?{kind:"story",storyType:"footnote",noteId:t.id}:void 0;case"endnote":return t.id?{kind:"story",storyType:"endnote",noteId:t.id}:void 0;case"header":case"footer":return t.id?{kind:"story",storyType:"headerFooterPart",refId:t.id}:void 0;case"textbox":return t.id?{kind:"story",storyType:"textbox",textboxId:t.id}:void 0;default:return}}function q6(e){if(!(typeof e!="string"||e.length===0||e==="body")){if(e.startsWith("hf:part:")){const t=e.slice(8);return t?{kind:"story",storyType:"headerFooterPart",refId:t}:void 0}if(e.startsWith("fn:")){const t=e.slice(3);return t?{kind:"story",storyType:"footnote",noteId:t}:void 0}if(e.startsWith("en:")){const t=e.slice(3);return t?{kind:"story",storyType:"endnote",noteId:t}:void 0}}}function Nw(e){if(!e||typeof e!="object")return null;const t=e.selectionTarget;return t&&typeof t=="object"?t:null}function Zv(e){if(!e||typeof e!="object")return null;const t=e.id;return typeof t=="string"&&t.length>0?t:null}function qX(e){if(!e||typeof e!="object")return null;const t=e;if(t.kind!=="selection")return e;const n=t.start;return!n||typeof n!="object"?null:{...t,end:n}}function Es(e){if(!e||typeof e!="object")return null;const t=e,n=t.id??t.commentId??t.changeId;return typeof n=="string"&&n.length>0?n:null}function y0(e){return typeof e=="string"?e.trim():""}function WX(e,t){const n=t??{},r=y0(n.id).toLowerCase(),i=y0(e.authorId).toLowerCase();if(r&&i)return r===i;const o=y0(n.email).toLowerCase(),s=y0(e.authorEmail).toLowerCase();if(o&&s)return o===s;if(r||o||i||s)return!1;const l=y0(e.author).replace(/\s+/g," ").toLowerCase();if(!l)return!0;const u=y0(n.name).replace(/\s+/g," ").toLowerCase();return!!(u&&u===l)}function KX(e){if(!e||typeof e!="object")return null;const t=e,n=t.anchor,r=t.focus,i=n==null?void 0:n.visualCaret,o=r==null?void 0:r.visualCaret,s=i==null?void 0:i.trackChangeId,l=o==null?void 0:o.trackChangeId;return typeof s=="string"&&s.length>0&&s===l?s:null}var W6=new WeakMap;function KD(e){const t=[],n=o=>
460{typeof o=="string"&&o.length>0&&!t.includes(o)&&t.push(o)},r=o=>{if(!o||typeof o!="object")return;const s=o,l=s.sourceIds;if(l&&typeof l=="object"&&(n(l.wordIdInsert),n(l.wordIdDelete),Array.isArray(l.wordIdOther)))for(const p of l.wordIdOther)n(p);const u=s.wordRevisionIds;u&&typeof u=="object"&&(n(u.insert),n(u.delete),n(u.format));const d=s.replacement;if(d&&typeof d=="object")for(const p of[d.inserted,d.deleted])p&&typeof p=="object"&&(n(p.id),n(p.wordId));const f=s.move;if(f&&typeof f=="object")for(const p of[f.source,f.destination])p&&typeof p=="object"&&(n(p.id),n(p.wordId))};r(e);const i=e==null?void 0:e.change;return i&&i!==e&&r(i),t}function xd(e){const t=W6.get(e);if(t)return t;const n=new Set,r=new Map;for(const o of e){const s=Es(o);if(s){n.add(s);for(const l of KD(o)){r.has(l)||r.set(l,s);const u=`imported:${l}`;r.has(u)||r.set(u,s)}}}const i={toPublicId(o){if(n.has(o))return o;const s=r.get(o);return s!=null&&n.has(s)?s:null},aliasesFor(o){const s=[o];for(const[l,u]of r)u===o&&!s.includes(l)&&s.push(l);return s}};return W6.set(e,i),i}var K6=new WeakMap,Y6=new WeakMap;function mp(e,t){const n=co(t);let r=K6.get(e);r||(r=new Map,K6.set(e,r));const i=r.get(n);if(i)return i;const o=xd(e.filter(s=>co(p2(s))===n));return r.set(n,o),o}function YD(e){return!!e&&typeof e=="object"&&e.storyType==="textbox"}function YX(e,t){const n=t.filter(i=>e.some(o=>Es(o)===i&&p2(o)==null));if(n.length===0)return null;if(n.length===1)return n[0];const r=new Set;for(const i of n){const o=e.find(s=>Es(s)===i);if(o)for(const s of KD(o)){if(r.has(s))return null;r.add(s)}}return n[0]}function XX(e){const t=Y6.get(e);if(t)return t;const n=e.filter(i=>p2(i)!=null),r=n.length===e.length?e:n;return Y6.set(e,r),r}function ZX(e){const{selectionIds:t,publicIds:n,selection:r,bodyItems:i,allStoryItems:o}=e;if(t.length===0)return null;const s=d=>{for(const f of t){const p=d.toPublicId(f);if(p)return p}return null},l=Eu(r),u=co(l)===co(null);if(o){const d=u?XX(o):o,f=s(mp(d,l));if(f)return f;const p=n==null?void 0:n.find(m=>d.some(y=>vc(y,m,l)));return p||(u?s(xd(i)):YD(l)?YX(o,t):null)}return u?s(xd(i))??t[0]??null:null}function QX(e,t){const n=e.find(r=>Es(r)===t||r.importedId===t);return n?n.rootCommentId??n.parentCommentId??Es(n)??t:null}function JX(e){var s,l;const t=e.selectionTarget;if(t){const u=t.start,d=t.end,f=typeof(u==null?void 0:u.blockId)=="string"?u.blockId:void 0,p=typeof(d==null?void 0:d.blockId)=="string"?d.blockId:f;if(f)return{startBlockId:f,endBlockId:p??f}}const n=e.target,r=n&&Array.isArray(n.segments)?n.segments:[],i=(s=r[0])==null?void 0:s.blockId,o=(l=r[r.length-1])==null?void 0:l.blockId;return typeof i=="string"?{startBlockId:i,endBlockId:typeof o=="string"?o:i}:null}function fs(e){var s,l;const t=[],n=u=>{typeof u=="string"&&u.length>0&&!t.includes(u)&&t.push(u)},r=e.target,i=r&&Array.isArray(r.segments)?r.segments:[];for(const u of i)n(u==null?void 0:u.blockId);const o=e.selectionTarget;return o&&(n((s=o.start)==null?void 0:s.blockId),n((l=o.end)==null?void 0:l.blockId)),t}var eZ=64;function Nm(e){return e.length<=eZ}function Eu(e){const t=e.target,n=e.selectionTarget,r=n==null?void 0:n.start,i=n==null?void 0:n.end,o=(t==null?void 0:t.story)??(n==null?void 0:n.story)??(r==null?void 0:r.story)??(i==null?void 0:i.story);return o&&typeof o=="object"?o:{kind:"story",storyType:"body"}}function Ca(e,t){return{kind:"block",nodeType:"paragraph",nodeId:e,...t&&typeof t=="object"?{story:t}:{}}}function If(e){return{kind:"block",nodeType:"paragraph",nodeId:e}}function X6(e,t){return{kind:"block",nodeType:"listItem",nodeId:e,...t&&typeof t=="object"?{story:t}:{}}}var Z6=720;function Id(e){return Math.round(e*20)}function v0(e){return typeof e=="number"&&Number.isFinite(e)}function tZ(e){if(!e||typeof e!="object")return null;const t=e.node;if(!t||typeof t!="object")return null;const n=t.kind==="heading"?t.heading??null:t.kind==="paragraph"?t.paragraph??null:null;if(!n)return null;const r=n.resolved,i=n.props,o=(r==null?void 0:r.indent)??(i==null?void 0:i.indent);if(!o||typeof o!="object")return null;const s=v0(o.left)?Id(o.left):v0(o.start)?Id(o.start):void 0,l=v0(o.right)?Id(o.right):v0(o.end)?Id(o.end):void 0,u=v0(o.firstLine)?Id(o.firstLine):void 0,d=v0(o.hanging)?Id(o.hanging):void 0;return s==null&&l==null&&u==null&&d==null?null:{...s!=null?{left:s}:{},...l!=null?{right:l}:{}
460,...u!=null?{firstLine:u}:{},...d!=null?{hanging:d}:{}}}function DS(e){const t=e.target,n=t&&Array.isArray(t.segments)?t.segments:[],r=t==null?void 0:t.story,i=[];for(const o of n){if(!o||typeof o.blockId!="string")continue;const s=o.range;!s||typeof s.start!="number"||typeof s.end!="number"||s.start===s.end||i.push({kind:"text",blockId:o.blockId,range:{start:s.start,end:s.end},...r?{story:r}:{}})}return i}function nZ(e){if(!e||typeof e!="object")return[];const t=e,n=t.story,r=[];if(t.kind==="text"&&t.range&&typeof t.blockId=="string"){const i=t.range;return typeof i.start=="number"&&typeof i.end=="number"&&i.start!==i.end&&r.push({kind:"text",blockId:t.blockId,range:{start:Math.min(i.start,i.end),end:Math.max(i.start,i.end)},...n?{story:n}:{}}),r}if(t.kind==="text"&&Array.isArray(t.segments)){for(const i of t.segments){const o=i==null?void 0:i.range;typeof(i==null?void 0:i.blockId)=="string"&&typeof(o==null?void 0:o.start)=="number"&&typeof(o==null?void 0:o.end)=="number"&&o.start!==o.end&&r.push({kind:"text",blockId:i.blockId,range:{start:Math.min(o.start,o.end),end:Math.max(o.start,o.end)},...n?{story:n}:{}})}return r}if(t.kind==="selection"){const i=t.start,o=t.end,s=typeof(i==null?void 0:i.blockId)=="string"&&(o==null?void 0:o.blockId)===i.blockId?i.blockId:null;(i==null?void 0:i.kind)==="text"&&(o==null?void 0:o.kind)==="text"&&s&&typeof i.offset=="number"&&typeof o.offset=="number"&&i.offset!==o.offset&&r.push({kind:"text",blockId:s,range:{start:Math.min(i.offset,o.offset),end:Math.max(i.offset,o.offset)},...t.story??i.story?{story:t.story??i.story}:{}})}return r}function qb(e){if(!e||typeof e!="object")return null;const t=e,n=t.story;if(t.kind==="text"&&t.range&&typeof t.blockId=="string"){const r=t.range;if(typeof r.start=="number"&&typeof r.end=="number"&&r.start===r.end)return{kind:"text",blockId:t.blockId,range:{start:r.start,end:r.end},...n?{story:n}:{}}}if(t.kind==="text"&&Array.isArray(t.segments)){const r=t.segments[0],i=r==null?void 0:r.range;if(typeof(r==null?void 0:r.blockId)=="string"&&typeof(i==null?void 0:i.start)=="number"&&typeof(i==null?void 0:i.end)=="number"&&i.start===i.end)return{kind:"text",blockId:r.blockId,range:{start:i.start,end:i.end},...n?{story:n}:{}}}if(t.kind==="selection"){const r=t.start,i=t.end,o=typeof(r==null?void 0:r.blockId)=="string"&&(i==null?void 0:i.blockId)===r.blockId?r.blockId:null;if((r==null?void 0:r.kind)==="text"&&(i==null?void 0:i.kind)==="text"&&o&&typeof r.offset=="number"&&typeof i.offset=="number"&&r.offset===i.offset)return{kind:"text",blockId:o,range:{start:r.offset,end:r.offset},...t.story??r.story?{story:t.story??r.story}:{}}}return null}function Au(e){return qb(e.target)??qb(e.selectionTarget)}function Q6(e){var n;const t=(n=Au(e))==null?void 0:n.story;return(t==null?void 0:t.storyType)==="headerFooterPart"||(t==null?void 0:t.storyType)==="headerFooterSlot"}var XD=["fontFamily","fontSize","color","highlight"],rZ={undo:"history.undo",redo:"history.redo"},Qv=["bold","italic","underline","strikethrough"];function LS(e){return XD.includes(e)}function q0(e){const t=e.target,n=t&&Array.isArray(t.segments)?t.segments:[],r=[],i=(u,d,f)=>{typeof u!="string"||typeof d!="number"||typeof f!="number"||r.push({blockId:u,start:Math.min(d,f),end:Math.max(d,f)})};for(const u of n){const d=u==null?void 0:u.range;i(u==null?void 0:u.blockId,d==null?void 0:d.start,d==null?void 0:d.end)}if(r.length>0)return r;const o=e.selectionTarget,s=o==null?void 0:o.start,l=o==null?void 0:o.end;return!s||!l||s.blockId!==l.blockId||i(s.blockId,s.offset,l.offset),r}function Tu(e){const t=e.target,n=e.selectionTarget,r=n==null?void 0:n.start,i=n==null?void 0:n.end,o=(t==null?void 0:t.story)??(n==null?void 0:n.story)??(r==null?void 0:r.story)??(i==null?void 0:i.story);return o&&typeof o=="object"?o:void 0}function iZ(e){const t=Tu(e);if(!t||typeof t!="object")return"body";const n=t;return JSON.stringify({storyType:typeof n.storyType=="string"?n.storyType:"body",refId:typeof n.refId=="string"?n.refId:null,noteId:typeof n.noteId=="string"?n.noteId:null,textboxId:typeof n.textboxId=="string"?n.textboxId:null})}function Rf(e){const t=q0(e);return t.length===0?null:[iZ(e),...t.map(n=>`${n.blockId}:${n.start}-${n.end}`)].join("|")}function J6(e){const t=e.selectionTarget;return!t||typeof t!="object"?null:Um({selectionTarget:t})}function oZ(e,t){if(e==="fontSize"){const r=typeof t=="number"?t:Number(t);return Number.isFinite(r)&&r>0?String(r):null}if(typeof t!="string")return null;const n=t.trim();return n.length===0?null:e==="color"||e==="highlight"?n.toUpperCase():n}function sZ(e,t){return Math.max(e.start,t.start)<Math.min(e.end,t.end)}function aZ(e){if(!e)return[];const t=Array.isArray(e.blocks)?e.blocks:[],n=[];for(const r of t){const i=r==null?void 0:r.range,o=r==null?void 0:r.blockId;typeof o!="string"||typeof(i==null?void 0:i.start)!="number"||typeof(i==null?void 0:i.end)!="number"||n.push({blockId:o,start:Math.min(i.start,i.end),end:Math.max(i.start,i.end)})}return n}function lZ(e,t){return e.length!==t.length?!1:e.every((n,r)=>{const i=t[r];return(i==null?void 0:i.blockId)===n.blockId&&(i==null?void 0:i.start)===n.start&&(i==null?void 0:i.end)===n.end})}function e8(e,t){const n=q0(t);if(n.length===0)return null;const r=e&&Array.isArray(e.items)?e.items:[];if(r.length===0)return null;const i=r.find(o=>lZ(n,aZ(o)));if(i)return i;if(n.length===1){const o=r.find(s=>
460{const l=s==null?void 0:s.address;return(l==null?void 0:l.kind)==="block"&&l.nodeId===n[0].blockId});if(o)return o}return r[0]??null}function cZ(e,t){const n=t==="fontSize"?(e==null?void 0:e.fontSizePt)??(e==null?void 0:e.fontSize):t==="highlight"?(e==null?void 0:e.highlight)??(e==null?void 0:e.backgroundColor):e==null?void 0:e[t];if(typeof n=="number")return Number.isFinite(n)?String(n):void 0;if(typeof n!="string")return;const r=n.trim();if(r.length!==0)return t==="color"||t==="highlight"?r.toUpperCase():r}function PS(e){var r;if(typeof e!="string")return;const t=(r=e.split(",")[0])==null?void 0:r.trim().replace(/^['"]+|['"]+$/g,"").trim();if(!t)return;const n=t.toLowerCase();if(!(n==="serif"||n==="sans-serif"||n==="monospace"||n==="cursive"||n==="fantasy"))return t}function uZ(e){if(typeof e!="number"||!Number.isFinite(e)||e<=0)return;const t=Math.round(e*.75*2)/2;if(!(t<=0))return String(t)}function dZ(e,t){return e==="fontFamily"?t.toLowerCase():e==="color"||e==="highlight"?t.toUpperCase():t}function t8(e,t){if(!e)return{};const n=new Map;for(const o of q0(t)){const s=n.get(o.blockId)??[];s.push({start:o.start,end:o.end}),n.set(o.blockId,s)}if(n.size===0)return{};const r=Array.isArray(e.blocks)?e.blocks:[],i={};for(const o of XD){const s=new Map;let l=!1,u=!1;for(const d of r){const f=typeof(d==null?void 0:d.blockId)=="string"?d.blockId:null;if(!f)continue;const p=n.get(f);if(!(p!=null&&p.length))continue;const m=Array.isArray(d==null?void 0:d.runs)?d.runs:[];for(const y of m){const b=y==null?void 0:y.range,k=typeof(b==null?void 0:b.start)=="number"?b.start:null,S=typeof(b==null?void 0:b.end)=="number"?b.end:null;if(k==null||S==null||!p.some(C=>sZ(C,{start:k,end:S})))continue;l=!0;const x=cZ(y==null?void 0:y.styles,o);if(x===void 0){u=!0;continue}const T=dZ(o,x);if(s.has(T)||s.set(T,x),s.size>1)break}if(s.size>1)break}l&&!u&&s.size===1&&(i[o]=[...s.values()][0])}return i}function BS(e,t){const n=fs(e)[0];return n?t==="nodeId"?{kind:"after",nodeId:n}:{kind:"after",target:Ca(n)}:{kind:"documentEnd"}}function Rr(e,t){const n=e.supported??t!=="unsupported",r=e.enabled??(e.disabled!==void 0?!e.disabled:n);return{enabled:r,disabled:!r,active:e.active??!1,supported:n,value:e.value,source:t,reason:r?void 0:e.reason}}function b0(e){if(!e||typeof e!="object")return null;const t=e,n=t.change,r=n&&typeof n=="object"?n:t;return{...t,id:t.id??r.id,change:r}}function w0(e){const t=e,n=t.change;return n&&typeof n=="object"?n:t}function fd(e){if(zo(e))return!0;if(e===!1)return!1;if(e===!0||e==null||typeof e!="object")return!0;const t=e;return"success"in t||"failure"in t||"effects"in t?e:t.status!=="rejected"}function Nx(e){return!!e&&typeof e=="object"&&e.success===!0}function n8(e){if(e.dryRun===!0)return!1;const t=e.receipt;return!(t&&typeof t=="object"&&t.changed===!1||t&&typeof t=="object"&&t.noop===!0||t&&typeof t=="object"&&t.status==="NO_OP")}function ua(e){return!(e===!1||e&&typeof e=="object"&&e.success===!1)}function Jv(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function jS(e){const t=[],n=r=>{if(!r||typeof r!="object")return;const i=r;if(Array.isArray(i.runs)&&t.push(i),Array.isArray(i.rows))for(const o of i.rows){const s=o==null?void 0:o.cells;if(Array.isArray(s))for(const l of s){const u=l;if(Array.isArray(u==null?void 0:u.blocks))for(const d of u.blocks)n(d);u!=null&&u.paragraph&&n(u.paragraph)}}};if(Array.isArray(e))for(const r of e)n(r);return t}function Mm(e,t){var n;return((n=e.sourceAnchor)==null?void 0:n.sourceNodeId)===t?!0:e.id===t}function Mw(e){var t;return((t=e.trackedChange)==null?void 0:t.kind)==="delete"?0:typeof e.text=="string"?e.text.length:0}function yc(e){let t=!1,n=null,r=null,i=null;for(const o of e)t=o,!ua(o)&&n===null&&(n=o),Nx(o)&&(i=o),o!==!1&&(r=o);return n??i??r??t}function fZ(e){const t=e==null?void 0:e.anchor,n=t==null?void 0:t.start,r=t==null?void 0:t.end;return typeof(n==null?void 0:n.blockId)!="string"||typeof(r==null?void 0:r.blockId)!="string"||n.blockId!==r.blockId||typeof n.offset!="number"||typeof r.offset!="number"?null:{kind:"selection",start:{kind:"text",blockId:n.blockId,offset:n.offset},end:{kind:"text",blockId:r.blockId,offset:r.offset}}}function hZ(e){return e.startsWith("#")?{kind:"anchor",anchor:e.slice(1)}:{kind:"external",url:e}}function Dw(e){var t;return((t=R0(e))==null?void 0:t.trackDecision)??null}function pZ(e){return{found:e.length>0,success:e.length>0,rects:e,rect:e[0]}}function dp(e){return{found:!1,success:!1,rects:[],reason:e}}function mZ(e,t){if(!t||typeof t.getBoundingClientRect!="function"||e.rects.length===0)return e;let n;try{const i=t.getBoundingClientRect();n={left:i.left,top:i.top}}catch{return e}const r=e.rects.map(i=>({...i,left:i.left-n.left,right:i.right-n.left,top:i.top-n.top,bottom:i.bottom-n.top}));return{...e,rects:r,rect:r[0]}}function gZ(e){if(!e||typeof e!="object")return!1;const t=e;if(typeof t.blockId!="string"||!t.range||typeof t.range!="object")return!1;const n=t.range;return Number.isInteger(n.start)&&Number.isInteger(n.end)&&n.start>=0&&n.start<=n.end}function ZD(e){if(!e||e.kind!=="text"||!Array.isArray(e.segments)||e.segments.length===0)return null;const t=Array.from(e.segments);if(!t.every(gZ))return null;const n=t[0],r=t[t.length-1],i=e.story;return{kind:"selection",start:{kind:"text",blockId:n.blockId,offset:n.range.start,...i?{story:i}:{}},end:{kind:"text",blockId:r.blockId,offset:r.range.end,...i?{story:i}:{}},...i?{story:i}:{}}}function yZ(e){return e.selectionTarget?e.selectionTarget:ZD(e.target)}function x0(e){if(e.empty)return null;if(e.selectionTarget)return e.selectionTarget;
460const t=ZD(e.target);return t&&t.start.kind==="text"&&t.end.kind==="text"&&t.start.blockId!==t.end.blockId?null:t}function FS(e){return!e.inline||typeof e.docRoute!="string"?null:e.docRoute.startsWith("format.")?e.docRoute.slice(7):null}var GA={bold:null,italic:null,underline:null,strike:null,color:null,highlight:null,fontFamily:null,fontSize:null,vertAlign:null,smallCaps:null,caps:null,letterSpacing:null,dstrike:null},vZ=Object.fromEntries(Object.entries(GA).filter(([e])=>{var t;return((t=NX[e])==null?void 0:t.tracked)===!0}));function bZ(e,t,n,r){switch(e.kind){case"toggle":{const i=typeof n=="object"&&n!==null&&"value"in n?n.value:n;return typeof i=="boolean"||i===null?{target:t,value:i}:{target:t,value:!r}}case"value-string":{const i=typeof n=="object"&&n!==null&&"value"in n?n.value:n;return i===null?{target:t,value:null}:typeof i!="string"||i.trim()===""?null:{target:t,value:i}}case"value-number":{const i=typeof n=="object"&&n!==null&&"value"in n?n.value:n,o=typeof i=="number"?i:Number(i);return!Number.isFinite(o)||o<=0?null:{target:t,value:o}}case"clear":return{target:t,inline:{...GA}};default:return null}}function wZ(e){const t=i=>{if(!i||typeof i!="object")return null;const o=i,s=o.rowIndex,l=o.columnIndex;return typeof s!="number"||!Number.isInteger(s)||typeof l!="number"||!Number.isInteger(l)?null:{rowIndex:s,columnIndex:l}};if(!e)return null;const n=t(e.start),r=t(e.end);return!n||!r?null:{start:n,end:r}}function xZ(e,t){const{tableNodeId:n,rowIndex:r,columnIndex:i,cellNodeId:o,mergeRange:s}=t;switch(e){case"insert-row-before":return{nodeId:n,rowIndex:r,position:"above"};case"insert-row-after":return{nodeId:n,rowIndex:r,position:"below"};case"delete-row":return{nodeId:n,rowIndex:r};case"insert-column-before":return{nodeId:n,columnIndex:i,position:"left"};case"insert-column-after":return{nodeId:n,columnIndex:i,position:"right"};case"delete-column":return{nodeId:n,columnIndex:i};case"delete-table":return{nodeId:n};case"merge-cells":{const l=s??{start:{rowIndex:r,columnIndex:i},end:{rowIndex:r,columnIndex:i}};return{nodeId:n,start:l.start,end:l.end}}case"split-cell":return o?{nodeId:o,rows:1,columns:2}:null;case"remove-borders":return{nodeId:n,mode:"applyTo",applyTo:"all",border:null};default:return null}}function kZ(e){const t=e.superdoc,n=new Map,r=new Map;let i=null,o=0;const s=[];let l=null,u=0,d=!1,f=Promise.resolve(),p=null,m={mode:"idle",snapshot:null,sourceSelectionKey:null,lastClickAt:0,pointerSelecting:!1,keyboardSelecting:!1},y=0,b=null;const k=new Set;let S={},x="",T=null;const C=()=>{const v=t==null?void 0:t.activeEditor;return v&&typeof v=="object"?v:null},I={open:()=>{if(oe)return{ok:!1,reason:en.notReady};const v=C();if(!v)return{ok:!1,reason:en.notReady};const w=v.contextMenu;if(!w||typeof w!="object"||typeof w.open!="function")return{ok:!1,reason:en.operationUnavailable};try{const A=w.open();return A&&typeof A=="object"&&A.ok===!1?{ok:!1,reason:Ox(A.reason,en.operationUnavailable)}:{ok:!0}}catch{return{ok:!1,reason:en.operationUnavailable}}},close:()=>{var w;if(oe)return;const v=(w=C())==null?void 0:w.contextMenu;if(!(!v||typeof v!="object"||typeof v.close!="function"))try{v.close()}catch{}},contextAt:xv};let D;const P=()=>{var w;if(D!==void 0)return D;const v=(w=C())==null?void 0:w.doc;return v&&typeof v=="object"?v:null},V=()=>{var w;const v=(w=C())==null?void 0:w.v2TrackedChanges;return v&&typeof v=="object"?v:null},ee=()=>{const v=C();if((v==null?void 0:v.editorVersion)!==2)return null;const w=v.reviewWindow;return w&&typeof w=="object"?w:null},F=()=>{const v=ee();return!v||typeof v.getSnapshot!="function"?null:Dn(()=>v.getSnapshot(),null)},H=()=>{var v;return typeof((v=ee())==null?void 0:v.getSnapshot)=="function"},te=v=>{const w=v==null?void 0:v.status;return w==="ready"||w==="stale"?w:"pending"},M=()=>{var w;const v=(w=C())==null?void 0:w.host;return v&&typeof v=="object"?v:null},Z=()=>{var G;const v=C(),w=v==null?void 0:v.doc;if((v==null?void 0:v.editorVersion)!==2)return w;const A=M(),N=A?(G=yk.get(t))==null?void 0:G.get(A):null;if(!w||!A||!N)return null;const j=(ce,we)=>new Proxy(ce,{get(Re,nt,ht){const pt=Reflect.get(Re,nt,ht);if(typeof nt!="string")return pt;const It=we?`${we}.${nt}`:nt;return typeof pt=="function"&&N.supports(It)?(...Vt)=>C()!==v||M()!==A||v.doc!==w?!1:N.run(It,Vt):pt&&(typeof pt=="object"||typeof pt=="function")?j(pt,It):pt}});return j(w,"")},L=v=>
460{if(v.storyType!=="headerFooterPart"||typeof v.refId!="string")return null;const w=C(),A=M(),N=(w==null?void 0:w.pageLayout)??(A==null?void 0:A.pageLayout);if(!N||typeof N!="object")return null;const j=N.getActiveRulerContext,G=A==null?void 0:A.resolveHeaderFooterEditTarget;if(typeof j!="function"||typeof G!="function")return null;const ce=Dn(()=>j.call(N),null);if(!ce||typeof ce.pageIndex!="number")return null;for(const we of["header","footer"]){const Re=Dn(()=>G.call(A,{pageIndex:ce.pageIndex,kind:we}),null);if(!((Re==null?void 0:Re.status)!=="ready"||Re.refId!==v.refId||typeof Re.sectionId!="string"||!["default","first","even"].includes(String(Re.slotVariant))))return{kind:"story",storyType:"headerFooterSlot",section:{kind:"section",sectionId:Re.sectionId},headerFooterKind:we,variant:Re.slotVariant}}return null},W=()=>{const v=M(),w=v==null?void 0:v.getPendingInlineFormat;if(typeof w!="function")return null;const A=Dn(()=>w.call(v),null);return A&&typeof A=="object"?A:null},U=v=>{var j;const w=FS(v);if(!w)return null;const A=W();if(!A||!(w in A))return null;const N=A[w];return((j=v.inline)==null?void 0:j.kind)==="toggle"?N===!0:N!=null&&N!==""},q=v=>{const w=FS(v);if(!w)return;const A=W();if(!A||!(w in A))return;const N=A[w];if(typeof N=="string"&&N!=="")return N;if(typeof N=="number"&&Number.isFinite(N))return String(N)},Q=(v,w)=>{const A=M(),N=A==null?void 0:A.setPendingInlineFormat;typeof N=="function"&&Dn(()=>N.call(A,v,w),void 0)},re=v=>{const w=M(),A=w==null?void 0:w.clearPendingInlineFormat;typeof A=="function"&&Dn(()=>A.call(w,v),void 0)},ne=new Set(["bold","italic","underline","strikethrough"]),J=v=>{const w=W();if(!w)return;const A=Array.isArray(v.activeMarks)?v.activeMarks:[];let N=null;for(const j of Object.keys(w)){const G=w[j];let ce;if(ne.has(j)){if(G===!1)continue;ce=A.includes(j)===(G===!0)}else if(LS(j)){if(G==null)continue;N||(N=nl(v)),ce=N[j]===G}else ce=!1;ce&&re(j)}},ge=()=>{var w;const v=(w=C())==null?void 0:w.editCommands;return v&&typeof v=="object"?v:null},le=v=>{var N,j;const w=ge();if(!w||typeof w.getSnapshot!="function")return null;const A=(j=(N=Dn(()=>w.getSnapshot(),null))==null?void 0:N.commands)==null?void 0:j[v];return A&&typeof A=="object"?A:null},ve=()=>le("lists.apply"),Ee=v=>{var A;const w=(A=v==null?void 0:v.value)==null?void 0:A.seed;return w==="bullet"||w==="ordered"?w:null},st=v=>{const w=rZ[v];return w?le(w):null},At=()=>{const v=M();if(!v||typeof v.getTableContext!="function")return null;const w=Dn(()=>v.getTableContext(),null);return w&&typeof w=="object"?w:null},yt=()=>{const v=At();if(!v||v.inTable!==!0)return null;const w=v.table,A=typeof(w==null?void 0:w.nodeId)=="string"&&w.nodeId.length>0?w.nodeId:null;if(!A)return null;const N=v.row,j=v.column,G=v.cell,ce=typeof(N==null?void 0:N.index)=="number"&&Number.isInteger(N.index)?N.index:null,we=typeof(j==null?void 0:j.index)=="number"&&Number.isInteger(j.index)?j.index:null;if(ce==null||we==null)return null;const Re=typeof(G==null?void 0:G.nodeId)=="string"&&G.nodeId.length>0?G.nodeId:null,nt=v.cellRange;return{tableNodeId:A,rowIndex:ce,columnIndex:we,cellNodeId:Re,mergeRange:wZ(nt)}},Ge=new Map;let Be=null,he=null,Oe=0,ye=0,B=0;const be=new Set,ie=(v,w)=>v===w?!0:!v||!w?!1:v.id===w.id&&v.paintedEntityId===w.paintedEntityId&&co(v.story)===co(w.story),fe=v=>Array.from(be).some(w=>ie(w,v)),ue=v=>{var j;const w=M();if(typeof(w==null?void 0:w.getHandles)!="function")return;const A=Dn(()=>w.getHandles(),null),N=A==null?void 0:A.review;if(N){if(v){if(typeof N.setActiveReviewTarget!="function")return;const G=A==null?void 0:A.layout;Dn(()=>N.setActiveReviewTarget({entityType:"trackedChange",entityId:v.id,...v.paintedEntityId?{paintedEntityId:v.paintedEntityId}:{},origin:"panel",layoutEpoch:typeof(G==null?void 0:G.generation)=="number"?G.generation:0,story:v.story??{kind:"story",storyType:"body"}}),null);return}typeof N.getActiveReviewTarget!="function"||typeof N.clearActiveReviewTarget!="function"||((j=Dn(()=>N.getActiveReviewTarget(),null))==null?void 0:j.entityType)==="trackedChange"&&Dn(()=>N.clearActiveReviewTarget(),void 0)}},Ce=(v,w)=>{he=v,Oe+=1,B+=1,(w==null?void 0:w.invalidateQueuedNavigation)!==!1&&(ye+=1)},Ue=new Set;let K,oe=!1,Fe=null;const Le=new Map,tt=new Set;let De=null,Pe=null,mt=!1,xt=null,de=0,z=null,Y=null,me=null;const Ve=[],lt=()=>{if(mt||oe)return;mt=!0;const v=()=>{mt=!1,oe||Rt("async-read-settled")};typeof queueMicrotask=="function"?queueMicrotask(v):Promise.resolve().then(v)},gt=250,dn=5e3,Hn=v=>{oe||xt&&de<=v||(xt&&clearTimeout(xt),de=v,xt=setTimeout(()=>{xt=null,de=0,oe||Rt()},Math.max(0,v-Date.now())))},br=new WeakMap;let ur=0;const tr=v=>{if(!v)return"none";let w=br.get(v);return w==null&&(w=ur+=1,br.set(v,w)),`e${w}`};let Br=0;const Lr=e.superdoc,$e=LX(Lr),Bt=()=>
460{$e.abortController.abort("review-mutation-started"),$e.inFlight=null},hn=()=>{$e.generation+=1,$e.abortController=new AbortController,$e.inFlight=null},Pn=v=>{const w=$e.activeMutationTokens;if(typeof v!="string"||v.length===0||w.has(v))return;const A=w.size===0;w.add(v),A&&Bt()},jn=v=>{const w=$e.activeMutationTokens;typeof v!="string"||!w.delete(v)||w.size===0&&hn()},Lt=v=>{var nt;const w=V(),A=w==null?void 0:w.listTrackedChanges;if(typeof A!="function")return((nt=C())==null?void 0:nt.editorVersion)===2?Promise.reject(new Error("v2-tracked-changes-bridge-pending")):v();if($e.activeMutationTokens.size>0)return Promise.reject(new Error("ui-review-catalog-superseded"));const N=$e.generation,j=$e.inFlight;if((j==null?void 0:j.generation)===N)return j.promise;const G=$e.abortController.signal,ce=ht=>{if(G.aborted||N!==$e.generation||(ht==null?void 0:ht.reason)==="review-hydration-superseded")throw new Error("ui-review-catalog-superseded");return ht},we=A.call(w,{blocking:!1,signal:G});if(!zo(we))return ce(we);const Re=Promise.resolve(we).then(ce);return $e.inFlight={generation:N,promise:Re},Re.then(()=>{var ht;((ht=$e.inFlight)==null?void 0:ht.promise)===Re&&($e.inFlight=null)},()=>{var ht;((ht=$e.inFlight)==null?void 0:ht.promise)===Re&&($e.inFlight=null)}),Re};let St=null,Te=new Set,qe=null,it=0,Et=null;const $t=new WeakSet,sn=new WeakMap,Tn=v=>{if(sn.has(v))return;const w=typeof v.getLocalMutationRevision=="function"?Dn(()=>v.getLocalMutationRevision(),null):null,A=typeof w=="number"?w:0;sn.set(v,A),A>0?$t.add(v):w===0&&$t.delete(v)},kn=()=>{const v=M();return v?(Tn(v),$t.has(v)):!1},rn=()=>`${tr(C())}|m${Br}`,Wn=()=>{St=null,Te=new Set},qr=v=>{for(const w of["trackChanges","trackChanges:all"]){const A=Le.get(w);if(!(A!=null&&A.hasSettled)||!Array.isArray(A.value))continue;const N=A.value.filter(j=>{const G=Es(j);return!G||!v.has(G)});N.length!==A.value.length&&Le.set(w,{...A,value:N})}},Yr=v=>{var G;const w=()=>{if(!oe)for(const ce of[...Ue])ce(K)},A=Jv(v)?v:null,N=(G=C())==null?void 0:G.documentMutationReadiness,j=()=>{const ce=globalThis.requestAnimationFrame;return typeof ce!="function"?Promise.resolve():new Promise(we=>{let Re=!1;const nt=()=>{Re||(Re=!0,clearTimeout(ht),we())},ht=setTimeout(nt,250);ce(()=>ce(()=>setTimeout(nt,0)))})};if((A==null?void 0:A.success)===!0&&typeof A.txId=="string"&&A.txId.length>0&&typeof(N==null?void 0:N.whenPainted)=="function")try{Promise.resolve(N.whenPainted.call(N,A)).then(j,()=>{}).then(w,w);return}catch{}w()},gi=(v,w)=>{const A=K.trackChanges,N=A.items.filter(ce=>{const we=Es(ce);return!we||!v.has(we)});if(N.length===A.items.length)return;he&&v.has(he.id)&&Ce(null);const j=new Set;for(const ce of N){const we=w0(ce),Re=ce,nt=we.author??we.authorEmail??Re.author??Re.authorEmail;typeof nt=="string"&&j.add(nt)}const G=A.items.length-N.length;K={...K,trackChanges:{...A,items:N,total:Math.max(N.length,A.total-G),activeId:A.activeId&&v.has(A.activeId)?null:A.activeId,authors:[...j]}},Yr(w)},Jn=v=>{const w=K.trackChanges,A=w.items.length>0||w.total!==0||w.activeId!==null||w.authors.length>0;qe=rn(),he!==null&&Ce(null),K={...K,trackChanges:{...w,items:[],total:0,activeId:null,authors:[]}},A&&Yr(v)},Tr=(v,w)=>{if(v.size===0)return;const A=rn(),N=St===A?Te:new Set,j=new Set([...v].filter(G=>!N.has(G)));j.size!==0&&(St=A,Te=new Set([...N,...j]),qr(Te),gi(j,w))},zr=v=>St===v&&Te.size>0?Te:null,Kn=v=>{const w=rn(),A=zr(w),N=v.map(b0).filter(j=>{if(j==null)return!1;const G=Es(j);return G!=null&&!(A!=null&&A.has(G))});for(const j of["trackChanges","trackChanges:all"])Le.set(j,{token:w,value:[...N],hasSettled:!0,inflightToken:null})},Gn=()=>`${rn()}|m${Ei()}|s${it}`,ni=v=>JSON.stringify({t:v.target??null,s:v.selectionTarget??null}),Di=["contentControls:inRange:","query:","effInline:"],Ro=120,Si=180,Gs=()=>{var N;const v=M(),w=v==null?void 0:v.getDocumentLoadingSnapshot;if(typeof w!="function")return"unknown";const A=(N=Dn(()=>w.call(v),null))==null?void 0:N.sourceStage;return A==="opening"||A==="bootstrap-ready"||A==="source-loading"?"loading":A==="source-complete"||A==="source-failed"||A==="source-cancelled"?"complete":"unknown"},Oo=new Map,Hi=new Map,cn=new Map;let Fn=null;const dr={comments:0,trackChanges:0,contentControls:0},rr=v=>{const w=rn();Oo.get(v)!==w&&(Oo.set(v,w),lt())},je=()=>
460{const v=Le.get("comments");return v!=null&&v.hasSettled?Array.isArray(v.value)&&v.value.length>0:(v==null?void 0:v.inflightToken)!=null},Je=(v,w)=>Oo.get(v)===w,Ut=()=>{const v=rn();let w=!1;for(const[A,N]of Hi){if(N!==v){Hi.delete(A);continue}if(cn.get(A)===v)continue;const j=Le.get(A);!(j!=null&&j.hasSettled)||j.token!==v||j.inflightToken!=null||(Le.set(A,{...j,token:null,inflightToken:null}),cn.set(A,v),w=!0)}w&&lt()},un=v=>{dr[v]+=1,rr(v);let w=!1;return()=>{w||(w=!0,dr[v]=Math.max(0,dr[v]-1),dr[v]===0&&Oo.get(v)===rn()&&Oo.delete(v),lt())}},Xt=v=>{rr("contentControls")},Zn=()=>{const v=Le.get("trackChanges");v!=null&&v.hasSettled||(v==null?void 0:v.inflightToken)!=null||rr("trackChanges")},Bi=()=>{const v=Le.get("comments");v!=null&&v.hasSettled||(v==null?void 0:v.inflightToken)!=null||rr("comments")},ri=6500,ot=250;let jt=0,gr=0,$n=!1,Pr=null;const ui=()=>{if(oe||Pr)return;const v=()=>{if(Pr=null,oe)return;const w=Date.now()-jt;if(er()||w<ri){Pr=setTimeout(v,ot);return}$n=!1,Rt()};Pr=setTimeout(v,0)};let jr=null,Zr=null;const ro=()=>{const v=M();if(!v||jr===v)return;Zr&&(Zr(),Zr=null),jr=v;const w=v.subscribeDocumentLoading;if(typeof w!="function"){jr=null,is(ri);return}try{const A=G=>{const ce=G==null?void 0:G.sourceStage;(ce==="source-complete"||ce==="source-failed"||ce==="source-cancelled")&&(Fn=rn(),Ut(),jt=Math.max(jt,Date.now()),ui())},N=w.call(v,A);typeof N=="function"&&(Zr=N);const j=v.getDocumentLoadingSnapshot;typeof j=="function"&&A(Dn(()=>j.call(v),null))}catch{jr=null,is(ri)}},Go=()=>{var N;const v=(N=C())==null?void 0:N.host,w=v==null?void 0:v.getForegroundMutationState;if(typeof w!="function")return null;const A=Dn(()=>w.call(v),null);return{active:typeof(A==null?void 0:A.active)=="number"?A.active:0,pending:typeof(A==null?void 0:A.pending)=="number"?A.pending:0}},er=()=>{const v=Go();return!!(v&&(v.active>0||v.pending>0))},is=(v=Ro)=>{oe||z||(z=setTimeout(()=>{if(z=null,oe)return;if(er()){is();return}const w=Y;Y=null,w===Gn()&&ta("selection",w,Xd,vs),Rt()},v))},di=(v,w)=>{if(!Go())return!1;const A=`${v}\0${w}`;return tt.has(A)?!1:(tt.add(A),is(Si),!0)},Hr=v=>{if(De==null||v===De)return Pe!=null&&Pe.timer&&clearTimeout(Pe.timer),Pe=null,De=v,!1;if((Pe==null?void 0:Pe.key)===v)return Pe.ready?(Pe=null,De=v,!1):!0;Pe!=null&&Pe.timer&&clearTimeout(Pe.timer);const w={key:v,ready:!1,timer:null};return w.timer=setTimeout(()=>{oe||Pe!==w||(w.timer=null,w.ready=!0,Rt())},Si),Pe=w,!0},No=v=>uX(v),Mo=()=>{Na(),Rt()};let Ti=null,_o=null,yn=!1,Nn=0,yr=!1,fr=0;const Ri=()=>{Ti=null,yn=!1,Nn+=1},Co=()=>{_o=null,yr=!1,fr+=1},uu=()=>{const v=C(),w=v==null?void 0:v.documentMutationReadiness;if(!v||typeof(w==null?void 0:w.whenPainted)!="function"||(Ti={editor:v,readiness:w,afterEpoch:typeof w.getRenderEpoch=="function"?Dn(()=>w.getRenderEpoch.call(w),null):null},yn))return;yn=!0;const A=Nn;(async()=>{for(;!oe&&A===Nn;){const j=Ti;if(Ti=null,!j){yn=!1;return}let G=!1;try{await j.readiness.whenPainted.call(j.readiness,typeof j.afterEpoch=="number"?{afterEpoch:j.afterEpoch}:void 0),G=!0}catch{}if(oe||A!==Nn)return;if(C()!==j.editor){Ri();return}G&&Mo()}})()},nc=()=>{const v=C(),w=v==null?void 0:v.documentMutationReadiness;if(!v||typeof(w==null?void 0:w.whenPainted)!="function")return!1;if(_o={editor:v,readiness:w,afterEpoch:typeof w.getRenderEpoch=="function"?Dn(()=>w.getRenderEpoch.call(w),null):null},yr)return!0;yr=!0;const A=fr;return(async()=>{for(;!oe&&A===fr;){const j=_o;if(_o=null,!j){yr=!1;return}let G=!1;try{await j.readiness.whenPainted.call(j.readiness,typeof j.afterEpoch=="number"?{afterEpoch:j.afterEpoch}:void 0),G=!0}catch{}if(oe||A!==fr)return;if(C()!==j.editor){Co();return}_o||(it+=1,rc(),Rt(G?"post-paint-selection":"post-paint-selection-failed"))}})(),!0},Oa=()=>{me&&clearTimeout(me),me=setTimeout(()=>{me=null,oe||Mo()},500)},ta=(v,w,A,N)=>{let j;try{j=A()}catch{j=void 0}if(!zo(j)){const we={token:w,value:N(j),hasSettled:!0,inflightToken:null,failedToken:null,failureCount:0,retryAtMs:0};return Le.set(v,we),we}const G=Le.get(v),ce=(G==null?void 0:G.failedToken)===w;return Le.set(v,{token:(G==null?void 0:G.token)??null,value:(G==null?void 0:G.value)??null,hasSettled:(G==null?void 0:G.hasSettled)??!1,inflightToken:w,failedToken:ce?w:null,failureCount:ce?G.failureCount??0:0,retryAtMs:0}),Promise.resolve(j).then(we=>{const Re=Le.get(v);if(!Re||Re.inflightToken!==w)return;Le.set(v,{token:w,value:N(we),hasSettled:!0,inflightToken:null,failedToken:null,failureCount:0,retryAtMs:0});const{sink:nt,workerContext:ht}=Rx();if(nt){const pt=Tf();
460Ve.push({key:v,settledAtMs:pt,commandId:(ht==null?void 0:ht.commandId)??null,commandKind:(ht==null?void 0:ht.commandKind)??null}),NS({stage:"superdoc-ui-async-read-settled",atMs:pt,key:v,settledAtMs:pt,commandId:(ht==null?void 0:ht.commandId)??null,commandKind:(ht==null?void 0:ht.commandKind)??null})}lt()},()=>{const we=Le.get(v);if(!we||we.inflightToken!==w)return;const Re=we.failedToken===w?(we.failureCount??0)+1:1,nt=Math.min(dn,gt*2**Math.min(Re-1,8)),ht=Date.now()+nt;Le.set(v,{...we,inflightToken:null,failedToken:w,failureCount:Re,retryAtMs:ht}),Hn(ht)}),null},ys=(v,w,A,N)=>{const j=Le.get(v);if(j&&j.token===w&&j.hasSettled)return{value:j.value,status:"ready"};if(GX(v)&&!Je(v,w)){if(Gs()==="loading")return $n=!0,ro(),j!=null&&j.hasSettled?{value:j.value,status:"stale"}:{value:null,status:"pending"};if($n)return ui(),j!=null&&j.hasSettled?{value:j.value,status:"stale"}:{value:null,status:"pending"};if(Date.now()-gr<ri)return $n=!0,ui(),j!=null&&j.hasSettled?{value:j.value,status:"stale"}:{value:null,status:"pending"}}if(er())return is(),j!=null&&j.hasSettled?{value:j.value,status:"stale"}:{value:null,status:"pending"};if((j==null?void 0:j.failedToken)===w&&j.inflightToken==null&&(j.retryAtMs??0)>Date.now())return Hn(j.retryAtMs),j.hasSettled?{value:j.value,status:"stale"}:{value:null,status:"pending"};if(!j&&v.startsWith("effInline:")&&Hr(v))return{value:null,status:"pending"};if(!j&&di(v,w))return{value:null,status:"pending"};if(!j||j.inflightToken!==w){const ce=ta(v,w,A,N);if(ce)return{value:ce.value,status:"ready"}}const G=Le.get(v);return G!=null&&G.hasSettled?{value:G.value,status:"stale"}:{value:null,status:"pending"}},du=v=>{for(const w of Le.keys())v(w)&&Le.delete(w)},na=v=>{const w=ni(v),A=J6(v);return new Set([`contentControls:inRange:${w}`,`query:${w}`,...A?[`effInline:${A}`]:[]])},Gu=v=>{const w=na(v);du(A=>Di.some(N=>A.startsWith(N))&&!w.has(A));for(const A of tt){const N=A.split("\0",1)[0];Di.some(j=>N.startsWith(j))&&!w.has(N)&&tt.delete(A)}},Ja=()=>{const v=C();v!==Et&&(Ri(),Co(),Et=v,Le.clear(),xt&&clearTimeout(xt),xt=null,de=0,Pe!=null&&Pe.timer&&clearTimeout(Pe.timer),Pe=null,De=null,T=null,i=null,Y=null,tt.clear(),Oo.clear(),Hi.clear(),cn.clear(),Fn=null,$n=!1,Zr&&Zr(),Zr=null,jr=null,Wn(),qe=null)},Na=()=>{Br+=1,Hi.clear(),cn.clear(),Fn=null,Wn()},Oc=()=>{const v=qe===rn();Na(),v&&(Kn([]),qe=rn()),Rt()},Ts=v=>{var ce;if(typeof v!="string"||v.length===0)return no("insertText requires a non-empty string.","INVALID_INPUT");if(Ei()==="viewing")return no("The document is read-only.","DOCUMENT_READONLY");const w=P(),A=w==null?void 0:w.insert;if(!w||typeof A!="function")return no("insert is unavailable.");const N=(ce=w.selection)==null?void 0:ce.current;if(typeof N!="function")return no("selection.current is unavailable.");const j=we=>{const Re=we&&typeof we=="object"?we:null,nt=(Re==null?void 0:Re.selectionTarget)??(Re==null?void 0:Re.target)??null;return!nt||typeof nt!="object"?no("insertText requires a live selection target.","PRECONDITION_FAILED"):Dn(()=>Pa(A.call(w,{type:"text",value:v,target:nt}),no("insert failed.")),no("insert failed."))};let G;try{G=N.call(w.selection)}catch{return no("insertText could not resolve the live selection.","PRECONDITION_FAILED")}return zo(G)?Promise.resolve(G).then(j,()=>no("insertText could not resolve the live selection.","PRECONDITION_FAILED")):j(G)},fu=(v,w)=>({payload:v,state:K,editor:C(),superdoc:t,context:w,ui:Fe,execute:(A,N)=>Fl(A,N),executeAsync:(A,N)=>mf(A,N),doc:P(),selection:K.selection,documentMode:Ei(),insertText:Ts}),qo=v=>v==="editing"||v==="suggesting"||v==="viewing"?v:null,Ei=()=>{var ce,we;const v=C(),w=t&&typeof t=="object"?t:null,A=qo((ce=w==null?void 0:w.config)==null?void 0:ce.documentMode),N=Dn(typeof(w==null?void 0:w.getActiveRuntime)=="function"?()=>{const Re=w.getActiveRuntime();return typeof(Re==null?void 0:Re.getSnapshot)=="function"?Re.getSnapshot():null}:void 0,null),j=qo(N==null?void 0:N.documentMode),G=qo((we=v==null?void 0:v.options)==null?void 0:we.documentMode);return A&&j&&A!==j?A:j??A??G},Il=()=>{var N,j,G;const v=t&&typeof t=="object"?t:null,w=(N=v==null?void 0:v.interactionConfig)==null?void 0:N.comments;if(w&&typeof w.readOnly=="boolean")return w.readOnly===!0;const A=(G=(j=v==null?void 0:v.config)==null?void 0:j.modules)==null?void 0:G.comments;return!!A&&typeof A=="object"&&A.readOnly===!0},Rl=()=>{var w,A;if(Ei()==="viewing")return en.documentReadonly;const v=(A=(w=t&&typeof t=="object"?t:null)==null?void 0:w.interactionConfig)==null?void 0:A.trackedChanges;return v&&typeof v.allowDecisions=="boolean"?v.allowDecisions?void 0:en.trackedChangeDecisionsDisabled:Il()?en.documentReadonly:void 0},bh=()=>{var N,j,G;const v=t&&typeof t=="object"?t:null,w=(N=v==null?void 0:v.interactionConfig)==null?void 0:N.comments;
460if(w&&typeof w.allowResolve=="boolean")return w.allowResolve===!1;const A=(G=(j=v==null?void 0:v.config)==null?void 0:j.modules)==null?void 0:G.comments;return!!A&&typeof A=="object"&&A.allowResolve===!1},hu=()=>Il(),Nc=()=>Rl()!=null,vs=v=>v&&typeof v=="object"?v:null,el=(v,w)=>{if(!v)return{...VX,status:w};const A=v.target??null,N=typeof v.text=="string"?v.text:"";return{status:w,empty:v.empty===!0,target:A,selectionTarget:v.selectionTarget??null,activeMarks:Array.isArray(v.activeMarks)?v.activeMarks:[],activeCommentIds:Array.isArray(v.activeCommentIds)?v.activeCommentIds:[],activeChangeIds:Array.isArray(v.activeChangeIds)?v.activeChangeIds:[],quotedText:N}},Mc=()=>{var w;const v=(w=P())==null?void 0:w.selection;return ys("selection",Gn(),()=>v!=null&&v.current?v.current({includeText:!0}):void 0,vs)},So=()=>{const{value:v,status:w}=Mc();return el(v,w)},Xd=()=>{var w;const v=(w=P())==null?void 0:w.selection;return v!=null&&v.current?v.current({includeText:!0}):void 0},Zd=v=>{if(v.empty!==!0)return!1;const w=v.selectionTarget,A=w==null?void 0:w.start,N=w==null?void 0:w.end;return(A==null?void 0:A.kind)==="text"&&(N==null?void 0:N.kind)==="text"&&typeof A.blockId=="string"&&A.blockId===N.blockId&&typeof A.offset=="number"&&A.offset===N.offset},rc=v=>{const w=M(),A=w==null?void 0:w.readLiveSelectionSyncSnapshot;if(typeof A!="function")return;const N=vs(Dn(()=>A.call(w),null));if(!N||!Zd(N))return;const j=Gn(),G=Go(),ce=!!(G&&(G.active>0||G.pending>0));if(ce)Y=j,is();else if(Y=null,ta("selection",j,Xd,vs))return;const we=Le.get("selection"),Re=Array.isArray(N.activeMarks)&&N.activeMarks.length>0?N.activeMarks:Array.isArray(K.selection.activeMarks)?K.selection.activeMarks:[],nt=Array.isArray(N.activeCommentIds)?N.activeCommentIds:[],ht=KX(v),pt=Au(K.selection),It=qb(N.selectionTarget)??qb(N.target),Vt=pt==null?void 0:pt.range,zt=It==null?void 0:It.range,Dt=!!(G&&G.active>0&&pt&&It&&pt.blockId===It.blockId&&co(pt.story)===co(It.story)&&typeof(Vt==null?void 0:Vt.start)=="number"&&typeof(zt==null?void 0:zt.start)=="number"&&Math.abs(zt.start-Vt.start)<=2),Ht=ht!=null||Dt?K.selection.activeChangeIds.filter(Tt=>ht==null||xd(K.trackChanges.items).aliasesFor(Tt).includes(ht)):[],qt=Array.isArray(N.activeChangeIds)&&N.activeChangeIds.length>0?N.activeChangeIds:Ht;Le.set("selection",{token:j,value:{...N,activeMarks:Re,activeCommentIds:nt,activeChangeIds:qt},hasSettled:!0,inflightToken:ce?null:(we==null?void 0:we.inflightToken)??null})},qu=async(v=0)=>{var G;const w=(G=P())==null?void 0:G.selection,A=w==null?void 0:w.current,N=Gn();if(typeof A!="function")return Le.set("selection",{token:N,value:null,hasSettled:!0,inflightToken:null}),Rt(),K.selection;let j;try{j=A.call(w,{includeText:!0}),zo(j)&&(j=await Promise.resolve(j))}catch{j=null}return oe?el(null,"pending"):Gn()!==N?v<1?qu(v+1):K.selection:(Le.set("selection",{token:N,value:vs(j),hasSettled:!0,inflightToken:null}),Rt(),K.selection)},Qd=()=>{var w;const v=(w=P())==null?void 0:w.comments;return ys("comments",rn(),()=>v!=null&&v.list?v.list():void 0,A=>A&&Array.isArray(A.items)?A.items:[])},Dc=(v="trackChanges")=>{var ce;const w=rn(),A=(ce=P())==null?void 0:ce.trackChanges,N=V(),j=typeof(N==null?void 0:N.listTrackedChanges)=="function"?N.listTrackedChanges:null,G=ys(v,w,()=>j?Lt(()=>{var we;return(we=A==null?void 0:A.list)==null?void 0:we.call(A,{in:"all"})}):A!=null&&A.list?A.list({in:"all"}):void 0,we=>{const Re=we&&typeof we=="object"?we:null;if((Re==null?void 0:Re.complete)===!1||(Re==null?void 0:Re.sourceCoverageComplete)===!1){if(Hi.set(v,w),ro(),Fn===w||Gs()==="complete"){const nt=()=>{oe||Ut()};typeof queueMicrotask=="function"?queueMicrotask(nt):Promise.resolve().then(nt)}}else Hi.get(v)===w&&Hi.delete(v);return Re&&Array.isArray(Re.items)?Re.items:[]});return Hi.get(v)===w&&G.status==="ready"?{...G,status:"stale"}:G},sm=v=>{const w=F(),A=H(),N=A?null:Qd(),j=A&&Array.isArray(w==null?void 0:w.commentItems)?w.commentItems:null,G=A?j:N.value,ce=A?te(w):N.status,we=G??[],Re=v.activeCommentIds,nt=Le.get("
460comments"),ht=(nt==null?void 0:nt.token)===rn()&&nt.hasSettled&&Array.isArray(nt.value)?nt.value:null,pt=dr.comments>0?ht:we;Be&&pt&&!pt.some(Vt=>Es(Vt)===Be)&&(Be=null);const It=Be??Re[0]??null;return{status:up(ce,v.status),listStatus:ce,items:we,total:we.length,activeIds:Re,activeId:It}},Jd=new WeakMap,ic=v=>{const w=Jd.get(v);if(w)return w;const A=v.map(b0).filter(N=>N!=null);return Jd.set(v,A),A},Wu=new WeakMap,Ma=(v,w)=>{const A=Wu.get(v);if((A==null?void 0:A.suppressedIds)===w)return A.value;const N=w?v.filter(j=>{const G=Es(j);return!G||!w.has(G)}):v;return Wu.set(v,{suppressedIds:w,value:N}),N},Ku=new WeakMap,ef=v=>{const w=Ku.get(v);if(w)return w;const A=new Set;for(const j of v){const G=w0(j),ce=j,we=G.author??G.authorEmail??ce.author??ce.authorEmail;typeof we=="string"&&A.add(we)}const N=[...A];return Ku.set(v,N),N},ra=()=>{var N;const v=rn();if(H()){const j=Le.get("trackChanges"),G=(j==null?void 0:j.token)===v&&j.hasSettled&&Array.isArray(j.value)?j.value:(N=F())==null?void 0:N.trackedChangeItems;return Array.isArray(G)?ic(G):null}const{value:w,status:A}=Dc("trackChanges:all");return A==="ready"?ic(w??[]):null},wh=v=>{const w=rn(),A=zr(w),N=F(),j=H(),G=j?null:Dc(),ce=j&&Array.isArray(N==null?void 0:N.trackedChangeItems)?N.trackedChangeItems:null,we=j?ce:G.value,Re=j?te(N):G.status,nt=Ma(ic(we??[]),A),ht=ra(),pt=he;if(pt&&!be.has(pt)){const kt=Le.get("trackChanges"),xn=(kt==null?void 0:kt.token)===w&&kt.hasSettled&&Array.isArray(kt.value)?Ma(ic(kt.value),A):null,or=dr.trackChanges>0?xn:pt.story?ht:nt;or&&!or.some(hr=>
460vc(hr,pt.id,pt.story))&&Ce(null)}const It=ht??nt,Vt=mp(It,Eu(v)),zt=qe===w?[]:A?v.activeChangeIds.filter(kt=>!A.has(kt)):v.activeChangeIds,Dt=zt.map(kt=>Vt.toPublicId(kt)??kt),Ht=he!=null&&he.story?mp(It,he.story):xd(It),qt=he?Ht.toPublicId(he.id)??he.id:null,Tt=ZX({selectionIds:zt,publicIds:Dt,selection:v,bodyItems:nt,allStoryItems:ht}),Wt=qt??Tt;return{status:up(Re,v.status),items:nt,total:nt.length,activeId:Wt,authors:ef(nt)}},am=(v,w)=>{if(!H())return w;rr("comments");const A=Qd(),N=A.value??w.items;return{status:up(A.status,v.status),listStatus:A.status,items:N,total:N.length,activeIds:v.activeCommentIds,activeId:Be??v.activeCommentIds[0]??null}},tf=(v,w)=>{if(!H())return w;rr("trackChanges");const A=Dc(),N=zr(rn()),j=Ma(ic(A.value??w.items),N),G=he!=null&&he.story?mp(j,he.story):xd(j),ce=he?G.toPublicId(he.id)??he.id:w.activeId;return{status:up(A.status,v.status),items:j,total:j.length,activeId:ce,authors:ef(j)}};let Yu=null,xh=[];const nf=(v,w)=>{const A=rn();return w==="ready"?(Yu=A,xh=v,{items:v,status:w}):w==="pending"&&Yu===A?{items:xh,status:"stale"}:{items:v,status:w}},kh=v=>{var pt;const w=(pt=P())==null?void 0:pt.contentControls,{value:A,status:N}=ys("contentControls",rn(),()=>w!=null&&w.list?w.list():void 0,It=>It&&Array.isArray(It.items)?It.items:[]),j=A??[],{items:G,status:ce}=_h(w,v),we=new Map(G.map(It=>[It.id,It])),Re=new Set(j.map(It=>It.id)),nt=[...j.map(It=>we.get(It.id)??It),...G.filter(It=>!Re.has(It.id))],ht=G.map(It=>It.id);return{status:up(N,ce,v.status),items:nt,total:nt.length,activeId:ht[0]??null,activeIds:ht}},pu=(v,w)=>{if(!v||typeof v.listInRange!="function")return{lockModesById:new Map,rows:[],status:"ready"};const A=JX(w);if(!A)return{lockModesById:new Map,rows:[],status:"ready"};const{value:N,status:j}=ys(`contentControls:inRange:${ni(w)}`,rn(),()=>v.listInRange(A),we=>we&&Array.isArray(we.items)?we.items:[]),G=N??[],ce=new Map;for(const we of G)typeof(we==null?void 0:we.id)=="string"&&ce.set(we.id,typeof we.lockMode=="string"?we.lockMode:"unlocked");return{lockModesById:ce,rows:G,status:j}},_h=(v,w)=>{const{rows:A,status:N}=pu(v,w),j=w.selectionTarget,G=w.target;let ce=j==null?void 0:j.start;if(j){if(j.kind!=="selection"||(ce==null?void 0:ce.kind)!=="text"||typeof ce.blockId!="string"||typeof ce.offset!="number")return nf([],N)}else{const Dt=(G==null?void 0:G.kind)==="text"&&Array.isArray(G.segments)?G.segments[0]:void 0,Ht=Dt==null?void 0:Dt.range;if(typeof(Dt==null?void 0:Dt.blockId)!="string"||typeof(Ht==null?void 0:Ht.start)!="number")return nf([],N);ce={kind:"text",blockId:Dt.blockId,offset:Ht.start,story:G==null?void 0:G.story}}const we=((G==null?void 0:G.coordinateSpace)!=="tracked"&&Array.isArray(G==null?void 0:G.segments)?G.segments:[]).find(Dt=>Dt.blockId===ce.blockId),Re=we==null?void 0:we.range,nt=we&&typeof we.blockId=="string"&&typeof(Re==null?void 0:Re.start)=="number"?{blockId:we.blockId,offset:Re.start,story:(G==null?void 0:G.story)??ce.story}:null,ht=(j?j.coordinateSpace:G==null?void 0:G.coordinateSpace)==="tracked"?"tracked":"visible",pt=ht==="tracked"?nt:ce,It=fs(w),Vt=It.indexOf((pt??ce).blockId),zt=A.map((Dt,Ht)=>({item:Dt,index:Ht})).filter(({item:Dt})=>{const Ht=Dt.selectionTarget,qt=(Ht==null?void 0:Ht.coordinateSpace)==="tracked"?"tracked":"visible";if(qt==="tracked"&&ht!=="tracked")return!1;const Tt=qt==="tracked"?ce:pt;if(!Tt)return!1;const Wt=Ht==null?void 0:Ht.start,kt=Ht==null?void 0:Ht.end;if((Ht==null?void 0:Ht.kind)!=="selection"||(Wt==null?void 0:Wt.kind)!=="text"||(kt==null?void 0:kt.kind)!=="text"||typeof Wt.blockId!="string"||typeof kt.blockId!="string"||typeof Wt.offset!="number"||typeof kt.offset!="number"||co(Ht.story??Wt.story??kt.story)!==co((j==null?void 0:j.story)??Tt.story))return!1;if(Wt.blockId===kt.blockId){if(Tt.blockId!==Wt.blockId)return!1;const hr=Math.min(Wt.offset,kt.offset),Yn=Math.max(Wt.offset,kt.offset);return hr===Yn?Tt.offset===hr:Tt.offset>=hr&&Tt.offset<Yn}if(Tt.blockId===Wt.blockId)return Tt.offset>=Wt.offset;if(Tt.blockId===kt.blockId)return Tt.offset<kt.offset;if(Vt===-1)return!1;const xn=It.indexOf(Wt.blockId),or=It.indexOf(kt.blockId);return xn!==-1&&or!==-1?Vt>Math.min(xn,or)&&Vt<Math.max(xn,or):xn!==-1?Vt>xn:or!==-1?Vt<or:!0}).sort((Dt,Ht)=>{const qt=Dt.item.selectionTarget,Tt=Ht.item.selectionTarget,Wt=qt.start.kind==="text"&&qt.end.kind==="text"&&qt.start.blockId===qt.end.blockId,kt=Tt.start.kind==="text"&&Tt.end.kind==="text"&&Tt.start.blockId===Tt.end.blockId;if(Wt!==kt)return Wt?-1:1;if(Dt.item.kind!==Ht.item.kind)return Dt.item.kind==="inline"?-1:1;if(Wt&&kt&&qt.start.kind==="text"&&qt.end.kind==="text"&&Tt.start.kind==="text"&&Tt.end.kind==="text"){const xn=Math.abs(qt.end.offset-qt.start.offset),or=Math.abs(Tt.end.offset-Tt.start.offset);if(xn!==or)return xn-or}return Ht.index-Dt.index}).map(({item:Dt})=>Dt);return nf(zt,N)},rf=()=>{const v=t==null?void 0:t.fonts;return{options:AZ(SZ(Dn(v!=null&&v.getDocumentFontOptions?()=>v.getDocumentFontOptions():void 0,[])),EZ(Dn(v!=null&&v.getFontFamilyOptions?()=>v.getFontFamilyOptions():void 0,[]))),sizeOptions:TZ}},Ch=()=>{const v=Dn(t!=null&&t.getZoomState?()=>t.getZoomState():void 0,null),w=typeof(v==null?void 0:v.value)=="number"?v.value:100,A=v==null?void 0:v.mode;return{mode:A==="manual"||A==="fit-width"?A:A==="fixed"?"manual":null,value:w,min:typeof(v==null?void 0:v.min)=="number"?v.min:10,max:typeof(v==null?void 0:v.max)=="number"?v.max:100}},lm=()=>Dn(t!=null&&t.getMeasurementUnit?()=>t.getMeasurementUnit():void 0,"in")==="cm"?"cm":"in",Sh=()=>{const v=C(),w=v?v.isDirty:void 0;return{ready:v!=null,mode:Ei(),dirty:v?w===void 0?kn():!!w:!1}},bs=v=>{const w=v.quotedText;
460if(typeof w!="string"||w.length===0)return null;const A=q0(v);if(A.length===0||!Nm(A.map(G=>G.blockId)))return null;const N=v.target,j=A.length===1?Ca(A[0].blockId,N==null?void 0:N.story):void 0;return{select:{type:"text",pattern:w,mode:"contains",caseSensitive:!0},...j?{within:j}:{},require:"any"}},Lc=v=>{var j;const w=(j=P())==null?void 0:j.query;if(typeof(w==null?void 0:w.match)!="function")return null;const A=bs(v);if(!A)return null;const{value:N}=ys(`query:${ni(v)}`,rn(),()=>w.match(A),G=>G&&typeof G=="object"?G:null);return e8(N,v)},Xu=v=>{var Dt,Ht;const w=M(),A=new Set(fs(v));if(A.size===0)return{};const N=w==null?void 0:w.readMountedProjectionBlocksByIds,j=w==null?void 0:w.readMountedProjectionBlocks;if(typeof N!="function"&&typeof j!="function")return{};const G=Dn(()=>{if(typeof N!="function")return j.call(w);const qt=Tu(v);return qt?N.call(w,[...A],qt):N.call(w,[...A])},null);if(!Array.isArray(G))return{};const ce=jS(G),we=qt=>{const Tt={},Wt=PS(qt.fontFamily);Wt&&(Tt.fontFamily=Wt);const kt=uZ(qt.fontSize);return kt&&(Tt.fontSize=kt),typeof qt.color=="string"&&qt.color.trim()!==""&&(Tt.color=qt.color.trim().toUpperCase()),typeof qt.highlight=="string"&&qt.highlight.trim()!==""&&(Tt.highlight=qt.highlight.trim().toUpperCase()),Tt},Re=Au(v),nt=Re&&typeof((Dt=Re.range)==null?void 0:Dt.start)=="number"?Re.range.start:null;if(Re&&nt!==null&&A.has(Re.blockId)){const qt=ce.find(Wt=>Mm(Wt,Re.blockId)),Tt=qt&&Array.isArray(qt.runs)?qt.runs:null;if(Tt&&Tt.length>0&&Tt.every(Wt=>(Wt==null?void 0:Wt.kind)==="text"||(Wt==null?void 0:Wt.kind)==="tab")){let Wt=0,kt=null;for(const xn of Tt){const or=Mw(xn);if(nt>=Wt&&nt<Wt+or){kt=xn;break}Wt+=or}if(!kt){for(let xn=Tt.length-1;xn>=0&&!kt;xn-=1)((Ht=Tt[xn])==null?void 0:Ht.kind)==="text"&&(kt=Tt[xn]);kt??(kt=Tt[Tt.length-1]??null)}return kt?we(kt):{}}}const ht=q0(v);if(ht.length>0){const qt=new Set,Tt=new Set;let Wt=!1,kt=!0;for(const xn of ht){const or=ce.find(vi=>Mm(vi,xn.blockId));if(!or)return{};const hr=Array.isArray(or.runs)?or.runs:[];if(hr.length===0)continue;if(!hr.every(vi=>(vi==null?void 0:vi.kind)==="text"||(vi==null?void 0:vi.kind)==="tab")){kt=!1;break}let Yn=0;for(const vi of hr){const Yi=Mw(vi),Cs=Yn,Ns=Yn+Yi;if(Cs<xn.end&&Ns>xn.start){Wt=!0;const Xi=we(vi);Xi.fontFamily&&qt.add(Xi.fontFamily),Xi.fontSize&&Tt.add(Xi.fontSize)}Yn=Ns}}if(kt&&Wt){const xn={};return qt.size===1&&(xn.fontFamily=[...qt][0]),Tt.size===1&&(xn.fontSize=[...Tt][0]),xn}}const pt=new Set,It=new Set;let Vt=!1;for(const qt of ce){if(![...A].some(Wt=>Mm(qt,Wt)))continue;const Tt=Array.isArray(qt.runs)?qt.runs:[];for(const Wt of Tt){if((Wt==null?void 0:Wt.kind)!=="text")continue;Vt=!0;const kt=we(Wt);kt.fontFamily&&pt.add(kt.fontFamily),kt.fontSize&&It.add(kt.fontSize)}}if(!Vt)return{};
460const zt={};return pt.size===1&&(zt.fontFamily=[...pt][0]),It.size===1&&(zt.fontSize=[...It][0]),zt},of=v=>{var zt,Dt;const w=M(),A=new Set(fs(v));if(A.size===0)return{};const N=w==null?void 0:w.readMountedProjectionBlocksByIds,j=w==null?void 0:w.readMountedProjectionBlocks;if(typeof N!="function"&&typeof j!="function")return{};const G=Dn(()=>{if(typeof N!="function")return j.call(w);const Ht=Tu(v);return Ht?N.call(w,[...A],Ht):N.call(w,[...A])},null);if(!Array.isArray(G))return{};const ce=jS(G),we=Ht=>({bold:Ht.bold===!0,italic:Ht.italic===!0,underline:Ht.underline!=null,strikethrough:Ht.strike===!0}),Re=Ht=>{const qt={};for(const Tt of Qv){const Wt=Ht[Tt];Wt.size===1&&(qt[Tt]=[...Wt][0])}return qt},nt=Au(v),ht=nt&&typeof((zt=nt.range)==null?void 0:zt.start)=="number"?nt.range.start:null;if(nt&&ht!==null&&A.has(nt.blockId)){const Ht=ce.find(Tt=>Mm(Tt,nt.blockId)),qt=Ht&&Array.isArray(Ht.runs)?Ht.runs:null;if(qt&&qt.length>0&&qt.every(Tt=>(Tt==null?void 0:Tt.kind)==="text"||(Tt==null?void 0:Tt.kind)==="tab")){let Tt=0,Wt=null;for(const kt of qt){const xn=Mw(kt);if(ht>=Tt&&ht<Tt+xn){Wt=kt;break}Tt+=xn}if(!Wt){for(let kt=qt.length-1;kt>=0&&!Wt;kt-=1)((Dt=qt[kt])==null?void 0:Dt.kind)==="text"&&(Wt=qt[kt]);Wt??(Wt=qt[qt.length-1]??null)}return Wt?we(Wt):{}}}const pt=q0(v);if(pt.length>0){const Ht={bold:new Set,italic:new Set,underline:new Set,strikethrough:new Set};let qt=!1,Tt=!0;for(const Wt of pt){const kt=ce.find(hr=>Mm(hr,Wt.blockId));if(!kt)return{};const xn=Array.isArray(kt.runs)?kt.runs:[];if(xn.length===0)continue;if(!xn.every(hr=>(hr==null?void 0:hr.kind)==="text"||(hr==null?void 0:hr.kind)==="tab")){Tt=!1;break}let or=0;for(const hr of xn){const Yn=Mw(hr),vi=or,Yi=or+Yn;if(vi<Wt.end&&Yi>Wt.start){qt=!0;const Cs=we(hr);for(const Ns of Qv)Ht[Ns].add(Cs[Ns])}or=Yi}}if(Tt&&qt)return Re(Ht)}const It={bold:new Set,italic:new Set,underline:new Set,strikethrough:new Set};let Vt=!1;for(const Ht of ce){if(![...A].some(Tt=>Mm(Ht,Tt)))continue;const qt=Array.isArray(Ht.runs)?Ht.runs:[];for(const Tt of qt){if((Tt==null?void 0:Tt.kind)!=="text")continue;Vt=!0;const Wt=we(Tt);for(const kt of Qv)It[kt].add(Wt[kt])}}return Vt?Re(It):{}},sf=(v,w)=>{if(w.fontFamily!==void 0&&w.fontSize!==void 0&&w.color!==void 0&&w.highlight!==void 0)return{values:w,effectiveUniformityStatus:"ready"};const A=Xu(v),N={...A.fontFamily!==void 0?{fontFamily:A.fontFamily}:{},...A.fontSize!==void 0?{fontSize:A.fontSize}:{},...A.color!==void 0?{color:A.color}:{},...A.highlight!==void 0?{highlight:A.highlight}:{},...w};if(!v.empty&&(N.fontFamily===void 0||N.fontSize===void 0)){const j=Eh(v);return j.values&&(N.fontFamily===void 0&&j.values.fontFamily!==void 0&&(N.fontFamily=j.values.fontFamily),N.fontSize===void 0&&j.values.fontSize!==void 0&&(N.fontSize=j.values.fontSize)),{values:N,effectiveUniformityStatus:j.status}}return{values:N,effectiveUniformityStatus:"ready"}},mu=["fontFamily","fontSize","bold","italic","underline","strikethrough"],af=v=>{const w=v.selectionTarget;if(!w)return{value:null,status:"ready"};const A=jo(P(),"format.readEffectiveInlineUniformity");if(!A)return{value:null,status:"ready"};const N=J6(v)??ni(v);return ys(`effInline:${N}`,rn(),()=>A({target:w,offsetSpace:"selection",keys:mu}),j=>j&&typeof j=="object"?j:null)},Eh=v=>{const{value:w,status:A}=af(v);if(!w||w.success!==!0)return{values:null,status:A};const N=w.values,j=G=>{const ce=N==null?void 0:N[G];if(!(!ce||ce.state!=="uniform"||typeof ce.value!="string"))return G==="fontFamily"?PS(ce.value):ce.value};return{values:{fontFamily:j("fontFamily"),fontSize:j("fontSize")},status:A}},Pc=v=>{const{value:w,status:A}=af(v);if(!w||w.success!==!0)return{values:null,status:A};const N=w.values,j={};for(const G of Qv){const ce=N==null?void 0:N[G];(ce==null?void 0:ce.state)==="uniform"&&(ce.value==="true"||ce.value==="false")&&(j[G]=ce.value==="true")}return{values:j,status:A}},Ah=(v,w)=>{const A=v.activeMark;if(!A||!Qv.includes(A))return null;const N=A,j=of(w)[N];if(j!==void 0)return j;const{values:G}=Pc(w),ce=G==null?void 0:G[N];return ce!==void 0?ce:null},Th=async v=>{const w=v.selectionTarget;if(!w)return null;const A=jo(P(),"format.readEffectiveInlineUniformity");if(!A)return null;try{const N=await Promise.resolve(A({target:w,offsetSpace:"selection"}));return N&&typeof N=="object"&&N.success===!0?N:null}catch{return null}},lf=(v,w,A)=>{const N=A.values;for(const j of["fontFamily","fontSize"]){if(w[j]!==void 0)continue;const G=N==null?void 0:N[j];(G==null?void 0:G.state)==="uniform"&&typeof G.value=="string"?v[j]=j==="fontFamily"?PS(G.value):G.value:delete v[j]}},tl=v=>sf(v,t8(Lc(v),v)),nl=v=>tl(v).values,gu=async v=>{var N;const w=(N=P())==null?void 0:N.query,A=bs(v);if(typeof(w==null?void 0:w.match)!="function"||!A)return nl(v);try{const j=await Promise.resolve(w.match(A)),G=t8(e8(j&&typeof j=="object"?j:null,v),v),ce=sf(v,G);if(ce.effectiveUniformityStatus!=="ready"&&(G.fontFamily===void 0||G.fontSize===void 0)){const we=await Th(v);we&&lf(ce.values,G,we)}return ce.values}catch{return nl(v)}},Ol=async v=>{var A;const w=P();if(w)return typeof w.getNode=="function"?await Promise.resolve(w.getNode(v)):await Promise.resolve((A=w.getNodeById)==null?void 0:A.call(w,{nodeId:v.nodeId,nodeType:v.nodeType}))},Ih=v=>{var j;const w=(j=P())==null?void 0:j.query;if(typeof(w==null?void 0:w.match)!="function")return"ready";const A=bs(v);if(!A)return"ready";const{status:N}=ys(`query:${ni(v)}`,rn(),()=>w.match(A),G=>G&&typeof G=="object"?G:null);return N},yu=v=>{const w=tl(v),A=w.values;if(v.empty)return w;const N=Rf(v);return N?v.status==="ready"&&Ih(v)==="ready"&&w.effectiveUniformityStatus==="ready"?(T={key:N,values:A},w):T&&T.key===N?{...w,values:{...T.values,...A}}:w:w},cf=v=>{const w=P(),A=yu(v),N=A.values;v.status==="ready"&&!v.empty&&Ih(v)==="ready"&&A.effectiveUniformityStatus==="ready"&&(S=N,x=`${Um(v)}:${rn()}`);const j=w==null?void 0:w.contentControls,{lockModesById:G}
460=pu(j,v),ce={};for(const we of fn())ce[we]=uf(we,w,v,N,G);return ce},ya=v=>v?en.operationUnavailable:C()?en.documentApiUnavailable:en.notReady,Da=v=>v==="contentLocked"||v==="sdtContentLocked",io=v=>{for(const w of v.values())if(Da(w))return en.contentControlLocked},Rh=(v,w,A,N,j)=>{if(!w)return v.scope==="all"?en.bulkDecisionsDisabled:ya(j);if(A)return A;if(v.scope!=="all"&&N.activeChangeIds.length===0)return en.selectionRequired},Zu=v=>{var j;Ja();let w;if(H()){const G=(j=ra())==null?void 0:j.find(we=>Es(we)===v);if(G)return w0(G);const ce=Le.get("trackChanges");w=ce!=null&&ce.hasSettled&&Array.isArray(ce.value)?ce.value:null}else w=Dc("trackChanges:all").value;const A=w==null?void 0:w.find(G=>Es(G)===v),N=b0(A);return N?w0(N):null},oc=(v,w)=>{const A=t.canPerformPermission;if(typeof A!="function"||w.length===0)return;const N=t.config&&typeof t.config=="object"?t.config.user:null;for(const j of w){const G=Zu(j)??{id:j},ce=WX(G,N),we=v==="accept"?ce?"RESOLVE_OWN":"RESOLVE_OTHER":ce?"REJECT_OWN":"REJECT_OTHER";let Re;try{Re=A.call(t,{permission:we,trackedChange:G,comment:null})}catch{return}if(Re===!1)return en.permissionDenied}},Oh=v=>{var N,j;const w=M(),A=(j=(N=Dn(typeof(w==null?void 0:w.getCapabilities)=="function"?()=>w.getCapabilities():void 0,null))==null?void 0:N.editableSubset)==null?void 0:j.commands;if(Array.isArray(A))return A.find(G=>(G==null?void 0:G.command)===v||(G==null?void 0:G.id)===v)??null;if(A&&typeof A=="object"){const G=A[v];return G&&typeof G=="object"?G:null}return null},sc=(v,w)=>{if(v.scope!=="all"||typeof(w==null?void 0:w[`${v.kind}All`])=="function")return;const A=Oh(`trackedChanges.${v.kind}All`);if(!(A&&(A.status==="supported"||A.enabled===!0)))return en.bulkDecisionsDisabled},uf=(v,w,A,N,j=new Map)=>{var Vt,zt,Dt,Ht,qt,Tt,Wt;if(Ge.has(v))return Rr({supported:!0,enabled:!0,...Dn(Ge.get(v).getState?()=>Ge.get(v).getState(fu(void 0)):void 0,{})},"custom");const G=Ei()==="viewing",ce=V6(v);if(ce&&typeof((zt=(Vt=ge())==null?void 0:Vt.lists)==null?void 0:zt.apply)=="function"){const kt=ve(),xn=typeof(kt==null?void 0:kt.shippedStatus)=="string"?kt.shippedStatus:null,or=xn!=="not-shipped"&&xn!=="disabled",hr=or&&(typeof(kt==null?void 0:kt.enabled)=="boolean"?kt.enabled:!0),Yn=or?Ee(kt):null;return Rr(G?{enabled:!1,active:Yn===ce,supported:or,value:kt==null?void 0:kt.value,reason:en.documentReadonly}:{enabled:hr,active:Yn===ce,supported:or,value:kt==null?void 0:kt.value},"builtin")}const we=Dw(v);if(we){const kt=w==null?void 0:w.trackChanges,xn=typeof(kt==null?void 0:kt.decide)=="function"||typeof(kt==null?void 0:kt[we.kind])=="function",or=typeof(kt==null?void 0:kt.decide)=="function"||typeof(kt==null?void 0:kt[`${we.kind}All`])=="function",hr=we.scope==="all"?or:xn,Yn=sc(we,kt)??Rh(we,hr,Rl(),A,w)??(we.scope==="all"?void 0:oc(we.kind,A.activeChangeIds));return Rr({enabled:Yn==null,active:!1,supported:hr,reason:Yn},"builtin")}if(v==="copy-format")return Ei()==="viewing"?Rr({supported:!0,enabled:!1,active:!1},"builtin"):C()?Rr({supported:!0,enabled:!0,active:m.mode!=="idle"},"builtin"):Rr({supported:!0,enabled:!1,active:!1,reason:en.notReady},"builtin");const Re=R0(v);if(!Re)return Rr({enabled:!1,active:!1,supported:!1,reason:en.commandUnsupported},"unsupported");if(Re.disposition!=="routed")return Rr({enabled:!1,active:!1,supported:!1,reason:Re.reason??en.commandUnsupported},Re.disposition==="unsupported"?"unsupported":"builtin");if(Re.instanceRoute)return En(Re);if(Re.table)return Nl(Re,w,G);if(((Dt=Re.inline)==null?void 0:Dt.kind)==="clear"){if(Re.mutates&&G)return Rr({enabled:!1,active:!1,supported:!0,reason:en.documentReadonly},"builtin");const kt=io(j);if(kt)return Rr({enabled:!1,active:!1,supported:!0,reason:kt},"builtin");const xn=fs(A).length>0||x0(A)!=null;return Rr({enabled:xn,active:!1,supported:!0,reason:xn?void 0:en.selectionRequired},"builtin")}const nt=Re.docRoute;if(!nt)return Rr({enabled:!1,active:!1,supported:!1,reason:en.commandUnsupported},"unsupported");if(jo(w,nt)==null)return Rr({enabled:!1,active:!1,supported:!1,reason:ya(w)},"builtin");const ht=st(v);if(ht){const kt=ht.shippedStatus,xn=kt!=="not-shipped"&&kt!=="disabled",or=typeof ht.enabled=="boolean"?ht.enabled:!0,hr=v==="undo"||v==="redo",Yn=hr&&ht.historyResolved===!1,vi=hr&&xn&&or===!1&&ht.reason===null&&!Yn,Yi=ht.reason===void 0?void 0:vi?en.historyEmpty:Yn?en.notReady:Ox(ht.reason,en.commandUnsupported);return Re.mutates&&G?Rr({enabled:!1,active:!1,supported:xn,reason:en.documentReadonly},"builtin"):Rr({enabled:xn&&or,active:!1,supported:xn,reason:Yi},"builtin")}const pt=pe(Re,w,A),It=xe(Re,w,A,N);if(((Ht=Re.list)==null?void 0:Ht.mode)==="indent"||((qt=Re.list)==null?void 0:qt.mode)==="outde
460nt")return ir(Re,w,G,A,pt,It);if(((Tt=Re.list)==null?void 0:Tt.mode)==="toggle-seed")return ii(Re,w,G,A,pt,It);if(Re.mutates&&G)return Rr({enabled:!1,active:pt,supported:!0,value:It,reason:en.documentReadonly},"builtin");if(Re.inline&&!x0(A)){const kt=io(j);return Rr(kt?{enabled:!1,active:pt,supported:!0,value:It,reason:kt}:fs(A).length>0&&typeof((Wt=M())==null?void 0:Wt.setPendingInlineFormat)=="function"?{enabled:!0,active:pt,supported:!0,value:It}:{enabled:!1,active:pt,supported:!0,value:It,reason:en.rangeSelectionRequired},"builtin")}if((Re.blockParagraph||Re.list)&&fs(A).length===0)return Rr({enabled:!1,active:pt,supported:!0,value:It,reason:en.selectionRequired},"builtin");if(Re.field&&!Q6(A))return Rr({enabled:!1,active:pt,supported:!0,reason:en.contextUnavailable},"builtin");if(Re.pageNumbers&&Ei()==="suggesting")return Rr({enabled:!1,active:pt,supported:!0,reason:en.operationUnavailable},"builtin");if(Re.link&&!pt&&DS(A).length===0&&!Au(A))return Rr({enabled:!1,active:pt,supported:!0,reason:en.rangeSelectionRequired},"builtin");if(Re.inline){const kt=io(j);if(kt)return Rr({enabled:!1,active:pt,supported:!0,value:It,reason:kt},"builtin")}return Rr({enabled:!0,active:pt,supported:!0,value:It},"builtin")};function R(v,w){var pt;const A=(pt=v.address)==null?void 0:pt.anchor,N=A==null?void 0:A.start,j=A==null?void 0:A.end,G=typeof(N==null?void 0:N.blockId)=="string"?N.blockId:null,ce=typeof(j==null?void 0:j.blockId)=="string"?j.blockId:null;if(!G||!ce)return!1;const we=typeof(N==null?void 0:N.offset)=="number"?N.offset:null,Re=typeof(j==null?void 0:j.offset)=="number"?j.offset:null;if(we==null||Re==null)return!1;const nt=w.target,ht=nt&&Array.isArray(nt.segments)?nt.segments:[];for(const It of ht){const Vt=typeof(It==null?void 0:It.blockId)=="string"?It.blockId:null;if(!Vt)continue;const zt=It.range,Dt=typeof(zt==null?void 0:zt.start)=="number"?zt.start:null,Ht=typeof(zt==null?void 0:zt.end)=="number"?zt.end:null;if(!(Dt==null||Ht==null)){if(G!==ce){if(Vt===G&&Ht>we||Vt===ce&&Dt<Re)return!0;continue}if(Vt===G){if(Dt===Ht){if(Dt>=we&&Dt<=Re)return!0;continue}if(Math.max(Dt,we)<Math.min(Ht,Re))return!0}}}return!1}const X=(v,w)=>{const A=v==null?void 0:v.hyperlinks;if(!A||typeof A.list!="function")return null;const N=fs(w);if(!Nm(N))return null;for(const j of N){const G={kind:"block",nodeType:"paragraph",nodeId:j},{value:ce}=ys(`hyperlinks:${j}`,rn(),()=>A.list({within:G}),Re=>Re&&typeof Re=="object"?Re:null),we=(ce&&Array.isArray(ce.items)?ce.items:[]).find(Re=>R(Re,w));if(we)return we}return null},pe=(v,w,A)=>{var we;if(v.link)return X(w,A)!=null;if(((we=v.list)==null?void 0:we.mode)==="toggle-seed"&&v.list.seed)return Xe(w,A)===v.list.seed;const N=U(v);if(N!==null)return N;const j=r.get(v.id),G=Rf(A);if(G&&(j==null?void 0:j.selectionSignature)===G)return j.active;const ce=Ah(v,A);return ce!==null?ce:IZ(v,A)},xe=(v,w,A,N)=>{if(v.inline&&LS(v.inline.key)){const j=q(v);if(j!==void 0)return j;const G=N[v.inline.key];if(G!==void 0)return G;const ce=Rf(A),we=ce?n.get(v.inline.key):void 0;if(ce&&(we==null?void 0:we.selectionSignature)===ce)return we.value}if(v.id==="linked-style"){const{style:j}=va(A,il().cache);return!j.styleId||j.mixed?void 0:{styleId:j.styleId,styleName:j.styleName}}if(v.id==="text-align")return Kt(w,A);if(v.id==="link")return Do(w,A)??void 0},ke=(v,w,A)=>{const N=v==null?void 0:v.lists;if(!N)return{value:null,status:"ready"};const j=A.storyType==="body",G=typeof N.getStateInStory=="function"?()=>N.getStateInStory({target:If(w),story:A}):j&&typeof N.getState=="function"?()=>N.getState({target:If(w)}):null;if(!G)return{value:null,status:"ready"};const{value:ce,status:we}=ys(`lists:${co(A)}:${w}`,rn(),G,Re=>Re&&typeof Re=="object"?Re:null);return{value:(ce==null?void 0:ce.success)===!0?ce:null,status:we}},Me=(v,w,A)=>ke(v,w,A).value,He=(v,w,A)=>{const N=Me(v,w,A);return!N||N.isListItem!==!0?null:N.seed==="bullet"||N.seed==="ordered"?N.seed:null},Ie=(v,w,A)=>{const N=ke(v,w,A),j=N.value;return{value:j&&typeof j.isListItem=="boolean"?j.isListItem:null,status:N.status}},Xe=(v,w)=>{const A=fs(w);if(A.length===0||!Nm(A))return null;const N=Eu(w),j=He(v,A[0],N);if(j!=="bullet"&&j!=="ordered")return null;for(const G of A.slice(1))if(He(v,G,N)!==j)return null;return j},Ke=(v,w,A)=>{if(!v)return{value:null,status:"ready",refreshing:!1};const N=co(A),j=N==="story:body";if(j&&typeof v.getNodeById!="function")return{value:null,status:"ready",refreshing:!1};if(!j&&typeof v.getNode!="function")return{value:null,status:"ready",refreshing:!1};const G=`node:${N}:${w}`,ce=rn(),we=ys(G,ce,()=>
460j?v.getNodeById({nodeId:w,nodeType:"paragraph"}):v.getNode(Ca(w,A)),nt=>nt&&typeof nt=="object"?nt:null),Re=Le.get(G);return{...we,refreshing:we.status==="stale"&&(Re==null?void 0:Re.inflightToken)===ce&&Re.failedToken!==ce}},wt=v=>v==="left"||v==="center"||v==="right"||v==="justify"?v:void 0,ct=v=>v==="start"||v==="end"||v==="distributed"||v==="numTab"||v==="lowKashida"||v==="mediumKashida"||v==="highKashida"||v==="thaiDistribute",vt=(v,w)=>{const A=M(),N=A==null?void 0:A.readMountedProjectionBlocksByIds;if(typeof N!="function")return null;const j=Tu(v),G=Dn(()=>j?N.call(A,[...w],j):N.call(A,[...w]),null);if(!Array.isArray(G))return new Map;const ce=jS(G),we=new Map;for(const Re of w){const nt=ce.find(Vt=>Mm(Vt,Re));if(!nt)continue;const ht=nt.attrs,pt=wt(ht==null?void 0:ht.alignment),It=SX(ht);we.set(Re,pt??(It==="rtl"?"right":"left"))}return we},Ft=(v,w,A,N)=>{var Vt;const{value:j,status:G,refreshing:ce}=Ke(v,w,A),we=N==null?void 0:N.get(w);if(G==="pending")return we?{status:"uniform",value:we}:{status:"pending"};if(G==="stale"&&!ce)return{status:"pending"};if(G==="stale"&&we)return{status:"uniform",value:we};if(G==="stale"&&N&&!we)return{status:"unavailable"};if(!j)return{status:"unavailable"};const Re=j.node;if(!Re)return{status:"unavailable"};const nt=Re.kind;if(nt!=="paragraph"&&nt!=="heading")return{status:"unavailable"};const ht=Re[nt];if(!ht||typeof ht!="object")return{status:"unavailable"};const pt=(Vt=ht.props)==null?void 0:Vt.alignment;if(pt==null)return we?{status:"uniform",value:we}:{status:"unavailable"};const It=wt(pt);return It?{status:"uniform",value:It}:ct(pt)&&we?{status:"uniform",value:we}:{status:"unavailable"}},Zt=(v,w)=>{const A=fs(w);if(A.length===0||!Nm(A))return{status:"unavailable"};const N=Eu(w),j=vt(w,A),G=Ft(v,A[0],N,j);if(G.status!=="uniform")return G;for(const ce of A.slice(1)){const we=Ft(v,ce,N,j);if(we.status!=="uniform")return we;if(we.value!==G.value)return{status:"mixed"}}return G},an=v=>{const w=fs(v);return w.length===0?null:`${co(Eu(v))}:${w.join(",")}`},Kt=(v,w)=>{const A=Zt(v,w),N=A.status==="uniform"?A.value:void 0,j=i;if(!j)return N;const G=an(w);return G&&G!==j.selectionSignature?(i=null,N):!G||!j.settled?j.value:A.status!=="pending"?(i=null,N):j.value},tn=(v,w)=>{const A=wt(w),N=an(v),j=fs(v);if(!A||!N||j.length===0)return null;const G=++o;return i={selectionSignature:N,value:A,generation:G,settled:!1,canReconcile:Nm(j)},Rt(),G},Bn=(v,w)=>{if(v==null)return;const A=i;if(!(!A||A.generation!==v)){if(!ua(w)){i=null;return}if(!A.canReconcile){i=null;return}A.settled=!0}},Rn=async(v,w,A)=>{const N=v==null?void 0:v.lists;if(!N)return null;try{const j=A.storyType==="body",G=typeof N.getStateInStory=="function"?await N.getStateInStory({target:If(w),story:A}):j&&typeof N.getState=="function"?await N.getState({target:If(w)}):null,ce=G&&typeof G=="object"?G:null;return!ce||ce.success!==!0||typeof ce.isListItem!="boolean"?null:ce.isListItem}catch{return null}},Fr=(v,w,A)=>{const N={resolved:!1,seed:null},j=v==null?void 0:v.lists;if(!j)return N;const G=A.storyType==="body",ce=typeof j.getStateInStory=="function"?()=>j.getStateInStory({target:If(w),story:A}):G&&typeof j.getState=="function"?()=>j.getState({target:If(w)}):null;if(!ce)return N;const we=Re=>{const nt=Re&&typeof Re=="object"?Re:null;return!nt||nt.success!==!0||typeof nt.isListItem!="boolean"?N:{resolved:!0,seed:nt.isListItem===!0&&(nt.seed==="bullet"||nt.seed==="ordered")?nt.seed:null}};try{const Re=ce();return zo(Re)?Promise.resolve(Re).then(we,()=>N):we(Re)}catch{return N}},kr=async(v,w,A)=>{if(!v)return null;try{const N=!A||A.storyType==="body",j=A&&typeof v.getNode=="function"?await v.getNode(Ca(w,A)):N&&typeof v.getNodeById=="function"?await v.getNodeById({nodeId:w,nodeType:"paragraph"}):null;return tZ(j&&typeof j=="object"?j:null)}catch{return null}},ir=(v,w,A,N,j,G)=>{var zt;if(v.mutates&&A)return Rr({enabled:!1,active:j,supported:!0,value:G,reason:en.documentReadonly},"builtin");const ce=fs(N);if(ce.length===0)return Rr({enabled:!1,active:j,supported:!0,value:G,reason:en.selectionRequired},"builtin");const we=v.docRoute?jo(w,v.docRoute):null,Re=jo(w,"format.paragraph.setIndentation"),nt=jo(w,"format.paragraph.clearIndentation"),ht=(zt=v.list)==null?void 0:zt.mode,pt=ht==="indent"?Re!=null:Re!=null||nt!=null,It=Eu(N);let Vt=null;if(It.storyType!=="body"){Vt=[];for(const Dt of ce){const{value:Ht,status:qt}=Ie(w,Dt,It);if(Ht===null)return qt!=="ready"&&(we!=null||pt)?Rr({enabled:!0,active:j,supported:!0,value:G},"builtin"):Rr({enabled:!1,active:j,supported:!1,value:G,reason:ya(w)},"builtin");Vt.push(Ht)}}if(Vt!=null&&Vt.some(Dt=>Dt===!0)){const Dt=ht==="indent"?"lists.indentRange":"lists.outdentRange",Ht=Ei()!=="suggesting"&&Vt.every(Tt=>
460Tt===!0)&&jo(w,Dt)!=null,qt=ht==="outdent"&&jo(w,"lists.outdentInStory")!=null;if(!Ht&&!qt)return Rr({enabled:!1,active:j,supported:!1,value:G,reason:ya(w)},"builtin")}for(const[Dt,Ht]of ce.entries()){const qt=Vt?{value:Vt[Dt]??null,status:"ready"}:Ie(w,Ht,It),Tt=qt.value;if(Tt===!0){if(we!=null)return Rr({enabled:!0,active:j,supported:!0,value:G},"builtin");continue}if(Tt===!1&&pt){if(It.storyType!=="body"&&typeof(w==null?void 0:w.getNode)!="function")continue;return Rr({enabled:!0,active:j,supported:!0,value:G},"builtin")}if(Tt===null)return qt.status!=="ready"&&(we!=null||pt)?Rr({enabled:!0,active:j,supported:!0,value:G},"builtin"):Rr({enabled:!1,active:j,supported:!1,value:G,reason:ya(w)},"builtin")}return Rr({enabled:!1,active:j,supported:!1,value:G,reason:ya(w)},"builtin")},ii=(v,w,A,N,j,G)=>{var Vt;if(v.mutates&&A)return Rr({enabled:!1,active:j,supported:!0,value:G,reason:en.documentReadonly},"builtin");const ce=fs(N);if(ce.length===0)return Rr({enabled:!1,active:j,supported:!0,value:G,reason:en.selectionRequired},"builtin");const we=Eu(N),Re=w==null?void 0:w.lists;if(!(typeof(Re==null?void 0:Re.getStateInStory)=="function"||we.storyType==="body"&&typeof(Re==null?void 0:Re.getState)=="function"))return Rr({enabled:!1,active:j,supported:!1,value:G,reason:en.operationUnavailable},"builtin");if(!Nm(ce))return Rr(we.storyType==="body"&&jo(w,"lists.remove")!=null?{enabled:!0,active:j,supported:!0,value:G}:{enabled:!1,active:j,supported:!1,value:G,reason:en.operationUnavailable},"builtin");const nt=ce.map(zt=>ke(w,zt,we));if(nt.some(({status:zt})=>zt!=="ready"))return Rr({enabled:!0,active:j,supported:!0,value:G},"builtin");if(nt.some(({value:zt})=>zt===null))return Rr({enabled:!1,active:j,supported:!1,value:G,reason:en.operationUnavailable},"builtin");const ht=(Vt=v.list)==null?void 0:Vt.seed,pt=nt.every(({value:zt})=>(zt==null?void 0:zt.isListItem)===!0&&zt.seed===ht);if(we.storyType==="body")return Rr(!pt||jo(w,"lists.remove")!=null?{enabled:!0,active:j,supported:!0,value:G}:{enabled:!1,active:j,supported:!1,value:G,reason:en.operationUnavailable},"builtin");const It=jo(w,"lists.removeInStory");return Rr(pt&&It?{enabled:!0,active:j,supported:!0,value:G}:{enabled:!1,active:j,supported:!1,value:G,reason:en.operationUnavailable},"builtin")},Do=(v,w)=>{var N,j;const A=(j=(N=X(v,w))==null?void 0:N.properties)==null?void 0:j.href;return typeof A=="string"?A:null},En=v=>{if(!C())return Rr({enabled:!1,active:!1,supported:!1,reason:en.notReady},"builtin");const w=v.instanceRoute;return typeof(t==null?void 0:t[w])!="function"?Rr({enabled:!1,active:!1,supported:!1,reason:en.operationUnavailable},"builtin"):Rr({enabled:!0,active:ws(v),supported:!0,value:Ml(v)},"builtin")},ws=v=>{var A;const w=(t==null?void 0:t.config)??void 0;return v.valueFrom==="ruler"?!!(w!=null&&w.rulers):v.valueFrom==="formattingMarks"?!!((A=w==null?void 0:w.layoutEngineOptions)!=null&&A.showFormattingMarks):!1},Nl=(v,w,A)=>{if(A)return Rr({enabled:!1,active:!1,supported:!0,reason:en.documentReadonly},"builtin");const N=yt();return N!=null&&(!v.table.requiresCell||N.cellNodeId!=null)?(v.docRoute?jo(w,v.docRoute):null)==null?Rr({enabled:!1,active:!1,supported:!1,reason:ya(w)},"builtin"):Rr({enabled:!0,active:!1,supported:!0},"builtin"):Rr({enabled:!1,active:!1,supported:!0,reason:en.tableContextUnavailable},"builtin")},Ml=v=>{if(v.valueFrom==="zoom")return Ch().value;if(v.valueFrom==="documentMode")return Ei();if(v.valueFrom==="measurementUnit")return lm();if(v.valueFrom==="ruler"||v.valueFrom==="formattingMarks")return ws(v)},xs=(v,w)=>v.id==="zoom"?typeof w=="number"&&Number.isFinite(w)&&w>0:v.id==="document-mode"?w==="editing"||w==="suggesting"||w==="viewing":v.id==="measurement-unit"?w==="in"||w==="cm":!0,fn=()=>[...new Set([..._X,...Ge.keys()])],_r="Normal",Eo={ready:!1,status:"ready",catalogRevision:null,quickGallery:[],activeParagraphStyleId:null,activeParagraphStyleName:null,mixedSelection:!1,sourceStatus:null,diagnostics:[]},La=v=>`styles:catalog:${JSON.stringify(v??{})}`,rl=v=>{var A;const w=(A=P())==null?void 0:A.styles;return!w||typeof w.getCatalog!="function"?{value:null,status:"ready"}:ys(La(v),rn(),()=>w.getCatalog(v),N=>N&&typeof N=="object"?N:null)},il=()=>{const v=rl({includePreview:!0});if(!v.value)return{cache:null,status:v.status};const w=rl({view:"quickGallery",includePreview:!0}),A=w.value?w.value.items:v.value.styles.filter(j=>j.visibility.quickGallery),N=new Map;for(const j of v.value.styles)N.set(j.id,j);return{cache:{full:v.value,quickGallery:A,byId:N},status:up(v.status,w.status)}},Bc=(v,w,A)=>{const{value:N,status:j}=Ke(v,w,A);if(!N)return{ok:!1,styleRef:null,status:j};const G=N.node;if(!G||typeof G!="object")return{ok:!1,styleRef:null,status:j};const ce=G.kind,we=typeof ce=="string"?G[ce]:void 0,Re=we&&typeof we=="object"?we.styleRef:void 0;return{ok:!0,styleRef:typeof Re=="string"&&Re.length>0?Re:null,status:j}},va=(v,w)=>{var zt;const A=[],N=P();if(!N)return A.push({severity:"warning",code:"active-style-unavailable",message:"Active paragraph style is unavailable: the Document API is not reachable."}),{style:{styleId:null,styleName:null,mixed:!1,diagnostics:A},status:"ready"};const j=fs(v);if(j.length===0)return A.push({severity:"info",code:"active-style-no-selection",message:"No paragraph block 
460is resolvable from the current selection; active paragraph style is unavailable."}),{style:{styleId:null,styleName:null,mixed:!1,diagnostics:A},status:"ready"};if(!Nm(j))return A.push({severity:"info",code:"active-style-selection-too-large",message:"Active paragraph style is unavailable for a large multi-paragraph selection."}),{style:{styleId:null,styleName:null,mixed:!1,diagnostics:A},status:"ready"};const G=(w==null?void 0:w.full.defaults.paragraphStyleId)??(w?_r:null),ce=new Set;let we=0,Re=0,nt=0,ht="ready";const pt=Eu(v);for(const Dt of j){const Ht=Bc(N,Dt,pt);if(ht=up(ht,Ht.status),!Ht.ok){Re+=1;continue}if(!Ht.styleRef&&!G){nt+=1;continue}const qt=Ht.styleRef??G;if(!qt){nt+=1;continue}we+=1,ce.add(qt)}if(we===0){const Dt=nt>0&&Re===0;return A.push({severity:"warning",code:Dt?"active-style-default-unavailable":"active-style-read-failed",message:Dt?"Selected paragraphs have no explicit style and the style catalogue is unavailable, so the document default cannot be resolved.":"Could not read the paragraph style of any selected block; active paragraph style is unavailable."}),{style:{styleId:null,styleName:null,mixed:!1,diagnostics:A},status:ht}}const It=Re+nt;if(It>0)return A.push({severity:"warning",code:"active-style-partial",message:`Active paragraph style resolved from ${we} of ${we+It} selected blocks; ${It} could not be read, so the active style is unavailable.`}),{style:{styleId:null,styleName:null,mixed:!1,diagnostics:A},status:ht};if(ce.size>1)return{style:{styleId:null,styleName:null,mixed:!0,diagnostics:A},status:ht};const Vt=[...ce][0];return{style:{styleId:Vt,styleName:((zt=w==null?void 0:w.byId.get(Vt))==null?void 0:zt.name)??null,mixed:!1,diagnostics:A},status:ht}},df=v=>{if(!C())return Eo;const{cache:w,status:A}=il(),{style:N,status:j}=va(v,w);let G;return w?G=N.diagnostics.length===0?w.full.diagnostics:[...w.full.diagnostics,...N.diagnostics]:G=[{severity:"warning",code:"catalog-unavailable",message:"The style catalogue is unavailable: the Document API styles surface is not reachable (e.g. viewing mode or a worker-backed editor)."},...N.diagnostics],{ready:!0,status:up(A,j,v.status),catalogRevision:(w==null?void 0:w.full.revision)??null,quickGallery:(w==null?void 0:w.quickGallery)??[],activeParagraphStyleId:N.styleId,activeParagraphStyleName:N.styleName,mixedSelection:N.mixed,sourceStatus:(w==null?void 0:w.full.sourceStatus)??null,diagnostics:G}},jc=(v="direct")=>{const{sink:w}=Rx(),A=w?Tf():0,N={},j=(nt,ht)=>{if(!w)return ht();const pt=Tf();try{return ht()}finally{N[nt]=Tf()-pt}},G=j("documentMode",Ei),ce=j("selection",So);ce.status==="ready"&&Gu(ce),J(ce);const we=Rf(ce);for(const[nt,ht]of r)(!we||ht.selectionSignature!==we||ht.settled&&ce.status==="ready")&&r.delete(nt);const Re={ready:C()!=null,documentMode:G,document:j("document",Sh),selection:ce,toolbar:{context:G,commands:j("toolbarCommands",()=>cf(ce)),copyFormatActive:m.mode!=="idle"},comments:j("comments",()=>sm(ce)),trackChanges:j("trackChanges",()=>wh(ce)),contentControls:j("contentControls",()=>kh(ce)),zoom:j("zoom",Ch),fonts:j("fonts",rf),styles:j("styles",()=>df(ce))};if(w){const nt=Tf();NS({stage:"superdoc-ui-compute-state",atMs:nt,reason:v,startedAtMs:A,completedAtMs:nt,durationMs:nt-A,phaseMs:N,asyncReadSettlements:Ve.splice(0)})}return Re},ol=v=>{const w=Rf(v);w&&l&&w!==l&&(n.clear(),r.clear()),w&&(l=w)};let ks=null,Wi=null,Dl=null,go=null,ac=null,ia=null,Is=!1;const Ll=()=>{if(oe||Is)return;Is=!0;const v=()=>{Is&&(Is=!1,!oe&&Rt())};typeof queueMicrotask=="function"?queueMicrotask(v):Promise.resolve().then(v)},lc=()=>{const v=ge();if(v!==Dl&&(go&&(go(),go=null),Dl=v,!(!v||typeof v.subscribe!="function")))try{const w=v.subscribe(()=>Ll());typeof w=="function"&&(go=w)}catch{Dl=null}},cc=()=>{const v=ee();if(v!==ac&&(ia&&(ia(),ia=null),ac=v,!(!v||typeof v.subscribe!="function")))try{const w=v.subscribe(()=>Rt());typeof w=="function"&&(ia=w)}catch{ac=null}};let oa=null,oo=null,sa=null,Wo=null,Pl=null,$=null;const se=()=>{var A,N,j;const v=(A=C())==null?void 0:A.host,w=(j=(N=Dn(v!=null&&v.getHandles?()=>v.getHandles():void 0,null))==null?void 0:N.editing)==null?void 0:j.selection;return w&&typeof w.subscribe=="function"?w:null},ze=()=>{var pt,It;const v=M(),w=v==null?void 0:v.readLiveSelectionSyncSnapshot;if(typeof w!="function")return!1;const A=vs(Dn(()=>w.call(v),null));if(!A||!Zd(A))return!1;const N=el(A,"ready"),j=Au(K.selection),G=Au(N);if(j&&G&&j.blockId===G.blockId&&co(j.story)===co(G.story))return!1;const ce=Xu(N),we=(pt=K.toolbar.commands["font-family"])==null?void 0:pt.value,Re=(It=K.toolbar.commands["font-size"])==null?void 0:It.value,nt=typeof we=="string"&&we.length>0,ht=typeof Re=="string"&&Re.length>0||typeof Re=="number"&&Number.isFinite(Re);return nt&&ce.fontFamily===void 0||ht&&ce.fontSize===void 0},We=()=>{const v=se();if(v!==ks&&(Wi&&(Wi(),Wi=null),ks=v,!!v))try{const w=v.subscribe(A=>{er()&&ze()&&nc()||(it+=1,rc(A),Rt("host-selection"))});typeof w=="function"&&(Wi=w)}catch{ks=null}},bt=()=>{var A,N;const v=(A=C())==null?void 0:A.host,w=(N=Dn(v!=null&&v.getHandles?()=>v.getHandles():void 0,null))==null?void 0:N.review;return w&&typeof w.subscribe=="function"?w:null},Jt=v=>{var w;return v?typeof v.getActiveReviewTarget=="function"?Dn(()=>v.getActiveReviewTarget(),null):typeof v.getSnapshot=="function"?((w=Dn(()=>v.getSnapshot(),null))==null?void 0:w.activeReviewTarget)??null:null:null};let vn=0;const qn=(v,w)=>{var G;const A=(G=w&&typeof w=="object"?w:null)==null?void 0:G.lastInteractionRejection;if(v==null&&A&&typeof A=="object"&&A.code==="review-target-invalidated"&&A.detail==="not-painted"&&he)return!1;const N=v&&typeof v=="object"?v:null;let j=null;if((N==null?void 0:N.entityType)==="trackedChange"&&typeof N.entityId=="string"&&N.entityId.length>0){const ce=N.story&&typeof N.story=="object"?N.story:void 0,we=ce&&co(ce)!==co(null)?ce:void 0,Re=typeof N.paintedEntityId=="string"&&N.paintedEntityId.length>0?N.paintedEntityId:null,nt=Re??N.entityId,ht=(()=>
460{if(we){const Vt=ra(),zt=Vt?mp(Vt,we):null;return(zt==null?void 0:zt.toPublicId(nt))??(zt==null?void 0:zt.toPublicId(N.entityId))??N.entityId}const It=xd(Array.isArray(K==null?void 0:K.trackChanges.items)?K.trackChanges.items:[]);return It.toPublicId(nt)??It.toPublicId(N.entityId)??N.entityId})(),pt=Re??(nt!==ht?nt:null);j={id:ht,...we?{story:we}:{},...pt&&pt!==ht?{paintedEntityId:pt}:{}}}return v==null&&j==null&&he!=null&&fe(he)||ie(he,j)?!1:(Ce(j),!0)},Cr=()=>{const v=bt();if(v===oa)return;if(oo&&(oo(),oo=null),oa=v,!v){qn(null);return}let w=!0;try{const A=v.subscribe(N=>{const j=N&&typeof N=="object"?N:null,G=j&&Object.prototype.hasOwnProperty.call(j,"activeReviewTarget")?j.activeReviewTarget:Jt(v);!qn(G,N)||w||Rt()});typeof A=="function"&&(oo=A),qn(Jt(v))}catch{oa=null}finally{w=!1}},ln=()=>{var A,N;if(ks||Ei()!=="viewing")return null;const v=(N=(A=C())==null?void 0:A.mount)==null?void 0:N.container,w=(v&&typeof v=="object"&&"ownerDocument"in v?v.ownerDocument??null:null)??globalThis.document??null;return w&&typeof w.addEventListener=="function"?w:null},lr=()=>{const v=ln();if(v===Pl||($&&($(),$=null),Pl=v,!v))return;const w=()=>{it+=1,Rt()};v.addEventListener("selectionchange",w),v.addEventListener("pointerup",w,!0),v.addEventListener("mouseup",w,!0),$=()=>{v.removeEventListener("selectionchange",w),v.removeEventListener("pointerup",w,!0),v.removeEventListener("mouseup",w,!0)}};Ja(),qn(Jt(bt())),K=jc("initial"),l=Rf(K.selection);let wr=()=>{};const pn=()=>{var N;const v=(N=C())==null?void 0:N.host,w=v==null?void 0:v.events,A=w&&typeof w.subscribe=="function"?w:null;if(A!==sa&&(Wo&&(Wo(),Wo=null),sa=A,!!A)){v&&(sn.delete(v),Tn(v));try{const j=A.subscribe(G=>{var Re,nt;const ce=G==null?void 0:G.type,we=ce==="document:mutated"&&G.hasCommitEvent!==!0;if((we||ce==="mutation:committed"&&n8(G)||ce==="collaboration:remote-changed"&&Array.isArray(G.changedStoryIds)&&G.changedStoryIds.length>0)&&wr(),(ce==="document:mutated"||ce==="mutation:committed"&&n8(G))&&v&&!$t.has(v)&&($t.add(v),Rt("document-dirty")),ce==="collaboration:document-replaced"&&v&&($t.delete(v),sn.delete(v),Tn(v),Rt("document-dirty")),ce==="review-mutation:started"){Pn((Re=G.reviewMutation)==null?void 0:Re.token);return}if(ce==="review-mutation:aborted"){jn((nt=G.reviewMutation)==null?void 0:nt.token),lt();return}if(ce==="mutation:rejected"&&G.reviewMutation&&(jn(G.reviewMutation.token),lt()),ce==="mutation:committed"&&G.reviewMutation&&jn(G.reviewMutation.token),ce==="source:complete"||ce==="source:signals-complete"){Fn=rn(),Ut();return}if((we||ce==="mutation:committed"||ce==="collaboration:remote-changed")&&(jt=Date.now()),we||ce==="mutation:committed"||ce==="save:completed"||ce==="collaboration:remote-changed"){const ht=ce==="mutation:committed"?UD(G):null;if(ht!=null&&ht.allResolved){Kn([]),Jn(G.receipt);return}ht!=null&&ht.removedIds.size&&Tr(new Set(ht.removedIds),G.receipt);const pt=ce==="mutation:committed"&&No(G)||ce==="collaboration:remote-changed"&&Array.isArray(G.changedStoryIds)&&G.changedStoryIds.length>0;if(pt&&(gr=Date.now()),ce==="mutation:committed"&&pt){Oa();return}if(ht!=null&&ht.removedIds.size&&ht.upsertIds.size===0)return;(we||ce==="collaboration:remote-changed"||ce==="mutation:committed"&&!pt)&&uu();const It=ce==="collaboration:remote-changed"&&Array.isArray(G.changedPartUris)&&G.changedPartUris.some(zt=>typeof zt=="string"&&$X.has(zt)),Vt=ce==="collaboration:remote-changed"&&Array.isArray(G.changedStoryIds)&&G.changedStoryIds.length>0&&je();It&&!pt&&($n=!0),Na(),It&&!pt?rr("comments"):Vt&&($n=!0,ui()),Rt()}});typeof j=="function"&&(Wo=j)}catch{sa=null}}},Rt=(v="unspecified")=>{if(oe)return;const{sink:w}=Rx(),A=w?Tf():0;Is=!1,Ja(),We(),lc(),cc(),Cr(),lr(),pn();const N=jc(v);ol(N.selection),K=N;let j=0,G=0;for(const ce of[...Ue]){if(!w){ce(K);continue}const we=Tf();ce(K);const Re=Tf()-we;j+=Re,G=Math.max(G,Re)}if(w){const ce=Tf();NS({stage:"superdoc-ui-recompute",atMs:ce,reason:v,startedAtMs:A,completedAtMs:ce,durationMs:ce-A,listenerCount:Ue.size,listenerTotalMs:j,listenerMaxMs:G})}},Nr=[],Sr=[],Qr=[],oi=v=>{for(const w of v)try{w()}catch{}},Ki=()=>oi(Nr),$i=()=>oi(Sr),Gi=()=>oi(Qr),Mr=[];((v,w)=>{if(!(!v||typeof v.on!="function"))for(const A of w){const N=A==="active-editor-change"?()=>{Ki(),$i(),Rt()}:A==="document-replaced"?j=>{const G=j&&typeof j=="object"?j:null,ce=G==null?void 0:G.editor,we=G==null?void 0:G.host,Re=!!ce&&ce===C(),nt=!!we&&we===M();if(!Re&&!nt)return;const ht=nt?we:M();ht&&($t.delete(ht),sn.delete(ht)),$i(),Le.clear(),Na(),Rt()}:A==="document-mode-change"?()=>{Rt(),Gi()}:()=>Rt();try{v.on(A,N),Mr.push(()=>{try{typeof v.off=="function"&&v.off(A,N)}catch{}})}catch{}}})(t,jX),We(),lc(),cc(),Cr(),lr(),pn();const ti=(v,w=IK)=>({get:()=>v(K),subscribe:A=>{let N=v(K);const j=G=>{const ce=v(G);w(N,ce)||(N=ce,A(ce))};return Ue.add(j),()=>Ue.delete(j)}}),so=v=>ti(v),Ji=v=>{const w=A=>{const N=G=>{try{A(G)}catch{}},j=v.subscribe(N);return N(v.get()),j};return{get:()=>v.get(),getSnapshot:()=>v.get(),observe:w,subscribe:A=>w(N=>A({snapshot:N}))}},Ws=(v,w,A)=>{const N=Ji(v),j=Ji(w),G=ce=>{const we=un(A);Rt();const Re=j.observe(ce);return()=>{Re(),we()}};return{get:N.get,getSnapshot:N.getSnapshot,observe:G,subscribe:ce=>G(we=>ce({snapshot:we}))}};function ba(v){return v&&typeof v=="object"&&typeof v.id=="string"?String(v.id):null}function wa(v){const w=Tu(v);return w&&co(w)!==co(null)?w:void 0}function Bl(v,w){return{kind:"id",id:v,...w?{story:w}:{}}}function Fc(v){if(v.empty)return null;const w=v.selectionTarget,A=w==null?void 0:w.start,N=w==null?void 0:w.end;if((w==null?void 0:w.kind)!=="selection"||(A==null?void 0:A.kind)!=="text"||(N==null?void 0:N.kind)!=="text"||typeof A.blockId!="string"||A.blockId!==N.blockId||!Number.isInteger(A.offset)||!Number.isInteger(N.offset)||A.offset<0||N.offset<0||A.offset===N.offset)return null;const j=Math.min(A.offset,N.offset),G=Math.max(A.offset,N.offset),ce=Tu(v);return{kind:"range",coordinateSpace:w.coordinateSpace==="tracked"?"tracked":"visible",range:{kind:"text",...ce?{story:ce}:{},segments:[{blockId:A.blockId,range:{start:j,end:G}}]}}}function Xr(v,w){var ce;if(co(w)!==co(null))return;const A=(ce=P())==null?void 0:ce.trackChanges,N=A==null?void 0:A.list;if(typeof N!="function")return;const j=Dn(()=>N.call(A),null);if(zo(j)||!j||typeof j!="object")return;const G=j.items;if(Array.isArray(G))return G.map(b0).find(we=>we!=null&&vc(we,v,w))}function sl(v,w){const A=al(v.quotedText);if(!A)return!1;const N=w0(w);return[N.insertedText,N.deletedText,N.excerpt].some(j=>al(j)===A)}function al(v){return typeof v=="string"?v.replace(/\s+/g," ").trim():""}function os(){var ce;const v=K.selection.activeChangeIds[0];if(!v)return"unavailable";const w=Tu(K.selection),A=(K.trackChanges.status==="ready"?K.trackChanges.items.find(we=>vc(we,v,w)):void 0)??Xr(v,w)??((ce=ra())==null?void 0:ce.find(we=>vc(we,v,w)));if(!A)return"unavailable";const N=w0(A),j=N.type,G=N.grouping;return sl(K.selection,A)?"id":j==="replacement"&&G==="replacement-pair"||(j==="insertion"||j==="deleti
460on"||j==="insert"||j==="delete")&&G==="standalone"?"range":"id"}function Nh(v,w,A,N){const j=()=>Gg(v,Bl(A,N),A,N);try{const G=Gg(v,w,A,N);if(zo(G))return ss(Promise.resolve(G).then(we=>ua(fd(we))?we:j()));const ce=fd(G);return ss(ua(ce)?G:j())}catch{return!1}}function Mh(v){if(typeof v=="string"&&v.length>0)return{target:{kind:"id",id:v},changeId:v};if(v&&typeof v=="object"){const w=v;if(w.target&&typeof w.target=="object"){const N=w.target;return{target:N,changeId:ba(N),story:N.story}}const A=typeof w.changeId=="string"?w.changeId:w.id;if(typeof A=="string"&&A.length>0)return{target:Bl(A,w.story),changeId:A,story:w.story}}return null}function Mg(v,w){if(v.scope==="all")return{target:{kind:"all"},changeId:null};const A=Mh(w);if(A)return A;const N=K.selection.activeChangeIds[0],j=wa(K.selection);return N?{target:Bl(N,j),changeId:N,story:j}:null}function Dg(v,w){if(v.scope==="id"&&w==null){if(K.selection.activeChangeIds.length>1)return ad(v.kind,{kind:"ids",ids:K.selection.activeChangeIds},null);if(K.selection.activeChangeIds.length===1&&!K.selection.empty&&K.selection.selectionTarget){const N=os();if(N==="unavailable")return!1;if(N==="range"){const j=Fc(K.selection),G=wa(K.selection);return j?Nh(v.kind,j,K.selection.activeChangeIds[0],G):!1}if(N==="id"){const j=K.selection.activeChangeIds[0],G=Tu(K.selection),ce=G&&co(G)!==co(null)?G:void 0;return ym(v.kind,ce?{id:j,story:ce}:j)}}}const A=Mg(v,w);return A?ad(v.kind,A.target,A.changeId,A.story):!1}function sv(v,w){var ht,pt,It,Vt;const A=(ht=ge())==null?void 0:ht.lists,N=A==null?void 0:A.apply,j=M(),G=D!==void 0&&((
460pt=C())==null?void 0:pt.editorVersion)===2&&j?(It=yk.get(t))==null?void 0:It.get(j):null;if(D!==void 0&&((Vt=C())==null?void 0:Vt.editorVersion)===2&&!G||!G&&typeof N!="function")return!1;const{behavior:ce,preset:we,continuity:Re}=typeof w=="string"?UX(w):w&&typeof w=="object"?w:{},nt={kind:v,behavior:ce??"toggle"};we!==void 0&&(nt.preset=we),Re!==void 0&&(nt.continuity=Re);try{return ss(G?G.runListApply(nt):N.call(A,nt))}catch{return!1}}let fi=Promise.resolve(!1),Ko=null,xa=null,uc=null,Qu=Promise.resolve(!1);const jl=async v=>{var j;if(!Nx(v))return v;const w=(j=C())==null?void 0:j.documentMutationReadiness,A=w==null?void 0:w.whenPainted;if(typeof A!="function")return v;const N=typeof v.txId=="string"?v.txId:void 0;try{await A.call(w,N?{txId:N}:void 0)}catch{}return v},Yo=v=>{if(zo(v)){const A=Promise.resolve(v);return{immediate:!0,committed:A.then(N=>fd(N),()=>!1),settled:A.then(N=>jl(fd(N)),()=>!1)}}const w=fd(v);return{immediate:w,committed:Promise.resolve(w),settled:jl(w)}},Lg=()=>{const v=s.shift();if(!v){d=!1,p==null||p(),p=null;return}try{v.resolve(oe?!1:v.mutate())}catch{v.resolve(!1)}},Dh=()=>{let v=!1;return()=>{v||(v=!0,Lg())}},mn=(v,w)=>{if(!d){d=!0,f=new Promise(G=>{p=G});try{return{result:w(),release:Dh()}}catch(G){throw d=!1,p==null||p(),p=null,G}}const A=s.find(G=>G.key===v);if(A)return A.mutate=w,{result:A.result,release:()=>{}};let N;const j=new Promise(G=>{N=G});return s.push({key:v,mutate:w,result:j,resolve:N}),{result:j,release:Dh()}},Mn=new Set(["create.tableOfContents","headerFooters.pageNumbers.set","headerFooters.pageNumbers.remove"]),cr=v=>no(`Tracked authoring is not supported for ${v}.`),si=v=>{if(Ei()==="suggesting")return Mn.has(v)?cr(v):{changeMode:"tracked"}},Oi=()=>Ei()==="suggesting"?vZ:GA,Er=(v,w,A)=>{const N=si(v);return N&&N.success===!1?N:N?w(A,N):w(A)},Lo=(v,w,A,N)=>{const j=v.inline;if(!j)return;const G=fd(N);if(G===!1||typeof G=="object"&&G&&G.success===!1)return;if(j.kind==="clear"){n.clear();return}if(j.kind==="toggle"||!LS(j.key))return;const ce=Rf(w);if(!ce)return;const we=oZ(j.key,A.value);if(we==null){n.delete(j.key);return}n.set(j.key,{selectionSignature:ce,value:we})},aa=(v,w,A,N)=>!v.inline||v.inline.kind==="toggle"?N:zo(N)?Promise.resolve(N).then(j=>(Lo(v,w,A,j),j)):N,zc=(v,w,A,N)=>{var ce;if(((ce=v.inline)==null?void 0:ce.kind)!=="toggle"||!ua(fd(N))||typeof A.value!="boolean"&&A.value!==null)return null;const j=Rf(w);if(!j)return null;const G=++u;return r.set(v.id,{selectionSignature:j,active:A.value===!0,generation:G,settled:!1}),Rt(),G},ll=(v,w,A)=>{if(w==null)return;const N=r.get(v.id);if(!(!N||N.generation!==w)){if(!ua(A)){r.delete(v.id);return}N.settled=!0}},ff=(v,w)=>v.then(A=>(w==null||w(A),Oc(),A),()=>(w==null||w(!1),Oc(),!1)),ss=(v,w)=>{var j,G;const A=Ko;if(Ko=null,A)return fi=ff(A,w),fd(v);if(zo(v))return fi=ff(Yo(v).settled,w),!0;const N=fd(v);return Nx(N)&&typeof((G=(j=C())==null?void 0:j.documentMutationReadiness)==null?void 0:G.whenPainted)=="function"?(fi=ff(jl(N),w),N):(w==null||w(N),fi=Promise.resolve(N),Oc(),N)},hf=(v,w)=>!v||typeof v!="object"?w:v,Pa=(v,w=no("Document API operation failed."))=>{var N,j;if(zo(v))return Promise.resolve(v).then(G=>Pa(G,w),()=>w);const A=hf(v,w);return Na(),Nx(A)&&typeof((j=(N=C())==null?void 0:N.documentMutationReadiness)==null?void 0:j.whenPainted)=="function"?(ff(jl(A)),Rt(),A):(Rt(),A)},N2=(v,w,A,N)=>{const j=[],G=[];for(const ce of A){const we=N(ce);if(we)try{const Re=Yo(Er(v,w,we));j.push(Re.immediate),G.push(Re.settled)}catch{j.push(!1),G.push(Promise.resolve(!1))}}return Ko=G.length?Promise.all(G).then(ce=>yc(ce)):null,yc(j)},M2=(v,w,A,N)=>{const j=[],G=[];for(const ce of A){const we=N(ce);if(we)try{const Re=Yo(Er(v,w,we));j.push(Re.immediate),G.push(Re.settled)}catch{j.push(!1),G.push(Promise.resolve(!1))}}return Ko=G.length?Promise.all(G).then(ce=>yc(ce)):null,yc(j)},Ju=(v,w,A,N=K.selection)=>{const j=si(v);return j&&j.success===!1?j:N.selectionTarget?w(A,{...j,offsetSpace:"selection"}):j?w(A,j):w(A)},cm=(v,w,A,N)=>{const j=Ca(w,N);switch(v.kind){case"alignment":{const G=A;return G!=="left"&&G!=="center"&&G!=="right"&&G!=="justify"?null:{target:j,alignment:G}}case"spacing-line":{const G=typeof A=="number"?A:Number(A);return!Number.isFinite(G)||G<=0?null:{target:j,line:G,lineRule:"auto"}}case"style":if(A&&typeof A=="object"){const G=A.role;if(G&&typeof G=="object")return{target:j,role:G}}return typeof A!="string"||A.trim()===""?null:{target:j,styleId:A};case"direction":{const G=v.fixedValue;return G!=="ltr"&&G!=="rtl"?null:{target:j,direction:G}}default:return null}},Pg=(v,w)=>{const A=v.inline,N=FS(v),j=M();if(!A||typeof(j==null?void 0:j.setPendingInlineFormat)!="function")return!1;if(A.kind==="clear")return re(),!0;if(!N)return!1;let G;if(A.kind==="toggle")G=!pe(v,P(),K.selection);else{const ce=w&&typeof w=="object"&&"value"in w?w.value:w;if(A.kind==="value-number"){const we=typeof ce=="number"?ce:Number(ce);G=Number.isFinite(we)&&we>0?we:null}else G=typeof ce=="string"&&ce.trim()!==""?ce:null;if(G===null)return Q(N,null),!0}return Q(N,G),!0},um=()=>{var Vt;const v=P(),{lockModesById:w}=pu(v==null?void 0:v.contentControls,K.selection);if(io(w))return!1;const A=[],N=[],j=zt=>{const Dt=Yo(zt);A.push(Dt.immediate),N.push(Dt.settled)},G=(zt,Dt,Ht)=>{try{j(Ht?zt(Dt,Ht):zt(Dt))}
460catch{A.push(!1),N.push(Promise.resolve(!1))}},ce=((Vt=il().cache)==null?void 0:Vt.full.defaults.paragraphStyleId)??_r,we=x0(K.selection);if(we){const zt=jo(v,"format.apply");if(zt)try{j(Ju("format.apply",zt,{target:we,inline:{...Oi()}}))}catch{A.push(!1),N.push(Promise.resolve(!1))}}const Re=jo(v,"format.paragraph.resetDirectFormatting"),nt=jo(v,"styles.paragraph.setStyleRef"),ht=Tu(K.selection),pt=!ht||ht.storyType==="body",It=jo(v,pt?"lists.remove":"lists.removeInStory");for(const zt of fs(K.selection)){const Dt=Ca(zt,ht);if(Re&&G(Re,{target:Dt}),It)try{const Ht=If(zt),qt=Yo(It(pt?{target:Ht}:{target:Ht,story:ht}));N.push(qt.settled.then(Tt=>ua(Tt)?Tt:!0))}catch{}nt&&G(nt,{target:Dt,styleId:ce})}if(!we&&Ei()!=="suggesting"){const zt=jo(v,"format.paragraph.setMarkRunProps");if(zt)for(const Dt of fs(K.selection))G(zt,{target:Ca(Dt,ht),markRunProps:{bold:!1,italic:!1,strikethrough:!1,doubleStrikethrough:!1,smallCaps:!1,caps:!1,verticalAlign:"baseline"}})}return Ko=N.length?Promise.all(N).then(zt=>yc(zt)):null,yc(A.length?A:[!1])},Bg=(v,w,A)=>{const N=fs(K.selection);if(N.length===0)return!1;const j=Tu(K.selection);return N2(v.docRoute,w,N,G=>cm(v.blockParagraph,G,A,j))},D2=(v,w,A)=>{var ht;const N=P(),j=jo(N,"format.paragraph.setIndentation"),G=jo(N,"format.paragraph.clearIndentation"),ce=(ht=v.list)==null?void 0:ht.mode,we=Eu(K.selection),Re=Tu(K.selection),nt=async pt=>{const It=await Rn(N,pt,we);if(It===!0)return{kind:"list",routeToCall:v.docRoute,opToCall:w,input:{target:X6(pt)}};if(It===null||Re&&Re.storyType!=="body"&&typeof(N==null?void 0:N.getNode)!="function")return null;const Vt=await kr(N,pt,Re),zt={};if((Vt==null?void 0:Vt.right)!=null&&(zt.right=Vt.right),(Vt==null?void 0:Vt.firstLine)!=null&&(zt.firstLine=Vt.firstLine),(Vt==null?void 0:Vt.hanging)!=null&&(zt.hanging=Vt.hanging),ce==="indent")return j?{kind:"paragraph",routeToCall:"format.paragraph.setIndentation",opToCall:j,input:{target:Ca(pt,Re),left:Math.max(0,(Vt==null?void 0:Vt.left)??0)+Z6,...zt}}:null;const Dt=Math.max(0,((Vt==null?void 0:Vt.left)??0)-Z6);return Dt>0&&(zt.left=Dt),Object.keys(zt).length===0?G?{kind:"paragraph",routeToCall:"format.paragraph.clearIndentation",opToCall:G,input:{target:Ca(pt,Re)}}:j?{kind:"paragraph",routeToCall:"format.paragraph.setIndentation",opToCall:j,input:{target:Ca(pt,Re),left:0}}:null:j?{kind:"paragraph",routeToCall:"format.paragraph.setIndentation",opToCall:j,input:{target:Ca(pt,Re),...zt}}:null};return Ko=(async()=>{const pt=await Promise.all(A.map(Dt=>nt(Dt).catch(()=>null)));if(pt.length===A.length&&pt.every(Dt=>(Dt==null?void 0:Dt.kind)==="list")&&Ei()!=="suggesting"){const Dt=ce==="indent"?"lists.indentRange":"lists.outdentRange",Ht=jo(N,Dt);if(Ht)try{return await Yo(Er(Dt,Ht,{paraIds:A,story:we})).settled}catch{return!1}}const It=we.storyType!=="body"&&pt.some(Dt=>(Dt==null?void 0:Dt.kind)==="list"),Vt=It&&ce==="outdent"?jo(N,"lists.outdentInStory"):null;if(It&&!Vt)return!1;
460const zt=pt.map(Dt=>{if(!Dt)return Promise.resolve(!1);try{return Dt.kind==="list"&&Vt?Yo(Er("lists.outdentInStory",Vt,{target:Dt.input.target,story:we})).settled:Yo(Er(Dt.routeToCall,Dt.opToCall,Dt.input)).settled}catch{return Promise.resolve(!1)}});return yc(await Promise.all(zt))})(),!0},pf=(v,w)=>{const A=v.list,N=P(),j=fs(K.selection);if(j.length===0)return!1;const G=Eu(K.selection),ce=G.storyType==="body";if(A.mode==="indent"||A.mode==="outdent")return D2(v,w,j);const we=A.seed,Re=pt=>{if(pt.some(qt=>!qt.resolved))return{immediate:!1,settled:null};const It=pt.every(qt=>qt.seed===we);if(!It&&!ce)return{immediate:!1,settled:null};const Vt=It?ce?"lists.remove":"lists.removeInStory":v.docRoute,zt=It?jo(N,Vt):w;if(!zt)return{immediate:!1,settled:null};const Dt=[],Ht=[];return j.forEach((qt,Tt)=>{var kt;if(!It&&((kt=pt[Tt])==null?void 0:kt.seed)===we)return;const Wt=It?{target:If(qt),...ce?{}:{story:G}}:{target:If(qt),seed:we};try{const xn=Yo(Er(Vt,zt,Wt));Dt.push(xn.immediate),Ht.push(xn.settled)}catch{Dt.push(!1),Ht.push(Promise.resolve(!1))}}),{immediate:yc(Dt),settled:Ht.length?Promise.all(Ht).then(qt=>yc(qt)):null}},nt=j.map(pt=>Fr(N,pt,G));if(nt.some(zo))return Ko=Promise.all(nt).then(async pt=>{const It=Re(pt);return It.settled?await It.settled:It.immediate}),!0;const ht=Re(nt);return Ko=ht.settled,ht.immediate};function Lh(v){return v&&typeof v=="object"?v:{}}function ed(v){if(typeof v=="string")return v;const w=Lh(v);if(Object.prototype.hasOwnProperty.call(w,"href"))return w.href;if(Object.prototype.hasOwnProperty.call(w,"value"))return w.value}function av(v,w){const A=Lh(v).text;return typeof A=="string"&&A.trim()!==""?A:w}function jg(v){const w=Lh(v),A=w.capture&&typeof w.capture=="object"?w.capture:null;return w.target??(A==null?void 0:A.target)??(A==null?void 0:A.selectionTarget)??w.selectionTarget??w.textTarget??null}const td=v=>{var Dt,Ht;const w=P(),A=w==null?void 0:w.hyperlinks;if(!A)return!1;const N=M(),j=typeof(N==null?void 0:N.getHandles)=="function"?N.getHandles():null,G=D?(Dt=j==null?void 0:j.editing)==null?void 0:Dt.hyperlinks:A,ce=Lh(v),we=ed(v),Re=jg(v),nt=typeof ce.text=="string"?ce.text:void 0,ht=typeof ce.currentText=="string"?ce.currentText:void 0,pt=Jv(ce.hyperlinkTarget)?ce.hyperlinkTarget:null,It=Jv(ce.textTarget)?ce.textTarget:null,Vt=X(w,K.selection),zt=typeof(pt==null?void 0:pt.storyId)=="string"&&typeof(pt==null?void 0:pt.hyperlinkNodeId)=="string";if(zt&&we===null){const qt=A.remove;if(typeof qt!="function")return!1;try{return Er("hyperlinks.remove",qt,{storyId:pt.storyId,hyperlinkNodeId:pt.hyperlinkNodeId,keepText:!0})}catch{return!1}}if(Vt&&we===null){const qt=G==null?void 0:G.remove;if(typeof qt!="function")return!1;try{return Er("hyperlinks.remove",qt,{target:Vt.address,mode:"unwrap"})}catch{return!1}}if((Vt||pt)&&typeof we=="string"&&we.trim()!==""){const qt=G==null?void 0:G.patch,Tt=A.updateTarget;if(!(!zt&&Vt&&typeof qt=="function")&&!(zt&&typeof Tt=="function"))return!1;const Wt=typeof nt=="string"&&nt!==(zt?ht:(Vt==null?void 0:Vt.text)??ht),kt=(Ht=w==null?void 0:w.text)==null?void 0:Ht.replace,xn=Wt?zt?It:fZ(Vt==null?void 0:Vt.address):null,or=Wt&&!!xn&&typeof kt=="function";if(Wt&&!or)return!1;const hr=[],Yn=[];let vi=null,Yi=null,Cs=null,Ns=!1;try{if(zt){if(typeof Tt!="function")return!1;const Xi=Er("hyperlinks.updateTarget",Tt,{storyId:pt.storyId,hyperlinkNodeId:pt.hyperlinkNodeId,newTarget:hZ(we)});Ns=zo(Xi);const Jo=Yo(Xi);if(!ua(Jo.immediate))return!1;hr.push(Jo.immediate),Yn.push(Jo.settled),vi=Jo.immediate,Yi=Jo.committed,Cs=Jo.settled}else if(Vt){if(typeof qt!="function")return!1;const Xi=Er("hyperlinks.patch",qt,{target:Vt.address,patch:{href:we}});Ns=zo(Xi);const Jo=Yo(Xi);if(!ua(Jo.immediate))return!1;hr.push(Jo.immediate),Yn.push(Jo.settled),vi=Jo.immediate,Yi=Jo.committed,Cs=Jo.settled}}catch{return!1}if(or){const Xi=(cs,Ss)=>ua(Ss)?yc([cs,Ss]):ua(cs)?Yv(cs,Ss):Ss,Jo=cs=>{if(!ua(cs))return cs;try{const Ss=Yo(Er("text.replace",kt,{target:xn,text:nt}));return ua(Ss.immediate)?Promise.all([Cs??Promise.resolve(cs),Ss.settled]).then(([Ms,Yh])=>Xi(Ms,Yh)):Yv(cs,Ss.immediate)}catch{return Yv(cs,!1)}};if(Ns)return Ko=(Yi??Promise.resolve(vi??!1)).then(Jo),yc(hr);
460try{const cs=Yo(Er("text.replace",kt,{target:xn,text:nt}));if(!ua(cs.immediate))return vi?Yv(vi,cs.immediate):cs.immediate;hr.push(cs.immediate),Yn.push(cs.settled),Ko=Promise.all([Cs??Promise.resolve(vi??!1),cs.settled]).then(([Ss,Ms])=>Xi(Ss,Ms))}catch{return vi?Yv(vi,!1):!1}}return!or&&Yn.length>0&&(Ko=Promise.all(Yn).then(Xi=>yc(Xi))),yc(hr)}if(typeof we=="string"&&we.trim()!==""){const qt=we.trim(),Tt=G==null?void 0:G.wrap,Wt=nZ(Re),kt=Wt.length>0?Wt:DS(K.selection);if(kt.length>0){if(typeof Tt!="function")return!1;try{return M2("hyperlinks.wrap",Tt,kt,Yn=>({target:Yn,link:{destination:{href:qt}}}))}catch{return!1}}const xn=G==null?void 0:G.insert,or=av(v,qt);if(typeof xn!="function"||or.trim()==="")return!1;const hr=qb(Re)??Au(K.selection);if(!hr)return!1;try{return Er("hyperlinks.insert",xn,{target:hr,text:or,link:{destination:{href:qt}}})}catch{return!1}}return!1},nd=(v,w,A)=>{var ce,we,Re;const N=v.create.kind,j=A&&typeof A=="object"?A:{};if(N==="table"){const nt=Number(j.rows??j.rowCount),ht=Number(j.columns??j.cols??j.colCount);if(!Number.isInteger(nt)||nt<1||!Number.isInteger(ht)||ht<1)return!1;const pt=Au(K.selection),It=pt&&typeof pt.blockId=="string"?{kind:"inParagraph",target:Ca(pt.blockId),offset:((ce=pt.range)==null?void 0:ce.start)??0}:BS(K.selection,"nodeId");try{return Er(v.docRoute,w,{rows:nt,columns:ht,at:It})}catch{return!1}}if(N==="image"){const nt=j.src??j.value;if(typeof nt!="string"||nt.trim()==="")return!1;const ht=Au(K.selection),pt=Eu(K.selection),It=pt.storyType==="body"?null:pt;let Vt;ht&&typeof ht.blockId=="string"?Vt={kind:"inParagraph",target:Ca(ht.blockId,It),offset:((we=ht.range)==null?void 0:we.start)??0}:(Vt=BS(K.selection,"target"),It&&Vt.kind==="after"&&(Vt={...Vt,target:{...Vt.target,story:It}}));const zt={src:nt,at:Vt};It&&(zt.in=Vt.kind==="inParagraph"?L(It)??It:It),typeof j.alt=="string"&&(zt.alt=j.alt),typeof j.title=="string"&&(zt.title=j.title),j.size&&typeof j.size=="object"&&(zt.size=j.size);const Dt=M(),Ht=typeof(Dt==null?void 0:Dt.getHandles)=="function"?Dt.getHandles():null,qt=D?(Re=Ht==null?void 0:Ht.editing)==null?void 0:Re.images:null,Tt=D?qt==null?void 0:qt.create:w;if(typeof Tt!="function")return!1;try{return Er(v.docRoute,Tt,zt)}catch{return!1}}const G={at:BS(K.selection,"target")};typeof j.instruction=="string"&&(G.instruction=j.instruction),j.config&&typeof j.config=="object"&&(G.config=j.config);try{return Er(v.docRoute,w,G)}catch{return!1}},dm=()=>{var w,A;if(D===null)return null;const v=M();return v?D!==void 0?((A=(w=typeof v.getHandles=="function"?v.getHandles():null)==null?void 0:w.editing)==null?void 0:A.fields)??null:typeof v.getCodeFieldEditingCommands=="function"?v.getCodeFieldEditingCommands():null:null},lv=v=>{if(K.selection.status==="ready"&&!Q6(K.selection))return!1;const w=si(v.docRoute);if(w&&w.success===!1)return w;const A={instruction:v.field.instruction};try{const N=dm();return typeof(N==null?void 0:N.insertAtSelection)!="function"?!1:w?N.insertAtSelection(A,w):N.insertAtSelection(A)}catch{return!1}},Fg=()=>{var w,A;if(D===null)return null;const v=M();return v?D!==void 0?((A=(w=typeof v.getHandles=="function"?v.getHandles():null)==null?void 0:w.editing)==null?void 0:A.pageNumbers)??null:typeof v.getCodePageNumberEditingCommands=="function"?v.getCodePageNumberEditingCommands():null:null},fm=(v,w)=>{if(!w)return!1;const A=si(v.docRoute);if(A&&A.success===!1)return A;const N=v.pageNumbers;try{const j=Fg();if(typeof(j==null?void 0:j[N])!="function")return!1;const G=j[N];return A?G(w,A):G(w)}catch{return!1}},hm=async()=>{try{const v=Fg();return typeof(v==null?void 0:v.get)!="function"?null:await v.get()??null}catch{return null}},cv=()=>{var w,A;if(D===null)return null;const v=M();return v?D!==void 0?((A=(w=typeof v.getHandles=="function"?v.getHandles():null)==null?void 0:w.editing)==null?void 0:A.tables)??null:typeof v.getCodeTableEditingCommands=="function"?v.getCodeTableEditingCommands():null:null},L2=(v,w)=>{const A=v.table,N=yt();if(!N||A.requiresCell&&!N.cellNodeId)return!1;const j=xZ(A.action,N);if(!j)return!1;try{if(A.action==="insert-row-before"||A.action==="insert-row-after"){const G=cv();if(typeof(G==null?void 0:G.insertRow)!="function")return!1;const ce=si(v.docRoute);return ce&&ce.success===!1?ce:ce?G.insertRow(j,ce):G.insertRow(j)}if(A.action==="insert-column-before"||A.action==="insert-column-after"){const G=cv();if(typeof(G==null?void 0:G.insertColumn)!="function")return!1;const ce=si(v.docRoute);return ce&&ce.success===!1?ce:ce?G.insertColumn(j,N.rowIndex,ce):G.insertColumn(j,N.rowIndex)}return Er(v.docRoute,w,j)}catch{return!1}},Ph=v=>!v||v.disposition!=="routed"?!1:!!(v.inline||v.blockParagraph||v.list||v.link||v.create),zg=v=>{const w=Lh(v);return!!(jg(v)||Jv(w.hyperlinkTarget)||Jv(w.textTarget))},P2=(v,w,A)=>{var N,j;return K.selection.status!=="ready"?!1:((N=Dw(v))==null?void 0:N.scope)==="id"||!w||w.disposition!=="routed"?!0:((j=w.inline)==null?void 0:j.kind)==="clear"?fs(K.selection).length>0||x0(K.selection)!=null:w.inline?x0(K.selection)!=null||fs(K.selection).length>0:w.blockParagraph||w.list?fs(K.selection).length>0:w.link?zg(A)||DS(K.selection).length>0||Au(K.selection)!=null||pe(w,P(),K.selection):!0},uv=(v,w)=>{const A=Dw(v),N=R0(v);return(A==null?void 0:A.scope)==="id"&&Mh(w)||(A==null?void 0:A.scope)!=="id"&&!Ph(N)?!1:!P2(v,N,w)},dv=(v,w)=>
460uv(v,w)?qu().then(()=>{}):null,cl=(v,w,A)=>{var pt,It,Vt;if(Ko=null,fi=Promise.resolve(!1),oe)return!1;const N=Ge.get(v);if(N)try{const zt=N.execute(fu(w,A));return ss(zt)}catch{return!1}const j=V6(v);if(j){if(Ei()==="viewing")return!1;if(typeof((It=(pt=ge())==null?void 0:pt.lists)==null?void 0:It.apply)=="function")return sv(j,w)}const G=Dw(v);if(G)return Dg(G,w);if(v==="copy-format")return ss(B2());const ce=R0(v);if(!ce||ce.disposition!=="routed")return!1;const we=ce.normalizePayload?ce.normalizePayload(w):w;if(ce.instanceRoute){if(!C()||!xs(ce,we))return!1;const zt=t==null?void 0:t[ce.instanceRoute];if(typeof zt!="function")return!1;try{const Dt=ce.fixedArg!==void 0?ce.fixedArg:we,Ht=zt.call(t,Dt);return ss(Ht)}catch{return!1}}if(((Vt=ce.inline)==null?void 0:Vt.kind)==="clear")return ce.mutates&&Ei()==="viewing"?!1:ss(um());const Re=ce.docRoute;if(!Re||ce.mutates&&Ei()==="viewing")return!1;const nt=P(),ht=jo(nt,Re);if(!ht)return!1;if(ce.inline){const{lockModesById:zt}=pu(nt==null?void 0:nt.contentControls,K.selection);if(io(zt))return!1;const Dt=x0(K.selection);if(!Dt)return K.selection.empty===!1?ss(!1):ss(Pg(ce,we));const Ht=pe(ce,nt,K.selection),qt=bZ(ce.inline,Dt,we,Ht);if(!qt)return!1;let Tt=null;try{const Wt=C(),kt=Wt==null?void 0:Wt.doc,xn=Ei(),or=()=>C()!==Wt||(Wt==null?void 0:Wt.doc)!==kt||Ei()!==xn?!1:Ju(Re,ht,qt),hr=Rf(K.selection)??Um(K.selection),Yn=ce.inline.kind==="toggle"?mn(`${ce.id}:${hr}`,or):null;Tt=(Yn==null?void 0:Yn.release)??null;const vi=Yn?Yn.result:or(),Yi=zc(ce,K.selection,qt,vi),Cs=aa(ce,K.selection,qt,vi),Ns=ss(Cs,Xi=>{ll(ce,Yi,Xi),Tt==null||Tt(),Tt=null});return ce.inline.kind==="toggle"&&(Qu=fi),Ns}catch{return Tt==null||Tt(),!1}}if(ce.blockParagraph){const zt=Bg(ce,ht,we),Dt=ce.blockParagraph.kind==="alignment"&&ua(zt)?tn(K.selection,we):null;return ss(zt,Ht=>{Bn(Dt,Ht)})}if(ce.list){const zt=pf(ce,ht);return ss(zt)}if(ce.link){const zt=td(we);return ss(zt)}if(ce.create){const zt=nd(ce,ht,we);return ss(zt)}if(ce.field){if(xa)return!1;
460const zt=ss(lv(ce)),Dt=fi;return xa=Dt,Dt.finally(()=>{xa===Dt&&(xa=null)}),zt}if(ce.pageNumbers){if(uc)return!1;const zt=ss(fm(ce,we)),Dt=fi;return uc=Dt,Dt.finally(()=>{uc===Dt&&(uc=null)}),zt}if(ce.table){const zt=L2(ce,ht);return ss(zt)}try{return ss(ce.mutates?Er(Re,ht,we):ht(we))}catch{return!1}},Ba=(v,w,A,N)=>{const j=SK(t,"command:started",()=>({commandId:v,selection:K.selection}));let G;const ce=D;D=N&&!Ge.has(v)?Z():void 0;try{G=cl(v,w,A)}catch(Re){throw b1(t,"command:settled",()=>({actionId:j,commandId:v,outcome:"threw"})),Re}finally{D=ce}const we=Re=>b1(t,"command:settled",()=>({actionId:j,commandId:v,outcome:ua(Re)?"succeeded":"rejected",result:Re}));if(G===!1)we(G);else try{fi.then(we,()=>we(!1))}catch{}return G},Fl=(v,w,A)=>Ba(v,w,A,!1),Bh=()=>{y+=1,b=null,m={mode:"idle",snapshot:null,sourceSelectionKey:null,lastClickAt:m.lastClickAt,pointerSelecting:!1,keyboardSelecting:!1};for(const v of k)v("idle");Rt()},B2=async()=>{const v=D??null,w=["bold","italic","underline","strikethrough"].filter(pt=>{var It;return((It=K.toolbar.commands[pt])==null?void 0:It.active)===!0}),A=await Qu;await f;const N=ua(A)?w:[],j=500,G=Date.now();if(m.mode!=="idle"){if(m.mode==="armed"&&G-m.lastClickAt<j){m={...m,mode:"persistent",lastClickAt:G};for(const pt of k)pt("persistent");return Rt(),!0}return Bh(),!1}const ce=G-m.lastClickAt<j,we=++y;m={...m,lastClickAt:G};const Re=await qu(),nt=`${Um(Re)}:${rn()}`,ht=await rd(null,Re,nt&&nt===x?S:void 0,N);if(we!==y)return!0;m={...m,mode:ce?"persistent":"armed",snapshot:ht,sourceSelectionKey:Um(Re),lastClickAt:G},b=v;for(const pt of k)pt(m.mode);return Rt(),!0},rd=async(v,w,A,N=[])=>{var zt,Dt;const j=(w==null?void 0:w.target)??(v==null?void 0:v.target);if(!j||j.kind!=="text")return null;const G=Array.isArray(j.segments)?j.segments:[];if(G.length===0)return null;const ce=P();if(!ce)return null;const we=j.story;let Re=null;for(const Ht of G){const qt=((zt=await Ol(Ca(Ht.blockId,we)))==null?void 0:zt.node)??null;if(!qt)continue;const Tt=ka(qt),Wt=Array.isArray(Tt==null?void 0:Tt.inlines)?Tt.inlines:[],kt=Xo(Wt,Ht.range);Re?Re=pm(Re,kt):Re=kt}const nt=Re?nX(Re):{},ht={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strike"},pt=new Set([...(w==null?void 0:w.activeMarks)??(Array.isArray(v==null?void 0:v.activeMarks)?v.activeMarks:[]),...N]);for(const[Ht,qt]of Object.entries(ht))pt.has(Ht)&&(nt[qt]=!0);const It=A??await gu(w??el(v,"ready"));if(It.fontFamily&&(nt.fontFamily=It.fontFamily),It.color&&(nt.color=It.color),It.highlight&&(nt.highlight=It.highlight),It.fontSize){const Ht=Number.parseFloat(It.fontSize);Number.isNaN(Ht)||(nt.fontSize=Ht)}let Vt=null;if(G.length===1){const Ht=G[0],qt=((Dt=await Ol(Ca(Ht.blockId,we)))==null?void 0:Dt.node)??null;qt&&ka(qt)&&(Vt=await vu(qt,Ht.blockId,ce,we))}return{story:we??null,inline:nt,paragraph:Vt}},ka=v=>v?v.kind==="paragraph"?v.paragraph??null:v.kind==="heading"?v.heading??null:null:null,Xo=(v,w)=>{const A=ce=>{const we=ce.run;return typeof(we==null?void 0:we.text)=="string"?we.text:""},N=ce=>{var we;return(we=ce.run)==null?void 0:we.props};if(w.start===w.end){let ce=0;for(const we of v){const Re=A(we),nt=ce,ht=ce+Re.length;if(ce=ht,w.start>=nt&&w.start<=ht){const pt=N(we);return pt?{...pt}:{}}}return{}}let j=0;const G=[];for(const ce of v){const we=A(ce),Re=j,nt=j+we.length;if(j=nt,nt<=w.start||Re>=w.end)continue;const ht=N(ce);ht&&G.push(ht)}return G.length===0?{}:G.length===1?{...G[0]}:pm(G[0],...G.slice(1))},pm=(v,...w)=>{const A={...v};for(const N of w)for(const j of Object.keys(A)){if(!(j in N)){delete A[j];continue}const G=A[j],ce=N[j];(typeof G!=typeof ce||JSON.stringify(G)!==JSON.stringify(ce))&&delete A[j]}return A},vu=async(v,w,A,N)=>{var qt,Tt,Wt,kt;const j=ka(v),G=j.props??{},ce=j.styleRef??null,we=G.alignment??null,Re=G.spacing??null,nt=G.indent??null,ht=nt?{...nt.left!=null?{left:nt.left}:{},...nt.right!=null?{right:nt.right}:{},...nt.firstLine!=null?{firstLine:nt.firstLine}:{},...nt.hanging!=null?{hanging:nt.hanging}:{}}:null,pt=G.markRunProps??null,It=(qt=G.numbering)==null?void 0:qt.numId,Vt=typeof It=="string"?parseInt(It,10):typeof It=="number"?It:NaN,zt=(Tt=G.numbering)==null?void 0:Tt.level,Dt=isNaN(Vt)?null:{numId:Vt,...zt!=null?{level:zt}:{}};let Ht=null;if(Dt&&typeof((Wt=A.lists)==null?void 0:Wt.getState)=="function")try{const xn=await A.lists.getState({target:Ca(w,N)});xn&&typeof((kt=A.lists)==null?void 0:kt.getStyle)=="function"&&(Ht=await A.lists.getStyle(xn)??null)}catch{}return{styleId:ce,alignment:we,spacing:Re,indentation:ht,markRunProps:pt,numbering:Dt,listStyle:Ht}},Ur=async()=>{var ce,we;if(m.mode==="idle"||m.pointerSelecting||m.keyboardSelecting)return;const v=(ce=P())==null?void 0:ce.selection,w=async()=>{const Re=typeof(v==null?void 0:v.current)=="function"?await Promise.resolve(v.current({includeText:!0})):Mc().value;return vs(Re)},A=()=>new Promise(Re=>setTimeout(Re,16)),N=8;let j=null,G="";for(let Re=0;Re<N;Re+=1){if(Re>0&&await A(),m.mode==="idle"||m.pointerSelecting||m.keyboardSelecting)return;if(j=await w(),!(!j||j.empty)&&(G=Um(j),G!==m.sourceSelectionKey))break}if(j&&!j.empty&&G!==m.sourceSelectionKey){await ji(j);return}if((we=m.snapshot)!=null&&we.paragraph){const Re=await w();if(!Re||Um(Re)===m.sourceSelectionKey)return;await ji(Re)}},ji=async v=>{var we,Re,nt,ht,pt,It,Vt,zt,Dt,Ht,qt,Tt,Wt,kt,xn,or,hr,Yn,vi,Yi,Cs,Ns,Xi,Jo,cs;const w=m.snapshot;if(!w){m.mode==="armed"&&Bh();return}const A=b??P();if(!A)return;const N=el(v,"ready"),{lockModesById:j}=pu(A.contentControls,N);if(io(j)){Rt();return}const G=v.target,ce=v.selectionTarget;if(v.empty!==!0&&Object.keys(w.inline).length>0){const Ss=jo(A,"format.apply");if(Ss&&ce)try{if(!ua(fd(await Promise.resolve(Ju("format.apply",Ss,{target:ce,inline:w.inline},v))))){Rt();return}}catch{Rt();return}}if(w.paragraph){const Ss=Array.isArray(G==null?void 0:G.segments)?G.segments:[],Ms=G==null?void 0:G.story;for(const Yh of Ss){const t0=Ca(Yh.blockId,Ms),xf=await Ol(t0),n0=(xf==null?void 0:xf.node)??null,Tm=(xf==null?void 0:xf.address)??null;if(!n0)continue;const Uc={kind:"block",nodeType:(Tm==null?void 0:Tm.nodeType)??n0.kind??"paragraph",nodeId:Yh.blockId,...Ms&&typeof Ms=="object"?{story:Ms}:{}},{styleId:Tv,alignment:Vc,spacing:es,indentation:fc,markRunProps:Iv,numbering:ts,listStyle:Q2}=w.paragraph;if(Tv&&await((nt=(Re=(we=A.styles)==null?void 0:we.paragraph)==null?void 0:Re.setStyle)==null?void 0:nt.call(Re,{target:Uc,styleId:Tv})),Vc&&await((It=(pt=(ht=A.format)==null?void 0:ht.paragraph)==null?void 0:pt.setAlignment)==null?void 0:It.call(pt,{target:Uc,alignment:Vc})),es){const hc=es,Rv=hc.lineRule??"auto",ao=new Set(["auto","exact","atLeast"]).has(Rv)?Rv:"auto",Va={...hc.before!=null?{before:Math.round(hc.before*20)}:{},...hc.after!=null?{after:Math.round(hc.after*20)}:{},...hc.line!=null?{line:Math.round(ao==="auto"?hc.line*240:hc.line*20),lineRule:ao}:{}};await((Dt=(zt=(Vt=A.format)==null?void 0:Vt.paragraph)==null?void 0:zt.setSpacing)==null?void 0:Dt.call(zt,{target:Uc,...Va}))}if(fc){const hc={...fc.left!=null?{left:Id(fc.left)}:{},...fc.right!=null?{right:Id(fc.right)}:{},...fc.firstLine!=null?{firstLine:Id(fc.firstLine)}:{},...fc.hanging!=null?{hanging:Id(fc.hanging)}:{}};await((Tt=(qt=(Ht=A.format)==null?void 0:Ht.paragraph)==null?void 0:qt.setIndentation)==null?void 0:Tt.call(qt,{target:Uc,...hc}))}Iv&&await((xn=(kt=(Wt=A.format)==null?void 0:Wt.paragraph)==null?void 0:kt.setMarkRunProps)==null?void 0:xn.call(kt,{target:Uc,markRunProps:Iv})),ts&&await((Yn=(hr=(or=A.format)==null?void 0:or.paragraph)==null?void 0:hr.setNumbering)==null?void 0:Yn.call(hr,{target:Uc,...ts})),Q2&&(((Yi=(vi=await Ol(t0))==null?void 0:vi.address)==null?void 0:Yi.nodeType)==="listItem"?await((Ns=(Cs=A.lists)==null?void 0:Cs.applyStyle)==null?void 0:Ns.call(Cs,{target:X6(Yh.blockId,Ms),style:Q2})):ts&&await((cs=(Jo=(Xi=A.format)==null?void 0:Xi.paragraph)==null?void 0:Jo.setNumbering)==null?void 0:cs.call(Jo,{target:Uc,...ts})))}}m.mode==="armed"&&Bh(),Rt()},Zo=(v,w,A,N)=>{var ce,we;
460const j=dv(v,w),G=j?j.then(()=>(Ba(v,w,A,N),fi)):(Ba(v,w,A,N),fi);return((we=(ce=R0(v))==null?void 0:ce.inline)==null?void 0:we.kind)==="toggle"&&(Qu=G),G},mf=(v,w,A)=>Zo(v,w,A,!1),jh=(v,w)=>Zo(v,w,void 0,!0),id=v=>({id:v,getState:()=>K.toolbar.commands[v]??uf(v,P(),K.selection,nl(K.selection)),observe:w=>ti(A=>A.toolbar.commands[v]??{enabled:!1,active:!1,supported:!1,source:"unsupported",reason:en.commandUnsupported}).subscribe(w),execute:w=>Fl(v,w),executeAsync:w=>mf(v,w)}),Ug=v=>{Ge.set(v.id,v),Rt();const w=()=>{Ge.delete(v.id),Rt()};return Object.assign(w,{handle:id(v.id),unregister:w})},od=so(v=>v.selection),bu=Ji(od),Vg=()=>{var j;const v=M();if(typeof(v==null?void 0:v.getHandles)!="function")return{reason:en.hostCapabilityUnavailable};let w=null;try{w=v.getHandles()}catch(G){const ce=G==null?void 0:G.reason;return{reason:ce==="host-not-ready"||ce==="host-disposed"||ce==="editing-mount-required"?en.notReady:en.hostCapabilityUnavailable}}const A=(j=w==null?void 0:w.editing)==null?void 0:j.selectionTargets;if(typeof(A==null?void 0:A.apply)=="function")return{helper:A};const N=w==null?void 0:w.selection;return typeof(N==null?void 0:N.apply)=="function"?{helper:N}:{reason:en.hostCapabilityUnavailable}},Po=()=>{var j,G,ce,we,Re;const v=M();if(typeof(v==null?void 0:v.getHandles)!="function")return null;let w=null;try{w=v.getHandles()}catch{return null}const A=((ce=(G=(j=w==null?void 0:w.editing)==null?void 0:j.selection)==null?void 0:G.toSelectionTarget)==null?void 0:ce.call(G))??((Re=(we=w==null?void 0:w.selection)==null?void 0:we.toSelectionTarget)==null?void 0:Re.call(we));if(!A||typeof A!="object"||A.kind!=="ok")return null;const N=A.target;return N&&typeof N=="object"?N:null},fv=v=>{var A,N;const w=M();if(typeof(w==null?void 0:w.getHandles)=="function")try{const j=(N=(A=w.getHandles())==null?void 0:A.editing)==null?void 0:N.contentControls;typeof(j==null?void 0:j.activate)=="function"&&j.activate({id:v})}catch{}},mm={get:bu.get,getSnapshot:bu.getSnapshot,subscribe:bu.subscribe,observe:bu.observe,current:()=>Mc().value,capture:()=>{const v=od.get();return v.empty||!v.target&&!v.selectionTarget?null:{...v,capturedAt:Date.now()}},restore:v=>{const w=j=>(Rt(),{...j,success:j.ok});if(!v||typeof v!="object")return w({ok:!1,reason:en.targetUnresolved});if(!C())return w({ok:!1,reason:en.notReady});const A=yZ(v);if(!A)return w({ok:!1,reason:en.targetUnresolved});const N=Vg();if(!("helper"in N))return w({ok:!1,reason:N.reason});try{return w(MS(N.helper.apply(A)))}catch{return w({ok:!1,reason:en.hostCapabilityUnavailable})}},apply:v=>{if(!C())return{ok:!1,reason:en.notReady};const w=Vg();if(!("helper"in w))return{ok:!1,reason:w.reason};try{const A=w.helper.apply(v);return Rt(),MS(A)}catch{return{ok:!1,reason:en.hostCapabilityUnavailable}}},placeAroundContentControl:async v=>{if(!C())return{ok:!1,reason:en.notReady};const w=Vg();if(!("helper"in w))return{ok:!1,reason:w.reason};if(typeof w.helper.placeAroundContentControl!="function")return{ok:!1,reason:en.hostCapabilityUnavailable};try{const A=await w.helper.placeAroundContentControl(v);return Rt(),MS(A)}catch{return{ok:!1,reason:en.targetUnresolved}}},getAnchorRect:v=>{const w=M();if(typeof(w==null?void 0:w.getSelectionAnchorRect)=="function"){const A=Dn(()=>w.getSelectionAnchorRect(v),null);return A&&typeof A=="object"&&(Number(A.width)>0||Number(A.height)>0)?A:null}return null},getRects:v=>{const w=od.get(),A=w.selectionTarget??w.target;if(w.empty||!A)return[];const N=Xg.getRect({target:A,relativeTo:v==null?void 0:v.relativeTo});return N.found?N.rects:[]}},j2={get ids(){return fn()},has:v=>R0(v)!=null||Ge.has(v),get:v=>id(v),execute:Fl,executeAsync:mf,register:Ug,getContextMenuItems:v=>{const w=[];for(const A of Ge.values()){const N=A.contextMenu;N&&Dn(N.when?()=>N.when(v):void 0,!0)&&w.push({id:A.id,label:N.label,group:N.group,order:N.order,invoke:()=>Fl(A.id,void 0,v)})}return w.sort((A,N)=>(A.order??0)-(N.order??0)||A.label.localeCompare(N.label))}},Hg=Ji(so(v=>v.toolbar)),OC={get:Hg.get,getSnapshot:()=>K.toolbar,subscribe:Hg.subscribe,observe:Hg.observe,execute:Fl,executeAsync:mf},wu=async(v,w)=>{if(!C())return{success:!1,ok:!1,reason:en.notReady};if(!v)return{success:!1,ok:!1,reason:en.targetUnresolved};const A=M(),N=A==null?void 0:A.scrollTargetIntoView;if(typeof N!="function")return{success:!1,ok:!1,reason:en.hostCapabilityUnavailable};try{const j={target:v,block:(w==null?void 0:w.block)??"center",behavior:(w==null?void 0:w.behavior)??"smooth"},G=await Promise.resolve(w!=null&&w.shouldContinue?N.call(A,j,w.shouldContinue):N.call(A,j));return G&&typeof G=="object"&&G.success===!1?{success:!1,ok:!1,reason:Ox(G.reason,en.targetUnresolved)}:{success:!0,ok:!0}}catch{return{success:!1,ok:!1,reason:en.hostCapabilityUnavailable}}};let gm=0;Sr.push(()=>{gm+=1});
460const hv={navigateTo:async(v,w)=>{const A=++gm,N=()=>({success:!1,ok:!1,reason:en.targetUnresolved}),j=typeof v=="string"?{kind:"entity",entityType:"bookmark",name:v}:v;if(!j||j.kind!=="entity"||j.entityType!=="bookmark"||typeof j.name!="string"||j.name.length===0||j.story!==void 0&&(!j.story||j.story.kind!=="story"||j.story.storyType!=="body"))return N();const G=C();if(!G||oe)return{success:!1,ok:!1,reason:en.notReady};const ce=P(),we=ce==null?void 0:ce.bookmarks;if(typeof(we==null?void 0:we.list)!="function"||typeof(we==null?void 0:we.get)!="function")return{success:!1,ok:!1,reason:en.operationUnavailable};const Re=Vg();if(!("helper"in Re))return{success:!1,ok:!1,reason:Re.reason};const nt=M();if(typeof(nt==null?void 0:nt.scrollTargetIntoView)!="function")return{success:!1,ok:!1,reason:en.hostCapabilityUnavailable};const ht=Gh();let pt=!0;const It=()=>pt&&!oe&&A===gm&&C()===G&&P()===ce&&M()===nt&&Gh()===ht,Vt=async()=>{var Ht,qt,Tt;try{const Wt=await we.list.call(we,j.story?{in:j.story}:{});if(!It()||(Array.isArray(Wt==null?void 0:Wt.items)?Wt.items:[]).filter(Yi=>(Yi==null?void 0:Yi.name)===j.name).length!==1)return N();const kt=await we.get.call(we,{target:j});if(!It())return N();const xn=(Ht=kt==null?void 0:kt.range)==null?void 0:Ht.from,or=(qt=kt==null?void 0:kt.range)==null?void 0:qt.to,hr=Yi=>typeof(Yi==null?void 0:Yi.blockId)=="string"&&Yi.blockId.length>0&&Number.isInteger(Yi.offset)&&Yi.offset>=0;if((kt==null?void 0:kt.name)!==j.name||(Tt=kt==null?void 0:kt.address)!=null&&Tt.story&&kt.address.story.storyType!=="body"||kt!=null&&kt.tableColumn||!hr(xn)||!hr(or)||xn.blockId===or.blockId&&xn.offset>or.offset)return N();const Yn=await wu({kind:"text",segments:[{blockId:xn.blockId,range:{start:xn.offset,end:xn.offset}}]},{block:(w==null?void 0:w.block)??"center",behavior:(w==null?void 0:w.behavior)??"instant",shouldContinue:It});if(!It())return N();if(!Yn.ok)return Yn;const vi=mm.apply({kind:"selection",start:{kind:"text",blockId:xn.blockId,offset:xn.offset},end:{kind:"text",blockId:or.blockId,offset:or.offset}});return{...vi,success:vi.ok}}catch{return N()}};let zt;const Dt=new Promise(Ht=>{zt=setTimeout(()=>{pt=!1,Ht(N())},15e3)});try{return await Promise.race([Vt(),Dt])}finally{pt=!1,clearTimeout(zt)}}},la=v=>{if(!v||typeof v!="object")return null;const w=v,A=w.wordRevisionIds&&typeof w.wordRevisionIds=="object"?w.wordRevisionIds:null,N=w.sourceIds&&typeof w.sourceIds=="object"?w.sourceIds:null,j=Array.isArray(N==null?void 0:N.wordIdOther)?N.wordIdOther:void 0,G=(A==null?void 0:A.insert)??(A==null?void 0:A.delete)??(A==null?void 0:A.format)??(N==null?void 0:N.wordIdInsert)??(N==null?void 0:N.wordIdDelete)??(j==null?void 0:j[0]);return typeof G=="string"&&G.length>0?G:null},Bo=async(v,w,A,N,j)=>{const G=await wu(w,j);if(G.ok)return G;const ce=V(),we=ce==null?void 0:ce.focusTrackedChange;if(typeof we!="function")return G;const Re=A||N?{commentId:v,...A?{trackedChangeStory:A}:{},...N?{importedId:N}:{}}:v;try{const nt=await Promise.resolve(we.call(ce,Re));if(nt&&typeof nt=="object"&&nt.ok===!0)return{success:!0,ok:!0}}catch{}return G},gf=async(v,w,A,N)=>{var Tt;const j=v==="trackChanges"?N==null?void 0:N.story:void 0,G=v==="trackChanges"?(N==null?void 0:N.matchStory)??j:void 0,ce=Wt=>{if(!j||!Wt||typeof Wt!="object")return Wt;const kt=Wt,xn=kt.address&&typeof kt.address=="object"?kt.address:null;return kt.story||xn!=null&&xn.story?Wt:{...kt,story:j}},we=v==="trackChanges"?$6:Gb,Re=A.find(Wt=>vc(Wt,w,G)),nt=Re&&typeof Re=="object"?Re:null,ht=v==="trackChanges"&&(nt==null?void 0:nt.type)==="move"&&(nt.subtype==="move-to"||nt.subtype==="move-from")?nt.subtype:null,pt=ht&&typeof(nt==null?void 0:nt.trackedChangeCanonicalId)=="string"?nt.trackedChangeCanonicalId:w,It=Wt=>{if(!ht)return v==="trackChanges"?$6(Wt,{preferStableBlock:!0}):we(Wt);const kt=Gb(Wt);if((kt==null?void 0:kt.kind)!=="move")return null;const xn=ht==="move-to"?kt.destination:kt.source;return A4(xn)?xn:null},Vt=we(Re),zt=v!=="trackChanges"||!ht&&A4(Gb(Re));if(Vt&&zt)return ce(Vt);const Dt=(Tt=P())==null?void 0:Tt[v],Ht=v==="comments"?{commentId:w}:{id:pt,...j?{story:j}:{}},qt=Dt==null?void 0:Dt.get;if(typeof qt!="function")return ce(Vt);try{return ce(It(await Promise.resolve(qt.call(Dt,Ht)))??Vt)}catch{return ce(Vt)}};function Fh(v,w){var G;if(hu())return no("Comments are read-only.","DOCUMENT_READONLY");if(bh())return no("Resolving comments is disabled.","DOCUMENT_READONLY");const A=(G=P())==null?void 0:G.comments,N=A==null?void 0:A.patch;if(typeof N!="function")return no("comments.patch is unavailable.");const j=no("comments.patch failed.");return Dn(()=>Pa(N.call(A,{commentId:v,status:w}),j),j)}const sd=()=>hu()?no("Comments are read-only.","DOCUMENT_READONLY"):null,pv=(v,w)=>{const A=w&&typeof w=="object"?w:null;let N=Array.from(v);(A==null?void 0:A.includeResolved)===!1&&(N=N.filter(Re=>Re.status!=="resolved"));const j=Number(A==null?void 0:A.offset),G=Number.isInteger(j)&&j>0?j:0,ce=Number(A==null?void 0:A.limit),we=Number.isInteger(ce)&&ce>=0?G+ce:void 0;return N.slice(G,we)},ja=so(v=>
460v.comments),yf=Ws(ja,ti(v=>am(v.selection,v.comments)),"comments"),mv={get:yf.get,getSnapshot:yf.getSnapshot,subscribe:yf.subscribe,observe:yf.observe,list:v=>{Bi();const w=Qd();return pv(w.value??ja.get().items,v)},getById:v=>{var j;const w=ja.get().items.find(G=>Es(G)===v)??null;if(w)return w;const A=(j=P())==null?void 0:j.comments,N=Dn(A!=null&&A.get?()=>A.get({commentId:v}):void 0,null);return zo(N)?null:N},createFromCapture:(v,w)=>{var ce;const A=sd();if(A)return A;const N=(ce=P())==null?void 0:ce.comments,j=N==null?void 0:N.create;if(typeof j!="function")return no("comments.create is unavailable.");const G=no("comments.create failed.");return Dn(()=>{const we=v&&typeof v=="object"?v.target??v.selectionTarget:null;return we==null?no("A range selection is required to comment.","NO_SELECTION"):Pa(j.call(N,{target:we,text:w.text}),G)},G)},createFromSelection:v=>{var we;const w=sd();if(w)return w;const A=(we=P())==null?void 0:we.comments,N=A==null?void 0:A.create;if(typeof N!="function")return no("comments.create is unavailable.");const j=od.get();let G=j.target??j.selectionTarget;if(j.empty||!G){const Re=Po();Re&&(G=Re)}if(!G)return no("A range selection is required to comment.","NO_SELECTION");const ce=no("comments.create failed.");return Dn(()=>Pa(N.call(A,{target:G,text:v.text}),ce),ce)},reply:(v,w)=>{var ce;const A=sd();if(A)return A;const N=(ce=P())==null?void 0:ce.comments,j=(N==null?void 0:N.reply)??(N==null?void 0:N.create);if(typeof j!="function")return no("comments.reply is unavailable.");const G=no("comments.reply failed.");return Dn(()=>Pa(j===(N==null?void 0:N.reply)?j.call(N,{parentCommentId:v,text:w.text}):j.call(N,{parentCommentId:v,text:w.text}),G),G)},edit:(v,w)=>{var ce;const A=sd();if(A)return A;const N=(ce=P())==null?void 0:ce.comments,j=N==null?void 0:N.patch;if(typeof j!="function")return no("comments.patch is unavailable.");const G=no("comments.patch failed.");return Dn(()=>Pa(j.call(N,{commentId:v,text:w.text}),G),G)},resolve:v=>Fh(v,"resolved"),reopen:v=>Fh(v,"active"),delete:v=>{var G;const w=sd();if(w)return w;const A=(G=P())==null?void 0:G.comments,N=(A==null?void 0:A.delete)??(A==null?void 0:A.remove);if(typeof N!="function")return no("comments.delete is unavailable.");const j=no("comments.delete failed.");return Dn(()=>Pa(N.call(A,{commentId:v}),j),j)},setActive:v=>{if(v==null)return Be=null,Rt(),!0;if(!C())return!1;const w=ja.get(),A=Le.get("comments"),N=(A==null?void 0:A.token)===rn()&&A.hasSettled&&Array.isArray(A.value)?A.value:null,j=N??w.items;if(!N&&w.listStatus!=="ready")return!1;const G=QX(j,v);return!G||!j.some(ce=>Es(ce)===G)?!1:(Be=G,Rt(),!0)},scrollTo:async v=>{if(!P())return{success:!1,ok:!1,reason:C()?en.documentApiUnavailable:en.notReady};const w=await gf("comments",v,ja.get().items);return w?wu(w):{success:!1,ok:!1,reason:en.targetUnresolved}}},Fa=so(v=>v.trackChanges),$g=(v,w)=>{Zn();const A=(Dc().value??Fa.get().items).map(b0).filter(pt=>pt!=null&&Es(pt)!==null);if(A.length===0)return null;const N=K.trackChanges.activeId,j=(he==null?void 0:he.id)===N?he.story:void 0,G=A.filter(pt=>Xv(pt)==null),ce=j||G.length===0?A:G;let we=N?ce.findIndex(pt=>vc(pt,N,j)):-1;we===-1&&N&&j&&(we=ce.findIndex(pt=>vc(pt,N)));const Re=ce[we===-1?v>0?0:ce.length-1:(we+v+ce.length)%ce.length],nt=Es(Re),ht=Xv(Re);return Ce(ht?{id:nt,story:ht}:{id:nt},w),Rt(),nt},gv=async v=>{const w=V(),A=w==null?void 0:w.listTrackedChanges;if(typeof A=="function")try{await Promise.resolve(A.call(w,{mode:"visible-window",targetIds:[v],refreshReason:"ui-track-change-reveal-restamp",blocking:!0}))}catch{}};let yv=Promise.resolve();const F2=v=>{const w=ye;return yv.catch(()=>{}).then(()=>z2(v,w))},z2=async(v,w)=>{if(ye!==w)return{success:!1};const A=he,N=$g(v,{invalidateQueuedNavigation:!1});if(N==null)return{success:!1};const j=he,G=Oe,ce=()=>ye===w&&he===j&&Oe===G,we=()=>{ce()&&(Ce(A,{invalidateQueuedNavigation:!1}),Rt())};j&&be.add(j);try{const Re=await gf("trackChanges",N,Fa.get().items,j!=null&&j.story?{story:j.story}:void 0);if(!ce())return{success:!1};if(!Re)return we(),{success:!1};const nt=Fa.get().items.find(pt=>vc(pt,N,j==null?void 0:j.story))??Fa.get().items.find(pt=>Es(pt)===N),ht=la(nt);vn+=1;try{const pt=await Bo(N,Re,j==null?void 0:j.story,ht,{behavior:"auto",shouldContinue:ce});if(!ce())return{success:!1};if(!pt.ok&&pt.reason!==en.targetNotVisible)we(),ue(A);else{if(pt.ok&&await gv(N),!ce())return{success:!1};ue(j)}return{success:pt.ok}}finally{vn=Math.max(0,vn-1),vn===0&&(ce()?oa&&qn(Jt(oa)):ue(he))}}finally{j&&be.delete(j)}},vv=v=>{const w=F2(v);return yv=w.then(()=>{},()=>{}),w}
460,zh=Ws(Fa,ti(v=>tf(v.selection,v.trackChanges)),"trackChanges"),U2={get:zh.get,getSnapshot:zh.getSnapshot,subscribe:zh.subscribe,observe:zh.observe,list:()=>{Zn();const v=Dc().value??Fa.get().items,w=zr(rn());return v.map(b0).filter(A=>A!=null).filter(A=>{const N=Es(A);return!N||!(w!=null&&w.has(N))})},accept:v=>ym("accept",v),acceptAsync:v=>vm(()=>ym("accept",v)),reject:v=>ym("reject",v),rejectAsync:v=>vm(()=>ym("reject",v)),acceptAll:()=>ad("accept",{kind:"all"},null),acceptAllAsync:()=>vm(()=>ad("accept",{kind:"all"},null)),rejectAll:()=>ad("reject",{kind:"all"},null),rejectAllAsync:()=>vm(()=>ad("reject",{kind:"all"},null)),next:()=>$g(1),previous:()=>$g(-1),navigateNext:()=>vv(1),navigatePrevious:()=>vv(-1),getAt:v=>{if(!v||typeof v!="object"||typeof v.x!="number"||typeof v.y!="number")return null;const w=Kg(v);if(w.length===0)return null;const A=Fa.get().items;let N;for(const j of w){if(j.type!=="trackedChange")continue;let G;if(j.story){if(N===void 0&&(N=ra()),!N)continue;G=N}else G=A;const ce=G.find(we=>vc(we,j.id,j.story));if(ce)return j.story?{id:ce.id,item:ce,story:j.story}:{id:ce.id,item:ce}}return null},setActive:v=>{if(v==null)return Ce(null),ue(null),Rt(),!0;if(!C())return!1;const w=typeof v=="string"?{id:v}:{id:v.id,story:v.story};if(typeof w.id!="string"||w.id.length===0)return!1;const A=w.id;if(w.story){const N=ra();if(!N)return!1;const j=mp(N,w.story).toPublicId(w.id)??w.id;if(!N.some(G=>vc(G,j,w.story)))return!1;w.id=j}else{const N=ra()??Fa.get().items,j=xd(N).toPublicId(w.id)??w.id,G=N.find(ce=>Es(ce)===j);if(!G)return!1;w.id=j,w.story=Xv(G)}return A!==w.id&&(w.paintedEntityId=A),Ce(w),ue(w),Rt(),!0},scrollTo:async v=>{if(!P())return{success:!1,ok:!1,reason:C()?en.documentApiUnavailable:en.notReady};const w=typeof v=="string"?v:v.id,A=typeof v=="string"||!v.story||typeof v.story!="object"?void 0:v.story,N=A?Xv({address:{story:A}}):void 0;if(typeof w!="string"||w.length===0)return{success:!1,ok:!1,reason:en.targetUnresolved};ye+=1,B+=1;const j=B,G=A?ra()??Fa.get().items:Fa.get().items,ce=A?mp(G,A).toPublicId(w)??w:xd(G).toPublicId(w)??w,we=A?G.find(It=>vc(It,ce,A)):G.find(It=>Es(It)===ce),Re=A?N:Xv(we),nt=la(we),ht=he,pt={id:ce,...Re?{story:Re}:{},...ce!==w?{paintedEntityId:w}:{}};be.add(pt);try{const It=await gf("trackChanges",ce,G,Re||A?{story:Re,matchStory:A}:void 0);if(B!==j)return{success:!1,ok:!1};if(!It)return{success:!1,ok:!1,reason:en.targetUnresolved};Ce(pt);const Vt=B,zt=he,Dt=Oe,Ht=()=>B===Vt&&he===zt&&Oe===Dt,qt=()=>{Ht()&&(Ce(ht,{invalidateQueuedNavigation:!1}),Rt())};Rt(),vn+=1;try{const Tt=await Bo(ce,It,Re,nt,{behavior:"auto",shouldContinue:Ht});if(!Ht())return{success:!1,ok:!1};if(!Tt.ok&&Tt.reason!==en.targetNotVisible)qt(),ue(ht);else{if(Tt.ok&&await gv(ce),!Ht())return{success:!1,ok:!1};ue(pt)}return Tt}finally{vn=Math.max(0,vn-1),vn===0&&(Ht()?oa&&qn(Jt(oa)):ue(he))}}finally{be.delete(pt)}}},ym=(v,w)=>{const{id:A,story:N}=typeof w=="string"?{id:w,story:void 0}:w;if(typeof A!="string"||A.length===0)return!1;const j={kind:"id",id:A,...N?{story:N}:{}};return ad(v,j,A,N)},vm=v=>(Ko=null,fi=Promise.resolve(!1),oe||v()===!1?Promise.resolve(!1):fi),ad=(v,w,A,N)=>{try{return ss(Gg(v,w,A,N))}catch{return!1}},Gg=(v,w,A,N)=>{var It,Vt,zt;if(Nc())return!1;const j=(It=P())==null?void 0:It.trackChanges,G=w.kind==="all"||w.scope==="all",ce=w.kind==="range",we=w.kind==="ids",Re=G?[]:we&&Array.isArray(w.ids)?w.ids.filter(Dt=>typeof Dt=="string"&&Dt.length>0):A?[A]:[];if(Re.length>0&&oc(v,Re)||sc({kind:v,scope:G?"all":"id"},j))return!1;if(D){const Dt=M(),Ht=(zt=(Vt=Dn(typeof(Dt==null?void 0:Dt.getHandles)=="function"?()=>Dt.getHandles():void 0,null))==null?void 0:Vt.trackChanges)==null?void 0:zt.decide;return typeof Ht=="function"?Ht({decision:v,target:w}):!1}const nt=G?`${v}All`:v,ht=!ce&&!we&&!N&&j&&typeof j[nt]=="function"?j[nt]:null,pt=j&&typeof j.decide=="function"?j.decide:null;return!ht&&!pt?!1:ht?ht.call(j,A??{}):pt.call(j,{decision:v,target:w})},Uh=so(v=>v.contentControls),Vh=v=>Uh.get().items.find(w=>(w==null?void 0:w.id)===v)??null,bm=Ws(Uh,ti(v=>(dr.contentControls>0&&rr("contentControls"),v.contentControls)),"contentControls"),V2=(v=>{if(v===void 0)return bm.get();const w=Zv(v);return w?Vh(w):null}),H2=Ji(Uh);let qg=0,bv=null;const Wg=()=>{qg+=1;const v=bv??M();bv=null,Dn(()=>{var w;return(w=v==null?void 0:v.clearContentControlHighlight)==null?void 0:w.call(v)},void 0)};Sr.push(Wg);const Hh={clearHighlight:Wg,highlight:async v=>{var we,Re;const w=Zv(v);if(!w)return{success:!1,reason:"invalid-id"};const A=M(),N=C(),j=(we=P())==null?void 0:we.contentControls;if(oe||!A||typeof A.highlightContentControl!="function"||typeof(j==null?void 0:j.list)!="function")return{success:!1,reason:"not-ready"};const G=++qg;bv=A,Dn(()=>{var nt;return(nt=A.cancelContentControlHighlightRequest)==null?void 0:nt.call(A)},void 0);const ce=()=>oe||G!==qg||N!==C();try{const nt=await j.list.call(j);if(ce())return{success:!1,reason:"cancelled"};const ht=(Re=nt==null?void 0:nt.items)==null?void 0:Re.find(Vt=>Vt.id===w);if(!ht)return{success:!1,reason:"not-found"};const pt=Nw(ht);if(!pt||ht.isEmpty)return{success:!1,reason:"not-reachable"};const It=await A.highlightContentControl.call(A,w,pt);return ce()?{success:!1,reason:"cancelled"}:It?{success:!0}:{success:!1,reason:"not-reachable"}}catch{return{success:!1,reason:ce()?"cancelled":"not-reachable"}}},get:(v=>(v!==void 0&&Xt(),V2(v))),getSnapshot:bm.getSnapshot,subscribe:bm.subscribe,observe:bm.observe,observeActivePath:H2.observe,list:()=>(Xt(),Uh.get().items),getById:v=>(Xt(),Vh(v)),getRect:v=>{const w=Zv(v);if(!w)return dp("unresolved");Xt();const A=Vh(w);if(!A)return dp("unresolved");const N=Nw(A);return N?Xg.getRect({target:N}):dp("unavailable")},scrollIntoView:async v=>{const w=Zv(v);if(!w)return{success:!1};Xt();const A=Vh(w);if(!A)return{success:!1};const N=Nw(A);return N?{success:(await wu(N,{block:v.block,behavior:v.behavior})).ok}:{success:!1}},focus:async v=>{const w=Zv(v);if(!w)return{success:!1,reason:"invalid-id"};if(!C())return{success:!1,reason:"not-ready"};Xt();const A=Vh(w);if(!A)return{success:!1,reason:"not-found"};const N=Nw(A);if(!N)return{success:!1,reason:"not-reachable"};if(!(await wu(N,{block:v.block,behavior:v.behavior})).ok)return{success:!1,reason:"not-reachable"};const j=qX(N);if(!j)return{success:!1,reason:"not-reachable"};const G=mm.apply(j);return!G.ok&&G.reason!==en.hostCapabilityUnavailable?{success:!1,reason:"not-reachable"}:(fv(w),{success:!0})}},wm=Ji(so(v=>v.fonts)),xm={get:wm.get,getSnapshot:wm.getSnapshot,subscribe:wm.subscribe,observe:wm.observe,getFamilyOptions:()=>K.fonts.options,getSizeOptions:()=>K.fonts.sizeOptions},vf=Ji(so(v=>v.zoom)),$2={get:vf.get,getSnapshot:vf.getSnapshot,subscribe:vf.subscribe,observe:vf.observe,set:v=>{if(typeof(t==null?void 0:t.setZoom)=="function")try{t.setZoom(v),Rt()}catch{}},setMode:v=>{if(typeof(t==null?void 0:t.setZoomMode)=="function")try{t.setZoomMode(v),Rt()}catch{}}},$h=Ji(so(v=>v.document)),NC={get:$h.get,getSnapshot:$h.getSnapshot,subscribe:$h.subscribe,observe:$h.observe,setMode:v=>{if(typeof(t==null?void 0:t.setDocumentMode)=="function")try{t.setDocumentMode(v),Rt()}catch{}},export:v=>{if(typeof(t==null?void 0:t.export)=="function")try{return Promise.resolve(t.export(v))}catch{return}},getText:()=>{const v=P(),w=Dn(v!=null&&v.getText?()=>v.getText({}):void 0,null);return typeof w=="string"?w:w&&typeof w=="object"&&typeof w.text=="string"?w.text:null},replaceDocument:async v=>{const w=e.superdoc;return typeof w.replaceDocument!="function"?{ok:!1,reason:en.operationUnavailable}:w.replaceDocument(v)},replaceFile:v=>{const w=(t==null?void 0:t.replaceFile)??(t==null?void 0:t.loadDocument)??(t==null?void 0:t.reload);if(typeof w=="function")try{return Promise.resolve(w.call(t,v))}catch{return}}},wv=()=>{var A,N;if(typeof HTMLElement>"u")return null;const v=(N=(A=C())==null?void 0:A.mount)==null?void 0:N.container;if(v instanceof HTMLElement)return v;const w=t==null?void 0:t.element;return w instanceof HTMLElement?w:null},G2=(v,w)=>{if(typeof v!="number"||typeof w!="number"||!Number.isFinite(v)||!Number.isFinite(w))return[];const A=globalThis.document;if(!A||typeof A.elementFromPoint!="function")return[];const N=wv();if(!N)return[];const j=A.elementFromPoint(v,w);if(!j||!N.contains(j))return[];const G=[j],ce=Tt=>{Tt&&N.contains(Tt)&&!G.includes(Tt)&&G.push(Tt)},we=A.elementsFromPoint;if(typeof we=="function"){let Tt=[];try{Tt=we.call(A,v,w)??[]}catch{Tt=[]}for(const Wt of Tt)ce(Wt)}const Re=[],nt=Tt=>{Tt&&N.contains(Tt)&&!Re.includes(Tt)&&!G.includes(Tt)&&Re.push(Tt)},ht=Tt=>{const Wt=Tt.getBoundingClientRect;if(typeof Wt!="function")return!1;let kt;try{kt=Wt.call(Tt)}catch{return!1}return kt!=null&&v>=kt.left&&v<=kt.right&&w>=kt.top&&w<=kt.bottom};for(const Tt of G){const Wt=Tt.querySelectorAll;if(typeof Wt!="function")continue;let kt;try{kt=Wt.call(Tt,"[data-track-change-marker]")}catch{continue}for(let xn=0;xn<kt.length;xn+=1)ht(kt[xn])&&nt(kt[xn])}Re.reverse();const pt=[...Re,...G],It=U6(pt[0],N);for(let Tt=1;Tt<pt.length;Tt+=1)for(const Wt of U6(pt[Tt],N))It.push(Wt);
460if(It.length===0)return It;const Vt=Fa.get().items,zt=xd(Vt);let Dt;const Ht=new Set,qt=[];for(const Tt of It){if(Tt.type!=="trackedChange"){const or=Tt.type==="contentControl"?G6(Tt.story):void 0,hr=Tt.type==="contentControl"?YD(or)?or:q6(Tt.storyKey)??or:void 0,Yn=`${Tt.type}:${Tt.id}:${JSON.stringify(hr??null)}`;if(Ht.has(Yn))continue;if(Ht.add(Yn),Tt.type==="contentControl"){const{storyKey:vi,story:Yi,...Cs}=Tt;qt.push(hr?{...Cs,story:hr}:Cs)}else qt.push(Tt);continue}const Wt=q6(Tt.storyKey)??G6(Tt.story);let kt;if(Wt){if(Dt===void 0&&(Dt=ra()),!Dt||(kt=mp(Dt,Wt).toPublicId(Tt.id),!kt||!Dt.some(or=>vc(or,kt,Wt))))continue}else if(kt=zt.toPublicId(Tt.id),!kt)continue;const xn=`trackedChange:${kt}`;Ht.has(xn)||(Ht.add(xn),qt.push(Wt?{type:"trackedChange",id:kt,story:Wt}:{type:"trackedChange",id:kt}))}return qt};function Kg(v,w){return typeof v=="object"?G2(v==null?void 0:v.x,v==null?void 0:v.y):null}function xv(v){const w=!!v&&typeof v.x=="number"&&typeof v.y=="number",A=w?{x:v.x,y:v.y}:{x:0,y:0};return{point:A,entities:w?Kg(A):[],selection:K.selection,position:null,insideSelection:!1}}const bf=new Set;let km=!1;const kv=v=>{const w=M();if(typeof(w==null?void 0:w.observeGeometry)!="function")return;let A=!1;const N=Dn(()=>{const j=w.observeGeometry(()=>v.schedule());return A=!0,j},null);v.detach=typeof N=="function"?N:null,v.boundHost=A?w:null},_m=v=>{if(v.detach){try{v.detach()}catch{}v.detach=null}v.boundHost=null},Yg=()=>{if(km=!1,!(oe||M()))for(const v of bf)_m(v)},q2=()=>{if(!km){if(km=!0,typeof queueMicrotask=="function"){queueMicrotask(Yg);return}Promise.resolve().then(Yg)}},W2=()=>{const v=M();if(!v){q2();return}for(const w of bf)w.boundHost&&w.boundHost===v||(_m(w),kv(w),w.schedule())};Nr.push(W2);const Xg={getRect:v=>{const w=M(),A=w==null?void 0:w.getTargetRects;if(typeof A=="function"){const N=Dn(()=>A.call(w,{target:v.target}),null);return N&&typeof N=="object"?N.success===!0&&Array.isArray(N.rects)?mZ(pZ(N.rects.filter(j=>j!=null&&typeof j=="object")),v.relativeTo):dp(typeof N.reason=="string"?N.reason:"unresolved"):dp("unresolved")}return dp("unavailable")},observe:v=>{const w=[];let A=0;const N=typeof requestAnimationFrame=="function",j=()=>{if(!N){v();return}A||(A=requestAnimationFrame(()=>{A=0,v()}))},G=ti(we=>({ready:we.ready,selection:we.selection,zoom:we.zoom}));w.push(G.subscribe(()=>j()));const ce={schedule:j,detach:null,boundHost:null};return kv(ce),bf.add(ce),()=>{bf.delete(ce),_m(ce),A&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(A);for(const we of w.splice(0))try{we()}catch{}}},getHost:()=>wv(),entityAt:Kg,contextAt:xv,scrollIntoView:async v=>{const w=v==null?void 0:v.target;if(!w)return{success:!1};let A=null;if(w.kind==="entity"){const N=w.entityType==="comment"?"comments":"trackChanges",j=N==="comments"?ja.get().items:Fa.get().items,G=w.entityType==="trackedChange"&&w.story?{story:w.story}:void 0;A=await gf(N,w.entityId,j,G)}else{const N=w,j=w,G=Array.isArray(N.segments)&&N.segments.length>0?N.segments:j.blockId&&j.range?[{blockId:j.blockId,range:j.range}]:null;if(G){const ce=w.story;A={kind:"text",segments:G,...ce?{story:ce}:{}}}}return A?{success:(await wu(A,{block:v.block??"center",behavior:v.behavior??"smooth"})).ok}:{success:!1}}},Zg=v=>{var A;const w=(A=v&&typeof v=="object"?v:null)==null?void 0:A.target;return w&&typeof w=="object"?w:null},_v=v=>`metadata:resolve:${v}`,Gh=()=>{const v=M(),w=typeof(v==null?void 0:v.getLocalMutationRevision)=="function"?Dn(()=>v.getLocalMutationRevision(),null):null;return`${rn()}|local:${typeof w=="number"?w:"unknown"}`},Cv=v=>{var j;const w=(j=P())==null?void 0:j.metadata;if(!w||typeof w.resolve!="function")return null;const{value:A,status:N}=ys(_v(v),Gh(),()=>w.resolve({id:v}),Zg);return N==="ready"?A:null},K2=async v=>{var A;const w=(A=P())==null?void 0:A.metadata;if(!w||typeof w.resolve!="function")return null;try{const N=Gh(),j=await Promise.resolve(w.resolve({id:v}));if(N!==Gh())return null;const G=Zg(j);return Le.set(_v(v),{token:N,value:G,hasSettled:!0,inflightToken:null}),G}catch{return null}},Y2={getRect:v=>{var N;const w=(N=P())==null?void 0:N.metadata;if(!w||typeof w.resolve!="function")return dp("unavailable");const A=Cv(v.id);return A?Xg.getRect({target:A}):dp("unresolved")},scrollIntoView:async v=>{const w=await K2(v.id);return w?{success:(await wu(w,{block:v.block,behavior:v.behavior})).ok}:{success:!1}}},MC={inTable:!1,tableNodeId:null,rowIndex:null,columnIndex:null,cellNodeId:null,rows:null,columns:null},DC={getContext:()=>{var A;const v=yt();if(!v)return{...MC};const w=(A=At())==null?void 0:A.table;return{inTable:!0,tableNodeId:v.tableNodeId,rowIndex:v.rowIndex,columnIndex:v.columnIndex,cellNodeId:v.cellNodeId,rows:typeof(w==null?void 0:w.rows)=="number"?w.rows:null,columns:typeof(w==null?void 0:w.columns)=="number"?w.columns:null}},isInTable:()=>yt()!=null}
460,Cm={query:"",total:0,activeIndex:-1,open:!1,available:!1,caseSensitive:!1,includeTrackedDeletions:!1,includeDeletedText:!1,regex:!1,canReplace:!1,canReplaceAll:!1,reason:en.searchUnavailable};let sr={...Cm};const qh=new Set,ul=()=>{var w;const v=(w=M())==null?void 0:w.search;return v&&typeof v=="object"?v:null},za=()=>{var w;const v=(w=ge())==null?void 0:w.search;return v&&typeof v=="object"?v:null},Wh=()=>{const v=ul();if(v&&typeof v.setSession=="function")return!0;const w=za();return!!w&&typeof w.query=="function"&&typeof w.getState=="function"},Ks=()=>{for(const v of[...qh])try{v(sr)}catch{}},Rs=v=>{sr={...sr,...v};const w=v.includeTrackedDeletions??v.includeDeletedText;return w!==void 0&&(sr.includeTrackedDeletions=w,sr.includeDeletedText=w),Ks(),sr};let yi=0,zl=null,Ua=null,xu=null,wf=null;const Kh=()=>{const v=wf;wf=null,v&&Dn(()=>v(),null)},ld=()=>{const v=xu;xu=null,v&&Dn(()=>(v(),null),null)},X2=()=>{Ua=null,yi+=1,zl=null,Ul=!1,Kh(),ld();const v=Wh();sr={...Cm,available:v,reason:v?void 0:en.searchUnavailable},Ks()};Sr.push(X2),Qr.push(()=>{if(zl===yi)return;const v=sr,w=dc();(w.canReplace!==v.canReplace||w.canReplaceAll!==v.canReplaceAll||w.available!==v.available||w.reason!==v.reason)&&Ks()});const Z2=v=>{if(!v)return!1;const w=v.queryError;if(w&&typeof w=="object"&&w.code==="invalid-pattern")return!0;const A=v.rejection;return v.status==="rejected"&&!!A&&typeof A=="object"&&A.code==="invalid-pattern"},Qg=(v,w=!1,A=w)=>{const N=v&&typeof v=="object"?v:null;if(!N)return null;const j=Array.isArray(N.matches)?N.matches:[],G=typeof N.total=="number"&&Number.isFinite(N.total)?N.total:j.length,ce=typeof N.activeMatchIndex=="number"?N.activeMatchIndex:typeof N.activeIndex=="number"?N.activeIndex:-1,we=N.canReplace===!0||w;return{...typeof N.query=="string"?{query:N.query}:{},total:G,activeIndex:ce,canReplace:we,canReplaceAll:we&&G>0&&N.truncated!==!0&&(N.canReplace===!0||A),...typeof N.caseSensitive=="boolean"?{caseSensitive:N.caseSensitive}:{},...typeof N.includeDeletedText=="boolean"?{includeDeletedText:N.includeDeletedText}:{},...N.regex===!0?{regex:!0}:{},...Z2(N)?{invalidPattern:!0}:{}}};let Ul=!1;const Jg=()=>{if(!Ul)return;Ul=!1;const v=za();v&&typeof v.query=="function"&&Dn(()=>v.query({query:""}),null)},_s=()=>{var v;return zl!==yi&&((v=le("find.replace"))==null?void 0:v.enabled)===!0},Os=()=>{var v;return zl!==yi&&((v=le("find.replaceAll"))==null?void 0:v.enabled)===!0},as=(v,w=!1,A=w)=>{const N=Qg(v,w,A);if(!N){Rs({total:0,activeIndex:-1,canReplace:!1,canReplaceAll:!1,reason:void 0});return}Rs({...N.query!==void 0?{query:N.query}:{},total:N.total,activeIndex:N.activeIndex,canReplace:N.canReplace,canReplaceAll:N.canReplaceAll,...N.includeDeletedText!==void 0?{includeDeletedText:N.includeDeletedText}:{},...N.regex!==void 0?{regex:N.regex}:{},reason:N.invalidPattern?en.searchInvalidPattern:void 0})},dc=()=>{const v=ul();if(v&&typeof v.getState!="function")return sr={...sr,available:Wh(),reason:Wh()?void 0:en.searchUnavailable},sr;if(!v){const A=za();if(A&&typeof A.getState=="function"){const N=Qg(Dn(()=>A.getState(),null),_s(),Os());if(zl===yi)return sr;if(N)return sr={...sr,...N.query!==void 0?{query:N.query}:{},total:N.total,activeIndex:N.activeIndex,canReplace:N.canReplace,canReplaceAll:N.canReplaceAll,available:!0,reason:N.invalidPattern?en.searchInvalidPattern:void 0,open:sr.open||!!N.query},sr}return sr={...Cm,query:sr.query,caseSensitive:sr.caseSensitive,includeTrackedDeletions:sr.includeTrackedDeletions,includeDeletedText:sr.includeDeletedText},sr}const w=Qg(Dn(()=>v.getState(),null));return w&&(sr={...sr,...w.query!==void 0?{query:w.query}:{},total:w.total,activeIndex:w.activeIndex,canReplace:w.canReplace,canReplaceAll:w.canReplaceAll,...w.includeDeletedText!==void 0?{includeDeletedText:w.includeDeletedText}:{},...w.includeDeletedText!==void 0?{includeTrackedDeletions:w.includeDeletedText}:{},...w.regex!==void 0?{regex:w.regex}:{},available:!0,reason:w.invalidPattern?en.searchInvalidPattern:void 0,open:sr.open||!!w.query}),sr},cd=v=>{const w=v&&typeof v=="object"?v:null;if((w==null?void 0:w.status)==="committed")return{ok:!0};if((w==null?void 0:w.status)==="rejected"&&w.reason==="read-only")return{ok:!1,reason:en.documentReadonly};const A=w==null?void 0:w.rejection;if((w==null?void 0:w.status)==="rejected"&&A&&typeof A=="object"&&A.code==="read-only-document")return{ok:!1,reason:en.documentReadonly};if((w==null?void 0:w.status)==="rejected"&&w.reason==="truncated")return{ok:!1,reason:en.searchTruncated};const N=w==null?void 0:w.failure;return(w==null?void 0:w.status)==="receipt-failure"&&N&&typeof N=="object"&&N.code==="REVISION_MISMATCH"?{ok:!1,reason:en.targetUnresolved}:{ok:!1,reason:en.operationUnavailable}},Qo=v=>{const w=yi;return dc(),Ks(),zo(v)?Promise.resolve(v).then(A=>(w===yi&&(dc(),Ks()),cd(A)),()=>(w===yi&&Rs({available:!1,reason:en.searchUnavailable}),{ok:!1,reason:en.searchUnavailable})):cd(v)},ls=Ji({get:()=>dc(),subscribe:v=>(qh.add(v),()=>qh.delete(v))}),Sv={get:ls.get,getSnapshot:ls.getSnapshot,subscribe:ls.subscribe,observe:ls.observe,open:()=>Wh()?(Rs({available:!0,open:!0,reason:void 0}),{ok:!0}):(Rs({available:!1,open:!1,reason:en.searchUnavailable}),{ok:!1,reason:en.searchUnavailable}),close:()=>{if(Ua=null,yi+=1,Kh(),xu)ld();else{const v=ul();if(v&&typeof v.clear=="function")Dn(()=>v.clear(),null);else{const w=za();w&&typeof w.query=="function"&&Dn(()=>w.query({query:""}),null)}}sr={...Cm,available:Wh(),reason:void 0},sr.available||(sr.reason=en.searchUnavailable),Ks()},find:(v,w)=>{const A=ul(),N=!!(w!=null&&w.caseSensitive),j=((w==null?void 0:w.includeTrackedDeletions)??(w==null?void 0:w.includeDeletedText))===!0,G=(w==null?void 0:w.regex)===!0;if((!A||typeof A.setSession!="function")&&Ua!==null&&Ua===za()&&zl!==yi&&Vl===null&&sr.open&&sr.available&&!sr.reason&&sr.query===v&&sr.caseSensitive===N&&sr.includeDeletedText===j&&sr.regex===G)return dc(),Ks(),sr;Ua=null,Vl!==null&&(clearTimeout(Vl),Vl=null);const ce=++yi;if(Kh(),Jg(),!A||typeof A.setSession!="function"){const Re=za();if(Re&&typeof Re.query=="function"&&typeof Re.getState=="function"){zl=ce,Rs({query:v,caseSensitive:N,includeDeletedText:j,regex:G,total:0,activeIndex:-1,
460canReplace:!1,canReplaceAll:!1,available:!0,open:!0,reason:void 0}),xu=()=>{Re.query({query:""})};const nt=Dn(()=>Re.query({query:v,caseSensitive:N,includeDeletedText:j,regex:G}),null);return zo(nt)?(Ul=!0,Promise.resolve(nt).then(ht=>{ce===yi&&(Ul=!1,zl=null,Ua=Re,as(ht,_s(),Os()))},()=>{ce===yi&&(Ul=!1,Rs({available:!1,reason:en.searchUnavailable}))}),sr):(zl=null,Ua=Re,as(nt,_s(),Os()),as(Dn(()=>Re.getState(),null),_s(),Os()),sr)}return Rs({query:v,total:0,activeIndex:-1,available:!1,caseSensitive:N,includeDeletedText:j,regex:G,reason:en.searchUnavailable})}Rs({query:v,caseSensitive:N,includeDeletedText:j,regex:G,available:!0,open:!0,reason:void 0}),xu=()=>{typeof A.clear=="function"&&A.clear()};const we=Dn(()=>A.setSession(v,{caseSensitive:N,includeDeletedText:j,...G?{regex:!0}:{},highlight:!0}),null);if(as(we),v.length>0&&sr.total===0&&sr.reason!==en.searchInvalidPattern){const Re=za();if(Re&&typeof Re.query=="function"&&typeof Re.getState=="function"){const nt=xu;xu=()=>{nt==null||nt(),Re.query({query:""})};const ht=Dn(()=>Re.query({query:v,caseSensitive:N,includeDeletedText:j,regex:G}),null);zo(ht)?(Ul=!0,Promise.resolve(ht).then(pt=>{ce===yi&&(Ul=!1,as(pt,_s(),Os()))},()=>{ce===yi&&(Ul=!1,Rs({available:!1,reason:en.searchUnavailable}))})):as(ht,_s(),Os()),as(Dn(()=>Re.getState(),null),_s(),Os())}}return sr},search:(v,w)=>Sv.find(v,w),next:()=>{const v=ul();if(!v||typeof v.next!="function"){const w=za();if(!w||typeof w.next!="function"||typeof w.getState!="function")return{ok:!1,reason:en.searchUnavailable};if(sr.total===0)return{ok:!1,reason:en.operationUnavailable};const A=Dn(()=>w.next(),null);if(zo(A)){const N=yi;Promise.resolve(A).then(j=>{N===yi&&as(j,_s(),Os())}).catch(()=>{N===yi&&Rs({available:!1,reason:en.searchUnavailable})})}else as(A,_s(),Os());return as(Dn(()=>w.getState(),null),_s(),Os()),{ok:!0}}return sr.total===0?{ok:!1,reason:en.operationUnavailable}:(as(Dn(()=>v.next(),null)),{ok:!0})},previous:()=>{const v=ul();if(!v||typeof v.previous!="function"){const w=za();if(!w||typeof w.previous!="function"||typeof w.getState!="function")return{ok:!1,reason:en.searchUnavailable};if(sr.total===0)return{ok:!1,reason:en.operationUnavailable};const A=Dn(()=>w.previous(),null);if(zo(A)){const N=yi;Promise.resolve(A).then(j=>{N===yi&&as(j,_s(),Os())}).catch(()=>{N===yi&&Rs({available:!1,reason:en.searchUnavailable})})}else as(A,_s(),Os());return as(Dn(()=>w.getState(),null),_s(),Os()),{ok:!0}}return sr.total===0?{ok:!1,reason:en.operationUnavailable}:(as(Dn(()=>v.previous(),null)),{ok:!0})},clear:()=>{Ua=null,yi+=1,Kh(),Jg();const v=ul();if(v&&typeof v.clear=="function"&&Dn(()=>v.clear(),null),!v||typeof v.clear!="function"){const w=za();w&&typeof w.query=="function"&&Dn(()=>w.query({query:""}),null)}Rs({query:"",total:0,activeIndex:-1,canReplace:!1,canReplaceAll:!1,reason:void 0})},replace:v=>{const w=ul();if(!w){const N=za();if(!N||typeof N.replace!="function"||typeof N.getState!="function")return{ok:!1,reason:en.searchUnavailable};if(!_s())return{ok:!1,reason:en.operationUnavailable};const j=Dn(()=>N.replace({replacement:typeof v=="string"?v:""}),null);if(zo(j)){const G=yi;dc(),Ks();const ce=()=>G===yi;return Promise.resolve(j).then(we=>(ce()&&(as(we,_s(),Os()),dc(),Ks()),cd(we)),()=>(ce()&&Rs({available:!1,reason:en.searchUnavailable}),{ok:!1,reason:en.searchUnavailable}))}return dc(),Ks(),cd(j)}if(typeof w.replaceCurrent!="function")return{ok:!1,reason:en.operationUnavailable};const A=Dn(()=>w.replaceCurrent(typeof v=="string"?v:""),null);return Qo(A)},replaceAll:v=>{var N;const w=ul();if(!w){const j=za();if(!j||typeof j.replaceAll!="function"||typeof j.getState!="function")return{ok:!1,reason:en.searchUnavailable};if(!Os())return{ok:!1,reason:((N=le("find.replaceAll"))==null?void 0:N.reason)==="search-truncated"?en.searchTruncated:en.operationUnavailable};const G=Dn(()=>j.replaceAll({replacement:typeof v=="string"?v:""}),null);if(zo(G)){const ce=yi;dc(),Ks();const we=()=>ce===yi;return Promise.resolve(G).then(Re=>(we()&&(as(Re,_s(),Os()),dc(),Ks()),cd(Re)),()=>(we()&&Rs({available:!1,reason:en.searchUnavailable}),{ok:!1,reason:en.searchUnavailable}))}return dc(),Ks(),cd(G)}if(typeof w.replaceAll!="function")return{ok:!1,reason:en.operationUnavailable};const A=Dn(()=>w.replaceAll(typeof v=="string"?v:""),null);return Qo(A)}};let Vl=null;wr=()=>{if(Ua=null,Vl!==null&&clearTimeout(Vl),!sr.open||!sr.query)return;const v=yi;Vl=setTimeout(()=>{if(Vl=null,oe||v!==yi||!sr.open||!sr.query)return;const w={query:sr.query,caseSensitive:sr.caseSensitive,includeDeletedText:sr.includeDeletedText,regex:sr.regex},A=za(),N=ul();if(typeof(A==null?void 0:A.refresh)!="function"&&typeof(N==null?void 0:N.refresh)!="function")return;const j=++yi;if(Jg(),typeof(A==null?void 0:A.refresh)=="function"&&typeof A.query=="function"){const ce=A;wf=()=>{ce.query({query:""})}}const G=typeof(A==null?void 0:A.refresh)=="function"?Dn(()=>A.refresh(w),null):Dn(()=>N.refresh(),null);zo(G)?(zl=j,Rs({canReplace:!1,canReplaceAll:!1}),Promise.resolve(G).then(ce=>{j!==yi||oe||(wf=null,zl=null,Ua=A,as(ce,_s(),Os()))},()=>{j!==yi||oe||(wf=null,Rs({available:!1,reason:en.searchUnavailable}))})):G!==null&&(wf=null,Ua=A,as(G))},120)};const Ev=so(v=>v.styles),Sm=Ji(Ev),Em={get:Sm.get,getSnapshot:Sm.getSnapshot,subscribe:Sm.subscribe,observe:Sm.observe,getCatalog:v=>(rr(La(v)),rl(v).value),getQuickGallery:()=>Ev.get().quickGallery,getActiveParagraphStyle:()=>va(K.selection,il().cache).style},Am=eX({getEditor:C,getMode:Ei,getFonts:()=>xm.getFamilyOptions(),getContainer:()=>t.element??null,openSurface:typeof t.openSurface=="function"?v=>t.openSurface(v):null});Sr.push(Am.close),Qr.push(Am.close);const e0={select:ti,get state(){return K},selection:mm,commands:j2,toolbar:OC,comments:mv,trackChanges:U2,contentControls:Hh,bookmarks:hv,fonts:xm,zoom:$2,document:NC,viewport:Xg,metadata:Y2,tables:DC,search:Sv,contextMenu:I,watermark:Am,styles:Em,formatPainter:{setPointerSelecting(v){oe||(m={...m,pointerSelecting:v})},notifyPointerUp(){oe||(m={...m,pointerSelecting:!1},Ur())},setKeyboardSelecting(v){oe||(m={...m,keyboardSelecting:v})},notifyKeyUp(){oe||(m={...m,keyboardSelecting:!1},Ur())},cancel(){oe||Bh()},onModeChange(v){return oe?()=>{}:(k.add(v),()=>k.delete(v))}},createScope:()=>{const v=[];return{select:(w,A)=>{const N=ti(w,A);return{get:N.get,subscribe:j=>{const G=N.subscribe(j);return v.push(G),G}}},dispose:()=>{for(const w of v.splice(0))w()}}},destroy:()=>
460{if(!oe){Am.destroy(),Wg(),oe=!0,Ua=null,Vl!==null&&clearTimeout(Vl),Vl=null,Kh(),PX(Lr,$e),z&&(clearTimeout(z),z=null),xt&&(clearTimeout(xt),xt=null,de=0),Pe!=null&&Pe.timer&&(clearTimeout(Pe.timer),Pe.timer=null),Pe=null,me&&(clearTimeout(me),me=null),Pr&&(clearTimeout(Pr),Pr=null),Zr&&Zr(),Zr=null,jr=null;for(const v of Object.keys(dr))dr[v]=0;Oo.clear(),Hi.clear(),cn.clear(),Fn=null,tt.clear();for(const v of Mr.splice(0))v();Wi&&Wi(),Wi=null,ks=null,go&&go(),go=null,Dl=null,ia&&ia(),ia=null,ac=null,oo&&oo(),oo=null,oa=null,Wo&&Wo(),Wo=null,sa=null,$&&$(),$=null,Pl=null;for(const v of bf)_m(v);bf.clear(),Ue.clear(),qh.clear(),y+=1,b=null,k.clear(),yi+=1,Ge.clear()}}};return Fe=e0,qD.set(e0,jh),WD.set(e0,hm),e0}var _Z=[{value:"Arial",label:"Arial",previewFamily:"Arial, sans-serif"},{value:"Calibri",label:"Calibri",previewFamily:"Calibri, sans-serif"},{value:"Courier New",label:"Courier New",previewFamily:'"Courier New", monospace'},{value:"Georgia",label:"Georgia",previewFamily:"Georgia, serif"},{value:"Times New Roman",label:"Times New Roman",previewFamily:'"Times New Roman", serif'},{value:"Verdana",label:"Verdana",previewFamily:"Verdana, sans-serif"}];function CZ(e){const t=e.trim(),n=t[0];if(n==='"'||n==="'"){const i=t.indexOf(n,1);if(i>0)return t.slice(1,i).trim()}const r=t.indexOf(",");return(r===-1?t:t.slice(0,r)).trim().replace(/^["']|["']$/g,"")}function SZ(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||typeof n!="object")continue;const r=n,i=typeof r.logicalFamily=="string"?CZ(r.logicalFamily):"";if(!i)continue;const o=typeof r.previewFamily=="string"&&r.previewFamily.trim()?r.previewFamily.trim():i;t.push({value:i,label:i,previewFamily:o})}return t}function EZ(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||typeof n!="object")continue;const r=n,i=typeof r.value=="string"?r.value.trim():"";if(!i)continue;const o=typeof r.label=="string"&&r.label.trim()?r.label.trim():i,s=typeof r.previewFamily=="string"&&r.previewFamily.trim()?r.previewFamily.trim():i;t.push({value:i,label:o,previewFamily:s})}return t}function AZ(e,t=[]){const n=[],r=new Set,i=s=>{const l=String(s.value).trim().toLowerCase();!l||r.has(l)||(r.add(l),n.push(s))};for(const s of e)i(s);const o=t.length?t:_Z;for(const s of o)i(s);return n}var TZ=[{value:"8",label:"8"},{value:"9",label:"9"},{value:"10",label:"10"},{value:"11",label:"11"},{value:"12",label:"12"},{value:"14",label:"14"},{value:"16",label:"16"},{value:"18",label:"18"},{value:"24",label:"24"},{value:"36",label:"36"}];function IZ(e,t){return e.activeMark?t.activeMarks.includes(e.activeMark):!1}var qA=OD(RD(((e,t)=>{var n=Object.prototype.hasOwnProperty,r="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function o(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function s(d,f,p,m,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var b=new o(p,m||d,y),k=r?r+f:f;return d._events[k]?d._events[k].fn?d._events[k]=[d._events[k],b]:d._events[k].push(b):(d._events[k]=b,d._eventsCount++),d}function l(d,f){--d._eventsCount===0?d._events=new i:delete d._events[f]}function u(){this._events=new i,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)n.call(p,m)&&f.push(r?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=r?r+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var y=0,b=m.length,k=new Array(b);y<b;y++)k[y]=m[y].fn;return k},u.prototype.listenerCount=function(f){var p=r?r+f:f,m=this._events[p];return m?m.fn?1:m.length:0},u.prototype.emit=function(f,p,m,y,b,k){var S=r?r+f:f;if(!this._events[S])return!1;var x=this._events[S],T=arguments.length,C,I;if(x.fn){switch(x.once&&this.removeListener(f,x.fn,void 0,!0),T){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,p),!0;case 3:return x.fn.call(x.context,p,m),!0;case 4:return x.fn.call(x.context,p,m,y),!0;case 5:return x.fn.call(x.context,p,m,y,b),!0;case 6:return x.fn.call(x.context,p,m,y,b,k),!0}for(I=1,C=new Array(T-1);I<T;I++)C[I-1]=arguments[I];x.fn.apply(x.context,C)}else{var D=x.length,P;for(I=0;I<D;I++)switch(x[I].once&&this.removeListener(f,x[I].fn,void 0,!0),T){case 1:x[I].fn.call(x[I].context);break;case 2:x[I].fn.call(x[I].context,p);break;case 3:x[I].fn.call(x[I].context,p,m);break;case 4:x[I].fn.call(x[I].context,p,m,y);break;default:if(!C)for(P=1,C=new Array(T-1);P<T;P++)C[P-1]=arguments[P];x[I].fn.apply(x[I].context,C)}}return!0},u.prototype.on=function(f,p,m){return s(this,f,p,m,!1)},u.prototype.once=function(f,p,m){return s(this,f,p,m,!0)},u.prototype.removeListener=function(f,p,m,y){var b=r?r+f:f;if(!this._events[b])return this;if(!p)return l(this,b),this;var k=this._events[b];if(k.fn)k.fn===p&&(!y||k.once)&&(!m||k.context===m)&&l(this,b);else{for(var S=0,x=[],T=k.length;S<T;S++)(k[S].fn!==p||y&&!k[S].once||m&&k[S].context!==m)&&x.push(k[S]);x.length?this._events[b]=x.length===1?x[0]:x:l(this,b)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=r?r+f:f,this._events[p]&&l(this,p)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)}))()),Sa=[];for(let e=0;e<256;++e)Sa.push((e+256).toString(16).slice(1));
460function RZ(e,t=0){return(Sa[e[t+0]]+Sa[e[t+1]]+Sa[e[t+2]]+Sa[e[t+3]]+"-"+Sa[e[t+4]]+Sa[e[t+5]]+"-"+Sa[e[t+6]]+Sa[e[t+7]]+"-"+Sa[e[t+8]]+Sa[e[t+9]]+"-"+Sa[e[t+10]]+Sa[e[t+11]]+Sa[e[t+12]]+Sa[e[t+13]]+Sa[e[t+14]]+Sa[e[t+15]]).toLowerCase()}var zS,OZ=new Uint8Array(16);function NZ(){if(!zS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");zS=crypto.getRandomValues.bind(crypto)}return zS(OZ)}var r8={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Sp(e,t,n){var i;if(r8.randomUUID&&!e)return r8.randomUUID();e=e||{};const r=e.random??((i=e.rng)==null?void 0:i.call(e))??NZ();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,RZ(r)}function QD(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function MZ(e){var t=QD(e),n=t[0],r=t[1];return(n+r)*3/4-r}function DZ(e,t,n){return(t+n)*3/4-n}function LZ(e){var t,n=QD(e),r=n[0],i=n[1],o=new JD(DZ(e,r,i)),s=0,l=i>0?r-4:r,u;for(u=0;u<l;u+=4)t=Cc[e.charCodeAt(u)]<<18|Cc[e.charCodeAt(u+1)]<<12|Cc[e.charCodeAt(u+2)]<<6|Cc[e.charCodeAt(u+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=Cc[e.charCodeAt(u)]<<2|Cc[e.charCodeAt(u+1)]>>4,o[s++]=t&255),i===1&&(t=Cc[e.charCodeAt(u)]<<10|Cc[e.charCodeAt(u+1)]<<4|Cc[e.charCodeAt(u+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function PZ(e){return Ou[e>>18&63]+Ou[e>>12&63]+Ou[e>>6&63]+Ou[e&63]}function BZ(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(PZ(r));return i.join("")}function jZ(e){for(var t,n=e.length,r=n%3,i=[],o=16383,s=0,l=n-r;s<l;s+=o)i.push(BZ(e,s,s+o>l?l:s+o));return r===1?(t=e[n-1],i.push(Ou[t>>2]+Ou[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(Ou[t>>10]+Ou[t>>4&63]+Ou[t<<2&63]+"=")),i.join("")}var Ds,eb,Ou,Cc,JD,Lw,Dm,i8,Pw,Yl,e9=zA((()=>{for(Ds={},eb={},eb.byteLength=MZ,eb.toByteArray=LZ,eb.fromByteArray=jZ,Ou=[],Cc=[],JD=typeof Uint8Array<"u"?Uint8Array:Array,Lw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Dm=0,i8=Lw.length;Dm<i8;++Dm)Ou[Dm]=Lw[Dm],Cc[Lw.charCodeAt(Dm)]=Dm;Cc[45]=62,Cc[95]=63,Pw={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Pw.read=function(e,t,n,r,i){var o,s,l=i*8-r-1,u=(1<<l)-1,d=u>>1,f=-7,p=n?i-1:0,m=n?-1:1,y=e[t+p];for(p+=m,o=y&(1<<-f)-1,y>>=-f,f+=l;f>0;o=o*256+e[t+p],p+=m,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=s*256+e[t+p],p+=m,f-=8);if(o===0)o=1-d;else{if(o===u)return s?NaN:(y?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-d}return(y?-1:1)*s*Math.pow(2,o-r)},Pw.write=function(e,t,n,r,i,o){var s,l,u,d=o*8-i-1,f=(1<<d)-1,p=f>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=r?0:o-1,b=r?1:-1,k=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+p>=1?t+=m/u:t+=m*Math.pow(2,1-p),t*u>=2&&(s++,u/=2),s+p>=f?(l=0,s=f):s+p>=1?(l=(t*u-1)*Math.pow(2,i),s=s+p):(l=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[n+y]=l&255,y+=b,l/=256,i-=8);for(s=s<<i|l,d+=i;d>0;e[n+y]=s&255,y+=b,s/=256,d-=8);e[n+y-b]|=k*128};/*!
461* The buffer module from node.js, for the browser.
462*
463* @author   Feross Aboukhadijeh <https://feross.org>
464* @license  MIT
465*/(function(e){const t=eb,n=Pw,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=D,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i;const{Uint8Array:o,ArrayBuffer:s,SharedArrayBuffer:l}=globalThis;f.TYPED_ARRAY_SUPPORT=u(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const de=new o(1),z={foo:function(){return 42}};return Object.setPrototypeOf(z,o.prototype),Object.setPrototypeOf(de,z),de.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function d(de){if(de>
vendor: 18,141 bytes, line 465
465i)throw new RangeError('The value "'+de+'" is invalid for option "size"');const z=new o(de);return Object.setPrototypeOf(z,f.prototype),z}function f(de,z,Y){if(typeof de=="number"){if(typeof z=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(de)}return p(de,z,Y)}f.poolSize=8192;function p(de,z,Y){if(typeof de=="string")return k(de,z);if(s.isView(de))return x(de);if(de==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof de);if(tt(de,s)||de&&tt(de.buffer,s)||typeof l<"u"&&(tt(de,l)||de&&tt(de.buffer,l)))return T(de,z,Y);if(typeof de=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const me=de.valueOf&&de.valueOf();if(me!=null&&me!==de)return f.from(me,z,Y);const Ve=C(de);if(Ve)return Ve;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof de[Symbol.toPrimitive]=="function")return f.from(de[Symbol.toPrimitive]("string"),z,Y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof de)}f.from=function(de,z,Y){return p(de,z,Y)},Object.setPrototypeOf(f.prototype,o.prototype),Object.setPrototypeOf(f,o);function m(de){if(typeof de!="number")throw new TypeError('"size" argument must be of type number');if(de<0)throw new RangeError('The value "'+de+'" is invalid for option "size"')}function y(de,z,Y){return m(de),de<=0?d(de):z!==void 0?typeof Y=="string"?d(de).fill(z,Y):d(de).fill(z):d(de)}f.alloc=function(de,z,Y){return y(de,z,Y)};function b(de){return m(de),d(de<0?0:I(de)|0)}f.allocUnsafe=function(de){return b(de)},f.allocUnsafeSlow=function(de){return b(de)};function k(de,z){if((typeof z!="string"||z==="")&&(z="utf8"),!f.isEncoding(z))throw new TypeError("Unknown encoding: "+z);const Y=P(de,z)|0;let me=d(Y);const Ve=me.write(de,z);return Ve!==Y&&(me=me.slice(0,Ve)),me}function S(de){const z=de.length<0?0:I(de.length)|0,Y=d(z);for(let me=0;me<z;me+=1)Y[me]=de[me]&255;return Y}function x(de){if(tt(de,o)){const z=new o(de);return T(z.buffer,z.byteOffset,z.byteLength)}return S(de)}function T(de,z,Y){if(z<0||de.byteLength<z)throw new RangeError('"offset" is outside of buffer bounds');if(de.byteLength<z+(Y||0))throw new RangeError('"length" is outside of buffer bounds');let me;return z===void 0&&Y===void 0?me=new o(de):Y===void 0?me=new o(de,z):me=new o(de,z,Y),Object.setPrototypeOf(me,f.prototype),me}function C(de){if(f.isBuffer(de)){const z=I(de.length)|0,Y=d(z);return Y.length===0||de.copy(Y,0,0,z),Y}if(de.length!==void 0)return typeof de.length!="number"||De(de.length)?d(0):S(de);if(de.type==="Buffer"&&Array.isArray(de.data))return S(de.data)}function I(de){if(de>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return de|0}function D(de){return+de!=de&&(de=0),f.alloc(+de)}f.isBuffer=function(z){return z!=null&&z._isBuffer===!0&&z!==f.prototype},f.compare=function(z,Y){if(tt(z,o)&&(z=f.from(z,z.offset,z.byteLength)),tt(Y,o)&&(Y=f.from(Y,Y.offset,Y.byteLength)),!f.isBuffer(z)||!f.isBuffer(Y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(z===Y)return 0;let me=z.length,Ve=Y.length;for(let lt=0,gt=Math.min(me,Ve);lt<gt;++lt)if(z[lt]!==Y[lt]){me=z[lt],Ve=Y[lt];break}return me<Ve?-1:Ve<me?1:0},f.isEncoding=function(z){switch(String(z).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(z,Y){if(!Array.isArray(z))throw new TypeError('"list" argument must be an Array of Buffers');if(z.length===0)return f.alloc(0);let me;if(Y===void 0)for(Y=0,me=0;me<z.length;++me)Y+=z[me].length;const Ve=f.allocUnsafe(Y);let lt=0;for(me=0;me<z.length;++me){let gt=z[me];if(tt(gt,o))lt+gt.length>Ve.length?(f.isBuffer(gt)||(gt=f.from(gt)),gt.copy(Ve,lt)):o.prototype.set.call(Ve,gt,lt);else if(f.isBuffer(gt))gt.copy(Ve,lt);else throw new TypeError('"list" argument must be an Array of Buffers');lt+=gt.length}return Ve};function P(de,z){if(f.isBuffer(de))return de.length;if(s.isView(de)||tt(de,s))return de.byteLength;if(typeof de!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof de);const Y=de.length,me=arguments.length>2&&arguments[2]===!0;if(!me&&Y===0)return 0;let Ve=!1;for(;;)switch(z){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":return Ue(de).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y*2;case"hex":return Y>>>1;case"base64":return Fe(de).length;default:if(Ve)return me?-1:Ue(de).length;z=(""+z).toLowerCase(),Ve=!0}}f.byteLength=P;function V(de,z,Y){let me=!1;if((z===void 0||z<0)&&(z=0),z>this.length||((Y===void 0||Y>this.length)&&(Y=this.length),Y<=0)||(Y>>>=0,z>>>=0,Y<=z))return"";for(de||(de="utf8");;)switch(de){case"hex":return ge(this,z,Y);case"utf8":case"utf-8":return q(this,z,Y);case"ascii":return ne(this,z,Y);case"latin1":case"binary":return J(this,z,Y);case"base64":return U(this,z,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return le(this,z,Y);default:if(me)throw new TypeError("Unknown encoding: "+de);de=(de+"").toLowerCase(),me=!0}}f.prototype._isBuffer=!0;function ee(de,z,Y){const me=de[z];de[z]=de[Y],de[Y]=me}f.prototype.swap16=function(){const z=this.length;if(z%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Y=0;Y<z;Y+=2)ee(this,Y,Y+1);return this},f.prototype.swap32=function(){const z=this.length;if(z%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Y=0;Y<z;Y+=4)ee(this,Y,Y+3),ee(this,Y+1,Y+2);return this},f.prototype.swap64=function(){const z=this.length;if(z%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Y=0;Y<z;Y+=8)ee(this,Y,Y+7),ee(this,Y+1,Y+6),ee(this,Y+2,Y+5),ee(this,Y+3,Y+4);return this},f.prototype.toString=function(){const z=this.length;return z===0?"":arguments.length===0?q(this,0,z):V.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(z){if(!f.isBuffer(z))throw new TypeError("Argument must be a Buffer");return this===z?!0:f.compare(this,z)===0},f.prototype.inspect=function(){let z="";const Y=e.INSPECT_MAX_BYTES;return z=this.toString("hex",0,Y).replace(/(.{2})/g,"$1 ").trim(),this.length>Y&&(z+=" ... "),"<Buffer "+z+">"},r&&(f.prototype[r]=f.prototype.inspect),f.prototype.compare=function(z,Y,me,Ve,lt){if(tt(z,o)&&(z=f.from(z,z.offset,z.byteLength)),!f.isBuffer(z))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof z);if(Y===void 0&&(Y=0),me===void 0&&(me=z?z.length:0),Ve===void 0&&(Ve=0),lt===void 0&&(lt=this.length),Y<0||me>z.length||Ve<0||lt>this.length)throw new RangeError("out of range index");if(Ve>=lt&&Y>=me)return 0;if(Ve>=lt)return-1;if(Y>=me)return 1;if(Y>>>=0,me>>>=0,Ve>>>=0,lt>>>=0,this===z)return 0;let gt=lt-Ve,dn=me-Y;const Hn=Math.min(gt,dn),br=this.slice(Ve,lt),ur=z.slice(Y,me);for(let tr=0;tr<Hn;++tr)if(br[tr]!==ur[tr]){gt=br[tr],dn=ur[tr];break}return gt<dn?-1:dn<gt?1:0};function F(de,z,Y,me,Ve){if(de.length===0)return-1;if(typeof Y=="string"?(me=Y,Y=0):Y>2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),Y=+Y,De(Y)&&(Y=Ve?0:de.length-1),Y<0&&(Y=de.length+Y),Y>=de.length){if(Ve)return-1;Y=de.length-1}else if(Y<0)if(Ve)Y=0;else return-1;if(typeof z=="string"&&(z=f.from(z,me)),f.isBuffer(z))return z.length===0?-1:H(de,z,Y,me,Ve);if(typeof z=="number")return z=z&255,typeof o.prototype.indexOf=="function"?Ve?o.prototype.indexOf.call(de,z,Y):o.prototype.lastIndexOf.call(de,z,Y):H(de,[z],Y,me,Ve);throw new TypeError("val must be string, number or Buffer")}function H(de,z,Y,me,Ve){let lt=1,gt=de.length,dn=z.length;if(me!==void 0&&(me=String(me).toLowerCase(),me==="ucs2"||me==="ucs-2"||me==="utf16le"||me==="utf-16le")){if(de.length<2||z.length<2)return-1;lt=2,gt/=2,dn/=2,Y/=2}function Hn(ur,tr){return lt===1?ur[tr]:ur.readUInt16BE(tr*lt)}let br;if(Ve){let ur=-1;for(br=Y;br<gt;br++)if(Hn(de,br)===Hn(z,ur===-1?0:br-ur)){if(ur===-1&&(ur=br),br-ur+1===dn)return ur*lt}else ur!==-1&&(br-=br-ur),ur=-1}else for(Y+dn>gt&&(Y=gt-dn),br=Y;br>=0;br--){let ur=!0;for(let tr=0;tr<dn;tr++)if(Hn(de,br+tr)!==Hn(z,tr)){ur=!1;break}if(ur)return br}return-1}f.prototype.includes=function(z,Y,me){return this.indexOf(z,Y,me)!==-1},f.prototype.indexOf=function(z,Y,me){return F(this,z,Y,me,!0)},f.prototype.lastIndexOf=function(z,Y,me){return F(this,z,Y,me,!1)};function te(de,z,Y,me){Y=Number(Y)||0;const Ve=de.length-Y;me?(me=Number(me),me>Ve&&(me=Ve)):me=Ve;const lt=z.length;me>lt/2&&(me=lt/2);let gt;for(gt=0;gt<me;++gt){const dn=parseInt(z.substr(gt*2,2),16);if(De(dn))return gt;de[Y+gt]=dn}return gt}function M(de,z,Y,me){return Le(Ue(z,de.length-Y),de,Y,me)}function Z(de,z,Y,me){return Le(K(z),de,Y,me)}function L(de,z,Y,me){return Le(Fe(z),de,Y,me)}function W(de,z,Y,me){return Le(oe(z,de.length-Y),de,Y,me)}f.prototype.write=function(z,Y,me,Ve){if(Y===void 0)Ve="utf8",me=this.length,Y=0;else if(me===void 0&&typeof Y=="string")Ve=Y,me=this.length,Y=0;else if(isFinite(Y))Y=Y>>>0,isFinite(me)?(me=me>>>0,Ve===void 0&&(Ve="utf8")):(Ve=me,me=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const lt=this.length-Y;if((me===void 0||me>lt)&&(me=lt),z.length>0&&(me<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ve||(Ve="utf8");let gt=!1;for(;;)switch(Ve){case"hex":return te(this,z,Y,me);case"utf8":case"utf-8":return M(this,z,Y,me);case"ascii":case"latin1":case"binary":return Z(this,z,Y,me);case"base64":return L(this,z,Y,me);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,z,Y,me);default:if(gt)throw new TypeError("Unknown encoding: "+Ve);Ve=(""+Ve).toLowerCase(),gt=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function U(de,z,Y){return z===0&&Y===de.length?t.fromByteArray(de):t.fromByteArray(de.slice(z,Y))}function q(de,z,Y){Y=Math.min(de.length,Y);const me=[];let Ve=z;for(;Ve<Y;){const lt=de[Ve];let gt=null,dn=lt>239?4:lt>223?3:lt>191?2:1;if(Ve+dn<=Y){let Hn,br,ur,tr;switch(dn){case 1:lt<128&&(gt=lt);break;case 2:Hn=de[Ve+1],(Hn&192)===128&&(tr=(lt&31)<<6|Hn&63,tr>127&&(gt=tr));break;case 3:Hn=de[Ve+1],br=de[Ve+2],(Hn&192)===128&&(br&192)===128&&(tr=(lt&15)<<12|(Hn&63)<<6|br&63,tr>2047&&(tr<55296||tr>57343)&&(gt=tr));break;case 4:Hn=de[Ve+1],br=de[Ve+2],ur=de[Ve+3],(Hn&192)===128&&(br&192)===128&&(ur&192)===128&&(tr=(lt&15)<<18|(Hn&63)<<12|(br&63)<<6|ur&63,tr>65535&&tr<1114112&&(gt=tr))}}gt===null?(gt=65533,dn=1):gt>65535&&(gt-=65536,me.push(gt>>>10&1023|55296),gt=56320|gt&1023),me.push(gt),Ve+=dn}return re(me)}const Q=4096;function re(de){const z=de.length;if(z<=Q)return String.fromCharCode.apply(String,de);let Y="",me=0;for(;me<z;)Y+=String.fromCharCode.apply(String,de.slice(me,me+=Q));return Y}function ne(de,z,Y){let me="";Y=Math.min(de.length,Y);for(let Ve=z;Ve<Y;++Ve)me+=String.fromCharCode(de[Ve]&127);return me}function J(de,z,Y){let me="";Y=Math.min(de.length,Y);for(let Ve=z;Ve<Y;++Ve)me+=String.fromCharCode(de[Ve]);return me}function ge(de,z,Y){const me=de.length;(!z||z<0)&&(z=0),(!Y||Y<0||Y>me)&&(Y=me);let Ve="";for(let lt=z;lt<Y;++lt)Ve+=Pe[de[lt]];return Ve}function le(de,z,Y){const me=de.slice(z,Y);let Ve="";for(let lt=0;lt<me.length-1;lt+=2)Ve+=String.fromCharCode(me[lt]+me[lt+1]*256);return Ve}f.prototype.slice=function(z,Y){const me=this.length;z=~~z,Y=Y===void 0?me:~~Y,z<0?(z+=me,z<0&&(z=0)):z>me&&(z=me),Y<0?(Y+=me,Y<0&&(Y=0)):Y>me&&(Y=me),Y<z&&(Y=z);const Ve=this.subarray(z,Y);return Object.setPrototypeOf(Ve,f.prototype),Ve};function ve(de,z,Y){if(de%1!==0||de<0)throw new RangeError("offset is not uint");if(de+z>Y)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(z,Y,me){z=z>>>0,Y=Y>>>0,me||ve(z,Y,this.length);let Ve=this[z],lt=1,gt=0;for(;++gt<Y&&(lt*=256);)Ve+=this[z+gt]*lt;return Ve},f.prototype.readUintBE=f.prototype.readUIntBE=function(z,Y,me){z=z>>>0,Y=Y>>>0,me||ve(z,Y,this.length);let Ve=this[z+--Y],lt=1;for(;Y>0&&(lt*=256);)Ve+=this[z+--Y]*lt;return Ve},f.prototype.readUint8=f.prototype.readUInt8=function(z,Y){return z=z>>>0,Y||ve(z,1,this.length),this[z]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(z,Y){return z=z>>>0,Y||ve(z,2,this.length),this[z]|this[z+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(z,Y){return z=z>>>0,Y||ve(z,2,this.length),this[z]<<8|this[z+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(z,Y){return z=z>>>0,Y||ve(z,4,this.length),(this[z]|this[z+1]<<8|this[z+2]<<16)+this[z+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(z,Y){return z=z>>>0,Y||ve(z,4,this.length),this[z]*16777216+(this[z+1]<<16|this[z+2]<<8|this[z+3])},f.prototype.readBigUInt64LE=mt(function(z){z=z>>>0,ie(z,"offset");const Y=this[z],me=this[z+7];(Y===void 0||me===void 0)&&fe(z,this.length-8);const Ve=Y+this[++z]*2**8+this[++z]*2**16+this[++z]*2**24,lt=this[++z]+this[++z]*2**8+this[++z]*2**16+me*2**24;return BigInt(Ve)+(BigInt(lt)<<BigInt(32))}),f.prototype.readBigUInt64BE=mt(function(z){z=z>>>0,ie(z,"offset");const Y=this[z],me=this[z+7];(Y===void 0||me===void 0)&&fe(z,this.length-8);const Ve=Y*2**24+this[++z]*2**16+this[++z]*2**8+this[++z],lt=this[++z]*2**24+this[++z]*2**16+this[++z]*2**8+me;return(BigInt(Ve)<<BigInt(32))+BigInt(lt)}),f.prototype.readIntLE=function(z,Y,me){z=z>>>0,Y=Y>>>0,me||ve(z,Y,this.length);let Ve=this[z],lt=1,gt=0;for(;++gt<Y&&(lt*=256);)Ve+=this[z+gt]*lt;return lt*=128,Ve>=lt&&(Ve-=Math.pow(2,8*Y)),Ve},f.prototype.readIntBE=function(z,Y,me){z=z>>>0,Y=Y>>>0,me||ve(z,Y,this.length);let Ve=Y,lt=1,gt=this[z+--Ve];for(;Ve>0&&(lt*=256);)gt+=this[z+--Ve]*lt;return lt*=128,gt>=lt&&(gt-=Math.pow(2,8*Y)),gt},f.prototype.readInt8=function(z,Y){return z=z>>>0,Y||ve(z,1,this.length),this[z]&128?(255-this[z]+1)*-1:this[z]},f.prototype.readInt16LE=function(z,Y){z=z>>>0,Y||ve(z,2,this.length);const me=this[z]|this[z+1]<<8;return me&32768?me|4294901760:me},f.prototype.readInt16BE=function(z,Y){z=z>>>0,Y||ve(z,2,this.length);const me=this[z+1]|this[z]<<8;return me&32768?me|4294901760:me},f.prototype.readInt32LE=function(z,Y){return z=z>>>0,Y||ve(z,4,this.length),this[z]|this[z+1]<<8|this[z+2]<<16|this[z+3]<<24},f.prototype.readInt32BE=function(z,Y){return z=z>>>0,Y||ve(z,4,this.length),this[z]<<24|this[z+1]<<16|this[z+2]<<8|this[z+3]},f.prototype.readBigInt64LE=mt(function(z){z=z>>>0,ie(z,"offset");const Y=this[z],me=this[z+7];(Y===void 0||me===void 0)&&fe(z,this.length-8);const Ve=this[z+4]+this[z+5]*2**8+this[z+6]*2**16+(me<<24);return(BigInt(Ve)<<BigInt(32))+BigInt(Y+this[++z]*2**8+this[++z]*2**16+this[++z]*2**24)}),f.prototype.readBigInt64BE=mt(function(z){z=z>>>0,ie(z,"offset");const Y=this[z],me=this[z+7];(Y===void 0||me===void 0)&&fe(z,this.length-8);const Ve=(Y<<24)+this[++z]*2**16+this[++z]*2**8+this[++z];return(BigInt(Ve)<<BigInt(32))+BigInt(this[++z]*2**24+this[++z]*2**16+this[++z]*2**8+me)}),f.prototype.readFloatLE=function(z,Y){return z=z>>>0,Y||ve(z,4,this.length),n.read(this,z,!0,23,4)},f.prototype.readFloatBE=function(z,Y){return z=z>>>0,Y||ve(z,4,this.length),n.read(this,z,!1,23,4)},f.prototype.readDoubleLE=function(z,Y){return z=z>>>0,Y||ve(z,8,this.length),n.read(this,z,!0,52,8)},f.prototype.readDoubleBE=function(z,Y){return z=z>>>0,Y||ve(z,8,this.length),n.read(this,z,!1,52,8)};function Ee(de,z,Y,me,Ve,lt){if(!f.isBuffer(de))throw new TypeError('"buffer" argument must be a Buffer instance');if(z>Ve||z<lt)throw new RangeError('"value" argument is out of bounds');if(Y+me>de.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(z,Y,me,Ve){if(z=+z,Y=Y>>>0,me=me>>>0,!Ve){const dn=Math.pow(2,8*me)-1;Ee(this,z,Y,me,dn,0)}let lt=1,gt=0;for(this[Y]=z&255;++gt<me&&(lt*=256);)this[Y+gt]=z/lt&255;return Y+me},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(z,Y,me,Ve){if(z=+z,Y=Y>>>0,me=me>>>0,!Ve){const dn=Math.pow(2,8*me)-1;Ee(this,z,Y,me,dn,0)}let lt=me-1,gt=1;for(this[Y+lt]=z&255;--lt>=0&&(gt*=256);)this[Y+lt]=z/gt&255;return Y+me},f.prototype.writeUint8=f.prototype.writeUInt8=function(z,Y,me){return z=+z,Y=Y>>>0,me||Ee(this,z,Y,1,255,0),this[Y]=z&255,Y+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(z,Y,me){return z=+z,Y=Y>>>0,me||Ee(this,z,Y,2,65535,0),this[Y]=z&255,this[Y+1]=z>>>8,Y+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(z,Y,me){return z=+z,Y=Y>>>0,me||Ee(this,z,Y,2,65535,0),this[Y]=z>>>8,this[Y+1]=z&255,Y+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(z,Y,me){return z=+z,Y=Y>>>0,me||Ee(this,z,Y,4,4294967295,0),this[Y+3]=z>>>24,this[Y+2]=z>>>16,this[Y+1]=z>>>8,this[Y]=z&255,Y+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(z,Y,me){return z=+z,Y=Y>>>0,me||Ee(this,z,Y,4,4294967295,0),this[Y]=z>>>24,this[Y+1]=z>>>16,this[Y+2]=z>>>8,this[Y+3]=z&255,Y+4};function st(de,z,Y,me,Ve){be(z,me,Ve,de,Y,7);let lt=Number(z&BigInt(4294967295));de[Y++]=lt,lt=lt>>8,de[Y++]=lt,lt=lt>>8,de[Y++]=lt,lt=lt>>8,de[Y++]=lt;let gt=Number(z>>BigInt(32)&BigInt(4294967295));return de[Y++]=gt,gt=gt>>8,de[Y++]=gt,gt=gt>>8,de[Y++]=gt,gt=gt>>8,de[Y++]=gt,Y}function At(de,z,Y,me,Ve){be(z,me,Ve,de,Y,7);let lt=Number(z&BigInt(4294967295));de[Y+7]=lt,lt=lt>>8,de[Y+6]=lt,lt=lt>>8,de[Y+5]=lt,lt=lt>>8,de[Y+4]=lt;let gt=Number(z>>BigInt(32)&BigInt(4294967295));return de[Y+3]=gt,gt=gt>>8,de[Y+2]=gt,gt=gt>>8,de[Y+1]=gt,gt=gt>>8,de[Y]=gt,Y+8}f.prototype.writeBigUInt64LE=mt(function(z,Y=0){return st(this,z,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=mt(function(z,Y=0){return At(this,z,Y,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(z,Y,me,Ve){if(z=+z,Y=Y>>>0,!Ve){const Hn=Math.pow(2,8*me-1);Ee(this,z,Y,me,Hn-1,-Hn)}let lt=0,gt=1,dn=0;for(this[Y]=z&255;++lt<me&&(gt*=256);
vendor: 5,101 bytes, line 465
465)z<0&&dn===0&&this[Y+lt-1]!==0&&(dn=1),this[Y+lt]=(z/gt>>0)-dn&255;return Y+me},f.prototype.writeIntBE=function(z,Y,me,Ve){if(z=+z,Y=Y>>>0,!Ve){const Hn=Math.pow(2,8*me-1);Ee(this,z,Y,me,Hn-1,-Hn)}let lt=me-1,gt=1,dn=0;for(this[Y+lt]=z&255;--lt>=0&&(gt*=256);)z<0&&dn===0&&this[Y+lt+1]!==0&&(dn=1),this[Y+lt]=(z/gt>>0)-dn&255;return Y+me},f.prototype.writeInt8=function(z,Y,me){return z=+z,Y=Y>>>0,me||Ee(this,z,Y,1,127,-128),z<0&&(z=255+z+1),this[Y]=z&255,Y+1},f.prototype.writeInt16LE=function(z,Y,me){return z=+z,Y=Y>>>0,me||Ee(this,z,Y,2,32767,-32768),this[Y]=z&255,this[Y+1]=z>>>8,Y+2},f.prototype.writeInt16BE=function(z,Y,me){return z=+z,Y=Y>>>0,me||Ee(this,z,Y,2,32767,-32768),this[Y]=z>>>8,this[Y+1]=z&255,Y+2},f.prototype.writeInt32LE=function(z,Y,me){return z=+z,Y=Y>>>0,me||Ee(this,z,Y,4,2147483647,-2147483648),this[Y]=z&255,this[Y+1]=z>>>8,this[Y+2]=z>>>16,this[Y+3]=z>>>24,Y+4},f.prototype.writeInt32BE=function(z,Y,me){return z=+z,Y=Y>>>0,me||Ee(this,z,Y,4,2147483647,-2147483648),z<0&&(z=4294967295+z+1),this[Y]=z>>>24,this[Y+1]=z>>>16,this[Y+2]=z>>>8,this[Y+3]=z&255,Y+4},f.prototype.writeBigInt64LE=mt(function(z,Y=0){return st(this,z,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=mt(function(z,Y=0){return At(this,z,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function yt(de,z,Y,me,Ve,lt){if(Y+me>de.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function Ge(de,z,Y,me,Ve){return z=+z,Y=Y>>>0,Ve||yt(de,z,Y,4),n.write(de,z,Y,me,23,4),Y+4}f.prototype.writeFloatLE=function(z,Y,me){return Ge(this,z,Y,!0,me)},f.prototype.writeFloatBE=function(z,Y,me){return Ge(this,z,Y,!1,me)};function Be(de,z,Y,me,Ve){return z=+z,Y=Y>>>0,Ve||yt(de,z,Y,8),n.write(de,z,Y,me,52,8),Y+8}f.prototype.writeDoubleLE=function(z,Y,me){return Be(this,z,Y,!0,me)},f.prototype.writeDoubleBE=function(z,Y,me){return Be(this,z,Y,!1,me)},f.prototype.copy=function(z,Y,me,Ve){if(!f.isBuffer(z))throw new TypeError("argument should be a Buffer");if(me||(me=0),!Ve&&Ve!==0&&(Ve=this.length),Y>=z.length&&(Y=z.length),Y||(Y=0),Ve>0&&Ve<me&&(Ve=me),Ve===me||z.length===0||this.length===0)return 0;if(Y<0)throw new RangeError("targetStart out of bounds");if(me<0||me>=this.length)throw new RangeError("Index out of range");if(Ve<0)throw new RangeError("sourceEnd out of bounds");Ve>this.length&&(Ve=this.length),z.length-Y<Ve-me&&(Ve=z.length-Y+me);const lt=Ve-me;return this===z&&typeof o.prototype.copyWithin=="function"?this.copyWithin(Y,me,Ve):o.prototype.set.call(z,this.subarray(me,Ve),Y),lt},f.prototype.fill=function(z,Y,me,Ve){if(typeof z=="string"){if(typeof Y=="string"?(Ve=Y,Y=0,me=this.length):typeof me=="string"&&(Ve=me,me=this.length),Ve!==void 0&&typeof Ve!="string")throw new TypeError("encoding must be a string");if(typeof Ve=="string"&&!f.isEncoding(Ve))throw new TypeError("Unknown encoding: "+Ve);if(z.length===1){const gt=z.charCodeAt(0);(Ve==="utf8"&&gt<128||Ve==="latin1")&&(z=gt)}}else typeof z=="number"?z=z&255:typeof z=="boolean"&&(z=Number(z));if(Y<0||this.length<Y||this.length<me)throw new RangeError("Out of range index");if(me<=Y)return this;Y=Y>>>0,me=me===void 0?this.length:me>>>0,z||(z=0);let lt;if(typeof z=="number")for(lt=Y;lt<me;++lt)this[lt]=z;else{const gt=f.isBuffer(z)?z:f.from(z,Ve),dn=gt.length;if(dn===0)throw new TypeError('The value "'+z+'" is invalid for argument "value"');for(lt=0;lt<me-Y;++lt)this[lt+Y]=gt[lt%dn]}return this};const he={};function Oe(de,z,Y){he[de]=class extends Y{constructor(){super(),Object.defineProperty(this,"message",{value:z.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${de}]`,this.stack,delete this.name}get code(){return de}set code(Ve){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ve,writable:!0})}toString(){return`${this.name} [${de}]: ${this.message}`}}}Oe("ERR_BUFFER_OUT_OF_BOUNDS",function(de){return de?`${de} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Oe("ERR_INVALID_ARG_TYPE",function(de,z){return`The "${de}" argument must be of type number. Received type ${typeof z}`},TypeError),Oe("ERR_OUT_OF_RANGE",function(de,z,Y){let me=`The value of "${de}" is out of range.`,Ve=Y;return Number.isInteger(Y)&&Math.abs(Y)>2**32?Ve=ye(String(Y)):typeof Y=="bigint"&&(Ve=String(Y),(Y>BigInt(2)**BigInt(32)||Y<-(BigInt(2)**BigInt(32)))&&(Ve=ye(Ve)),Ve+="n"),me+=` It must be ${z}. Received ${Ve}`,me},RangeError);function ye(de){let z="",Y=de.length;const me=de[0]==="-"?1:0;for(;Y>=me+4;Y-=3)z=`_${de.slice(Y-3,Y)}${z}`;return`${de.slice(0,Y)}${z}`}function B(de,z,Y){ie(z,"offset"),(de[z]===void 0||de[z+Y]===void 0)&&fe(z,de.length-(Y+1))}function be(de,z,Y,me,Ve,lt){if(de>Y||de<z){const gt=typeof z=="bigint"?"n":"";let dn;throw lt>3&&(z===0||z===BigInt(0)?dn=`>= 0${gt} and < 2${gt} ** ${(lt+1)*8}${gt}`:dn=`>= -(2${gt} ** ${(lt+1)*8-1}${gt}) and < 2 ** ${(lt+1)*8-1}${gt}`),new he.ERR_OUT_OF_RANGE("value",dn,de)}B(me,Ve,lt)}function ie(de,z){if(typeof de!="number")throw new he.ERR_INVALID_ARG_TYPE(z,"
465number",de)}function fe(de,z,Y){throw Math.floor(de)!==de?(ie(de,Y),new he.ERR_OUT_OF_RANGE(Y||"offset","an integer",de)):z<0?new he.ERR_BUFFER_OUT_OF_BOUNDS:new he.ERR_OUT_OF_RANGE(Y||"offset",`>= ${Y?1:0} and <= ${z}`,de)}const ue=/[^+/0-9A-Za-z-_]/g;function Ce(de){if(de=de.split("=")[0],de=de.trim().replace(ue,""),de.length<2)return"";for(;de.length%4!==0;)de=de+"=";return de}function Ue(de,z){z=z||1/0;let Y;const me=de.length;let Ve=null;const lt=[];for(let gt=0;gt<me;++gt){if(Y=de.charCodeAt(gt),Y>55295&&Y<57344){if(!Ve){if(Y>56319){(z-=3)>-1&&lt.push(239,191,189);continue}else if(gt+1===me){(z-=3)>-1&&lt.push(239,191,189);continue}Ve=Y;continue}if(Y<56320){(z-=3)>-1&&lt.push(239,191,189),Ve=Y;continue}Y=(Ve-55296<<10|Y-56320)+65536}else Ve&&(z-=3)>-1&&lt.push(239,191,189);if(Ve=null,Y<128){if((z-=1)<0)break;lt.push(Y)}else if(Y<2048){if((z-=2)<0)break;lt.push(Y>>6|192,Y&63|128)}else if(Y<65536){if((z-=3)<0)break;lt.push(Y>>12|224,Y>>6&63|128,Y&63|128)}else if(Y<1114112){if((z-=4)<0)break;lt.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,Y&63|128)}else throw new Error("Invalid code point")}return lt}function K(de){const z=[];for(let Y=0;Y<de.length;++Y)z.push(de.charCodeAt(Y)&255);return z}function oe(de,z){let Y,me,Ve;const lt=[];for(let gt=0;gt<de.length&&!((z-=2)<0);++gt)Y=de.charCodeAt(gt),me=Y>>8,Ve=Y%256,lt.push(Ve),lt.push(me);return lt}function Fe(de){return t.toByteArray(Ce(de))}function Le(de,z,Y,me){let Ve;for(Ve=0;Ve<me&&!(Ve+Y>=z.length||Ve>=de.length);++Ve)z[Ve+Y]=de[Ve];return Ve}function tt(de,z){return de instanceof z||de!=null&&de.constructor!=null&&de.constructor.name!=null&&de.constructor.name===z.name}function De(de){return de!==de}const Pe=(function(){const de="0123456789abcdef",z=new Array(256);for(let Y=0;Y<16;++Y){const me=Y*16;for(let Ve=0;Ve<16;++Ve)z[me+Ve]=de[Y]+de[Ve]}return z})();function mt(de){return typeof BigInt>"u"?xt:de}function xt(){throw new Error("BigInt not supported")}})(Ds),Yl=Ds.Buffer,Ds.Blob,Ds.BlobOptions,Ds.Buffer,Ds.File,Ds.FileOptions,Ds.INSPECT_MAX_BYTES,Ds.SlowBuffer,Ds.TranscodeEncoding,Ds.atob,Ds.btoa,Ds.constants,Ds.isAscii,Ds.isUtf8,Ds.kMaxLength,Ds.kStringMaxLength,Ds.resolveObjectURL,Ds.transcode})),wl,N_=zA((()=>{wl=globalThis||self}));function FZ(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function T4(){throw new Error("setTimeout has not been defined")}function I4(){throw new Error("clearTimeout has not been defined")}function t9(e){if(kd===setTimeout)return setTimeout(e,0);if((kd===T4||!kd)&&setTimeout)return kd=setTimeout,setTimeout(e,0);try{return kd(e,0)}catch{try{return kd.call(null,e,0)}catch{return kd.call(this,e,0)}}}function zZ(e){if(_d===clearTimeout)return clearTimeout(e);if((_d===I4||!_d)&&clearTimeout)return _d=clearTimeout,clearTimeout(e);try{return _d(e)}catch{try{return _d.call(null,e)}catch{return _d.call(this,e)}}}function UZ(){!lg||!Km||(lg=!1,Km.length?Dd=Km.concat(Dd):Wb=-1,Dd.length&&n9())}function n9(){if(!lg){var e=t9(UZ);lg=!0;for(var t=Dd.length;t;){for(Km=Dd,Dd=[];++Wb<t;)Km&&Km[Wb].run();Wb=-1,t=Dd.length}Km=null,lg=!1,zZ(e)}}function o8(e,t){this.fun=e,this.array=t}function Of(){}var US,ds,kd,_d,Dd,lg,Km,Wb,s8,ci,r9=zA((()=>{US={exports:{}},ds=US.exports={},(function(){try{typeof setTimeout=="function"?kd=setTimeout:kd=T4}catch{kd=T4}try{typeof clearTimeout=="function"?_d=clearTimeout:_d=I4}catch{_d=I4}})(),Dd=[],lg=!1,Wb=-1,ds.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Dd.push(new o8(e,t)),Dd.length===1&&!lg&&t9(n9)},o8.prototype.run=function(){this.fun.apply(null,this.array)},ds.title="browser",ds.browser=!0,ds.env={},ds.argv=[],ds.version="",ds.versions={},ds.on=Of,ds.addListener=Of,ds.once=Of,ds.off=Of,ds.removeListener=Of,ds.removeAllListeners=Of,ds.emit=Of,ds.prependListener=Of,ds.prependOnceListener=Of,ds.listeners=function(e){return[]},ds.binding=function(e){throw new Error("process.binding is not supported")},ds.cwd=function(){return"/"},ds.chdir=function(e){throw new Error("process.chdir is not supported")},ds.umask=function(){return 0},s8=US.exports,ci=FZ(s8)})),VZ=RD(((e,t)=>{e9(),N_(),r9();/*!
466
467JSZip v3.10.1 - A JavaScript class for generating and reading zip files
468<http://stuartk.com/jszip>
469
vendor: 4,824 bytes, lines 470-475
470(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
471Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
472
473JSZip uses the library pako released under the MIT license :
474https://github.com/nodeca/pako/blob/main/LICENSE
475*/(function(n){typeof e=="object"&&typeof t<"u"?t.exports=n():typeof define=="function"&&define.amd?define([],n):(typeof window<"u"?window:typeof wl<"u"?wl:typeof self<"u"?self:this).JSZip=n()})(function(){return(function n(r,i,o){function s(d,f){if(!i[d]){if(!r[d]){var p=typeof Tw=="function"&&Tw;if(!f&&p)return p(d,!0);if(l)return l(d,!0);var m=new Error("Cannot find module '"+d+"'");throw m.code="MODULE_NOT_FOUND",m}var y=i[d]={exports:{}};r[d][0].call(y.exports,function(b){var k=r[d][1][b];return s(k||b)},y,y.exports,n,r,i,o)}return i[d].exports}for(var l=typeof Tw=="function"&&Tw,u=0;u<o.length;u++)s(o[u]);return s})({1:[function(n,r,i){var o=n("./utils"),s=n("./support"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(u){for(var d,f,p,m,y,b,k,S=[],x=0,T=u.length,C=T,I=o.getTypeOf(u)!=="string";x<u.length;)C=T-x,p=I?(d=u[x++],f=x<T?u[x++]:0,x<T?u[x++]:0):(d=u.charCodeAt(x++),f=x<T?u.charCodeAt(x++):0,x<T?u.charCodeAt(x++):0),m=d>>2,y=(3&d)<<4|f>>4,b=1<C?(15&f)<<2|p>>6:64,k=2<C?63&p:64,S.push(l.charAt(m)+l.charAt(y)+l.charAt(b)+l.charAt(k));return S.join("")},i.decode=function(u){var d,f,p,m,y,b,k=0,S=0,x="data:";if(u.substr(0,x.length)===x)throw new Error("Invalid base64 input, it looks like a data url.");var T,C=3*(u=u.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(u.charAt(u.length-1)===l.charAt(64)&&C--,u.charAt(u.length-2)===l.charAt(64)&&C--,C%1!=0)throw new Error("Invalid base64 input, bad content length.");for(T=s.uint8array?new Uint8Array(0|C):new Array(0|C);k<u.length;)d=l.indexOf(u.charAt(k++))<<2|(m=l.indexOf(u.charAt(k++)))>>4,f=(15&m)<<4|(y=l.indexOf(u.charAt(k++)))>>2,p=(3&y)<<6|(b=l.indexOf(u.charAt(k++))),T[S++]=d,y!==64&&(T[S++]=f),b!==64&&(T[S++]=p);return T}},{"./support":30,"./utils":32}],2:[function(n,r,i){var o=n("./external"),s=n("./stream/DataWorker"),l=n("./stream/Crc32Probe"),u=n("./stream/DataLengthProbe");function d(f,p,m,y,b){this.compressedSize=f,this.uncompressedSize=p,this.crc32=m,this.compression=y,this.compressedContent=b}d.prototype={getContentWorker:function(){var f=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),p=this;return f.on("end",function(){if(this.streamInfo.data_length!==p.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),f},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},d.createWorkerFrom=function(f,p,m){return f.pipe(new l).pipe(new u("uncompressedSize")).pipe(p.compressWorker(m)).pipe(new u("compressedSize")).withStreamInfo("compression",p)},r.exports=d},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var o=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var o=n("./utils"),s=(function(){for(var l,u=[],d=0;d<256;d++){l=d;for(var f=0;f<8;f++)l=1&l?3988292384^l>>>1:l>>>1;u[d]=l}return u})();r.exports=function(l,u){return l!==void 0&&l.length?o.getTypeOf(l)!=="string"?(function(d,f,p,m){var y=s,b=m+p;d^=-1;for(var k=m;k<b;k++)d=d>>>8^y[255&(d^f[k])];return-1^d})(0|u,l,l.length,0):(function(d,f,p,m){var y=s,b=m+p;d^=-1;for(var k=m;k<b;k++)d=d>>>8^y[255&(d^f.charCodeAt(k))];return-1^d})(0|u,l,l.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var o=null;o=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:o}},{lie:37}],7:[function(n,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),l=n("./utils"),u=n("./stream/GenericWorker"),d=o?"uint8array":"array";function f(p,m){u.call(this,"FlateWorker/"+p),this._pako=null,this._pakoAction=p,this._pakoOptions=m,this.meta={}}i.magic="\b\0",l.inherits(f,u),f.prototype.processChunk=function(p){this.meta=p.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(d,p.data),!1)},f.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)}
vendor: 5,548 bytes, lines 475-476
475,f.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var p=this;this._pako.onData=function(m){p.push({data:m,meta:p.meta})}},i.compressWorker=function(p){return new f("Deflate",p)},i.uncompressWorker=function(){return new f("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function o(y,b){var k,S="";for(k=0;k<b;k++)S+=String.fromCharCode(255&y),y>>>=8;return S}function s(y,b,k,S,x,T){var C,I,D=y.file,P=y.compression,V=T!==d.utf8encode,ee=l.transformTo("string",T(D.name)),F=l.transformTo("string",d.utf8encode(D.name)),H=D.comment,te=l.transformTo("string",T(H)),M=l.transformTo("string",d.utf8encode(H)),Z=F.length!==D.name.length,L=M.length!==H.length,W="",U="",q="",Q=D.dir,re=D.date,ne={crc32:0,compressedSize:0,uncompressedSize:0};b&&!k||(ne.crc32=y.crc32,ne.compressedSize=y.compressedSize,ne.uncompressedSize=y.uncompressedSize);var J=0;b&&(J|=8),V||!Z&&!L||(J|=2048);var ge=0,le=0;Q&&(ge|=16),x==="UNIX"?(le=798,ge|=(function(Ee,st){var At=Ee;return Ee||(At=st?16893:33204),(65535&At)<<16})(D.unixPermissions,Q)):(le=20,ge|=(function(Ee){return 63&(Ee||0)})(D.dosPermissions)),C=re.getUTCHours(),C<<=6,C|=re.getUTCMinutes(),C<<=5,C|=re.getUTCSeconds()/2,I=re.getUTCFullYear()-1980,I<<=4,I|=re.getUTCMonth()+1,I<<=5,I|=re.getUTCDate(),Z&&(U=o(1,1)+o(f(ee),4)+F,W+="up"+o(U.length,2)+U),L&&(q=o(1,1)+o(f(te),4)+M,W+="uc"+o(q.length,2)+q);var ve="";return ve+=`
476\0`,ve+=o(J,2),ve+=P.magic,ve+=o(C,2),ve+=o(I,2),ve+=o(ne.crc32,4),ve+=o(ne.compressedSize,4),ve+=o(ne.uncompressedSize,4),ve+=o(ee.length,2),ve+=o(W.length,2),{fileRecord:p.LOCAL_FILE_HEADER+ve+ee+W,dirRecord:p.CENTRAL_FILE_HEADER+o(le,2)+ve+o(te.length,2)+"\0\0\0\0"+o(ge,4)+o(S,4)+ee+W+te}}var l=n("../utils"),u=n("../stream/GenericWorker"),d=n("../utf8"),f=n("../crc32"),p=n("../signature");function m(y,b,k,S){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=b,this.zipPlatform=k,this.encodeFileName=S,this.streamFiles=y,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(m,u),m.prototype.push=function(y){var b=y.meta.percent||0,k=this.entriesCount,S=this._sources.length;this.accumulate?this.contentBuffer.push(y):(this.bytesWritten+=y.data.length,u.prototype.push.call(this,{data:y.data,meta:{currentFile:this.currentFile,percent:k?(b+100*(k-S-1))/k:100}}))},m.prototype.openedSource=function(y){this.currentSourceOffset=this.bytesWritten,this.currentFile=y.file.name;var b=this.streamFiles&&!y.file.dir;if(b){var k=s(y,b,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:k.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(y){this.accumulate=!1;var b=this.streamFiles&&!y.file.dir,k=s(y,b,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(k.dirRecord),b)this.push({data:(function(S){return p.DATA_DESCRIPTOR+o(S.crc32,4)+o(S.compressedSize,4)+o(S.uncompressedSize,4)})(y),meta:{percent:100}});else for(this.push({data:k.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var y=this.bytesWritten,b=0;b<this.dirRecords.length;b++)this.push({data:this.dirRecords[b],meta:{percent:100}});var k=this.bytesWritten-y,S=(function(x,T,C,I,D){var P=l.transformTo("string",D(I));return p.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(x,2)+o(x,2)+o(T,4)+o(C,4)+o(P.length,2)+P})(this.dirRecords.length,k,y,this.zipComment,this.encodeFileName);this.push({data:S,meta:{percent:100}})},m.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},m.prototype.registerPrevious=function(y){this._sources.push(y);var b=this;return y.on("data",function(k){b.processChunk(k)}),y.on("end",function(){b.closedSource(b.previous.streamInfo),b._sources.length?b.prepareNextSource():b.end()}),y.on("error",function(k){b.error(k)}),this},m.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},m.prototype.error=function(y){var b=this._sources;if(!u.prototype.error.call(this,y))return!1;for(var k=0;k<b.length;k++)try{b[k].error(y)}catch{}return!0},m.prototype.lock=function(){u.prototype.lock.call(this);for(var y=this._sources,b=0;b<y.length;b++)y[b].lock()},r.exports=m},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,i){var o=n("../compressions"),s=n("./ZipFileWorker");i.generateWorker=function(l,u,d){var f=new s(u.streamFiles,d,u.platform,u.encodeFileName),p=0;try{l.forEach(function(m,y){p++;var b=(function(T,C){var I=T||C,D=o[I];if(!D)throw new Error(I+" is not a valid compression method !");return D})(y.options.compression,u.compression),k=y.options.compressionOptions||u.compressionOptions||{},S=y.dir,x=y.date;y._compressWorker(b,k).withStreamInfo("file",{name:m,dir:S,date:x,comment:y.comment||"",unixPermissions:y.unixPermissions,dosPermissions:y.dosPermissions}).pipe(f)}),f.entriesCount=p}catch(m){f.error(m)}return f}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,i){function o(){if(!(this instanceof o))return new o;
vendor: 20,927 bytes, line 476
476if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new o;for(var l in this)typeof this[l]!="function"&&(s[l]=this[l]);return s}}(o.prototype=n("./object")).loadAsync=n("./load"),o.support=n("./support"),o.defaults=n("./defaults"),o.version="3.10.1",o.loadAsync=function(s,l){return new o().loadAsync(s,l)},o.external=n("./external"),r.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,i){var o=n("./utils"),s=n("./external"),l=n("./utf8"),u=n("./zipEntries"),d=n("./stream/Crc32Probe"),f=n("./nodejsUtils");function p(m){return new s.Promise(function(y,b){var k=m.decompressed.getContentWorker().pipe(new d);k.on("error",function(S){b(S)}).on("end",function(){k.streamInfo.crc32!==m.decompressed.crc32?b(new Error("Corrupted zip : CRC32 mismatch")):y()}).resume()})}r.exports=function(m,y){var b=this;return y=o.extend(y||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:l.utf8decode}),f.isNode&&f.isStream(m)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",m,!0,y.optimizedBinaryString,y.base64).then(function(k){var S=new u(y);return S.load(k),S}).then(function(k){var S=[s.Promise.resolve(k)],x=k.files;if(y.checkCRC32)for(var T=0;T<x.length;T++)S.push(p(x[T]));return s.Promise.all(S)}).then(function(k){for(var S=k.shift(),x=S.files,T=0;T<x.length;T++){var C=x[T],I=C.fileNameStr,D=o.resolve(C.fileNameStr);b.file(D,C.decompressed,{binary:!0,optimizedBinaryString:!0,date:C.date,dir:C.dir,comment:C.fileCommentStr.length?C.fileCommentStr:null,unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions,createFolders:y.createFolders}),C.dir||(b.file(D).unsafeOriginalName=I)}return S.zipComment.length&&(b.comment=S.zipComment),b})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,i){var o=n("../utils"),s=n("../stream/GenericWorker");function l(u,d){s.call(this,"Nodejs stream input adapter for "+u),this._upstreamEnded=!1,this._bindStream(d)}o.inherits(l,s),l.prototype._bindStream=function(u){var d=this;(this._stream=u).pause(),u.on("data",function(f){d.push({data:f,meta:{percent:0}})}).on("error",function(f){d.isPaused?this.generatedError=f:d.error(f)}).on("end",function(){d.isPaused?d._upstreamEnded=!0:d.end()})},l.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},l.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=l},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,i){var o=n("readable-stream").Readable;function s(l,u,d){o.call(this,u),this._helper=l;var f=this;l.on("data",function(p,m){f.push(p)||f._helper.pause(),d&&d(m)}).on("error",function(p){f.emit("error",p)}).on("end",function(){f.push(null)})}n("../utils").inherits(s,o),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(n,r,i){r.exports={isNode:typeof Yl<"u",newBufferFrom:function(o,s){if(Yl.from&&Yl.from!==Uint8Array.from)return Yl.from(o,s);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Yl(o,s)},allocBuffer:function(o){if(Yl.alloc)return Yl.alloc(o);var s=new Yl(o);return s.fill(0),s},isBuffer:function(o){return Yl.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(n,r,i){function o(I,D,P){var V,ee=l.getTypeOf(D),F=l.extend(P||{},f);F.date=F.date||new Date,F.compression!==null&&(F.compression=F.compression.toUpperCase()),typeof F.unixPermissions=="string"&&(F.unixPermissions=parseInt(F.unixPermissions,8)),F.unixPermissions&&16384&F.unixPermissions&&(F.dir=!0),F.dosPermissions&&16&F.dosPermissions&&(F.dir=!0),F.dir&&(I=x(I)),F.createFolders&&(V=S(I))&&T.call(this,V,!0);var H=ee==="string"&&F.binary===!1&&F.base64===!1;P&&P.binary!==void 0||(F.binary=!H),(D instanceof p&&D.uncompressedSize===0||F.dir||!D||D.length===0)&&(F.base64=!1,F.binary=!0,D="",F.compression="STORE",ee="string");var te=null;te=D instanceof p||D instanceof u?D:b.isNode&&b.isStream(D)?new k(I,D):l.prepareContent(I,D,F.binary,F.optimizedBinaryString,F.base64);var M=new m(I,te,F);this.files[I]=M}var s=n("./utf8"),l=n("./utils"),u=n("./stream/GenericWorker"),d=n("./stream/StreamHelper"),f=n("./defaults"),p=n("./compressedObject"),m=n("./zipObject"),y=n("./generate"),b=n("./nodejsUtils"),k=n("./nodejs/NodejsStreamInputAdapter"),S=function(I){I.slice(-1)==="/"&&(I=I.substring(0,I.length-1));var D=I.lastIndexOf("/");return 0<D?I.substring(0,D):""},x=function(I){return I.slice(-1)!=="/"&&(I+="/"),I},T=function(I,D){return D=D!==void 0?D:f.createFolders,I=x(I),this.files[I]||o.call(this,I,null,{dir:!0,createFolders:D}),this.files[I]};function C(I){return Object.prototype.toString.call(I)==="[object RegExp]"}r.exports={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(I){var D,P,V;for(D in this.files)V=this.files[D],(P=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&I(P,V)},filter:function(I){var D=[];return this.forEach(function(P,V){I(P,V)&&D.push(V)}),D},file:function(I,D,P){if(arguments.length!==1)return I=this.root+I,o.call(this,I,D,P),this;if(C(I)){var V=I;return this.filter(function(F,H){return!H.dir&&V.test(F)})}var ee=this.files[this.root+I];return ee&&!ee.dir?ee:null},folder:function(I){if(!I)return this;if(C(I))return this.filter(function(ee,F){return F.dir&&I.test(ee)});var D=this.root+I,P=T.call(this,D),V=this.clone();return V.root=P.name,V},remove:function(I){I=this.root+I;var D=this.files[I];if(D||(I.slice(-1)!=="/"&&(I+="/"),D=this.files[I]),D&&!D.dir)delete this.files[I];else for(var P=this.filter(function(ee,F){return F.name.slice(0,I.length)===I}),V=0;V<P.length;V++)delete this.files[P[V].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(I){var D,P={};try{if((P=l.extend(I||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=P.type.toLowerCase(),P.compression=P.compression.toUpperCase(),P.type==="binarystring"&&(P.type="string"),!P.type)throw new Error("No output type specified.");l.checkSupport(P.type),P.platform!=="darwin"&&P.platform!=="freebsd"&&P.platform!=="linux"&&P.platform!=="sunos"||(P.platform="UNIX"),P.platform==="win32"&&(P.platform="DOS");var V=P.comment||this.comment||"";D=y.generateWorker(this,P,V)}catch(ee){(D=new u("error")).error(ee)}return new d(D,P.type||"string",P.mimeType)},generateAsync:function(I,D){return this.generateInternalStream(I).accumulate(D)},generateNodeStream:function(I,D){return(I=I||{}).type||(I.type="nodebuffer"),this.generateInternalStream(I).toNodejsStream(D)}}},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,i){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,i){var o=n("./DataReader");function s(l){o.call(this,l);for(var u=0;u<this.data.length;u++)l[u]=255&l[u]}n("../utils").inherits(s,o),s.prototype.byteAt=function(l){return this.data[this.zero+l]},s.prototype.lastIndexOfSignature=function(l){for(var u=l.charCodeAt(0),d=l.charCodeAt(1),f=l.charCodeAt(2),p=l.charCodeAt(3),m=this.length-4;0<=m;--m)if(this.data[m]===u&&this.data[m+1]===d&&this.data[m+2]===f&&this.data[m+3]===p)return m-this.zero;return-1},s.prototype.readAndCheckSignature=function(l){var u=l.charCodeAt(0),d=l.charCodeAt(1),f=l.charCodeAt(2),p=l.charCodeAt(3),m=this.readData(4);return u===m[0]&&d===m[1]&&f===m[2]&&p===m[3]},s.prototype.readData=function(l){if(this.checkOffset(l),l===0)return[];var u=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,u},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(n,r,i){var o=n("../utils");function s(l){this.data=l,this.length=l.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(l){this.checkIndex(this.index+l)},checkIndex:function(l){if(this.length<this.zero+l||l<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+l+"). Corrupted zip ?")},setIndex:function(l){this.checkIndex(l),this.index=l},skip:function(l){this.setIndex(this.index+l)},byteAt:function(){},readInt:function(l){var u,d=0;for(this.checkOffset(l),u=this.index+l-1;u>=this.index;u--)d=(d<<8)+this.byteAt(u);return this.index+=l,d},readString:function(l){return o.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,i){var o=n("./Uint8ArrayReader");function s(l){o.call(this,l)}n("../utils").inherits(s,o),s.prototype.readData=function(l){this.checkOffset(l);var u=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,u},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var o=n("./DataReader");function s(l){o.call(this,l)}n("../utils").inherits(s,o),s.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},s.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},s.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},s.prototype.readData=function(l){this.checkOffset(l);var u=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,u},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var o=n("./ArrayReader");function s(l){o.call(this,l)}n("../utils").inherits(s,o),s.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,u},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var o=n("../utils"),s=n("../support"),l=n("./ArrayReader"),u=n("./StringReader"),d=n("./NodeBufferReader"),f=n("./Uint8ArrayReader");r.exports=function(p){var m=o.getTypeOf(p);return o.checkSupport(m),m!=="string"||s.uint8array?m==="nodebuffer"?new d(p):s.uint8array?new f(o.transformTo("uint8array",p)):new l(o.transformTo("array",p)):new u(p)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK��",i.CENTRAL_FILE_HEADER="PK��",i.CENTRAL_DIRECTORY_END="PK��",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK�\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK��",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var o=n("./GenericWorker"),s=n("../utils");function l(u){o.call(this,"ConvertWorker to "+u),this.destType=u}s.inherits(l,o),l.prototype.processChunk=function(u){this.push({data:s.transformTo(this.destType,u.data),meta:u.meta})},r.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var o=n("./GenericWorker"),s=n("../crc32");function l(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(l,o),l.prototype.processChunk=function(u){this.streamInfo.crc32=s(u.data,this.streamInfo.crc32||0),this.push(u)},r.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function l(u){s.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}o.inherits(l,s),l.prototype.processChunk=function(u){if(u){var d=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=d+u.data.length}s.prototype.processChunk.call(this,u)},r.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function l(u){s.call(this,"DataWorker");var d=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(f){d.dataIsReady=!0,d.data=f,d.max=f&&f.length||0,d.type=o.getTypeOf(f),d.isPaused||d._tickAndRepeat()},function(f){d.error(f)})}o.inherits(l,s),l.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var u=null,d=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,d);break;case"uint8array":u=this.data.subarray(this.index,d);break;case"array":case"nodebuffer":u=this.data.slice(this.index,d)}return this.index=d,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,l){return this._listeners[s].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,l){if(this._listeners[s])for(var u=0;u<this._listeners[s].length;u++)this._listeners[s][u].call(this,l)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var l=this;return s.on("data",function(u){l.processChunk(u)}),s.on("end",function(){l.end()}),s.on("error",function(u){l.error(u)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,l){return this.extraStreamInfo[s]=l,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},r.exports=o},{}],29:[function(n,r,i){var o=n("../utils"),s=n("./ConvertWorker"),l=n("./GenericWorker"),u=n("../base64"),d=n("../support"),f=n("../external"),p=null;if(d.nodestream)try{p=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(b,k){return new f.Promise(function(S,x){var T=[],C=b._internalType,I=b._outputType,D=b._mimeType;b.on("data",function(P,V){T.push(P),k&&k(V)}).on("error",function(P){T=[],x(P)}).on("end",function(){try{S((function(P,V,ee){switch(P){case"blob":return o.newBlob(o.transformTo("arraybuffer",V),ee);case"base64":return u.encode(V);default:return o.transformTo(P,V)}})(I,(function(P,V){var ee,F=0,H=null,te=0;for(ee=0;ee<V.length;ee++)te+=V[ee].length;switch(P){case"string":return V.join("");case"array":return Array.prototype.concat.apply([],V);case"uint8array":for(H=new Uint8Array(te),ee=0;ee<V.length;ee++)H.set(V[ee],F),F+=V[ee].length;return H;case"nodebuffer":return Yl.concat(V);default:throw new Error("concat : unsupported type '"+P+"'")}})(C,T),D))}catch(P){x(P)}T=[]}).resume()})}function y(b,k,S){var x=k;switch(k){case"blob":case"arraybuffer":x="uint8array";break;case"base64":x="string"}try{this._internalType=x,this._outputType=k,this._mimeType=S,o.checkSupport(x),this._worker=b.pipe(new s(x)),b.lock()}catch(T){this._worker=new l("error"),this._worker.error(T)}}y.prototype={accumulate:function(b){return m(this,b)},on:function(b,k){var S=this;return b==="data"?this._worker.on(b,function(x){k.call(S,x.data,x.meta)}):this._worker.on(b,function(){o.delay(k,arguments,S)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(b){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new p(this,{objectMode:this._outputType!=="nodebuffer"},b)}},r.exports=y},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Yl<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var o=n("./utils"),s=n("./support"),l=n("./nodejsUtils"),u=n("./stream/GenericWorker"),d=new Array(256),f=0;f<256;f++)d[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;d[254]=d[254]=1;function p(){u.call(this,"utf-8 decode"),this.leftOver=null}function m(){u.call(this,"utf-8 encode")}i.utf8encode=function(y){return s.nodebuffer?l.newBufferFrom(y,"utf-8"):(function(b){var k,S,x,T,C,I=b.length,D=0;for(T=0;T<I;T++)(64512&(S=b.charCodeAt(T)))==55296&&T+1<I&&(64512&(x=b.charCodeAt(T+1)))==56320&&(S=65536+(S-55296<<10)+(x-56320),T++),D+=S<128?1:S<2048?2:S<65536?3:4;for(k=s.uint8array?new Uint8Array(D):new Array(D),T=C=0;C<D;T++)(64512&(S=b.charCodeAt(T)))==55296&&T+1<I&&(64512&(x=b.charCodeAt(T+1)))==56320&&(S=65536+(S-55296<<10)+(x-56320),T++),S<128?k[C++]=S:(S<2048?k[C++]=192|S>>>6:(S<65536?k[C++]=224|S>>>12:(k[C++]=240|S>>>18,k[C++]=128|S>>>12&63),k[C++]=128|S>>>6&63),k[C++]=128|63&S);return k})(y)},i.utf8decode=function(y){return s.nodebuffer?o.transformTo("nodebuffer",y).toString("utf-8"):(function(b){var k,S,x,T,C=b.length,I=new Array(2*C);for(k=S=0;k<C;)if((x=b[k++])<128)I[S++]=x;else if(4<(T=d[x]))I[S++]=65533,k+=T-1;else{for(x&=T===2?31:T===3?15:7;1<T&&k<C;)x=x<<6|63&b[k++],T--;1<T?I[S++]=65533:x<65536?I[S++]=x:(x-=65536,I[S++]=55296|x>>10&1023,I[S++]=56320|1023&x)}return I.length!==S&&(I.subarray?I=I.subarray(0,S):I.length=S),o.applyFromCharCode(I)})(y=o.transformTo(s.uint8array?"uint8array":"array",y))},o.inherits(p,u),p.prototype.processChunk=function(y){var b=o.transformTo(s.uint8array?"uint8array":"array",y.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var k=b;(b=new Uint8Array(k.length+this.leftOver.length)).set(this.leftOver,0),b.set(k,this.leftOver.length)}else b=this.leftOver.concat(b);this.leftOver=null}var S=(function(T,C){var I;for((C=C||T.length)>T.length&&(C=T.length),I=C-1;0<=I&&(192&T[I])==128;)I--;return I<0||I===0?C:I+d[T[I]]>C?I:C})(b),x=b;S!==b.length&&(s.uint8array?(x=b.subarray(0,S),this.leftOver=b.subarray(S,b.length)):(x=b.slice(0,S),this.leftOver=b.slice(S,b.length))),this.push({data:i.utf8decode(x),meta:y.meta})},p.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=p,o.inherits(m,u),m.prototype.processChunk=function(y){this.push({data:i.utf8encode(y.data),meta:y.meta})},i.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var o=n("./support"),s=n("./base64"),l=n("./nodejsUtils"),u=n("./external");function d(k){return k}function f(k,S){for(var x=0;x<k.length;
vendor: 4,127 bytes, line 476
476++x)S[x]=255&k.charCodeAt(x);return S}n("setimmediate"),i.newBlob=function(k,S){i.checkSupport("blob");try{return new Blob([k],{type:S})}catch{try{var x=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return x.append(k),x.getBlob(S)}catch{throw new Error("Bug : can't construct the Blob.")}}};var p={stringifyByChunk:function(k,S,x){var T=[],C=0,I=k.length;if(I<=x)return String.fromCharCode.apply(null,k);for(;C<I;)S==="array"||S==="nodebuffer"?T.push(String.fromCharCode.apply(null,k.slice(C,Math.min(C+x,I)))):T.push(String.fromCharCode.apply(null,k.subarray(C,Math.min(C+x,I)))),C+=x;return T.join("")},stringifyByChar:function(k){for(var S="",x=0;x<k.length;x++)S+=String.fromCharCode(k[x]);return S},applyCanBeUsed:{uint8array:(function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,l.allocBuffer(1)).length===1}catch{return!1}})()}};function m(k){var S=65536,x=i.getTypeOf(k),T=!0;if(x==="uint8array"?T=p.applyCanBeUsed.uint8array:x==="nodebuffer"&&(T=p.applyCanBeUsed.nodebuffer),T)for(;1<S;)try{return p.stringifyByChunk(k,x,S)}catch{S=Math.floor(S/2)}return p.stringifyByChar(k)}function y(k,S){for(var x=0;x<k.length;x++)S[x]=k[x];return S}i.applyFromCharCode=m;var b={};b.string={string:d,array:function(k){return f(k,new Array(k.length))},arraybuffer:function(k){return b.string.uint8array(k).buffer},uint8array:function(k){return f(k,new Uint8Array(k.length))},nodebuffer:function(k){return f(k,l.allocBuffer(k.length))}},b.array={string:m,array:d,arraybuffer:function(k){return new Uint8Array(k).buffer},uint8array:function(k){return new Uint8Array(k)},nodebuffer:function(k){return l.newBufferFrom(k)}},b.arraybuffer={string:function(k){return m(new Uint8Array(k))},array:function(k){return y(new Uint8Array(k),new Array(k.byteLength))},arraybuffer:d,uint8array:function(k){return new Uint8Array(k)},nodebuffer:function(k){return l.newBufferFrom(new Uint8Array(k))}},b.uint8array={string:m,array:function(k){return y(k,new Array(k.length))},arraybuffer:function(k){return k.buffer},uint8array:d,nodebuffer:function(k){return l.newBufferFrom(k)}},b.nodebuffer={string:m,array:function(k){return y(k,new Array(k.length))},arraybuffer:function(k){return b.nodebuffer.uint8array(k).buffer},uint8array:function(k){return y(k,new Uint8Array(k.length))},nodebuffer:d},i.transformTo=function(k,S){return S=S||"",k?(i.checkSupport(k),b[i.getTypeOf(S)][k](S)):S},i.resolve=function(k){for(var S=k.split("/"),x=[],T=0;T<S.length;T++){var C=S[T];C==="."||C===""&&T!==0&&T!==S.length-1||(C===".."?x.pop():x.push(C))}return x.join("/")},i.getTypeOf=function(k){return typeof k=="string"?"string":Object.prototype.toString.call(k)==="[object Array]"?"array":o.nodebuffer&&l.isBuffer(k)?"nodebuffer":o.uint8array&&k instanceof Uint8Array?"uint8array":o.arraybuffer&&k instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(k){if(!o[k.toLowerCase()])throw new Error(k+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(k){var S,x,T="";for(x=0;x<(k||"").length;x++)T+="\\x"+((S=k.charCodeAt(x))<16?"0":"")+S.toString(16).toUpperCase();return T},i.delay=function(k,S,x){setImmediate(function(){k.apply(x||null,S||[])})},i.inherits=function(k,S){function x(){}x.prototype=S.prototype,k.prototype=new x},i.extend=function(){var k,S,x={};for(k=0;k<arguments.length;k++)for(S in arguments[k])Object.prototype.hasOwnProperty.call(arguments[k],S)&&x[S]===void 0&&(x[S]=arguments[k][S]);return x},i.prepareContent=function(k,S,x,T,C){return u.Promise.resolve(S).then(function(I){return o.blob&&(I instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(I))!==-1)&&typeof FileReader<"u"?new u.Promise(function(D,P){var V=new FileReader;V.onload=function(ee){D(ee.target.result)},V.onerror=function(ee){P(ee.target.error)},V.readAsArrayBuffer(I)}):I}).then(function(I){var D=i.getTypeOf(I);return D?(D==="arraybuffer"?I=i.transformTo("uint8array",I):D==="str
476ing"&&(C?I=s.decode(I):x&&T!==!0&&(I=(function(P){return f(P,o.uint8array?new Uint8Array(P.length):new Array(P.length))})(I))),I):u.Promise.reject(new Error("Can't read the data of '"+k+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,i){var o=n("./reader/readerFor"),s=n("./utils"),l=n("./signature"),u=n("./zipEntry"),d=n("./support");function f(p){this.files=[],this.loadOptions=p}f.prototype={checkSignature:function(p){if(!this.reader.readAndCheckSignature(p)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(m)+", expected "+s.pretty(p)+")")}},isSignature:function(p,m){var y=this.reader.index;this.reader.setIndex(p);var b=this.reader.readString(4)===m;return this.reader.setIndex(y),b},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var p=this.reader.readData(this.zipCommentLength),m=d.uint8array?"uint8array":"array",y=s.transformTo(m,p);this.zipComment=this.loadOptions.decodeFileName(y)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var p,m,y,b=this.zip64EndOfCentralSize-44;0<b;)p=this.reader.readInt(2),m=this.reader.readInt(4),y=this.reader.readData(m),this.zip64ExtensibleData[p]={id:p,length:m,value:y}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var p,m;for(p=0;p<this.files.length;p++)m=this.files[p],this.reader.setIndex(m.localHeaderOffset),this.checkSignature(l.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var p;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(l.CENTRAL_FILE_HEADER);)(p=new u({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(p);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var p=this.reader.lastIndexOfSignature(l.CENTRAL_DIRECTORY_END);if(p<0)throw this.isSignature(0,l.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(p);var m=p;if(this.checkSignature(l.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(p=this.reader.lastIndexOfSignature(l.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(p),this.checkSignature(l.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,l.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(l.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(l.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var y=this.centralDirOffset+this.centralDirSize;this.zip64&&(y+=20,y+=12+this.zip64EndOfCentralSize);var b=m-y;if(0<b)this.isSignature(m,l.CENTRAL_FILE_HEADER)||(this.reader.zero=b);else if(b<0)throw new Error("Corrupted zip: missing "+Math.abs(b)+" bytes.")},prepareReader:function(p){this.reader=o(p)},load:function(p){this.prepareReader(p),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=f},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,i){var o=n("./reader/readerFor"),s=n("./utils"),l=n("./compressedObject"),u=n("./crc32"),d=n("./utf8"),f=n("./compressions"),p=n("./support");function m(y,b){this.options=y,this.loadOptions=b}m.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(y){var b,k;if(y.skip(22),this.fileNameLength=y.readInt(2),k=y.readInt(2),this.fileName=y.readData(this.fileNameLength),y.skip(k),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((b=(function(S){for(var x in f)if(Object.prototype.hasOwnProperty.call(f,x)&&f[x].magic===S)return f[x];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new l(this.compressedSize,this.uncompressedSize,this.crc32,b,y.readData(this.compressedSize))},readCentralPart:function(y){this.versionMadeBy=y.readInt(2),y.skip(2),this.bitFlag=y.readInt(2),this.compressionMethod=y.readString(2),this.date=y.readDate(),this.crc32=y.readInt(4),this.compressedSize=y.readInt(4),this.uncompressedSize=y.readInt(4);var b=y.readInt(2);if(this.extraFieldsLength=y.readInt(2),this.fileCommentLength=y.readInt(2),this.diskNumberStart=y.readInt(2),this.internalFileAttributes=y.readInt(2),this.externalFileAttributes=y.readInt(4),this.localHeaderOffset=y.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");y.skip(b),this.readExtraFields(y),this.parseZIP64ExtraField(y),this.fileComment=y.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var y=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),y==0&&(this.dosPermissions=63&this.externalFileAttributes),y==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var y=o(this.extraFields[1].value);
vendor: 12,807 bytes, line 476
476this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=y.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=y.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=y.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=y.readInt(4))}},readExtraFields:function(y){var b,k,S,x=y.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});y.index+4<x;)b=y.readInt(2),k=y.readInt(2),S=y.readData(k),this.extraFields[b]={id:b,length:k,value:S};y.setIndex(x)},handleUTF8:function(){var y=p.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=d.utf8decode(this.fileName),this.fileCommentStr=d.utf8decode(this.fileComment);else{var b=this.findExtraFieldUnicodePath();if(b!==null)this.fileNameStr=b;else{var k=s.transformTo(y,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(k)}var S=this.findExtraFieldUnicodeComment();if(S!==null)this.fileCommentStr=S;else{var x=s.transformTo(y,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(x)}}},findExtraFieldUnicodePath:function(){var y=this.extraFields[28789];if(y){var b=o(y.value);return b.readInt(1)!==1||u(this.fileName)!==b.readInt(4)?null:d.utf8decode(b.readData(y.length-5))}return null},findExtraFieldUnicodeComment:function(){var y=this.extraFields[25461];if(y){var b=o(y.value);return b.readInt(1)!==1||u(this.fileComment)!==b.readInt(4)?null:d.utf8decode(b.readData(y.length-5))}return null}},r.exports=m},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,i){function o(b,k,S){this.name=b,this.dir=S.dir,this.date=S.date,this.comment=S.comment,this.unixPermissions=S.unixPermissions,this.dosPermissions=S.dosPermissions,this._data=k,this._dataBinary=S.binary,this.options={compression:S.compression,compressionOptions:S.compressionOptions}}var s=n("./stream/StreamHelper"),l=n("./stream/DataWorker"),u=n("./utf8"),d=n("./compressedObject"),f=n("./stream/GenericWorker");o.prototype={internalStream:function(b){var k=null,S="string";try{if(!b)throw new Error("No output type specified.");var x=(S=b.toLowerCase())==="string"||S==="text";S!=="binarystring"&&S!=="text"||(S="string"),k=this._decompressWorker();var T=!this._dataBinary;T&&!x&&(k=k.pipe(new u.Utf8EncodeWorker)),!T&&x&&(k=k.pipe(new u.Utf8DecodeWorker))}catch(C){(k=new f("error")).error(C)}return new s(k,S,"")},async:function(b,k){return this.internalStream(b).accumulate(k)},nodeStream:function(b,k){return this.internalStream(b||"nodebuffer").toNodejsStream(k)},_compressWorker:function(b,k){if(this._data instanceof d&&this._data.compression.magic===b.magic)return this._data.getCompressedWorker();var S=this._decompressWorker();return this._dataBinary||(S=S.pipe(new u.Utf8EncodeWorker)),d.createWorkerFrom(S,b,k)},_decompressWorker:function(){return this._data instanceof d?this._data.getContentWorker():this._data instanceof f?this._data:new l(this._data)}};for(var p=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],m=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},y=0;y<p.length;y++)o.prototype[p[y]]=m;r.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,i){(function(o){var s,l,u=o.MutationObserver||o.WebKitMutationObserver;if(u){var d=0,f=new u(b),p=o.document.createTextNode("");f.observe(p,{characterData:!0}),s=function(){p.data=d=++d%2}}else if(o.setImmediate||o.MessageChannel===void 0)s="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var k=o.document.createElement("script");k.onreadystatechange=function(){b(),k.onreadystatechange=null,k.parentNode.removeChild(k),k=null},o.document.documentElement.appendChild(k)}:function(){setTimeout(b,0)};else{var m=new o.MessageChannel;m.port1.onmessage=b,s=function(){m.port2.postMessage(0)}}var y=[];function b(){var k,S;l=!0;for(var x=y.length;x;){for(S=y,y=[],k=-1;++k<x;)S[k]();x=y.length}l=!1}r.exports=function(k){y.push(k)!==1||l||s()}}).call(this,typeof wl<"u"?wl:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,i){var o=n("immediate");function s(){}var l={},u=["REJECTED"],d=["FULFILLED"],f=["PENDING"];function p(x){if(typeof x!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,x!==s&&k(this,x)}function m(x,T,C){this.promise=x,typeof T=="function"&&(this.onFulfilled=T,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}function y(x,T,C){o(function(){var I;try{I=T(C)}catch(D){return l.reject(x,D)}I===x?l.reject(x,new TypeError("Cannot resolve promise with itself")):l.resolve(x,I)})}function b(x){var T=x&&x.then;if(x&&(typeof x=="object"||typeof x=="function")&&typeof T=="function")return function(){T.apply(x,arguments)}}function k(x,T){var C=!1;function I(V){C||(C=!0,l.reject(x,V))}function D(V){C||(C=!0,l.resolve(x,V))}var P=S(function(){T(D,I)});P.status==="error"&&I(P.value)}function S(x,T){var C={};try{C.value=x(T),C.status="success"}catch(I){C.status="error",C.value=I}return C}(r.exports=p).prototype.finally=function(x){if(typeof x!="function")return this;var T=this.constructor;return this.then(function(C){return T.resolve(x()).then(function(){return C})},function(C){return T.resolve(x()).then(function(){throw C})})},p.prototype.catch=function(x){return this.then(null,x)},p.prototype.then=function(x,T){if(typeof x!="function"&&this.state===d||typeof T!="function"&&this.state===u)return this;var C=new this.constructor(s);return this.state!==f?y(C,this.state===d?x:T,this.outcome):this.queue.push(new m(C,x,T)),C},m.prototype.callFulfilled=function(x){l.resolve(this.promise,x)},m.prototype.otherCallFulfilled=function(x){y(this.promise,this.onFulfilled,x)},m.prototype.callRejected=function(x){l.reject(this.promise,x)},m.prototype.otherCallRejected=function(x){y(this.promise,this.onRejected,x)},l.resolve=function(x,T){var C=S(b,T);if(C.status==="error")return l.reject(x,C.value);var I=C.value;if(I)k(x,I);else{x.state=d,x.outcome=T;for(var D=-1,P=x.queue.length;++D<P;)x.queue[D].callFulfilled(T)}return x},l.reject=function(x,T){x.state=u,x.outcome=T;for(var C=-1,I=x.queue.length;++C<I;)x.queue[C].callRejected(T);return x},p.resolve=function(x){return x instanceof this?x:l.resolve(new this(s),x)},p.reject=function(x){var T=new this(s);return l.reject(T,x)},p.all=function(x){var T=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=x.length,I=!1;if(!C)return this.resolve([]);for(var D=new Array(C),P=0,V=-1,ee=new this(s);++V<C;)F(x[V],V);return ee;function F(H,te){T.resolve(H).then(function(M){D[te]=M,++P!==C||I||(I=!0,l.resolve(ee,D))},function(M){I||(I=!0,l.reject(ee,M))})}},p.race=function(x){var T=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=x.length,I=!1;if(!C)return this.resolve([]);for(var D=-1,P=new this(s);++D<C;)V=x[D],T.resolve(V).then(function(ee){I||(I=!0,l.resolve(P,ee))},function(ee){I||(I=!0,l.reject(P,ee))});var V;return P}},{immediate:36}],38:[function(n,r,i){var o={};(0,n("./lib/utils/common").assign)(o,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,i){var o=n("./zlib/deflate"),s=n("./utils/common"),l=n("./utils/strings"),u=n("./zlib/messages"),d=n("./zlib/zstream"),f=Object.prototype.toString,p=0,m=-1,y=0,b=8;function k(x){if(!(this instanceof k))return new k(x);this.options=s.assign({level:m,method:b,chunkSize:16384,windowBits:15,memLevel:8,strategy:y,to:""},x||{});var T=this.options;T.raw&&0<T.windowBits?T.windowBits=-T.windowBits:T.gzip&&0<T.windowBits&&T.windowBits<16&&(T.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var C=o.deflateInit2(this.strm,T.level,T.method,T.windowBits,T.memLevel,T.strategy);if(C!==p)throw new Error(u[C]);if(T.header&&o.deflateSetHeader(this.strm,T.header),T.dictionary){var I;if(I=typeof T.dictionary=="string"?l.string2buf(T.dictionary):f.call(T.dictionary)==="[object ArrayBuffer]"?new Uint8Array(T.dictionary):T.dictionary,(C=o.deflateSetDictionary(this.strm,I))!==p)throw new Error(u[C]);this._dict_set=!0}}function S(x,T){var C=new k(T);if(C.push(x,!0),C.err)throw C.msg||u[C.err];return C.result}k.prototype.push=function(x,T){var C,I,D=this.strm,P=this.options.chunkSize;if(this.ended)return!1;I=T===~~T?T:T===!0?4:0,typeof x=="string"?D.input=l.string2buf(x):f.call(x)==="[object ArrayBuffer]"?D.input=new Uint8Array(x):D.input=x,D.next_in=0,D.avail_in=D.input.length;do{if(D.avail_out===0&&(D.output=new s.Buf8(P),D.next_out=0,D.avail_out=P),(C=o.deflate(D,I))!==1&&C!==p)return this.onEnd(C),!(this.ended=!0);D.avail_out!==0&&(D.avail_in!==0||I!==4&&I!==2)||(this.options.to==="string"?this.onData(l.buf2binstring(s.shrinkBuf(D.output,D.next_out))):this.onData(s.shrinkBuf(D.output,D.next_out)))}while((0<D.avail_in||D.avail_out===0)&&C!==1);return I===4?(C=o.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===p):I!==2||(this.onEnd(p),!(D.avail_out=0))},k.prototype.onData=function(x){this.chunks.push(x)},k.prototype.onEnd=function(x){x===p&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg},i.Deflate=k,i.deflate=S,i.deflateRaw=function(x,T){return(T=T||{}).raw=!0,S(x,T)},i.gzip=function(x,T){return(T=T||{}).gzip=!0,S(x,T)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,i){var o=n("./zlib/inflate"),s=n("./utils/common"),l=n("./utils/strings"),u=n("./zlib/constants"),d=n("./zlib/messages"),f=n("./zlib/zstream"),p=n("./zlib/gzheader"),m=Object.prototype.toString;function y(k){if(!(this instanceof y))return new y(k);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},k||{});var S=this.options;S.raw&&0<=S.windowBits&&S.windowBits<16&&(S.windowBits=-S.windowBits,S.windowBits===0&&(S.windowBits=-15)),!(0<=S.windowBits&&S.windowBits<16)||k&&k.windowBits||(S.windowBits+=32),15<S.windowBits&&S.windowBits<48&&(15&S.windowBits)==0&&(S.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var x=o.inflateInit2(this.strm,S.windowBits);if(x!==u.Z_OK)throw new Error(d[x]);this.header=new p,o.inflateGetHeader(this.strm,this.header)}function b(k,S){var x=new y(S);if(x.push(k,!0),x.err)throw x.msg||d[x.err];return x.result}y.prototype.push=function(k,S){var x,T,C,I,D,P,V=this.strm,ee=this.options.chunkSize,F=this.options.dictionary,H=!1;if(this.ended)return!1;T=S===~~S?S:S===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof k=="string"?V.input=l.binstring2buf(k):m.call(k)==="[object ArrayBuffer]"?V.input=new Uint8Array(k):V.input=k,V.next_in=0,V.avail_in=V.input.length;do{if(V.avail_out===0&&(V.output=new s.Buf8(ee),V.next_out=0,V.avail_out=ee),(x=o.inflate(V,u.Z_NO_FLUSH))===u.Z_NEED_DICT&&F&&(P=typeof F=="string"?l.string2buf(F):m.call(F)==="[object ArrayBuffer]"?new Uint8Array(F):F,x=o.inflateSetDictionary(this.strm,P)),x===u.Z_BUF_ERROR&&H===!0&&(x=u.Z_OK,H=!1),x!==u.Z_STREAM_END&&x!==u.Z_OK)return this.onEnd(x),!(this.ended=!0);V.next_out&&(V.avail_out!==0&&x!==u.Z_STREAM_END&&(V.avail_in!==0||T!==u.Z_FINISH&&T!==u.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=l.utf8border(V.output,V.next_out),I=V.next_out-C,D=l.buf2string(V.output,C),V.next_out=I,V.avail_out=ee-I,I&&s.arraySet(V.output,V.output,C,I,0),this.onData(D)):this.onData(s.shrinkBuf(V.output,V.next_out)))),V.avail_in===0&&V.avail_out===0&&(H=!0)}while((0<V.avail_in||V.avail_out===0)&&x!==u.Z_STREAM_END);return x===u.Z_STREAM_END&&(T=u.Z_FINISH),T===u.Z_FINISH?(x=o.inflateEnd(this.strm),this.onEnd(x),this.ended=!0,x===u.Z_OK):T!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),!(V.avail_out=0))},y.prototype.onData=function(k){this.chunks.push(k)},y.prototype.onEnd=function(k){k===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=k,this.msg=this.strm.msg},i.Inflate=y,i.inflate=b,i.inflateRaw=function(k,S){return(S=S||{}).raw=!0,b(k,S)},i.ungzip=b},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(u){for(var d=Array.prototype.slice.call(arguments,1
vendor: 4,809 bytes, line 476
476);d.length;){var f=d.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var p in f)f.hasOwnProperty(p)&&(u[p]=f[p])}}return u},i.shrinkBuf=function(u,d){return u.length===d?u:u.subarray?u.subarray(0,d):(u.length=d,u)};var s={arraySet:function(u,d,f,p,m){if(d.subarray&&u.subarray)u.set(d.subarray(f,f+p),m);else for(var y=0;y<p;y++)u[m+y]=d[f+y]},flattenChunks:function(u){var d,f,p,m,y,b;for(d=p=0,f=u.length;d<f;d++)p+=u[d].length;for(b=new Uint8Array(p),d=m=0,f=u.length;d<f;d++)y=u[d],b.set(y,m),m+=y.length;return b}},l={arraySet:function(u,d,f,p,m){for(var y=0;y<p;y++)u[m+y]=d[f+y]},flattenChunks:function(u){return[].concat.apply([],u)}};i.setTyped=function(u){u?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,s)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,l))},i.setTyped(o)},{}],42:[function(n,r,i){var o=n("./common"),s=!0,l=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{l=!1}for(var u=new o.Buf8(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;function f(p,m){if(m<65537&&(p.subarray&&l||!p.subarray&&s))return String.fromCharCode.apply(null,o.shrinkBuf(p,m));for(var y="",b=0;b<m;b++)y+=String.fromCharCode(p[b]);return y}u[254]=u[254]=1,i.string2buf=function(p){var m,y,b,k,S,x=p.length,T=0;for(k=0;k<x;k++)(64512&(y=p.charCodeAt(k)))==55296&&k+1<x&&(64512&(b=p.charCodeAt(k+1)))==56320&&(y=65536+(y-55296<<10)+(b-56320),k++),T+=y<128?1:y<2048?2:y<65536?3:4;for(m=new o.Buf8(T),k=S=0;S<T;k++)(64512&(y=p.charCodeAt(k)))==55296&&k+1<x&&(64512&(b=p.charCodeAt(k+1)))==56320&&(y=65536+(y-55296<<10)+(b-56320),k++),y<128?m[S++]=y:(y<2048?m[S++]=192|y>>>6:(y<65536?m[S++]=224|y>>>12:(m[S++]=240|y>>>18,m[S++]=128|y>>>12&63),m[S++]=128|y>>>6&63),m[S++]=128|63&y);return m},i.buf2binstring=function(p){return f(p,p.length)},i.binstring2buf=function(p){for(var m=new o.Buf8(p.length),y=0,b=m.length;y<b;y++)m[y]=p.charCodeAt(y);return m},i.buf2string=function(p,m){var y,b,k,S,x=m||p.length,T=new Array(2*x);for(y=b=0;y<x;)if((k=p[y++])<128)T[b++]=k;else if(4<(S=u[k]))T[b++]=65533,y+=S-1;else{for(k&=S===2?31:S===3?15:7;1<S&&y<x;)k=k<<6|63&p[y++],S--;1<S?T[b++]=65533:k<65536?T[b++]=k:(k-=65536,T[b++]=55296|k>>10&1023,T[b++]=56320|1023&k)}return f(T,b)},i.utf8border=function(p,m){var y;for((m=m||p.length)>p.length&&(m=p.length),y=m-1;0<=y&&(192&p[y])==128;)y--;return y<0||y===0?m:y+u[p[y]]>m?y:m}},{"./common":41}],43:[function(n,r,i){r.exports=function(o,s,l,u){for(var d=65535&o|0,f=o>>>16&65535|0,p=0;l!==0;){for(l-=p=2e3<l?2e3:l;f=f+(d=d+s[u++]|0)|0,--p;);d%=65521,f%=65521}return d|f<<16|0}},{}],44:[function(n,r,i){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,i){var o=(function(){for(var s,l=[],u=0;u<256;u++){s=u;for(var d=0;d<8;d++)s=1&s?3988292384^s>>>1:s>>>1;l[u]=s}return l})();r.exports=function(s,l,u,d){var f=o,p=d+u;s^=-1;for(var m=d;m<p;m++)s=s>>>8^f[255&(s^l[m])];return-1^s}},{}],46:[function(n,r,i){var o,s=n("../utils/common"),l=n("./trees"),u=n("./adler32"),d=n("./crc32"),f=n("./messages"),p=0,m=4,y=0,b=-2,k=-1,S=4,x=2,T=8,C=9,I=286,D=30,P=19,V=2*I+1,ee=15,F=3,H=258,te=H+F+1,M=42,Z=113,L=1,W=2,U=3,q=4;function Q(B,be){return B.msg=f[be],be}function re(B){return(B<<1)-(4<B?9:0)}function ne(B){for(var be=B.length;0<=--be;)B[be]=0}function J(B){var be=B.state,ie=be.pending;ie>B.avail_out&&(ie=B.avail_out),ie!==0&&(s.arraySet(B.output,be.pending_buf,be.pending_out,ie,B.next_out),B.next_out+=ie,be.pending_out+=ie,B.total_out+=ie,B.avail_out-=ie,be.pending-=ie,be.pending===0&&(be.pending_out=0))}function ge(B,be){l._tr_flush_block(B,0<=B.block_start?B.block_start:-1,B.strstart-B.block_start,be),B.block_start=B.strstart,J(B.strm)}function le(B,be){B.pending_buf[B.pending++]=be}function ve(B,be){B.pending_buf[B.pending++]=be>>>8&255,B.pending_buf[B.pending++]=255&be}function Ee(B,be){var ie,fe,ue=B.max_chain_length,Ce=B.strstart,Ue=B.prev_length,K=B.nice_match,oe=B.strstart>B.w_size-te?B.strstart-(B.w_size-te):0,Fe=B.window,Le=B.w_mask,tt=B.prev,De=B.strstart+H,Pe=Fe[Ce+Ue-1],mt=Fe[Ce+Ue];B.prev_length>=B.good_match&&(ue>>=2),K>B.lookahead&&(K=B.lookahead);do if(Fe[(ie=be)+Ue]===mt&&Fe[ie+Ue-1]===Pe&&Fe[ie]===Fe[Ce]&&Fe[++ie]===Fe[Ce+1]){Ce+=2,ie++;do;while(Fe[++Ce]===Fe[++ie]&&Fe[++Ce]===Fe[++ie]&&Fe[++Ce]===Fe[++ie]&&Fe[++Ce]===Fe[++ie]&&Fe[++Ce]===Fe[++ie]&&Fe[++Ce]===Fe[++ie]&&Fe[++Ce]===Fe[++ie]&&Fe[++Ce]===Fe[++ie]&&Ce<De);
vendor: 35,771 bytes, line 476
476if(fe=H-(De-Ce),Ce=De-H,Ue<fe){if(B.match_start=be,K<=(Ue=fe))break;Pe=Fe[Ce+Ue-1],mt=Fe[Ce+Ue]}}while((be=tt[be&Le])>oe&&--ue!=0);return Ue<=B.lookahead?Ue:B.lookahead}function st(B){var be,ie,fe,ue,Ce,Ue,K,oe,Fe,Le,tt=B.w_size;do{if(ue=B.window_size-B.lookahead-B.strstart,B.strstart>=tt+(tt-te)){for(s.arraySet(B.window,B.window,tt,tt,0),B.match_start-=tt,B.strstart-=tt,B.block_start-=tt,be=ie=B.hash_size;fe=B.head[--be],B.head[be]=tt<=fe?fe-tt:0,--ie;);for(be=ie=tt;fe=B.prev[--be],B.prev[be]=tt<=fe?fe-tt:0,--ie;);ue+=tt}if(B.strm.avail_in===0)break;if(Ue=B.strm,K=B.window,oe=B.strstart+B.lookahead,Fe=ue,Le=void 0,Le=Ue.avail_in,Fe<Le&&(Le=Fe),ie=Le===0?0:(Ue.avail_in-=Le,s.arraySet(K,Ue.input,Ue.next_in,Le,oe),Ue.state.wrap===1?Ue.adler=u(Ue.adler,K,Le,oe):Ue.state.wrap===2&&(Ue.adler=d(Ue.adler,K,Le,oe)),Ue.next_in+=Le,Ue.total_in+=Le,Le),B.lookahead+=ie,B.lookahead+B.insert>=F)for(Ce=B.strstart-B.insert,B.ins_h=B.window[Ce],B.ins_h=(B.ins_h<<B.hash_shift^B.window[Ce+1])&B.hash_mask;B.insert&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[Ce+F-1])&B.hash_mask,B.prev[Ce&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=Ce,Ce++,B.insert--,!(B.lookahead+B.insert<F)););}while(B.lookahead<te&&B.strm.avail_in!==0)}function At(B,be){for(var ie,fe;;){if(B.lookahead<te){if(st(B),B.lookahead<te&&be===p)return L;if(B.lookahead===0)break}if(ie=0,B.lookahead>=F&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+F-1])&B.hash_mask,ie=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart),ie!==0&&B.strstart-ie<=B.w_size-te&&(B.match_length=Ee(B,ie)),B.match_length>=F)if(fe=l._tr_tally(B,B.strstart-B.match_start,B.match_length-F),B.lookahead-=B.match_length,B.match_length<=B.max_lazy_match&&B.lookahead>=F){for(B.match_length--;B.strstart++,B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+F-1])&B.hash_mask,ie=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart,--B.match_length!=0;);B.strstart++}else B.strstart+=B.match_length,B.match_length=0,B.ins_h=B.window[B.strstart],B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+1])&B.hash_mask;else fe=l._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++;if(fe&&(ge(B,!1),B.strm.avail_out===0))return L}return B.insert=B.strstart<F-1?B.strstart:F-1,be===m?(ge(B,!0),B.strm.avail_out===0?U:q):B.last_lit&&(ge(B,!1),B.strm.avail_out===0)?L:W}function yt(B,be){for(var ie,fe,ue;;){if(B.lookahead<te){if(st(B),B.lookahead<te&&be===p)return L;if(B.lookahead===0)break}if(ie=0,B.lookahead>=F&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+F-1])&B.hash_mask,ie=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart),B.prev_length=B.match_length,B.prev_match=B.match_start,B.match_length=F-1,ie!==0&&B.prev_length<B.max_lazy_match&&B.strstart-ie<=B.w_size-te&&(B.match_length=Ee(B,ie),B.match_length<=5&&(B.strategy===1||B.match_length===F&&4096<B.strstart-B.match_start)&&(B.match_length=F-1)),B.prev_length>=F&&B.match_length<=B.prev_length){for(ue=B.strstart+B.lookahead-F,fe=l._tr_tally(B,B.strstart-1-B.prev_match,B.prev_length-F),B.lookahead-=B.prev_length-1,B.prev_length-=2;++B.strstart<=ue&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+F-1])&B.hash_mask,ie=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart),--B.prev_length!=0;);if(B.match_available=0,B.match_length=F-1,B.strstart++,fe&&(ge(B,!1),B.strm.avail_out===0))return L}else if(B.match_available){if((fe=l._tr_tally(B,0,B.window[B.strstart-1]))&&ge(B,!1),B.strstart++,B.lookahead--,B.strm.avail_out===0)return L}else B.match_available=1,B.strstart++,B.lookahead--}return B.match_available&&(fe=l._tr_tally(B,0,B.window[B.strstart-1]),B.match_available=0),B.insert=B.strstart<F-1?B.strstart:F-1,be===m?(ge(B,!0),B.strm.avail_out===0?U:q):B.last_lit&&(ge(B,!1),B.strm.avail_out===0)?L:W}function Ge(B,be,ie,fe,ue){this.good_length=B,this.max_lazy=be,this.nice_length=ie,this.max_chain=fe,this.func=ue}function Be(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=T,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*V),this.dyn_dtree=new s.Buf16(2*(2*D+1)),this.bl_tree=new s.Buf16(2*(2*P+1)),ne(this.dyn_ltree),ne(this.dyn_dtree),ne(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(ee+1),this.heap=new s.Buf16(2*I+1),ne(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*I+1),ne(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function he(B){var be;return B&&B.state?(B.total_in=B.total_out=0,B.data_type=x,(be=B.state).pending=0,be.pending_out=0,be.wrap<0&&(be.wrap=-be.wrap),be.status=be.wrap?M:Z,B.adler=be.wrap===2?0:1,be.last_flush=p,l._tr_init(be),y):Q(B,b)}function Oe(B){var be=he(B);return be===y&&(function(ie){ie.window_size=2*ie.w_size,ne(ie.head),ie.max_lazy_match=o[ie.level].max_lazy,ie.good_match=o[ie.level].good_length,ie.nice_match=o[ie.level].nice_length,ie.max_chain_length=o[ie.level].max_chain,ie.strstart=0,ie.block_start=0,ie.lookahead=0,ie.insert=0,ie.match_length=ie.prev_length=F-1,ie.match_available=0,ie.ins_h=0})(B.state),be}function ye(B,be,ie,fe,ue,Ce){if(!B)return b;var Ue=1;if(be===k&&(be=6),fe<0?(Ue=0,fe=-fe):15<fe&&(Ue=2,fe-=16),ue<1||C<ue||ie!==T||fe<8||15<fe||be<0||9<be||Ce<0||S<Ce)return Q(B,b);fe===8&&(fe=9);var K=new Be;return(B.state=K).strm=B,K.wrap=Ue,K.gzhead=null,K.w_bits=fe,K.w_size=1<<K.w_bits,K.w_mask=K.w_size-1,K.hash_bits=ue+7,K.hash_size=1<<K.hash_bits,K.hash_mask=K.hash_size-1,K.hash_shift=~~((K.hash_bits+F-1)/F),K.window=new s.Buf8(2*K.w_size),K.head=new s.Buf16(K.hash_size),K.prev=new s.Buf16(K.w_size),K.lit_bufsize=1<<ue+6,K.pending_buf_size=4*K.lit_bufsize,K.pending_buf=new s.Buf8(K.pending_buf_size),K.d_buf=1*K.lit_bufsize,K.l_buf=3*K.lit_bufsize,K.level=be,K.strategy=Ce,K.method=ie,Oe(B)}o=[new Ge(0,0,0,0,function(B,be){var ie=65535;for(ie>B.pending_buf_size-5&&(ie=B.pending_buf_size-5);;){if(B.lookahead<=1){if(st(B),B.lookahead===0&&be===p)return L;if(B.lookahead===0)break}B.strstart+=B.lookahead,B.lookahead=0;var fe=B.block_start+ie;if((B.strstart===0||B.strstart>=fe)&&(B.lookahead=B.strstart-fe,B.strstart=fe,ge(B,!1),B.strm.avail_out===0)||B.strstart-B.block_start>=B.w_size-te&&(ge(B,!1),B.strm.avail_out===0))return L}return B.insert=0,be===m?(ge(B,!0),B.strm.avail_out===0?U:q):(B.strstart>B.block_start&&(ge(B,!1),B.strm.avail_out),L)}),new Ge(4,4,8,4,At),new Ge(4,5,16,8,At),new Ge(4,6,32,32,At),new Ge(4,4,16,16,yt),new Ge(8,16,32,32,yt),new Ge(8,16,128,128,yt),new Ge(8,32,128,256,yt),new Ge(32,128,258,1024,yt),new Ge(32,258,258,4096,yt)],i.deflateInit=function(B,be){return ye(B,be,T,15,8,0)},i.deflateInit2=ye,i.deflateReset=Oe,i.deflateResetKeep=he,i.deflateSetHeader=function(B,be){return B&&B.state?B.state.wrap!==2?b:(B.state.gzhead=be,y):b},i.deflate=function(B,be){var ie,fe,ue,Ce;if(!B||!B.state||5<be||be<0)return B?Q(B,b):b;if(fe=B.state,!B.output||!B.input&&B.avail_in!==0||fe.status===666&&be!==m)return Q(B,B.avail_out===0?-5:b);if(fe.strm=B,ie=fe.last_flush,fe.last_flush=be,fe.status===M)if(fe.wrap===2)B.adler=0,le(fe,31),le(fe,139),le(fe,8),fe.gzhead?(le(fe,(fe.gzhead.text?1:0)+(fe.gzhead.hcrc?2:0)+(fe.gzhead.extra?4:0)+(fe.gzhead.name?8:0)+(fe.gzhead.comment?16:0)),le(fe,255&fe.gzhead.time),le(fe,fe.gzhead.time>>8&255),le(fe,fe.gzhead.time>>16&255),le(fe,fe.gzhead.time>>24&255),le(fe,fe.level===9?2:2<=fe.strategy||fe.level<2?4:0),le(fe,255&fe.gzhead.os),fe.gzhead.extra&&fe.gzhead.extra.length&&(le(fe,255&fe.gzhead.extra.length),le(fe,fe.gzhead.extra.length>>8&255)),fe.gzhead.hcrc&&(B.adler=d(B.adler,fe.pending_buf,fe.pending,0)),fe.gzindex=0,fe.status=69):(le(fe,0),le(fe,0),le(fe,0),le(fe,0),le(fe,0),le(fe,fe.level===9?2:2<=fe.strategy||fe.level<2?4:0),le(fe,3),fe.status=Z);else{var Ue=T+(fe.w_bits-8<<4)<<8;Ue|=(2<=fe.strategy||fe.level<2?0:fe.level<6?1:fe.level===6?2:3)<<6,fe.strstart!==0&&(Ue|=32),Ue+=31-Ue%31,fe.status=Z,ve(fe,Ue),fe.strstart!==0&&(ve(fe,B.adler>>>16),ve(fe,65535&B.adler)),B.adler=1}if(fe.status===69)if(fe.gzhead.extra){for(ue=fe.pending;fe.gzindex<(65535&fe.gzhead.extra.length)&&(fe.pending!==fe.pending_buf_size||(fe.gzhead.hcrc&&fe.pending>ue&&(B.adler=d(B.adler,fe.pending_buf,fe.pending-ue,ue)),J(B),ue=fe.pending,fe.pending!==fe.pending_buf_size));)le(fe,255&fe.gzhead.extra[fe.gzindex]),fe.gzindex++;fe.gzhead.hcrc&&fe.pending>ue&&(B.adler=d(B.adler,fe.pending_buf,fe.pending-ue,ue)),fe.gzindex===fe.gzhead.extra.length&&(fe.gzindex=0,fe.status=73)}else fe.status=73;if(fe.status===73)if(fe.gzhead.name){ue=fe.pending;do{if(fe.pending===fe.pending_buf_size&&(fe.gzhead.hcrc&&fe.pending>ue&&(B.adler=d(B.adler,fe.pending_buf,fe.pending-ue,ue)),J(B),ue=fe.pending,fe.pending===fe.pending_buf_size)){Ce=1;break}Ce=fe.gzindex<fe.gzhead.name.length?255&fe.gzhead.name.charCodeAt(fe.gzindex++):0,le(fe,Ce)}while(Ce!==0);fe.gzhead.hcrc&&fe.pending>ue&&(B.adler=d(B.adler,fe.pending_buf,fe.pending-ue,ue)),Ce===0&&(fe.gzindex=0,fe.status=91)}else fe.status=91;if(fe.status===91)if(fe.gzhead.comment){ue=fe.pending;do{if(fe.pending===fe.pending_buf_size&&(fe.gzhead.hcrc&&fe.pending>ue&&(B.adler=d(B.adler,fe.pending_buf,fe.pending-ue,ue)),J(B),ue=fe.pending,fe.pending===fe.pending_buf_size)){Ce=1;break}Ce=fe.gzindex<fe.gzhead.comment.length?255&fe.gzhead.comment.charCodeAt(fe.gzindex++):0,le(fe,Ce)}while(Ce!==0);fe.gzhead.hcrc&&fe.pending>ue&&(B.adler=d(B.adler,fe.pending_buf,fe.pending-ue,ue)),Ce===0&&(fe.status=103)}else fe.status=103;if(fe.status===103&&(fe.gzhead.hcrc?(fe.pending+2>fe.pending_buf_size&&J(B),fe.pending+2<=fe.pending_buf_size&&(le(fe,255&B.adler),le(fe,B.adler>>8&255),B.adler=0,fe.status=Z)):fe.status=Z),fe.pending!==0){if(J(B),B.avail_out===0)return fe.last_flush=-1,y}else if(B.avail_in===0&&re(be)<=re(ie)&&be!==m)return Q(B,-5);if(fe.status===666&&B.avail_in!==0)return Q(B,-5);if(B.avail_in!==0||fe.lookahead!==0||be!==p&&fe.status!==666){var K=fe.strategy===2?(function(oe,Fe){for(var Le;;){if(oe.lookahead===0&&(st(oe),oe.lookahead===0)){if(Fe===p)return L;break}if(oe.match_length=0,Le=l._tr_tally(oe,0,oe.window[oe.strstart]),oe.lookahead--,oe.strstart++,Le&&(ge(oe,!1),oe.strm.avail_out===0))return L}return oe.insert=0,Fe===m?(ge(oe,!0),oe.strm.avail_out===0?U:q):oe.last_lit&&(ge(oe,!1),oe.strm.avail_out===0)?L:W})(fe,be):fe.strategy===3?(function(oe,Fe){for(var Le,tt,De,Pe,mt=oe.window;;){if(oe.lookahead<=H){if(st(oe),oe.lookahead<=H&&Fe===p)return L;if(oe.lookahead===0)break}if(oe.match_length=0,oe.lookahead>=F&&0<oe.strstart&&(tt=mt[De=oe.strstart-1])===mt[++De]&&tt===mt[++De]&&tt===mt[++De]){Pe=oe.strstart+H;do;while(tt===mt[++De]&&tt===mt[++De]&&tt===mt[++De]&&tt===mt[++De]&&tt===mt[++De]&&tt===mt[++De]&&tt===mt[++De]&&tt===mt[++De]&&De<Pe);oe.match_length=H-(Pe-De),oe.match_length>oe.lookahead&&(oe.match_length=oe.lookahead)}if(oe.match_length>=F?(Le=l._tr_tally(oe,1,oe.match_length-F),oe.lookahead-=oe.match_length,oe.strstart+=oe.match_length,oe.match_length=0):(Le=l._tr_tally(oe,0,oe.window[oe.strstart]),oe.lookahead--,oe.strstart++),Le&&(ge(oe,!1),oe.strm.avail_out===0))return L}return oe.insert=0,Fe===m?(ge(oe,!0),oe.strm.avail_out===0?U:q):oe.last_lit&&(ge(oe,!1),oe.strm.avail_out===0)?L:W})(fe,be):o[fe.level].func(fe,be);if(K!==U&&K!==q||(fe.status=666),K===L||K===U)return B.avail_out===0&&(fe.last_flush=-1),y;if(K===W&&(be===1?l._tr_align(fe):be!==5&&(l._tr_stored_block(fe,0,0,!1),be===3&&(ne(fe.head),fe.lookahead===0&&(fe.strstart=0,fe.block_start=0,fe.insert=0))),J(B),B.avail_out===0))return fe.last_flush=-1,y}return be!==m?y:fe.wrap<=0?1:(fe.wrap===2?(le(fe,255&B.adler),le(fe,B.adler>>8&255),le(fe,B.adler>>16&255),le(fe,B.adler>>24&255),le(fe,255&B.total_in),le(fe,B.total_in>>8&255),le(fe,B.total_in>>16&255),le(fe,B.total_in>>24&255)):(ve(fe,B.adler>>>16),ve(fe,65535&B.adler)),J(B),0<fe.wrap&&(fe.wrap=-fe.wrap),fe.pending!==0?y:1)},i.deflateEnd=function(B){var be;return B&&B.state?(be=B.state.status)!==M&&be!==69&&be!==73&&be!==91&&be!==103&&be!==Z&&be!==666?Q(B,b):(B.state=null,be===Z?Q(B,-3):y):b},i.deflateSetDictionary=function(B,be){var ie,fe,ue,Ce,Ue,K,oe,Fe,Le=be.length;if(!B||!B.state||(Ce=(ie=B.state).wrap)===2||Ce===1&&ie.status!==M||ie.lookahead)return b;for(Ce===1&&(B.adler=u(B.adler,be,Le,0)),ie.wrap=0,Le>=ie.w_size&&(Ce===0&&(ne(ie.head),ie.strstart=0,ie.block_start=0,ie.insert=0),Fe=new s.Buf8(ie.w_size),s.arraySet(Fe,be,Le-ie.w_size,ie.w_size,0),be=Fe,Le=ie.w_size),Ue=B.avail_in,K=B.next_in,oe=B.input,B.avail_in=Le,B.next_in=0,B.input=be,st(ie);ie.lookahead>=F;){for(fe=ie.strstart,ue=ie.lookahead-(F-1);ie.ins_h=(ie.ins_h<<ie.hash_shift^ie.window[fe+F-1])&ie.hash_mask,ie.prev[fe&ie.w_mask]=ie.head[ie.ins_h],ie.head[ie.ins_h]=fe,fe++,--ue;);ie.strstart=fe,ie.lookahead=F-1,st(ie)}return ie.strstart+=ie.lookahead,ie.block_start=ie.strstart,ie.insert=ie.lookahead,ie.lookahead=0,ie.match_length=ie.prev_length=F-1,ie.match_available=0,B.next_in=K,B.input=oe,B.avail_in=Ue,ie.wrap=Ce,y},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,i){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,i){r.exports=function(o,s){var l=o.state,u=o.next_in,d,f,p,m,y,b,k,S,x,T,C,I,D,P,V,ee,F,H,te,M,Z,L=o.input,W;d=u+(o.avail_in-5),f=o.next_out,W=o.output,p=f-(s-o.avail_out),m=f+(o.avail_out-257),y=l.dmax,b=l.wsize,k=l.whave,S=l.wnext,x=l.window,T=l.hold,C=l.bits,I=l.lencode,D=l.distcode,P=(1<<l.lenbits)-1,V=(1<<l.distbits)-1;e:do{C<15&&(T+=L[u++]<<C,C+=8,T+=L[u++]<<C,C+=8),ee=I[T&P];t:for(;;){if(T>>>=F=ee>>>24,C-=F,(F=ee>>>16&255)===0)W[f++]=65535&ee;else{if(!(16&F)){if((64&F)==0){ee=I[(65535&ee)+(T&(1<<F)-1)];continue t}if(32&F){l.mode=12;break e}o.msg="invalid literal/length code",l.mode=30;break e}H=65535&ee,(F&=15)&&(C<F&&(T+=L[u++]<<C,C+=8),H+=T&(1<<F)-1,T>>>=F,C-=F),C<15&&(T+=L[u++]<<C,C+=8,T+=L[u++]<<C,C+=8),ee=D[T&V];n:for(;;){if(T>>>=F=ee>>>24,C-=F,!(16&(F=ee>>>16&255))){if((64&F)==0){ee=D[(65535&ee)+(T&(1<<F)-1)];continue n}o.msg="invalid distance code",l.mode=30;break e}if(te=65535&ee,C<(F&=15)&&(T+=L[u++]<<C,(C+=8)<F&&(T+=L[u++]<<C,C+=8)),y<(te+=T&(1<<F)-1)){o.msg="invalid distance too far back",l.mode=30;break e}if(T>>>=F,C-=F,(F=f-p)<te){if(k<(F=te-F)&&l.sane){o.msg="invalid distance too far back",l.mode=30;break e}if(Z=x,(M=0)===S){if(M+=b-F,F<H){for(H-=F;W[f++]=x[M++],--F;);M=f-te,Z=W}}else if(S<F){if(M+=b+S-F,(F-=S)<H){for(H-=F;W[f++]=x[M++],--F;);if(M=0,S<H){for(H-=F=S;W[f++]=x[M++],--F;);M=f-te,Z=W}}}else if(M+=S-F,F<H){for(H-=F;W[f++]=x[M++],--F;);M=f-te,Z=W}for(;2<H;)W[f++]=Z[M++],W[f++]=Z[M++],W[f++]=Z[M++],H-=3;H&&(W[f++]=Z[M++],1<H&&(W[f++]=Z[M++]))}else{for(M=f-te;W[f++]=W[M++],W[f++]=W[M++],W[f++]=W[M++],2<(H-=3););H&&(W[f++]=W[M++],1<H&&(W[f++]=W[M++]))}break}}break}}while(u<d&&f<m);u-=H=C>>3,T&=(1<<(C-=H<<3))-1,o.next_in=u,o.next_out=f,o.avail_in=u<d?d-u+5:5-(u-d),o.avail_out=f<m?m-f+257:257-(f-m),l.hold=T,l.bits=C}},{}],49:[function(n,r,i){var o=n("../utils/common"),s=n("./adler32"),l=n("./crc32"),u=n("./inffast"),d=n("./inftrees"),f=1,p=2,m=0,y=-2,b=1,k=852,S=592;function x(M){return(M>>>24&255)+(M>>>8&65280)+((65280&M)<<8)+((255&M)<<24)}function T(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function C(M){var Z;return M&&M.state?(Z=M.state,M.total_in=M.total_out=Z.total=0,M.msg="",Z.wrap&&(M.adler=1&Z.wrap),Z.mode=b,Z.last=0,Z.havedict=0,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new o.Buf32(k),Z.distcode=Z.distdyn=new o.Buf32(S),Z.sane=1,Z.back=-1,m):y}function I(M){var Z;return M&&M.state?((Z=M.state).wsize=0,Z.whave=0,Z.wnext=0,C(M)):y}function D(M,Z){var L,W;return M&&M.state?(W=M.state,Z<0?(L=0,Z=-Z):(L=1+(Z>>4),Z<48&&(Z&=15)),Z&&(Z<8||15<Z)?y:(W.window!==null&&W.wbits!==Z&&(W.window=null),W.wrap=L,W.wbits=Z,I(M))):y}function P(M,Z){var L,W;return M?(W=new T,(M.state=W).window=null,(L=D(M,Z))!==m&&(M.state=null),L):y}var V,ee,F=!0;function H(M){if(F){var Z;for(V=new o.Buf32(512),ee=new o.Buf32(32),Z=0;Z<144;)M.lens[Z++]=8;for(;Z<256;)M.lens[Z++]=9;for(;Z<280;)M.lens[Z++]=7;for(;Z<288;)M.lens[Z++]=8;for(d(f,M.lens,0,288,V,0,M.work,{bits:9}),Z=0;Z<32;)M.lens[Z++]=5;d(p,M.lens,0,32,ee,0,M.work,{bits:5}),F=!1}M.lencode=V,M.lenbits=9,M.distcode=ee,M.distbits=5}function te(M,Z,L,W){var U,q=M.state;return q.window===null&&(q.wsize=1<<q.wbits,q.wnext=0,q.whave=0,q.window=new o.Buf8(q.wsize)),W>=q.wsize?(o.arraySet(q.window,Z,L-q.wsize,q.wsize,0),q.wnext=0,q.whave=q.wsize):(W<(U=q.wsize-q.wnext)&&(U=W),o.arraySet(q.window,Z,L-W,U,q.wnext),(W-=U)?(o.arraySet(q.window,Z,L-W,W,0),q.wnext=W,q.whave=q.wsize):(q.wnext+=U,q.wnext===q.wsize&&(q.wnext=0),q.whave<q.wsize&&(q.whave+=U))),0}i.inflateReset=I,i.inflateReset2=D,i.inflateResetKeep=C,i.inflateInit=function(M){return P(M,15)},i.inflateInit2=P,i.inflate=function(M,Z){var L,W,U,q,Q,re,ne,J,ge,le,ve,Ee,st,At,yt,Ge,Be,he,Oe,ye,B,be,ie,fe,ue=0,Ce=new o.Buf8(4),Ue=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!M||!M.state||!M.output||!M.input&&M.avail_in!==0)return y;(L=M.state).mode===12&&(L.mode=13),Q=M.next_out,U=M.output,ne=M.avail_out,q=M.next_in,W=M.input,re=M.avail_in,J=L.hold,ge=L.bits,le=re,ve=ne,be=m;e:for(;;)switch(L.mode){case b:if(L.wrap===0){L.mode=13;break}for(;ge<16;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}if(2&L.wrap&&J===35615){Ce[L.check=0]=255&J,Ce[1]=J>>>8&255,L.check=l(L.check,Ce,2,0),ge=J=0,L.mode=2;break}if(L.flags=0,L.head&&(L.head.done=!1),!(1&L.wrap)||(((255&J)<<8)+(J>>8))%31){M.msg="incorrect header check",L.mode=30;break}if((15&J)!=8){M.msg="unknown compression method",L.mode=30;break}if(ge-=4,B=8+(15&(J>>>=4)),L.wbits===0)L.wbits=B;else if(B>L.wbits){M.msg="invalid window size",L.mode=30;break}L.dmax=1<<B,M.adler=L.check=1,L.mode=512&J?10:12,ge=J=0;break;case 2:for(;ge<16;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}if(L.flags=J,(255&L.flags)!=8){M.msg="unknown compression method",L.mode=30;break}if(57344&L.flags){M.msg="unknown header flags set",L.mode=30;break}L.head&&(L.head.text=J>>8&1),512&L.flags&&(Ce[0]=255&J,Ce[1]=J>>>8&255,L.check=l(L.check,Ce,2,0)),ge=J=0,L.mode=3;case 3:for(;ge<32;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}L.head&&(L.head.time=J),512&L.flags&&(Ce[0]=255&J,Ce[1]=J>>>8&255,Ce[2]=J>>>16&255,Ce[3]=J>>>24&255,L.check=l(L.check,Ce,4,0)),ge=J=0,L.mode=4;case 4:for(;ge<16;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}L.head&&(L.head.xflags=255&J,L.head.os=J>>8),512&L.flags&&(Ce[0]=255&J,Ce[1]=J>>>8&255,L.check=l(L.check,Ce,2,0)),ge=J=0,L.mode=5;case 5:if(1024&L.flags){for(;ge<16;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}L.length=J,L.head&&(L.head.extra_len=J),512&L.flags&&(Ce[0]=255&J,Ce[1]=J>>>8&255,L.check=l(L.check,Ce,2,0)),ge=J=0}else L.head&&(L.head.extra=null);L.mode=6;case 6:if(1024&L.flags&&(re<(Ee=L.length)&&(Ee=re),Ee&&(L.head&&(B=L.head.extra_len-L.length,L.head.extra||(L.head.extra=new Array(L.head.extra_len)),o.arraySet(L.head.extra,W,q,Ee,B)),512&L.flags&&(L.check=l(L.check,W,Ee,q)),re-=Ee,q+=Ee,L.length-=Ee),L.length))break e;L.length=0,L.mode=7;case 7:if(2048&L.flags){if(re===0)break e;for(Ee=0;B=W[q+Ee++],L.head&&B&&L.length<65536&&(L.head.name+=String.fromCharCode(B)),B&&Ee<re;);if(512&L.flags&&(L.check=l(L.check,W,Ee,q)),re-=Ee,q+=Ee,B)break e}else L.head&&(L.head.name=null);L.length=0,L.mode=8;case 8:if(4096&L.flags){if(re===0)break e;for(Ee=0;B=W[q+Ee++],L.head&&B&&L.length<65536&&(L.head.comment+=String.fromCharCode(B)),B&&Ee<re;);if(512&L.flags&&(L.check=l(L.check,W,Ee,q)),re-=Ee,q+=Ee,B)break e}else L.head&&(L.head.comment=null);L.mode=9;case 9:if(512&L.flags){for(;ge<16;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}if(J!==(65535&L.check)){M.msg="header crc mismatch",L.mode=30;break}ge=J=0}L.head&&(L.head.hcrc=L.flags>>9&1,L.head.done=!0),M.adler=L.check=0,L.mode=12;break;case 10:for(;ge<32;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}M.adler=L.check=x(J),ge=J=0,L.mode=11;case 11:if(L.havedict===0)return M.next_out=Q,M.avail_out=ne,M.next_in=q,M.avail_in=re,L.hold=J,L.bits=ge,2;M.adler=L.check=1,L.mode=12;case 12:if(Z===5||Z===6)break e;case 13:if(L.last){J>>>=7&ge,ge-=7&ge,L.mode=27;break}for(;ge<3;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}switch(L.last=1&J,ge-=1,3&(J>>>=1)){case 0:L.mode=14;break;case 1:if(H(L),L.mode=20,Z!==6)break;J>>>=2,ge-=2;break e;case 2:L.mode=17;break;case 3:M.msg="invalid block type",L.mode=30}J>>>=2,ge-=2;break;case 14:for(J>>>=7&ge,ge-=7&ge;ge<32;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}if((65535&J)!=(J>>>16^65535)){M.msg="invalid stored block lengths",L.mode=30;break}if(L.length=65535&J,ge=J=0,L.mode=15,Z===6)break e;case 15:L.mode=16;case 16:if(Ee=L.length){if(re<Ee&&(Ee=re),ne<Ee&&(Ee=ne),Ee===0)break e;o.arraySet(U,W,q,Ee,Q),re-=Ee,q+=Ee,ne-=Ee,Q+=Ee,L.length-=Ee;break}L.mode=12;break;case 17:for(;ge<14;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}if(L.nlen=257+(31&J),J>>>=5,ge-=5,L.ndist=1+(31&J),J>>>=5,ge-=5,L.ncode=4+(15&J),J>>>=4,ge-=4,286<L.nlen||30<L.ndist){M.msg="too many length or distance symbols",L.mode=30;break}L.have=0,L.mode=18;case 18:for(;L.have<L.ncode;){for(;ge<3;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}L.lens[Ue[L.have++]]=7&J,J>>>=3,ge-=3}for(;L.have<19;)L.lens[Ue[L.have++]]=0;if(L.lencode=L.lendyn,L.lenbits=7,ie={bits:L.lenbits},be=d(0,L.lens,0,19,L.lencode,0,L.work,ie),L.lenbits=ie.bits,be){M.msg="invalid code lengths set",L.mode=30;break}L.have=0,L.mode=19;case 19:for(;L.have<L.nlen+L.ndist;){for(;Ge=(ue=L.lencode[J&(1<<L.lenbits)-1])>>>16&255,Be=65535&ue,!((yt=ue>>>24)<=ge);){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}if(Be<16)J>>>=yt,ge-=yt,L.lens[L.have++]=Be;else{if(Be===16){for(fe=yt+2;ge<fe;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}if(J>>>=yt,ge-=yt,L.have===0){M.msg="invalid bit length repeat",L.mode=30;break}B=L.lens[L.have-1],Ee=3+(3&J),J>>>=2,ge-=2}else if(Be===17){for(fe=yt+3;ge<fe;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}ge-=yt,B=0,Ee=3+(7&(J>>>=yt)),J>>>=3,ge-=3}else{for(fe=yt+7;ge<fe;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}ge-=yt,B=0,Ee=11+(127&(J>>>=yt)),J>>>=7,ge-=7}if(L.have+Ee>L.nlen+L.ndist){M.msg="invalid bit length repeat",L.mode=30;break}for(;Ee--;)L.lens[L.have++]=B}}if(L.mode===30)break;if(L.lens[256]===0){M.msg="invalid code -- missing end-of-block",L.mode=30;break}if(L.lenbits=9,ie={bits:L.lenbits},be=d(f,L.lens,0,L.nlen,L.lencode,0,L.work,ie),L.lenbits=ie.bits,be){M.msg="invalid literal/lengths set",L.mode=30;break}if(L.distbits=6,L.distcode=L.distdyn,ie={bits:L.distbits},be=d(p,L.lens,L.nlen,L.ndist,L.distcode,0,L.work,ie),L.distbits=ie.bits,be){M.msg="invalid distances set",L.mode=30;break}if(L.mode=20,Z===6)break e;case 20:L.mode=21;case 21:if(6<=re&&258<=ne){M.next_out=Q,M.avail_out=ne,M.next_in=q,M.avail_in=re,L.hold=J,L.bits=ge,u(M,ve),Q=M.next_out,U=M.output,ne=M.avail_out,q=M.next_in,W=M.input,re=M.avail_in,J=L.hold,ge=L.bits,L.mode===12&&(L.back=-1);break}for(L.back=0;Ge=(ue=L.lencode[J&(1<<L.lenbits)-1])>>>16&255,Be=65535&ue,!((yt=ue>>>24)<=ge);){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}if(Ge&&(240&Ge)==0){for(he=yt,Oe=Ge,ye=Be;Ge=(ue=L.lencode[ye+((J&(1<<he+Oe)-1)>>he)])>>>16&255,Be=65535&ue,!(he+(yt=ue>>>24)<=ge);){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}J>>>=he,ge-=he,L.back+=he}if(J>>>=yt,ge-=yt,L.back+=yt,L.length=Be,Ge===0){L.mode=26;break}if(32&Ge){L.back=-1,L.mode=12;break}if(64&Ge){M.msg="invalid literal/length code",L.mode=30;break}L.extra=15&Ge,L.mode=22;case 22:if(L.extra){for(fe=L.extra;ge<fe;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}L.length+=J&(1<<L.extra)-1,J>>>=L.extra,ge-=L.extra,L.back+=L.extra}L.was=L.length,L.mode=23;case 23:for(;Ge=(ue=L.distcode[J&(1<<L.distbits)-1])>>>16&255,Be=65535&ue,!((yt=ue>>>24)<=ge);){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}if((240&Ge)==0){for(he=yt,Oe=Ge,ye=Be;Ge=(ue=L.distcode[ye+((J&(1<<he+Oe)-1)>>he)])>>>16&255,Be=65535&ue,!(he+(yt=ue>>>24)<=ge);){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}J>>>=he,ge-=he,L.back+=he}if(J>>>=yt,ge-=yt,L.back+=yt,64&Ge){M.msg="invalid distance code",L.mode=30;break}L.offset=Be,L.extra=15&Ge,L.mode=24;case 24:if(L.extra){for(fe=L.extra;ge<fe;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}L.offset+=J&(1<<L.extra)-1,J>>>=L.extra,ge-=L.extra,L.back+=L.extra}if(L.offset>L.dmax){M.msg="invalid distance too far back",L.mode=30;break}L.mode=25;case 25:if(ne===0)break e;if(Ee=ve-ne,L.offset>Ee){if((Ee=L.offset-Ee)>L.whave&&L.sane){M.msg="invalid distance too far back",L.mode=30;break}st=Ee>L.wnext?(Ee-=L.wnext,L.wsize-Ee):L.wnext-Ee,Ee>L.length&&(Ee=L.length),At=L.window}else At=U,st=Q-L.offset,Ee=L.length;for(ne<Ee&&(Ee=ne),ne-=Ee,L.length-=Ee;U[Q++]=At[st++],--Ee;);L.length===0&&(L.mode=21);break;case 26:if(ne===0)break e;U[Q++]=L.length,ne--,L.mode=21;break;case 27:if(L.wrap){for(;ge<32;){if(re===0)break e;re--,J|=W[q++]<<ge,ge+=8}if(ve-=ne,M.total_out+=ve,L.total+=ve,ve&&(M.adler=L.check=L.flags?l(L.check,U,ve,Q-ve):s(L.check,U,ve,Q-ve)),ve=ne,(L.flags?J:x(J))!==L.check){M.msg="incorrect data check",L.mode=30;break}ge=J=0}L.mode=28;case 28:if(L.wrap&&L.flags){for(;ge<32;){if(re===0)break e;re--,J+=W[q++]<<ge,ge+=8}if(J!==(4294967295&L.total)){M.msg="incorrect length check",L.mode=30;break}ge=J=0}L.mode=29;case 29:be=1;break e;case 30:be=-3;break e;case 31:return-4;case 32:default:return y}return M.next_out=Q,M.avail_out=ne,M.next_in=q,M.avail_in=re,L.hold=J,L.bits=ge,(L.wsize||ve!==M.avail_out&&L.mode<30&&(L.mode<27||Z!==4))&&te(M,M.output,M.next_out,ve-M.avail_out)?(L.mode=31,-4):(le-=M.avail_in,ve-=M.avail_out,M.total_in+=le,M.total_out+=ve,L.total+=ve,L.wrap&&ve&&(M.adler=L.check=L.flags?l(L.check,U,ve,M.next_out-ve):s(L.check,U,ve,M.next_out-ve)),M.data_type=L.bits+(L.last?64:0)+(L.mode===12?128:0)+(L.mode===20||L.mode===15?256:0),(le==0&&ve===0||Z===4)&&be===m&&(be=-5),be)},i.inflateEnd=function(M){if(!M||!M.state)return y;var Z=M.state;return Z.window&&(Z.window=null),M.state=null,m},i.inflateGetHeader=function(M,Z){var L;return M&&M.state?(2&(L=M.state).wrap)==0?y:((L.head=Z).done=!1,m):y},i.inflateSetDictionary=function(M,Z){var L,W=Z.length;return M&&M.state?(L=M.state).wrap!==0&&L.mode!==11?y:L.mode===11&&s(1,Z,W,0)!==L.check?-3:te(M,Z,W,W)?(L.mode=31,-4):(L.havedict=1,m):y},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,i){var o=n("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],u=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(f,p,m,y,b,k,S,x){var T,C,I,D,P,V,ee,F,H,te=x.bits,M=0,Z=0,L=0,W=0,U=0,q=0,Q=0,re=0,ne=0,J=0,ge=null,le=0,ve=new o.Buf16(16),Ee=new o.Buf16(16),st=null,At=0;for(M=0;M<=15;M++)ve[M]=0;for(Z=0;Z<y;Z++)ve[p[m+Z]]++;for(U=te,W=15;1<=W&&ve[W]===0;W--);if(W<U&&(U=W),W===0)return b[k++]=20971520,b[k++]=20971520,x.bits=1,0;for(L=1;L<W&&ve[L]===0;L++);for(U<L&&(U=L),M=re=1;M<=15;M++)if(re<<=1,(re-=ve[M])<0)return-1;if(0<re&&(f===0||W!==1))return-1;for(Ee[1]=0,M=1;M<15;M++)Ee[M+1]=Ee[M]+ve[M];for(Z=0;Z<y;Z++)p[m+Z]!==0&&(S[Ee[p[m+Z]]++]=Z);if(V=f===0?(ge=st=S,19):f===1?(ge=s,le-=257,st=l,At-=257,256):(ge=u,st=d,-1),M=L,P=k,Q=Z=J=0,I=-1,D=(ne=1<<(q=U))-1,f===1&&852<ne||f===2&&592<ne)return 1;for(;;){for(ee=M-Q,H=S[Z]<V?(F=0,S[Z]):S[Z]>V?(F=st[At+S[Z]],ge[le+S[Z]]):(F=96,0),T=1<<M-Q,L=C=1<<q;b[P+(J>>Q)+(C-=T)]=ee<<24|F<<16|H|0,C!==0;);for(T=1<<M-1;J&T;)T>>=1;if(T!==0?(J&=T-1,J+=T):J=0,Z++,--ve[M]==0){if(M===W)break;M=p[m+S[Z]]}if(U<M&&(J&D)!==I){for(Q===0&&(Q=U),P+=L,re=1<<(q=M-Q);q+Q<W&&!((re-=ve[q+Q])<=0);)q++,re<<=1;if(ne+=1<<q,f===1&&852<ne||f===2&&592<ne)return 1;b[I=J&D]=U<<24|q<<16|P-k|0}}return J!==0&&(b[P+J]=M-Q<<24|4194304),x.bits=U,0}},{"../utils/common":41}],51:[function(n,r,i){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,i){var o=n("../utils/common"),s=0,l=1;function u(ue){for(var Ce=ue.length;0<=--Ce;)ue[Ce]=0}var d=0,f=29,p=256,m=p+1+f,y=30,b=19,k=2*m+1,S=15,x=16,T=7,C=256,I=16,D=17,P=18,V=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ee=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],te=new Array(2*(m+2));u(te);var M=new Array(2*y);u(M);var Z=new Array(512);u(Z);var L=new Array(256);u(L);var W=new Array(f);u(W);var U,q,Q,re=new Array(y);function ne(ue,Ce,Ue,K,oe){this.static_tree=ue,this.extra_bits=Ce,this.extra_base=Ue,this.elems=K,this.max_length=oe,this.has_stree=ue&&ue.length}function J(ue,Ce){this.dyn_tree=ue,this.max_code=0,this.stat_desc=Ce}function ge(ue){return ue<256?Z[ue]:Z[256+(ue>>>7)]}function le(ue,Ce){ue.pending_buf[ue.pending++]=255&Ce,ue.pending_buf[ue.pending++]=Ce>>>8&255}function ve(ue,Ce,Ue){ue.bi_valid>x-Ue?(ue.bi_buf|=Ce<<ue.bi_valid&65535,le(ue,ue.bi_buf),ue.bi_buf=Ce>>x-ue.bi_valid,ue.bi_valid+=Ue-x):(ue.bi_buf|=Ce<<ue.bi_valid&65535,ue.bi_valid+=Ue)}function Ee(ue,Ce,Ue){ve(ue,Ue[2*Ce],Ue[2*Ce+1])}function st(ue,Ce){for(var Ue=0;Ue|=1&ue,ue>>>=1,Ue<<=1,0<--Ce;);return Ue>>>1}function At(ue,Ce,Ue){var K,oe,Fe=new Array(S+1),Le=0;for(K=1;K<=S;K++)Fe[K]=Le=Le+Ue[K-1]<<1;for(oe=0;oe<=Ce;oe++){var tt=ue[2*oe+1];tt!==0&&(ue[2*oe]=st(Fe[tt]++,tt))}}function yt(ue){var Ce;for(Ce=0;Ce<m;Ce++)ue.dyn_ltree[2*Ce]=0;for(Ce=0;Ce<y;Ce++)ue.dyn_dtree[2*Ce]=0;for(Ce=0;Ce<b;Ce++)ue.bl_tree[2*Ce]=0;ue.dyn_ltree[2*C]=1,ue.opt_len=ue.static_len=0,ue.last_lit=ue.matches=0}function Ge(ue){8<ue.bi_valid?le(ue,ue.bi_buf):0<ue.bi_valid&&(ue.pending_buf[ue.pending++]=ue.bi_buf),ue.bi_buf=0,ue.bi_valid=0}function Be(ue,Ce,Ue,K){var oe=2*Ce,Fe=2*Ue;return ue[oe]<ue[Fe]||ue[oe]===ue[Fe]&&K[Ce]<=K[Ue]}function he(ue,Ce,Ue){for(var K=ue.heap[Ue],oe=Ue<<1;oe<=ue.heap_len&&(oe<ue.heap_len&&Be(Ce,ue.heap[oe+1],ue.heap[oe],ue.depth)&&oe++,!Be(Ce,K,ue.heap[oe],ue.depth));)ue.heap[Ue]=ue.heap[oe],Ue=oe,oe<<=1;ue.heap[Ue]=K}function Oe(ue,Ce,Ue){var K,oe,Fe,Le,tt=0;if(ue.last_lit!==0)for(;K=ue.pending_buf[ue.d_buf+2*tt]<<8|ue.pending_buf[ue.d_buf+2*tt+1],oe=ue.pending_buf[ue.l_buf+tt],tt++,K===0?Ee(ue,oe,Ce):(Ee(ue,(Fe=L[oe])+p+1,Ce),(Le=V[Fe])!==0&&ve(ue,oe-=W[Fe],Le),Ee(ue,Fe=ge(--K),Ue),(Le=ee[Fe])!==0&&ve(ue,K-=re[Fe],Le)),tt<ue.last_lit;);Ee(ue,C,Ce)}function ye(ue,Ce){var Ue,K,oe,Fe=Ce.dyn_tree,Le=Ce.stat_desc.static_tree,tt=Ce.stat_desc.has_stree,De=Ce.stat_desc.elems,Pe=-1;for(ue.heap_len=0,ue.heap_max=k,Ue=0;Ue<De;Ue++)Fe[2*Ue]!==0?(ue.heap[++ue.heap_len]=Pe=Ue,ue.depth[Ue]=0):Fe[2*Ue+1]=0;for(;ue.heap_len<2;)Fe[2*(oe=ue.heap[++ue.heap_len]=Pe<2?++Pe:0)]=1,ue.depth[oe]=0,ue.opt_len--,tt&&(ue.static_len-=Le[2*oe+1]);for(Ce.max_code=Pe,Ue=ue.heap_len>>1;1<=Ue;Ue--)he(ue,Fe,Ue);for(oe=De;Ue=ue.heap[1],ue.heap[1]=ue.heap[ue.heap_len--],he(ue,Fe,1),K=ue.heap[1],ue.heap[--ue.heap_max]=Ue,ue.heap[--ue.heap_max]=K,Fe[2*oe]=Fe[2*Ue]+Fe[2*K],ue.depth[oe]=(ue.depth[Ue]>=ue.depth[K]?ue.depth[Ue]:ue.depth[K])+1,Fe[2*Ue+1]=Fe[2*K+1]=oe,ue.heap[1]=oe++,he(ue,Fe,1),2<=ue.heap_len;);ue.heap[--ue.heap_max]=ue.heap[1],(function(mt,xt){var de,z,Y,me,Ve,lt,gt=xt.dyn_tree,dn=xt.max_code,Hn=xt.stat_desc.static_tree,br=xt.stat_desc.has_stree,ur=xt.stat_desc.extra_bits,tr=xt.stat_desc.extra_base,Br=xt.stat_desc.max_length,Lr=0;for(me=0;me<=S;me++)mt.bl_count[me]=0;for(gt[2*mt.heap[mt.heap_max]+1]=0,de=mt.heap_max+1;de<k;de++)Br<(me=gt[2*gt[2*(z=mt.heap[de])+1]+1]+1)&&(me=Br,Lr++),gt[2*z+1]=me,dn<z||(mt.bl_count[me]++,Ve=0,tr<=z&&(Ve=ur[z-tr]),lt=gt[2*z],mt.opt_len+=lt*(me+Ve),br&&(mt.static_len+=lt*(Hn[2*z+1]+Ve)));if(Lr!==0){do{for(me=Br-1;mt.bl_count[me]===0;)me--;mt.bl_count[me]--,mt.bl_count[me+1]+=2,mt.bl_count[Br]--,Lr-=2}while(0<Lr);for(me=Br;me!==0;me--)for(z=mt.bl_count[me];z!==0;)dn<(Y=mt.heap[--de])||(gt[2*Y+1]!==me&&(mt.opt_len+=(me-gt[2*Y+1])*gt[2*Y],gt[2*Y+1]=me),z--)}})(ue,Ce),At(Fe,Pe,ue.bl_count)}function B(ue,Ce,Ue){var K,oe,Fe=-1,Le=Ce[1],tt=0,De=7,Pe=4;for(Le===0&&(De=138,Pe=3),Ce[2*(Ue+1)+1]=65535,K=0;K<=Ue;K++)oe=Le,Le=Ce[2*(K+1)+1],++tt<De&&oe===Le||(tt<Pe?ue.bl_tree[2*oe]+=tt:oe!==0?(oe!==Fe&&ue.bl_tree[2*oe]++,ue.bl_tree[2*I]++):tt<=10?ue.bl_tree[2*D]++:ue.bl_tree[2*P]++,Fe=oe,Pe=(tt=0)===Le?(De=138,3):oe===Le?(De=6,3):(De=7,4))}function be(ue,Ce,Ue){var K,oe,Fe=-1,Le=Ce[1],tt=0,De=7,Pe=4;for(Le===0&&(De=138,Pe=3),K=0;K<=Ue;K++)if(oe=Le,Le=Ce[2*(K+1)+1],!(++tt<De&&oe===Le)){if(tt<Pe)for(;Ee(ue,oe,ue.bl_tree),--tt!=0;);else oe!==0?(oe!==Fe&&(Ee(ue,oe,ue.bl_tree),tt--),Ee(ue,I,ue.bl_tree),ve(ue,tt-3,2)):tt<=10?(Ee(ue,D,ue.bl_tree),ve(ue,tt-3,3)):(Ee(ue,P,ue.bl_tree),ve(ue,tt-11,7));Fe=oe,Pe=(tt=0)===Le?(De=138,3):oe===Le?(De=6,3):(De=7,4)}}u(re);var ie=!1;function fe(ue,Ce,Ue,K){ve(ue,(d<<1)+(K?1:0),3),(function(oe,Fe,Le,tt){Ge(oe),le(oe,Le),le(oe,~Le),o.arraySet(oe.pending_buf,oe.window,Fe,Le,oe.pending),oe.pending+=Le})(ue,Ce,Ue)}i._tr_init=function(ue){ie||((function(){var Ce,Ue,K,oe,Fe,Le=new Array(S+1);for(oe=K=0;oe<f-1;oe++)for(W[oe]=K,Ce=0;Ce<1<<V[oe];Ce++)L[K++]=oe;for(L[K-1]=oe,oe=Fe=0;oe<16;oe++)for(re[oe]=Fe,Ce=0;Ce<1<<ee[oe];Ce++)Z[Fe++]=oe;for(Fe>>=7;oe<y;oe++)for(re[oe]=Fe<<7,Ce=0;Ce<1<<ee[oe]-7;Ce++)Z[256+Fe++]=oe;for(Ue=0;Ue<=S;Ue++)Le[Ue]=0;for(Ce=0;Ce<=143;)te[2*Ce+1]=8,Ce++,Le[8]++;for(;Ce<=255;)te[2*Ce+1]=9,Ce++,Le[9]++;for(;Ce<=279;)te[2*Ce+1]=7,Ce++,Le[7]++;for(;Ce<=287;)te[2*Ce+1]=8,Ce++,Le[8]++;for(At(te,m+1,Le),Ce=0;Ce<y;Ce++)M[2*Ce+1]=5,M[2*Ce]=st(Ce,5);U=new ne(te,V,p+1,m,S),q=new ne(M,ee,0,y,S),Q=new ne(new Array(0),F,0,b,T)})(),ie=!0),ue.l_desc=new J(ue.dyn_ltree,U),ue.d_desc=new J(ue.dyn_dtree,q),ue.bl_desc=new J(ue.bl_tree,Q),ue.bi_buf=0,ue.bi_valid=0,yt(ue)},i._tr_stored_block=fe,i._tr_flush_block=function(ue,Ce,Ue,K){var oe,Fe,Le=0;0<ue.level?(ue.strm.data_type===2&&(ue.strm.data_type=(function(tt){var De,Pe=4093624447;for(De=0;De<=31;De++,Pe>>>=1)if(1&Pe&&tt.dyn_ltree[2*De]!==0)return s;if(tt.dyn_ltree[18]!==0||tt.dyn_ltree[20]!==0||tt.dyn_ltree[26]!==0)return l;for(De=32;De<p;De++)if(tt.dyn_ltree[2*De]!==0)return l;return s})(ue)),ye(ue,ue.l_desc),ye(ue,ue.d_desc),Le=(function(tt){var De;for(B(tt,tt.dyn_ltree,tt.l_desc.max_code),B(tt,tt.dyn_dtree,tt.d_desc.max_code),ye(tt,tt.bl_desc),De=b-1;3<=De&&tt.bl_tree[2*H[De]+1]===0;De--);return tt.opt_len+=3*(De+1)+5+5+4,De})(ue),oe=ue.opt_len+3+7>>>3,(Fe=ue.static_len+3+7>>>3)<=oe&&(oe=Fe)):oe=Fe=Ue+5,Ue+4<=oe&&Ce!==-1?fe(ue,Ce,Ue,K):ue.strategy===4||Fe===oe?(ve(ue,2+(K?1:0),3),Oe(ue,te,M)):(ve(ue,4+(K?1:0),3),(function(tt,De,Pe,mt){var xt;
vendor: 2,881 bytes, lines 476-479
476for(ve(tt,De-257,5),ve(tt,Pe-1,5),ve(tt,mt-4,4),xt=0;xt<mt;xt++)ve(tt,tt.bl_tree[2*H[xt]+1],3);be(tt,tt.dyn_ltree,De-1),be(tt,tt.dyn_dtree,Pe-1)})(ue,ue.l_desc.max_code+1,ue.d_desc.max_code+1,Le+1),Oe(ue,ue.dyn_ltree,ue.dyn_dtree)),yt(ue),K&&Ge(ue)},i._tr_tally=function(ue,Ce,Ue){return ue.pending_buf[ue.d_buf+2*ue.last_lit]=Ce>>>8&255,ue.pending_buf[ue.d_buf+2*ue.last_lit+1]=255&Ce,ue.pending_buf[ue.l_buf+ue.last_lit]=255&Ue,ue.last_lit++,Ce===0?ue.dyn_ltree[2*Ue]++:(ue.matches++,Ce--,ue.dyn_ltree[2*(L[Ue]+p+1)]++,ue.dyn_dtree[2*ge(Ce)]++),ue.last_lit===ue.lit_bufsize-1},i._tr_align=function(ue){ve(ue,2,3),Ee(ue,C,te),(function(Ce){Ce.bi_valid===16?(le(Ce,Ce.bi_buf),Ce.bi_buf=0,Ce.bi_valid=0):8<=Ce.bi_valid&&(Ce.pending_buf[Ce.pending++]=255&Ce.bi_buf,Ce.bi_buf>>=8,Ce.bi_valid-=8)})(ue)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(o){(function(s,l){if(!s.setImmediate){var u,d,f,p,m=1,y={},b=!1,k=s.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(s);S=S&&S.setTimeout?S:s,u={}.toString.call(s.process)==="[object process]"?function(I){ci.nextTick(function(){T(I)})}:(function(){if(s.postMessage&&!s.importScripts){var I=!0,D=s.onmessage;return s.onmessage=function(){I=!1},s.postMessage("","*"),s.onmessage=D,I}})()?(p="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",C,!1):s.attachEvent("onmessage",C),function(I){s.postMessage(p+I,"*")}):s.MessageChannel?((f=new MessageChannel).port1.onmessage=function(I){T(I.data)},function(I){f.port2.postMessage(I)}):k&&"onreadystatechange"in k.createElement("script")?(d=k.documentElement,function(I){var D=k.createElement("script");D.onreadystatechange=function(){T(I),D.onreadystatechange=null,d.removeChild(D),D=null},d.appendChild(D)}):function(I){setTimeout(T,0,I)},S.setImmediate=function(I){typeof I!="function"&&(I=new Function(""+I));for(var D=new Array(arguments.length-1),P=0;P<D.length;P++)D[P]=arguments[P+1];return y[m]={callback:I,args:D},u(m),m++},S.clearImmediate=x}function x(I){delete y[I]}function T(I){if(b)setTimeout(T,0,I);else{var D=y[I];if(D){b=!0;try{(function(P){var V=P.callback,ee=P.args;switch(ee.length){case 0:V();break;case 1:V(ee[0]);break;case 2:V(ee[0],ee[1]);break;case 3:V(ee[0],ee[1],ee[2]);break;default:V.apply(l,ee)}})(D)}finally{x(I),b=!1}}}}function C(I){I.source===s&&typeof I.data=="string"&&I.data.indexOf(p)===0&&T(+I.data.slice(p.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof wl<"u"?wl:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})),HZ=96/72;/**
477* @vue/shared v3.5.41
478* (c) 2018-present Yuxi (Evan) You and Vue contributors
479* @license MIT
vendor: 5,602 bytes, line 480
480**/function _g(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const _i={},W0=[],Ec=()=>{},i9=()=>!1,m2=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),M_=e=>e.startsWith("onUpdate:"),qi=Object.assign,WA=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},$Z=Object.prototype.hasOwnProperty,Ui=(e,t)=>$Z.call(e,t),nr=Array.isArray,K0=e=>$y(e)==="[object Map]",Cg=e=>$y(e)==="[object Set]",a8=e=>$y(e)==="[object Date]",GZ=e=>$y(e)==="[object RegExp]",Or=e=>typeof e=="function",Mi=e=>typeof e=="string",Ic=e=>typeof e=="symbol",Vi=e=>e!==null&&typeof e=="object",KA=e=>(Vi(e)||Or(e))&&Or(e.then)&&Or(e.catch),o9=Object.prototype.toString,$y=e=>o9.call(e),qZ=e=>$y(e).slice(8,-1),D_=e=>$y(e)==="[object Object]",L_=e=>Mi(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,cg=_g(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),P_=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},WZ=/-\w/g,Vs=P_(e=>e.replace(WZ,t=>t.slice(1).toUpperCase())),KZ=/\B([A-Z])/g,_l=P_(e=>e.replace(KZ,"-$1").toLowerCase()),g2=P_(e=>e.charAt(0).toUpperCase()+e.slice(1)),Kb=P_(e=>e?`on${g2(e)}`:""),ha=(e,t)=>!Object.is(e,t),Y0=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Cy=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},B_=e=>{const t=parseFloat(e);return isNaN(t)?e:t},vk=e=>{const t=Mi(e)?Number(e):NaN;return isNaN(t)?e:t};let l8;const ug=()=>l8||(l8=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),YZ="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",XZ=_g(YZ);function Gy(e){if(nr(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=Mi(r)?eQ(r):Gy(r);if(i)for(const o in i)t[o]=i[o]}return t}else if(Mi(e)||Vi(e))return e}const ZZ=/;(?![^(]*\))/g,QZ=/:([^]+)/,JZ=/\/\*[^]*?\*\//g;function eQ(e){const t={};return e.replace(JZ,"").split(ZZ).forEach(n=>{if(n){const r=n.split(QZ);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function tQ(e){if(!e)return"";if(Mi(e))return e;let t="";for(const n in e){const r=e[n];if(Mi(r)||typeof r=="number"){const i=n.startsWith("--")?n:_l(n);t+=`${i}:${r};`}}return t}function qy(e){let t="";if(Mi(e))t=e;else if(nr(e))for(let n=0;n<e.length;n++){const r=qy(e[n]);r&&(t+=r+" ")}else if(Vi(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function nQ(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Mi(t)&&(e.class=qy(t)),n&&(e.style=Gy(n)),e}const s9="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",rQ=_g(s9),c8=_g(s9+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function j_(e){return!!e||e===""}const iQ=_g("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap"),oQ=_g("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radiu
480s,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");function a9(e){if(e==null)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"}const sQ=/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;function aQ(e,t){return e.replace(sQ,n=>`\\${n}`)}function lQ(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=oh(e[r],t[r]);return n}function oh(e,t){if(e===t)return!0;let n=a8(e),r=a8(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Ic(e),r=Ic(t),n||r)return e===t;if(n=nr(e),r=nr(t),n||r)return n&&r?lQ(e,t):!1;if(n=Vi(e),r=Vi(t),n||r){if(!n||!r)return!1;const i=Object.keys(e).length,o=Object.keys(t).length;if(i!==o)return!1;for(const s in e){const l=e.hasOwnProperty(s),u=t.hasOwnProperty(s);if(l&&!u||!l&&u||!oh(e[s],t[s]))return!1}}return String(e)===String(t)}function F_(e,t){return e.findIndex(n=>oh(n,t))}const l9=e=>!!(e&&e.__v_isRef===!0),c9=e=>Mi(e)?e:e==null?"":nr(e)||Vi(e)&&(e.toString===o9||!Or(e.toString))?l9(e)?c9(e.value):JSON.stringify(e,u9,2):String(e),u9=(e,t)=>l9(t)?u9(e,t.value):K0(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i],o)=>(n[VS(r,o)+" =>"]=i,n),{})}:Cg(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>VS(n))}:Ic(t)?VS(t):Vi(t)&&!nr(t)&&!D_(t)?String(t):t,VS=(e,t="")=>{var n;return Ic(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function d9(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
481* @vue/reactivity v3.5.41
482* (c) 2018-present Yuxi (Evan) You and Vue contributors
483* @license MIT
vendor: 10,335 bytes, line 484
484**/let Xs;class YA{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Xs&&(Xs.active?(this.parent=Xs,this.index=(Xs.scopes||(Xs.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const i=this.scopes.slice();for(t=0,n=i.length;t<n;t++)i[t].resume()}const r=this.effects.slice();for(t=0,n=r.length;t<n;t++)r[t].resume()}}run(t){if(this._active){const n=Xs;try{return Xs=this,t()}finally{Xs=n}}}on(){++this._on===1&&(this.prevScope=Xs,Xs=this)}off(){if(this._on>0&&--this._on===0){if(Xs===this)Xs=this.prevScope;else{let t=Xs;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const i=this.scopes.slice();for(n=0,r=i.length;n<r;n++)i[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function cQ(e){return new YA(e)}function f9(){return Xs}function uQ(e,t=!1){Xs&&Xs.cleanups.push(e)}let vo;const HS=new WeakSet;class w1{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Xs&&(Xs.active?Xs.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,HS.has(this)&&(HS.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||p9(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,u8(this),m9(this);const t=vo,n=ju;vo=this,ju=!0;try{return this.fn()}finally{g9(this),vo=t,ju=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)QA(t);this.deps=this.depsTail=void 0,u8(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?HS.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){R4(this)&&this.run()}get dirty(){return R4(this)}}let h9=0,Yb,Xb;function p9(e,t=!1){if(e.flags|=8,t){e.next=Xb,Xb=e;return}e.next=Yb,Yb=e}function XA(){h9++}function ZA(){if(--h9>0)return;if(Xb){let t=Xb;for(Xb=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Yb;){let t=Yb;for(Yb=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function m9(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function g9(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),QA(r),dQ(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function R4(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(y9(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function y9(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===x1)||(e.globalVersion=x1,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!R4(e))))return;e.flags|=2;const t=e.dep,n=vo,r=ju;vo=e,ju=!0;try{m9(e);const i=e.fn(e._value);(t.version===0||ha(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{vo=n,ju=r,g9(e),e.flags&=-3}}function QA(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)QA(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function dQ(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function fQ(e,t){e.effect instanceof w1&&(e=e.effect.fn);const n=new w1(e);t&&qi(n,t);try{n.run()}catch(i){throw n.stop(),i}const r=n.run.bind(n);return r.effect=n,r}function hQ(e){e.effect.stop()}let ju=!0;const v9=[];function Fd(){v9.push(ju),ju=!1}function zd(){const e=v9.pop();ju=e===void 0?!0:e}function u8(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=vo;vo=void 0;try{t()}finally{vo=n}}}let x1=0;class pQ{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class z_{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!vo||!ju||vo===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==vo)n=this.activeLink=new pQ(vo,this),vo.deps?(n.prevDep=vo.depsTail,vo.depsTail.nextDep=n,vo.depsTail=n):vo.deps=vo.depsTail=n,b9(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=vo.depsTail,n.nextDep=void 0,vo.depsTail.nextDep=n,vo.depsTail=n,vo.deps===n&&(vo.deps=r)}return n}trigger(t){this.version++,x1++,this.notify(t)}notify(t){XA();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ZA()}}}function b9(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)b9(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const bk=new WeakMap,dg=Symbol(""),O4=Symbol(""),k1=Symbol("");function Wa(e,t,n){if(ju&&vo){let r=bk.get(e);r||bk.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new z_),i.map=r,i.key=n),i.track()}}function Kf(e,t,n,r,i,o){const s=bk.get(e);if(!s){x1++;return}const l=u=>{u&&u.trigger()};if(XA(),t==="clear")s.forEach(l);else{const u=nr(e),d=u&&L_(n);if(u&&n==="length"){const f=Number(r);s.forEach((p,m)=>{(m==="length"||m===k1||!Ic(m)&&m>=f)&&l(p)})}else switch((n!==void 0||s.has(void 0))&&l(s.get(n)),d&&l(s.get(k1)),t){case"add":u?d&&l(s.get("length")):(l(s.get(dg)),K0(e)&&l(s.get(O4)));break;case"delete":u||(l(s.get(dg)),K0(e)&&l(s.get(O4)));break;case"set":K0(e)&&l(s.get(dg));break}}ZA()}function mQ(e,t){const n=bk.get(e);return n&&n.get(t)}function k0(e){const t=xi(e);return t===e?t:(Wa(t,"iterate",k1),ec(e)?t:t.map(Uu))}function U_(e){return Wa(e=xi(e),"iterate",k1),e}function Rd(e,t){return Ud(e)?Sy(eh(e)?Uu(t):t):Uu(t)}const gQ={__proto__:null,[Symbol.iterator](){return $S(this,Symbol.iterator,e=>Rd(this,e))},concat(...e){return k0(this).concat(...e.map(t=>nr(t)?k0(t):t))},entries(){return $S(this,"entries",e=>(e[1]=Rd(this,e[1]),e))},every(e,t){return Nf(this,"every",e,t,void 0,arguments)},filter(e,t){return Nf(this,"filter",e,t,n=>n.map(r=>Rd(this,r)),arguments)},find(e,t){return Nf(this,"find",e,t,n=>Rd(this,n),arguments)},findIndex(e,t){return Nf(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Nf(this,"findLast",e,t,n=>Rd(this,n),arguments)},findLastIndex(e,t){return Nf(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Nf(this,"forEach",e,t,void 0,arguments)},includes(...e){return GS(this,"includes",e)},indexOf(...e){return GS(this,"indexOf",e)},join(e){return k0(this).join(e)},lastIndexOf(...e){return GS(this,"lastIndexOf",e)},map(e,t){return Nf(this,"map",e,t,void 0,arguments)},pop(){return tb(this,"pop")},push(...e){return tb(this,"push",e)},reduce(e,...t){return d8(this,"reduce",e,t)},reduceRight(e,...t){return d8(this,"reduceRight",e,t)},shift(){return tb(this,"shift")},some(e,t){return Nf(this,"some",e,t,void 0,arguments)},splice(...e){return tb(this,"splice",e)},toReversed(){return k0(this).toReversed()},toSorted(e){return k0(this).toSorted(e)},toSpliced(...e){return k0(this).toSpliced(...e)},unshift(...e){return tb(this,"unshift",e)},values(){return $S(this,"values",e=>Rd(this,e))}};function $S(e,t,n){const r=U_(e),i=r[t]();return r!==e&&!ec(e)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.done||(o.value=n(o.value)),o}),i}const yQ=Array.prototype;function Nf(e,t,n,r,i,o){const s=U_(e),l=s!==e&&!ec(e),u=s[t];if(u!==yQ[t]){const p=u.apply(e,o);return l?Uu(p):p}let d=n;s!==e&&(l?d=function(p,m){return n.call(this,Rd(e,p),m,e)}:n.length>2&&(d=function(p,m){return n.call(this,p,m,e)}));const f=u.call(s,d,r);return l&&i?i(f):f}function d8(e,t,n,r){const i=U_(e),o=i!==e&&!ec(e);let s=n,l=!1;i!==e&&(o?(l=r.length===0,s=function(d,f,p){return l&&(l=!1,d=Rd(e,d)),n.call(this,d,Rd(e,f),p,e)}):n.length>3&&(s=function(d,f,p){return n.call(this,d,f,p,e)}));const u=i[t](s,...r);return l?Rd(e,u):u}function GS(e,t,n){const r=xi(e);Wa(r,"iterate",k1);const i=r[t](...n);return(i===-1||i===!1)&&y2(n[0])?(n[0]=xi(n[0]),r[t](...n)):i}function tb(e,t,n=[]){Fd(),XA();const r=xi(e)[t].apply(e,n);return ZA(),zd(),r}const vQ=_g("__proto__,__v_isRef,__isVue"),w9=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ic));function bQ(e){Ic(e)||(e=String(e));const t=xi(this);return Wa(t,"has",e),t.hasOwnProperty(e)}class x9{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(i?o?A9:E9:o?S9:C9).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=nr(t);if(!i){let u;if(s&&(u=gQ[n]))return u;if(n==="hasOwnProperty")return bQ}const l=Reflect.get(t,n,As(t)?t:r);if((Ic(n)?w9.has(n):vQ(n))||(i||Wa(t,"get",n),o))return l;if(As(l)){const u=s&&L_(n)?l:l.value;return i&&Vi(u)?wk(u):u}return Vi(l)?i?wk(l):H_(l):l}}class k9 extends x9{constructor(t=!1){super(!1,t)}set(t,n,r,i){let o=t[n];const s=nr(t)&&L_(n);if(!this._isShallow){const d=Ud(o);if(!ec(r)&&!Ud(r)&&(o=xi(o),r=xi(r)),!s&&As(o)&&!As(r))return d||(o.value=r),!0}const l=s?Number(n)<t.length:Ui(t,n),u=Reflect.set(t,n,r,As(t)?t:i);return t===xi(i)&&u&&(l?ha(r,o)&&Kf(t,"set",n,r):Kf(t,"add",n,r)),u}deleteProperty(t,n){const r=Ui(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&r&&Kf(t,"delete",n,void 0),i}has(t,n){const r=Reflect.has(t,n);
vendor: 5,245 bytes, line 484
484return(!Ic(n)||!w9.has(n))&&Wa(t,"has",n),r}ownKeys(t){return Wa(t,"iterate",nr(t)?"length":dg),Reflect.ownKeys(t)}}class _9 extends x9{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const wQ=new k9,xQ=new _9,kQ=new k9(!0),_Q=new _9(!0),N4=e=>e,Bw=e=>Reflect.getPrototypeOf(e);function CQ(e,t,n){return function(...r){const i=this.__v_raw,o=xi(i),s=K0(o),l=e==="entries"||e===Symbol.iterator&&s,u=e==="keys"&&s,d=i[e](...r),f=n?N4:t?Sy:Uu;return!t&&Wa(o,"iterate",u?O4:dg),qi(Object.create(d),{next(){const{value:p,done:m}=d.next();return m?{value:p,done:m}:{value:l?[f(p[0]),f(p[1])]:f(p),done:m}}})}}function jw(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function SQ(e,t){const n={get(i){const o=this.__v_raw,s=xi(o),l=xi(i);e||(ha(i,l)&&Wa(s,"get",i),Wa(s,"get",l));const{has:u}=Bw(s),d=t?N4:e?Sy:Uu;if(u.call(s,i))return d(o.get(i));if(u.call(s,l))return d(o.get(l));o!==s&&o.get(i)},get size(){const i=this.__v_raw;return!e&&Wa(xi(i),"iterate",dg),i.size},has(i){const o=this.__v_raw,s=xi(o),l=xi(i);return e||(ha(i,l)&&Wa(s,"has",i),Wa(s,"has",l)),i===l?o.has(i):o.has(i)||o.has(l)},forEach(i,o){const s=this,l=s.__v_raw,u=xi(l),d=t?N4:e?Sy:Uu;return!e&&Wa(u,"iterate",dg),l.forEach((f,p)=>i.call(o,d(f),d(p),s))}};return qi(n,e?{add:jw("add"),set:jw("set"),delete:jw("delete"),clear:jw("clear")}:{add(i){const o=xi(this),s=Bw(o),l=xi(i),u=!t&&!ec(i)&&!Ud(i)?l:i;return s.has.call(o,u)||ha(i,u)&&s.has.call(o,i)||ha(l,u)&&s.has.call(o,l)||(o.add(u),Kf(o,"add",u,u)),this},set(i,o){!t&&!ec(o)&&!Ud(o)&&(o=xi(o));const s=xi(this),{has:l,get:u}=Bw(s);let d=l.call(s,i);d||(i=xi(i),d=l.call(s,i));const f=u.call(s,i);return s.set(i,o),d?ha(o,f)&&Kf(s,"set",i,o):Kf(s,"add",i,o),this},delete(i){const o=xi(this),{has:s,get:l}=Bw(o);let u=s.call(o,i);u||(i=xi(i),u=s.call(o,i)),l&&l.call(o,i);const d=o.delete(i);return u&&Kf(o,"delete",i,void 0),d},clear(){const i=xi(this),o=i.size!==0,s=i.clear();return o&&Kf(i,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=CQ(i,e,t)}),n}function V_(e,t){const n=SQ(e,t);return(r,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(Ui(n,i)&&i in r?n:r,i,o)}const EQ={get:V_(!1,!1)},AQ={get:V_(!1,!0)},TQ={get:V_(!0,!1)},IQ={get:V_(!0,!0)},C9=new WeakMap,S9=new WeakMap,E9=new WeakMap,A9=new WeakMap;function RQ(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function H_(e){return Ud(e)?e:$_(e,!1,wQ,EQ,C9)}function T9(e){return $_(e,!1,kQ,AQ,S9)}function wk(e){return $_(e,!0,xQ,TQ,E9)}function OQ(e){return $_(e,!0,_Q,IQ,A9)}function $_(e,t,n,r,i){if(!Vi(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const o=i.get(e);if(o)return o;const s=RQ(qZ(e));if(s===0)return e;const l=new Proxy(e,s===2?r:n);return i.set(e,l),l}function eh(e){return Ud(e)?eh(e.__v_raw):!!(e&&e.__v_isReactive)}function Ud(e){return!!(e&&e.__v_isReadonly)}function ec(e){return!!(e&&e.__v_isShallow)}function y2(e){return e?!!e.__v_raw:!1}function xi(e){const t=e&&e.__v_raw;return t?xi(t):e}function I9(e){return!Ui(e,"__v_skip")&&Object.isExtensible(e)&&Cy(e,"__v_skip",!0),e}const Uu=e=>Vi(e)?H_(e):e,Sy=e=>Vi(e)?wk(e):e;function As(e){return e?e.__v_isRef===!0:!1}function Zb(e){return O9(e,!1)}function R9(e){return O9(e,!0)}function O9(e,t){return As(e)?e:new NQ(e,t)}class NQ{constructor(t,n){this.dep=new z_,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:xi(t),this._value=n?t:Uu(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||ec(t)||Ud(t);t=r?t:xi(t),ha(t,n)&&(this._rawValue=t,this._value=r?t:Uu(t),this.dep.trigger())}}function MQ(e){e.dep&&e.dep.trigger()}function v2(e){return As(e)?e.value:e}function DQ(e){return Or(e)?e():v2(e)}const LQ={get:(e,t,n)=>t==="__v_raw"?e:v2(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return As(i)&&!As(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function JA(e){return eh(e)?e:new Proxy(e,LQ)}class PQ{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new z_,{get:r,set:i}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=i}get value(){return this._value=this._get()}set value(t){this._set(t)}}function N9(e){return new PQ(e)}function BQ(e){const t=nr(e)?new Array(e.length):{};for(const n in e)t[n]=M9(e,n);return t}class jQ{constructor(t,n,r){this._object=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._key=Ic(n)?n:String(n),this._raw=xi(t);let i=!0,o=t;if(!nr(t)||Ic(this._key)||!L_(this._key))do i=!y2(o)||ec(o);while(i&&(o=o.__v_raw));this._shallow=i}get value(){let t=this._object[this._key];return this._shallow&&(t=v2(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&As(this._raw[this._key])){const n=this._object[this._key];if(As(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return mQ(this._raw,this._key)}}class FQ{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function zQ(e,t,n){return As(e)?e:Or(e)?new FQ(e):Vi(e)&&arguments.length>1?M9(e,t,n):Zb(e)}
vendor: 2,522 bytes, lines 484-487
484function M9(e,t,n){return new jQ(e,t,n)}class UQ{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new z_(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=x1-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&vo!==this)return p9(this,!0),!0}get value(){const t=this.dep.track();return y9(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function VQ(e,t,n=!1){let r,i;return Or(e)?r=e:(r=e.get,i=e.set),new UQ(r,i,n)}const HQ={GET:"get",HAS:"has",ITERATE:"iterate"},$Q={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Fw={},xk=new WeakMap;let xp;function GQ(){return xp}function D9(e,t=!1,n=xp){if(n){let r=xk.get(n);r||xk.set(n,r=[]),r.push(e)}}function qQ(e,t,n=_i){const{immediate:r,deep:i,once:o,scheduler:s,augmentJob:l,call:u}=n,d=I=>i?I:ec(I)||i===!1||i===0?Yf(I,1):Yf(I);let f,p,m,y,b=!1,k=!1;if(As(e)?(p=()=>e.value,b=ec(e)):eh(e)?(p=()=>d(e),b=!0):nr(e)?(k=!0,b=e.some(I=>eh(I)||ec(I)),p=()=>e.map(I=>{if(As(I))return I.value;if(eh(I))return d(I);if(Or(I))return u?u(I,2):I()})):Or(e)?t?p=u?()=>u(e,2):e:p=()=>{if(m){Fd();try{m()}finally{zd()}}const I=xp;xp=f;try{return u?u(e,3,[y]):e(y)}finally{xp=I}}:p=Ec,t&&i){const I=p,D=i===!0?1/0:i;p=()=>Yf(I(),D)}const S=f9(),x=()=>{f.stop(),S&&S.active&&WA(S.effects,f)};if(o&&t){const I=t;t=(...D)=>{const P=I(...D);return x(),P}}let T=k?new Array(e.length).fill(Fw):Fw;const C=I=>{if(!(!(f.flags&1)||!f.dirty&&!I))if(t){const D=f.run();if(I||i||b||(k?D.some((P,V)=>ha(P,T[V])):ha(D,T))){m&&m();const P=xp;xp=f;try{const V=[D,T===Fw?void 0:k&&T[0]===Fw?[]:T,y];T=D,u?u(t,3,V):t(...V)}finally{xp=P}}}else f.run()};return l&&l(C),f=new w1(p),f.scheduler=s?()=>s(C,!1):C,y=I=>D9(I,!1,f),m=f.onStop=()=>{const I=xk.get(f);if(I){if(u)u(I,4);else for(const D of I)D();xk.delete(f)}},t?r?C(!0):T=f.run():s?s(C.bind(null,!0),!0):f.run(),x.pause=f.pause.bind(f),x.resume=f.resume.bind(f),x.stop=x,x}function Yf(e,t=1/0,n){if(t<=0||!Vi(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,As(e))Yf(e.value,t,n);else if(nr(e))for(let r=0;r<e.length;r++)Yf(e[r],t,n);else if(Cg(e)||K0(e))e.forEach(r=>{Yf(r,t,n)});else if(D_(e)){for(const r in e)Yf(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Yf(e[r],t,n)}return e}/**
485* @vue/runtime-core v3.5.41
486* (c) 2018-present Yuxi (Evan) You and Vue contributors
487* @license MIT
vendor: 4,659 bytes, lines 488-491
488**/const fg=[];function WQ(e){fg.push(e)}function KQ(){fg.pop()}let qS=!1;function gp(e,...t){if(qS)return;qS=!0,Fd();const n=fg.length?fg[fg.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=YQ();if(r)Sg(r,n,11,[e+t.map(o=>{var s,l;return(l=(s=o.toString)==null?void 0:s.call(o))!=null?l:JSON.stringify(o)}).join(""),n&&n.proxy,i.map(({vnode:o})=>`at <${FL(n,o.type)}>`).join(`
489`),i]);else{const o=[`[Vue warn]: ${e}`,...t];i.length&&o.push(`
490`,...XQ(i)),console.warn(...o)}zd(),qS=!1}function YQ(){let e=fg[fg.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function XQ(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
491`],...ZQ(n))}),t}function ZQ({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,i=` at <${FL(e.component,e.type,r)}`,o=">"+n;return e.props?[i,...QQ(e.props),o]:[i+o]}function QQ(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...L9(r,e[r]))}),n.length>3&&t.push(" ..."),t}function L9(e,t,n){return Mi(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:As(t)?(t=L9(e,xi(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Or(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=xi(t),n?t:[`${e}=`,t])}function JQ(e,t){}const eJ={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},tJ={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Sg(e,t,n,r){try{return r?e(...r):e()}catch(i){Eg(i,t,n)}}function Rc(e,t,n,r){if(Or(e)){const i=Sg(e,t,n,r);return i&&KA(i)&&i.catch(o=>{Eg(o,t,n)}),i}if(nr(e)){const i=[];for(let o=0;o<e.length;o++)i.push(Rc(e[o],t,n,r));return i}}function Eg(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||_i;if(t){let l=t.parent;const u=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const f=l.ec;if(f){for(let p=0;p<f.length;p++)if(f[p](e,u,d)===!1)return}l=l.parent}if(o){Fd(),Sg(o,null,10,[e,u,d]),zd();return}}nJ(e,n,i,r,s)}function nJ(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const xl=[];let bd=-1;const X0=[];let kp=null,O0=0;const P9=Promise.resolve();let kk=null;function G_(e){const t=kk||P9;return e?t.then(this?e.bind(this):e):t}function rJ(e){let t=bd+1,n=xl.length;for(;t<n;){const r=t+n>>>1,i=xl[r],o=C1(i);o<e||o===e&&i.flags&2?t=r+1:n=r}return t}function e5(e){if(!(e.flags&1)){const t=C1(e),n=xl[xl.length-1];!n||!(e.flags&2)&&t>=C1(n)?xl.push(e):xl.splice(rJ(t),0,e),e.flags|=1,B9()}}function B9(){kk||(kk=P9.then(j9))}function _1(e){if(!nr(e))kp&&e.id===-1?kp.splice(O0+1,0,e):e.flags&1||(X0.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)X0.push(e[t]);B9()}function f8(e,t,n=bd+1){for(;n<xl.length;n++){const r=xl[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;xl.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function _k(e){if(X0.length){const t=[...new Set(X0)].sort((n,r)=>C1(n)-C1(r));if(X0.length=0,kp){for(let n=0;n<t.length;n++)kp.push(t[n]);return}for(kp=t,O0=0;O0<kp.length;O0++){const n=kp[O0];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}kp=null,O0=0}}const C1=e=>e.id==null?e.flags&2?-1:1/0:e.id;function j9(e){try{for(bd=0;bd<xl.length;bd++){const t=xl[bd];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Sg(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;bd<xl.length;bd++){const t=xl[bd];t&&(t.flags&=-2)}
491bd=-1,xl.length=0,_k(),kk=null,(xl.length||X0.length)&&j9()}}let Nu,xb=[],M4=!1;function q_(e,...t){Nu?Nu.emit(e,...t):M4||xb.push({event:e,args:t})}function t5(e,t){var n,r;Nu=e,Nu?(Nu.enabled=!0,xb.forEach(({event:i,args:o})=>Nu.emit(i,...o)),xb=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{t5(o,t)}),setTimeout(()=>{Nu||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,M4=!0,xb=[])},3e3)):(M4=!0,xb=[])}function iJ(e,t){q_("app:init",e,t,{Fragment:zs,Text:nh,Comment:ms,Static:$p})}function oJ(e){q_("app:unmount",e)}const D4=n5("component:added"),F9=n5("component:updated"),sJ=n5("component:removed"),aJ=e=>{Nu&&typeof Nu.cleanupBuffer=="function"&&!Nu.cleanupBuffer(e)&&sJ(e)};function n5(e){return t=>{q_(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}function lJ(e,t,n){q_("component:emit",e.appContext.app,e,t,n)}let Ta=null,W_=null;function S1(e){const t=Ta;return Ta=e,W_=e&&e.type.__scopeId||null,t}function cJ(e){W_=e}function uJ(){W_=null}const dJ=e=>r5;function r5(e,t=Ta,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&I1(-1);const o=S1(t),s=rh.length;let l;try{l=e(...i)}finally{for(let u=rh.length;u>s;u--)tC();S1(o),r._d&&I1(1)}return __VUE_PROD_DEVTOOLS__&&F9(t),l};return r._n=!0,r._c=!0,r._d=!0,r}function fJ(e,t){if(Ta===null)return e;const n=_2(Ta),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,s,l,u=_i]=t[i];o&&(Or(o)&&(o={mounted:o,updated:o}),o.deep&&Yf(s),r.push({dir:o,instance:n,value:s,oldValue:void 0,arg:l,modifiers:u}))}return e}function Cd(e,t,n,r){const i=e.dirs,o=t&&t.dirs;for(let s=0;s<i.length;s++){const l=i[s];o&&(l.oldValue=o[s].value);let u=l.dir[r];u&&(Fd(),Rc(u,n,8,[e.el,l,e,t]),zd())}}function z9(e,t){if(Aa){let n=Aa.provides;const r=Aa.parent&&Aa.parent.provides;r===n&&(n=Aa.provides=Object.create(r)),n[e]=t}}function Qb(e,t,n=!1){const r=Al();if(r||hg){let i=hg?hg._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&Or(t)?t.call(r&&r.proxy):t}}function hJ(){return!!(Al()||hg)}const U9=Symbol.for("v-scx"),V9=()=>Qb(U9);function pJ(e,t){return b2(e,null,t)}function mJ(e,t){return b2(e,null,{flush:"post"})}function H9(e,t){return b2(e,null,{flush:"sync"})}function Z0(e,t,n){return b2(e,t,n)}function b2(e,t,n=_i){const{immediate:r,deep:i,flush:o,once:s}=n,l=qi({},n),u=t&&r||!t&&o!=="post";let d;if(bg){if(o==="sync"){const y=V9();d=y.__watcherHandles||(y.__watcherHandles=[])}else if(!u){const y=()=>{};return y.stop=Ec,y.resume=Ec,y.pause=Ec,y}}const f=Aa;l.call=(y,b,k)=>Rc(y,f,b,k);let p=!1;o==="post"?l.scheduler=y=>{js(y,f&&f.suspense)}:o!=="sync"&&(p=!0,l.scheduler=(y,b)=>{b?y():e5(y)}),l.augmentJob=y=>{t&&(y.flags|=4),p&&(y.flags|=2,f&&(y.id=f.uid,y.i=f))};const m=qQ(e,t,l);return bg&&(d?d.push(m):u&&m()),m}function gJ(e,t,n){const r=this.proxy,i=Mi(e)?e.includes(".")?$9(r,e):()=>r[e]:e.bind(r,r);let o;Or(t)?o=t:(o=t.handler,n=t);const s=Wy(this),l=b2(i,o.bind(r),n);return s(),l}function $9(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}const yp=new WeakMap,G9=Symbol("_vte"),K_=e=>e.__isTeleport,Gm=e=>e&&(e.disabled||e.disabled===""),yJ=e=>e&&(e.defer||e.defer===""),h8=e=>typeof SVGElement<"u"&&e instanceof SVGElement,p8=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,L4=(e,t)=>
vendor: 4,434 bytes, line 491
491{const n=e&&e.to;return Mi(n)?t?t(n):null:n},vJ={name:"Teleport",__isTeleport:!0,process(e,t,n,r,i,o,s,l,u,d){const{mc:f,pc:p,pbc:m,o:{insert:y,querySelector:b,createText:k,createComment:S,parentNode:x}}=d,T=Gm(t.props);let{dynamicChildren:C}=t;const I=(V,ee,F)=>{V.shapeFlag&16&&f(V.children,ee,F,i,o,s,l,u)},D=(V=t)=>{const ee=Gm(V.props),F=V.target=L4(V.props,b),H=P4(F,V,k,y);F&&(s!=="svg"&&h8(F)?s="svg":s!=="mathml"&&p8(F)&&(s="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(F),ee||(I(V,F,H),kb(V,!1)))},P=V=>{const ee=()=>{if(yp.get(V)===ee){if(yp.delete(V),Gm(V.props)){const F=x(V.el)||n;I(V,F,V.anchor),kb(V,!0)}D(V)}};yp.set(V,ee),js(ee,o)};if(e==null){const V=t.el=k(""),ee=t.anchor=k("");if(y(V,n,r),y(ee,n,r),yJ(t.props)||o&&o.pendingBranch){P(t);return}T&&(I(t,n,ee),kb(t,!0)),D()}else{t.el=e.el;const V=t.anchor=e.anchor,ee=yp.get(e);if(ee){ee.flags|=8,yp.delete(e),P(t);return}t.targetStart=e.targetStart;const F=t.target=e.target,H=t.targetAnchor=e.targetAnchor,te=Gm(e.props),M=te?n:F,Z=te?V:H;if(s==="svg"||h8(F)?s="svg":(s==="mathml"||p8(F))&&(s="mathml"),C?(m(e.dynamicChildren,C,M,i,o,s,l),g5(e,t,!0)):u||p(e,t,M,Z,i,o,s,l,!1),T)te?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):zw(t,n,V,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const L=L4(t.props,b);L&&(t.target=L,zw(t,L,null,d,0))}else te&&zw(t,F,H,d,1);kb(t,T)}},remove(e,t,n,{um:r,o:{remove:i}},o){const{shapeFlag:s,children:l,anchor:u,targetStart:d,targetAnchor:f,target:p,props:m}=e,y=Gm(m),b=o||!y,k=yp.get(e);if(k&&(k.flags|=8,yp.delete(e)),p&&(i(d),i(f)),o&&i(u),!k&&(y||p)&&s&16)for(let S=0;S<l.length;S++){const x=l[S];r(x,t,n,b,!!x.dynamicChildren)}},move:zw,hydrate:bJ};function zw(e,t,n,{o:{insert:r},m:i},o=2){o===0&&r(e.targetAnchor,t,n);const{el:s,anchor:l,shapeFlag:u,children:d,props:f}=e,p=o===2;if(p&&r(s,t,n),!yp.has(e)&&(!p||Gm(f))&&u&16)for(let m=0;m<d.length;m++)i(d[m],t,n,2);p&&r(l,t,n)}function bJ(e,t,n,r,i,o,{o:{nextSibling:s,parentNode:l,querySelector:u,insert:d,createText:f}},p){function m(S,x){let T=x;for(;T;){if(T&&T.nodeType===8){if(T.data==="teleport start anchor")t.targetStart=T;else if(T.data==="teleport anchor"){t.targetAnchor=T,S._lpa=t.targetAnchor&&s(t.targetAnchor);break}}T=s(T)}}function y(S,x){x.anchor=p(s(S),x,l(S),n,r,i,o)}const b=t.target=L4(t.props,u),k=Gm(t.props);if(b){const S=b._lpa||b.firstChild;t.shapeFlag&16&&(k?(y(e,t),m(b,S),t.targetAnchor||P4(b,t,f,d,l(e)===b?e:null)):(t.anchor=s(e),m(b,S),t.targetAnchor||P4(b,t,f,d),p(S&&s(S),t,b,n,r,i,o))),kb(t,k)}else k&&t.shapeFlag&16&&(y(e,t),t.targetStart=e,t.targetAnchor=s(e));return t.anchor&&s(t.anchor)}const wJ=vJ;function kb(e,t){const n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function P4(e,t,n,r,i=null){const o=t.targetStart=n(""),s=t.targetAnchor=n("");return o[G9]=s,e&&(r(o,e,i),r(s,e,i)),s}const iu=Symbol("_leaveCb"),nb=Symbol("_enterCb");function i5(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return x2(()=>{e.isMounted=!0}),Q_(()=>{e.isUnmounting=!0}),e}const Gc=[Function,Array],o5={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Gc,onEnter:Gc,onAfterEnter:Gc,onEnterCancelled:Gc,onBeforeLeave:Gc,onLeave:Gc,onAfterLeave:Gc,onLeaveCancelled:Gc,onBeforeAppear:Gc,onAppear:Gc,onAfterAppear:Gc,onAppearCancelled:Gc},q9=e=>{const t=e.subTree;return t.component?q9(t.component):t},xJ={name:"BaseTransition",props:o5,setup(e,{slots:t}){const n=Al(),r=i5();return()=>{const i=t.default&&Y_(t.default(),!0),o=i&&i.length?W9(i):n.subTree?NL():void 0;if(!o)return;const s=xi(e),{mode:l}=s;if(r.isLeaving)return WS(o);const u=Ck(o);if(!u)return WS(o);let d=Ey(u,s,r,n,p=>d=p);u.type!==ms&&sh(u,d);let f=n.subTree&&Ck(n.subTree);if(f&&f.type!==ms&&!Mu(f,u)&&q9(n).type!==ms){let p=Ey(f,s,r,n);if(sh(f,p),l==="out-in"&&u.type!==ms)return r.isLeaving=!0,p.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete p.afterLeave,f=void 0},WS(o);l==="in-out"&&u.type!==ms?p.delayLeave=(m,y,b)=>{const k=Y9(r,f);k[String(f.key)]=f,m[iu]=()=>{y(),m[iu]=void 0,delete d.delayedLeave,f=void 0},d.delayedLeave=()=>{b(),delete d.delayedLeave,f=void 0}}:f=void 0}else f&&(f=void 0);return o}}};function W9(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ms){t=n;break}}return t}const K9=xJ;
vendor: 3,080 bytes, line 491
491function Y9(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Ey(e,t,n,r,i){const{appear:o,mode:s,persisted:l=!1,onBeforeEnter:u,onEnter:d,onAfterEnter:f,onEnterCancelled:p,onBeforeLeave:m,onLeave:y,onAfterLeave:b,onLeaveCancelled:k,onBeforeAppear:S,onAppear:x,onAfterAppear:T,onAppearCancelled:C}=t,I=String(e.key),D=Y9(n,e),P=(F,H)=>{F&&Rc(F,r,9,H)},V=(F,H)=>{const te=H[1];P(F,H),nr(F)?F.every(M=>M.length<=1)&&te():F.length<=1&&te()},ee={mode:s,persisted:l,beforeEnter(F){let H=u;if(!n.isMounted)if(o)H=S||u;else return;F[iu]&&F[iu](!0);const te=D[I];te&&Mu(e,te)&&te.el[iu]&&te.el[iu](),P(H,[F])},enter(F){if(D[I]===e)return;let H=d,te=f,M=p;if(!n.isMounted)if(o)H=x||d,te=T||f,M=C||p;else return;let Z=!1;F[nb]=W=>{Z||(Z=!0,W?P(M,[F]):P(te,[F]),ee.delayedLeave&&ee.delayedLeave(),F[nb]=void 0)};const L=F[nb].bind(null,!1);H?V(H,[F,L]):L()},leave(F,H){const te=String(e.key);if(F[nb]&&F[nb](!0),n.isUnmounting)return H();P(m,[F]);let M=!1;F[iu]=L=>{M||(M=!0,H(),L?P(k,[F]):P(b,[F]),F[iu]=void 0,D[te]===e&&delete D[te])};const Z=F[iu].bind(null,!1);D[te]=e,y?V(y,[F,Z]):Z()},clone(F){const H=Ey(F,t,n,r,i);return i&&i(H),H}};return ee}function WS(e){if(w2(e))return e=Vd(e),e.children=null,e}function Ck(e){if(!w2(e))return K_(e.type)&&e.children?W9(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Or(n.default))return n.default()}}function sh(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;sh(K_(n.type)&&Ck(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Y_(e,t=!1,n){let r=[],i=0;for(let o=0;o<e.length;o++){let s=e[o];const l=n==null?s.key:String(n)+String(s.key!=null?s.key:o);s.type===zs?(s.patchFlag&128&&i++,r=r.concat(Y_(s.children,t,l))):(t||s.type!==ms)&&r.push(l!=null?Vd(s,{key:l}):s)}if(i>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function s5(e,t){return Or(e)?qi({name:e.name},t,{setup:e}):e}function kJ(){const e=Al();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function a5(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function _J(e){const t=Al(),n=R9(null);if(t){const i=t.refs===_i?t.refs={}:t.refs;Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:o=>n.value=o})}return n}function m8(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Sk=new WeakMap;function Q0(e,t,n,r,i=!1){if(nr(e)){e.forEach((k,S)=>Q0(k,t&&(nr(t)?t[S]:t),n,r,i));return}if(th(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Q0(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?_2(r.component):r.el,s=i?null:o,{i:l,r:u}=e,d=t&&t.r,f=l.refs===_i?l.refs={}:l.refs,p=l.setupState,m=xi(p),y=p===_i?i9:k=>m8(f,k)?!1:Ui(m,k),b=(k,S)=>!(S&&m8(f,S));if(d!=null&&d!==u){if(g8(t),Mi(d))f[d]=null,y(d)&&(p[d]=null);else if(As(d)){const k=t;b(d,k.k)&&(d.value=null),k.k&&(f[k.k]=null)}}if(Or(u))Sg(u,l,12,[s,f]);
491else{const k=Mi(u),S=As(u);if(k||S){const x=()=>{if(e.f){const T=k?y(u)?p[u]:f[u]:b()||!e.k?u.value:f[e.k];if(i)nr(T)&&WA(T,o);else if(nr(T))T.includes(o)||T.push(o);else if(k)f[u]=[o],y(u)&&(p[u]=f[u]);else{const C=[o];b(u,e.k)&&(u.value=C),e.k&&(f[e.k]=C)}}else k?(f[u]=s,y(u)&&(p[u]=s)):S&&(b(u,e.k)&&(u.value=s),e.k&&(f[e.k]=s))};if(s){const T=()=>{x(),Sk.delete(e)};T.id=-1,Sk.set(e,T),js(T,n)}else g8(e),x()}}}function g8(e){const t=Sk.get(e);t&&(t.flags|=8,Sk.delete(e))}let y8=!1;const Lm=()=>{y8||(console.error("Hydration completed but contains mismatches."),y8=!0)},CJ=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",SJ=e=>e.namespaceURI.includes("MathML"),Uw=e=>{if(e.nodeType===1){if(CJ(e))return"svg";if(SJ(e))return"mathml"}},qm=e=>e.nodeType===8;function EJ(e){const{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:o,parentNode:s,remove:l,insert:u,createComment:d}}=e,f=(C,I)=>{if(!I.hasChildNodes()){__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&gp("Attempting to hydrate existing markup but container is empty. Performing full mount instead."),n(null,C,I),_k(),I._vnode=C;return}p(I.firstChild,C,null,null,null),_k(),I._vnode=C},p=(C,I,D,P,V,ee=!1)=>{ee=ee||!!I.dynamicChildren;const F=qm(C)&&C.data==="[",H=()=>k(C,I,D,P,V,F),{type:te,ref:M,shapeFlag:Z,patchFlag:L}=I;let W=C.nodeType;I.el=C,__VUE_PROD_DEVTOOLS__&&(Cy(C,"__vnode",I,!0),Cy(C,"__vueParentComponent",D,!0)),L===-2&&(ee=!1,I.dynamicChildren=null);let U=null;switch(te){case nh:W!==3?I.children===""?(u(I.el=i(""),s(C),C),U=C):U=H():(C.data!==I.children&&(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&gp("Hydration text mismatch in",C.parentNode,`
492  - rendered on server: ${JSON.stringify(C.data)}
493  - expected on client: ${JSON.stringify(I.children)}`),Lm(),C.data=I.children),U=o(C));break;case ms:T(C)?(U=o(C),x(I.el=C.content.firstChild,C,D)):W!==8||F?U=H():U=o(C);break;case $p:if(F&&(C=o(C),W=C.nodeType),W===1||W===3){U=C;const q=!I.children.length;for(let Q=0;Q<I.staticCount;Q++)q&&(I.children+=U.nodeType===1?U.outerHTML:U.data),Q===I.staticCount-1&&(I.anchor=U),U=o(U);return F?o(U):U}else H();break;case zs:F?U=b(C,I,D,P,V,ee):U=H();break;default:if(Z&1)(W!==1||I.type.toLowerCase()!==C.tagName.toLowerCase())&&!T(C)?U=H():U=m(C,I,D,P,V,ee);else if(Z&6){I.slotScopeIds=V;const q=s(C);if(F?U=S(C):qm(C)&&C.data==="teleport start"?U=S(C,C.data,"teleport end"):U=o(C),t(I,q,null,D,P,Uw(q),ee),th(I)&&!I.type.__asyncResolved){let Q;F?(Q=$o(zs),Q.anchor=U?U.previousSibling:q.lastChild):Q=C.nodeType===3?v5(""):$o("div"),Q.el=C,I.component.subTree=Q}}else Z&64?W!==8?U=H():U=I.type.hydrate(C,I,D,P,V,ee,e,y):Z&128?U=I.type.hydrate(C,I,D,P,Uw(s(C)),V,ee,e,p):__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&gp("Invalid HostVNode type:",te,`(${typeof te})`)}return M!=null&&Q0(M,null,P,I),U},m=(C,I,D,P,V,ee)=>{ee=ee||!!I.dynamicChildren;const{type:F,dynamicProps:H,props:te,patchFlag:M,shapeFlag:Z,dirs:L,transition:W}=I,U=F==="input"||F==="option",q=!!H;if(U||q||M!==-1){L&&Cd(I,null,D,"created");let Q=!1;if(T(C)){Q=CL(null,W)&&D&&D.vnode.props&&D.vnode.props.appear;const ne=C.content.firstChild;if(Q){const J=ne.getAttribute("class");J&&(ne.$cls=J),W.beforeEnter(ne)}x(ne,C,D),I.el=C=ne}if(Z&16&&!(te&&(te.innerHTML||te.textContent))){let ne=y(C.firstChild,I,C,D,P,V,ee);for(ne&&!Jb(C,1)&&(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&gp("Hydration children mismatch on",C,`
494Server rendered element contains more child nodes than client vdom.`),Lm());ne;){const J=ne;ne=ne.nextSibling,l(J)}}else if(Z&8){let ne=I.children;ne[0]===`
495`&&(C.tagName==="PRE"||C.tagName==="TEXTAREA")&&(ne=ne.slice(1));const{textContent:J}=C;J!==ne&&J!==ne.replace(/\r\n|\r/g,`
496`)&&(Jb(C,0)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&gp("Hydration text content mismatch on",C,`
497  - rendered on server: ${J}
498  - expected on client: ${ne}`),Lm()),C.textContent=I.children)}if(te){if(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__||U||q||!ee||M&48){const ne=C.tagName.includes("-"),J=C.namespaceURI.includes("svg")?"svg":C.namespaceURI.includes("MathML")?"mathml":void 0;for(const ge in te)if(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&!(L&&L.some(le=>le.dir.created))&&IJ(C,ge,te[ge],I,D)&&Lm(),U&&(ge.endsWith("value")||ge==="indeterminate")||m2(ge)&&!cg(ge)||ge[0]==="."||ne&&!cg(ge)||H&&H.includes(ge)){if(TJ(C,ge,te[ge]))continue;r(C,ge,null,te[ge],J,D)}}else if(te.onClick)r(C,"onClick",null,te.onClick,void 0,D);else if(M&4&&eh(te.style))for(const ne in te.style)te.style[ne]}let re;(re=te&&te.onVnodeBeforeMount)&&Zl(re,D,I),L&&Cd(I,null,D,"beforeMount"),((re=te&&te.onVnodeMounted)||L||Q)&&TL(()=>{re&&Zl(re,D,I),Q&&W.enter(C),L&&Cd(I,null,D,"mounted")},P)}return C.nextSibling},y=(C,I,D,P,V,ee,F)=>{F=F||!!I.dynamicChildren;const H=I.children,te=H.length;let M=!1;for(let Z=0;Z<te;Z++){const L=F?H[Z]:H[Z]=Ql(H[Z]),W=L.type===nh;C?(W&&!F&&Z+1<te&&Ql(H[Z+1]).type===nh&&(u(i(C.data.slice(L.children.length)),D,o(C)),C.data=L.children),C=p(C,L,P,V,ee,F)):W&&!L.children?u(L.el=i(""),D):(M||(M=!0,Jb(D,1)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&gp("Hydration children mismatch on",D,`
499Server rendered element contains fewer child nodes than client vdom.`),Lm())),n(null,
499L,D,null,P,V,Uw(D),ee))}return C},b=(C,I,D,P,V,ee)=>{const{slotScopeIds:F}=I;F&&(V=V?V.concat(F):F);const H=s(C),te=y(o(C),I,H,D,P,V,ee);return te&&qm(te)&&te.data==="]"?o(I.anchor=te):(Lm(),u(I.anchor=d("]"),H,te),te)},k=(C,I,D,P,V,ee)=>{if(NJ(C,I)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&gp(`Hydration node mismatch:
500- rendered on server:`,C,C.nodeType===3?"(text)":qm(C)&&C.data==="["?"(start of fragment)":"",`
501- expected on client:`,I.type),Lm()),I.el=null,ee){const te=S(C);for(;;){const M=o(C);if(M&&M!==te)l(M);else break}}const F=o(C),H=s(C);return l(C),n(null,I,H,F,D,P,Uw(H),V),D&&(D.vnode.el=I.el,eC(D,I.el)),F},S=(C,I="[",D="]")=>{let P=0;for(;C;)if(C=o(C),C&&qm(C)&&(C.data===I&&P++,C.data===D)){if(P===0)return o(C);P--}return C},x=(C,I,D)=>{const P=I.parentNode;P&&P.replaceChild(C,I);let V=D;for(;V;)V.vnode.el===I&&(V.vnode.el=V.subTree.el=C),V=V.parent},T=C=>C.nodeType===1&&C.tagName==="TEMPLATE";return[f,p]}const AJ=new Set(["src","srcset","href","poster"]);function TJ(e,t,n){return AJ.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}function IJ(e,t,n,r,i){let o,s,l,u;if(t==="class")e.$cls?(l=e.$cls,delete e.$cls):l=e.getAttribute("class"),u=qy(n),RJ(b8(l||""),b8(u))||(o=2,s="class");else if(t==="style"){l=e.getAttribute("style")||"",u=Mi(n)?n:tQ(Gy(n));const d=w8(l),f=w8(u);if(r.dirs)for(const{dir:p,value:m}of r.dirs)p.name==="show"&&!m&&f.set("display","none");i&&X9(i,r,f),OJ(d,f)||(o=3,s="style")}else(e instanceof SVGElement&&oQ(t)||e instanceof HTMLElement&&(c8(t)||iQ(t)))&&(t==="hidden"?(l=v8(e.getAttribute(t)),u=v8(n)):c8(t)?(l=e.hasAttribute(t),u=j_(n)):n==null?(l=e.hasAttribute(t),u=!1):(e.hasAttribute(t)?l=e.getAttribute(t):t==="value"&&e.tagName==="TEXTAREA"?l=e.value:l=!1,u=a9(n)?String(n):!1),l!==u&&(o=4,s=t));if(o!=null&&!Jb(e,o)){const d=m=>m===!1?"(not rendered)":`${s}="${m}"`,f=`Hydration ${Z9[o]} mismatch on`,p=`
502  - rendered on server: ${d(l)}
503  - expected on client: ${d(u)}
504  Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
505  You should fix the source of the mismatch.`;return gp(f,e,p),!0}return!1}function v8(e){return a9(e)?Mi(e)?e.toLowerCase()==="until-found"?"until-found":"":j_(e)?"":!1:!1}function b8(e){return new Set(e.trim().split(/\s+/))}function RJ(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function w8(e){const t=new Map;for(const n of e.split(";")){let[r,i]=n.split(":");r=r.trim(),i=i&&i.trim(),r&&i&&t.set(r,i)}return t}function OJ(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e)if(r!==t.get(n))return!1;return!0}function X9(e,t,n){const r=e.subTree;if(e.getCssVars&&(t===r||r&&r.type===zs&&r.children.includes(t))){const i=e.getCssVars();for(const o in i){const s=d9(i[o]);n.set(`--${aQ(o)}`,s)}}t===r&&e.parent&&X9(e.parent,e.vnode,n)}const Ek="data-allow-mismatch",Z9={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Jb(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Ek);)e=e.parentElement;return l5(e&&e.getAttribute(Ek),t)}function l5(e,t){if(e==null)return!1;if(e==="")return!0;{const n=e.split(",");return t===0&&n.includes("children")?!0:n.includes(Z9[t])}}function NJ(e,t){return Jb(e.parentElement,1)||MJ(e)||DJ(t)}function MJ(e){return e.nodeType===1&&l5(e.getAttribute(Ek),1)}function DJ({props:e}){const t=e&&e[Ek];return typeof t=="string"&&l5(t,1)}const LJ=ug().requestIdleCallback||(e=>setTimeout(e,1)),PJ=ug().cancelIdleCallback||(e=>clearTimeout(e)),BJ=(e=1e4)=>t=>{const n=LJ(t,{timeout:e});return()=>PJ(n)};function jJ(e){const{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:o,innerWidth:s}=window;return(t>0&&t<o||r>0&&r<o)&&(n>0&&n<s||i>0&&i<s)}const FJ=e=>(t,n)=>{const r=new IntersectionObserver(i=>{for(const o of i)if(o.isIntersecting){r.disconnect(),t();break}},e);return n(i=>{if(i instanceof Element){if(jJ(i))return t(),r.disconnect(),!1;r.observe(i)}}),()=>r.disconnect()},zJ=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},UJ=(e=[])=>(t,n)=>{Mi(e)&&(e=[e]);let r=!1;const i=s=>{r||(r=!0,o(),t(),s.target.dispatchEvent(new s.constructor(s.type,s)))},o=()=>{n(s=>{for(const l of e)s.removeEventListener(l,i)})};return n(s=>{for(const l of e)s.addEventListener(l,i,{once:!0})}),o};function VJ(e,t){if(qm(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(qm(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const th=e=>!!e.type.__asyncLoader;function HJ(e){Or(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:o,timeout:s,suspensible:l=!0,onError:u}=e;let d=null,f,p=0;const m=()=>(p++,d=null,y()),y=()=>{let b;return d||(b=d=t().catch(k=>{if(k=k instanceof Error?k:new Error(String(k)),u)return new Promise((S,x)=>{u(k,()=>S(m()),()=>x(k),p+1)});throw k}).then(k=>b!==d&&d?d:(k&&(k.__esModule||k[Symbol.toStringTag]==="Module")&&(k=k.default),f=k,k)))};return s5({name:"AsyncComponentWrapper",__asyncLoader:y,__asyncHydrate(b,k,S){const x=b.isConnected;let T=!1;(k.bu||(k.bu=[])).push(()=>T=!0);const C=()=>{T||!b.parentNode||x&&!b.isConnected||S()},I=o?()=>{const D=o(C,P=>VJ(b,P));D&&(k.bum||(k.bum=[])).push(D)}:C;f?I():y().then(()=>!k.isUnmounted&&I())},get __asyncResolved(){return f},setup(){const b=Aa;if(a5(b),f)return()=>Vw(f,b);const k=D=>{d=null,Eg(D,b,13,!r)};if(l&&b.suspense||bg)return y().then(D=>()=>Vw(D,b)).catch(D=>(k(D),()=>r?$o(r,{error:D}):null));const S=Zb(!1),x=Zb(),T=Zb(!!i);let C,I;return k2(()=>{C!=null&&clearTimeout(C),I!=null&&clearTimeout(I)}),i&&(I=setTimeout(()=>{b.isUnmounted||(T.value=!1)},i)),s!=null&&(C=setTimeout(()=>{if(!b.isUnmounted&&!S.value&&!x.value){const D=new Error(`Async component timed out after ${s}ms.`);k(D),x.value=D}},s)),y().then(()=>{b.isUnmounted||(S.value=!0,b.parent&&w2(b.parent.vnode)&&b.parent.update(
vendor: 4,934 bytes, line 505
505))}).catch(D=>{if(b.isUnmounted){d=null;return}k(D),x.value=D}),()=>{if(S.value&&f)return Vw(f,b);if(x.value&&r)return $o(r,{error:x.value});if(n&&!T.value)return Vw(n,b)}}})}function Vw(e,t){const{ref:n,props:r,children:i,ce:o}=t.vnode,s=$o(e,r,i);return s.ref=n,s.ce=o,delete t.vnode.ce,s}const w2=e=>e.type.__isKeepAlive,$J={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Al(),r=n.ctx;if(!r.renderer)return()=>{const T=t.default&&t.default();return T&&T.length===1?T[0]:T};const i=new Map,o=new Set;let s=null;__VUE_PROD_DEVTOOLS__&&(n.__v_cache=i);const l=n.suspense,{renderer:{p:u,m:d,um:f,o:{createElement:p}}}=r,m=p("div");r.activate=(T,C,I,D,P)=>{const V=T.component;d(T,C,I,0,l),u(V.vnode,T,C,I,V,l,D,T.slotScopeIds,P),js(()=>{V.isDeactivated=!1,V.a&&Y0(V.a);const ee=T.props&&T.props.onVnodeMounted;ee&&Zl(ee,V.parent,T)},l),__VUE_PROD_DEVTOOLS__&&D4(V)},r.deactivate=T=>{const C=T.component;Tk(C.m),Tk(C.a),d(T,m,null,1,l),js(()=>{C.da&&Y0(C.da);const I=T.props&&T.props.onVnodeUnmounted;I&&Zl(I,C.parent,T),C.isDeactivated=!0},l),__VUE_PROD_DEVTOOLS__&&D4(C)};function y(T){KS(T),f(T,n,l,!0)}function b(T){i.forEach((C,I)=>{const D=Dk(th(C)?C.type.__asyncResolved||{}:C.type);D&&!T(D)&&k(I)})}function k(T){const C=i.get(T);C&&(!s||!Mu(C,s))?y(C):s&&KS(s),i.delete(T),o.delete(T)}Z0(()=>[e.include,e.exclude],([T,C])=>{T&&b(I=>_b(T,I)),C&&b(I=>!_b(C,I))},{flush:"post",deep:!0});let S=null;const x=()=>{S!=null&&(Ik(n.subTree.type)?js(()=>{i.set(S,Hw(n.subTree))},n.subTree.suspense):i.set(S,Hw(n.subTree)))};return x2(x),Z_(x),Q_(()=>{i.forEach(T=>{const{subTree:C,suspense:I}=n,D=Hw(C);if(T.type===D.type&&T.key===D.key){KS(D);const P=D.component.da;P&&js(P,I);return}y(T)})}),()=>{if(S=null,!t.default)return s=null;const T=t.default(),C=T[0];if(T.length>1)return s=null,T;if(!ah(C)||!(C.shapeFlag&4)&&!(C.shapeFlag&128))return s=null,C;let I=Hw(C);if(I.type===ms)return s=null,I;const D=I.type,P=Dk(th(I)?I.type.__asyncResolved||{}:D),{include:V,exclude:ee,max:F}=e;if(V&&(!P||!_b(V,P))||ee&&P&&_b(ee,P))return I.shapeFlag&=-257,s=I,C;const H=I.key==null?D:I.key,te=i.get(H);return I.el&&(I=Vd(I),C.shapeFlag&128&&(C.ssContent=I)),S=H,te?(I.el=te.el,I.component=te.component,I.transition&&sh(I,I.transition),I.shapeFlag|=512,o.delete(H),o.add(H)):(o.add(H),F&&o.size>parseInt(F,10)&&k(o.values().next().value)),I.shapeFlag|=256,s=I,Ik(C.type)?C:I}}},GJ=$J;function _b(e,t){return nr(e)?e.some(n=>_b(n,t)):Mi(e)?e.split(",").includes(t):GZ(e)?(e.lastIndex=0,e.test(t)):!1}function Q9(e,t){eL(e,"a",t)}function J9(e,t){eL(e,"da",t)}function eL(e,t,n=Aa){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(X_(t,r,n),n){let i=n.parent;for(;i&&i.parent;)w2(i.parent.vnode)&&qJ(r,t,n,i),i=i.parent}}function qJ(e,t,n,r){const i=X_(t,e,r,!0);k2(()=>{WA(r[t],i)},n)}function KS(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Hw(e){return e.shapeFlag&128?e.ssContent:e}function X_(e,t,n=Aa,r=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...s)=>{Fd();const l=Wy(n),u=Rc(t,n,e,s);return l(),zd(),u});return r?i.unshift(o):i.push(o),o}}const hh=e=>(t,n=Aa)=>{(!bg||e==="sp")&&X_(e,(...r)=>t(...r),n)},tL=hh("bm"),x2=hh("m"),c5=hh("bu"),Z_=hh("u"),Q_=hh("bum"),k2=hh("um"),nL=hh("sp"),rL=hh("rtg"),iL=hh("rtc");function oL(e,t=Aa){X_("ec",e,t)}const u5="components",WJ="directives";function KJ(e,t){return d5(u5,e,!0,t)||e}const sL=Symbol.for("v-ndc");function YJ(e){return Mi(e)?d5(u5,e,!1)||e:e||sL}function XJ(e){return d5(WJ,e)}function d5(e,t,n=!0,r=!1){const i=Ta||Aa;if(i){const o=i.type;if(e===u5){const l=Dk(o,!1);if(l&&(l===t||l===Vs(t)||l===g2(Vs(t))))return o}const s=x8(i[e]||o[e],t)||x8(i.appContext[e],t);return!s&&r?o:s}}function x8(e,t){return e&&(e[t]||e[Vs(t)]||e[g2(Vs(t))])}function ZJ(e,t,n,r){let i;const o=n&&n[r],s=nr(e);if(s||Mi(e)){const l=s&&eh(e);let u=!1,d=!1;l&&(u=!ec(e),d=Ud(e),e=U_(e)),i=new Array(e.length);for(let f=0,p=e.length;f<p;f++)i[f]=t(u?d?Sy(Uu(e[f])):Uu(e[f]):e[f],f,void 0,o&&o[f])}else if(typeof e=="number"){i=new Array(e);for(let l=0;l<e;l++)i[l]=t(l+1,l,void 0,o&&o[l])}else if(Vi(e))if(e[Symbol.iterator])i=Array.from(e,(l,u)=>t(l,u,void 0,o&&o[u]));else{const l=Object.keys(e);i=new Array(l.length);for(let u=0,d=l.length;u<d;u++){const f=l[u];i[u]=t(e[f],f,u,o&&o[u])}}else i=[];return n&&(n[r]=i),i}function QJ(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(nr(r))for(let i=0;i<r.length;i++)e[r[i].name]=r[i].fn;else r&&(e[r.name]=r.key?(...i)=>{const o=r.fn(...i);return o&&(o.key=r.key),o}:r.fn)}return e}function JJ(e,t,n,r,i,o){if(n==null&&(n={}),Ta.ce||Ta.parent&&th(Ta.parent)&&Ta.parent.ce){const d=o!=null&&n.key==null?qi({},n,{key:o}):n,f=Object.keys(d).length>0;return t!=="default"&&(d.name=t),T1(),Rk(zs,null,[$o("slot",d,r&&r())],f?-2:64)}let s=e[t];s&&s._c&&(s._d=!1);const l=rh.length;T1();let u;
505try{const d=s&&f5(s(n)),f=n.key||o||d&&d.key;u=Rk(zs,{key:(f&&!Ic(f)?f:`_${t}`)+(!d&&r?"_fb":"")},d||(r?r():[]),d&&e._===1?64:-2)}catch(d){for(let f=rh.length;f>l;f--)tC();throw d}finally{s&&s._c&&(s._d=!0)}return!i&&u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),u}function f5(e){return e.some(t=>ah(t)?!(t.type===ms||t.type===zs&&!f5(t.children)):!0)?e:null}function eee(e,t){const n={};for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:Kb(r)]=e[r];return n}const B4=e=>e?LL(e)?_2(e):B4(e.parent):null,e1=qi(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>B4(e.parent),$root:e=>B4(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?h5(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{e5(e.update)}),$nextTick:e=>e.n||(e.n=G_.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?gJ.bind(e):Ec}),YS=(e,t)=>e!==_i&&!e.__isScriptSetup&&Ui(e,t),j4={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:o,accessCache:s,type:l,appContext:u}=e;if(t[0]!=="$"){const m=s[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return o[t]}else{if(YS(r,t))return s[t]=1,r[t];if(__VUE_OPTIONS_API__&&i!==_i&&Ui(i,t))return s[t]=2,i[t];if(Ui(o,t))return s[t]=3,o[t];if(n!==_i&&Ui(n,t))return s[t]=4,n[t];(!__VUE_OPTIONS_API__||F4)&&(s[t]=0)}}const d=e1[t];let f,p;if(d)return t==="$attrs"&&Wa(e.attrs,"get",""),d(e);if((f=l.__cssModules)&&(f=f[t]))return f;if(n!==_i&&Ui(n,t))return s[t]=4,n[t];if(p=u.config.globalProperties,Ui(p,t))return p[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:o}=e;return YS(i,t)?(i[t]=n,!0):__VUE_OPTIONS_API__&&r!==_i&&Ui(r,t)?(r[t]=n,!0):Ui(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:o,type:s}},l){let u;return!!(n[l]||__VUE_OPTIONS_API__&&e!==_i&&l[0]!=="$"&&Ui(e,l)||YS(t,l)||Ui(o,l)||Ui(r,l)||Ui(e1,l)||Ui(i.config.globalProperties,l)||(u=s.__cssModules)&&u[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ui(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},tee=qi({},j4,{get(e,t){if(t!==Symbol.unscopables)return j4.get(e,t,e)},has(e,t){return t[0]!=="_"&&!XZ(t)}});function nee(){return null}function ree(){return null}function iee(e){}function oee(e){}function see(){return null}function aee(){}function lee(e,t){return null}function cee(){return aL().slots}function uee(){return aL().attrs}function aL(e){const t=Al();return t.setupContext||(t.setupContext=jL(t))}function E1(e){return nr(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function dee(e,t){const n=E1(e);for(const r in t){if(r.startsWith("__skip"))continue;let i=n[r];i?nr(i)||Or(i)?i=n[r]={type:i,default:t[r]}:i.default=t[r]:i===null&&(i=n[r]={default:t[r]}),i&&t[`__skip_${r}`]&&(i.skipFactory=!0)}return n}function fee(e,t){return!e||!t?e||t:nr(e)&&nr(t)?e.concat(t):qi({},E1(e),E1(t))}function hee(e,t){const n={};for(const r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function pee(e){const t=Al(),n=bg;let r=e();R1(),n&&Gp(!1);const i=()=>{Wy(t),n&&Gp(!0)},o=()=>{Al()!==t&&t.scope.off(),R1(),n&&Gp(!1)};return KA(r)&&(r=r.catch(s=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(o)),s})),[r,()=>{i(),Promise.resolve().then(o)}]}let F4=!0;function mee(e){const t=h5(e),n=e.proxy,r=e.ctx;F4=!1,t.beforeCreate&&k8(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:s,watch:l,provide:u,inject:d,created:f,beforeMount:p,mounted:m,beforeUpdate:y,updated:b,activated:k,deactivated:S,beforeDestroy:x,beforeUnmount:T,destroyed:C,unmounted:I,render:D,renderTracked:P,renderTriggered:V,errorCaptured:ee,serverPrefetch:F,expose:H,inheritAttrs:te,components:M,directives:Z,filters:L}=t;if(d&&gee(d,r,null),s)for(const q in s){const Q=s[q];Or(Q)&&(r[q]=Q.bind(n))}if(i){const q=i.call(n,n);Vi(q)&&(e.data=H_(q))}if(F4=!0,o)for(const q in o){const Q=o[q],re=Or(Q)?Q.bind(n,n):Or(Q.get)?Q.get.bind(n,n):Ec,ne=!Or(Q)&&Or(Q.set)?Q.set.bind(n):Ec,J=zL({get:re,set:ne});Object.defineProperty(r,q,{enumerable:!0,configurable:!0,get:()=>J.value,set:ge=>J.value=ge})}if(l)for(const q in l)lL(l[q],r,n,q);if(u){const q=Or(u)?u.call(n):u;Reflect.ownKeys(q).forEach(Q=>{z9(Q,q[Q])})}f&&k8(f,e,"c");function U(q,Q){nr(Q)?Q.forEach(re=>q(re.bind(n))):Q&&q(Q.bind(n))}if(U(tL,p),U(x2,m),U(c5,y),U(Z_,b),U(Q9,k),U(J9,S),U(oL,ee),U(iL,P),U(rL,V),U(Q_,T),U(k2,I),U(nL,F),nr(H))if(H.length){const q=e.exposed||(e.exposed={});H.forEach(Q=>{Object.defineProperty(q,Q,{get:()=>n[Q],set:re=>
vendor: 5,452 bytes, line 505
505n[Q]=re,enumerable:!0})})}else e.exposed||(e.exposed={});D&&e.render===Ec&&(e.render=D),te!=null&&(e.inheritAttrs=te),M&&(e.components=M),Z&&(e.directives=Z),F&&a5(e)}function gee(e,t,n=Ec){nr(e)&&(e=z4(e));for(const r in e){const i=e[r];let o;Vi(i)?"default"in i?o=Qb(i.from||r,i.default,!0):o=Qb(i.from||r):o=Qb(i),As(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:s=>o.value=s}):t[r]=o}}function k8(e,t,n){Rc(nr(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function lL(e,t,n,r){let i=r.includes(".")?$9(n,r):()=>n[r];if(Mi(e)){const o=t[e];Or(o)&&Z0(i,o)}else if(Or(e))Z0(i,e.bind(n));else if(Vi(e))if(nr(e))e.forEach(o=>lL(o,t,n,r));else{const o=Or(e.handler)?e.handler.bind(n):t[e.handler];Or(o)&&Z0(i,o,e)}}function h5(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,l=o.get(t);let u;return l?u=l:!i.length&&!n&&!r?u=t:(u={},i.length&&i.forEach(d=>Ak(u,d,s,!0)),Ak(u,t,s)),Vi(t)&&o.set(t,u),u}function Ak(e,t,n,r=!1){const{mixins:i,extends:o}=t;o&&Ak(e,o,n,!0),i&&i.forEach(s=>Ak(e,s,n,!0));for(const s in t)if(!(r&&s==="expose")){const l=yee[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}const yee={data:_8,props:C8,emits:C8,methods:Cb,computed:Cb,beforeCreate:hl,created:hl,beforeMount:hl,mounted:hl,beforeUpdate:hl,updated:hl,beforeDestroy:hl,beforeUnmount:hl,destroyed:hl,unmounted:hl,activated:hl,deactivated:hl,errorCaptured:hl,serverPrefetch:hl,components:Cb,directives:Cb,watch:bee,provide:_8,inject:vee};function _8(e,t){return t?e?function(){return qi(Or(e)?e.call(this,this):e,Or(t)?t.call(this,this):t)}:t:e}function vee(e,t){return Cb(z4(e),z4(t))}function z4(e){if(nr(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function hl(e,t){return e?[...new Set([].concat(e,t))]:t}function Cb(e,t){return e?qi(Object.create(null),e,t):t}function C8(e,t){return e?nr(e)&&nr(t)?[...new Set([...e,...t])]:qi(Object.create(null),E1(e),E1(t??{})):t}function bee(e,t){if(!e)return t;if(!t)return e;const n=qi(Object.create(null),e);for(const r in t)n[r]=hl(e[r],t[r]);return n}function cL(){return{app:null,config:{isNativeTag:i9,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let wee=0;function xee(e,t){return function(r,i=null){Or(r)||(r=qi({},r)),i!=null&&!Vi(i)&&(i=null);const o=cL(),s=new WeakSet,l=[];let u=!1;const d=o.app={_uid:wee++,_component:r,_props:i,_container:null,_context:o,_instance:null,version:G4,get config(){return o.config},set config(f){},use(f,...p){return s.has(f)||(f&&Or(f.install)?(s.add(f),f.install(d,...p)):Or(f)&&(s.add(f),f(d,...p))),d},mixin(f){return __VUE_OPTIONS_API__&&(o.mixins.includes(f)||o.mixins.push(f)),d},component(f,p){return p?(o.components[f]=p,d):o.components[f]},directive(f,p){return p?(o.directives[f]=p,d):o.directives[f]},mount(f,p,m){if(!u){const y=d._ceVNode||$o(r,i);return y.appContext=o,m===!0?m="svg":m===!1&&(m=void 0),p&&t?t(y,f):e(y,f,m),u=!0,d._container=f,f.__vue_app__=d,__VUE_PROD_DEVTOOLS__&&(d._instance=y.component,iJ(d,G4)),_2(y.component)}},onUnmount(f){l.push(f)},unmount(){u&&(Rc(l,d._instance,16),e(null,d._container),__VUE_PROD_DEVTOOLS__&&(d._instance=null,oJ(d)),delete d._container.__vue_app__)},provide(f,p){return o.provides[f]=p,d},runWithContext(f){const p=hg;hg=d;try{return f()}finally{hg=p}}};return d}}let hg=null;function kee(e,t,n=_i){const r=Al(),i=Vs(t),o=_l(t),s=uL(e,i),l=N9((u,d)=>{let f,p=_i,m;return H9(()=>{const y=e[i];ha(f,y)&&(f=y,d())}),{get(){return u(),n.get?n.get(f):f},set(y){const b=n.set?n.set(y):y;if(!ha(b,f)&&!(p!==_i&&ha(y,p)))return;const k=r.vnode.props,S=!!(k&&(t in k||i in k||o in k)&&(`onUpdate:${t}`in k||`onUpdate:${i}`in k||`onUpdate:${o}`in k));S||(f=y,d()),r.emit(`update:${t}`,b),ha(y,p)&&(ha(y,b)&&!ha(b,m)||S&&p!==_i&&!ha(b,f))&&d(),p=y,m=b}}});return l[Symbol.iterator]=()=>{let u=0;return{next(){return u<2?{value:u++?s||_i:l,done:!1}:{done:!0}}}},l}const uL=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Vs(t)}Modifiers`]||e[`${_l(t)}Modifiers`];function _ee(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||_i;let i=n;const o=t.startsWith("update:"),s=o&&uL(r,t.slice(7));s&&(s.trim&&(i=n.map(f=>Mi(f)?f.trim():f)),s.number&&(i=n.map(B_))),__VUE_PROD_DEVTOOLS__&&lJ(e,t,i);let l,u=r[l=Kb(t)]||r[l=Kb(Vs(t))];!u&&o&&(u=r[l=Kb(_l(t))]),u&&Rc(u,e,6,i);const d=r[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Rc(d,e,6,i)}}const Cee=new WeakMap;function dL(e,t,n=!1){const r=__VUE_OPTIONS_API__&&n?Cee:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const o=e.emits;let s={},l=!1;if(__VUE_OPTIONS_API__&&!Or(e)){const u=d=>{const f=dL(d,t,!0);f&&(l=!0,qi(s,f))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!o&&!l?(Vi(e)&&r.set(e,null),null):(nr(o)?o.forEach(u=>s[u]=null):qi(s,o),Vi(e)&&r.set(e,s),s)}function J_(e,t){return!e||!m2(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Ui(e,t[0].toLowerCase()+t.slice(1))||Ui(e,_l(t))||Ui(e,t))}function Mx(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[o],slots:s,attrs:l,emit:u,render:d,renderCache:f,props:p,data:m,setupState:y,ctx:b,inheritAttrs:k}=e,S=S1(e);let x,T;
vendor: 8,977 bytes, line 505
505try{if(n.shapeFlag&4){const I=i||r,D=I;x=Ql(d.call(D,I,f,p,y,m,b)),T=l}else{const I=t;x=Ql(I.length>1?I(p,{attrs:l,slots:s,emit:u}):I(p,null)),T=t.props?l:Eee(l)}}catch(I){rh.length=0,Eg(I,e,1),x=$o(ms)}let C=x;if(T&&k!==!1){const I=Object.keys(T),{shapeFlag:D}=C;I.length&&D&7&&(o&&I.some(M_)&&(T=Aee(T,o)),C=Vd(C,T,!1,!0))}if(n.dirs&&(C=Vd(C,null,!1,!0),C.dirs=C.dirs?C.dirs.concat(n.dirs):n.dirs),n.transition){const I=K_(C.type)&&Ck(C)||C;sh(I,n.transition)}return x=C,S1(S),x}function See(e,t=!0){let n;for(let r=0;r<e.length;r++){const i=e[r];if(ah(i)){if(i.type!==ms||i.children==="v-if"){if(n)return;n=i}}else return}return n}const Eee=e=>{let t;for(const n in e)(n==="class"||n==="style"||m2(n))&&((t||(t={}))[n]=e[n]);return t},Aee=(e,t)=>{const n={};for(const r in e)(!M_(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Tee(e,t,n){const{props:r,children:i,component:o}=e,{props:s,children:l,patchFlag:u}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return r?S8(r,s,d):!!s;if(u&8){const f=t.dynamicProps;for(let p=0;p<f.length;p++){const m=f[p];if(fL(s,r,m)&&!J_(d,m))return!0}}}else return(i||l)&&(!l||!l.$stable)?!0:r===s?!1:r?s?S8(r,s,d):!0:!!s;return!1}function S8(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const o=r[i];if(fL(t,e,o)&&!J_(n,o))return!0}return!1}function fL(e,t,n){const r=e[n],i=t[n];return n==="style"&&Vi(r)&&Vi(i)?!oh(r,i):r!==i}function eC({vnode:e,parent:t,suspense:n},r){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.suspense.vnode.el=i.el=r,e=i),i===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const hL={},pL=()=>Object.create(hL),mL=e=>Object.getPrototypeOf(e)===hL;function Iee(e,t,n,r=!1){const i={},o=pL();e.propsDefaults=Object.create(null),gL(e,t,i,o);for(const s in e.propsOptions[0])s in i||(i[s]=void 0);n?e.props=r?i:T9(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function Ree(e,t,n,r){const{props:i,attrs:o,vnode:{patchFlag:s}}=e,l=xi(i),[u]=e.propsOptions;let d=!1;if((r||s>0)&&!(s&16)){if(s&8){const f=e.vnode.dynamicProps;for(let p=0;p<f.length;p++){let m=f[p];if(J_(e.emitsOptions,m))continue;const y=t[m];if(u)if(Ui(o,m))y!==o[m]&&(o[m]=y,d=!0);else{const b=Vs(m);i[b]=U4(u,l,b,y,e,!1)}else y!==o[m]&&(o[m]=y,d=!0)}}}else{gL(e,t,i,o)&&(d=!0);let f;for(const p in l)(!t||!Ui(t,p)&&((f=_l(p))===p||!Ui(t,f)))&&(u?n&&(n[p]!==void 0||n[f]!==void 0)&&(i[p]=U4(u,l,p,void 0,e,!0)):delete i[p]);if(o!==l)for(const p in o)(!t||!Ui(t,p))&&(delete o[p],d=!0)}d&&Kf(e.attrs,"set","")}function gL(e,t,n,r){const[i,o]=e.propsOptions;let s=!1,l;if(t)for(let u in t){if(cg(u))continue;const d=t[u];let f;i&&Ui(i,f=Vs(u))?!o||!o.includes(f)?n[f]=d:(l||(l={}))[f]=d:J_(e.emitsOptions,u)||(!(u in r)||d!==r[u])&&(r[u]=d,s=!0)}if(o){const u=xi(n),d=l||_i;for(let f=0;f<o.length;f++){const p=o[f];n[p]=U4(i,u,p,d[p],e,!Ui(d,p))}}return s}function U4(e,t,n,r,i,o){const s=e[n];if(s!=null){const l=Ui(s,"default");if(l&&r===void 0){const u=s.default;if(s.type!==Function&&!s.skipFactory&&Or(u)){const{propsDefaults:d}=i;if(n in d)r=d[n];else{const f=Wy(i);r=d[n]=u.call(null,t),f()}}else r=u;i.ce&&i.ce._setProp(n,r)}s[0]&&(o&&!l?r=!1:s[1]&&(r===""||r===_l(n))&&(r=!0))}return r}const Oee=new WeakMap;function yL(e,t,n=!1){const r=__VUE_OPTIONS_API__&&n?Oee:t.propsCache,i=r.get(e);if(i)return i;const o=e.props,s={},l=[];let u=!1;if(__VUE_OPTIONS_API__&&!Or(e)){const f=p=>{u=!0;const[m,y]=yL(p,t,!0);qi(s,m),y&&l.push(...y)};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!o&&!u)return Vi(e)&&r.set(e,W0),W0;if(nr(o))for(let f=0;f<o.length;f++){const p=Vs(o[f]);E8(p)&&(s[p]=_i)}else if(o)for(const f in o){const p=Vs(f);if(E8(p)){const m=o[f],y=s[p]=nr(m)||Or(m)?{type:m}:qi({},m),b=y.type;let k=!1,S=!0;if(nr(b))for(let x=0;x<b.length;++x){const T=b[x],C=Or(T)&&T.name;if(C==="Boolean"){k=!0;break}else C==="String"&&(S=!1)}else k=Or(b)&&b.name==="Boolean";y[0]=k,y[1]=S,(k||Ui(y,"default"))&&l.push(p)}}const d=[s,l];return Vi(e)&&r.set(e,d),d}function E8(e){return e[0]!=="$"&&!cg(e)}const p5=e=>e==="_"||e==="_ctx"||e==="$stable",m5=e=>nr(e)?e.map(Ql):[Ql(e)],Nee=(e,t,n)=>{if(t._n)return t;const r=r5((...i)=>m5(t(...i)),n);return r._c=!1,r},vL=(e,t,n)=>{const r=e._ctx;for(const i in e){if(p5(i))continue;const o=e[i];if(Or(o))t[i]=Nee(i,o,r);else if(o!=null){const s=m5(o);t[i]=()=>s}}},bL=(e,t)=>{const n=m5(t);e.slots.default=()=>n},wL=(e,t,n)=>{for(const r in t)(n||!p5(r))&&(e[r]=t[r])},Mee=(e,t,n)=>{const r=e.slots=pL();if(e.vnode.shapeFlag&32){const i=t._;i?(wL(r,t,n),n&&Cy(r,"_",i,!0)):vL(t,r)}else t&&bL(e,t)},Dee=(e,t,n)=>{const{vnode:r,slots:i}=e;let o=!0,s=_i;if(r.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:wL(i,t,n):(o=!t.$stable,vL(t,i)),s=t}else t&&(bL(e,t),s={default:1});if(o)for(const l in i)!p5(l)&&s[l]==null&&delete i[l]};function Lee(){typeof __VUE_OPTIONS_API__!="boolean"&&(ug().__VUE_OPTIONS_API__=!0),typeof __VUE_PROD_DEVTOOLS__!="boolean"&&(ug().__VUE_PROD_DEVTOOLS__=!1),typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__!="boolean"&&(ug().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1)}const js=TL;function xL(e){return _L(e)}function kL(e){return _L(e,EJ)}function _L(e,t){Lee();const n=ug();n.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&t5(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:r,remove:i,patchProp:o,createElement:s,createText:l,createComment:u,setText:d,setElementText:f,parentNode:p,nextSibling:m,setScopeId:y=Ec,insertStaticContent:b}=e,k=(ye,B,be,ie=null,fe=null,ue=null,Ce=void 0,Ue=null,K=!!B.dynamicChildren)=>{if(ye===B)return;ye&&!Mu(ye,B)&&(ie=At(ye),ge(ye,fe,ue,!0),ye=null),B.patchFlag===-2&&(K=!1,B.dynamicChildren=null);const{type:oe,ref:Fe,shapeFlag:Le}=B;switch(oe){case nh:S(ye,B,be,ie);break;case ms:x(ye,B,be,ie);break;case $p:ye==null&&T(B,be,ie,Ce);break;case zs:M(ye,B,be,ie,fe,ue,Ce,Ue,K);break;default:Le&1?D(ye,B,be,ie,fe,ue,Ce,Ue,K):Le&6?Z(ye,B,be,ie,fe,ue,Ce,Ue,K):(Le&64||Le&128)&&oe.process(ye,B,be,ie,fe,ue,Ce,Ue,K,Be)}Fe!=null&&fe?Q0(Fe,ye&&ye.ref,ue,B||ye,!B):Fe==null&&ye&&ye.ref!=null&&Q0(ye.ref,null,ue,ye,!0)},S=(ye,B,be,ie)=>{if(ye==null)r(B.el=l(B.children),be,ie);else{const fe=B.el=ye.el;B.children!==ye.children&&d(fe,B.children)}},x=(ye,B,be,ie)=>{ye==null?r(B.el=u(B.children||""),be,ie):B.el=ye.el},T=(ye,B,be,ie)=>{[ye.el,ye.anchor]=b(ye.children,B,be,ie,ye.el,ye.anchor)},C=({el:ye,anchor:B},be,ie)=>{let fe;for(;ye&&ye!==B;)fe=m(ye),r(ye,be,ie),ye=fe;r(B,be,ie)},I=({el:ye,anchor:B})=>{let be;for(;ye&&ye!==B;)be=m(ye),i(ye),ye=be;i(B)},D=(ye,B,be,ie,fe,ue,Ce,Ue,K)=>{if(B.type==="svg"?Ce="svg":B.type==="math"&&(Ce="mathml"),ye==null)P(B,be,ie,fe,ue,Ce,Ue,K);else{const oe=ye.el&&ye.el._isVueCE?ye.el:null;try{oe&&oe._beginPatch(),F(ye,B,fe,ue,Ce,Ue,K)}finally{oe&&oe._endPatch()}}},P=(ye,B,be,ie,fe,ue,Ce,Ue)=>{let K,oe;const{props:Fe,shapeFlag:Le,transition:tt,dirs:De}=ye;if(K=ye.el=s(ye.type,ue,Fe&&Fe.is,Fe),Le&8?f(K,ye.children):Le&16&&ee(ye.children,K,null,ie,fe,XS(ye,ue),Ce,Ue),De&&Cd(ye,null,ie,"created"),V(K,ye,ye.scopeId,Ce,ie),Fe){for(const mt in Fe)mt!=="value"&&!cg(mt)&&o(K,mt,null,Fe[mt],ue,ie);"value"in Fe&&o(K,"value",null,Fe.value,ue),(oe=Fe.onVnodeBeforeMount)&&Zl(oe,ie,ye)}__VUE_PROD_DEVTOOLS__&&(Cy(K,"__vnode",ye,!0),Cy(K,"__vueParentComponent",ie,!0)),De&&Cd(ye,null,ie,"beforeMount");const Pe=CL(fe,tt);Pe&&tt.beforeEnter(K),r(K,B,be),((oe=Fe&&Fe.onVnodeMounted)||Pe||De)&&js(()=>{try{oe&&Zl(oe,ie,ye),Pe&&tt.enter(K),De&&Cd(ye,null,ie,"mounted")}finally{}},fe)},V=(ye,B,be,ie,fe)=>{if(be&&y(ye,be),ie)for(let ue=0;ue<ie.length;ue++)y(ye,ie[ue]);if(fe){let ue=fe.subTree;if(B===ue||Ik(ue.type)&&(ue.ssContent===B||ue.ssFallback===B)){const Ce=fe.vnode;V(ye,Ce,Ce.scopeId,Ce.slotScopeIds,fe.parent)}}},ee=(ye,B,be,ie,fe,ue,Ce,Ue,K=0)=>{for(let oe=K;oe<ye.length;oe++){const Fe=ye[oe]=Ue?jf(ye[oe]):Ql(ye[oe]);k(null,Fe,B,be,ie,fe,ue,Ce,Ue)}},F=(ye,B,be,ie,fe,ue,Ce)=>{const Ue=B.el=ye.el;__VUE_PROD_DEVTOOLS__&&(Ue.__vnode=B);let{patchFlag:K,dynamicChildren:oe,dirs:Fe}=B;K|=ye.patchFlag&16;const Le=ye.props||_i,tt=B.props||_i;let De;if(be&&Pm(be,!1),(De=tt.onVnodeBeforeUpdate)&&Zl(De,be,B,ye),Fe&&Cd(B,ye,be,"beforeUpdate"),be&&Pm(be,!0),oe&&(!ye.dynamicChildren||ye.dynamicChildren.length!==oe.length)&&(K=0,Ce=!1,oe=null),(Le.innerHTML&&tt.innerHTML==null||Le.textContent&&tt.textContent==null)&&f(Ue,""),oe?H(ye.dynamicChildren,oe,Ue,be,ie,XS(B,fe),ue):Ce||Q(ye,B,Ue,null,be,ie,XS(B,fe),ue,!1),K>0){if(K&16)te(Ue,Le,tt,be,fe);else if(K&2&&Le.class!==tt.class&&o(Ue,"class",null,tt.class,fe),K&4&&o(Ue,"style",Le.style,tt.style,fe),K&8){const Pe=B.dynamicProps;for(let mt=0;mt<Pe.length;mt++){const xt=Pe[mt],de=Le[xt],z=tt[xt];(z!==de||xt==="value")&&o(Ue,xt,de,z,fe,be)}}K&1&&ye.children!==B.children&&f(Ue,B.children)}else!Ce&&oe==null&&te(Ue,Le,tt,be,fe);((De=tt.onVnodeUpdated)||Fe)&&js(()=>{De&&Zl(De,be,B,ye),Fe&&Cd(B,ye,be,"updated")},ie)},H=(ye,B,be,ie,fe,ue,Ce)=>{for(let Ue=0;Ue<B.length;
vendor: 4,703 bytes, line 505
505Ue++){const K=ye[Ue],oe=B[Ue],Fe=K.el&&(K.type===zs||!Mu(K,oe)||K.shapeFlag&198)?p(K.el):be;k(K,oe,Fe,null,ie,fe,ue,Ce,!0)}},te=(ye,B,be,ie,fe)=>{if(B!==be){if(B!==_i)for(const ue in B)!cg(ue)&&!(ue in be)&&o(ye,ue,B[ue],null,fe,ie);for(const ue in be){if(cg(ue))continue;const Ce=be[ue],Ue=B[ue];Ce!==Ue&&ue!=="value"&&o(ye,ue,Ue,Ce,fe,ie)}"value"in be&&o(ye,"value",B.value,be.value,fe)}},M=(ye,B,be,ie,fe,ue,Ce,Ue,K)=>{const oe=B.el=ye?ye.el:l(""),Fe=B.anchor=ye?ye.anchor:l("");let{patchFlag:Le,dynamicChildren:tt,slotScopeIds:De}=B;De&&(Ue=Ue?Ue.concat(De):De),ye==null?(r(oe,be,ie),r(Fe,be,ie),ee(B.children||[],be,Fe,fe,ue,Ce,Ue,K)):Le>0&&Le&64&&tt&&ye.dynamicChildren&&ye.dynamicChildren.length===tt.length?(H(ye.dynamicChildren,tt,be,fe,ue,Ce,Ue),(B.key!=null||fe&&B===fe.subTree)&&g5(ye,B,!0)):Q(ye,B,be,Fe,fe,ue,Ce,Ue,K)},Z=(ye,B,be,ie,fe,ue,Ce,Ue,K)=>{B.slotScopeIds=Ue,ye==null?B.shapeFlag&512?fe.ctx.activate(B,be,ie,Ce,K):L(B,be,ie,fe,ue,Ce,K):W(ye,B,K)},L=(ye,B,be,ie,fe,ue,Ce)=>{const Ue=ye.component=DL(ye,ie,fe);if(w2(ye)&&(Ue.ctx.renderer=Be),PL(Ue,!1,Ce),Ue.asyncDep){if(fe&&fe.registerDep(Ue,U,Ce),!ye.el){const K=Ue.subTree=$o(ms);x(null,K,B,be),ye.placeholder=K.el}}else U(Ue,ye,B,be,fe,ue,Ce)},W=(ye,B,be)=>{const ie=B.component=ye.component;if(Tee(ye,B,be))if(ie.asyncDep&&!ie.asyncResolved){q(ie,B,be);return}else ie.next=B,ie.update();else B.el=ye.el,ie.vnode=B},U=(ye,B,be,ie,fe,ue,Ce)=>{const Ue=()=>{if(ye.isMounted){let{next:Le,bu:tt,u:De,parent:Pe,vnode:mt}=ye;{const me=SL(ye);if(me){Le&&(Le.el=mt.el,q(ye,Le,Ce)),me.asyncDep.then(()=>{js(()=>{ye.isUnmounted||oe()},fe)});return}}let xt=Le,de;Pm(ye,!1),Le?(Le.el=mt.el,q(ye,Le,Ce)):Le=mt,tt&&Y0(tt),(de=Le.props&&Le.props.onVnodeBeforeUpdate)&&Zl(de,Pe,Le,mt),Pm(ye,!0);const z=Mx(ye),Y=ye.subTree;ye.subTree=z,k(Y,z,p(Y.el),At(Y),ye,fe,ue),Le.el=z.el,xt===null&&eC(ye,z.el),De&&js(De,fe),(de=Le.props&&Le.props.onVnodeUpdated)&&js(()=>Zl(de,Pe,Le,mt),fe),__VUE_PROD_DEVTOOLS__&&F9(ye)}else{let Le;const{el:tt,props:De}=B,{bm:Pe,m:mt,parent:xt,root:de,type:z}=ye,Y=th(B);if(Pm(ye,!1),Pe&&Y0(Pe),!Y&&(Le=De&&De.onVnodeBeforeMount)&&Zl(Le,xt,B),Pm(ye,!0),tt&&Oe){const me=()=>{ye.subTree=Mx(ye),Oe(tt,ye.subTree,ye,fe,null)};Y&&z.__asyncHydrate?z.__asyncHydrate(tt,ye,me):me()}else{de.ce&&de.ce._hasShadowRoot()&&de.ce._injectChildStyle(z,ye.parent?ye.parent.type:void 0);const me=ye.subTree=Mx(ye);k(null,me,be,ie,ye,fe,ue),B.el=me.el}if(mt&&js(mt,fe),!Y&&(Le=De&&De.onVnodeMounted)){const me=B;js(()=>Zl(Le,xt,me),fe)}(B.shapeFlag&256||xt&&th(xt.vnode)&&xt.vnode.shapeFlag&256)&&ye.a&&js(ye.a,fe),ye.isMounted=!0,__VUE_PROD_DEVTOOLS__&&D4(ye),B=be=ie=null}};ye.scope.on();const K=ye.effect=new w1(Ue);ye.scope.off();const oe=ye.update=K.run.bind(K),Fe=ye.job=K.runIfDirty.bind(K);Fe.i=ye,Fe.id=ye.uid,K.scheduler=()=>e5(Fe),Pm(ye,!0),oe()},q=(ye,B,be)=>{B.component=ye;const ie=ye.vnode.props;ye.vnode=B,ye.next=null,Ree(ye,B.props,ie,be),Dee(ye,B.children,be),Fd(),f8(ye),zd()},Q=(ye,B,be,ie,fe,ue,Ce,Ue,K=!1)=>{const oe=ye&&ye.children,Fe=ye?ye.shapeFlag:0,Le=B.children,{patchFlag:tt,shapeFlag:De}=B;if(tt>0){if(tt&128){ne(oe,Le,be,ie,fe,ue,Ce,Ue,K);return}else if(tt&256){re(oe,Le,be,ie,fe,ue,Ce,Ue,K);return}}De&8?(Fe&16&&st(oe,fe,ue),Le!==oe&&f(be,Le)):Fe&16?De&16?ne(oe,Le,be,ie,fe,ue,Ce,Ue,K):st(oe,fe,ue,!0):(Fe&8&&f(be,""),De&16&&ee(Le,be,ie,fe,ue,Ce,Ue,K))},re=(ye,B,be,ie,fe,ue,Ce,Ue,K)=>{ye=ye||W0,B=B||W0;const oe=ye.length,Fe=B.length,Le=Math.min(oe,Fe);let tt;for(tt=0;tt<Le;tt++){const De=B[tt]=K?jf(B[tt]):Ql(B[tt]);k(ye[tt],De,be,null,fe,ue,Ce,Ue,K)}oe>Fe?st(ye,fe,ue,!0,!1,Le):ee(B,be,ie,fe,ue,Ce,Ue,K,Le)},ne=(ye,B,be,ie,fe,ue,Ce,Ue,K)=>{let oe=0;const Fe=B.length;let Le=ye.length-1,tt=Fe-1;for(;oe<=Le&&oe<=tt;){const De=ye[oe],Pe=B[oe]=K?jf(B[oe]):Ql(B[oe]);if(Mu(De,Pe))k(De,Pe,be,null,fe,ue,Ce,Ue,K);else break;oe++}for(;oe<=Le&&oe<=tt;){const De=ye[Le],Pe=B[tt]=K?jf(B[tt]):Ql(B[tt]);if(Mu(De,Pe))k(De,Pe,be,null,fe,ue,Ce,Ue,K);else break;Le--,tt--}if(oe>Le){if(oe<=tt){const De=tt+1,Pe=De<Fe?B[De].el:ie;for(;oe<=tt;)k(null,B[oe]=K?jf(B[oe]):Ql(B[oe]),be,Pe,fe,ue,Ce,Ue,K),oe++}}else if(oe>tt)for(;oe<=Le;)ge(ye[oe],fe,ue,!0),oe++;else{const De=oe,Pe=oe,mt=new Map;for(oe=Pe;oe<=tt;oe++){const gt=B[oe]=K?jf(B[oe]):Ql(B[oe]);gt.key!=null&&mt.set(gt.key,oe)}let xt,de=0;const z=tt-Pe+1;let Y=!1,me=0;const Ve=new Array(z);for(oe=0;oe<z;oe++)Ve[oe]=0;for(oe=De;oe<=Le;oe++){const gt=ye[oe];if(de>=z){ge(gt,fe,ue,!0);continue}let dn;if(gt.key!=null)dn=mt.get(gt.key);else for(xt=Pe;xt<=tt;xt++)if(Ve[xt-Pe]===0&&Mu(gt,B[xt])){dn=xt;break}dn===void 0?ge(gt,fe,ue,!0):(Ve[dn-Pe]=oe+1,dn>=me?me=dn:Y=!0,k(gt,B[dn],be,null,fe,ue,Ce,Ue,K),de++)}const lt=Y?Pee(Ve):W0;for(xt=lt.length-1,oe=z-1;oe>=0;
vendor: 9,700 bytes, line 505
505oe--){const gt=Pe+oe,dn=B[gt],Hn=B[gt+1],br=gt+1<Fe?Hn.el||EL(Hn):ie;Ve[oe]===0?k(null,dn,be,br,fe,ue,Ce,Ue,K):Y&&(xt<0||oe!==lt[xt]?J(dn,be,br,2):xt--)}}},J=(ye,B,be,ie,fe=null)=>{const{el:ue,type:Ce,transition:Ue,children:K,shapeFlag:oe}=ye;if(oe&6){J(ye.component.subTree,B,be,ie);return}if(oe&128){ye.suspense.move(B,be,ie);return}if(oe&64){Ce.move(ye,B,be,Be);return}if(Ce===zs){r(ue,B,be);for(let Le=0;Le<K.length;Le++)J(K[Le],B,be,ie);r(ye.anchor,B,be);return}if(Ce===$p){C(ye,B,be);return}if(ie!==2&&oe&1&&Ue)if(ie===0)Ue.persisted&&!ue[iu]?r(ue,B,be):(Ue.beforeEnter(ue),r(ue,B,be),js(()=>Ue.enter(ue),fe));else{const{leave:Le,delayLeave:tt,afterLeave:De}=Ue,Pe=()=>{ye.ctx.isUnmounted?i(ue):r(ue,B,be)},mt=()=>{const xt=ue._isLeaving||!!ue[iu];ue._isLeaving&&ue[iu](!0),Ue.persisted&&!xt?Pe():Le(ue,()=>{Pe(),De&&De()})};tt?tt(ue,Pe,mt):mt()}else r(ue,B,be)},ge=(ye,B,be,ie=!1,fe=!1)=>{const{type:ue,props:Ce,ref:Ue,children:K,dynamicChildren:oe,shapeFlag:Fe,patchFlag:Le,dirs:tt,cacheIndex:De,memo:Pe}=ye;if(Le===-2&&(fe=!1),Ue!=null&&(Fd(),Q0(Ue,null,be,ye,!0),zd()),De!=null&&(B.renderCache[De]=void 0),Fe&256){B.ctx.deactivate(ye);return}const mt=Fe&1&&tt,xt=!th(ye);let de;if(xt&&(de=Ce&&Ce.onVnodeBeforeUnmount)&&Zl(de,B,ye),Fe&6)Ee(ye.component,be,ie);else{if(Fe&128){ye.suspense.unmount(be,ie);return}mt&&Cd(ye,null,B,"beforeUnmount"),Fe&64?ye.type.remove(ye,B,be,Be,ie):oe&&!oe.hasOnce&&(ue!==zs||Le>0&&Le&64)?st(oe,B,be,!1,!0):(ue===zs&&Le&384||!fe&&Fe&16)&&st(K,B,be),ie&&le(ye)}const z=Pe!=null&&De==null;(xt&&(de=Ce&&Ce.onVnodeUnmounted)||mt||z)&&js(()=>{de&&Zl(de,B,ye),mt&&Cd(ye,null,B,"unmounted"),z&&(ye.el=null)},be)},le=ye=>{const{type:B,el:be,anchor:ie,transition:fe}=ye;if(B===zs){ve(be,ie);return}if(B===$p){I(ye);return}const ue=()=>{i(be),fe&&!fe.persisted&&fe.afterLeave&&fe.afterLeave()};if(ye.shapeFlag&1&&fe&&!fe.persisted){const{leave:Ce,delayLeave:Ue}=fe,K=()=>Ce(be,ue);Ue?Ue(ye.el,ue,K):K()}else ue()},ve=(ye,B)=>{let be;for(;ye!==B;)be=m(ye),i(ye),ye=be;i(B)},Ee=(ye,B,be)=>{const{bum:ie,scope:fe,job:ue,subTree:Ce,um:Ue,m:K,a:oe}=ye;Tk(K),Tk(oe),ie&&Y0(ie),fe.stop(),ue&&(ue.flags|=8,ge(Ce,ye,B,be)),Ue&&js(Ue,B),js(()=>{ye.isUnmounted=!0},B),__VUE_PROD_DEVTOOLS__&&aJ(ye)},st=(ye,B,be,ie=!1,fe=!1,ue=0)=>{for(let Ce=ue;Ce<ye.length;Ce++)ge(ye[Ce],B,be,ie,fe)},At=ye=>{if(ye.shapeFlag&6)return At(ye.component.subTree);if(ye.shapeFlag&128)return ye.suspense.next();const B=m(ye.anchor||ye.el),be=B&&B[G9];return be?m(be):B};let yt=!1;const Ge=(ye,B,be)=>{let ie;ye==null?B._vnode&&(ge(B._vnode,null,null,!0),ie=B._vnode.component):k(B._vnode||null,ye,B,null,null,null,be),B._vnode=ye,yt||(yt=!0,f8(ie),_k(),yt=!1)},Be={p:k,um:ge,m:J,r:le,mt:L,mc:ee,pc:Q,pbc:H,n:At,o:e};let he,Oe;return t&&([he,Oe]=t(Be)),{render:Ge,hydrate:he,createApp:xee(Ge,he)}}function XS({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Pm({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function CL(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function g5(e,t,n=!1){const r=e.children,i=t.children;if(nr(r)&&nr(i))for(let o=0;o<r.length;o++){const s=r[o];let l=i[o];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=i[o]=jf(i[o]),l.el=s.el),!n&&l.patchFlag!==-2&&g5(s,l)),l.type===nh&&(l.patchFlag===-1&&(l=i[o]=jf(l)),l.el=s.el),l.type===ms&&!l.el&&(l.el=s.el)}}function Pee(e){const t=e.slice(),n=[0];let r,i,o,s,l;const u=e.length;for(r=0;r<u;r++){const d=e[r];if(d!==0){if(i=n[n.length-1],e[i]<d){t[r]=i,n.push(r);continue}for(o=0,s=n.length-1;o<s;)l=o+s>>1,e[n[l]]<d?o=l+1:s=l;d<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,s=n[o-1];o-- >0;)n[o]=s,s=t[s];return n}function SL(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:SL(t)}function Tk(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function EL(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?EL(t.subTree):null}const Ik=e=>e.__isSuspense;let V4=0;const Bee={name:"Suspense",__isSuspense:!0,process(e,t,n,r,i,o,s,l,u,d){if(e==null)Fee(t,n,r,i,o,s,l,u,d);else{if(o&&o.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}zee(e,t,n,r,i,s,l,u,d)}},hydrate:Uee,normalize:Vee},jee=Bee;function A1(e,t){const n=e.props&&e.props[t];Or(n)&&n()}function Fee(e,t,n,r,i,o,s,l,u){const{p:d,o:{createElement:f}}=u,p=f("div"),m=e.suspense=AL(e,i,r,t,p,n,o,s,l,u);d(null,m.pendingBranch=e.ssContent,p,null,r,m,o,s),m.deps>0?(A1(e,"onPending"),A1(e,"onFallback"),d(null,e.ssFallback,t,n,r,null,o,s),J0(m,e.ssFallback)):m.resolve(!1,!0)}function zee(e,t,n,r,i,o,s,l,{p:u,um:d,o:{createElement:f}}){const p=t.suspense=e.suspense;p.vnode=t,t.el=e.el;const m=t.ssContent,y=t.ssFallback,{activeBranch:b,pendingBranch:k,isInFallback:S,isHydrating:x}=p;if(k)p.pendingBranch=m,Mu(k,m)?(u(k,m,p.hiddenContainer,null,i,p,o,s,l),p.deps<=0?p.resolve():S&&(x||(u(b,y,n,r,i,null,o,s,l),J0(p,y)))):(p.pendingId=V4++,x?(p.isHydrating=!1,p.activeBranch=k):d(k,i,p),p.deps=0,p.effects.length=0,p.hiddenContainer=f("div"),S?(u(null,m,p.hiddenContainer,null,i,p,o,s,l),p.deps<=0?p.resolve():(u(b,y,n,r,i,null,o,s,l),J0(p,y))):b&&Mu(b,m)?(u(b,m,n,r,i,p,o,s,l),p.resolve(!0)):(u(null,m,p.hiddenContainer,null,i,p,o,s,l),p.deps<=0&&p.resolve()));else if(b&&Mu(b,m))u(b,m,n,r,i,p,o,s,l),J0(p,m);else if(A1(t,"onPending"),p.pendingBranch=m,m.shapeFlag&512?p.pendingId=m.component.suspenseId:p.pendingId=V4++,u(null,m,p.hiddenContainer,null,i,p,o,s,l),p.deps<=0)p.resolve();else{const{timeout:T,pendingId:C}=p;T>0?setTimeout(()=>{p.pendingId===C&&p.fallback(y)},T):T===0&&p.fallback(y)}}function AL(e,t,n,r,i,o,s,l,u,d,f=!1){const{p,m,um:y,n:b,o:{parentNode:k,remove:S}}=d;let x;const T=Hee(e);T&&t&&t.pendingBranch&&(x=t.pendingId,t.deps++);const C=e.props?vk(e.props.timeout):void 0,I=o,D={vnode:e,parent:t,parentComponent:n,namespace:s,container:r,hiddenContainer:i,deps:0,pendingId:V4++,timeout:typeof C=="number"?C:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!f,isHydrating:f,isUnmounted:!1,effects:[],resolve(P=!1,V=!1){const{vnode:ee,activeBranch:F,pendingBranch:H,pendingId:te,effects:M,parentComponent:Z,container:L,isInFallback:W}=D;let U=!1;if(D.isHydrating)D.isHydrating=!1;else if(!P){U=F&&H.transition&&H.transition.mode==="out-in";let re=!1;U&&(F.transition.afterLeave=()=>{te===D.pendingId&&(m(H,L,o===I&&!re?b(F):o,0),_1(M),W&&ee.ssFallback&&(ee.ssFallback.el=null))}),F&&!D.isFallbackMountPending&&(k(F.el)===L&&(o=b(F),re=!0),y(F,Z,D,!0),!U&&W&&ee.ssFallback&&js(()=>ee.ssFallback.el=null,D)),U||m(H,L,o,0)}D.isFallbackMountPending=!1,J0(D,H),D.pendingBranch=null,D.isInFallback=!1;let q=D.parent,Q=!1;for(;q;){if(q.pendingBranch){for(let re=0;re<M.length;re++)q.effects.push(M[re]);Q=!0;break}q=q.parent}!Q&&!U&&_1(M),D.effects=[],T&&t&&t.pendingBranch&&x===t.pendingId&&(t.deps--,t.deps===0&&!V&&t.resolve()),A1(ee,"onResolve")},fallback(P){if(!D.pendingBranch)return;const{vnode:V,activeBranch:ee,parentComponent:F,container:H,namespace:te}=D;A1(V,"onFallback");const M=b(ee),Z=()=>{D.isFallbackMountPending=!1,D.isInFallback&&(p(null,P,H,M,F,null,te,l,u),J0(D,P))},L=P.transition&&P.transition.mode==="out-in";L&&(D.isFallbackMountPending=!0,ee.transition.afterLeave=Z),D.isInFallback=!0,y(ee,F,null,!0),L||Z()},move(P,V,ee){D.activeBranch&&m(D.activeBranch,P,V,ee),D.container=P},next(){return D.activeBranch&&b(D.activeBranch)},registerDep(P,V,ee){const F=!!D.pendingBranch;F&&D.deps++;const H=P.vnode.el;P.asyncDep.catch(te=>{Eg(te,P,0)}).then(te=>{if(P.isUnmounted||D.isUnmounted||D.pendingId!==P.suspenseId)return;R1(),P.asyncResolved=!0;const{vnode:M}=P;H4(P,te,!1),H&&(M.el=H);const Z=!H&&P.subTree.el;V(P,M,k(H||P.subTree.el),H?null:b(P.subTree),D,s,ee),Z&&(M.placeholder=null,S(Z)),eC(P,M.el),F&&--D.deps===0&&D.resolve()})},unmount(P,V){D.isUnmounted=!0,D.activeBranch&&y(D.activeBranch,n,P,V),D.pendingBranch&&y(D.pendingBranch,n,P,V)}};return D}function Uee(e,t,n,r,i,o,s,l,u){const d=t.suspense=AL(t,r,n,e.parentNode,document.createElement("div"),null,i,o,s,l,!0),f=u(e,d.pendingBranch=t.ssContent,n,d,o,s);return d.deps===0&&d.resolve(!1,!0),f}function Vee(e){const{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=A8(r?n.default:n),e.ssFallback=r?A8(n.fallback):$o(ms)}function A8(e){let t;if(Or(e)){const n=vg&&e._c;n&&(e._d=!1,T1()),e=e(),n&&(e._d=!0,t=Ka,tC())}return nr(e)&&(e=See(e)),e=Ql(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function TL(e,t){t&&t.pendingBranch?nr(e)?t.effects.push(...e):t.effects.push(e):_1(e)}function J0(e,t){e.activeBranch=t;const{vnode:n,parentComponent:r}=e;let i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,eC(r,i))}function Hee(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const zs=Symbol.for("v-fgt"),nh=Symbol.for("v-txt"),ms=Symbol.for("v-cmt"),$p=Symbol.for("v-stc"),rh=[];let Ka=null;function T1(e=!1){rh.push(Ka=e?null:[])}function tC(){rh.pop(),Ka=rh[rh.length-1]||null}let vg=1;function I1(e,t=!1){vg+=e,e<0&&Ka&&t&&(Ka.hasOnce=!0)}function IL(e){return e.dynamicChildren=vg>0?Ka||W0:null,tC(),vg>0&&Ka&&Ka.push(e),e}function $ee(e,t,n,r,i,o){return IL(y5(e,t,n,r,i,o,!0))}function Rk(e,t,n,r,i){return IL($o(e,t,n,r,i,!0))}function ah(e){return e?e.__v_isVNode===!0:!1}function Mu(e,t){return e.type===t.type&&e.key===t.key}function Gee(e){}const RL=({key:e})=>e??null,Dx=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Mi(e)||As(e)||Or(e)?{i:Ta,r:e,k:t,f:!!n}:e:null);function y5(e,t=null,n=null,r=0,i=null,o=e===zs?0:1,s=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,t
vendor: 3,934 bytes, line 505
505ype:e,props:t,key:t&&RL(t),ref:t&&Dx(t),scopeId:W_,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Ta};return l?(Ok(u,n),o&128&&e.normalize(u)):n&&(u.shapeFlag|=Mi(n)?8:16),vg>0&&!s&&Ka&&(u.patchFlag>0||o&6)&&u.patchFlag!==32&&Ka.push(u),u}const $o=qee;function qee(e,t=null,n=null,r=0,i=null,o=!1){if((!e||e===sL)&&(e=ms),ah(e)){const l=Vd(e,t,!0);return n&&Ok(l,n),vg>0&&!o&&Ka&&(l.shapeFlag&6?Ka[Ka.indexOf(e)]=l:Ka.push(l)),l.patchFlag=-2,l}if(nte(e)&&(e=e.__vccOpts),t){t=OL(t);let{class:l,style:u}=t;l&&!Mi(l)&&(t.class=qy(l)),Vi(u)&&(y2(u)&&!nr(u)&&(u=qi({},u)),t.style=Gy(u))}const s=Mi(e)?1:Ik(e)?128:K_(e)?64:Vi(e)?4:Or(e)?2:0;return y5(e,t,n,r,i,s,o,!0)}function OL(e){return e?y2(e)||mL(e)?qi({},e):e:null}function Vd(e,t,n=!1,r=!1){const{props:i,ref:o,patchFlag:s,children:l,transition:u}=e,d=t?ML(i||{},t):i,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&RL(d),ref:t&&t.ref?n&&o?nr(o)?o.concat(Dx(t)):[o,Dx(t)]:Dx(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==zs?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vd(e.ssContent),ssFallback:e.ssFallback&&Vd(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&r&&sh(f,u.clone(f)),f}function v5(e=" ",t=0){return $o(nh,null,e,t)}function Wee(e,t){const n=$o($p,null,e);return n.staticCount=t,n}function NL(e="",t=!1){return t?(T1(),Rk(ms,null,e)):$o(ms,null,e)}function Ql(e){return e==null||typeof e=="boolean"?$o(ms):nr(e)?$o(zs,null,e.slice()):ah(e)?jf(e):$o(nh,null,String(e))}function jf(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vd(e)}function Ok(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(nr(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Ok(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!mL(t)?t._ctx=Ta:i===3&&Ta&&(Ta.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Or(t)){if(r&65){Ok(e,{default:t});return}t={default:t,_ctx:Ta},n=32}else t=String(t),r&64?(n=16,t=[v5(t)]):n=8;e.children=t,e.shapeFlag|=n}function ML(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=qy([t.class,r.class]));else if(i==="style")t.style=Gy([t.style,r.style]);else if(m2(i)){const o=t[i],s=r[i];s&&o!==s&&!(nr(o)&&o.includes(s))?t[i]=o?[].concat(o,s):s:s==null&&o==null&&!M_(i)&&(t[i]=s)}else i!==""&&(t[i]=r[i])}return t}function Zl(e,t,n,r=null){Rc(e,t,7,[n,r])}const Kee=cL();let Yee=0;function DL(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||Kee,o={uid:Yee++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new YA(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:yL(r,i),emitsOptions:dL(r,i),emit:null,emitted:null,propsDefaults:_i,inheritAttrs:r.inheritAttrs,ctx:_i,data:_i,props:_i,attrs:_i,slots:_i,refs:_i,setupState:_i,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=_ee.bind(null,o),e.ce&&e.ce(o),o}let Aa=null;const Al=()=>Aa||Ta;let Nk,Gp;{const e=ug(),t=(n,r)=>{let i;
505return(i=e[n])||(i=e[n]=[]),i.push(r),o=>{i.length>1?i.forEach(s=>s(o)):i[0](o)}};Nk=t("__VUE_INSTANCE_SETTERS__",n=>Aa=n),Gp=t("__VUE_SSR_SETTERS__",n=>bg=n)}const Wy=e=>{const t=Aa;return Nk(e),e.scope.on(),()=>{e.scope.off(),Nk(t)}},R1=()=>{Aa&&Aa.scope.off(),Nk(null)};function LL(e){return e.vnode.shapeFlag&4}let bg=!1;function PL(e,t=!1,n=!1){t&&Gp(t);const{props:r,children:i}=e.vnode,o=LL(e);Iee(e,r,o,t),Mee(e,i,n||t);const s=o?Xee(e,t):void 0;return t&&Gp(!1),s}function Xee(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,j4);const{setup:r}=n;if(r){Fd();const i=e.setupContext=r.length>1?jL(e):null,o=Wy(e),s=Sg(r,e,0,[e.props,i]),l=KA(s);if(zd(),o(),(l||e.sp)&&!th(e)&&a5(e),l){if(s.then(R1,R1),t)return s.then(u=>{Gp(!0);try{H4(e,u,t)}finally{Gp(!1)}}).catch(u=>{Eg(u,e,0)});e.asyncDep=s}else H4(e,s,t)}else BL(e,t)}function H4(e,t,n){Or(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Vi(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=JA(t)),BL(e,n)}let Mk,$4;function Zee(e){Mk=e,$4=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,tee))}}const Qee=()=>!Mk;function BL(e,t,n){const r=e.type;if(!e.render){if(!t&&Mk&&!r.render){const i=r.template||__VUE_OPTIONS_API__&&h5(e).template;if(i){const{isCustomElement:o,compilerOptions:s}=e.appContext.config,{delimiters:l,compilerOptions:u}=r,d=qi(qi({isCustomElement:o,delimiters:l},s),u);r.render=Mk(i,d)}}e.render=r.render||Ec,$4&&$4(e)}if(__VUE_OPTIONS_API__){const i=Wy(e);Fd();try{mee(e)}finally{zd(),i()}}}const Jee={get(e,t){return Wa(e,"get",""),e[t]}};function jL(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Jee),slots:e.slots,emit:e.emit,expose:t}}function _2(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(JA(I9(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in e1)return e1[n](e)},has(t,n){return n in t||n in e1}})):e.proxy}const ete=/(?:^|[-_])\w/g,tte=e=>e.replace(ete,t=>t.toUpperCase()).replace(/[-_]/g,"");function Dk(e,t=!0){return Or(e)?e.displayName||e.name:e.name||t&&e.__name}function FL(e,t,n=!1){let r=Dk(t);if(!r&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&e){const i=o=>{for(const s in o)if(o[s]===t)return s};r=i(e.components)||e.parent&&i(e.parent.type.components)||i(e.appContext.components)}return r?tte(r):n?"App":"Anonymous"}function nte(e){return Or(e)&&"__vccOpts"in e}const zL=(e,t)=>VQ(e,t,bg);function UL(e,t,n){try{I1(-1);const r=arguments.length;return r===2?Vi(t)&&!nr(t)?ah(t)?$o(e,null,[t]):$o(e,t):$o(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ah(n)&&(n=[n]),$o(e,t,n))}finally{I1(1)}}function rte(){}function ite(e,t,n,r){const i=n[r];if(i&&VL(i,e))return i;const o=t();return o.memo=e.slice(),o.cacheIndex=r,n[r]=o}function VL(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let r=0;r<n.length;r++)if(ha(n[r],t[r]))return!1;return vg>0&&Ka&&Ka.push(e),!0}const G4="3.5.41",ote=Ec,ste=tJ,ate=Nu,lte=t5,cte={createComponentInstance:DL,setupComponent:PL,renderComponentRoot:Mx,setCurrentRenderingInstance:S1,isVNode:ah,normalizeVNode:Ql,getComponentPublicInstance:_2,ensureValidVNode:f5,pushWarningContext:WQ,popWarningContext:KQ},ute=cte,dte=null,fte=null,hte=null;/**
506* @vue/runtime-dom v3.5.41
507* (c) 2018-present Yuxi (Evan) You and Vue contributors
508* @license MIT
509**/let q4;const T8=typeof window<"u"&&window.trustedTypes;if(T8)try{q4=T8.createPolicy("vue",{createHTML:e=>e})}catch{}const HL=q4?e=>q4.createHTML(e):e=>e,pte="http://www.w3.org/2000/svg",mte="http://www.w3.org/1998/Math/MathML",Bf=typeof document<"u"?document:null,I8=Bf&&Bf.createElement("template"),$L={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const i=t==="svg"?Bf.createElementNS(pte,e):t==="mathml"?Bf.createElementNS(mte,e):n?Bf.createElement(e,{is:n}):Bf.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>Bf.createTextNode(e),createComment:e=>Bf.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Bf.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,o){const s=n?n.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===o||!(i=i.nextSibling)););else{I8.innerHTML=HL(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const l=I8.content;if(r==="svg"||r==="mathml"){const u=l.firstChild;for(;u.firstChild;)l.appendChild(u.firstChild);l.removeChild(u)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},fp="transition",rb="animation",Ay=Symbol("_vtc"),GL={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},qL=qi({},o5,GL),gte=e=>(e.displayName="Transition",e.props=qL,e),yte=gte((e,{slots:t})=>UL(K9,WL(e),t)),Bm=(e,t=[])=>{nr(e)?e.forEach(n=>n(...t)):e&&e(...t)},R8=e=>e?nr(e)?e.some(t=>t.length>1):e.length>1:!1;function WL(e){const t={};for(const M in e)M in GL||(t[M]=e[M]);if(e.css===!1)return t;const{name:n="v",type:r,duration:i,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:u=o,appearActiveClass:d=s,appearToClass:f=l,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:m=`${n}-leave-active`,leaveToClass:y=`${n}-leave-to`}=e,b=vte(i),k=b&&b[0],S=b&&b[1],{onBeforeEnter:x,onEnter:T,onEnterCancelled:C,onLeave:I,onLeaveCancelled:D,onBeforeAppear:P=x,onAppear:V=T,onAppearCancelled:ee=C}=t,F=(M,Z,L,W)=>{M._enterCancelled=W,vp(M,Z?f:l),vp(M,Z?d:s),L&&L()},H=(M,Z)=>{M._isLeaving=!1,vp(M,p),vp(M,y),vp(M,m),Z&&Z()},te=M=>(Z,L)=>{const W=M?V:T,U=()=>F(Z,M,L);Bm(W,[Z,U]),O8(()=>{vp(Z,M?u:o),gd(Z,M?f:l),R8(W)||N8(Z,r,k,U)})};return qi(t,{onBeforeEnter(M){Bm(x,[M]),gd(M,o),gd(M,s)},onBeforeAppear(M){Bm(P,[M]),gd(M,u),gd(M,d)},onEnter:te(!1),onAppear:te(!0),onLeave(M,Z){M._isLeaving=!0;const L=()=>H(M,Z);gd(M,p),M._enterCancelled?(gd(M,m),W4(M)):(W4(M),gd(M,m)),O8(()=>{M._isLeaving&&(vp(M,p),gd(M,y),R8(I)||N8(M,r,S,L))}),Bm(I,[M,L])},onEnterCancelled(M){F(M,!1,void 0,!0),Bm(C,[M])},onAppearCancelled(M){F(M,!0,void 0,!0),Bm(ee,[M])},onLeaveCancelled(M){H(M),Bm(D,[M])}})}function vte(e){if(e==null)return null;if(Vi(e))return[ZS(e.enter),ZS(e.leave)];{const t=ZS(e);return[t,t]}}function ZS(e){return vk(e)}function gd(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Ay]||(e[Ay]=new Set)).add(t)}function vp(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Ay];n&&(n.delete(t),n.size||(e[Ay]=void 0))}function O8(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let bte=0;function N8(e,t,n,r){const i=e._endId=++bte,o=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:s,timeout:l,propCount:u}=KL(e,t);if(!s)return r();const d=s+"end";let f=0;const p=()=>{e.removeEventListener(d,m),o()},m=y=>{y.target===e&&++f>=u&&p()};setTimeout(()=>{f<u&&p()},l+1),e.addEventListener(d,m)}function KL(e,t){const n=window.getComputedStyle(e),r=b=>(n[b]||"").split(", "),i=r(`${fp}Delay`),o=r(`${fp}Duration`),s=M8(i,o),l=r(`${rb}Delay`),u=r(`${rb}Duration`),d=M8(l,u);let f=null,p=0,m=0;t===fp?s>0&&(f=fp,p=s,m=o.length):t===rb?d>0&&(f=rb,p=d,m=u.length):(p=Math.max(s,d),f=p>0?s>d?fp:rb:null,m=f?f===fp?o.length:u.length:0);const y=f===fp&&/\b(?:transform|all)(?:,|$)/.test(r(`${fp}Property`).toString());return{type:f,timeout:p,propCount:m,hasTransform:y}}function M8(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>D8(n)+D8(e[r])))}function D8(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function W4(e){return(e?e.ownerDocument:document).body.offsetHeight}function wte(e,t,n){const r=e[Ay];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Lk=Symbol("_vod"),b5=Symbol("_vsh"),YL={name:"show",beforeMount(e,{value:t},{transition:n}){e[Lk]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):ib(e,t)}
vendor: 8,840 bytes, line 509
509,mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),ib(e,!0),r.enter(e)):r.leave(e,()=>{ib(e,!1)}):ib(e,t))},beforeUnmount(e,{value:t}){ib(e,t)}};function ib(e,t){e.style.display=t?e[Lk]:"none",e[b5]=!t}function xte(){YL.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const XL=Symbol("");function kte(e){const t=Al();if(!t)return;const n=t.ut=(i=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(o=>Pk(o,i))},r=()=>{const i=e(t.proxy);t.ce?Pk(t.ce,i):K4(t.subTree,i),n(i)};c5(()=>{_1(r)}),x2(()=>{Z0(r,Ec,{flush:"post"});const i=new MutationObserver(r);i.observe(t.subTree.el.parentNode,{childList:!0}),k2(()=>i.disconnect())})}function K4(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{K4(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Pk(e.el,t);else if(e.type===zs)e.children.forEach(n=>K4(n,t));else if(e.type===$p){let{el:n,anchor:r}=e;for(;n&&(Pk(n,t),n!==r);)n=n.nextSibling}}function Pk(e,t){if(e.nodeType===1){const n=e.style;let r="";for(const i in t){const o=d9(t[i]);n.setProperty(`--${i}`,o),r+=`--${i}: ${o};`}n[XL]=r}}const _te=/(?:^|;)\s*display\s*:/;function Cte(e,t,n){const r=e.style,i=Mi(n);let o=!1;if(n&&!i){if(t)if(Mi(t))for(const s of t.split(";")){const l=s.slice(0,s.indexOf(":")).trim();n[l]==null&&Sb(r,l,"")}else for(const s in t)n[s]==null&&Sb(r,s,"");for(const s in n){s==="display"&&(o=!0);const l=n[s];l!=null?Ete(e,s,!Mi(t)&&t?t[s]:void 0,l)||Sb(r,s,l):Sb(r,s,"")}}else if(i){if(t!==n){const s=r[XL];s&&(n+=";"+s),r.cssText=n,o=_te.test(n)}}else t&&e.removeAttribute("style");Lk in e&&(e[Lk]=o?r.display:"",e[b5]&&(r.display="none"))}const L8=/\s*!important$/;function Sb(e,t,n){if(nr(n))n.forEach(r=>Sb(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Ste(e,t);L8.test(n)?e.setProperty(_l(r),n.replace(L8,""),"important"):e[r]=n}}const P8=["Webkit","Moz","ms"],QS={};function Ste(e,t){const n=QS[t];if(n)return n;let r=Vs(t);if(r!=="filter"&&r in e)return QS[t]=r;r=g2(r);for(let i=0;i<P8.length;i++){const o=P8[i]+r;if(o in e)return QS[t]=o}return t}function Ete(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Mi(r)&&n===r}const B8="http://www.w3.org/1999/xlink";function j8(e,t,n,r,i,o=rQ(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(B8,t.slice(6,t.length)):e.setAttributeNS(B8,t,n):n==null||o&&!j_(n)?e.removeAttribute(t):e.setAttribute(t,o?"":Ic(n)?String(n):n)}function F8(e,t,n,r,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?HL(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const l=o==="OPTION"?e.getAttribute("value")||"":e.value,u=n==null?e.type==="checkbox"?"on":"":String(n);(l!==u||!("_value"in e))&&(e.value=u),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=j_(n):n==null&&l==="string"?(n="",s=!0):l==="number"&&(n=0,s=!0)}try{e[t]=n}catch{}s&&e.removeAttribute(i||t)}function Xf(e,t,n,r){e.addEventListener(t,n,r)}function Ate(e,t,n,r){e.removeEventListener(t,n,r)}const z8=Symbol("_vei");function Tte(e,t,n,r,i=null){const o=e[z8]||(e[z8]={}),s=o[t];if(r&&s)s.value=r;else{const[l,u]=Ote(t);if(r){const d=o[t]=Dte(r,i);Xf(e,l,d,u)}else s&&(Ate(e,l,s,u),o[t]=void 0)}}const Ite=/(Once|Passive|Capture)$/,Rte=/^on:?(?:Once|Passive|Capture)$/;function Ote(e){let t,n;for(;(n=e.match(Ite))&&!Rte.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):_l(e.slice(2)),t]}let JS=0;const Nte=Promise.resolve(),Mte=()=>JS||(Nte.then(()=>JS=0),JS=Date.now());function Dte(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;const i=n.value;if(nr(i)){const o=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{o.call(r),r._stopped=!0};const s=i.slice(),l=[r];for(let u=0;u<s.length&&!r._stopped;u++){const d=s[u];d&&Rc(d,t,5,l)}}else Rc(i,t,5,[r])};return n.value=e,n.attached=Mte(),n}const U8=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ZL=(e,t,n,r,i,o)=>{const s=i==="svg";t==="class"?wte(e,r,s):t==="style"?Cte(e,n,r):m2(t)?M_(t)||Tte(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Lte(e,t,r,s))?(F8(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&j8(e,t,r,s,o,t!=="value")):e._isVueCE&&(Pte(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Mi(r)))?F8(e,Vs(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),j8(e,t,r,s))};function Lte(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&U8(t)&&Or(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return U8(t)&&Mi(n)?!1:t in e}function Pte(e,t){const n=e._def.props;if(!n)return!1;const r=Vs(t);return Array.isArray(n)?n.some(i=>Vs(i)===r):Object.keys(n).some(i=>Vs(i)===r)}const V8={};function QL(e,t,n){let r=s5(e,t);D_(r)&&(r=qi({},r,t));class i extends nC{constructor(s){super(r,s,n)}}return i.def=r,i}const Bte=((e,t)=>QL(e,t,dP)),jte=typeof HTMLElement<"u"?HTMLElement:class{};class nC extends jte{constructor(t,n={},r=Y4){super(),this._def=t,this._props=n,this._createApp=r,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&r!==Y4?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(qi({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof nC){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{if(this._pendingResolve=void 0,this.isConnected)return this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,G_(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return this._pendingResolve;for(let r=0;r<this.attributes.length;r++)this._setAttr(this.attributes[r].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(r,i=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:o,styles:s}=r;let l;if(o&&!nr(o))for(const u in o){const d=o[u];(d===Number||d&&d.type===Number)&&(u in this._props&&(this._props[u]=vk(this._props[u])),(l||(l=Object.create(null)))[Vs(u)]=!0)}this._numberProps=l,this._resolveProps(r),this.shadowRoot&&this._applyStyles(s),this._mount(r)},n=this._def.__asyncLoader;if(n)return this._pendingResolve=n().then(r=>{r.configureApp=this._def.configureApp,t(this._def=r,!0)}),this._pendingResolve;t(this._def)}_mount(t){__VUE_PROD_DEVTOOLS__&&!t.name&&(t.name="VueElement"),this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const r in n)Ui(this,r)||Object.defineProperty(this,r,{get:()=>v2(n[r])})}_resolveProps(t){const{props:n}=t,r=nr(n)?n:Object.keys(n||{});for(const i of Object.keys(this))i[0]!=="_"&&r.includes(i)&&this._setProp(i,this[i]);for(const i of r.map(Vs))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(o){this._setProp(i,o,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let r=n?this.getAttribute(t):V8;const i=Vs(t);n&&this._numberProps&&this._numberProps[i]&&(r=vk(r)),this._setProp(i,r,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,r=!0,i=!1){if(n!==this._props[t]&&(this._dirty=!0,n===V8?delete this._props[t]:(this._props[t]=n,t==="
509key"&&this._app&&(this._app._ceVNode.key=n)),i&&this._instance&&this._update(),r)){const o=this._ob;o&&(this._processMutations(o.takeRecords()),o.disconnect()),n===!0?this.setAttribute(_l(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(_l(t),n+""):n||this.removeAttribute(_l(t)),o&&o.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),uP(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=$o(this._def,qi(t,this._props));return this._instance||(n.ce=r=>{this._instance=r,r.ce=this,r.isCE=!0;const i=(o,s)=>{this.dispatchEvent(new CustomEvent(o,D_(s[0])?qi({detail:s},s[0]):{detail:s}))};r.emit=(o,...s)=>{i(o,s),_l(o)!==o&&i(_l(o),s)},this._setParent()}),n}_applyStyles(t,n,r){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const i=this._nonce,o=this.shadowRoot,s=r?this._getStyleAnchor(r)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(o);let l=null;for(let u=t.length-1;u>=0;u--){const d=document.createElement("style");i&&d.setAttribute("nonce",i),d.textContent=t[u],o.insertBefore(d,l||s),l=d,u===0&&(r||this._styleAnchors.set(this._def,d),n&&this._styleAnchors.set(n,d))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const r=t.childNodes[n];if(!(r instanceof HTMLStyleElement))return r}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const r=n.nodeType===1&&n.getAttribute("slot")||"default";(t[r]||(t[r]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let r=0;r<t.length;r++){const i=t[r],o=i.getAttribute("name")||"default",s=this._slots[o],l=i.parentNode;if(s)for(const u of s){if(n&&u.nodeType===1){const d=n+"-s",f=document.createTreeWalker(u,1);u.setAttribute(d,"");let p;for(;p=f.nextNode();)p.setAttribute(d,"")}l.insertBefore(u,i)}else for(;i.firstChild;)l.insertBefore(i.firstChild,i);l.removeChild(i)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const r of t){const i=r.querySelectorAll("slot");for(let o=0;o<i.length;o++)n.add(i[o])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function JL(e){const t=Al(),n=t&&t.ce;return n||null}function Fte(){const e=JL();return e&&e.shadowRoot}function zte(e="$style"){{const t=Al();if(!t)return _i;const n=t.type.__cssModules;if(!n)return _i;const r=n[e];return r||_i}}const eP=new WeakMap,tP=new WeakMap,Bk=Symbol("_moveCb"),H8=Symbol("_enterCb"),Ute=e=>(delete e.props.mode,e),Vte=Ute({name:"TransitionGroup",props:qi({},qL,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Al(),r=i5();let i,o;return Z_(()=>{if(!i.length)return;const s=e.moveClass||`${e.name||"v"}-move`;if(!Wte(i[0].el,n.vnode.el,s)){i=[];return}i.forEach($te),i.forEach(Gte);const l=i.filter(qte);W4(n.vnode.el),l.forEach(u=>{const d=u.el,f=d.style;gd(d,s),f.transform=f.webkitTransform=f.transitionDuration="";const p=d[Bk]=m=>{m&&m.target!==d||(!m||m.propertyName.endsWith("transform"))&&(d.removeEventListener("transitionend",p),d[Bk]=null,vp(d,s))};d.addEventListener("transitionend",p)}),i=[]}
vendor: 7,047 bytes, lines 509-513
509),()=>{const s=xi(e),l=WL(s);let u=s.tag||zs;if(i=[],o)for(let d=0;d<o.length;d++){const f=o[d];f.el&&f.el instanceof Element&&!f.el[b5]&&(i.push(f),sh(f,Ey(f,l,r,n)),eP.set(f,nP(f.el)))}o=t.default?Y_(t.default()):[];for(let d=0;d<o.length;d++){const f=o[d];f.key!=null&&sh(f,Ey(f,l,r,n))}return $o(u,null,o)}}}),Hte=Vte;function $te(e){const t=e.el;t[Bk]&&t[Bk](),t[H8]&&t[H8]()}function Gte(e){tP.set(e,nP(e.el))}function qte(e){const t=eP.get(e),n=tP.get(e),r=t.left-n.left,i=t.top-n.top;if(r||i){const o=e.el,s=o.style,l=o.getBoundingClientRect();let u=1,d=1;return o.offsetWidth&&(u=l.width/o.offsetWidth),o.offsetHeight&&(d=l.height/o.offsetHeight),(!Number.isFinite(u)||u===0)&&(u=1),(!Number.isFinite(d)||d===0)&&(d=1),Math.abs(u-1)<.01&&(u=1),Math.abs(d-1)<.01&&(d=1),s.transform=s.webkitTransform=`translate(${r/u}px,${i/d}px)`,s.transitionDuration="0s",e}}function nP(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function Wte(e,t,n){const r=e.cloneNode(),i=e[Ay];i&&i.forEach(l=>{l.split(/\s+/).forEach(u=>u&&r.classList.remove(u))}),n.split(/\s+/).forEach(l=>l&&r.classList.add(l)),r.style.display="none";const o=t.nodeType===1?t:t.parentNode;o.appendChild(r);const{hasTransform:s}=KL(r);return o.removeChild(r),s}const Yp=e=>{const t=e.props["onUpdate:modelValue"]||!1;return nr(t)?n=>Y0(t,n):t};function Kte(e){e.target.composing=!0}function $8(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Sc=Symbol("_assign"),$w=Symbol("_initialValue");function e3(e,t,n){return t&&(e=e.trim()),n&&(e=B_(e)),e}const jk={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type==="text"?e[$w]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[$w]=e.defaultValue.replace(/\r\n?/g,`
510`))),e[Sc]=Yp(i);const o=r||i.props&&i.props.type==="number";Xf(e,t?"change":"input",s=>{s.target.composing||e[Sc](e3(e.value,n,o))}),(n||o)&&Xf(e,"change",()=>{e.value=e3(e.value,n,o)}),t||(Xf(e,"compositionstart",Kte),Xf(e,"compositionend",$8),Xf(e,"change",$8))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){const i=t??"",o=e[$w];delete e[$w],o!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==o?e[Sc](e3(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:o}},s){if(e[Sc]=Yp(s),e.composing)return;const l=(o||e.type==="number")&&!/^0\d/.test(e.value)?B_(e.value):e.value,u=t??"";if(l===u)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===u)||(e.value=u)}},w5={deep:!0,created(e,t,n){e[Sc]=Yp(n),Xf(e,"change",()=>{const r=e._modelValue,i=Ty(e),o=e.checked,s=e[Sc];if(nr(r)){const l=F_(r,i),u=l!==-1;if(o&&!u)s(r.concat(i));else if(!o&&u){const d=[...r];d.splice(l,1),s(d)}}else if(Cg(r)){const l=new Set(r);o?l.add(i):l.delete(i),s(l)}else s(iP(e,o))})},mounted:G8,beforeUpdate(e,t,n){e[Sc]=Yp(n),G8(e,t,n)}};function G8(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(nr(t))i=F_(t,r.props.value)>-1;else if(Cg(t))i=t.has(r.props.value);else{if(t===n)return;i=oh(t,iP(e,!0))}e.checked!==i&&(e.checked=i)}const x5={created(e,{value:t},n){e.checked=oh(t,n.props.value),e[Sc]=Yp(n),Xf(e,"change",()=>{e[Sc](Ty(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Sc]=Yp(r),t!==n&&(e.checked=oh(t,r.props.value))}},rP={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Xf(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?B_(Ty(o)):Ty(o));e[Sc](e.multiple?Cg(e._modelValue)?new Set(i):i:i[0]),e._assigning=!0,G_(()=>{e._assigning=!1})}),e[Sc]=Yp(r)},mounted(e,{value:t}){q8(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Sc]=Yp(n)},updated(e,{value:t}){e._assigning||q8(e,t)}};function q8(e,t){const n=e.multiple,r=nr(t);if(!(n&&!r&&!Cg(t))){for(let i=0,o=e.options.length;i<o;i++){const s=e.options[i],l=Ty(s);if(n)if(r){const u=typeof l;u==="string"||u==="number"?s.selected=t.some(d=>String(d)===String(l)):s.selected=F_(t,l)>-1}else s.selected=t.has(l);else if(oh(Ty(s),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ty(e){return"_value"in e?e._value:e.value}function iP(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const oP={created(e,t,n){Gw(e,t,n,null,"created")},mounted(e,t,n){Gw(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){Gw(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){Gw(e,t,n,r,"updated")}};function sP(e,t){switch(e){case"SELECT":return rP;case"TEXTAREA":return jk;default:switch(t){case"checkbox":return w5;case"radio":return x5;default:return jk}}}function Gw(e,t,n,r,i){const s=sP(e.tagName,n.props&&n.props.type)[i];s&&s(e,t,n,r)}function Yte(){jk.getSSRProps=({value:e})=>({value:e}),x5.getSSRProps=({value:e},t)=>{if(t.props&&oh(t.props.value,e))return{checked:!0}},w5.getSSRProps=({value:e},t)=>{if(nr(e)){if(t.props&&F_(e,t.props.value)>-1)return{checked:!0}}else if(Cg(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},oP.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=sP(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const Xte=["ctrl","shift","alt","meta"],Zte={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Xte.some(n=>e[`${n}Key`]&&!t.includes(n))},Qte=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((i,...o)=>{for(let s=0;s<t.length;s++){const l=Zte[t[s]];if(l&&l(i,t))return}return e(i,...o)}))},Jte={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ene=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(i=>{if(!("key"in i))return;const o=_l(i.key);if(t.some(s=>s===o||Jte[s]===o))return e(i)}))},aP=qi({patchProp:ZL},$L);let t1,W8=!1;function lP(){return t1||(t1=xL(aP))}function cP(){return t1=W8?t1:kL(aP),W8=!0,t1}const uP=((...e)=>{lP().render(...e)}),tne=((...e)=>{cP().hydrate(...e)}),Y4=((...e)=>{const t=lP().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=hP(r);if(!i)return;const o=t._component;!Or(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const s=n(i,!1,fP(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t}),dP=((...e)=>{const t=cP().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=hP(r);if(i)return n(i,!0,fP(i))},t});function fP(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function hP(e){return Mi(e)?document.querySelector(e):e}let K8=!1;const nne=()=>{K8||(K8=!0,Yte(),xte())};/**
511* vue v3.5.41
512* (c) 2018-present Yuxi (Evan) You and Vue contributors
513* @license MIT
514**/const rne=()=>{},ine=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:K9,BaseTransitionPropsValidators:o5,Comment:ms,DeprecationTypes:hte,EffectScope:YA,ErrorCodes:eJ,ErrorTypeStrings:ste,Fragment:zs,KeepAlive:GJ,ReactiveEffect:w1,Static:$p,Suspense:jee,Teleport:wJ,Text:nh,TrackOpTypes:HQ,Transition:yte,TransitionGroup:Hte,TriggerOpTypes:$Q,VueElement:nC,assertNumber:JQ,callWithAsyncErrorHandling:Rc,callWithErrorHandling:Sg,camelize:Vs,capitalize:g2,cloneVNode:Vd,compatUtils:fte,compile:rne,computed:zL,createApp:Y4,createBlock:Rk,createCommentVNode:NL,createElementBlock:$ee,createElementVNode:y5,createHydrationRenderer:kL,createPropsRestProxy:hee,createRenderer:xL,createSSRApp:dP,createSlots:QJ,createStaticVNode:Wee,createTextVNode:v5,createVNode:$o,customRef:N9,defineAsyncComponent:HJ,defineComponent:s5,defineCustomElement:QL,defineEmits:ree,defineExpose:iee,defineModel:aee,defineOptions:oee,defineProps:nee,defineSSRCustomElement:Bte,defineSlots:see,devtools:ate,effect:fQ,effectScope:cQ,getCurrentInstance:Al,getCurrentScope:f9,getCurrentWatcher:GQ,getTransitionRawChildren:Y_,guardReactiveProps:OL,h:UL,handleError:Eg,hasInjectionContext:hJ,hydrate:tne,hydrateOnIdle:BJ,hydrateOnInteraction:UJ,hydrateOnMediaQuery:zJ,hydrateOnVisible:FJ,initCustomFormatter:rte,initDirectivesForSSR:nne,inject:Qb,isMemoSame:VL,isProxy:y2,isReactive:eh,isReadonly:Ud,isRef:As,isRuntimeOnly:Qee,isShallow:ec,isVNode:ah,markRaw:I9,mergeDefaults:dee,mergeModels:fee,mergeProps:ML,nextTick:G_,nodeOps:$L,normalizeClass:qy,normalizeProps:nQ,normalizeStyle:Gy,onActivated:Q9,onBeforeMount:tL,onBeforeUnmount:Q_,onBeforeUpdate:c5,onDeactivated:J9,onErrorCaptured:oL,onMounted:x2,onRenderTracked:iL,onRenderTriggered:rL,onScopeDispose:uQ,onServerPrefetch:nL,onUnmounted:k2,onUpdated:Z_,onWatcherCleanup:D9,openBlock:T1,patchProp:ZL,popScopeId:uJ,provide:z9,proxyRefs:JA,pushScopeId:cJ,queuePostFlushCb:_1,reactive:H_,readonly:wk,ref:Zb,registerRuntimeCompiler:Zee,render:uP,renderList:ZJ,renderSlot:JJ,resolveComponent:KJ,resolveDirective:XJ,resolveDynamicComponent:YJ,resolveFilter:dte,resolveTransitionHooks:Ey,setBlockTracking:I1,setDevtoolsHook:lte,setTransitionHooks:sh,shallowReactive:T9,shallowReadonly:OQ,shallowRef:R9,ssrContextKey:U9,ssrUtils:ute,stop:hQ,toDisplayString:c9,toHandlerKey:Kb,toHandlers:eee,toRaw:xi,toRef:zQ,toRefs:BQ,toValue:DQ,transformVNodeArgs:Gee,triggerRef:MQ,unref:v2,useAttrs:uee,useCssModule:zte,useCssVars:kte,useHost:JL,useId:kJ,useModel:kee,useSSRContext:V9,useShadowRoot:Fte,useSlots:cee,useTemplateRef:_J,useTransitionState:i5,vModelCheckbox:w5,vModelDynamic:oP,vModelRadio:x5,vModelSelect:rP,vModelText:jk,vShow:YL,version:G4,warn:ote,watch:Z0,watchEffect:pJ,watchPostEffect:mJ,watchSyncEffect:H9,withAsyncContext:pee,withCtx:r5,withDefaults:lee,withDirectives:fJ,withKeys:ene,withMemo:ite,withModifiers:Qte,withScopeId:dJ},Symbol.toStringTag,{value:"Module"})),Pd=()=>new Map,X4=e=>{const t=Pd();return e.forEach((n,r)=>{t.set(r,n)}),t},Ky=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},one=(e,t)=>{const n=[];for(const[r,i]of e)n.push(t(i,r));return n},sne=(e,t)=>{for(const[n,r]of e)if(t(r,n))return!0;return!1},Iy=()=>new Set,t3=e=>e[e.length-1],Ry=Array.from,k5=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},pP=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},ane=(e,t)=>{const n=new Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},rC=Array.isArray;class lne{constructor(){this._observers=Pd()}on(t,n){return Ky(this._observers,t,Iy).add(n),n}once(t,n){const r=(...i)=>{this.off(t,r),n(...i)};this.on(t,r)}off(t,n){const r=this._observers.get(t);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(t))}emit(t,n){return Ry((this._observers.get(t)||Pd()).values()).forEach(r=>r(...n))}destroy(){this._observers=Pd()}}const lh=Math.floor,Lx=Math.abs,mP=(e,t)=>e<t?e:t,Yy=(e,t)=>e>t?e:t,cne=e=>e!==0?e<0:1/e<0,Y8=1,X8=2,n3=4,r3=8,une=32,gP=64,Fk=128,dne=31,Z8=63,n1=127,fne=2147483647,Q8=Number.MAX_SAFE_INTEGER,J8=Number.MIN_SAFE_INTEGER,hne=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&lh(e)===e),pne=String.fromCharCode,mne=e=>e.toLowerCase(),gne=/^\s*/g,yne=e=>e.replace(gne,""),vne=/([A-Z])/g,eR=(e,t)=>yne(e.replace(vne,n=>`${t}${mne(n)}`)),bne=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=t.codePointAt(i);return r},O1=typeof TextEncoder<"u"?new TextEncoder:null,wne=e=>O1.encode(e),xne=O1?wne:bne;let i3=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});i3&&i3.decode(new Uint8Array).length===1&&(i3=null);const kne=(e,t)=>ane(t,()=>e).join("");class C2{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const _5=()=>new C2,_ne=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},Zf=e=>{const t=new Uint8Array(_ne(e));let n=0;for(let r=0;r<e.bufs.length;r++){const i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},Cne=(e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Yy(n,t)*2),e.cpos=0)},da=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Z4=da,fo=(e,t)=>{for(;t>n1;)da(e,Fk|n1&t),t=lh(t/128);da(e,n1&t)},C5=(e,t)=>{const n=cne(t);for(n&&(t=-t),da(e,(t>Z8?Fk:0)|(n?gP:0)|Z8&t),t=lh(t/64);t>0;)da(e,(t>n1?Fk:0)|n1&t),t=lh(t/128)},Q4=new Uint8Array(3e4),Sne=Q4.length/3,Ene=(e,t)=>{if(t.length<Sne){const n=O1.encodeInto(t,Q4).written||0;fo(e,n);for(let r=0;r<n;r++)da(e,Q4[r])}else xc(e,xne(t))},Ane=(e,t)=>{const n=unescape(encodeURIComponent(t)),r=n.length;fo(e,r);for(let i=0;i<r;i++)da(e,n.codePointAt(i))}
514,ey=O1&&O1.encodeInto?Ene:Ane,S5=(e,t)=>{const n=e.cbuf.length,r=e.cpos,i=mP(n-r,t.length),o=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,o>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Yy(n*2,o)),e.cbuf.set(t.subarray(i)),e.cpos=o)},xc=(e,t)=>{fo(e,t.byteLength),S5(e,t)},E5=(e,t)=>{Cne(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},Tne=(e,t)=>E5(e,4).setFloat32(0,t,!1),Ine=(e,t)=>E5(e,8).setFloat64(0,t,!1),Rne=(e,t)=>E5(e,8).setBigInt64(0,t,!1),tR=new DataView(new ArrayBuffer(4)),One=e=>(tR.setFloat32(0,e),tR.getFloat32(0)===e),N1=(e,t)=>{switch(typeof t){case"string":da(e,119),ey(e,t);break;case"number":hne(t)&&Lx(t)<=fne?(da(e,125),C5(e,t)):One(t)?(da(e,124),Tne(e,t)):(da(e,123),Ine(e,t));break;case"bigint":da(e,122),Rne(e,t);break;case"object":if(t===null)da(e,126);else if(rC(t)){da(e,117),fo(e,t.length);for(let n=0;n<t.length;n++)N1(e,t[n])}else if(t instanceof Uint8Array)da(e,116),xc(e,t);else{da(e,118);const n=Object.keys(t);fo(e,n.length);for(let r=0;r<n.length;r++){const i=n[r];ey(e,i),N1(e,t[i])}}break;case"boolean":da(e,t?120:121);break;default:da(e,127)}};class nR extends C2{constructor(t){super(),this.w=t,this.s=null,this.count=0}write(t){this.s===t?this.count++:(this.count>0&&fo(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const rR=e=>{e.count>0&&(C5(e.encoder,e.count===1?e.s:-e.s),e.count>1&&fo(e.encoder,e.count-2))};class Px{constructor(){this.encoder=new C2,this.s=0,this.count=0}write(t){this.s===t?this.count++:(rR(this),this.count=1,this.s=t)}toUint8Array(){return rR(this),Zf(this.encoder)}}const iR=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);C5(e.encoder,t),e.count>1&&fo(e.encoder,e.count-2)}};class o3{constructor(){this.encoder=new C2,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(iR(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return iR(this),Zf(this.encoder)}}class Nne{constructor(){this.sarr=[],this.s="",this.lensE=new Px}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new C2;return this.sarr.push(this.s),this.s="",ey(t,this.sarr.join("")),S5(t,this.lensE.toUint8Array()),Zf(t)}}const Xp=e=>new Error(e),Fu=()=>{throw Xp("Method unimplemented")},ch=()=>{throw Xp("Unexpected case")},Mne=crypto.getRandomValues.bind(crypto),yP=()=>Mne(new Uint32Array(1))[0],Dne="10000000-1000-4000-8000"+-1e11,Lne=()=>Dne.replace(/[018]/g,e=>(e^yP()&15>>e/4).toString(16)),oR=e=>new Promise(e);Promise.all.bind(Promise);const sR=e=>e===void 0?null:e;let Pne=class{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}},vP=new Pne,Bne=!0;
514try{typeof localStorage<"u"&&localStorage&&(vP=localStorage,Bne=!1)}catch{}const jne=vP,M1=Symbol("Equality"),bP=(e,t)=>{var n;return e===t||!!((n=e==null?void 0:e[M1])!=null&&n.call(e,t))||!1},Fne=e=>typeof e=="object",zne=Object.assign,Une=Object.keys,Vne=(e,t)=>{for(const n in e)t(e[n],n)},zk=e=>Une(e).length,Hne=e=>{for(const t in e)return!1;return!0},S2=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},A5=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),$ne=(e,t)=>e===t||zk(e)===zk(t)&&S2(e,(n,r)=>(n!==void 0||A5(t,r))&&bP(t[r],n)),Gne=Object.freeze,wP=e=>{for(const t in e){const n=e[t];(typeof n=="object"||typeof n=="function")&&wP(e[t])}return Gne(e)},T5=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&T5(e,t,n+1)}},Bx=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[M1]!=null)return e[M1](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break}case Set:{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;break}case Map:{if(e.size!==t.size)return!1;for(const n of e.keys())if(!t.has(n)||!Bx(e.get(n),t.get(n)))return!1;break}case void 0:case Object:if(zk(e)!==zk(t))return!1;for(const n in e)if(!A5(e,n)||!Bx(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Bx(e[n],t[n]))return!1;break;default:return!1}return!0},qne=(e,t)=>t.includes(e);var xP={};const D1=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let hd;const Wne=()=>{if(hd===void 0)if(D1){hd=Pd();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const r=e[n];r[0]==="-"?(t!==null&&hd.set(t,""),t=r):t!==null&&(hd.set(t,r),t=null)}t!==null&&hd.set(t,"")}else typeof location=="object"?(hd=Pd(),(location.search||"?").slice(1).split("&").forEach(e=>{if(e.length!==0){const[t,n]=e.split("=");hd.set(`--${eR(t,"-")}`,n),hd.set(`-${eR(t,"-")}`,n)}})):hd=Pd();return hd},J4=e=>Wne().has(e),Uk=e=>sR(D1?xP[e.toUpperCase().replaceAll("-","_")]:jne.getItem(e)),kP=e=>J4("--"+e)||Uk(e)!==null,Kne=kP("production"),Yne=D1&&qne(xP.FORCE_COLOR,["true","1","2"]),Xne=Yne||!J4("--no-colors")&&!kP("no-color")&&(!D1||process.stdout.isTTY)&&(!D1||J4("--color")||Uk("COLORTERM")!==null||(Uk("TERM")||"").includes("color"));class Zne{constructor(t,n){this.left=t,this.right=n}}const Mf=(e,t)=>new Zne(e,t),aR=e=>e.next()>=.5,s3=(e,t,n)=>lh(e.next()*(n+1-t)+t),_P=(e,t,n)=>lh(e.next()*(n+1-t)+t),I5=(e,t,n)=>_P(e,t,n),Qne=e=>pne(I5(e,97,122)),Jne=(e,t=0,n=20)=>{const r=I5(e,t,n);let i="";for(let o=0;o<r;o++)i+=Qne(e);return i},a3=(e,t)=>t[I5(e,0,t.length-1)],ere=Symbol("0schema");class tre{constructor(){this._rerrs=[]}extend(t,n,r,i=null){this._rerrs.push({path:t,expected:n,has:r,message:i})}toString(){const t=[];for(let n=this._rerrs.length-1;n>0;n--){const r=this._rerrs[n];t.push(kne(" ",(this._rerrs.length-n)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return t.join(`
515`)}}const eE=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[M1]?bP(e,t):rC(e)?k5(e,n=>pP(t,r=>eE(n,r))):Fne(e)?S2(e,(n,r)=>eE(n,t[r])):!1;var _4;let Tl=(_4=class{extends(t){let[n,r]=[this.shape,t.shape];return this.constructor._dilutes&&([r,n]=[n,r]),eE(n,r)}equals(t){return this.constructor===t.constructor&&Bx(this.shape,t.shape)}[ere](){return!0}[M1](t){return this.equals(t)}validate(t){return this.check(t)}check(t,n){Fu()}get nullable(){return Xy(this,lC)}get optional(){return new EP(this)}cast(t){return lR(t,this),t}expect(t){return lR(t,this),t}},Ao(_4,"_dilutes",!1),_4);class R5 extends Tl{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n=void 0){const r=(t==null?void 0:t.constructor)===this.shape&&(this._c==null||this._c(t));return!r&&(n==null||n.extend(null,this.shape.name,t==null?void 0:t.constructor.name,(t==null?void 0:t.constructor)!==this.shape?"Constructor match failed":"Check failed")),r}}const $s=(e,t=null)=>new R5(e,t);$s(R5);class O5 extends Tl{constructor(t){super(),this.shape=t}check(t,n){const r=this.shape(t);return!r&&(n==null||n.extend(null,"custom prop",t==null?void 0:t.constructor.name,"failed to check custom prop")),r}}const ga=e=>new O5(e);$s(O5);class iC extends Tl{constructor(t){super(),this.shape=t}check(t,n){const r=this.shape.some(i=>i===t);return!r&&(n==null||n.extend(null,this.shape.join(" | "),t.toString())),r}}const oC=(...e)=>new iC(e),CP=$s(iC),nre=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,t=>"\\"+t)),SP=e=>{if(Oy.check(e))return[nre(e)];if(CP.check(e))return e.shape.map(t=>t+"");
515if(LP.check(e))return["[+-]?\\d+.?\\d*"];if(PP.check(e))return[".*"];if(Hk.check(e))return e.shape.map(SP).flat(1);ch()};class rre extends Tl{constructor(t){super(),this.shape=t,this._r=new RegExp("^"+t.map(SP).map(n=>`(${n.join("|")})`).join("")+"$")}check(t,n){const r=this._r.exec(t)!=null;return!r&&(n==null||n.extend(null,this._r.toString(),t.toString(),"String doesn't match string template.")),r}}$s(rre);const ire=Symbol("optional");class EP extends Tl{constructor(t){super(),this.shape=t}check(t,n){const r=t===void 0||this.shape.check(t);return!r&&(n==null||n.extend(null,"undefined (optional)","()")),r}get[ire](){return!0}}const ore=$s(EP);class sre extends Tl{check(t,n){return n==null||n.extend(null,"never",typeof t),!1}}$s(sre);const w_=class w_ extends Tl{constructor(t,n=!1){super(),this.shape=t,this._isPartial=n}get partial(){return new w_(this.shape,!0)}check(t,n){return t==null?(n==null||n.extend(null,"object","null"),!1):S2(this.shape,(r,i)=>{const o=this._isPartial&&!A5(t,i)||r.check(t[i],n);return!o&&(n==null||n.extend(i.toString(),r.toString(),typeof t[i],"Object property does not match")),o})}};Ao(w_,"_dilutes",!0);let Vk=w_;const are=e=>new Vk(e),lre=$s(Vk),cre=ga(e=>e!=null&&(e.constructor===Object||e.constructor==null));class AP extends Tl{constructor(t,n){super(),this.shape={keys:t,values:n}}check(t,n){return t!=null&&S2(t,(r,i)=>{const o=this.shape.keys.check(i,n);return!o&&(n==null||n.extend(i+"","Record",typeof t,o?"Key doesn't match schema":"Value doesn't match value")),o&&this.shape.values.check(r,n)})}}const TP=(e,t)=>new AP(e,t),ure=$s(AP);class IP extends Tl{constructor(t){super(),this.shape=t}check(t,n){return t!=null&&S2(this.shape,(r,i)=>{const o=r.check(t[i],n);return!o&&(n==null||n.extend(i.toString(),"Tuple",typeof r)),o})}}const dre=(...e)=>new IP(e);$s(IP);class RP extends Tl{constructor(t){super(),this.shape=t.length===1?t[0]:new sC(t)}check(t,n){const r=rC(t)&&k5(t,i=>this.shape.check(i));return!r&&(n==null||n.extend(null,"Array","")),r}}const OP=(...e)=>new RP(e),fre=$s(RP),hre=ga(e=>rC(e));class NP extends Tl{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n){const r=t instanceof this.shape&&(this._c==null||this._c(t));return!r&&(n==null||n.extend(null,this.shape.name,t==null?void 0:t.constructor.name)),r}}const pre=(e,t=null)=>new NP(e,t);$s(NP);const mre=pre(Tl);class gre extends Tl{constructor(t){super(),this.len=t.length-1,this.args=dre(...t.slice(-1)),this.res=t[this.len]}check(t,n){const r=t.constructor===Function&&t.length<=this.len;return!r&&(n==null||n.extend(null,"function",typeof t)),r}}const yre=$s(gre),vre=ga(e=>typeof e=="function");class bre extends Tl{constructor(t){super(),this.shape=t}check(t,n){const r=k5(this.shape,i=>i.check(t,n));return!r&&(n==null||n.extend(null,"Intersectinon",typeof t)),r}}$s(bre,e=>e.shape.length>0);class sC extends Tl{constructor(t){super(),this.shape=t}check(t,n){const r=pP(this.shape,i=>i.check(t,n));return n==null||n.extend(null,"Union",typeof t),r}}Ao(sC,"_dilutes",!0);const Xy=(...e)=>e.findIndex(t=>Hk.check(t))>=0?Xy(...e.map(t=>L1(t)).map(t=>Hk.check(t)?t.shape:[t]).flat(1)):e.length===1?e[0]:new sC(e),Hk=$s(sC),MP=()=>!0,$k=ga(MP),wre=$s(O5,e=>e.shape===MP),N5=ga(e=>typeof e=="bigint"),xre=ga(e=>e===N5),DP=ga(e=>typeof e=="symbol");ga(e=>e===DP);const ty=ga(e=>typeof e=="number"),LP=ga(e=>e===ty),Oy=ga(e=>typeof e=="string"),PP=ga(e=>e===Oy),aC=ga(e=>typeof e=="boolean"),kre=ga(e=>e===aC),BP=oC(void 0);$s(iC,e=>e.shape.length===1&&e.shape[0]===void 0);oC(void 0);const lC=oC(null),_re=$s(iC,e=>e.shape.length===1&&e.shape[0]===null);$s(Uint8Array);$s(R5,e=>e.shape===Uint8Array);const Cre=Xy(ty,Oy,lC,BP,N5,aC,DP);(()=>{const e=OP($k),t=TP(Oy,$k),n=Xy(ty,Oy,lC,aC,e,t);return e.shape=n,t.shape.values=n,n})();const L1=e=>{if(mre.check(e))return e;if(cre.check(e)){const t={};for(const n in e)t[n]=L1(e[n]);return are(t)}else{if(hre.check(e))return Xy(...e.map(L1));if(Cre.check(e))return oC(e);if(vre.check(e))return $s(e)}ch()},lR=Kne?()=>{}:(e,t)=>{const n=new tre;if(!t.check(e,n))throw Xp(`Expected value to be of type ${t.constructor.name}.
516${n.toString()}`)};class Sre{constructor(t){this.patterns=[],this.$state=t}if(t,n){return this.patterns.push({if:L1(t),h:n}),this}else(t){return this.if($k,t)}done(){return(t,n)=>{for(let r=0;r<this.patterns.length;r++){const i=this.patterns[r];if(i.if.check(t))return i.h(t,n)}throw Xp("Unhandled pattern")}}}const Ere=e=>new Sre(e),jP=Ere($k).if(LP,(e,t)=>s3(t,J8,Q8)).if(PP,(e,t)=>Jne(t)).if(kre,(e,t)=>aR(t)).if(xre,(e,t)=>BigInt(s3(t,J8,Q8))).if(Hk,(e,t)=>_0(t,a3(t,e.shape))).if(lre,(e,t)=>{const n={};for(const r in e.shape){let i=e.shape[r];if(ore.check(i)){if(aR(t))continue;i=i.shape}n[r]=jP(i,t)}return n}).if(fre,(e,t)=>{const n=[],r=_P(t,0,42);for(let i=0;i<r;i++)n.push(_0(t,e.shape));return n}).if(CP,(e,t)=>a3(t,e.shape)).if(_re,(e,t)=>null).if(yre,(e,t)=>{const n=_0(t,e.res);return()=>n}).if(wre,(e,t)=>_0(t,a3(t,[ty,Oy,lC,BP,N5,aC,OP(ty),TP(Xy("a","b","c"),ty)]))).if(ure,(e,t)=>{const n={},r=s3(t,0,3);for(let i=0;i<r;i++){const o=_0(t,e.shape.keys),s=_0(t,e.shape.values);n[o]=s}return n}).done(),_0=(e,t)=>jP(L1(t),e),cC=typeof document<"u"?document:{};ga(e=>e.nodeType===Ore);typeof DOMParser<"u"&&new DOMParser;ga(e=>e.nodeType===Tre);ga(e=>e.nodeType===Ire);const Are=e=>one(e,(t,n)=>`${n}:${t};`).join(""),Tre=cC.ELEMENT_NODE,Ire=cC.TEXT_NODE,Rre=cC.DOCUMENT_NODE,Ore=cC.DOCUMENT_FRAGMENT_NODE;ga(e=>e.nodeType===Rre);const ph=Symbol,FP=ph(),zP=ph(),Nre=ph(),Mre=ph(),Dre=ph(),UP=ph(),Lre=ph(),M5=ph(),Pre=ph(),Bre=e=>{var i;e.length===1&&((i=e[0])==null?void 0:i.constructor)===Function&&(e=e[0]());const t=[],n=[];let r=0;for(;r<e.length;r++){const o=e[r];if(o===void 0)break;if(o.constructor===String||o.constructor===Number)t.push(o);else if(o.constructor===Object)break}for(r>0&&n.push(t.join(""));r<e.length;r++){const o=e[r];o instanceof Symbol||n.push(o)}return n},jre={[FP]:Mf("font-weight","bold"),[zP]:Mf("font-weight","normal"),[Nre]:Mf("color","blue"),[Dre]:Mf("color","green"),[Mre]:Mf("color","grey"),[UP]:Mf("color","red"),[Lre]:Mf("color","purple"),[M5]:Mf("color","orange"),[Pre]:Mf("color","black")},Fre=e=>{var s;e.length===1&&((s=e[0])==null?void 0:s.constructor)===Function&&(e=e[0]());const t=[],n=[],r=Pd();let i=[],o=0;for(;o<e.length;o++){const l=e[o],u=jre[l];if(u!==void 0)r.set(u.left,u.right);else{if(l===void 0)break;if(l.constructor===String||l.constructor===Number){const d=Are(r);o>0||d.length>
5160?(t.push("%c"+l),n.push(d)):t.push(l)}else break}}for(o>0&&(i=n,i.unshift(t.join("")));o<e.length;o++){const l=e[o];l instanceof Symbol||i.push(l)}return i},VP=Xne?Fre:Bre,zre=(...e)=>{console.log(...VP(e)),HP.forEach(t=>t.print(e))},Ure=(...e)=>{console.warn(...VP(e)),e.unshift(M5),HP.forEach(t=>t.print(e))},HP=Iy(),$P=e=>({[Symbol.iterator](){return this},next:e}),Vre=(e,t)=>$P(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),l3=(e,t)=>$P(()=>{const{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}});class GP{constructor(t,n){this.clock=t,this.len=n}}class Hre{constructor(){this.clients=new Map}}const qP=(e,t,n)=>t.clients.forEach((r,i)=>{const o=e.doc.store.clients.get(i);if(o!=null){const s=o[o.length-1],l=s.id.clock+s.length;for(let u=0,d=r[u];u<r.length&&d.clock<l;d=r[++u])JP(e,o,d.clock,d.len,n)}}),$re=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){const i=lh((n+r)/2),o=e[i],s=o.clock;if(s<=t){if(t<s+o.len)return i;n=i+1}else r=i-1}return null},WP=(e,t)=>{const n=e.clients.get(t.client);return n!==void 0&&$re(n,t.clock)!==null},KP=e=>{e.clients.forEach(t=>{t.sort((i,o)=>i.clock-o.clock);let n,r;for(n=1,r=1;n<t.length;n++){const i=t[r-1],o=t[n];i.clock+i.len>=o.clock?t[r-1]=new GP(i.clock,Yy(i.len,o.clock+o.len-i.clock)):(r<n&&(t[r]=o),r++)}t.length=r})},YP=(e,t,n,r)=>{Ky(e.clients,t,()=>[]).push(new GP(n,r))},Gre=(e,t)=>{fo(e.restEncoder,t.clients.size),Ry(t.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{e.resetDsCurVal(),fo(e.restEncoder,n);const i=r.length;fo(e.restEncoder,i);for(let o=0;o<i;o++){const s=r[o];e.writeDsClock(s.clock),e.writeDsLen(s.len)}})},XP=yP;class E2 extends lne{constructor({guid:t=Lne(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:o=null,autoLoad:s=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=XP(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new tie,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=s,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=oR(d=>{this.on("load",()=>{this.isLoaded=!0,d(this)})});const u=()=>oR(d=>{const f=p=>{(p===void 0||p===!0)&&(this.off("sync",f),d())};this.on("sync",f)});this.on("sync",d=>{d===!1&&this.isSynced&&(this.whenSynced=u()),this.isSynced=d===void 0||d===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=u()}load(){const t=this._item;t!==null&&!this.shouldLoad&&Io(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Ry(this.subdocs).map(t=>t.guid))}transact(t,n=null){return Io(this,t,n)}get(t,n=Ia){const r=Ky(this.share,t,()=>{const o=new n;return o._integrate(this,null),o}),i=r.constructor;if(n!==Ia&&i!==n)if(i===Ia){const o=new n;o._map=r._map,r._map.forEach(s=>{for(;s!==null;s=s.left)s.parent=o}),o._start=r._start;for(let s=o._start;s!==null;s=s.right)s.parent=o;return o._length=r._length,this.share.set(t,o),o._integrate(this,null),o}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return r}getArray(t=""){return this.get(t,r1)}getText(t=""){return this.get(t,Wk)}getMap(t=""){return this.get(t,Ny)}getXmlElement(t=""){return this.get(t,j1)}getXmlFragment(t=""){return this.get(t,My)}toJSON(){const t={};return this.share.forEach((n,r)=>{t[r]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,Ry(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new E2({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,Io(t.parent.doc,r=>{const i=n.doc;t.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class qre{constructor(){this.restEncoder=_5()}toUint8Array(){return Zf(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){fo(this.restEncoder,t)}writeDsLen(t){fo(this.restEncoder,t)}}class Wre extends qre{writeLeftID(t){fo(this.restEncoder,t.client),fo(this.restEncoder,t.clock)}writeRightID(t){fo(this.restEncoder,t.client),fo(this.restEncoder,t.clock)}writeClient(t){fo(this.restEncoder,t)}writeInfo(t){Z4(this.restEncoder,t)}writeString(t){ey(this.restEncoder,t)}writeParentInfo(t){fo(this.restEncoder,t?1:0)}writeTypeRef(t){fo(this.restEncoder,t)}writeLen(t){fo(this.restEncoder,t)}writeAny(t){N1(this.restEncoder,t)}writeBuf(t){xc(this.restEncoder,t)}writeJSON(t){ey(this.restEncoder,JSON.stringify(t))}writeKey(t){ey(this.restEncoder,t)}}class Kre{constructor(){this.restEncoder=_5(),this.dsCurrVal=0}toUint8Array(){return Zf(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){const n=t-this.dsCurrVal;this.dsCurrVal=t,fo(this.restEncoder,n)}writeDsLen(t){t===0&&ch(),fo(this.restEncoder,t-1),this.dsCurrVal+=t}}class Yre extends Kre{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new o3,this.clientEncoder=new Px,this.leftClockEncoder=new o3,this.rightClockEncoder=new o3,this.infoEncoder=new nR(Z4),this.stringEncoder=new Nne,this.parentInfoEncoder=new nR(Z4),this.typeRefEncoder=new Px,this.lenEncoder=new Px}toUint8Array(){const t=_5();return fo(t,0),xc(t,this.keyClockEncoder.toUint8Array()),xc(t,this.clientEncoder.toUint8Array()),xc(t,this.leftClockEncoder.toUint8Array()),xc(t,this.rightClockEncoder.toUint8Array()),xc(t,Zf(this.infoEncoder)),xc(t,this.stringEncoder.toUint8Array()),xc(t,Zf(this.parentInfoEncoder)),xc(t,this.typeRefEncoder.toUint8Array()),xc(t,this.lenEncoder.toUint8Array()),S5(t,Zf(this.restEncoder)),Zf(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){N1(this.restEncoder,t)}writeBuf(t){xc(this.restEncoder,t)}writeJSON(t){N1(this.restEncoder,t)}writeKey(t){const n=this.keyMap.get(t);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(n)}}const Xre=(e,t,n,r)=>{r=Yy(r,t[0].id.clock);const i=uh(t,r);fo(e.restEncoder,t.length-i),e.writeClient(n),fo(e.restEncoder,r);const o=t[i];o.write(e,r-o.id.clock);for(let s=i+1;s<t.length;s++)t[s].write(e,0)}
516,Zre=(e,t,n)=>{const r=new Map;n.forEach((i,o)=>{Jl(t,o)>i&&r.set(o,i)}),D5(t).forEach((i,o)=>{n.has(o)||r.set(o,0)}),fo(e.restEncoder,r.size),Ry(r.entries()).sort((i,o)=>o[0]-i[0]).forEach(([i,o])=>{Xre(e,t.clients.get(i),i,o)})},Qre=(e,t)=>Zre(e,t.doc.store,t.beforeState);class Jre{constructor(){this.l=[]}}const cR=()=>new Jre,uR=(e,t)=>e.l.push(t),dR=(e,t)=>{const n=e.l,r=n.length;e.l=n.filter(i=>t!==i),r===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},ZP=(e,t,n)=>T5(e.l,[t,n]);class jx{constructor(t,n){this.client=t,this.clock=n}}const qw=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,gs=(e,t)=>new jx(e,t),eie=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw ch()},N0=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!WP(t.ds,e.id),tE=(e,t)=>{const n=Ky(e.meta,tE,Iy),r=e.doc.store;n.has(t)||(t.sv.forEach((i,o)=>{i<Jl(r,o)&&Zp(e,gs(o,i))}),qP(e,t.ds,i=>{}),n.add(t))};class tie{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const D5=e=>{const t=new Map;return e.clients.forEach((n,r)=>{const i=n[n.length-1];t.set(r,i.id.clock+i.length)}),t},Jl=(e,t)=>{const n=e.clients.get(t);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},QP=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==t.id.clock)throw ch()}n.push(t)},uh=(e,t)=>{let n=0,r=e.length-1,i=e[r],o=i.id.clock;if(o===t)return r;let s=lh(t/(o+i.length-1)*r);for(;n<=r;){if(i=e[s],o=i.id.clock,o<=t){if(t<o+i.length)return s;n=s+1}else r=s-1;s=lh((n+r)/2)}throw ch()},nie=(e,t)=>{const n=e.clients.get(t.client);return n[uh(n,t.clock)]},c3=nie,nE=(e,t,n)=>{const r=uh(t,n),i=t[r];return i.id.clock<n&&i instanceof Ya?(t.splice(r+1,0,yB(e,i,n-i.id.clock)),r+1):r},Zp=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[nE(e,n,t.clock)]},fR=(e,t,n)=>{const r=t.clients.get(n.client),i=uh(r,n.clock),o=r[i];return n.clock!==o.id.clock+o.length-1&&o.constructor!==Ep&&r.splice(i+1,0,yB(e,o,n.clock-o.id.clock+1)),o},rie=(e,t,n)=>{const r=e.clients.get(t.id.client);r[uh(r,t.id.clock)]=n},JP=(e,t,n,r,i)=>{if(r===0)return;const o=n+r;let s=nE(e,t,n),l;do l=t[s++],o<l.id.clock+l.length&&nE(e,t,o),i(l);while(s<t.length&&t[s].id.clock<o)};class iie{constructor(t,n,r){this.doc=t,this.deleteSet=new Hre,this.beforeState=D5(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const hR=(e,t)=>t.deleteSet.clients.size===0&&!sne(t.afterState,(n,r)=>t.beforeState.get(r)!==n)?!1:(KP(t.deleteSet),Qre(e,t),Gre(e,t.deleteSet),!0),pR=(e,t,n)=>{const r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&Ky(e.changed,t,Iy).add(n)},Fx=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof Ya&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const o=t-i;return o&&e.splice(t+1-o,o),o},oie=(e,t,n)=>{for(const[r,i]of e.clients.entries()){const o=t.clients.get(r);for(let s=i.length-1;s>=0;s--){const l=i[s],u=l.clock+l.len;for(let d=uh(o,l.clock),f=o[d];d<o.length&&f.id.clock<u;f=o[++d]){const p=o[d];if(l.clock+l.len<=p.id.clock)break;p instanceof Ya&&p.deleted&&!p.keep&&n(p)&&p.gc(t,!1)}}}},sie=(e,t)=>{e.clients.forEach((n,r)=>{const i=t.clients.get(r);for(let o=n.length-1;o>=0;o--){const s=n[o],l=mP(i.length-1,1+uh(i,s.clock+s.len-1));for(let u=l,d=i[u];u>0&&d.id.clock>=s.clock;d=i[u])u-=1+Fx(i,u)}})},eB=(e,t)=>{if(t<e.length){const n=e[t],r=n.doc,i=r.store,o=n.deleteSet,s=n._mergeStructs;try{KP(o),n.afterState=D5(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const l=[];n.changed.forEach((u,d)=>l.push(()=>{(d._item===null||!d._item.deleted)&&d._callObserver(n,u)})),l.push(()=>
516{n.changedParentTypes.forEach((u,d)=>{d._dEH.l.length>0&&(d._item===null||!d._item.deleted)&&(u=u.filter(f=>f.target._item===null||!f.target._item.deleted),u.forEach(f=>{f.currentTarget=d,f._path=null}),u.sort((f,p)=>f.path.length-p.path.length),l.push(()=>{ZP(d._dEH,u,n)}))}),l.push(()=>r.emit("afterTransaction",[n,r])),l.push(()=>{n._needFormattingCleanup&&vie(n)})}),T5(l,[])}finally{r.gc&&oie(o,i,r.gcFilter),sie(o,i),n.afterState.forEach((f,p)=>{const m=n.beforeState.get(p)||0;if(m!==f){const y=i.clients.get(p),b=Yy(uh(y,m),1);for(let k=y.length-1;k>=b;)k-=1+Fx(y,k)}});for(let f=s.length-1;f>=0;f--){const{client:p,clock:m}=s[f].id,y=i.clients.get(p),b=uh(y,m);b+1<y.length&&Fx(y,b+1)>1||b>0&&Fx(y,b)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(zre(M5,FP,"[yjs] ",zP,UP,"Changed the client-id because another client seems to be using it."),r.clientID=XP()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const f=new Wre;hR(f,n)&&r.emit("update",[f.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const f=new Yre;hR(f,n)&&r.emit("updateV2",[f.toUint8Array(),n.origin,r,n])}const{subdocsAdded:l,subdocsLoaded:u,subdocsRemoved:d}=n;(l.size>0||d.size>0||u.size>0)&&(l.forEach(f=>{f.clientID=r.clientID,f.collectionid==null&&(f.collectionid=r.collectionid),r.subdocs.add(f)}),d.forEach(f=>r.subdocs.delete(f)),r.emit("subdocs",[{loaded:u,added:l,removed:d},r,n]),d.forEach(f=>f.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,e])):eB(e,t+1)}}},Io=(e,t,n=null,r=!0)=>{const i=e._transactionCleanups;let o=!1,s=null;e._transaction===null&&(o=!0,e._transaction=new iie(e,n,r),i.push(e._transaction),i.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(o){const l=e._transaction===i[0];e._transaction=null,l&&eB(i,0)}}return s},mR="You must not compute changes after the event-handler fired.";class uC{constructor(t,n){this.target=t,this.currentTarget=t,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=aie(this.currentTarget,this.target))}deletes(t){return WP(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Xp(mR);const t=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const o=n._map.get(i);let s,l;if(this.adds(o)){let u=o.left;for(;u!==null&&this.adds(u);)u=u.left;if(this.deletes(o))if(u!==null&&this.deletes(u))s="delete",l=t3(u.content.getContent());else return;else u!==null&&this.deletes(u)?(s="update",l=t3(u.content.getContent())):(s="add",l=void 0)}else if(this.deletes(o))s="delete",l=t3(o.content.getContent());else return;t.set(i,{action:s,oldValue:l})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw Xp(mR);const n=this.target,r=Iy(),i=Iy(),o=[];
516if(t={added:r,deleted:i,delta:o,keys:this.keys},this.transaction.changed.get(n).has(null)){let l=null;const u=()=>{l&&o.push(l)};for(let d=n._start;d!==null;d=d.right)d.deleted?this.deletes(d)&&!this.adds(d)&&((l===null||l.delete===void 0)&&(u(),l={delete:0}),l.delete+=d.length,i.add(d)):this.adds(d)?((l===null||l.insert===void 0)&&(u(),l={insert:[]}),l.insert=l.insert.concat(d.content.getContent()),r.add(d)):((l===null||l.retain===void 0)&&(u(),l={retain:0}),l.retain+=d.length);l!==null&&l.retain===void 0&&u()}this._changes=t}return t}}const aie=(e,t)=>{const n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let r=0,i=t._item.parent._start;for(;i!==t._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;n.unshift(r)}t=t._item.parent}return n},Za=()=>{Ure("Invalid access: Add Yjs type to a document before reading data.")},tB=80;let L5=0;class lie{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=L5++}}const cie=e=>{e.timestamp=L5++},nB=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=L5++},uie=(e,t,n)=>{if(e.length>=tB){const r=e.reduce((i,o)=>i.timestamp<o.timestamp?i:o);return nB(r,t,n),r}else{const r=new lie(t,n);return e.push(r),r}},dC=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;const n=e._searchMarker.length===0?null:e._searchMarker.reduce((o,s)=>Lx(t-o.index)<Lx(t-s.index)?o:s);let r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,cie(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&Lx(n.index-i)<r.parent.length/tB?(nB(n,r,i),n):uie(e._searchMarker,r,i)},P1=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){const i=e[r];if(n>0){let o=i.p;for(o.marker=!1;o&&(o.deleted||!o.countable);)o=o.left,o&&!o.deleted&&o.countable&&(i.index-=o.length);if(o===null||o.marker===!0){e.splice(r,1);continue}i.p=o,o.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=Yy(t,i.index+n))}},fC=(e,t,n)=>{const r=e,i=t.changedParentTypes;for(;Ky(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;ZP(r._eH,n,t)};class Ia{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=cR(),this._dEH=cR(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw Fu()}clone(){throw Fu()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,n){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){uR(this._eH,t)}observeDeep(t){uR(this._dEH,t)}unobserve(t){dR(this._eH,t)}unobserveDeep(t){dR(this._dEH,t)}toJSON(){}}const rB=(e,t,n)=>{e.doc??Za(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t;const i=[];let o=e._start;for(;o!==null&&r>0;){if(o.countable&&!o.deleted){const s=o.content.getContent();if(s.length<=t)t-=s.length;else{for(let l=t;l<s.length&&r>0;l++)i.push(s[l]),r--;t=0}}o=o.right}return i},iB=e=>{e.doc??Za();const t=[];let n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i<r.length;i++)t.push(r[i])}n=n.right}return t},B1=(e,t)=>{let n=0,r=e._start;for(e.doc??Za();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let o=0;o<i.length;o++)t(i[o],n++,e)}r=r.right}},oB=(e,t)=>{const n=[];return B1(e,(r,i)=>{n.push(t(r,i,e))}),n},die=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},sB=(e,t)=>{e.doc??Za();const n=dC(e,t);let r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},Gk=(e,t,n,r)=>{let i=n;const o=e.doc,s=o.clientID,l=o.store,u=n===null?t._start:n.right;let d=[];const f=()=>{d.length>0&&(i=new Ya(gs(s,Jl(l,s)),i,i&&i.lastId,u,u&&u.id,t,null,new Dy(d)),i.integrate(e,0),d=[])};r.forEach(p=>{if(p===null)d.push(p);else switch(p.constructor){case Number:case Object:case Boolean:case Array:case String:d.push(p);break;default:switch(f(),p.constructor){case Uint8Array:case ArrayBuffer:i=new Ya(gs(s,Jl(l,s)),i,i&&i.lastId,u,u&&u.id,t,null,new hC(new Uint8Array(p))),i.integrate(e,0);break;case E2:i=new Ya(gs(s,Jl(l,s)),i,i&&i.lastId,u,u&&u.id,t,null,new pC(p)),i.integrate(e,0);break;default:if(p instanceof Ia)i=new Ya(gs(s,Jl(l,s)),i,i&&i.lastId,u,u&&u.id,t,null,new em(p)),i.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),f()},aB=()=>Xp("Length exceeded!"),lB=(e,t,n,r)=>{if(n>t._length)throw aB();if(n===0)return t._searchMarker&&P1(t._searchMarker,n,r.length),Gk(e,t,null,r);const i=n,o=dC(t,n);let s=t._start;for(o!==null&&(s=o.p,n-=o.index,n===0&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));s!==null;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&Zp(e,gs(s.id.client,s.id.clock+n));break}n-=s.length}return t._searchMarker&&P1(t._searchMarker,i,r.length),Gk(e,t,s,r)},fie=(e,t,n)=>{let i=(t._searchMarker||[]).reduce((o,s)=>s.index>o.index?s:o,{index:0,p:t._start}).p;if(i)for(;i.right;)i=i.right;return Gk(e,t,i,n)},cB=(e,t,n,r)=>{if(r===0)return;const i=n,o=r,s=dC(t,n);let l=t._start;for(s!==null&&(l=s.p,n-=s.index);l!==null&&n>0;l=l.right)!l.deleted&&l.countable&&(n<l.length&&Zp(e,gs(l.id.client,l.id.clock+n)),n-=l.length);for(;r>0&&l!==null;)l.deleted||(r<l.length&&Zp(e,gs(l.id.client,l.id.clock+r)),l.delete(e),r-=l.length),l=l.right;if(r>0)throw aB();t._searchMarker&&P1(t._searchMarker,i,-o+r)},qk=(e,t,n)=>{const r=t._map.get(n);r!==void 0&&r.delete(e)},P5=(e,t,n,r)=>{const i=t._map.get(n)||null,o=e.doc,s=o.clientID;let l;if(r==null)l=new Dy([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new Dy([r]);break;case Uint8Array:l=new hC(r);break;case E2:l=new pC(r);break;default:if(r instanceof Ia)l=new em(r);else throw new Error("Unexpected content type")}new Ya(gs(s,Jl(o.store,s)),i,i&&i.lastId,null,null,t,n,l).integrate(e,0)},B5=(e,t)=>{e.doc??Za();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},uB=e=>{const t={};
516return e.doc??Za(),e._map.forEach((n,r)=>{n.deleted||(t[r]=n.content.getContent()[n.length-1])}),t},dB=(e,t)=>{e.doc??Za();const n=e._map.get(t);return n!==void 0&&!n.deleted},hie=(e,t)=>{const n={};return e._map.forEach((r,i)=>{let o=r;for(;o!==null&&(!t.sv.has(o.id.client)||o.id.clock>=(t.sv.get(o.id.client)||0));)o=o.left;o!==null&&N0(o,t)&&(n[i]=o.content.getContent()[o.length-1])}),n},Ww=e=>(e.doc??Za(),Vre(e._map.entries(),t=>!t[1].deleted));class pie extends uC{}class r1 extends Ia{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const n=new r1;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new r1}clone(){const t=new r1;return t.insert(0,this.toArray().map(n=>n instanceof Ia?n.clone():n)),t}get length(){return this.doc??Za(),this._length}_callObserver(t,n){super._callObserver(t,n),fC(this,t,new pie(this,t))}insert(t,n){this.doc!==null?Io(this.doc,r=>{lB(r,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?Io(this.doc,n=>{fie(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?Io(this.doc,r=>{cB(r,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return sB(this,t)}toArray(){return iB(this)}slice(t=0,n=this.length){return rB(this,t,n)}toJSON(){return this.map(t=>t instanceof Ia?t.toJSON():t)}map(t){return oB(this,t)}forEach(t){B1(this,t)}[Symbol.iterator](){return die(this)}_write(t){t.writeTypeRef(Cie)}}class mie extends uC{constructor(t,n,r){super(t,n),this.keysChanged=r}}class Ny extends Ia{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,n){super._integrate(t,n),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new Ny}clone(){const t=new Ny;return this.forEach((n,r)=>{t.set(r,n instanceof Ia?n.clone():n)}),t}_callObserver(t,n){fC(this,t,new mie(this,t,n))}toJSON(){this.doc??Za();const t={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];t[r]=i instanceof Ia?i.toJSON():i}}),t}get size(){return[...Ww(this)].length}keys(){return l3(Ww(this),t=>t[0])}values(){return l3(Ww(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return l3(Ww(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??Za(),this._map.forEach((n,r)=>{n.deleted||t(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?Io(this.doc,n=>{qk(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?Io(this.doc,r=>{P5(r,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return B5(this,t)}has(t){return dB(this,t)}clear(){this.doc!==null?Io(this.doc,t=>{this.forEach(function(n,r,i){qk(t,i,r)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(Sie)}}const Up=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&$ne(e,t);class rE{constructor(t,n,r,i){this.left=t,this.right=n,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&ch(),this.right.content.constructor){case ma:this.right.deleted||Zy(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const gR=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case ma:t.right.deleted||Zy(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&Zp(e,gs(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},Kw=(e,t,n,r)=>{const i=new Map,o=r?dC(t,n):null;if(o){const s=new rE(o.p.left,o.p,o.index,i);return gR(e,s,n-o.index)}else{const s=new rE(null,t._start,0,i);return gR(e,s,n)}},fB=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===ma&&Up(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=e.doc,o=i.clientID;r.forEach((s,l)=>{const u=n.left,d=n.right,f=new Ya(gs(o,Jl(i.store,o)),u,u&&u.lastId,d,d&&d.id,t,null,new ma(l,s));f.integrate(e,0),n.right=f,n.forward()})},Zy=(e,t)=>{const{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},hB=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===ma&&Up(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},pB=(e,t,n,r)=>{const i=e.doc,o=i.clientID,s=new Map;for(const l in r){const u=r[l],d=n.currentAttributes.get(l)??null;if(!Up(d,u)){s.set(l,d);const{left:f,right:p}=n;n.right=new Ya(gs(o,Jl(i.store,o)),f,f&&f.lastId,p,p&&p.id,t,null,new ma(l,u)),n.right.integrate(e,0),n.forward()}}return s},u3=(e,t,n,r,i)=>
516{n.currentAttributes.forEach((m,y)=>{i[y]===void 0&&(i[y]=null)});const o=e.doc,s=o.clientID;hB(n,i);const l=pB(e,t,n,i),u=r.constructor===String?new dh(r):r instanceof Ia?new em(r):new Qy(r);let{left:d,right:f,index:p}=n;t._searchMarker&&P1(t._searchMarker,n.index,u.getLength()),f=new Ya(gs(s,Jl(o.store,s)),d,d&&d.lastId,f,f&&f.id,t,null,u),f.integrate(e,0),n.right=f,n.index=p,n.forward(),fB(e,t,n,l)},yR=(e,t,n,r,i)=>{const o=e.doc,s=o.clientID;hB(n,i);const l=pB(e,t,n,i);e:for(;n.right!==null&&(r>0||l.size>0&&(n.right.deleted||n.right.content.constructor===ma));){if(!n.right.deleted)switch(n.right.content.constructor){case ma:{const{key:u,value:d}=n.right.content,f=i[u];if(f!==void 0){if(Up(f,d))l.delete(u);else{if(r===0)break e;l.set(u,d)}n.right.delete(e)}else n.currentAttributes.set(u,d);break}default:r<n.right.length&&Zp(e,gs(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let u="";for(;r>0;r--)u+=`
517`;n.right=new Ya(gs(s,Jl(o.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new dh(u)),n.right.integrate(e,0),n.forward()}fB(e,t,n,l)},mB=(e,t,n,r,i)=>{let o=t;const s=Pd();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===ma){const d=o.content;s.set(d.key,d)}o=o.right}let l=0,u=!1;for(;t!==o;){if(n===t&&(u=!0),!t.deleted){const d=t.content;switch(d.constructor){case ma:{const{key:f,value:p}=d,m=r.get(f)??null;(s.get(f)!==d||m===p)&&(t.delete(e),l++,!u&&(i.get(f)??null)===p&&m!==p&&(m===null?i.delete(f):i.set(f,m))),!u&&!t.deleted&&Zy(i,d);break}}}t=t.right}return l},gie=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===ma){const r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},yie=e=>{let t=0;return Io(e.doc,n=>{let r=e._start,i=e._start,o=Pd();const s=X4(o);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case ma:Zy(s,i.content);break;default:t+=mB(n,r,i,o,s),o=X4(s),r=i;break}i=i.right}}),t},vie=e=>{const t=new Set,n=e.doc;for(const[r,i]of e.afterState.entries()){const o=e.beforeState.get(r)||0;i!==o&&JP(e,n.store.clients.get(r),o,i,s=>{!s.deleted&&s.content.constructor===ma&&s.constructor!==Ep&&t.add(s.parent)})}Io(n,r=>{qP(e,e.deleteSet,i=>{if(i instanceof Ep||!i.parent._hasFormatting||t.has(i.parent))return;const o=i.parent;i.content.constructor===ma?t.add(o):gie(r,i)});for(const i of t)yie(i)})},vR=(e,t,n)=>{const r=n,i=X4(t.currentAttributes),o=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case em:case Qy:case dh:n<t.right.length&&Zp(e,gs(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}o&&mB(e,o,t.right,i,t.currentAttributes);const s=(t.left||t.right).parent;return s._searchMarker&&P1(s._searchMarker,t.index,-r+n),t};class bie extends uC{constructor(t,n,r){super(t,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc,n=[];Io(t,r=>{const i=new Map,o=new Map;let s=this.target._start,l=null;const u={};let d="",f=0,p=0;const m=()=>{if(l!==null){let y=null;switch(l){case"delete":p>0&&(y={delete:p}),p=0;break;case"insert":(typeof d=="object"||d.length>0)&&(y={insert:d},i.size>0&&(y.attributes={},i.forEach((b,k)=>{b!==null&&(y.attributes[k]=b)}))),d="";break;case"retain":f>0&&(y={retain:f},Hne(u)||(y.attributes=zne({},u))),f=0;break}y&&n.push(y),l=null}};for(;s!==null;){switch(s.content.constructor){case em:case Qy:this.adds(s)?this.deletes(s)||(m(),l="insert",d=s.content.getContent()[0],m()):this.deletes(s)?(l!=="delete"&&(m(),l="delete"),p+=1):s.deleted||(l!=="retain"&&(m(),l="retain"),f+=1);break;case dh:this.adds(s)?this.deletes(s)||(l!=="insert"&&(m(),l="insert"),d+=s.content.str):this.deletes(s)?(l!=="delete"&&(m(),l="delete"),p+=s.length):s.deleted||(l!=="retain"&&(m(),l="retain"),f+=s.length);break;case ma:{const{key:y,value:b}=s.content;if(this.adds(s)){if(!this.deletes(s)){const k=i.get(y)??null;Up(k,b)?b!==null&&s.delete(r):(l==="retain"&&m(),Up(b,o.get(y)??null)?delete u[y]:u[y]=b)}}else if(this.deletes(s)){o.set(y,b);const k=i.get(y)??null;Up(k,b)||(l==="retain"&&m(),u[y]=k)}else if(!s.deleted){o.set(y,b);const k=u[y];k!==void 0&&(Up(k,b)?k!==null&&s.delete(r):(l==="retain"&&m(),b===null?delete u[y]:u[y]=b))}s.deleted||(l==="insert"&&m(),Zy(i,s.content));break}}s=s.right}for(m();n.length>0;){const y=n[n.length-1];if(y.retain!==void 0&&y.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class Wk extends Ia{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Za(),this._length}
517_integrate(t,n){super._integrate(t,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new Wk}clone(){const t=new Wk;return t.applyDelta(this.toDelta()),t}_callObserver(t,n){super._callObserver(t,n);const r=new bie(this,t,n);fC(this,t,r),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??Za();let t="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===dh&&(t+=n.content.str),n=n.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=!0}={}){this.doc!==null?Io(this.doc,r=>{const i=new rE(null,this._start,0,new Map);for(let o=0;o<t.length;o++){const s=t[o];if(s.insert!==void 0){const l=!n&&typeof s.insert=="string"&&o===t.length-1&&i.right===null&&s.insert.slice(-1)===`
518`?s.insert.slice(0,-1):s.insert;(typeof l!="string"||l.length>0)&&u3(r,this,i,l,s.attributes||{})}else s.retain!==void 0?yR(r,this,i,s.retain,s.attributes||{}):s.delete!==void 0&&vR(r,i,s.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,n,r){this.doc??Za();const i=[],o=new Map,s=this.doc;let l="",u=this._start;function d(){if(l.length>0){const p={};let m=!1;o.forEach((b,k)=>{m=!0,p[k]=b});const y={insert:l};m&&(y.attributes=p),i.push(y),l=""}}const f=()=>{for(;u!==null;){if(N0(u,t)||n!==void 0&&N0(u,n))switch(u.content.constructor){case dh:{const p=o.get("ychange");t!==void 0&&!N0(u,t)?(p===void 0||p.user!==u.id.client||p.type!=="removed")&&(d(),o.set("ychange",r?r("removed",u.id):{type:"removed"})):n!==void 0&&!N0(u,n)?(p===void 0||p.user!==u.id.client||p.type!=="added")&&(d(),o.set("ychange",r?r("added",u.id):{type:"added"})):p!==void 0&&(d(),o.delete("ychange")),l+=u.content.str;break}case em:case Qy:{d();const p={insert:u.content.getContent()[0]};if(o.size>0){const m={};p.attributes=m,o.forEach((y,b)=>{m[b]=y}
518)}i.push(p);break}case ma:N0(u,t)&&(d(),Zy(o,u.content));break}u=u.right}d()};return t||n?Io(s,p=>{t&&tE(p,t),n&&tE(p,n),f()},"cleanup"):f(),i}insert(t,n,r){if(n.length<=0)return;const i=this.doc;i!==null?Io(i,o=>{const s=Kw(o,this,t,!r);r||(r={},s.currentAttributes.forEach((l,u)=>{r[u]=l})),u3(o,this,s,n,r)}):this._pending.push(()=>this.insert(t,n,r))}insertEmbed(t,n,r){const i=this.doc;i!==null?Io(i,o=>{const s=Kw(o,this,t,!r);u3(o,this,s,n,r||{})}):this._pending.push(()=>this.insertEmbed(t,n,r||{}))}delete(t,n){if(n===0)return;const r=this.doc;r!==null?Io(r,i=>{vR(i,Kw(i,this,t,!0),n)}):this._pending.push(()=>this.delete(t,n))}format(t,n,r){if(n===0)return;const i=this.doc;i!==null?Io(i,o=>{const s=Kw(o,this,t,!1);s.right!==null&&yR(o,this,s,n,r)}):this._pending.push(()=>this.format(t,n,r))}removeAttribute(t){this.doc!==null?Io(this.doc,n=>{qk(n,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,n){this.doc!==null?Io(this.doc,r=>{P5(r,this,t,n)}):this._pending.push(()=>this.setAttribute(t,n))}getAttribute(t){return B5(this,t)}getAttributes(){return uB(this)}_write(t){t.writeTypeRef(Eie)}}class d3{constructor(t,n=()=>!0){this._filter=n,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??Za()}[Symbol.iterator](){return this}next(){let t=this._currentNode,n=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(n)))do if(n=t.content.type,!t.deleted&&(n.constructor===j1||n.constructor===My)&&n._start!==null)t=n._start;else for(;t!==null;){const r=t.next;if(r!==null){t=r;break}else t.parent===this._root?t=null:t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class My extends Ia{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new My}clone(){const t=new My;return t.insert(0,this.toArray().map(n=>n instanceof Ia?n.clone():n)),t}get length(){return this.doc??Za(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new d3(this,t)}querySelector(t){t=t.toUpperCase();const r=new d3(this,i=>i.nodeName&&i.nodeName.toUpperCase()===t).next();return r.done?null:r.value}querySelectorAll(t){return t=t.toUpperCase(),Ry(new d3(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){fC(this,t,new wie(this,n,t))}toString(){return oB(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,n={},r){const i=t.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),B1(this,o=>{i.insertBefore(o.toDOM(t,n,r),null)}),i}insert(t,n){this.doc!==null?Io(this.doc,r=>{lB(r,this,t,n)}):this._prelimContent.splice(t,0,...n)}insertAfter(t,n){if(this.doc!==null)Io(this.doc,r=>{const i=t&&t instanceof Ia?t._item:t;Gk(r,this,i,n)});else{const r=this._prelimContent,i=t===null?0:r.findIndex(o=>o===t)+1;if(i===0&&t!==null)throw Xp("Reference item not found");r.splice(i,0,...n)}}delete(t,n=1){this.doc!==null?Io(this.doc,r=>{cB(r,this,t,n)}):this._prelimContent.splice(t,n)}toArray(){return iB(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return sB(this,t)}slice(t=0,n=this.length){return rB(this,t,n)}forEach(t){B1(this,t)}_write(t){t.writeTypeRef(Tie)}}class j1 extends My{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,n){super._integrate(t,n),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new j1(this.nodeName)}clone(){const t=new j1(this.nodeName),n=this.getAttributes();return Vne(n,(r,i)=>{t.setAttribute(i,r)}),t.insert(0,this.toArray().map(r=>r instanceof Ia?r.clone():r)),t}toString(){const t=this.getAttributes(),n=[],r=[];for(const l in t)r.push(l);r.sort();const i=r.length;for(let l=0;l<i;l++){const u=r[l];n.push(u+'="'+t[u]+'"')}const o=this.nodeName.toLocaleLowerCase(),s=n.length>0?" "+n.join(" "):"";return`<${o}${s}>${super.toString()}</${o}>`}removeAttribute(t){this.doc!==null?Io(this.doc,n=>{qk(n,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,n){this.doc!==null?Io(this.doc,r=>{P5(r,this,t,n)}):this._prelimAttrs.set(t,n)}getAttribute(t){return B5(this,t)}hasAttribute(t){return dB(this,t)}getAttributes(t){return t?hie(this,t):uB(this)}toDOM(t=document,n={},r){const i=t.createElement(this.nodeName),o=this.getAttributes();for(const s in o){const l=o[s];typeof l=="string"&&i.setAttribute(s,l)}return B1(this,s=>{i.appendChild(s.toDOM(t,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(t){t.writeTypeRef(Aie),t.writeKey(this.nodeName)}}class wie extends uC{constructor(t,n,r){super(t,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEac
518h(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class gB{constructor(t,n){this.id=t,this.length=n}get deleted(){throw Fu()}mergeWith(t){return!1}write(t,n,r){throw Fu()}integrate(t,n){throw Fu()}}const xie=0;class Ep extends gB{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){n>0&&(this.id.clock+=n,this.length-=n),QP(t.doc.store,this)}write(t,n){t.writeInfo(xie),t.writeLen(this.length-n)}getMissing(t,n){return null}}class hC{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new hC(this.content)}splice(t){throw Fu()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}}class Kk{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Kk(this.len)}splice(t){const n=new Kk(this.len-t);return this.len=t,n}mergeWith(t){return this.len+=t.len,!0}integrate(t,n){YP(t.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(t){}gc(t){}write(t,n){t.writeLen(this.len-n)}getRef(){return 1}}const kie=(e,t)=>new E2({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class pC{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const n={};this.opts=n,t.gc||(n.gc=!1),t.autoLoad&&(n.autoLoad=!0),t.meta!==null&&(n.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new pC(kie(this.doc.guid,this.opts))}splice(t){throw Fu()}mergeWith(t){return!1}integrate(t,n){this.doc._item=n,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,n){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}class Qy{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Qy(this.embed)}splice(t){throw Fu()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}}class ma{constructor(t,n){this.key=t,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new ma(this.key,this.value)}splice(t){throw Fu()}mergeWith(t){return!1}integrate(t,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(t){}gc(t){}write(t,n){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}const _ie=Uk("node_env")==="development";class Dy{constructor(t){this.arr=t,_ie&&wP(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Dy(this.arr)}splice(t){const n=new Dy(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const r=this.arr.length;t.writeLen(r-n);for(let i=n;i<r;i++){const o=this.arr[i];t.writeAny(o)}}getRef(){return 8}}class dh{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new dh(this.str)}splice(t){const n=new dh(this.str.slice(t));this.str=this.str.slice(0,t);const r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(t){return this.str+=t.str,!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const Cie=0,Sie=1,Eie=2,Aie=3,Tie=4;class em{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new em(this.type._copy())}splice(t){throw Fu()}mergeWith(t){return!1}integrate(t,n){this.type._integrate(t.doc,n)}delete(t){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t),n=n.right;
518this.type._map.forEach(r=>{r.deleted?r.id.clock<(t.beforeState.get(r.id.client)||0)&&t._mergeStructs.push(r):r.delete(t)}),t.changed.delete(this.type)}gc(t){let n=this.type._start;for(;n!==null;)n.gc(t,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(t,!0),r=r.left}),this.type._map=new Map}write(t,n){this.type._write(t)}getRef(){return 7}}const yB=(e,t,n)=>{const{client:r,clock:i}=t.id,o=new Ya(gs(r,i+n),t,gs(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&o.markDeleted(),t.keep&&(o.keep=!0),t.redone!==null&&(o.redone=gs(t.redone.client,t.redone.clock+n)),t.right=o,o.right!==null&&(o.right.left=o),e._mergeStructs.push(o),o.parentSub!==null&&o.right===null&&o.parent._map.set(o.parentSub,o),t.length=n,o};class Ya extends gB{constructor(t,n,r,i,o,s,l,u){super(t,u.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=o,this.parent=s,this.parentSub=l,this.redone=null,this.content=u,this.info=this.content.isCountable()?X8:0}set marker(t){(this.info&r3)>0!==t&&(this.info^=r3)}get marker(){return(this.info&r3)>0}get keep(){return(this.info&Y8)>0}set keep(t){this.keep!==t&&(this.info^=Y8)}get countable(){return(this.info&X8)>0}get deleted(){return(this.info&n3)>0}set deleted(t){this.deleted!==t&&(this.info^=n3)}markDeleted(){this.info|=n3}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Jl(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Jl(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===jx&&this.id.client!==this.parent.client&&this.parent.clock>=Jl(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=fR(t,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Zp(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Ep||this.right&&this.right.constructor===Ep)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Ya?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===Ya&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===jx){const r=c3(n,this.parent);r.constructor===Ep?this.parent=null:this.parent=r.content.type}return null}integrate(t,n){if(n>0&&(this.id.clock+=n,this.left=fR(t,t.doc.store,gs(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const o=new Set,s=new Set;for(;i!==null&&i!==this.right;){if(s.add(i),o.add(i),qw(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,o.clear();else if(qw(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&s.has(c3(t.doc.store,i.origin)))o.has(c3(t.doc.store,i.origin))||(r=i,o.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(t)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),QP(t.doc.store,this),this.content.integrate(t,this),pR(t,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(t)}else new Ep(this.id,this.length).integrate(t,0)}get next(){let t=this.right;for(;t!==null&&t.deleted;)t=t.right;return t}get prev(){let t=this.left;for(;t!==null&&t.deleted;)t=t.left;return t}get lastId(){return this.length===1?this.id:gs(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&qw(t.origin,this.lastId)&&this.right===t&&qw(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){const n=this.parent._searchMarker;
518return n&&n.forEach(r=>{r.p===t&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),YP(t.deleteSet,this.id.client,this.id.clock,this.length),pR(t,n,this.parentSub),this.content.delete(t)}}gc(t,n){if(!this.deleted)throw ch();this.content.gc(t),n?rie(t,this,new Ep(this.id,this.length)):this.content=new Kk(this.length)}write(t,n){const r=n>0?gs(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,o=this.parentSub,s=this.content.getRef()&dne|(r===null?0:Fk)|(i===null?0:gP)|(o===null?0:une);if(t.writeInfo(s),r!==null&&t.writeLeftID(r),i!==null&&t.writeRightID(i),r===null&&i===null){const l=this.parent;if(l._item!==void 0){const u=l._item;if(u===null){const d=eie(l);t.writeParentInfo(!0),t.writeString(d)}else t.writeParentInfo(!1),t.writeLeftID(u.id)}else l.constructor===String?(t.writeParentInfo(!0),t.writeString(l)):l.constructor===jx?(t.writeParentInfo(!1),t.writeLeftID(l)):ch();o!==null&&t.writeString(o)}this.content.write(t,n)}}const vB=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},bB="__ $YJS$ __";vB[bB]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");vB[bB]=!0;const Iie=Math.floor,Rie=(e,t)=>e<t?e:t,Oie=(e,t)=>e>t?e:t,Nie=128,f3=127,Mie=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=t.codePointAt(i);return r},F1=typeof TextEncoder<"u"?new TextEncoder:null,Die=e=>F1.encode(e),Lie=F1?Die:Mie;let h3=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});h3&&h3.decode(new Uint8Array).length===1&&(h3=null);const Yk=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},j5=(e,t)=>{for(;t>f3;)Yk(e,Nie|f3&t),t=Iie(t/128);Yk(e,f3&t)},iE=new Uint8Array(3e4),Pie=iE.length/3,Bie=(e,t)=>{if(t.length<Pie){const n=F1.encodeInto(t,iE).written||0;j5(e,n);for(let r=0;r<n;r++)Yk(e,iE[r])}else zie(e,Lie(t))},jie=(e,t)=>{const n=unescape(encodeURIComponent(t)),r=n.length;j5(e,r);for(let i=0;i<r;i++)Yk(e,n.codePointAt(i))};F1&&F1.encodeInto;const Fie=(e,t)=>{const n=e.cbuf.length,r=e.cpos,i=Rie(n-r,t.length),o=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,o>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Oie(n*2,o)),e.cbuf.set(t.subarray(i)),e.cpos=o)},zie=(e,t)=>{j5(e,t.byteLength),Fie(e,t)};var bR;(function(e){e[e.Token=0]="Token",e[e.PermissionDenied=1]="PermissionDenied",e[e.Authenticated=2]="Authenticated"})(bR||(bR={}));var wR;(function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"})(wR||(wR={}));var wB={};const p3=()=>new Map,Uie=e=>e.toLowerCase(),Vie=/^\s*/g,Hie=e=>e.replace(Vie,""),$ie=/([A-Z])/g,xR=(e,t)=>Hie(e.replace($ie,n=>`${t}${Uie(n)}`)),Gie=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=t.codePointAt(i);return r},z1=typeof TextEncoder<"u"?new TextEncoder:null,qie=e=>z1.encode(e),Wie=z1?qie:Gie;let m3=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});m3&&m3.decode(new Uint8Array).length===1&&(m3=null);const kR=e=>e===void 0?null:e;class Kie{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}}let xB=new Kie,Yie=!0;try{typeof localStorage<"u"&&localStorage&&(xB=localStorage,Yie=!1)}catch{}const Xie=xB,Zie=(e,t)=>t.includes(e),U1=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let pd;
518const Qie=()=>{if(pd===void 0)if(U1){pd=p3();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const r=e[n];r[0]==="-"?(t!==null&&pd.set(t,""),t=r):t!==null&&(pd.set(t,r),t=null)}t!==null&&pd.set(t,"")}else typeof location=="object"?(pd=p3(),(location.search||"?").slice(1).split("&").forEach(e=>{if(e.length!==0){const[t,n]=e.split("=");pd.set(`--${xR(t,"-")}`,n),pd.set(`-${xR(t,"-")}`,n)}})):pd=p3();return pd},oE=e=>Qie().has(e),sE=e=>kR(U1?wB[e.toUpperCase()]:Xie.getItem(e)),Jie=e=>oE("--"+e)||sE(e)!==null;Jie("production");const _R=U1&&Zie(wB.FORCE_COLOR,["true","1","2"]);!oE("no-colors")&&(!U1||process.stdout.isTTY||_R)&&(!U1||oE("color")||_R||sE("COLORTERM")!==null||(sE("TERM")||"").includes("color"));const eoe=Math.floor,toe=(e,t)=>e<t?e:t,noe=(e,t)=>e>t?e:t,roe=128,g3=127,Xk=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},F5=(e,t)=>{for(;t>g3;)Xk(e,roe|g3&t),t=eoe(t/128);Xk(e,g3&t)},aE=new Uint8Array(3e4),ioe=aE.length/3,ooe=(e,t)=>{if(t.length<ioe){const n=z1.encodeInto(t,aE).written||0;F5(e,n);for(let r=0;r<n;r++)Xk(e,aE[r])}else loe(e,Wie(t))},soe=(e,t)=>{const n=unescape(encodeURIComponent(t)),r=n.length;F5(e,r);for(let i=0;i<r;i++)Xk(e,n.codePointAt(i))};z1&&z1.encodeInto;const aoe=(e,t)=>{const n=e.cbuf.length,r=e.cpos,i=toe(n-r,t.length),o=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,o>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(noe(n*2,o)),e.cbuf.set(t.subarray(i)),e.cpos=o)},loe=(e,t)=>{F5(e,t.byteLength),aoe(e,t)};var CR;(function(e){e[e.Sync=0]="Sync",e[e.Awareness=1]="Awareness",e[e.Auth=2]="Auth",e[e.QueryAwareness=3]="QueryAwareness",e[e.Stateless=5]="Stateless",e[e.CLOSE=7]="CLOSE",e[e.SyncStatus=8]="SyncStatus"})(CR||(CR={}));var SR;(function(e){e.Connecting="connecting",e.Connected="connected",e.Disconnected="disconnected"})(SR||(SR={}));crypto.getRandomValues.bind(crypto);var kB="__SUPERDOC_V2_BROWSER_RUNTIME__";function coe(e=globalThis){const t=e[kB];return t&&typeof t=="object"?t:null}function uoe(e={},t=globalThis){const n=coe(t)??{},r={...n,...e,vue:e.vue??n.vue??ine};return t[kB]=r,r}uoe();var Ho="application/vnd.openxmlformats-officedocument.wordprocessingml.document",Qp="application/pdf",V1="text/html",doe={docx:Ho,pdf:Qp,html:V1},zx={RESOLVED:"resolved",NEW:"new",ADD:"add",UPDATE:"update",DELET
518ED:"deleted",PENDING:"pending",SELECTED:"selected",COMMENTS_LIST:"comments-list",CHANGE_ACCEPTED:"change-accepted",CHANGE_REJECTED:"change-rejected"},foe=e=>typeof e!="string"?"":e.trim(),lE=e=>{if(typeof e!="string")return"";const t=e.trim();return t?t.toLowerCase():""},Yw=e=>{if(typeof e!="string")return"";const t=e.trim();return t?t.toLowerCase():""},Ym=e=>{const t=e??{},n=foe(t.id),r=lE(t.email);return{id:n,email:r,name:typeof t.name=="string"?t.name:"",hasId:n.length>0,hasEmail:r.length>0}},_B=({current:e,other:t})=>{const n=Ym(e),r=Ym(t);return n.hasId&&r.hasId?n.id===r.id:n.hasEmail&&r.hasEmail?n.email===r.email:!1},F0=({actor:e,fallbackKey:t=""})=>{const n=Ym(e);if(n.hasId)return`id:${n.id}`;if(n.hasEmail)return`email:${n.email}`;const r=typeof t=="number"?String(t):typeof t=="string"?t.trim():"";return r?`fallback:${r}`:""};function hoe(e){return typeof e.captureStackTrace=="function"}var Zk=class extends Error{constructor(e,t){super(e),this.cause=t,this.name="FileObjectError",hoe(Error)&&Error.captureStackTrace(this,this.constructor)}},poe=class extends Zk{constructor(e){super("Invalid data URI format: URI must contain exactly one comma separator"),this.uri=e,this.name="InvalidDataUriError"}},moe=class extends Zk{constructor(e,t){super(`Failed to fetch file from URL: ${e}`,t),this.url=e,this.name="FetchFailedError"}},ER=async(e,t,n)=>{try{if(e.startsWith("data:")&&e.includes(";base64,")){const o=e.split(",");if(o.length!==2)throw new poe(e);const s=atob(o[1]),l=Uint8Array.from(s,u=>u.charCodeAt(0));return new File([l],t,{type:n})}const r=await fetch(e);if(!r.ok)throw new moe(e,new Error(`HTTP ${r.status}: ${r.statusText}`));const i=await r.blob();return new File([i],t,{type:n})}catch(r){throw r instanceof Zk?r:new Zk("Failed to create file object",r)}},Qk=new WeakMap;function CB(e){return e.ownerDocument??document}function SB(e,t){const n=Qk.get(t);n==null||n.bindings.delete(e),n&&n.bindings.size===0&&(t.removeEventListener("click",n.listener),Qk.delete(t))}function AR(e,t){const n=CB(e);e.__clickOutsideDocument&&e.__clickOutsideDocument!==n&&SB(e,e.__clickOutsideDocument);let r=Qk.get(n);if(!r){const i=new Map,o=s=>{var u;const l=typeof s.composedPath=="function"?s.composedPath():null;for(const[d,f]of i)((l==null?void 0:l.includes(d))??d.contains(s.target))||(u=f.value)==null||u.call(f,s)};r={bindings:i,listener:o},Qk.set(n,r),n.addEventListener("click",o)}r.bindings.set(e,t),e.__clickOutsideHandler=r.listener,e.__clickOutsideDocument=n}var z5={mounted(e,t){AR(e,t)},updated(e,t){AR(e,t)},unmounted(e){SB(e,e.__clickOutsideDocument??CB(e)),delete e.__clickOutsideHandler,delete e.__clickOutsideDocument}};function goe(e){return e[1].user!==void 0}var yoe=(e,t)=>{const n=new Set;return Array.from(t.entries()).filter(goe).filter(([r,i])=>{const o=F0({actor:i.user,fallbackKey:r});return!o||n.has(o)?!1:(n.add(o),!0)}).map(([r,i])=>{const o=F0({actor:i.user,fallbackKey:r});let s=e.userColorMap.get(o);return s||(s=i.user.color||(e.config.colors.length>0?e.config.colors[e.colorIndex%e.config.colors.length]:void 0),e.userColorMap.set(o,s),e.colorIndex++),{clientId:r,...i.user,color:s}})},voe=e=>{for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e},boe="https://ingest.superdoc.dev/v1/collect";function woe(){try{return"2.20.0"}catch{return"unknown"}}var xoe=class{constructor(e){this.enabled=e.enabled,this.endpoint=e.endpoint||boe,this.licenseKey=e.licenseKey||"",this.metadata=e.metadata,this.superdocVersion=woe()}getBrowserInfo(){return typeof window>"u"?{userAgent:"",currentUrl:"",hostname:"",screenSize:{width:0,height:0}}:{userAgent:window.navigator.userAgent,currentUrl:window.location.origin,hostname:window.location.hostname,screenSize:{width:window.screen.width,height:window.screen.height}}}trackDocumentOpen(e,t=null){if(!this.enabled)return;const n={timestamp:new Date().toISOString(),documentId:e,documentCreatedAt:t};this.sendEvent(n)}async sendEvent(e){const t={superdocVersion:this.superdocVersion,browserInfo:this.getBrowserInfo(),...this.metadata&&{metadata:this.metadata},events:[e]};try{await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-License-Key":this.licenseKey},body:JSON.stringify(t),credentials:"omit"})}catch{}}};e9();N_();var koe=Object.create,EB=Object.defineProperty,_oe=Object.getOwnPropertyDescriptor,U5=Object.getOwnPropertyNames,Coe=Object.getPrototypeOf,Soe=Object.prototype.hasOwnProperty,Eoe=(e,t)=>
518function(){return e&&(t=(0,e[U5(e)[0]])(e=0)),t},Aoe=(e,t)=>function(){return t||(0,e[U5(e)[0]])((t={exports:{}}).exports,t),t.exports},Toe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of U5(t))!Soe.call(e,i)&&i!==n&&EB(e,i,{get:()=>t[i],enumerable:!(r=_oe(t,i))||r.enumerable});return e},Ioe=(e,t,n)=>(n=e!=null?koe(Coe(e)):{},Toe(EB(n,"default",{value:e,enumerable:!0}),e)),A2=Eoe({"../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),Roe=Aoe({"../../node_modules/.pnpm/[email protected]/node_modules/rfdc/index.js"(e,t){A2(),t.exports=r;function n(o){return o instanceof Yl?Yl.from(o):new o.constructor(o.buffer.slice(),o.byteOffset,o.length)}function r(o){if(o=o||{},o.circles)return i(o);const s=new Map;if(s.set(Date,p=>new Date(p)),s.set(Map,(p,m)=>new Map(u(Array.from(p),m))),s.set(Set,(p,m)=>new Set(u(Array.from(p),m))),o.constructorHandlers)for(const p of o.constructorHandlers)s.set(p[0],p[1]);let l=null;return o.proto?f:d;function u(p,m){const y=Object.keys(p),b=new Array(y.length);for(let k=0;k<y.length;k++){const S=y[k],x=p[S];typeof x!="object"||x===null?b[S]=x:x.constructor!==Object&&(l=s.get(x.constructor))?b[S]=l(x,m):ArrayBuffer.isView(x)?b[S]=n(x):b[S]=m(x)}return b}function d(p){if(typeof p!="object"||p===null)return p;if(Array.isArray(p))return u(p,d);if(p.constructor!==Object&&(l=s.get(p.constructor)))return l(p,d);const m={};for(const y in p){if(Object.hasOwnProperty.call(p,y)===!1)continue;const b=p[y];typeof b!="object"||b===null?m[y]=b:b.constructor!==Object&&(l=s.get(b.constructor))?m[y]=l(b,d):ArrayBuffer.isView(b)?m[y]=n(b):m[y]=d(b)}return m}function f(p){if(typeof p!="object"||p===null)return p;if(Array.isArray(p))return u(p,f);if(p.constructor!==Object&&(l=s.get(p.constructor)))return l(p,f);const m={};for(const y in p){const b=p[y];typeof b!="object"||b===null?m[y]=b:b.constructor!==Object&&(l=s.get(b.constructor))?m[y]=l(b,f):ArrayBuffer.isView(b)?m[y]=n(b):m[y]=f(b)}return m}}function i(o){const s=[],l=[],u=new Map;if(u.set(Date,y=>new Date(y)),u.set(Map,(y,b)=>new Map(f(Array.from(y),b))),u.set(Set,(y,b)=>new Set(f(Array.from(y),b))),o.constructorHandlers)for(const y of o.constructorHandlers)u.set(y[0],y[1]);let d=null;return o.proto?m:p;function f(y,b){const k=Object.keys(y),S=new Array(k.length);for(let x=0;x<k.length;x++){const T=k[x],C=y[T];if(typeof C!="object"||C===null)S[T]=C;else if(C.constructor!==Object&&(d=u.get(C.constructor)))S[T]=d(C,b);else if(ArrayBuffer.isView(C))S[T]=n(C);else{const I=s.indexOf(C);I!==-1?S[T]=l[I]:S[T]=b(C)}}return S}function p(y){if(typeof y!="object"||y===null)return y;if(Array.isArray(y))return f(y,p);if(y.constructor!==Object&&(d=u.get(y.constructor)))return d(y,p);const b={};s.push(y),l.push(b);for(const k in y){if(Object.hasOwnProperty.call(y,k)===!1)continue;const S=y[k];if(typeof S!="object"||S===null)b[k]=S;else if(S.constructor!==Object&&(d=u.get(S.constructor)))b[k]=d(S,p);else if(ArrayBuffer.isView(S))b[k]=n(S);else{const x=s.indexOf(S);x!==-1?b[k]=l[x]:b[k]=p(S)}}return s.pop(),l.pop(),b}function m(y){if(typeof y!="object"||y===null)return y;if(Array.isArray(y))return f(y,m);if(y.constructor!==Object&&(d=u.get(y.constructor)))return d(y,m);const b={};s.push(y),l.push(b);for(const k in y){const S=y[k];if(typeof S!="object"||S===null)b[k]=S;else if(S.constructor!==Object&&(d=u.get(S.constructor)))b[k]=d(S,m);else if(ArrayBuffer.isView(S))b[k]=n(S);else{const x=s.indexOf(S);x!==-1?b[k]=l[x]:b[k]=m(S)}}return s.pop(),l.pop(),b}}}});A2();A2();A2();var AB=typeof navigator<"u",Xn=typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof wl<"u"?wl:{};typeof Xn.chrome<"u"&&Xn.chrome.devtools;AB&&(Xn.self,Xn.top);var TR;typeof navigator<"u"&&((TR=navigator.userAgent)==null||TR.toLowerCase().includes("electron"));A2();var Ooe=Ioe(Roe()),Noe=/(?:^|[-_/])(\w)/g;function Moe(e,t){return t?t.toUpperCase():""}function Doe(e){return e&&`${e}`.replace(Noe,Moe)}function Loe(e,t){let n=e.replace(/^[a-z]:/i,"").replace(/\\/g,"/");n.endsWith(`index${t}`)&&(n=n.replace(`/index${t}`,t));const r=n.lastIndexOf("/"),i=n.substring(r+1);{const o=i.lastIndexOf(t);return i.substring(0,o)}}var IR=(0,Ooe.default)({circles:!0}),Poe={trailing:!0};function Ly(e,t=25,n={}){if(n={...Poe,...n},!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let r,i,o=[],s,l;const u=(d,f)=>(s=Boe(e,d,f),s.finally(()=>
518{if(s=null,n.trailing&&l&&!i){const p=u(d,l);return l=null,p}}),s);return function(...d){return s?(n.trailing&&(l=d),s):new Promise(f=>{const p=!i&&n.leading;clearTimeout(i),i=setTimeout(()=>{i=null;const m=n.leading?r:u(this,d);for(const y of o)y(m);o=[]},t),p?(r=u(this,d),f(r)):o.push(f)})}}async function Boe(e,t,n){return await e.apply(t,n)}function cE(e,t={},n){for(const r in e){const i=e[r],o=n?`${n}:${r}`:r;typeof i=="object"&&i!==null?cE(i,t,o):typeof i=="function"&&(t[o]=i)}return t}var joe={run:e=>e()},Foe=()=>joe,TB=typeof console.createTask<"u"?console.createTask:Foe;function zoe(e,t){const n=TB(t.shift());return e.reduce((r,i)=>r.then(()=>n.run(()=>i(...t))),Promise.resolve())}function Uoe(e,t){const n=TB(t.shift());return Promise.all(e.map(r=>n.run(()=>r(...t))))}function y3(e,t){for(const n of[...e])n(t)}var Voe=class{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,t,n={}){if(!e||typeof t!="function")return()=>{};const r=e;let i;for(;this._deprecatedHooks[e];)i=this._deprecatedHooks[e],e=i.to;if(i&&!n.allowDeprecated){let o=i.message;o||(o=`${r} hook has been deprecated`+(i.to?`, please use ${i.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(o)||(console.warn(o),this._deprecatedMessages.add(o))}if(!t.name)try{Object.defineProperty(t,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&(this.removeHook(e,t),t=void 0)}}hookOnce(e,t){let n,r=(...i)=>(typeof n=="function"&&n(),n=void 0,r=void 0,t(...i));return n=this.hook(e,r),n}removeHook(e,t){if(this._hooks[e]){const n=this._hooks[e].indexOf(t);n!==-1&&this._hooks[e].splice(n,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,t){this._deprecatedHooks[e]=typeof t=="string"?{to:t}:t;const n=this._hooks[e]||[];delete this._hooks[e];for(const r of n)this.hook(e,r)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(const t in e)this.deprecateHook(t,e[t])}addHooks(e){const t=cE(e),n=Object.keys(t).map(r=>this.hook(r,t[r]));return()=>{for(const r of n.splice(0,n.length))r()}}removeHooks(e){const t=cE(e);for(const n in t)this.removeHook(n,t[n])}removeAllHooks(){for(const e in this._hooks)delete this._hooks[e]}callHook(e,...t){return t.unshift(e),this.callHookWith(zoe,e,...t)}callHookParallel(e,...t){return t.unshift(e),this.callHookWith(Uoe,e,...t)}callHookWith(e,t,...n){const r=this._before||this._after?{name:t,args:n,context:{}}:void 0;this._before&&y3(this._before,r);const i=e(t in this._hooks?[...this._hooks[t]]:[],n);return i instanceof Promise?i.finally(()=>{this._after&&r&&y3(this._after,r)}):(this._after&&r&&y3(this._after,r),i)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const t=this._before.indexOf(e);t!==-1&&this._before.splice(t,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const t=this._after.indexOf(e);t!==-1&&this._after.splice(t,1)}}}};function IB(){return new Voe}var Hoe=Object.create,RB=Object.defineProperty,$oe=Object.getOwnPropertyDescriptor,V5=Object.getOwnPropertyNames,Goe=Object.getPrototypeOf,qoe=Object.prototype.hasOwnProperty,Woe=(e,t)=>function(){return e&&(t=(0,e[V5(e)[0]])(e=0)),t},OB=(e,t)=>function(){return t||(0,e[V5(e)[0]])((t={exports:{}}).exports,t),t.exports},Koe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of V5(t))!qoe.call(e,i)&&i!==n&&RB(e,i,{get:()=>t[i],enumerable:!(r=$oe(t,i))||r.enumerable});return e},Yoe=(e,t,n)=>(n=e!=null?Hoe(Goe(e)):{},Koe(RB(n,"default",{value:e,enumerable:!0}),e)),On=Woe({"../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js"(){}}),Xoe=OB({"../../node_modules/.pnpm/[email protected]/node_modules/speakingurl/lib/speakingurl.
518js"(e,t){On(),(function(n){var r={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"Ae",Å:"A",Æ:"AE",Ç:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"Oe",Ő:"O",Ø:"O",Ù:"U",Ú:"U",Û:"U",Ü:"Ue",Ű:"U",Ý:"Y",Þ:"TH",ß:"ss",à:"a",á:"a",â:"a",ã:"a",ä:"ae",Ã¥:"a",æ:"ae",ç:"c",è:"e",é:"e",ê:"e",ë:"e",ì:"i",í:"i",î:"i",ï:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"oe",ő:"o",ø:"o",ù:"u",ú:"u",û:"u",ü:"ue",ű:"u",ý:"y",þ:"th",ÿ:"y","ẞ":"SS",ا:"a",Ø£:"a",Ø¥:"i",Ø¢:"aa",ؤ:"u",ئ:"e",Ø¡:"a",ب:"b",ت:"t",Ø«:"th",ج:"j",Ø­:"h",Ø®:"kh",د:"d",ذ:"th",ر:"r",ز:"z",س:"s",Ø´:"sh",ص:"s",ض:"dh",Ø·:"t",ظ:"z",ع:"a",غ:"gh",ف:"f",ق:"q",ك:"k",ل:"l",م:"m",ن:"n",ه:"h",و:"w",ي:"y",ى:"a",Ø©:"h",ï»»:"la",ï»·:"laa",ﻹ:"lai",ﻵ:"laa",Ú¯:"g",چ:"ch",Ù¾:"p",ژ:"zh",Ú©:"k",ی:"y","َ":"a","ً":"an","ِ":"e","ٍ":"en","ُ":"u","ٌ":"on","ْ":"","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9",က:"k",ခ:"kh",ဂ:"g",ဃ:"ga",င:"ng",စ:"s",ဆ:"sa",ဇ:"z","စျ":"za",ည:"ny",ဋ:"t",ဌ:"ta",ဍ:"d",ဎ:"da",ဏ:"na",တ:"t",ထ:"ta",ဒ:"d",ဓ:"da",န:"n",ပ:"p",ဖ:"pa",ဗ:"b",ဘ:"ba",မ:"m",ယ:"y",ရ:"ya",လ:"l",ဝ:"w",သ:"th",ဟ:"h",ဠ:"la",အ:"a","ြ":"y","ျ":"ya","ွ":"w","ြွ":"yw","ျွ":"ywa","ှ":"h",ဧ:"e","၏":"-e",ဣ:"i",ဤ:"-i",ဉ:"u",ဦ:"-u",ဩ:"aw","သြော":"aw",ဪ:"aw","၀":"0","၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","္":"","့":"","း":"",č:"c",ď:"d",ě:"e",ň:"n",ř:"r",Å¡:"s",Å¥:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Å :"S",Ť:"T",Å®:"U",Ž:"Z",ހ:"h",ށ:"sh",ނ:"n",ރ:"r",ބ:"b",ޅ:"lh",ކ:"k",އ:"a",ވ:"v",މ:"m",ފ:"f",ދ:"dh",ތ:"th",ލ:"l",ގ:"g",ޏ:"gn",ސ:"s",ޑ:"d",ޒ:"z",ޓ:"t",ޔ:"y",ޕ:"p",ޖ:"j",ޗ:"ch",ޘ:"tt",ޙ:"hh",ޚ:"kh",ޛ:"th",ޜ:"z",ޝ:"sh",ޞ:"s",ޟ:"d",Þ :"t",Þ¡:"z",Þ¢:"a",Þ£:"gh",Þ¤:"q",Þ¥:"w","Þ¦":"a","Þ§":"aa","Þ¨":"i","Þ©":"ee","Þª":"u","Þ«":"oo","Þ¬":"e","Þ­":"ey","Þ®":"o","Þ¯":"oa","Þ°":"",ა:"a",ბ:"b",გ:"g",დ:"d",ე:"e",ვ:"v",ზ:"z",თ:"t",ი:"i",კ:"k",ლ:"l",მ:"m",ნ:"n",ო:"o",პ:"p",ჟ:"zh",რ:"r",ს:"s",ტ:"t",უ:"u",ფ:"p",ქ:"k",ღ:"gh",ყ:"q",შ:"sh",ჩ:"ch",ც:"ts",ძ:"dz",წ:"ts",ჭ:"ch",ხ:"kh",ჯ:"j",ჰ:"h",α:"a",β:"v",γ:"g",δ:"d",ε:"e",ζ:"z",η:"i",θ:"th",ι:"i",κ:"k",λ:"l",μ:"m",ν:"n",ξ:"ks",ο:"o",π:"p",ρ:"r",σ:"s",τ:"t",υ:"y",φ:"f",χ:"x",ψ:"ps",ω:"o",ά:"a",έ:"e",ί:"i",ό:"o",ύ:"y",ή:"i",ώ:"o",ς:"s",ϊ:"i",ΰ:"y",ϋ:"y",ΐ:"i",Α:"A",Β:"B",Γ:"G",Δ:"D",Ε:"E",Ζ:"Z",Η:"I",Θ:"TH",Ι:"I",Κ:"K",Λ:"L",Μ:"M",Ν:"N",Ξ:"KS",Ο:"O",Π:"P",Ρ:"R",Σ:"S",Τ:"T",Î¥:"Y",Φ:"F",Χ:"X",Ψ:"PS",Ω:"O",Ά:"A",Έ:"E",Ί:"I",Ό:"O",Ύ:"Y",Ή:"I",Ώ:"O",Ϊ:"I",Ϋ:"Y",ā:"a",ē:"e",Ä£:"g",Ä«:"i",Ä·:"k",ļ:"l",ņ:"n",Å«:"u",Ā:"A",Ē:"E",Ä¢:"G",Ī:"I",Ķ:"k",Ä»:"L",Ņ:"N",Ū:"U",Ќ:"Kj",ќ:"kj",Љ:"Lj",љ:"lj",Њ:"Nj",њ:"nj",Тс:"Ts",тс:"ts",ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"E",Ł:"L",Ń:"N",Ś:"S",Ź:"Z",Å»:"Z",Є:"Ye",І:"I",Ї:"Yi",Ґ:"G",є:"ye",і:"i",ї:"yi",ґ:"g",ă:"a",Ă:"A",ș:"s",Ș:"S",ț:"t",Ț:"T",Å£:"t",Å¢:"T",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya",А:"A",Б:"B",В:"V",Г:"G",Д:"D",Е:"E",Ё:"Yo",Ж:"Zh",З:"Z",И:"I",Й:"I",К:"K",Л:"L",М:"M",Н:"N",О:"O",П:"P",Р:"R",С:"S",Т:"T",У:"U",Ф:"F",Ð¥:"Kh",Ц:"C",Ч:"Ch",Ш:"Sh",Щ:"Sh",Ъ:"",Ы:"Y",Ь:"",Э:"E",Ю:"Yu",Я:"Ya",ђ:"dj",ј:"j",ћ:"c",џ:"dz",Ђ:"Dj",Ј:"j",Ћ:"C",Џ:"Dz",ľ:"l",ĺ:"l",ŕ:"r",Ľ:"L",Ĺ:"L",Ŕ:"R",ş:"s",Ş:"S",ı:"i",İ:"I",ğ:"g",Ğ:"G",ả:"a",Ả:"A",ẳ:"a",Ẳ:"A",ẩ:"a",Ẩ:"A",đ:"d",Đ:"D",ẹ:"e",Ẹ:"E",ẽ:"e",Ẽ:"E",ẻ:"e",Ẻ:"E",ế:"e",Ế:"E",ề:"e",Ề:"E",ệ:"e",Ệ:"E",ễ:"e",Ễ:"E",ể:"e",Ể:"E",ỏ:"o",ọ:"o",Ọ:"o",ố:"o",Ố:"O",ồ:"o",Ồ:"O",ổ:"o",Ổ:"O",ộ:"o",Ộ:"O",ỗ:"o",Ỗ:"O",Æ¡:"o",Æ :"O",ớ:"o",Ớ:"O",ờ:"o",Ờ:"O",ợ:"o",Ợ:"O",ỡ:"o",á» :"O",Ở:"o",ở:"o",ị:"i",Ị:"I",Ä©:"i",Ĩ:"I",ỉ:"i",Ỉ:"i",á»§:"u",Ủ:"U",ụ:"u",Ụ:"U",Å©:"u",Ũ:"U",ư:"u",Ư:"U",ứ:"u",Ứ:"U",ừ:"u",Ừ:"U",á»±:"u",á»°:"U",ữ:"u",á»®:"U",á»­:"u",Ử:"ư",á»·:"y",á»¶:"y",ỳ:"y",Ỳ:"Y",ỵ:"y",á»´:"Y",ỹ:"y",Ỹ:"Y",ạ:"a",Ạ:"A",á
518º¥:"a",Ấ:"A",ầ:"a",Ầ:"A",ậ:"a",Ậ:"A",ẫ:"a",Ẫ:"A",ắ:"a",Ắ:"A",ằ:"a",Ằ:"A",ặ:"a",Ặ:"A",ẵ:"a",Ẵ:"A","⓪":"0","①":"1","②":"2","③":"3","④":"4","⑤":"5","⑥":"6","⑦":"7","⑧":"8","⑨":"9","⑩":"10","⑪":"11","⑫":"12","⑬":"13","⑭":"14","⑮":"15","⑯":"16","⑰":"17","⑱":"18","⑲":"18","⑳":"18","⓵":"1","⓶":"2","⓷":"3","⓸":"4","⓹":"5","⓺":"6","⓻":"7","⓼":"8","⓽":"9","⓾":"10","⓿":"0","⓫":"11","⓬":"12","⓭":"13","⓮":"14","⓯":"15","⓰":"16","⓱":"17","⓲":"18","⓳":"19","⓴":"20","Ⓐ":"A","Ⓑ":"B","Ⓒ":"C","Ⓓ":"D","Ⓔ":"E","Ⓕ":"F","Ⓖ":"G","Ⓗ":"H","Ⓘ":"I","Ⓙ":"J","Ⓚ":"K","Ⓛ":"L","Ⓜ":"M","Ⓝ":"N","Ⓞ":"O","Ⓟ":"P","Ⓠ":"Q","Ⓡ":"R","Ⓢ":"S","Ⓣ":"T","Ⓤ":"U","Ⓥ":"V","Ⓦ":"W","Ⓧ":"X","Ⓨ":"Y","Ⓩ":"Z","ⓐ":"a","ⓑ":"b","ⓒ":"c","ⓓ":"d","ⓔ":"e","ⓕ":"f","ⓖ":"g","ⓗ":"h","ⓘ":"i","ⓙ":"j","ⓚ":"k","ⓛ":"l","ⓜ":"m","ⓝ":"n","ⓞ":"o","ⓟ":"p","ⓠ":"q","ⓡ":"r","ⓢ":"s","ⓣ":"t","ⓤ":"u","ⓦ":"v","ⓥ":"w","ⓧ":"x","ⓨ":"y","ⓩ":"z","“":'"',"”":'"',"‘":"'","’":"'","∂":"d",ƒ:"f","™":"(TM)","©":"(C)",œ:"oe",Œ:"OE","®":"(R)","†":"+","℠":"(SM)","…":"...","˚":"o",º:"o",ª:"a","•":"*","၊":",","။":".",$:"USD","€":"EUR","₢":"BRN","₣":"FRF","£":"GBP","₤":"ITL","₦":"NGN","₧":"ESP","₩":"KRW","₪":"ILS","₫":"VND","₭":"LAK","₮":"MNT","₯":"GRD","₱":"ARS","₲":"PYG","₳":"ARA","₴":"UAH","₵":"GHS","¢":"cent","Â¥":"CNY",元:"CNY",円:"YEN","ï·¼":"IRR","₠":"EWE","฿":"THB","₨":"INR","₹":"INR","₰":"PF","₺":"TRY","؋":"AFN","₼":"AZN",лв:"BGN","៛":"KHR","₡":"CRC","₸":"KZT",ден:"MKD",zł:"PLN","₽":"RUB","₾":"GEL"},i=["်","Þ°"],o={"ာ":"a","ါ":"a","ေ":"e","ဲ":"e","ိ":"i","ီ":"i","ို":"o","ု":"u","ူ":"u","ေါင်":"aung","ော":"aw","ော်":"aw","ေါ":"aw","ေါ်":"aw","်":"်","က်":"et","ိုက်":"aik","ောက်":"auk","င်":"in","ိုင်":"aing","ောင်":"aung","စ်":"it","ည်":"i","တ်":"at","ိတ်":"eik","ုတ်":"ok","ွတ်":"ut","ေတ်":"it","ဒ်":"d","ိုဒ်":"ok","ုဒ်":"ait","န်":"an","ာန်":"an","ိန်":"ein","ုန်":"on","ွန်":"un","ပ်":"at","ိပ်":"eik","ုပ်":"ok","ွပ်":"ut","န်ုပ်":"nub","မ်":"an","ိမ်":"ein","ုမ်":"on","ွမ်":"un","ယ်":"e","ိုလ်":"ol","ဉ်":"in","ံ":"an","ိံ":"ein","ုံ":"on","ައް":"ah","ަށް":"ah"},s={en:{},az:{ç:"c",ə:"e",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"C",Ə:"E",Ğ:"G",İ:"I",Ö:"O",Ş:"S",Ü:"U"},cs:{č:"c",ď:"d",ě:"e",ň:"n",ř:"r",Å¡:"s",Å¥:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Å :"S",Ť:"T",Å®:"U",Ž:"Z"},fi:{ä:"a",Ä:"A",ö:"o",Ö:"O"},hu:{ä:"a",Ä:"A",ö:"o",Ö:"O",ü:"u",Ü:"U",ű:"u",Ű:"U"},lt:{ą:"a",č:"c",ę:"e",ė:"e",į:"i",Å¡:"s",ų:"u",Å«:"u",ž:"z",Ą:"A",Č:"C",Ę:"E",Ė:"E",Ä®:"I",Å :"S",Ų:"U",Ū:"U"},lv:{ā:"a",č:"c",ē:"e",Ä£:"g",Ä«:"i",Ä·:"k",ļ:"l",ņ:"n",Å¡:"s",Å«:"u",ž:"z",Ā:"A",Č:"C",Ē:"E",Ä¢:"G",Ī:"i",Ķ:"k",Ä»:"L",Ņ:"N",Å :"S",Ū:"u",Ž:"Z"},pl:{ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ó:"o",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"e",Ł:"L",Ń:"N",Ó:"O",Ś:"S",Ź:"Z",Å»:"Z"},sv:{ä:"a",Ä:"A",ö:"o",Ö:"O"},sk:{ä:"a",Ä:"A"},sr:{љ:"lj",њ:"nj",Љ:"Lj",Њ:"Nj",đ:"dj",Đ:"Dj"},tr:{Ü:"U",Ö:"O",ü:"u",ö:"o"}},l={ar:{"∆":"delta","∞":"la-nihaya","♥":"hob","&":"wa","|":"aw","<":"aqal-men",">":"akbar-men","∑":"majmou","¤":"omla"},az:{},ca:{"∆":"delta","∞":"infinit","♥":"amor","&":"i","|":"o","<":"menys que",">":"mes que","∑":"suma dels","¤":"moneda"},cs:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"nebo","<":"mensi nez",">":"vetsi nez","∑":"soucet","¤":"mena"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},dv:{"∆":"delta","∞":"kolunulaa","♥":"loabi","&":"aai","|":"noonee","<":"ah vure kuda",">":"ah vure bodu","∑":"jumula","¤":"faisaa"},en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},fa:{"∆":"delta","∞":"bi-nahayat","♥":"eshgh","&":"va","|":"ya","<":"kamtar-az",">":"bishtar-az","∑":"majmooe","¤":"vahed"},fi:{"∆":"delta","∞":"aarettomyys","♥":"rakkaus","&":"ja","|":"tai","<":"pienempi kuin",">":"suurempi kuin","∑":"summa","¤":"valuutta"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},ge:{"∆":"delta","∞":"usasruloba","♥":"siqvaruli","&":"da","|":"an","<":"naklebi",">":"meti","∑":"jami","¤":"valuta"},gr:{},hu:{"∆":"delta","∞":"vegtelen","♥":"szerelem","&":"es","|":"vagy","<":"kisebb mint",">":"nagyobb mint","∑":"szumma","¤":"penznem"},it:{"∆":"delta","∞":"infinito","♥":"amore","&":"e","|":"o","<":"minore di",">":"maggiore di","∑":"somma","¤":"moneta"},lt:{"∆":"delta","∞":"begalybe","♥":"meile","&":"ir","|":"ar","<":"maziau nei",">":"daugiau nei","∑":"suma","¤":"valiuta"},lv:{"∆":"delta","∞":"bezgaliba","♥":"milestiba","&":"un","|":"vai","<":"mazak neka",">":"lielaks neka","∑":"summa","¤":"valuta"},my:{"∆":"kwahkhyaet","∞":"asaonasme","♥":"akhyait","&":"nhin","|":"tho","<":"ngethaw",">":"kyithaw","∑":"paungld","¤":"ngwekye"},mk:{},nl:{"∆":"delta","∞":"oneindig","♥":"liefde","&":"en","|":"of","<":"kleiner dan",">":"groter dan","∑":"som","¤":"valuta"},pl:{"∆":"delta","∞":"nieskonczonosc","♥":"milosc","&":"i","|":"lub","<":"mniejsze niz",">":"wieksze niz","∑":"suma","¤":"waluta"},pt:{"∆":"delta","∞":"infinito","♥":"amor","&":"e","|":"ou","<":"menor que",">":"maior que","∑":"soma","¤":"moeda"},ro:{"∆":"delta","∞":"infinit","♥":"dragoste","&":"si","|":"sau","<":"mai mic ca",">":"mai mare ca","∑":"suma","¤":"valuta"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"},sk:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"alebo","<":"menej ako",">":"viac ako","∑":"sucet","¤":"mena"},sr:{},tr:{"∆":"delta","∞":"sonsuzluk","♥":"ask","&":"ve","|":"veya","<":"kucuktur",">":"buyuktur","∑":"toplam","¤":"para birimi"},uk:{"∆":"delta","∞":"bezkinechnist","♥":"lubov","&":"i","|":"abo","<":"menshe",">":"bilshe","∑":"suma","¤":"valjuta"},vn:{"∆":"delta","∞":"vo cuc","♥":"yeu","&":"va","|":"hoac","<":"nho hon",">":"lon hon","∑":"tong","¤":"tien te"}},u=[";","?",":","@","&","=","+","$",",","/"].join(""),d=[";","?",":","@","&","=","+","$",","].join(""),f=[".","!","~","*","'","(",")"].join(""),p=function(S,x){var T="-",C="",I="",D=!0,P={},V,ee,F,H,te,M,Z,L,W,U,q,Q,re,ne,J="";
518if(typeof S!="string")return"";if(typeof x=="string"&&(T=x),Z=l.en,L=s.en,typeof x=="object"){V=x.maintainCase||!1,P=x.custom&&typeof x.custom=="object"?x.custom:P,F=+x.truncate>1&&x.truncate||!1,H=x.uric||!1,te=x.uricNoSlash||!1,M=x.mark||!1,D=!(x.symbols===!1||x.lang===!1),T=x.separator||T,H&&(J+=u),te&&(J+=d),M&&(J+=f),Z=x.lang&&l[x.lang]&&D?l[x.lang]:D?l.en:{},L=x.lang&&s[x.lang]?s[x.lang]:x.lang===!1||x.lang===!0?{}:s.en,x.titleCase&&typeof x.titleCase.length=="number"&&Array.prototype.toString.call(x.titleCase)?(x.titleCase.forEach(function(ge){P[ge+""]=ge+""}),ee=!0):ee=!!x.titleCase,x.custom&&typeof x.custom.length=="number"&&Array.prototype.toString.call(x.custom)&&x.custom.forEach(function(ge){P[ge+""]=ge+""}),Object.keys(P).forEach(function(ge){var le;ge.length>1?le=new RegExp("\\b"+y(ge)+"\\b","gi"):le=new RegExp(y(ge),"gi"),S=S.replace(le,P[ge])});for(q in P)J+=q}for(J+=T,J=y(J),S=S.replace(/(^\s+|\s+$)/g,""),re=!1,ne=!1,U=0,Q=S.length;U<Q;U++)q=S[U],b(q,P)?re=!1:L[q]?(q=re&&L[q].match(/[A-Za-z0-9]/)?" "+L[q]:L[q],re=!1):q in r?(U+1<Q&&i.indexOf(S[U+1])>=0?(I+=q,q=""):ne===!0?(q=o[I]+r[q],I=""):q=re&&r[q].match(/[A-Za-z0-9]/)?" "+r[q]:r[q],re=!1,ne=!1):q in o?(I+=q,q="",U===Q-1&&(q=o[I]),ne=!0):Z[q]&&!(H&&u.indexOf(q)!==-1)&&!(te&&d.indexOf(q)!==-1)?(q=re||C.substr(-1).match(/[A-Za-z0-9]/)?T+Z[q]:Z[q],q+=S[U+1]!==void 0&&S[U+1].match(/[A-Za-z0-9]/)?T:"",re=!0):(ne===!0?(q=o[I]+q,I="",ne=!1):re&&(/[A-Za-z0-9]/.test(q)||C.substr(-1).match(/A-Za-z0-9]/))&&(q=" "+q),re=!1),C+=q.replace(new RegExp("[^\\w\\s"+J+"_-]","g"),T);return ee&&(C=C.replace(/(\w)(\S*)/g,function(ge,le,ve){var Ee=le.toUpperCase()+(ve!==null?ve:"");return Object.keys(P).indexOf(Ee.toLowerCase())<0?Ee:Ee.toLowerCase()})),C=C.replace(/\s+/g,T).replace(new RegExp("\\"+T+"+","g"),T).replace(new RegExp("(^\\"+T+"+|\\"+T+"+$)","g"),""),F&&C.length>F&&(W=C.charAt(F)===T,C=C.slice(0,F),W||(C=C.slice(0,C.lastIndexOf(T)))),!V&&!ee&&(C=C.toLowerCase()),C},m=function(S){return function(T){return p(T,S)}},y=function(S){return S.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},b=function(k,S){for(var x in S)if(S[x]===k)return!0};if(typeof t<"u"&&t.exports)t.exports=p,t.exports.createSlug=m;else if(typeof define<"u"&&define.amd)define([],function(){return p});else try{if(n.getSlug||n.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";n.getSlug=p,n.createSlug=m}catch{}})(e)}}),Zoe=OB({"../../node_modules/.pnpm/[email protected]/node_modules/speakingurl/index.js"(e,t){On(),t.exports=Xoe()}});On();On();On();On();On();On();On();On();function Qoe(e){var t;const n=e.name||e._componentTag||e.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||e.__name;return n==="index"&&((t=e.__file)!=null&&t.endsWith("index.vue"))?"":n}function Joe(e){const t=e.__file;if(t)return Doe(Loe(t,".vue"))}function RR(e,t){return e.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__=t,t}function H5(e){if(e.__VUE_DEVTOOLS_NEXT_APP_RECORD__)return e.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(e.root)return e.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__}function NB(e){var t,n;const r=(t=e.subTree)==null?void 0:t.type,i=H5(e);return i?((n=i==null?void 0:i.types)==null?void 0:n.Fragment)===r:!1}function mC(e){var t,n,r;const i=Qoe((e==null?void 0:e.type)||{});if(i)return i;if((e==null?void 0:e.root)===e)return"Root";for(const s in(n=(t=e.parent)==null?void 0:t.type)==null?void 0:n.components)if(e.parent.type.components[s]===(e==null?void 0:e.type))return RR(e,s);for(const s in(r=e.appContext)==null?void 0:r.components)if(e.appContext.components[s]===(e==null?void 0:e.type))return RR(e,s);const o=Joe((e==null?void 0:e.type)||{});return o||"Anonymous Component"}function ese(e){var t,n,r;return`${(r=(n=(t=e==null?void 0:e.appContext)==null?void 0:t.app)==null?void 0:n.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__)!=null?r:0}:${e===(e==null?void 0:e.root)?"root":e.uid}`}function uE(e,t){return t=t||`${e.id}:root`,e.instanceMap.get(t)||e.instanceMap.get(":root")}function tse(){const e={top:0,bottom:0,left:0,right:0,get width(){return e.right-e.left},get height(){return e.bottom-e.top}};return e}var Xw;function nse(e){return Xw||(Xw=document.createRange()),Xw.selectNode(e),Xw.getBoundingClientRect()}function rse(e){const t=tse();if(!e.children)return t;for(let n=0,r=e.children.length;n<r;n++){const i=e.children[n];let o;if(i.component)o=wg(i.component);else if(i.el){const s=i.el;s.nodeType===1||s.getBoundingClientRect?o=s.getBoundingClientRect():s.nodeType===3&&s.data.trim()&&(o=nse(s))}o&&ise(t,o)}return t}function ise(e,t){return(!e.top||t.top<e.top)&&(e.top=t.top),(!e.bottom||t.bottom>e.bottom)&&(e.bottom=t.bottom),(!e.left||t.left<e.left)&&(e.left=t.left),(!e.right||t.right>e.right)&&(e.right=t.right),e}var OR={top:0,left:0,right:0,bottom:0,width:0,height:0};function wg(e){const t=e.subTree.el;return typeof window>"u"?OR:NB(e)?rse(e.subTree):(t==null?void 0:t.nodeType)===1?t==null?void 0:t.getBoundingClientRect():e.subTree.component?wg(e.subTree.component):OR}On();function $5(e){return NB(e)?ose(e.subTree):e.subTree?[e.subTree.el]:[]}function ose(e){if(!e.children)return[];const t=[];
518return e.children.forEach(n=>{n.component?t.push(...$5(n.component)):n!=null&&n.el&&t.push(n.el)}),t}var MB="__vue-devtools-component-inspector__",DB="__vue-devtools-component-inspector__card__",LB="__vue-devtools-component-inspector__name__",PB="__vue-devtools-component-inspector__indicator__",BB={display:"block",zIndex:2147483640,position:"fixed",backgroundColor:"#42b88325",border:"1px solid #42b88350",borderRadius:"5px",transition:"all 0.1s ease-in",pointerEvents:"none"},sse={fontFamily:"Arial, Helvetica, sans-serif",padding:"5px 8px",borderRadius:"4px",textAlign:"left",position:"absolute",left:0,color:"#e9e9e9",fontSize:"14px",fontWeight:600,lineHeight:"24px",backgroundColor:"#42b883",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"},ase={display:"inline-block",fontWeight:400,fontStyle:"normal",fontSize:"12px",opacity:.7};function Jy(){return document.getElementById(MB)}function lse(){return document.getElementById(DB)}function cse(){return document.getElementById(PB)}function use(){return document.getElementById(LB)}function G5(e){return{left:`${Math.round(e.left*100)/100}px`,top:`${Math.round(e.top*100)/100}px`,width:`${Math.round(e.width*100)/100}px`,height:`${Math.round(e.height*100)/100}px`}}function q5(e){var t;const n=document.createElement("div");n.id=(t=e.elementId)!=null?t:MB,Object.assign(n.style,{...BB,...G5(e.bounds),...e.style});const r=document.createElement("span");r.id=DB,Object.assign(r.style,{...sse,top:e.bounds.top<35?0:"-35px"});const i=document.createElement("span");i.id=LB,i.innerHTML=`&lt;${e.name}&gt;&nbsp;&nbsp;`;const o=document.createElement("i");return o.id=PB,o.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`,Object.assign(o.style,ase),r.appendChild(i),r.appendChild(o),n.appendChild(r),document.body.appendChild(n),n}function W5(e){const t=Jy(),n=lse(),r=use(),i=cse();t&&(Object.assign(t.style,{...BB,...G5(e.bounds)}),Object.assign(n.style,{top:e.bounds.top<35?0:"-35px"}),r.innerHTML=`&lt;${e.name}&gt;&nbsp;&nbsp;`,i.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`)}function dse(e){const t=wg(e);if(!t.width&&!t.height)return;const n=mC(e);Jy()?W5({bounds:t,name:n}):q5({bounds:t,name:n})}function jB(){const e=Jy();e&&(e.style.display="none")}var dE=null;function fE(e){const t=e.target;if(t){const n=t.__vueParentComponent;if(n&&(dE=n,n.vnode.el)){const r=wg(n),i=mC(n);Jy()?W5({bounds:r,name:i}):q5({bounds:r,name:i})}}}function fse(e,t){e.preventDefault(),e.stopPropagation(),dE&&t(ese(dE))}var Jk=null;function hse(){jB(),window.removeEventListener("mouseover",fE),window.removeEventListener("click",Jk,!0),Jk=null}function pse(){return window.addEventListener("mouseover",fE),new Promise(e=>{function t(n){n.preventDefault(),n.stopPropagation(),fse(n,r=>{window.removeEventListener("click",t,!0),Jk=null,window.removeEventListener("mouseover",fE);const i=Jy();i&&(i.style.display="none"),e(JSON.stringify({id:r}))})}Jk=t,window.addEventListener("click",t,!0)})}function mse(e){const t=uE(kl.value,e.id);if(t){const[n]=$5(t);if(typeof n.scrollIntoView=="function")n.scrollIntoView({behavior:"smooth"});else{const r=wg(t),i=document.createElement("div"),o={...G5(r),position:"absolute"};Object.assign(i.style,o),document.body.appendChild(i),i.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{document.body.removeChild(i)},2e3)}setTimeout(()=>{const r=wg(t);if(r.width||r.height){const i=mC(t),o=Jy();o?W5({...e,name:i,bounds:r}):q5({...e,name:i,bounds:r}),setTimeout(()=>{o&&(o.style.display="none")},1500)}},1200)}}On();var NR;(NR=Xn).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__??(NR.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__=!0);function gse(e){let t=0;const n=setInterval(()=>{Xn.__VUE_INSPECTOR__&&(clearInterval(n),t+=30,e()),t>=5e3&&clearInterval(n)},30)}function yse(){const e=Xn.__VUE_INSPECTOR__,t=e.openInEditor;e.openInEditor=async(...n)=>{e.disable(),t(...n)}}function vse(){return new Promise(e=>{function t(){yse(),e(Xn.__VUE_INSPECTOR__)}Xn.__VUE_INSPECTOR__?t():gse(()=>{t()})})}On();On();function bse(e){return!!(e&&e.__v_isReadonly)}function FB(e){return bse(e)?FB(e.__v_raw):!!(e&&e.__v_isReactive)}function v3(e){return!!(e&&e.__v_isRef===!0)}function Eb(e){const t=e&&e.__v_raw;return t?Eb(t):e}var wse=class{constructor(){this.refEditor=new xse}set(e,t,n,r){const i=Array.isArray(t)?t:t.split(".");for(;i.length>1;){const l=i.shift();e instanceof Map?e=e.get(l):e instanceof Set?e=Array.from(e.values())[l]:e
518=e[l],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}const o=i[0],s=this.refEditor.get(e)[o];r?r(e,o,n):this.refEditor.isRef(s)?this.refEditor.set(s,n):e[o]=n}get(e,t){const n=Array.isArray(t)?t:t.split(".");for(let r=0;r<n.length;r++)if(e instanceof Map?e=e.get(n[r]):e=e[n[r]],this.refEditor.isRef(e)&&(e=this.refEditor.get(e)),!e)return;return e}has(e,t,n=!1){if(typeof e>"u")return!1;const r=Array.isArray(t)?t.slice():t.split("."),i=n?2:1;for(;e&&r.length>i;){const o=r.shift();e=e[o],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}return e!=null&&Object.prototype.hasOwnProperty.call(e,r[0])}createDefaultSetCallback(e){return(t,n,r)=>{if((e.remove||e.newKey)&&(Array.isArray(t)?t.splice(n,1):Eb(t)instanceof Map?t.delete(n):Eb(t)instanceof Set?t.delete(Array.from(t.values())[n]):Reflect.deleteProperty(t,n)),!e.remove){const i=t[e.newKey||n];this.refEditor.isRef(i)?this.refEditor.set(i,r):Eb(t)instanceof Map?t.set(e.newKey||n,r):Eb(t)instanceof Set?t.add(r):t[e.newKey||n]=r}}}},xse=class{set(e,t){if(v3(e))e.value=t;else{if(e instanceof Set&&Array.isArray(t)){e.clear(),t.forEach(i=>e.add(i));return}const n=Object.keys(t);if(e instanceof Map){const i=new Set(e.keys());n.forEach(o=>{e.set(o,Reflect.get(t,o)),i.delete(o)}
518),i.forEach(o=>e.delete(o));return}const r=new Set(Object.keys(e));n.forEach(i=>{Reflect.set(e,i,Reflect.get(t,i)),r.delete(i)}),r.forEach(i=>Reflect.deleteProperty(e,i))}}get(e){return v3(e)?e.value:e}isRef(e){return v3(e)||FB(e)}};On();On();On();var kse="__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";function _se(){if(typeof window>"u"||!AB||typeof localStorage>"u"||localStorage===null)return{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""};const e=typeof localStorage.getItem<"u"?localStorage.getItem(kse):null;return e?JSON.parse(e):{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""}}On();On();On();var MR;(MR=Xn).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS??(MR.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS=[]);var Cse=new Proxy(Xn.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS,{get(e,t,n){return Reflect.get(e,t,n)}});function Sse(e,t){Qs.timelineLayersState[t.id]=!1,Cse.push({...e,descriptorId:t.id,appRecord:H5(t.app)})}var DR;(DR=Xn).__VUE_DEVTOOLS_KIT_INSPECTOR__??(DR.__VUE_DEVTOOLS_KIT_INSPECTOR__=[]);var K5=new Proxy(Xn.__VUE_DEVTOOLS_KIT_INSPECTOR__,{get(e,t,n){return Reflect.get(e,t,n)}}),zB=Ly(()=>{ev.hooks.callHook("sendInspectorToClient",UB())});function Ese(e,t){var n,r;K5.push({options:e,descriptor:t,treeFilterPlaceholder:(n=e.treeFilterPlaceholder)!=null?n:"Search tree...",stateFilterPlaceholder:(r=e.stateFilterPlaceholder)!=null?r:"Search state...",treeFilter:"",selectedNodeId:"",appRecord:H5(t.app)}),zB()}function UB(){return K5.filter(e=>e.descriptor.app===kl.value.app).filter(e=>e.descriptor.id!=="components").map(e=>{var t;const n=e.descriptor,r=e.options;return{id:r.id,label:r.label,logo:n.logo,icon:`custom-ic-baseline-${(t=r==null?void 0:r.icon)==null?void 0:t.replace(/_/g,"-")}`,packageName:n.packageName,homepage:n.homepage,pluginId:n.id}})}function Ux(e,t){return K5.find(n=>n.options.id===e&&(t?n.descriptor.app===t:!0))}function Ase(){const e=IB();e.hook("addInspector",({inspector:r,plugin:i})=>{Ese(r,i.descriptor)});const t=Ly(async({inspectorId:r,plugin:i})=>{var o;if(!r||!((o=i==null?void 0:i.descriptor)!=null&&o.app)||Qs.highPerfModeEnabled)return;const s=Ux(r,i.descriptor.app),l={app:i.descriptor.app,inspectorId:r,filter:(s==null?void 0:s.treeFilter)||"",rootNodes:[]};await new Promise(u=>{e.callHookWith(async d=>{await Promise.all(d.map(f=>f(l))),u()},"getInspectorTree")}),e.callHookWith(async u=>{await Promise.all(u.map(d=>d({inspectorId:r,rootNodes:l.rootNodes})))},"sendInspectorTreeToClient")},120);e.hook("sendInspectorTree",t);const n=Ly(async({inspectorId:r,plugin:i})=>{var o;if(!r||!((o=i==null?void 0:i.descriptor)!=null&&o.app)||Qs.highPerfModeEnabled)return;const s=Ux(r,i.descriptor.app),l={app:i.descriptor.app,inspectorId:r,nodeId:(s==null?void 0:s.selectedNodeId)||"",state:null},u={currentTab:`custom-inspector:${r}`};l.nodeId&&await new Promise(d=>{e.callHookWith(async f=>{await Promise.all(f.map(p=>p(l,u))),d()},"getInspectorState")}),e.callHookWith(async d=>{await Promise.all(d.map(f=>f({inspectorId:r,nodeId:l.nodeId,state:l.state})))},"sendInspectorStateToClient")},120);return e.hook("sendInspectorState",n),e.hook("customInspectorSelectNode",({inspectorId:r,nodeId:i,plugin:o})=>{const s=Ux(r,o.descriptor.app);s&&(s.selectedNodeId=i)}),e.hook("timelineLayerAdded",({options:r,plugin:i})=>{Sse(r,i.descriptor)}),e.hook("timelineEventAdded",({options:r,plugin:i})=>{var o;Qs.highPerfModeEnabled||!((o=Qs.timelineLayersState)!=null&&o[i.descriptor.id])&&!["performance","component-event","keyboard","mouse"].includes(r.layerId)||e.callHookWith(async s=>{await Promise.all(s.map(l=>l(r)))},"sendTimelineEventToClient")}),e.hook("getComponentInstances",async({app:r})=>{const i=r.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(!i)return null;const o=i.id.toString();return[...i.instanceMap].filter(([s])=>s.split(":")[0]===o).map(([,s])=>s)}),e.hook("getComponentBounds",async({instance:r})=>wg(r)),e.hook("getComponentName",({instance:r})=>mC(r)),e.hook("componentHighlight",({uid:r})=>{const i=kl.value.instanceMap.get(r);i&&dse(i)}),e.hook("componentUnhighlight",()=>{jB()}),e}var LR;(LR=Xn).__VUE_DEVTOOLS_KIT_APP_RECORDS__??(LR.__VUE_DEVTOOLS_KIT_APP_RECORDS__=[]);var PR;(PR=Xn).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__??(PR.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__={});var BR;(BR=Xn).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__??(BR.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__="");var jR;(jR=Xn).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__??(jR.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__=[]);var FR;(FR=Xn).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__??(FR.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__=[]);var Xm="__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";function Tse(){return{connected:!1,clientConnected:!1,vitePluginDetected:!0,appRecords:[],activeAppRecordId:"",tabs:[],commands:[],highPerfModeEnabled:!0,devtoolsClientDetected:{},perfUniqueGroupId:0,timelineLayersState:_se()}}var zR;(zR=Xn)[Xm]??(zR[Xm]=Tse());var Ise=Ly(e=>{ev.hooks.callHook("devtoolsStateUpdated",{state:e})});Ly((e,t)=>{ev.hooks.callHook("devtoolsConnectedUpdated",{state:e,oldState:t})});var gC=new Proxy(Xn.__VUE_DEVTOOLS_KIT_APP_RECORDS__,{get(e,t,n){return t==="value"?Xn.__VUE_DEVTOOLS_KIT_APP_RECORDS__:Xn.__VUE_DEVTOOLS_KIT_APP_RECORDS__[t]}}),kl=new Proxy(Xn.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__,{get(e,t,n){return t==="value"?Xn.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__:t==="id"?Xn.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__:Xn.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[t]}});function VB(){Ise({...Xn[Xm],appRecords:gC.value,activeAppRecordId:kl.id,tabs:Xn.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,commands:Xn.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__})}function Rse(e){Xn.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__=e,VB()}function Ose(e){Xn.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__=e,VB()}var Qs=new Proxy(Xn[Xm],{get(e,t){return t==="appRecords"?gC:t==="activeAppRecordId"?kl.id:t==="tabs"?Xn.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__:t==="commands"?Xn.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__:Xn[Xm][t]},deleteProperty(e,t){return delete e[t],!0},set(e,t,n){return{...Xn[Xm]},e[t]=n,Xn[Xm][t]=n,!0}});function Nse(e={}){var t,n,r;const{file:i,host:o,baseUrl:s=window.location.origin,line:l=0,column:u=0}=e;if(i){if(o==="chrome-extension"){const d=i.replace(/\\/g,"\\\\"),f=(n=(t=window.VUE_DEVTOOLS_CONFIG)==null?void 0:t.openInEditorHost)!=null?n:"/";fetch(`${f}__open-in-editor?file=${encodeURI(i)}`).then(p=>{if(!p.ok){const m=`Opening component ${d} failed`;console.log(`%c${m}`,"color:red")}})}else if(Qs.vitePluginDetected){const d=(r=Xn.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__)!=null?r:s;Xn.__VUE_INSPECTOR__.openInEditor(d,i,l,u)}}}On();On();On();On();On();var UR;(UR=Xn).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__??(UR.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__=[]);var Y5=new Proxy(Xn.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__,{get(e,t,n){return Reflect.get(e,t,n)}});function hE(e){const t={};return Object.keys(e).forEach(n=>{t[n]=e[n].defaultValue}),t}function X5(e){return`__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${e}__`}function Mse(e){var t,n,r;const i=(n=(t=Y5.find(o=>{var s;return o[0].id===e&&!!((s=o[0])!=null&&s.settings)}))==null?void 0:t[0])!=null?n:null;return(r=i==null?void 0:i.settings)!=null?r:null}function HB(e,t){var n,r,i;const o=X5(e);if(o){const s=localStorage.getItem(o);if(s)return JSON.parse(s)}if(e){const s=(r=(n=Y5.find(l=>l[0].id===e))==null?void 0:n[0])!=null?r:null;return hE((i=s==null?void 0:s.settings)!=null?i:{})}return hE(t)}function Dse(e,t){const n=X5(e);localStorage.getItem(n)||localStorage.setItem(n,JSON.stringify(hE(t)))}function Lse(e,t,n){const r=X5(e),i=localStorage.getItem(r),o=JSON.parse(i||"{}"),s={...o,[t]:n};localStorage.setItem(r,JSON.stringify(s)),ev.hooks.callHookWith(l=>{l.forEach(u=>u({pluginId:e,key:t,oldValue:o[t],newValue:n,settings:s}))},"setPluginSettings")}On();var VR,HR,wc=(HR=(VR=Xn).__VUE_DEVTOOLS_HOOK)!=null?HR:VR.__VUE_DEVTOOLS_HOOK=IB(),$B={on:{vueAppInit(e){wc.hook("app:init",e)},vueAppUnmount(e){wc.hook("app:unmount",e)}
518,vueAppConnected(e){wc.hook("app:connected",e)},componentAdded(e){return wc.hook("component:added",e)},componentEmit(e){return wc.hook("component:emit",e)},componentUpdated(e){return wc.hook("component:updated",e)},componentRemoved(e){return wc.hook("component:removed",e)},setupDevtoolsPlugin(e){wc.hook("devtools-plugin:setup",e)},perfStart(e){return wc.hook("perf:start",e)},perfEnd(e){return wc.hook("perf:end",e)}},setupDevToolsPlugin(e,t){return wc.callHook("devtools-plugin:setup",e,t)}},Pse=class{constructor({plugin:e,ctx:t}){this.hooks=t.hooks,this.plugin=e}get on(){return{visitComponentTree:e=>{this.hooks.hook("visitComponentTree",e)},inspectComponent:e=>{this.hooks.hook("inspectComponent",e)},editComponentState:e=>{this.hooks.hook("editComponentState",e)},getInspectorTree:e=>{this.hooks.hook("getInspectorTree",e)},getInspectorState:e=>{this.hooks.hook("getInspectorState",e)},editInspectorState:e=>{this.hooks.hook("editInspectorState",e)},inspectTimelineEvent:e=>{this.hooks.hook("inspectTimelineEvent",e)},timelineCleared:e=>{this.hooks.hook("timelineCleared",e)},setPluginSettings:e=>{this.hooks.hook("setPluginSettings",e)}}}notifyComponentUpdate(e){var t;if(Qs.highPerfModeEnabled)return;const n=UB().find(r=>r.packageName===this.plugin.descriptor.packageName);if(n!=null&&n.id){if(e){const r=[e.appContext.app,e.uid,(t=e.parent)==null?void 0:t.uid,e];wc.callHook("component:updated",...r)}else wc.callHook("component:updated");this.hooks.callHook("sendInspectorState",{inspectorId:n.id,plugin:this.plugin})}}addInspector(e){this.hooks.callHook("addInspector",{inspector:e,plugin:this.plugin}),this.plugin.descriptor.settings&&Dse(e.id,this.plugin.descriptor.settings)}sendInspectorTree(e){Qs.highPerfModeEnabled||this.hooks.callHook("sendInspectorTree",{inspectorId:e,plugin:this.plugin})}sendInspectorState(e){Qs.highPerfModeEnabled||this.hooks.callHook("sendInspectorState",{inspectorId:e,plugin:this.plugin})}selectInspectorNode(e,t){this.hooks.callHook("customInspectorSelectNode",{inspectorId:e,nodeId:t,plugin:this.plugin})}visitComponentTree(e){return this.hooks.callHook("visitComponentTree",e)}now(){return Qs.highPerfModeEnabled?0:Date.now()}addTimelineLayer(e){this.hooks.callHook("timelineLayerAdded",{options:e,plugin:this.plugin})}addTimelineEvent(e){Qs.highPerfModeEnabled||this.hooks.callHook("timelineEventAdded",{options:e,plugin:this.plugin})}getSettings(e){return HB(e??this.plugin.descriptor.id,this.plugin.descriptor.settings)}getComponentInstances(e){return this.hooks.callHook("getComponentInstances",{app:e})}getComponentBounds(e){return this.hooks.callHook("getComponentBounds",{instance:e})}getComponentName(e){return this.hooks.callHook("getComponentName",{instance:e})}highlightElement(e){const t=e.__VUE_DEVTOOLS_NEXT_UID__;return this.hooks.callHook("componentHighlight",{uid:t})}unhighlightElement(){return this.hooks.callHook("componentUnhighlight")}},Bse=Pse;On();On();On();On();var jse="__vue_devtool_undefined__",Fse="__vue_devtool_infinity__",zse="__vue_devtool_negative_infinity__",Use="__vue_devtool_nan__";On();On();Object.entries({[jse]:"undefined",[Use]:"NaN",[Fse]:"Infinity",[zse]:"-Infinity"}).reduce((e,[t,n])=>(e[n]=t,e),{});On();On();On();On();On();var $R;($R=Xn).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__??($R.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__=new Set);function GB(e,t){return $B.setupDevToolsPlugin(e,t)}function Vse(e,t){const[n,r]=e;if(n.app!==t)return;const i=new Bse({plugin:{setupFn:r,descriptor:n},ctx:ev});n.packageName==="vuex"&&i.on.editInspectorState(o=>{i.sendInspectorState(o.inspectorId)}),r(i)}function qB(e,t){Xn.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(e)||Qs.highPerfModeEnabled&&!(t!=null&&t.inspectingComponent)||(Xn.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(e),Y5.forEach(n=>{Vse(n,e)}))}On();On();var pE="__VUE_DEVTOOLS_ROUTER__",e_="__VUE_DEVTOOLS_ROUTER_INFO__",GR;(GR=Xn).__VUE_DEVTOOLS_ROUTER_INFO__??(GR.__VUE_DEVTOOLS_ROUTER_INFO__={currentRoute:null,routes:[]});var qR;(qR=Xn).__VUE_DEVTOOLS_ROUTER__??(qR.__VUE_DEVTOOLS_ROUTER__={});new Proxy(Xn[e_],{get(e,t){return Xn[e_][t]}});new Proxy(Xn[pE],{get(e,t){if(t==="value")return Xn[pE]}});function Hse(e){const t=new Map;return((e==null?void 0:e.getRoutes())||[]).filter(n=>!t.has(n.path)&&t.set(n.path,1))}function Z5(e){return e.map(t=>{let{path:n,name:r,children:i,meta:o}=t;return i!=null&&i.length&&(i=Z5(i)),{path:n,name:r,children:i,meta:o}})}function $se(e){if(e){const{fullPath:t,hash:n,href:r,path:i,name:o,matched:s,params:l,query:u}=e;return{fullPath:t,hash:n,href:r,path:i,name:o,params:l,query:u,matched:Z5(s)}}return e}function Gse(e,t){function n(){var r;const i=(r=e.app)==null?void 0:r.config.globalProperties.$router,o=$se(i==null?void 0:i.currentRoute.value),s=Z5(Hse(i)),l=console.warn;console.warn=()=>{},Xn[e_]={currentRoute:o?IR(o):{},routes:IR(s)},Xn[pE]=i,console.warn=l}n(),$B.on.componentUpdated(Ly(()=>{var r;((r=t.value)==null?void 0:r.app)===e.app&&(n(),!Qs.highPerfModeEnabled&&ev.hooks.callHook("routerInfoUpdated",{state:Xn[e_]}))},200))}function qse(e){return{async getInspectorTree(t){const n={...t,app:kl.value.a
518pp,rootNodes:[]};return await new Promise(r=>{e.callHookWith(async i=>{await Promise.all(i.map(o=>o(n))),r()},"getInspectorTree")}),n.rootNodes},async getInspectorState(t){const n={...t,app:kl.value.app,state:null},r={currentTab:`custom-inspector:${t.inspectorId}`};return await new Promise(i=>{e.callHookWith(async o=>{await Promise.all(o.map(s=>s(n,r))),i()},"getInspectorState")}),n.state},editInspectorState(t){const n=new wse,r={...t,app:kl.value.app,set:(i,o=t.path,s=t.state.value,l)=>{n.set(i,o,s,l||n.createDefaultSetCallback(t.state))}};e.callHookWith(i=>{i.forEach(o=>o(r))},"editInspectorState")},sendInspectorState(t){const n=Ux(t);e.callHook("sendInspectorState",{inspectorId:t,plugin:{descriptor:n.descriptor,setupFn:()=>({})}})},inspectComponentInspector(){return pse()},cancelInspectComponentInspector(){return hse()},getComponentRenderCode(t){const n=uE(kl.value,t);if(n)return typeof(n==null?void 0:n.type)!="function"?n.render.toString():n.type.toString()},scrollToComponent(t){return mse({id:t})},openInEditor:Nse,getVueInspector:vse,toggleApp(t,n){const r=gC.value.find(i=>i.id===t);r&&(Ose(t),Rse(r),Gse(r,kl),zB(),qB(r.app,n))},inspectDOM(t){const n=uE(kl.value,t);if(n){const[r]=$5(n);r&&(Xn.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__=r)}},updatePluginSettings(t,n,r){Lse(t,n,r)},getPluginSettings(t){return{options:Mse(t),values:HB(t)}}}}On();var WR;(WR=Xn).__VUE_DEVTOOLS_ENV__??(WR.__VUE_DEVTOOLS_ENV__={vitePluginDetected:!1});var KR=Ase(),YR;(YR=Xn).__VUE_DEVTOOLS_KIT_CONTEXT__??(YR.__VUE_DEVTOOLS_KIT_CONTEXT__={hooks:KR,get state(){return{...Qs,activeAppRecordId:kl.id,activeAppRecord:kl.value,appRecords:gC.value}},api:qse(KR)});var ev=Xn.__VUE_DEVTOOLS_KIT_CONTEXT__;On();Yoe(Zoe());var XR;(XR=Xn).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__!=null||(XR.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__={id:0,appIds:new Set});On();On();function Wse(e){Qs.highPerfModeEnabled=e??!Qs.highPerfModeEnabled,!e&&kl.value&&qB(kl.value.app)}On();On();On();function Kse(e){Qs.devtoolsClientDetected={...Qs.devtoolsClientDetected,...e},Wse(!Object.values(Qs.devtoolsClientDetected).some(Boolean))}var ZR;(ZR=Xn).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__??(ZR.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__=Kse);On();On();On();On();On();On();var Yse=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},WB=class{constructor(e){this.generateIdentifier=e,this.kv=new Yse}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},Xse=class extends WB{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};On();On();function Zse(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function Qse(e,t){const n=Zse(e);if("find"in n)return n.find(t);const r=n;for(let i=0;i<r.length;i++){const o=r[i];if(t(o))return o}}function Py(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function Vx(e,t){return e.indexOf(t)!==-1}function QR(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var Jse=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return Qse(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}};On();On();var eae=e=>Object.prototype.toString.call(e).slice(8,-1),KB=e=>typeof e>"u",tae=e=>e===null,H1=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,mE=e=>H1(e)&&Object.keys(e).length===0,Jp=e=>Array.isArray(e),nae=e=>typeof e=="string",rae=e=>typeof e=="number"&&!isNaN(e),iae=e=>typeof e=="boolean",oae=e=>e instanceof RegExp,$1=e=>e instanceof Map,G1=e=>e instanceof Set,YB=e=>eae(e)==="Symbol",sae=e=>e instanceof Date&&!isNaN(e.valueOf()),aae=e=>e instanceof Error,JR=e=>typeof e=="number"&&isNaN(e),lae=e=>iae(e)||tae(e)||KB(e)||rae(e)||nae(e)||YB(e),cae=e=>typeof e=="bigint",uae=e=>e===1/0||e===-1/0,dae=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),fae=e=>e instanceof URL;On();var XB=e=>e.replace(/\./g,"\\."),b3=e=>e.map(String).map(XB).join("."),i1=e=>{const t=[];let n="";for(let i=0;i<e.length;i++){let o=e.charAt(i);if(o==="\\"&&e.charAt(i+1)==="."){n+=".",i++;continue}if(o==="."){t.push(n),n="";continue}n+=o}const r=n;return t.push(r),t};On();function md(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var ZB=[md(KB,"undefined",()=>null,()=>{}),md(cae,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),md(sae,"Date",e=>e.toISOString(),e=>new Date(e)),md(aae,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),md(oae,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),md(G1,"set",e=>[...e.values()],e=>new Set(e)),md($1,"map",e=>[...e.entries()],e=>new Map(e)),md(e=>JR(e)||uae(e),"number",e=>JR(e)?"NaN":e>0?"Infinity":"-Infinity",Number),md(e=>
518e===0&&1/e===-1/0,"number",()=>"-0",Number),md(fae,"URL",e=>e.toString(),e=>new URL(e))];function yC(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var QB=yC((e,t)=>YB(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),hae=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),JB=yC(dae,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=hae[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function ej(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var tj=yC(ej,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(i=>{r[i]=e[i]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),nj=yC((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),pae=[tj,QB,nj,JB],eO=(e,t)=>{const n=QR(pae,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=QR(ZB,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},rj={};ZB.forEach(e=>{rj[e.annotation]=e});var mae=(e,t,n)=>{if(Jp(t))switch(t[0]){case"symbol":return QB.untransform(e,t,n);case"class":return tj.untransform(e,t,n);case"custom":return nj.untransform(e,t,n);case"typed-array":return JB.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=rj[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}};On();var z0=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function ij(e){if(Vx(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Vx(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Vx(e,"constructor"))throw new Error("constructor is not allowed as a property")}var gae=(e,t)=>{ij(t);for(let n=0;n<t.length;n++){const r=t[n];if(G1(e))e=z0(e,+r);else if($1(e)){const i=+r,o=+t[++n]==0?"key":"value",s=z0(e,i);switch(o){case"key":e=s;break;case"value":e=e.get(s);break}}else e=e[r]}return e},gE=(e,t,n)=>{if(ij(t),t.length===0)return n(e);let r=e;for(let o=0;o<t.length-1;o++){const s=t[o];if(Jp(r)){const l=+s;r=r[l]}else if(H1(r))r=r[s];else if(G1(r)){const l=+s;r=z0(r,l)}else if($1(r)){if(o===t.length-2)break;const l=+s,u=+t[++o]==0?"key":"value",d=z0(r,l);switch(u){case"key":r=d;break;case"value":r=r.get(d);break}}}const i=t[t.length-1];if(Jp(r)?r[+i]=n(r[+i]):H1(r)&&(r[i]=n(r[i])),G1(r)){const o=z0(r,+i),s=n(o);o!==s&&(r.delete(o),r.add(s))}if($1(r)){const o=+t[t.length-2],s=z0(r,o);switch(+i==0?"key":"value"){case"key":{const l=n(s);r.set(l,r.get(s)),l!==s&&r.delete(s);break}case"value":r.set(s,n(r.get(s)));break}}return e};function yE(e,t,n=[]){if(!e)return;if(!Jp(e)){Py(e,(o,s)=>yE(o,t,[...n,...i1(s)]));return}const[r,i]=e;i&&Py(i,(o,s)=>{yE(o,t,[...n,...i1(s)])}),t(r,n)}function yae(e,t,n){return yE(t,(r,i)=>{e=gE(e,i,o=>mae(o,r,n))}),e}function vae(e,t){function n(r,i){const o=gae(e,i1(i));r.map(i1).forEach(s=>{e=gE(e,s,()=>o)})}if(Jp(t)){const[r,i]=t;r.forEach(o=>{e=gE(e,i1(o),()=>e)}),i&&Py(i,n)}else Py(t,n);return e}var bae=(e,t)=>H1(e)||Jp(e)||$1(e)||G1(e)||ej(e,t);function wae(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function xae(e,t){const n={};let r;return e.forEach(i=>
518{if(i.length<=1)return;t||(i=i.map(l=>l.map(String)).sort((l,u)=>l.length-u.length));const[o,...s]=i;o.length===0?r=s.map(b3):n[b3(o)]=s.map(b3)}),r?mE(n)?[r]:[r,n]:mE(n)?void 0:n}var oj=(e,t,n,r,i=[],o=[],s=new Map)=>{var l;const u=lae(e);if(!u){wae(e,i,t);const b=s.get(e);if(b)return r?{transformedValue:null}:b}if(!bae(e,n)){const b=eO(e,n),k=b?{transformedValue:b.value,annotations:[b.type]}:{transformedValue:e};return u||s.set(e,k),k}if(Vx(o,e))return{transformedValue:null};const d=eO(e,n),f=(l=d==null?void 0:d.value)!=null?l:e,p=Jp(f)?[]:{},m={};Py(f,(b,k)=>{if(k==="__proto__"||k==="constructor"||k==="prototype")throw new Error(`Detected property ${k}. This is a prototype pollution risk, please remove it from your object.`);const S=oj(b,t,n,r,[...i,k],[...o,e],s);p[k]=S.transformedValue,Jp(S.annotations)?m[k]=S.annotations:H1(S.annotations)&&Py(S.annotations,(x,T)=>{m[XB(k)+"."+T]=x})});const y=mE(m)?{transformedValue:p,annotations:d?[d.type]:void 0}:{transformedValue:p,annotations:d?[d.type,m]:m};return u||s.set(e,y),y};On();On();function sj(e){return Object.prototype.toString.call(e).slice(8,-1)}function tO(e){return sj(e)==="Array"}function kae(e){if(sj(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function _ae(e,t,n,r,i){const o={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";o==="enumerable"&&(e[t]=n),i&&o==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function vE(e,t={}){if(tO(e))return e.map(i=>vE(i,t));if(!kae(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,o)=>
518{if(tO(t.props)&&!t.props.includes(o))return i;const s=e[o];return _ae(i,o,vE(s,t),e,t.nonenumerable),i},{})}var xo=class{constructor({dedupe:e=!1}={}){this.classRegistry=new Xse,this.symbolRegistry=new WB(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new Jse,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=oj(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const i=xae(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){const{json:t,meta:n}=e;let r=vE(t);return n!=null&&n.values&&(r=yae(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=vae(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};xo.defaultInstance=new xo;xo.serialize=xo.defaultInstance.serialize.bind(xo.defaultInstance);xo.deserialize=xo.defaultInstance.deserialize.bind(xo.defaultInstance);xo.stringify=xo.defaultInstance.stringify.bind(xo.defaultInstance);xo.parse=xo.defaultInstance.parse.bind(xo.defaultInstance);xo.registerClass=xo.defaultInstance.registerClass.bind(xo.defaultInstance);xo.registerSymbol=xo.defaultInstance.registerSymbol.bind(xo.defaultInstance);xo.registerCustom=xo.defaultInstance.registerCustom.bind(xo.defaultInstance);xo.allowErrorProps=xo.defaultInstance.allowErrorProps.bind(xo.defaultInstance);On();On();On();On();On();On();On();On();On();On();On();On();On();On();On();var nO;(nO=Xn).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__??(nO.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__=[]);var rO;(rO=Xn).__VUE_DEVTOOLS_KIT_RPC_CLIENT__??(rO.__VUE_DEVTOOLS_KIT_RPC_CLIENT__=null);var iO;(iO=Xn).__VUE_DEVTOOLS_KIT_RPC_SERVER__??(iO.__VUE_DEVTOOLS_KIT_RPC_SERVER__=null);var oO;(oO=Xn).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__??(oO.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__=null);var sO;(sO=Xn).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__??(sO.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__=null);var aO;(aO=Xn).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__??(aO.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__=null);On();On();On();On();var Cae=OD(VZ());/*!
519* pinia v3.0.4
520* (c) 2025 Eduardo San Martin Morote
521* @license MIT
522*/N_();r9();var Vp=typeof window<"u",Ab,By=e=>Ab=e;ci.env.NODE_ENV;var aj=ci.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function xg(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Bd;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Bd||(Bd={}));var lO=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof wl=="object"&&wl.global===wl?wl:typeof globalThis=="object"?globalThis:{HTMLElement:null};function Sae(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function Q5(e,t,n){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){uj(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function lj(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Hx(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{const n=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(n)}}var $x=typeof navigator=="object"?navigator:{userAgent:""},cj=/Macintosh/.test($x.userAgent)&&/AppleWebKit/.test($x.userAgent)&&!/Safari/.test($x.userAgent),uj=Vp?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!cj?Eae:"msSaveOrOpenBlob"in $x?Aae:Tae:()=>{};function Eae(e,t="download",n){const r=document.createElement("a");r.download=t,r.rel="noopener",typeof e=="string"?(r.href=e,r.origin!==location.origin?lj(r.href)?Q5(e,t,n):(r.target="_blank",Hx(r)):Hx(r)):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Hx(r)},0))}function Aae(e,t="download",n){if(typeof e=="string")if(lj(e))Q5(e,t,n);else{const r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){Hx(r)})}else navigator.msSaveOrOpenBlob(Sae(e,n),t)}function Tae(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return Q5(e,t,n);const i=e.type==="application/octet-stream",o=/constructor/i.test(String(lO.HTMLElement))||"safari"in lO,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||i&&o||cj)&&typeof FileReader<"u"){const l=new FileReader;l.onloadend=function(){let u=l.result;if(typeof u!="string")throw r=null,new Error("Wrong reader.result type");u=s?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=u:location.assign(u),r=null},l.readAsDataURL(e)}else{const l=URL.createObjectURL(e);r?r.location.assign(l):location.href=l,r=null,setTimeout(function(){URL.revokeObjectURL(l)},4e4)}}function pa(e,t){const n="🍍 "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,t):t==="error"?console.error(n):t==="warn"?console.warn(n):console.log(n)}function J5(e){return"_a"in e&&"install"in e}function dj(){if(!("clipboard"in navigator))return pa("Your browser doesn't support the Clipboard API","error"),!0}function fj(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(pa('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function Iae(e){if(!dj())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),pa("Global state copied to clipboard.")}catch(t){if(fj(t))return;pa("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function Rae(e){if(!dj())try{hj(e,JSON.parse(await navigator.clipboard.readText())),pa("Global state pasted from clipboard.")}catch(t){if(fj(t))return;pa("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function Oae(e){try{uj(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){pa("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}var Df;function Nae(){Df||(Df=document.createElement("input"),Df.type="file",Df.accept=".json");function e(){return new Promise((t,n)=>{Df.onchange=async()=>{const r=Df.files;if(!r)return t(null);const i=r.item(0);return t(i?{text:await i.text(),file:i}:null)},Df.oncancel=()=>t(null),Df.onerror=n,Df.click()})}return e}async function Mae(e){try{const t=await Nae()();if(!t)return;const{text:n,file:r}=t;hj(e,JSON.parse(n)),pa(`Global state imported from "${r.name}".`)}catch(t){pa("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function hj(e,t){for(const n in t){const r=e.state.value[n];r?Object.assign(r,t[n]):e.state.value[n]=t[n]}}function Iu(e){return{_custom:{display:e}}}var pj="🍍 Pinia (root)",Gx="_root";function Dae(e){return J5(e)?{id:Gx,label:pj}:{id:e.$id,label:e.$id}}function Lae(e){if(J5(e)){const n=Array.from(e._s.keys()),r=e._s;return{state:n.map(i=>({editable:!0,key:i,value:e.state.value[i]})),getters:n.filter(i=>r.get(i)._getters).map(i=>{const o=r.get(i);return{editable:!1,key:i,value:o._getters.reduce((s,l)=>(s[l]=o[l],s),{})}})}}const t={state:Object.keys(e.$state).map(n=>({editable:!0,key:n,value:e.$state[n]}))};return e._getters&&e._getters.length&&(t.getters=e._getters.map(n=>({editable:!1,key:n,value:e[n]}))),e._customProperties.size&&(t.customProperties=Array.from(e._customProperties).map(n=>({editable:!0,key:n,value:e[n]}))),t}function Pae(e){return e?Array.isArray(e)?e.reduce((t,n)=>(t.keys.push(n.key),t.operations.push(n.type),t.oldValue[n.key]=n.oldValue,t.newValue[n.key]=n.newValue,t),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:Iu(e.type),key:Iu(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function Bae(e){switch(e){case Bd.direct:return"mutation";case Bd.patchFunction:return"$patch";case Bd.patchObject:return"$patch";default:return"unknown"}}var U0=!0,qx=[],Vm="pinia:mutations",qa="pinia",{assign:jae}=Object,t_=e=>"🍍 "+e;function Fae(e,t){GB({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:qx,app:e},n=>{typeof n.now!="function"&&pa("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),n.addTimelineLayer({id:Vm,label:"Pinia 🍍",color:15064968}),n.addInspector({id:qa,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{Iae(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await Rae(t),n.sendInspectorTree(qa),n.sendInspectorState(qa)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{Oae(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Mae(t),n.sendInspectorTree(qa),n.sendInspectorState(qa)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:r=>{const i=t._s.get(r);i?typeof i.$reset!="function"?pa(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(i.$reset(),pa(`Store "${r}" reset.`)):pa(`Cannot reset "${r}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent(r=>{const i=r.componentInstance&&r.componentInstance.proxy;if(i&&i._pStores){const o=r.componentInstance.proxy._pStores;
522Object.values(o).forEach(s=>{r.instanceData.state.push({type:t_(s.$id),key:"state",editable:!0,value:s._isOptionsAPI?{_custom:{value:au(s.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>s.$reset()}]}}:Object.keys(s.$state).reduce((l,u)=>(l[u]=s.$state[u],l),{})}),s._getters&&s._getters.length&&r.instanceData.state.push({type:t_(s.$id),key:"getters",editable:!1,value:s._getters.reduce((l,u)=>{try{l[u]=s[u]}catch(d){l[u]=d}return l},{})})})}}),n.on.getInspectorTree(r=>{if(r.app===e&&r.inspectorId===qa){let i=[t];i=i.concat(Array.from(t._s.values())),r.rootNodes=(r.filter?i.filter(o=>"$id"in o?o.$id.toLowerCase().includes(r.filter.toLowerCase()):pj.toLowerCase().includes(r.filter.toLowerCase())):i).map(Dae)}}),globalThis.$pinia=t,n.on.getInspectorState(r=>{if(r.app===e&&r.inspectorId===qa){const i=r.nodeId===Gx?t:t._s.get(r.nodeId);if(!i)return;i&&(r.nodeId!==Gx&&(globalThis.$store=au(i)),r.state=Lae(i))}}),n.on.editInspectorState(r=>{if(r.app===e&&r.inspectorId===qa){const i=r.nodeId===Gx?t:t._s.get(r.nodeId);if(!i)return pa(`store "${r.nodeId}" not found`,"error");const{path:o}=r;J5(i)?o.unshift("state"):(o.length!==1||!i._customProperties.has(o[0])||o[0]in i.$state)&&o.unshift("$state"),U0=!1,r.set(i,o,r.state.value),U0=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const i=r.type.replace(/^🍍\s*/,""),o=t._s.get(i);if(!o)return pa(`store "${i}" not found`,"error");const{path:s}=r;if(s[0]!=="state")return pa(`Invalid path for store "${i}":
523${s}
524Only state can be modified.`);s[0]="$state",U0=!1,r.set(o,s,r.state.value),U0=!0}})})}function zae(e,t){qx.includes(t_(t.$id))||qx.push(t_(t.$id)),GB({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:qx,app:e,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},n=>{const r=typeof n.now=="function"?n.now.bind(n):Date.now;t.$onAction(({after:s,onError:l,name:u,args:d})=>{const f=mj++;n.addTimelineEvent({layerId:Vm,event:{time:r(),title:"🛫 "+u,subtitle:"start",data:{store:Iu(t.$id),action:Iu(u),args:d},groupId:f}}),s(p=>{Hp=void 0,n.addTimelineEvent({layerId:Vm,event:{time:r(),title:"🛬 "+u,subtitle:"end",data:{store:Iu(t.$id),action:Iu(u),args:d,result:p},groupId:f}})}),l(p=>{Hp=void 0,n.addTimelineEvent({layerId:Vm,event:{time:r(),logType:"error",title:"💥 "+u,subtitle:"end",data:{store:Iu(t.$id),action:Iu(u),args:d,error:p},groupId:f}})})},!0),t._customProperties.forEach(s=>{pr(()=>Yt(t[s]),(l,u)=>{n.notifyComponentUpdate(),n.sendInspectorState(qa),U0&&n.addTimelineEvent({layerId:Vm,event:{time:r(),title:"Change",subtitle:s,data:{newValue:l,oldValue:u},groupId:Hp}})},{deep:!0})}),t.$subscribe(({events:s,type:l},u)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(qa),!U0)return;const d={time:r(),title:Bae(l),data:jae({store:Iu(t.$id)},Pae(s)),groupId:Hp};l===Bd.patchFunction?d.subtitle="⤵️":l===Bd.patchObject?d.subtitle="🧩":s&&!Array.isArray(s)&&(d.subtitle=s.type),s&&(d.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:s}}),n.addTimelineEvent({layerId:Vm,event:d})},{detached:!0,flush:"sync"});const i=t._hotUpdate;t._hotUpdate=Us(s=>{i(s),n.addTimelineEvent({layerId:Vm,event:{time:r(),title:"🔥 "+t.$id,subtitle:"HMR update",data:{store:Iu(t.$id),info:Iu("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(qa),n.sendInspectorState(qa)});const{$dispose:o}=t;t.$dispose=()=>{o(),n.notifyComponentUpdate(),n.sendInspectorTree(qa),n.sendInspectorState(qa),n.getSettings().logStoreChanges&&pa(`Disposed "${t.$id}" store 🗑`)},n.notifyComponentUpdate(),n.sendInspectorTree(qa),n.sendInspectorState(qa),n.getSettings().logStoreChanges&&pa(`"${t.$id}" store installed 🆕`)})}var mj=0,Hp;function cO(e,t,n){const r=t.reduce((i,o)=>(i[o]=au(e)[o],i),{});for(const i in r)e[i]=function(){const o=mj,s=n?new Proxy(e,{get(...u){return Hp=o,Reflect.get(...u)},set(...u){return Hp=o,Reflect.set(...u)}}):e;Hp=o;const l=r[i].apply(s,arguments);return Hp=void 0,l}}function Uae({app:e,store:t,options:n}){if(!t.$id.startsWith("__hot:")){if(t._isOptionsAPI=!!n.state,!t._p._testing){cO(t,Object.keys(n.actions),t._isOptionsAPI);const r=t._hotUpdate;au(t)._hotUpdate=function(i){r.apply(this,arguments),cO(t,Object.keys(i._hmrPayload.actions),!!t._isOptionsAPI)}}zae(e,t)}}function Vae(){const e=MD(!0),t=e.run(()=>Ne({}));let n=[],r=[];const i=Us({install(o){By(i),i._a=o,o.provide(aj,i),o.config.globalProperties.$pinia=i,ci.env.NODE_ENV!=="production"&&ci.env.NODE_ENV!=="test"&&Vp&&Fae(o,i),r.forEach(s=>n.push(s)),r=[]},use(o){return this._a?n.push(o):r.push(o),this},_p:n,_a:null,_e:e,_s:new Map,state:t});
524return ci.env.NODE_ENV!=="production"&&ci.env.NODE_ENV!=="test"&&Vp&&typeof Proxy<"u"&&i.use(Uae),i}function gj(e,t){for(const n in t){const r=t[n];if(!(n in e))continue;const i=e[n];xg(i)&&xg(r)&&!_y(r)&&!O_(r)?e[n]=gj(i,r):e[n]=r}return e}var yj=()=>{};function uO(e,t,n,r=yj){e.add(t);const i=()=>{e.delete(t)&&r()};return!n&&dK()&&mK(i),i}function C0(e,...t){e.forEach(n=>{n(...t)})}var Hae=e=>e(),dO=Symbol(),w3=Symbol();function bE(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,r)=>e.set(r,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],i=e[n];xg(i)&&xg(r)&&e.hasOwnProperty(n)&&!_y(r)&&!O_(r)?e[n]=bE(i,r):e[n]=r}return e}var $ae=ci.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Gae(e){return!xg(e)||!Object.prototype.hasOwnProperty.call(e,$ae)}var{assign:Kc}=Object;function fO(e){return!!(_y(e)&&e.effect)}function hO(e,t,n,r){const{state:i,actions:o,getters:s}=t,l=n.state.value[e];let u;function d(){!l&&(ci.env.NODE_ENV==="production"||!r)&&(n.state.value[e]=i?i():{});const f=ci.env.NODE_ENV!=="production"&&r?O6(Ne(i?i():{}).value):O6(n.state.value[e]);return Kc(f,o,Object.keys(s||{}).reduce((p,m)=>(ci.env.NODE_ENV!=="production"&&m in f&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${m}" in store "${e}".`),p[m]=Us(dt(()=>{By(n);const y=n._s.get(e);return s[m].call(y,y)})),p),{}))}return u=wE(e,d,t,n,r,!0),u}function wE(e,t,n={},r,i,o){let s;const l=Kc({actions:{}},n);if(ci.env.NODE_ENV!=="production"&&!r._e.active)throw new Error("Pinia destroyed");const u={deep:!0};ci.env.NODE_ENV!=="production"&&(u.onTrigger=F=>{d?y=F:d==!1&&!V._hotUpdating&&(Array.isArray(y)?y.push(F):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let d,f,p=new Set,m=new Set,y;const b=r.state.value[e];!o&&!b&&(ci.env.NODE_ENV==="production"||!i)&&(r.state.value[e]={});const k=Ne({});let S;function x(F){let H;d=f=!1,ci.env.NODE_ENV!=="production"&&(y=[]),typeof F=="function"?(F(r.state.value[e]),H={type:Bd.patchFunction,storeId:e,events:y}):(bE(r.state.value[e],F),H={type:Bd.patchObject,payload:F,storeId:e,events:y});const te=S=Symbol();Sn().then(()=>{S===te&&(d=!0)}),f=!0,C0(p,H,r.state.value[e])}const T=o?function(){const{state:H}=n,te=H?H():{};this.$patch(M=>{Kc(M,te)})}:ci.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:yj;function C(){s.stop(),p.clear(),m.clear(),r._s.delete(e)}const I=(F,H="")=>{if(dO in F)return F[w3]=H,F;const te=function(){By(r);const M=Array.from(arguments),Z=new Set,L=new Set;function W(Q){Z.add(Q)}function U(Q){L.add(Q)}C0(m,{args:M,name:te[w3],store:V,after:W,onError:U});let q;try{q=F.apply(this&&this.$id===e?this:V,M)}catch(Q){throw C0(L,Q),Q}return q instanceof Promise?q.then(Q=>(C0(Z,Q),Q)).catch(Q=>(C0(L,Q),Promise.reject(Q))):(C0(Z,q),q)};return te[dO]=!0,te[w3]=H,te},D=Us({actions:{},getters:{},state:[],hotState:k}),P={_p:r,$id:e,$onAction:uO.bind(null,m),$patch:x,$reset:T,$subscribe(F,H={}){const te=uO(p,F,H.detached,()=>M()),M=s.run(()=>pr(()=>r.state.value[e],Z=>{(H.flush==="sync"?f:d)&&F({storeId:e,type:Bd.direct,events:y},Z)},Kc({},u,H)));return te},$dispose:C},V=Sl(ci.env.NODE_ENV!=="production"||ci.env.NODE_ENV!=="production"&&ci.env.NODE_ENV!=="test"&&Vp?Kc({_hmrPayload:D,_customProperties:Us(new Set)},P):P);r._s.set(e,V);const ee=(r._a&&r._a.runWithContext||Hae)(()=>r._e.run(()=>(s=MD()).run(()=>t({action:I}))));for(const F in ee){const H=ee[F];_y(H)&&!fO(H)||O_(H)?(ci.env.NODE_ENV!=="production"&&i?k.value[F]=$b(ee,F):o||(b&&Gae(H)&&(_y(H)?H.value=b[F]:bE(H,b[F])),r.state.value[e][F]=H),ci.env.NODE_ENV!=="production"&&D.state.push(F)):typeof H=="function"?(ee[F]=ci.env.NODE_ENV!=="production"&&i?H:I(H,F),ci.env.NODE_ENV!=="production"&&(D.actions[F]=H),l.actions[F]=H):ci.env.NODE_ENV!=="production"&&fO(H)&&(D.getters[F]=o?n.getters[F]:H,Vp&&(ee._getters||(ee._getters=Us([]))).push(F))}if(Kc(V,ee),Kc(au(V),ee),Object.defineProperty(V,"$state",{get:()=>ci.env.NODE_ENV!=="production"&&i?k.value:r.state.value[e],set:F=>{if(ci.env.NODE_ENV!=="production"&&i)throw new Error("cannot set hotState");x(H=>{Kc(H,F)})}}),ci.env.NODE_ENV!=="production"&&(V._hotUpdate=Us(F=>{V._hotUpdating=!0,F._hmrPayload.state.forEach(H=>{if(H in V.$state){const te=F.$state[H],M=V.$state[H];typeof te=="object"&&xg(te)&&xg(M)?gj(te,M):F.$state[H]=M}V[H]=$b(F.$state,H)}),Object.keys(V.$state).forEach(H=>{H in F.$state||delete V[H]}),d=!1,f=!1,r.state.value[e]=$b(F._hmrPayload,"hotState"),f=!0,Sn().then(()=>{d=!0});for(const H in F._hmrPayload.actions){const te=F[H];V[H]=I(te,H)}for(const H in F._hmrPayload.getters){const te=F._hmrPayload.getters[H],M=o?dt(()=>(By(r),te.call(V,V))):te;V[H]=M}
524Object.keys(V._hmrPayload.getters).forEach(H=>{H in F._hmrPayload.getters||delete V[H]}),Object.keys(V._hmrPayload.actions).forEach(H=>{H in F._hmrPayload.actions||delete V[H]}),V._hmrPayload=F._hmrPayload,V._getters=F._getters,V._hotUpdating=!1})),ci.env.NODE_ENV!=="production"&&ci.env.NODE_ENV!=="test"&&Vp){const F={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(H=>{Object.defineProperty(V,H,Kc({value:V[H]},F))})}return r._p.forEach(F=>{if(ci.env.NODE_ENV!=="production"&&ci.env.NODE_ENV!=="test"&&Vp){const H=s.run(()=>F({store:V,app:r._a,pinia:r,options:l}));Object.keys(H||{}).forEach(te=>V._customProperties.add(te)),Kc(V,H)}else Kc(V,s.run(()=>F({store:V,app:r._a,pinia:r,options:l})))}),ci.env.NODE_ENV!=="production"&&V.$state&&typeof V.$state=="object"&&typeof V.$state.constructor=="function"&&!V.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
525	state: () => new MyClass()
526Found in store "${V.$id}".`),b&&o&&n.hydrate&&n.hydrate(V.$state,b),d=!0,f=!0,V}
526/*! #__NO_SIDE_EFFECTS__ */function vj(e,t,n){let r;const i=typeof t=="function";r=i?n:t;function o(s,l){const u=fK();if(s=(ci.env.NODE_ENV==="test"&&Ab&&Ab._testing?null:s)||(u?VA(aj,null):null),s&&By(s),ci.env.NODE_ENV!=="production"&&!Ab)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
527See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
528This will fail in production.`);s=Ab,s._s.has(e)||(i?wE(e,t,r,s):hO(e,r,s),ci.env.NODE_ENV!=="production"&&(o._pinia=s));const d=s._s.get(e);if(ci.env.NODE_ENV!=="production"&&l){const f="__hot:"+e,p=i?wE(f,t,r,s,!0):hO(f,Kc({},r),s,!0);l._hotUpdate(p),delete s.state.value[f],s._s.delete(f)}if(ci.env.NODE_ENV!=="production"&&Vp){const f=fh();if(f&&f.proxy&&!l){const p=f.proxy,m="_pStores"in p?p._pStores:p._pStores={};m[e]=d}}return d}return o.$id=e,o}function Hd(e){const t=au(e),n={};for(const r in t){const i=t[r];i.effect?n[r]=dt({get:()=>e[r],set(o){e[r]=o}}):(_y(i)||O_(i))&&(n[r]=$b(e,r))}return n}function bj(e){return e.collaboration!==void 0?e.collaboration:e.v2Collaboration}function wj(e){if(typeof e!="string"||e.length===0)return"<none>";try{const t=new URL(e);t.search="",t.hash="",t.username="",t.password="";const n=e.includes("?")?"?<redacted>":"";return`${t.toString().replace(/\?$/,"")}${n}`}catch{const t=e.replace(/\/\/[^/@]+@/,"//"),n=t.search(/[?#]/);return n===-1?t:`${t.slice(0,n)}?<redacted>`}}function pg(e){return typeof e=="string"&&e.length>0?e:null}function qae(e){if(typeof e!="string"||e.length===0)return null;try{const t=new URL(e);return t.protocol==="ws:"||t.protocol==="wss:"?e:null}catch{return null}}function Wae(e,t){if(typeof e!="string")return null;const n=e.trim();if(n.length===0)return null;try{const r=new URL(n);return r.protocol==="http:"||r.protocol==="https:"?n:null}catch{if(typeof t!="string"||t.trim().length===0)return null;try{const r=new URL(n,t);return r.protocol==="http:"||r.protocol==="https:"?r.href:null}catch{return null}}}function Kae(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t={};for(const[n,r]of Object.entries(e))typeof r=="string"&&(t[n]=r);return Object.keys(t).length>0?t:void 0}function eT(e){return e===void 0?"join":e==="join"||e==="create"?e:null}function Yae(e){if(e!==void 0)return typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=2147483647?e:null}function Zw(e,t){return!e.ok||t===void 0?e:{ok:!0,target:{...e.target,syncTimeoutMs:t}}}function tT(){return{ok:!1,reason:"invalid-room-mode",message:'SuperDoc v2 collaboration roomMode must be either "join" or "create".'}}function Xae(e){const t=e.providerType;return typeof t=="string"&&t.length>0?t.toLowerCase():null}function Zae(e){if(!e||typeof e!="object")return null;const t=typeof e.providerType=="string"?e.providerType.toLowerCase():"";return t==="hocuspocus"?"hocuspocus":t==="liveblocks"?"liveblocks":t==="superdoc"?"superdoc":e.ydoc!=null||e.provider!=null?"external-ydoc-provider":null}function pO(e,t){const n=pg(t.documentId);if(!n)return{ok:!1,reason:"invalid-document-id",message:`SuperDoc v2 collaboration requires a non-empty collaboration.documentId for the "${e}" provider.`};const r=t.url??t.serverUrl,i=qae(r);if(!i)return{ok:!1,reason:"invalid-server-url",message:`SuperDoc v2 collaboration requires a valid ws:// or wss:// URL for the "${e}" provider (received: ${wj(r)}).`};const o=Kae(t.params),s=e==="hocuspocus"&&typeof t.token=="function"?t.token:e==="hocuspocus"?pg(t.token):null,l=eT(t.roomMode);return l?{ok:!0,target:{providerFamily:e,documentId:n,roomMode:l,serverUrl:i,...o?{params:o}:{},...s?{token:s}:{}}}:tT()}function Qae(e){const t=pg(e.adapterId);if(!t)return{ok:!1,reason:"invalid-adapter-id",message:"SuperDoc v2 provider extensions require a non-empty collaboration.adapterId."};const n=pg(e.documentId);if(!n)return{ok:!1,reason:"invalid-document-id",message:"SuperDoc v2 provider extensions require a non-empty collaboration.documentId."};const r=eT(e.roomMode);if(!r)return tT();if(Object.prototype.hasOwnProperty.call(e,"providerOptions"))try{structuredClone(e.providerOptions)}catch{return{ok:!1,reason:"invalid-provider-options",message:"SuperDoc v2 provider extension o
528ptions must be structured-clone-safe."}}const i=typeof e.token=="function"?e.token:pg(e.token);return{ok:!0,target:{providerFamily:"extension",adapterId:t,documentId:n,roomMode:r,...Object.prototype.hasOwnProperty.call(e,"providerOptions")?{providerOptions:e.providerOptions}:{},...i?{token:i}:{}}}}function Jae(e,t){const n=pg(e.documentId??e.roomId);if(!n)return{ok:!1,reason:"invalid-document-id",message:'SuperDoc v2 collaboration requires a non-empty collaboration.documentId (or roomId) for the "liveblocks" provider.'};const r=pg(e.publicApiKey),i=eT(e.roomMode);if(!i)return tT();const o=e.authEndpoint,s=typeof o=="string"&&o.length>0;if(!r&&!s)return{ok:!1,reason:"missing-auth",message:"SuperDoc v2 Liveblocks collaboration requires exactly one auth mode: a publicApiKey or an authEndpoint. None was provided."};if(r&&s)return{ok:!1,reason:"mixed-auth",message:"SuperDoc v2 Liveblocks collaboration accepts exactly one auth mode; pass either publicApiKey or authEndpoint, not both."};if(r)return{ok:!0,target:{providerFamily:"liveblocks",documentId:n,roomMode:i,publicApiKey:r}};const l=Wae(o,t);return l?{ok:!0,target:{providerFamily:"liveblocks",documentId:n,roomMode:i,authEndpoint:l}}:{ok:!1,reason:"invalid-auth-endpoint",message:"SuperDoc v2 Liveblocks collaboration requires a valid http(s) authEndpoint URL (received: <redacted>)."}}function xj(e){const{legacyCollaboration:t,documentType:n,documentCount:r,authEndpointBaseUrl:i}=e,o=bj(e);if(typeof r=="number"&&r>1)return{ok:!1,reason:"unsupported-multi-document",message:`SuperDoc v2 collaboration supports exactly one document per room; received ${r}.`};if(n!=null&&n!=="application/vnd.openxmlformats-officedocument.wordprocessingml.document")return{ok:!1,reason:"unsupported-document-type",message:"SuperDoc v2 collaboration supports DOCX documents only."};if(!(o!=null&&typeof o=="object")){const d=Zae(t);if(d){const f=d==="external-ydoc-provider"?"unsupported-legacy-provider":"unsupported-provider-family",p=wj(t==null?void 0:t.url);return{ok:!1,reason:f,message:d==="external-ydoc-provider"?"SuperDoc v2 collaboration cannot use an external { ydoc, provider } pair. Provide a collaboration target (e.g. { providerType, documentId, url }) instead.":`SuperDoc v2 collaboration does not accept "${d}" through the legacy modules.collaboration block (server: ${p}). Configure it as a document.collaboration target ({ providerType: "${d}", documentId, ... }) instead.`}}return{ok:!1,reason:"missing-target",message:"SuperDoc v2 collaboration requires a collaboration target ({ documentId, serverUrl } or { providerType, ... }). None was provided."}}const s=o;if(Object.prototype.hasOwnProperty.call(s,"createIfMissing"))return{ok:!1,reason:"invalid-room-mode",message:'SuperDoc v2 collaboration createIfMissing has been removed. Use roomMode: "create" for creation or roomMode: "join" for normal opens.'};if(s.ydoc!=null||s.provider!=null)return{ok:!1,reason:"unsupported-legacy-provider",message:"SuperDoc v2 collaboration cannot use an external { ydoc, provider } pair. v2 owns its provider; pass a collaboration target ({ providerType, documentId, serverUrl | publicApiKey | authEndpoint }) instead."};const l=Yae(s.syncTimeoutMs);if(l===null)return{ok:!1,reason:"invalid-sync-timeout",message:"SuperDoc v2 collaboration syncTimeoutMs must be a finite positive number within the JavaScript timer range."};const u=Xae(s);return u===null||u==="y-websocket"?Zw(pO("y-websocket",s),l):u==="hocuspocus"?Zw(pO("hocuspocus",s),l):u==="liveblocks"?Zw(Jae(s,i),l):u==="extension"?Zw(Qae(s),l):{ok:!1,reason:"unsupported-provider-family",message:`SuperDoc v2 collaboration does not support the "${u}" provider family. Supported families are y-websocket, hocuspocus, liveblocks, and extension.`}}var o1=(e,t="document")=>{if(!e)return null;if(typeof File=="function"&&e instanceof File)return e;if(typeof Blob=="function"&&e instanceof Blob){if(typeof File=="function"){const n=e.name||t;return new File([e],n,{type:e.type})}return e}return e.originFileObj?o1(e.originFileObj,e.name||t):e.file?o1(e.file,e.name||t):e.raw?o1(e.raw,e.name||t):null},FM,mO=(FM=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:FM.get,zM,x3=(zM=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag))==null?void 0:zM.get,_p=e=>{if(ArrayBuffer.isView(e))return(x3==null?void 0:x3.call(e))==="Uint8Array";if(!mO)return!1;try{return mO.call(e),!0}catch{return!1}},xE=e=>{if(e instanceof Uint8Array)return e;const t=ArrayBuffer.isView(e)?e:new Uint8Array(e);return Uint8Array.from(t)},kE=(e,t)=>new Blob([xE(e)],{type:t}),k3=e=>{switch(e.toLowerCase()){case"docx":case Ho:return Ho;case"pdf":case Qp:return Qp;case"html":case V1:return V1;default:return e}},Qw=(e="")=>{const t=String(e).toLowerCase();return t.endsWith(".docx")?Ho:t.endsWith(".pdf")?Qp:t.endsWith(".html")||t.endsWith(".htm")?V1:t.endsWith(".md")||t.endsWith(".markdown")?"text/markdown":""},ele=e=>e==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?"document.docx":e==="application/pdf"?"document.pdf":e==="text/html"?"document.html":"document",tle="application/octet-stream",_E=e=>{if(e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"collaboration")){const n={...e};delete n.collaboration,e={...n,v2Collaboration:bj(e)}}if(_p(e))return{type:Ho,data:xE(e),name:"document.docx"};const t=o1(e);if(t){const n=e&&typeof e.name=="string"?e.name:"",r=t.name||"",i=Qw(n),o=i||Qw(r),s=t.type.toLowerCase()===tle,l=s&&i?n:r||n||"document",u=s&&o?o:t.type||o||"application/vnd.openxmlformats-officedocument.wordprocessingml.document";let d=t;return s&&o&&typeof File=="function"&&t instanceof File?d=new File([t],l,{type:u,lastModified:t.lastModified}):s&&o&&typeof Blob=="function"&&t instanceof Blob&&(d=new Blob([t],{type:u})),{...e.v2Collaboration!==void 0?{v2Collaboration:e.v2Collaboration}:{},type:u,data:d,name:l}}if(e&&typeof e=="object"&&"data"in e){if(_p(e.data)){const r=k3(e.type||Qw(e.name)||"application/vnd.openxmlformats-officedocument.wordprocessingml.document");return{...e,type:r,data:r==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?xE(e.data):kE(e.data,r),name:e.name||ele(r)}}const n=o1(e.data,e.name);if(n){const r=typeof e.type=="string"&&e.type?k3(e.type):"",i=r||n.type||Qw(n.name)||"application/vnd.openxmlformats-officedocument.wordprocessingml.document",o=!n.type||!!(r&&n.type!==r);let s=n;return o&&typeof File=="function"&&n instanceof File?s=new File([n],n.name,{type:i,lastModified:n.lastModified}):o&&typeof Blob=="function"&&n instanceof Blob&&(s=new Blob([n],{type:i})),{...e,type:i,data:s,name:e.name||n.name||"document"}}}if(e&&typeof e=="object"&&"url"in e&&typeof e.type=="string"){const n=k3(e.type);if(n!==e.type)return{...e,type:n}}return e};function nle(e,t){const n=e.itemid,r=e,i=t!==null&&typeof t=="object"?Sl({...t}):Ne(t),o=Ne(null);return pr(i,(l,u)=>{const d={fieldId:n.value,changeTime:Date.now(),oldValue:u,newValue:l,originalField:r};o.value=d}),{value:i}}function rle(e){const t=Ne(e.itemid),n=Ne(e.itemicon),r=Ne(e.itemiconpack),i=Ne(e.itemdisplaylabel),o=e.itemlinkvalue,s=e.itemplaceholdertext,{value:l}=nle(e,o,Ne([])),u=Ne(e.itemtype),d=Ne(e.itemfieldtype),f=e,p=Sl({fontFamily:e.fontfamily||"Arial",fontSize:e.font_size||"12pt",originalFontSize:e.original_font_size||"12pt"}),m=Ne(e.logicrules),y=Ne(!1),b=Sl({}),k={SELECT:ole,IMAGEINPUT:ile,CHECKBOXINPUT:sle};return u.value in k&&Object.assign(b,k[u.value](e)),{id:t,icon:n,iconPack:r,label:i,placeholder:s,fieldType:u,fieldSubType:d,value:l,format:Ne(e.itemformat),logicRules:m,hidden:y,originalJSON:f,fieldStyle:p,valueGetter:e.valueGetter,...b}}function ile(e){return{fontfamily:Ne(e.fontfamily),iteminputtype:Ne(e.iteminputtype)}}function ole(e){return{options:Ne(e.itemoptions)}}function sle(e){const t=Ne(e.itemoptions);return t.value&&(t.value=t.value.map(n=>({label:n.itemdisplaylabel,value:n.itemlinkvalue,checked:n.ischecked,id:n.itemid,annotationId:n.annotationId}))),{options:t}}
528function ale(e,{changes:t={},states:n}){const{added:r=[],removed:i=[]}=t,o={states:yoe(e,n),added:r,removed:i,superdoc:e};e.emit("awareness-update",o)}function lle(e,t,n){const r=e.awareness;if(!r)return console.warn("[superdoc] External provider missing awareness property"),()=>{};n&&r.setLocalStateField&&r.setLocalStateField("user",n);const i=(o={})=>{ale(t,{changes:o,states:r.getStates()})};return r.on("change",i),()=>{typeof r.off=="function"&&r.off("change",i)}}var cle=(e,t,n,r)=>{const{comment:i}=n,o=new Ny(Object.entries(i));t.transact(()=>{e.push([o])},{user:r})},gO=(e,t,n,r)=>{const{comment:i}=n,o=new Ny(Object.entries(i)),s=kj(e,i);s!==-1&&t.transact(()=>{e.delete(s,1),e.insert(s,[o])},{user:r})},ule=(e,t,n,r)=>{const{comment:i}=n,o=kj(e,i);o!==-1&&t.transact(()=>{e.delete(o,1)},{user:r})},kj=(e,t)=>e.toJSON().findIndex(n=>n.commentId===t.commentId),dle=e=>{var t;return((t=e==null?void 0:e.activeEditor)==null?void 0:t.editorVersion)===2||(e==null?void 0:e.editorVersion)===2},yO=e=>{const t=(e==null?void 0:e.commentId)??(e==null?void 0:e.importedId);return t==null?null:String(t)},fle=(e,t)=>{var i;if(!dle(e))return[];const n=(i=e==null?void 0:e.commentsStore)==null?void 0:i.commentsList;if(!Array.isArray(n)||!n.length)return[];const r=new Set(t.map(yO).filter(Boolean));return n.filter(o=>{if((o==null?void 0:o.trackedChange)!==!0)return!1;const s=yO(o);return!s||!r.has(s)})},vO=e=>{var i;if(!(e!=null&&e.ydoc)||!(e!=null&&e.commentsStore))return!1;const t=e.ydoc.getArray("comments").toJSON(),n=new Map,r=[];return t.forEach(o=>{const s=(o==null?void 0:o.importedId)??(o==null?void 0:o.commentId);if(s){if(n.has(s)){const l=n.get(s),u=o==null?void 0:o.commentId;l&&u&&l!==u&&console.warn(`[SuperDoc] Duplicate collaboration comment key "${s}" detected with conflicting commentId values. Keeping first entry and dropping duplicate.`,{key:s,keptCommentId:l,droppedCommentId:u});return}if(n.set(s,o==null?void 0:o.commentId),!(o!=null&&o.commentId)){r.push({...o,commentId:s});return}r.push(o)}}),e.commentsStore.commentsList=[...r.map(o=>Od(o)),...fle(e,r)],(i=e.provider)!=null&&i.synced&&(e.commentsStore.hasSyncedCollaborationComments=!0),!0},hle=e=>{if(!e.config.modules.comments||!e.provider)return;if(e._commentsCollabInitialized){vO(e);return}e._commentsCollabInitialized=!0;const t=e.ydoc.getArray("comments"),n=()=>vO(e),r=()=>{if(n()||setTimeout(n,0),e.commentsStore){const i=e.commentsStore.commentsParentElement,o=e.commentsStore.editorCommentIds;e.commentsStore.handleEditorLocationsUpdate(i,o),e.commentsStore.hasSyncedCollaborationComments=!0}e.provider.off("synced",r)};e.provider.on("synced",r),n()||setTimeout(n,0),t.observe(i=>{var l;if(!e.commentsStore)return;const o=e.config.user,{user:s={}}=((l=i==null?void 0:i.transaction)==null?void 0:l.origin)||{};_B({current:o,other:s})||n()})},Hm=(e,t)=>{if(!e.isCollaborative||!e.config.modules.comments)return;const n=e.ydoc.getArray("comments"),r=e.config.user;switch(t.type){case"add":cle(n,e.ydoc,t,r);break;case"update":gO(n,e.ydoc,t,r);break;case"resolved":gO(n,e.ydoc,t,r);break;case"deleted":ule(n,e.ydoc,t,r);break}};function s1(e){const t=Ne(e.documentId),n=Ne(e.page),r=Sl(e.selectionBounds||{}),i=Ne(e.source),o=()=>`${t.value}-page-${n.value}`;return{documentId:t,page:n,selectionBounds:r,source:i,getValues:()=>({documentId:t.value,page:n.value,selectionBounds:au(r),source:i.value}),getContainerId:o,getContainerLocation:u=>{if(!u)return{top:0,left:0};const d=u.getBoundingClientRect(),f=document.getElementById(o());let p={top:0,left:0};return f&&(p=f.getBoundingClientRect()),{top:Number((p.top-d.top).toFixed(3)),left:Number((p.left-d.left).toFixed(3))}}}}var Wm="document-editor",q1=Symbol("comment-reconciliation"),bO=e=>[e==null?void 0:e.commentId,e==null?void 0:e.importedId].filter(t=>t!=null).map(t=>String(t)),_3=()=>({ok:!1,reason:"read-only-document"}),C3=e=>{var t,n,r,i,o;return((n=(t=e==null?void 0:e.commentsStore)==null?void 0:t.getConfig)==null?void 0:n.readOnly)===!0||((o=(i=(r=e==null?void 0:e.config)==null?void 0:r.modules)==null?void 0:i.comments)==null?void 0:o.readOnly)===!0};function ple(e,t){const n=e==null?void 0:e.commentsStore;if(!n)return[];const r=n.commentsList,i=Array.isArray(r)?r:(r==null?void 0:r.value)??[],o=new Set(bO(t)),s=[];let l=!0;for(;l;){l=!1;for(const u of i){if(!u)continue;const d=bO(u);d.some(f=>o.has(f))||[u.parentCommentId,u.threadingParentCommentId].filter(f=>f!=null).map(f=>String(f)).some(f=>o.has(f))&&(s.push(u),d.forEach(f=>o.add(f)),l=!0)}}return s}function Od(e){var De;const t=Ne(e.uid);let n=e.commentId||Sp(),r=e.importedId,i=e.parentCommentId,o=e.trackedChangeParentId;const s=Ne(e.trackedChangeThreadParentId),l=Ne(e.trackedChangeSide),u=e.fileId,d=e.fileType,f=e.createdAtVersionNumber,p=Ne(e.isInternal!==void 0?e.isInternal:!0),m=Ne(Array.isArray(e.mentions)?e.mentions:[]),y=Ne(null),b=Ne(e.isFocused||!1),k=Ne(e.creatorId??null),S=Ne(e.creatorEmail??null),x=Ne(e.creatorName??null),T=Ne(e.creatorImage??null),C=Ne(e.createdTime||Date.now()),I=Ne(e.importedAuthor||null),D=Ne(e.docxCommentJSON||null),P=e.origin,V=e.threadingMethod,ee=e.threadingStyleOverride;let F=e.threadingParentCommentId;const H=e.originalXmlStructure,te=Ne(e.commentText||""),M=e.selection?s1(e.selection):s1({documentId:u,page:1,selectionBounds:{}}),Z=(De=e.selection)!=null&&De.selectionBounds?{...e.selection.selectionBounds}:{top:0,left:0,right:0,bottom:0},L=Ne(e.trackedChange),W=Ne(e.trackedChangeType||null),U=Ne(e.trackedChangeText||null),q=Ne(e.trackedChangeDisplayType||null),Q=Ne(e.semanticColorKey||null),re=Ne(e.semanticColor||null),ne=Ne(e.trackedChangeStory||null),J=Ne(e.trackedChangeStoryKind||null),ge=Ne(e.trackedChangeStoryLabel||""),le=Ne(e.trackedChangeAnchorKey||null),ve=Ne(e.trackedChangeCanonicalId||null),Ee=Ne(e.trackedChangePositionAliases||[]),st=Ne(e.deletedText||null),At=Ne(e.trackedChangeLabel||null),yt=Ne(e.trackedChangeDetailLines||null),Ge=Ne(e.trackedChangeImagePreview||null),Be=Ne(e.customAttributes??null),he=Ne(e.resolvedTime||null),Oe=Ne(e.resolvedById||null),ye=Ne(e.resolvedByEmail||null),B=Ne(e.resolvedByName||null),be=Ne(e.trackedChangeDecision||null),ie=({id:Pe,email:mt,n
528ame:xt,superdoc:de,decision:z,reconciliationToken:Y})=>{var dn;const me=Y===q1;if(C3(de)&&!me)return _3();if(he.value)return;he.value=Date.now(),Oe.value=Pe??null,ye.value=mt,B.value=xt,(z==="accept"||z==="reject")&&(be.value=z);const Ve={type:zx.RESOLVED,comment:tt()};Fe(de,Ve);const lt=(dn=de.activeEditor)==null?void 0:dn.commands;if(L.value){lt==null||lt.resolveComment({commentId:n,importedId:r});return}const gt=ple(de,{commentId:n,importedId:r});gt.length&&typeof(lt==null?void 0:lt.resolveCommentThread)=="function"?lt.resolveCommentThread({comments:[{commentId:n,importedId:r,preserveAnchor:!0},...gt.map(Hn=>({commentId:Hn.commentId,importedId:Hn.importedId,preserveAnchor:!1}))]}):lt==null||lt.resolveComment({commentId:n,importedId:r})},fe=({isInternal:Pe,superdoc:mt})=>{if(C3(mt))return _3();const xt=p.value;if(xt===Pe)return;p.value=Pe;const de={type:zx.UPDATE,changes:[{key:"isInternal",value:Pe,previousValue:xt}],comment:tt()};Fe(mt,de);const z=mt.activeEditor;z&&z.commands.setCommentInternal({commentId:n,importedId:r,isInternal:Pe})},ue=Pe=>{const{activeEditor:mt}=Pe;mt==null||mt.commands.setActiveComment({commentId:n,importedId:r})},Ce=({text:Pe,superdoc:mt,suppressUpdate:xt})=>{if(!xt&&C3(mt))return _3();if(te.value=Pe,m.value=Ue(Pe),xt)return;const de={type:zx.UPDATE,changes:[{key:"text",value:Pe}],comment:tt()};Fe(mt,de)},Ue=Pe=>{const mt=[...new DOMParser().parseFromString(Pe,"text/html").querySelectorAll('span[data-type="mention"]')],xt=[];return mt.forEach(de=>{xt.some(z=>{const Y=z.email===de.getAttribute("email"),me=z.name===de.getAttribute("name");return Y&&me})||xt.push({name:de.getAttribute("name"),email:de.getAttribute("email")})}),xt},K=(Pe,mt)=>{var z;M.source=Wm;const xt=(z=mt==null?void 0:mt.getBoundingClientRect())==null?void 0:z.top,de={top:Pe.top-xt,left:Pe.left,right:Pe.right,bottom:Pe.bottom-xt};M.selectionBounds=de},oe=()=>I.value?{name:I.value.name||"(Imported)",email:I.value.email}:{id:k.value,name:x.value,email:S.value,image:T.value},Fe=(Pe,mt)=>{Pe.emit("comments-update",mt),Hm(Pe,mt)},Le=(Pe={})=>{Object.prototype.hasOwnProperty.call(Pe,"commentId")&&(n=Pe.commentId),Object.prototype.hasOwnProperty.call(Pe,"importedId")&&(r=Pe.importedId),Object.prototype.hasOwnProperty.call(Pe,"parentCommentId")&&(i=Pe.parentCommentId),Object.prototype.hasOwnProperty.call(Pe,"trackedChangeParentId")&&(o=Pe.trackedChangeParentId),Object.prototype.hasOwnProperty.call(Pe,"trackedChangeThreadParentId")&&(s.value=Pe.trackedChangeThreadParentId),Object.prototype.hasOwnProperty.call(Pe,"threadingParentCommentId")&&(F=Pe.threadingParentCommentId)},tt=()=>({uid:t.value,commentId:n,importedId:r,parentCommentId:i,trackedChangeParentId:o,trackedChangeThreadParentId:s.value,trackedChangeSide:l.value,fileId:u,fileType:d,mentions:m.value.map(Pe=>({...Pe,name:Pe.name?Pe.name:Pe.email})),createdAtVersionNumber:f,creatorId:k.value,creatorEmail:S.value,creatorName:x.value,creatorImage:T.value,createdTime:C.value,importedAuthor:I.value,docxCommentJSON:D.value,isInternal:p.value,commentText:te.value,selection:M?M.getValues():null,trackedChange:L.value,trackedChangeText:U.value,trackedChangeType:W.value,trackedChangeDisplayType:q.value,semanticColorKey:Q.value,semanticColor:re.value,trackedChangeStory:ne.value,trackedChangeStoryKind:J.value,trackedChangeStoryLabel:ge.value,trackedChangeAnchorKey:le.value,trackedChangeCanonicalId:ve.value,trackedChangePositionAliases:Ee.value,trackedChangeDecision:be.value,trackedChangeLabel:At.value,trackedChangeDetailLines:yt.value,trackedChangeImagePreview:Ge.value,customAttributes:Be.value,deletedText:st.value,resolvedTime:he.value,resolvedById:Oe.value,resolvedByEmail:ye.value,resolvedByName:B.value,origin:P,threadingMethod:V,threadingStyleOverride:ee,threadingParentCommentId:F,originalXmlStructure:H});return Sl({uid:t,commentId:n,importedId:r,parentCommentId:i,trackedChangeParentId:o,trackedChangeThreadParentId:s,trackedChangeSide:l,fileId:u,fileType:d,mentions:m,commentElement:y,isFocused:b,creatorId:k,creatorEmail:S,creatorName:x,creatorImage:T,createdTime:C,isInternal:p,commentText:te,selection:M,floatingPosition:Z,trackedChange:L,deletedText:st,trackedChangeType:W,trackedChangeText:U,trackedChangeDisplayType:q,semanticColorKey:Q,semanticColor:re,trackedChangeStory:ne,trackedChangeStoryKind:J,trackedChangeStoryLabel:ge,trackedChangeAnchorKey:le,trackedChangeCanonicalId:ve,trackedChangePositionAliases:Ee,trackedChangeDecision:be,trackedChangeLabel:At,trackedChangeDetailLines:yt,trackedChangeImagePreview:Ge,customAttributes:Be,resolvedTime:he,resolvedById:Oe,resolvedByEmail
528:ye,resolvedByName:B,importedAuthor:I,docxCommentJSON:D,origin:P,threadingMethod:V,threadingStyleOverride:ee,threadingParentCommentId:F,originalXmlStructure:H,setText:Ce,getValues:tt,resolveComment:ie,setIsInternal:fe,setActive:ue,updatePosition:K,getCommentUser:oe,updateIdentityValues:Le})}function mle(e,t){var le;const n=e.id,r=te(e),i=e.data,o=t,s=e.state,l=e.role,u=e.html,d=e.markdown,f=e.password,p=Ne(0),m=Ne(null),y=Ne([]),b=Ne(!1),k=Ne(t.rulers),S=Zs(e.ydoc),x=Zs(e.provider),T=Zs(e.socket),C=Ne(e.isNewFile),I=Zs(e.v2Collaboration||null),D=Zs(null),P=ve=>D.value=ve,V=()=>D.value,ee=Zs(null),F=ve=>ee.value=ve,H=()=>ee.value;function te({type:ve,data:Ee}){if(Ee!=null&&Ee.type)return Ee.type;if(ve)return doe[ve]||ve;throw new Error("Document type not specified")}const M=()=>{Q.value=q.value,q.value=[]},Z=()=>{q.value=Q.value,console.debug("[superdoc] Restored comments:",q.value)},L=Ne(e.fields||[]),W=Ne(((le=e.fields)==null?void 0:le.map(ve=>rle(ve)))||[]),U=Ne(e.annotations||[]),q=Ne(ne()),Q=Ne(q.value),re=Ne(e.commentThreadingProfile||null);function ne(){var ve;return o.modules.comments?((ve=e.conversations)==null?void 0:ve.map(Ee=>Od(Ee)))||[]:[]}const J=Ne(null),ge=ve=>{const Ee=q.value.findIndex(st=>st.conversationId===ve);Ee>-1&&q.value.splice(Ee,1)};return{id:n,data:i,html:u,markdown:d,password:f,fieldContext:e.fieldContext,type:r,config:o,state:s,role:l,core:J,editorMountNonce:p,ydoc:S,provider:x,socket:T,isNewFile:C,v2Collaboration:I,container:m,pageContainers:y,isReady:b,rulers:k,rawFields:L,fields:W,annotations:U,conversations:q,commentThreadingProfile:re,setEditor:P,getEditor:V,setDocumentRuntime:F,getDocumentRuntime:H,removeComments:M,restoreComments:Z,removeConversation:ge}}var wO="in",tv=vj("superdoc",()=>{const e=Ne(null);let t=null;const n=qd(),r=Ne([]),i=Ne([]),o=Sl({}),s=Ne([]),l=Ne(100),u=Ne("manual"),d=Ne(wO),f=Ne(null),p=Ne(!1),m=Ne(!1),y=Ne([]),b=Sl({name:null,email:null}),k=Sl({}),S=Ne(null),x=Ne({left:0,top:0,width:0,height:0,source:null}),T=()=>{r.value=[],i.value=[],Object.assign(o,{}),s.value=[],p.value=!1,b.name=null,b.email=null,Object.assign(k,{}),S.value=null,d.value=wO},C=Sl({scrollTop:0,scrollLeft:0}),I=W=>{t=typeof W=="function"?W:null},D=W=>{var q;const U=t||((q=e.value)==null?void 0:q.onException);typeof U=="function"&&U(W)},P=async W=>{var J,ge;if(T(),e.value=W,((J=W.zoom)==null?void 0:J.initial)!==void 0){const le=W.zoom.initial;typeof le=="number"&&Number.isFinite(le)&&le>0?l.value=le:console.warn("[SuperDoc] zoom.initial expects a positive number representing percentage")}if(((ge=W.zoom)==null?void 0:ge.mode)!==void 0){const le=W.zoom.mode;le==="manual"||le==="fit-width"?u.value=le:console.warn("[SuperDoc] zoom.mode expects 'manual' or 'fit-width'")}if(W.measurementUnit!==void 0){const le=W.measurementUnit;le==="in"||le==="cm"?d.value=le:console.warn("[SuperDoc] measurementUnit expects 'in' or 'cm'")}const{documents:U,modules:q,user:Q,users:re}=W;if(s.value=re||[],Object.assign(b,Q),Object.assign(k,q),Object.prototype.hasOwnProperty.call(k,"comments")||(k.
528comments={}),!(U!=null&&U.length)&&!W.modules.collaboration){const le=await ER(aK,"blank.docx",Ho),ve={id:Sp(),type:Ho,data:le,name:"blank.docx",isNewFile:!0};W.html&&(ve.html=W.html),W.markdown&&(ve.markdown=W.markdown),U.push(ve)}const ne=(U==null?void 0:U.length)===1&&U[0]&&U[0].fieldContext===void 0?[{...U[0],fieldContext:W.fieldContext}]:U;await V(ne),p.value=!0},V=async(W=[])=>{if(!W)return[];for(let U of W){if(!U){D({error:new Error("Received empty document entry during initialization."),stage:"document-init",document:U}),console.warn("[superdoc] Skipping empty document entry.");continue}try{let q=await F(U);if(!q){D({error:new Error("Document could not be initialized with the provided configuration."),stage:"document-init",document:U}),console.warn("[superdoc] Skipping document due to invalid configuration:",U);continue}const Q=mle(q,e.value);r.value.push(Q)}catch(q){D({error:q,stage:"document-init",document:U}),console.warn("[superdoc] Error initializing document:",U,"with error:",q,"Skipping document.")}}},ee=(W,U,q)=>new File([W],U,{type:q}),F=async W=>{var U,q;if(W=_E(W),(U=e.value)!=null&&U.html&&(W.html=e.value.html),!W.data&&W.url&&!W.type&&(W.type=Ho),(q=e.value)!=null&&q.modules.collaboration&&!W.isNewFile)return{...W,data:null,url:null};if(W.data instanceof File){let Q=W.name;const re=W.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?".docx":W.type==="application/pdf"?".pdf":".bin";if(Q?Q.includes(".")||(Q=`${Q}${re}`):Q=`document${re}`,W.data.name!==Q){const ne=ee(W.data,Q,W.data.type||W.type);return{...W,name:Q,data:ne}}return W.name?W:{...W,name:Q}}else if(W.data instanceof Blob){let Q=W.name;Q||(Q=`document${W.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?".docx":W.type==="application/pdf"?".pdf":".bin"}`);const re=ee(W.data,Q,W.data.type||W.type);return{...W,data:re}}else{if(W.data)return W;if(W.url&&W.type){W.type.toLowerCase()==="docx"?W.type=Ho:W.type.toLowerCase()==="pdf"&&(W.type=Qp);try{const Q=await ER(W.url,W.name||"document",W.type);return{...W,data:Q}}catch(Q){const re=Q instanceof Error?Q.message:String(Q);throw console.debug("[SuperDoc] Failed to fetch document from URL:",re),Q}}}return null},H=dt(()=>{for(let W of r.value.filter(U=>U.type==="pdf"))if(!W.isReady)return!1;return!0}),te=W=>r.value.find(U=>U.id===W);return{commentsStore:n,documents:r,documentBounds:i,pages:o,documentUsers:s,users:y,activeZoom:l,zoomMode:u,measurementUnit:d,viewportMetrics:f,documentScroll:C,isInternal:m,selectionPosition:x,activeSelection:S,isReady:p,user:b,modules:k,areDocumentsReady:H,init:P,setExceptionHandler:I,reset:T,handlePageReady:(W,U,q)=>{o[W]||(o[W]=[]),o[W].push({page:U,containerBounds:q});const Q=te(W);Q&&Q.pageContainers.push({page:U,containerBounds:q})},getDocument:te,removeDocument:W=>{var ne,J,ge;const U=W!=null?String(W):null;if(!U)return null;const q=r.value.findIndex(le=>String((le==null?void 0:le.id)??"")===U);if(q===-1)return null;(ne=n.removeCommentsForDocument)==null||ne.call(n,U),((J=S.value)==null?void 0:J.documentId)!=null&&String(S.value.documentId)===U&&(S.value=null,x.value={left:0,top:0,width:0,height:0,source:null}),delete o[U];const[Q]=r.value.splice(q,1),re=(ge=e.value)==null?void 0:ge.documents;if(Array.isArray(re)){const le=re.findIndex(ve=>String((ve==null?void 0:ve.id)??"")===U);le!==-1&&re.splice(le,1)}return Q??null},getPageBounds:(W,U)=>{const q=o[W];if(!q)return;const Q=q.find(ne=>ne.page==U);if(!Q||!Q.container)return;const{height:re}=Q.container.getBoundingClientRect();return{top:re*(U-1)}}}}),gle=e=>{const t={trackInsert:"insertedMark",trackDelete:"deletionMark",trackFormat:"formatMark"},n=new Map;for(const i of e){const o=i.mark.attrs.id;n.has(o)||n.set(o,[]),n.get(o).push(i)}const r=[];for(const[,i]of n){if(i.length===1){const s=i[0],l=t[s.mark.type.name];r.push({from:s.from,to:s.to,[l]:s});continue}const o=new Set;for(let s=0;s<i.length;s++){if(o.has(s))continue;const l=i[s],u=t[l.mark.type.name],d=i[s+1];if(d&&!o.has(s+1)&&l.to===d.from&&l.mark.type.name!==d.mark.type.name){const p=t[d.mark.type.name];r.push({from:l.from,to:d.to,[u]:l,[p]:d}),o.add(s),o.add(s+1);continue}let f=!1;for(let p=s+1;p<i.length;p++){if(o.has(p))continue;const m=i[p];if(l.mark.type.name!==m.mark.type.name){const y=t[m.mark.type.name];r.push({from:Math.min(l.from,m.from),to:Math.max(l.to,m.to),[u]:l,[y]:m}),o.add(s),o.add(p),f=!0;break}}f||(r.push({from:l.from,to:l.to,[u]:l}),o.add(s))}}return r},yle="headerFooterPart",nT=e=>Number.isFinite(e)?Number(e):null,vle=(e,t)=>
528`${e}::page:${t}`,ble=(e,t)=>{const n=String(e),r=String(t);return n===r||n.startsWith("tc::")&&n.endsWith(`::${r}`)},wle=e=>{if(!Array.isArray(e)||e.length===0)return null;let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.forEach(o=>{[o==null?void 0:o.left,o==null?void 0:o.top,o==null?void 0:o.right,o==null?void 0:o.bottom].every(Number.isFinite)&&(t=Math.min(t,o.left),n=Math.min(n,o.top),r=Math.max(r,o.right),i=Math.max(i,o.bottom))}),[t,n,r,i].every(Number.isFinite)?{left:t,top:n,right:r,bottom:i,width:r-t,height:i-n}:null},_j=e=>{const t=new Map;return(Array.isArray(e)?e:[]).forEach(n=>{const r=nT(n==null?void 0:n.pageIndex);if(r==null)return;const i=t.get(r);if(i){i.push(n);return}t.set(r,[n])}),[...t.entries()].sort((n,r)=>n[0]-r[0]).map(([n,r])=>({pageIndex:n,rects:r}))},xle=(e,t)=>{var n;return!(e!=null&&e.trackedChange)||((n=e==null?void 0:e.trackedChangeStory)==null?void 0:n.storyType)!==yle?!1:_j(t==null?void 0:t.rects).length>1},kle=e=>{var n;const t=Number((n=e==null?void 0:e.selection)==null?void 0:n.page);return!Number.isInteger(t)||t<1?null:t-1},_le=({id:e,threadId:t,comment:n,positionKey:r,positionEntry:i})=>{const o=nT(i==null?void 0:i.pageIndex),s=n!=null&&n.trackedChange?null:kle(n);return{id:e,threadId:t,comment:n,positionKey:r,positionEntry:i??null,pageIndex:o??s,isPrimary:!0}},Cle=({comment:e,positionKey:t,positionEntry:n,primaryInstanceId:r})=>{var u;const i=_j(n==null?void 0:n.rects);if(i.length<2)return[];const o=i.map(({pageIndex:d,rects:f})=>{const p=wle(f);return p?{pageIndex:d,rects:f,bounds:p}:null}).filter(Boolean);if(o.length<2)return[];const s=nT(n==null?void 0:n.pageIndex),l=o.some(({pageIndex:d})=>d===s)?s:((u=o[0])==null?void 0:u.pageIndex)??null;return o.map(({pageIndex:d,rects:f,bounds:p})=>{const m=d===l;return{id:m?r:vle(r,d),threadId:(e==null?void 0:e.commentId)??t,comment:e,positionKey:t,pageIndex:d,isPrimary:m,positionEntry:{...n,pageIndex:d,rects:f,bounds:p}}})},Sle=({comment:e,positionKey:t,positionEntry:n,fallbackId:r})=>{const i=(e==null?void 0:e.trackedChange)&&t&&r&&Array.isArray(e==null?void 0:e.trackedChangePositionAliases)&&e.trackedChangePositionAliases.some(l=>ble(t,l)),o=(e==null?void 0:e.trackedChange)&&(e==null?void 0:e.trackedChangeCanonicalId)&&t&&r&&String(t)!==String(r),s=i||o?r:t??r;if(!s)return[];if(xle(e,n)&&t){const l=Cle({comment:e,positionKey:t,positionEntry:n,primaryInstanceId:s});if(l.length>0)return l}return[_le({id:s,threadId:(e==null?void 0:e.commentId)??r,comment:e,positionKey:t,positionEntry:n})]},Ele=()=>ag(()=>import("./docx-engine.es-BBi52nyt.js"),[]),ob=null,n_=null;async function Ale(){if(!ob){const e=Promise.resolve().then(()=>Ele()).then(t=>{const n=t&&typeof t=="object"&&"createSuperDocV2Integration"in t?t.createSuperDocV2Integration:null;if(typeof n!="function")throw new TypeError("SuperDoc: the DOCX Engine module does not export createSuperDocV2Integration");n_=n});ob=e,e.catch(()=>{ob===e&&(ob=null,n_=null)})}await ob}async function Tle(){try{await Ale()}catch(e){console.error("[SuperDoc] DOCX Engine failed to load; using the stub.",e)}}var Ile="tc-comment:",Rle="tc::body::";function Wx(e){if(!e||typeof e!="object")return!1;const t=e.id??e.commentId;return typeof t!="string"?!1:t.startsWith(Ile)}function M0(e){if(!e||e.trackedChange!==!0)return!1;const t=e.trackedChangeAnchorKey;return typeof t=="string"&&t.startsWith(Rle)}function Ole(){return{publish(){},recollect(){},reset(){},getLastEpoch(){return null},getLastPayload(){return null}}}function Nle(){return{setContext(){},onCommittedPagePaint(){},refreshCommittedWindow(){},invalidate(){},beginMutation(){},settleMutation(){},reset(){},getSnapshot(){return null},subscribe(){return()=>{}},getDiagnostics(){return null}}}var Mle=m1({name:"SuperDocV2IntegrationMissing",emits:["v2-editor-failed"],setup(e,{emit:t}){return po(()=>{t("v2-editor-failed",{reason:"v2-integration-unavailable",detail:"SuperDoc: the DOCX Engine runtime could not be constructed in this environment."})}),()=>Ps("div",{class:"superdoc-v2-integration-missing"})}});
528function S3(){return{version:1,capabilities:null,EditorComponent:Mle,RulerComponent:null,createGeometryPublisher:Ole,createReviewWindowController:Nle,isSyntheticTrackedChangeCommentLaneItem:Wx,isV2SyntheticTrackedChangeRow:M0}}function Dle(){if(!n_)return S3();try{const e=S3(),t=n_();return!t||typeof t!="object"||!t.EditorComponent?e:{version:typeof t.version=="number"?t.version:e.version,capabilities:t.capabilities??e.capabilities,EditorComponent:t.EditorComponent,RulerComponent:t.RulerComponent??e.RulerComponent,createGeometryPublisher:t.createGeometryPublisher??e.createGeometryPublisher,createReviewWindowController:t.createReviewWindowController??e.createReviewWindowController,isSyntheticTrackedChangeCommentLaneItem:t.isSyntheticTrackedChangeCommentLaneItem??e.isSyntheticTrackedChangeCommentLaneItem,isV2SyntheticTrackedChangeRow:t.isV2SyntheticTrackedChangeRow??e.isV2SyntheticTrackedChangeRow}}catch(e){return console.error("[SuperDoc] DOCX Engine integration failed to construct; using the stub.",e),S3()}}function Lle(){return Dle()}function Cj(){try{const e=globalThis.__superdocInteractionTrace;return e&&typeof e=="object"?e:null}catch{return null}}function CE(e,t,n=void 0){try{const r=Cj();return!r||typeof r.startSpan!="function"?null:r.startSpan(e,t,n)}catch{return null}}function V0(e,t=void 0){if(e)try{const n=Cj();if(!n||typeof n.endSpan!="function")return;n.endSpan(e,t)}catch{}}function S0(e,t,n,r){const i=CE(e,t,n);if(!i)return r();try{const o=r();return o&&typeof o.then=="function"?o.then(s=>(V0(i),s)).catch(s=>{throw V0(i,{error:s instanceof Error?s.message:String(s)}),s}):(V0(i),o)}catch(o){throw V0(i,{error:o instanceof Error?o.message:String(o)}),o}}var Ple=e=>!!(e!=null&&e.trackedChangeLink)||!!(e!=null&&e.trackedChangeType)||!!(e!=null&&e.trackedChangeDisplayType)||!!(e!=null&&e.trackedChangeText)||!!(e!=null&&e.deletedText)||(e==null?void 0:e.trackedChange)===!0,vC=e=>(e==null?void 0:e.trackedChangeThreadParentId)!=null?e.trackedChangeThreadParentId:(e==null?void 0:e.trackedChangeParentId)!=null&&Ple(e)?e.trackedChangeParentId:null,Ble=e=>e==="source"||e==="deleted"?"source":e==="destination"||e==="inserted"?"destination":null,jle=e=>(e==null?void 0:e.semanticColorKey)==="move-from"?"source":(e==null?void 0:e.semanticColorKey)==="move-to"?"destination":null,Sj=e=>{const t=new Map,n=new Map,r=(o,s,l)=>{const u=o.get(s);u?u.push(l):o.set(s,[l])};for(const o of e)(o==null?void 0:o.trackedChange)===!0&&(typeof o.commentId=="string"&&r(t,o.commentId,o),o.trackedChangeCanonicalId!=null&&r(n,String(o.trackedChangeCanonicalId),o));const i=new Map;for(const o of e){if((o==null?void 0:o.trackedChange)===!0)continue;const s=new Set([o.threadingParentCommentId,vC(o)].filter(p=>p!=null).map(p=>String(p)));if(s.size===0)continue;const l=new Set([...s].flatMap(p=>t.get(p)??[]));if(l.size===1){i.set(o,[...l][0]);continue}if(l.size>1)continue;const u=new Set([...s].flatMap(p=>n.get(p)??[]));if(u.size===1){i.set(o,[...u][0]);continue}const d=Ble(o.trackedChangeSide);if(!d)continue;const f=[...u].filter(p=>jle(p)===d);f.length===1&&i.set(o,f[0])}return i},Fle=(e,t=new Map)=>{const n=new Map,r=new Map,i=new Map,o=new Map,s=Sj(e),l=(d,f,p)=>{const m=d.get(f);m?m.push(p):d.set(f,[p])};e.forEach((d,f)=>{o.set(d,f),l(i,d.commentId,d),new Set([d.parentCommentId,d.threadingParentCommentId].filter(m=>m!=null).map(m=>String(m))).forEach(m=>l(n,m,d));const p=s.get(d);(p==null?void 0:p.commentId)!=null&&l(r,String(p.commentId),d)});const u=new Map;for(const d of e){if(!(d!=null&&d.trackedChange)||d.commentId==null)continue;const f=d.commentId,p=new Set([f]),m=[],y=[];typeof f=="string"&&y.push(f);const b=y.flatMap(T=>[...n.get(T)??[],...r.get(T)??[]]);for(const T of b){const C=T.commentId;C===f||p.has(C)||(p.add(C),m.push(C))}for(let T=0;T<m.length;T+=1){const C=m[T];for(const I of typeof C=="string"?n.get(C)??[]:[]){const D=I.commentId;p.has(D)||(p.add(D),m.push(D))}}const k=[...p].flatMap(T=>i.get(T)??[]).sort((T,C)=>(o.get(T)??0)-(o.get(C)??0));k.sort((T,C)=>T===d?-1:C===d?1:Number(T.createdTime)-Number(C.createdTime));const S=t.get(f),x=(S==null?void 0:S.length)===k.length&&k.every((T,C)=>S[C]===T)?S:k;u.set(f,x)}return u},zle=(e,t=new Map)=>{const n=new Map;for(const i of e){const o=new Set([i.parentCommentId,i.threadingParentCommentId,i.trackedChangeParentId,i.trackedChangeThreadParentId].filter(s=>s!=null).map(s=>String(s)));for(const s of o){const l=n.get(s);l?l.push(i):n.set(s,[i])}}const r=new Map;for(const[i,o]of n){const s=t.get(i);r.set(i,(s==null?void 0:s.length)===o.length&&o.every((l,u)=>s[u]===l)?s:o)}return r},xO=class{constructor(){throw new Error("SuperDoc v2 beta: v1 editor-backed comment import paths are not available.")}},fl={getTrackChanges:()=>[],enumerateStructuralRowChanges:()=>[]},Ule=Symbol("comments-plugin-disabled"),kO=()=>[],E3=()=>null,E0=()=>null,_O=()=>null,A3=({storyKey:e,rawId:t})=>`tc::${e}::${t}`,Vle=/<br(?:\s[^>]*)?\s*\/?>/gi,Hle=/<(?:p|div|li|blockquote|pre|h[1-6])(?:\s[^>]*)?\s*\/?>/gi,$le=/<\/(?:p|div|li|blockquote|pre|h[1-6])\s*>/gi,Gle=/<\/?[A-Za-z][A-Za-z0-9:-]*(?:\s[^>]*)?\s*\/?>/g,qle=/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z][a-zA-Z0-9]+);/g,Wle={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:'"'},rT=(e,t)=>
528{if(Object.is(e,t))return!0;if(!e||!t||typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>Object.prototype.hasOwnProperty.call(t,i)&&Object.is(e[i],t[i]))},CO=e=>{if(!Array.isArray(e))return null;const t=e.filter(n=>n&&typeof n=="object").map(n=>({excerpt:typeof n.excerpt=="string"?n.excerpt:"",label:typeof n.label=="string"?n.label:""}));return t.length>0?t:null},Kle=(e,t)=>e===t?!0:!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>rT(n,t[r])),SO=e=>Array.isArray(e)?e.filter(t=>t&&typeof t=="object").map(t=>({name:typeof t.name=="string"?t.name:"",namespaceUri:typeof t.namespaceUri=="string"?t.namespaceUri:"",localName:typeof t.localName=="string"?t.localName:"",value:typeof t.value=="string"?t.value:""})).filter(t=>t.name&&t.namespaceUri&&t.localName):null,Yle=(e,t)=>e===t?!0:!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>rT(n,t[r])),EO=e=>{if(!e||typeof e!="object")return null;const t=typeof e.src=="string"?e.src:null;if(!t||!t.startsWith("data:image/"))return null;const n=typeof e.contentType=="string"&&e.contentType.startsWith("image/")?e.contentType:null,r=typeof e.role=="string"?e.role:null,i=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:null,o=typeof e.height=="number"&&Number.isFinite(e.height)&&e.height>0?e.height:null,s=typeof e.alt=="string"&&e.alt.length>0?e.alt:"Tracked image preview";return{src:t,...n?{contentType:n}:{},...r?{role:r}:{},...i?{width:i}:{},...o?{height:o}:{},alt:s}},Xle=e=>{const t=String(e).toLowerCase(),n=Wle[t];if(n!==void 0)return n;const r=t.startsWith("#x")?16:t.startsWith("#")?10:null;if(!r)return null;const i=t.startsWith("#x")?t.slice(2):t.slice(1),o=Number.parseInt(i,r);if(!Number.isFinite(o))return null;try{return String.fromCodePoint(o)}catch{return null}},Zle=e=>e.replace(qle,(t,n)=>Xle(n)??t),T3=e=>{const t=String(e??"");return!t||t==="<p></p>"?"":Zle(t.replace(Vle,`
529`).replace($le,`
530`).replace(Hle,"").replace(Gle,"")).replace(/\n{3,}/g,`
531
532`).replace(/^\n+/,"").replace(/\n+$/,"")},Qle=e=>{if(!e||typeof e!="object")return null;const t=au(e);return{...t,...t.section&&typeof t.section=="object"?{section:{...au(t.section)}}:{}}},qd=vj("comments",()=>{const e={kind:"story",storyType:"body"},t=R=>{var pe,xe,ke;if(!(R!=null&&R.trackedChange))return!1;const X=(pe=R==null?void 0:R.trackedChangeStory)==null?void 0:pe.storyType;return X==null||X==="body"?!0:((ke=(xe=R==null?void 0:R.trackedChangeAnchorKey)==null?void 0:xe.startsWith)==null?void 0:ke.call(xe,"tc::body::"))===!0},n=R=>R==null?null:A3({storyKey:"body",rawId:String(R)}),r=R=>{const X=me(R);if(!(X!=null&&X.startsWith("tc::")))return null;const pe=X.indexOf("::",4);if(pe<=4)return null;const xe=X.slice(4,pe),ke=X.slice(pe+2);return!xe||!ke?null:{storyKey:xe,rawId:ke}},i=(R,X)=>X==null?null:A3({storyKey:R||"body",rawId:String(X)}),o=R=>{if(!R)return null;const X=R.sourceId?String(R.sourceId):"";return X?`word:structural:${X}`:R.id?String(R.id):null},s=tv(),l=Sl({name:"comments",readOnly:!1,allowResolve:!0,showResolved:!1}),u=()=>({ok:!1,reason:"read-only-document"}),d=()=>({ok:!1,reason:"resolve-disabled"}),f=()=>l.allowResolve===!1,p=()=>l.readOnly===!0,m=R=>{var pe,xe;const X=(xe=(pe=R==null?void 0:R.interactionConfig)==null?void 0:pe.trackedChanges)==null?void 0:xe.allowDecisions;return X===!0?null:X===!1?p()?"read-only-document":"tracked-change-decisions-disabled":p()?"read-only-document":null},y=Sl({documentMode:"editing",commentsVisible:!1,trackChangesVisible:!1}),b=!1,k={},S=new WeakMap,x=new Map;let T=0;const C=()=>typeof window>"u"?!1:"__labsSuperDocV2BenchmarkDebug"in window,I=(R,X=null)=>{if(C()){if(X!==null){console.debug("[SuperDoc][comments-store]",R,X);return}console.debug("[SuperDoc][comments-store]",R)}},D=zx,P=Ne(!1),V=Ne(!1),ee=Ne(null),F=Ne(!1),H=Ne(null),te=Ne(null),M=Ne(null),Z=Ne([]),L=Ne([]),W=new Set([]),U=Ne(!0),q=Ne(""),Q=Ne([]),re=Ne([]),ne=Zs([]);let J=new Map;const ge=dt(()=>{const R=Fle(re.value,J);return J=R,R}),le=R=>{const X=(R==null?void 0:R.commentId)??null;
532return(X!=null?ge.value.get(X):null)??[R].filter(Boolean)};let ve=new Map;const Ee=dt(()=>{const R=zle(re.value,ve);return ve=R,R}),st=Ne(!1),At=Ne(!1),yt=Ne(!1),Ge=Ne([]),Be=Ne({}),he=Ne(!1),Oe=Ne(0),ye=Ne([]),B=Ne([]),be=Ne(!1),ie=Ne(!1),fe=Ne([]),ue=Ne(null),Ce=Ne(null),Ue=Ne(null),K=Ne(null),oe=Zs(null),Fe=dt(()=>y.documentMode==="viewing"),Le=dt(()=>Fe.value?y.commentsVisible||y.trackChangesVisible:!0),tt=Zs(null),De=R=>{tt.value=R??null},Pe=R=>{var pe;const X=((pe=R==null?void 0:R.activeEditor)==null?void 0:pe.v2Comments)??null;return X||tt.value},mt=R=>{var X;return((X=R==null?void 0:R.activeEditor)==null?void 0:X.editorVersion)===2||tt.value!==null},xt=Zs(null),de=R=>{xt.value=R??null},z=R=>{var pe;const X=((pe=R==null?void 0:R.activeEditor)==null?void 0:pe.v2TrackedChanges)??null;return X||xt.value},Y=(R={})=>{var pe;const X={...l,...R};Object.assign(l,X),U.value=l.suppressInternalExternal||!1,R.comments&&R.comments.length&&(re.value=((pe=R.comments)==null?void 0:pe.map(xe=>Od(xe)))||[])},me=R=>R==null?null:String(R),Ve=R=>Array.isArray(R)?[...new Set(R.map(X=>me(X)).filter(Boolean))]:[],lt=R=>{if(!(R!=null&&R.trackedChange))return null;const X=r(R.trackedChangeAnchorKey);if(X!=null&&X.storyKey)return X.storyKey;const pe=R.trackedChangeStory;switch(pe==null?void 0:pe.storyType){case"body":return"body";case"headerFooterPart":return pe.refId?`hf:${pe.refId}`:null;case"footnote":return pe.noteId?`fn:${pe.noteId}`:null;case"endnote":return pe.noteId?`en:${pe.noteId}`:null;case"textbox":return pe.textboxId?`textbox:${pe.textboxId}`:null;default:return null}},gt=R=>R!=null&&R.startsWith("hf:part:")?`hf:${R.slice(8)}`:R!=null&&R.startsWith("headerFooterPart:")?`hf:${R.slice(17)}`:R,dn=(R,X)=>{const pe=gt(R),xe=gt(X);return!pe||!xe||pe===xe},Hn=(R,X)=>{const pe=gt(lt(X)),xe=gt(me(R==null?void 0:R.storyKey));return dn(pe,xe)},br=R=>{const X=me(R);return X?X.startsWith("imported:")?X:`imported:${X}`:null},ur=R=>{const X=me(R);if(!X)return{key:null,entry:null};const pe=Be.value||{};if(pe[X]!==void 0)return{key:X,entry:pe[X]};for(const[xe,ke]of Object.entries(pe)){const Me=me(ke==null?void 0:ke.key),He=me(ke==null?void 0:ke.threadId);if(Me===X||He===X)return{key:xe,entry:ke}}return{key:null,entry:null}},tr=(R,X)=>{if(!R||!X)return!1;const pe=Math.max(Number(R.left),Number(X.left)),xe=Math.min(Number(R.right),Number(X.right)),ke=Math.max(Number(R.top),Number(X.top)),Me=Math.min(Number(R.bottom),Number(X.bottom));return[pe,xe,ke,Me].every(Number.isFinite)&&xe>pe&&Me>ke},Br=(R,X)=>{if(!R||!X||R.kind!=="trackedChange"||X.kind!=="trackedChange"||R.storyKey&&X.storyKey&&R.storyKey!==X.storyKey)return!1;const pe=Number(R.pageIndex),xe=Number(X.pageIndex);if(Number.isFinite(pe)&&Number.isFinite(xe)&&pe!==xe)return!1;if(tr(R.bounds,X.bounds))return!0;const ke=Number(R.start),Me=Number(R.end),He=Number(X.start),Ie=Number(X.end);return[ke,Me,He,Ie].every(Number.isFinite)&&ke===He&&Me===Ie},Lr=R=>{const{entry:X}=ur(R);if(!X)return null;const pe=re.value.filter(xe=>xe!=null&&xe.trackedChange?jn(xe).some(ke=>{const{entry:Me}=ur(ke);return Br(X,Me)}):!1);return pe.length===1?pe[0]:null},$e=R=>{if(R==null)return null;const X=ke=>ke.commentId==R,pe=ke=>ke.importedId==R||ke.trackedChangeAnchorKey==R||(ke==null?void 0:ke.trackedChange)&&br(ke.importedId)==R,xe=ke=>ke.find(X)??ke.find(pe);return xe(re.value)??xe(ne.value)??Lr(R)},Bt=R=>R!=null&&R.parentCommentId?$e(R.parentCommentId):R,hn=R=>R!=null&&R.trackedChangeThreadParentId?R.trackedChangeThreadParentId:M0(R)&&(R==null?void 0:R.trackedChange)===!0?null:vC(R),Pn=R=>{if(!R)return null;const X=Be.value||{};if(typeof R=="string"){if(X[R])return R;const He=$e(R);if(!He)return R;const Ie=He.commentId??null,Xe=He.importedId??null,Ke=He.trackedChange?br(Xe):null,wt=He.trackedChangeAnchorKey??null;return wt&&X[wt]?wt:Ie&&X[Ie]?Ie:Xe&&X[Xe]?Xe:Ke&&X[Ke]?Ke:wt??Ie??Ke??Xe??null}const pe=R.commentId??null,xe=R.importedId??null,ke=R.trackedChange?br(xe):null,Me=R.trackedChangeAnchorKey??null;return Me&&X[Me]?Me:pe&&X[pe]?pe:xe&&X[xe]?xe:ke&&X[ke]?ke:Me??pe??ke??xe??null},jn=R=>{if(R==null)return[];const X=typeof R=="object"?null:R,pe=typeof R=="object"?R:$e(R),xe=pe!=null&&pe.trackedChange?Ve(pe==null?void 0:pe.trackedChangePositionAliases):[],ke=gt(lt(pe)),Me=new Set;return[X,Pn(pe),pe==null?void 0:pe.trackedChangeAnchorKey,pe==null?void 0:pe.commentId,pe==null?void 0:pe.importedId,pe!=null&&pe.trackedChange?br(pe==null?void 0:pe.importedId):null,...xe.flatMap(He=>[ke&&!He.startsWith("tc::")?A3({storyKey:ke,rawId:He}):null,He])].map(He=>me(He)).filter(He=>!He||Me.has(He)?!1:(Me.add(He),!0))},Lt=(R,X)=>{const pe=Be.value||{},xe=typeof R=="object"?R:$e(R),ke=new Set;for(const Me of[X,...jn(R)].map(He=>
532me(He)).filter(Boolean)){if(ke.has(Me))continue;ke.add(Me);const He=pe[Me];if(He!==void 0&&Hn(He,xe))return{key:Me,entry:He}}return{key:null,entry:null}},St=R=>{R&&((R.resolvedTime!=null||R.resolvedById!=null||R.resolvedByEmail!=null||R.resolvedByName!=null)&&S.set(R,{resolvedTime:R.resolvedTime??null,resolvedById:R.resolvedById??null,resolvedByEmail:R.resolvedByEmail??null,resolvedByName:R.resolvedByName??null,trackedChangeDecision:R.trackedChangeDecision??null}),R.resolvedTime=null,R.resolvedById=null,R.resolvedByEmail=null,R.resolvedByName=null,R.trackedChangeDecision=null)},Te=R=>{if(!R)return!1;const X=S.get(R);return X?(R.resolvedTime=X.resolvedTime??Date.now(),R.resolvedById=X.resolvedById??null,R.resolvedByEmail=X.resolvedByEmail??null,R.resolvedByName=X.resolvedByName??null,R.trackedChangeDecision=X.trackedChangeDecision??null,!0):!1},qe=R=>typeof(R==null?void 0:R.getValues)=="function"?R.getValues():{...R},it=R=>{var pe;const X=(pe=R==null?void 0:R.selection)==null?void 0:pe.source;return X==null?!0:X===Wm},Et=R=>!!(R!=null&&R.trackedChange)||!!hn(R),$t=({documentId:R,editor:X}={})=>{var Zt,an;if(!(X!=null&&X.state)||!((Zt=re.value)!=null&&Zt.length))return 0;const pe=Be.value||{};if(!Object.keys(pe).length)return 0;const xe=Kt=>Kt.find(tn=>pe[tn]!==void 0)??null,ke=new Set,Me=new Map;if(re.value.forEach(Kt=>{if(!(Kt!=null&&Kt.trackedChange))return;if(R){const Rn=(Kt==null?void 0:Kt.fileId)??null;if(Rn&&Rn!==R)return}const tn=jn(Kt),Bn=xe(tn);Bn&&(ke.add(Bn),Me.set(Bn,new Set(tn)))}),!ke.size)return 0;const He=new Set(fl.getTrackChanges(X.state).map(({mark:Kt})=>{var tn;return(tn=Kt==null?void 0:Kt.attrs)==null?void 0:tn.id}).filter(Kt=>Kt!=null).map(Kt=>String(Kt))),Ie=typeof E0=="function"?E0():null;let Xe=[];try{Xe=((an=Ie==null?void 0:Ie.getAll)==null?void 0:an.call(Ie))??[]}catch{}const Ke=new Set(Xe.map(Kt=>Kt==null?void 0:Kt.anchorKey).filter(Kt=>typeof Kt=="string"&&Kt.length>0)),wt=new Set(Array.from(ke).filter(Kt=>{const tn=Me.get(Kt)??new Set([Kt]);return Array.from(tn).some(Bn=>Ke.has(Bn))?!1:!Array.from(tn).some(Bn=>He.has(Bn))}));if(!wt.size)return 0;const ct=new Set;wt.forEach(Kt=>{(Me.get(Kt)??new Set([Kt])).forEach(tn=>ct.add(tn))});const vt=new Set(wt);re.value.forEach(Kt=>{const tn=jn(Kt),Bn=xe(tn);Bn&&[hn(Kt),Kt==null?void 0:Kt.threadingParentCommentId,Kt==null?void 0:Kt.parentCommentId].map(Rn=>me(Rn)).filter(Boolean).some(Rn=>ct.has(Rn))&&vt.add(Bn)});const Ft={...pe};if(vt.forEach(Kt=>{delete Ft[Kt]}),Be.value=Ft,H.value!==void 0&&H.value!==null){const Kt=$e(H.value),tn=new Set(jn(Kt??H.value)),Bn=[hn(Kt),Kt==null?void 0:Kt.threadingParentCommentId,Kt==null?void 0:Kt.parentCommentId].map(Rn=>me(Rn)).filter(Boolean);(Array.from(tn).some(Rn=>ct.has(Rn))||Bn.some(Rn=>ct.has(Rn)))&&io()}return vt.size},sn=R=>{var ke;const X=(ke=R==null?void 0:R.state)==null?void 0:ke.doc;if(!X||typeof X.descendants!="function")return null;const pe=new Set,xe=new Set;return X.descendants(Me=>{var Xe,Ke,wt;(Xe=Me.marks)==null||Xe.filter(ct=>{var vt;return((vt=ct==null?void 0:ct.type)==null?void 0:vt.name)==="commentMark"}).forEach(ct=>{var vt,Ft;[(vt=ct.attrs)==null?void 0:vt.commentId,(Ft=ct.attrs)==null?void 0:Ft.importedId].map(Zt=>me(Zt)).filter(Boolean).forEach(Zt=>pe.add(Zt))});const He=(Ke=Me.type)==null?void 0:Ke.name;if(He!=="commentRangeStart"&&He!=="commentRangeEnd")return;const Ie=me((wt=Me.attrs)==null?void 0:wt["w:id"]);Ie&&xe.add(Ie)}),{liveMarkIds:pe,resolvedAnchorIds:xe}},Tn=()=>{var X;const R=s.documents;if(!Array.isArray(R))return null;for(const pe of R){const xe=typeof(pe==null?void 0:pe.getEditor)=="function"?pe.getEditor():null;if((X=xe==null?void 0:xe.state)!=null&&X.doc)return xe}return null},kn=({editor:R}={})=>{if(tt.value)return 0;const X=R??Tn(),pe=sn(X),xe=Be.value||{},ke=new Set(Object.keys(xe));if(!pe&&!ke.size)return 0;let Me=0;return re.value.forEach(He=>{if(!it(He)||Et(He))return;if(pe){const Xe=jn(He),Ke=Xe.some(ct=>pe.liveMarkIds.has(ct)),wt=Xe.some(ct=>pe.resolvedAnchorIds.has(ct));if(Ke&&He.resolvedTime!=null){St(He),Me+=1;return}!Ke&&wt&&He.resolvedTime==null&&Te(He)&&(Me+=1);return}const{key:Ie}=Lt(He);Ie&&ke.has(String(Ie))&&He.resolvedTime!=null&&(St(He),Me+=1)}),Me};pr(Be,()=>{kn()}),pr(re,()=>{oc(),kn()},{deep:!1});const rn=R=>
532{if(!R)return null;const X=R.start??R.pos??R.from,pe=R.end??R.to??X;return!Number.isFinite(X)||!Number.isFinite(pe)?null:{start:X,end:pe}},Wn=R=>Lt(R).entry??null,qr=(R,X={})=>{var Xe,Ke,wt,ct;const pe=typeof R=="object"?R:$e(R);if(!pe)return null;const xe=Lt(R).entry??null,ke=rn(xe);if(!ke)return null;const Me=(ct=(wt=(Ke=(Xe=s.getDocument(pe.fileId))==null?void 0:Xe.getEditor)==null?void 0:Ke.call(Xe))==null?void 0:wt.state)==null?void 0:ct.doc;if(!(Me!=null&&Me.textBetween))return null;const He=X.separator??" ",Ie=Me.textBetween(ke.start,ke.end,He,He);return X.trim===!1?Ie:Ie==null?void 0:Ie.trim()},Yr=(R,X={})=>{const pe=Wn(R);return pe?{position:pe,anchoredText:qr(R,X)}:null},gi=R=>{if(!Fe.value)return!0;const X=Bt(R);return!X&&(R!=null&&R.parentCommentId)?!1:X!=null&&X.trackedChange||hn(R)?y.trackChangesVisible:y.commentsVisible},Jn=(R,X)=>{var Me,He;const pe=R==null?void 0:R.activeEditor,xe=Pe(R);if(X==null){if(io(),xe){xe.setActiveComment(null);return}(Me=pe==null?void 0:pe.commands)==null||Me.setActiveComment({commentId:null});return}const ke=$e(X);if(ke){if(H.value=ke.commentId,Zu(ke.commentId),xe){xe.setActiveComment(ke.commentId);return}(He=pe==null?void 0:pe.commands)==null||He.setActiveComment({commentId:H.value})}},Tr=({superdoc:R,params:X,broadcastChanges:pe=!0,documentState:xe=void 0,trackedChangeIdentityIndex:ke=null})=>{var He,Ie,Xe,Ke,wt,ct,vt,Ft;const Me=CE("store.trackedChanges.handleUpdate","store-reconciliation",{event:(X==null?void 0:X.event)??null,changeId:(X==null?void 0:X.changeId)??null,documentId:(X==null?void 0:X.documentId)??null});try{const{event:Zt,changeId:an,trackedChangeText:Kt,trackedChangeType:tn,trackedChangeDisplayType:Bn,semanticColorKey:Rn,semanticColor:Fr,deletedText:kr,trackedChangeLabel:ir,trackedChangeDetailLines:ii,trackedChangeImagePreview:Do,customAttributes:En,authorId:ws,authorEmail:Nl,authorImage:Ml,date:xs,author:fn,importedAuthor:_r,documentId:Eo,coords:La,trackedChangeStory:rl,trackedChangeStoryKind:il,trackedChangeStoryLabel:Bc,trackedChangeAnchorKey:va,trackedChangeCanonicalId:df,trackedChangePositionAliases:jc,importedId:ol}=X,ks=an!=null?String(an):null,Wi=df!=null?String(df):null,Dl=Object.prototype.hasOwnProperty.call(X,"trackedChangePositionAliases"),go=Dl?Ve(jc):void 0,ac=Object.prototype.hasOwnProperty.call(X,"importedId"),ia=Object.prototype.hasOwnProperty.call(X,"customAttributes"),Is=ia?SO(En):void 0,Ll=ac?ol!=null?String(ol):null:void 0,lc=Eo!=null?String(Eo):null;if(!(Bn==="tableInsert"||Bn==="tableDelete")&&ks){const ln=lc??(((Ie=(He=R==null?void 0:R.activeEditor)==null?void 0:He.options)==null?void 0:Ie.documentId)!=null?String(R.activeEditor.options.documentId):null),lr=ln?(Ke=(Xe=s.getDocument(ln))==null?void 0:Xe.getEditor)==null?void 0:Ke.call(Xe):null,wr=xe!==void 0?xe:(lr==null?void 0:lr.state)??((wt=R==null?void 0:R.activeEditor)==null?void 0:wt.state)??null;if(wr){const{ranges:pn,ids:Rt}=nl(wr),Nr=fl.getTrackChanges(wr,ks),Sr=pn.length>0&&Nr.length>0&&Ol(Nr,pn),Qr=Nr.length===0&&Rt.has(ks);if(Sr||Qr){hu({suppressedIds:new Set([ks]),activeDocumentId:ln,superdoc:R,broadcastChanges:pe});return}}}const cc=rl!==void 0||il!==void 0||Bc!==void 0||va!==void 0,oa=cc?rl??null:e,oo=cc?il??null:"body",sa=cc&&Bc!==void 0?Bc:"",Wo=va!==void 0?va??null:cc?null:n(ks),Pl=typeof ir=="string"&&ir.length>0?ir:null,$=CO(ii),se=EO(Do),ze=ri({documentId:Eo,commentId:an,trackedChange:!0,trackedChangeText:Kt,trackedChangeType:tn,trackedChangeDisplayType:Bn,semanticColorKey:Rn,semanticColor:Fr,deletedText:kr,trackedChangeLabel:Pl,trackedChangeDetailLines:$,trackedChangeImagePreview:se,...ia?{customAttributes:Is}:{},createdTime:xs,creatorId:ws??null,creatorName:fn,creatorEmail:Nl,creatorImage:Ml,isInternal:!1,importedAuthor:_r,...ac?{importedId:Ll}:{},trackedChangeStory:oa,trackedChangeStoryKind:oo,trackedChangeStoryLabel:sa,trackedChangeAnchorKey:Wo,trackedChangeCanonicalId:Wi,...Dl?{trackedChangePositionAliases:go}:{},selection:{source:Wm,selectionBounds:La}}),We=()=>{const ln=Wo!=null?String(Wo):null;if(!ks)return null;const lr=lt(ze),wr=pn=>{if(!pn)return!1;const Rt=pn.trackedChangeAnchorKey!=null?String(pn.trackedChangeAnchorKey):null,Nr=pn.commentId!=null?String(pn.commentId):null,Sr=pn.importedId!=null?String(pn.importedId):null,Qr=pn.trackedChangeCanonicalId!=null?String(pn.trackedChangeCanonicalId):null,oi=jn(pn),Ki=dn(lt(pn),lr);if(Ki&&oi.includes(ks))return!0;const $i=new Set(go??[]);if(Ki&&$i.size>
5320&&[Nr,Sr,Qr,Rt,...oi].filter(Boolean).some(Mr=>$i.has(Mr)))return!0;const Gi=Wi&&Wi!==ks||Qr&&Qr!==Nr;return Ki&&Nr===ks||Ki&&!Gi&&(Sr===ks||Ll!==void 0&&Ll!=null&&Sr===Ll)?!0:Gi?!1:ln&&Rt?Rt===ln:!1};if(ke){const pn=ke.candidates({changeId:ks,importedId:Ll,anchorKey:ln,canonicalId:Wi,positionAliases:go});for(const Rt of pn)if(wr(Rt)&&(!lc||So(Rt,lc)))return Rt;return null}return lc?re.value.find(pn=>wr(pn)&&So(pn,lc)):re.value.find(wr)},bt=ln=>{pe&&(Hm(R,ln),Ro(an,ln,R))},Jt=(ln,lr,wr)=>(ln==null?void 0:ln[lr])==null&&wr==null||!ln||rT(ln[lr],wr)?!1:(ln[lr]=wr,!0),vn=ln=>{if(!ln)return!1;let lr=!1;return oa!=null&&(lr=Jt(ln,"trackedChangeStory",oa)||lr),oo!=null&&(lr=Jt(ln,"trackedChangeStoryKind",oo)||lr),sa!==void 0&&sa!==""&&(lr=Jt(ln,"trackedChangeStoryLabel",sa)||lr),Wo!=null&&(lr=Jt(ln,"trackedChangeAnchorKey",Wo)||lr),lr},qn=ln=>{const lr={trackedChangeText:Kt??null,trackedChangeType:tn??null,trackedChangeDisplayType:Bn??null,semanticColorKey:Rn??null,semanticColor:Fr??null,deletedText:kr??null,trackedChangeLabel:Pl,trackedChangeImagePreview:se,trackedChangeCanonicalId:Wi,creatorId:ws??null,creatorName:fn??null,creatorEmail:Nl??null,creatorImage:Ml??null,createdTime:xs??null};if(ac&&(lr.importedId=Ll),Dl){const pn=new Set([ln==null?void 0:ln.commentId,ln==null?void 0:ln.importedId,ln==null?void 0:ln.trackedChangeCanonicalId,ln==null?void 0:ln.trackedChangeAnchorKey,...jn(ln)].map(Rt=>me(Rt)).filter(Boolean));lr.trackedChangePositionAliases=go.some(Rt=>pn.has(Rt))?Ve([...Array.isArray(ln==null?void 0:ln.trackedChangePositionAliases)?ln.trackedChangePositionAliases:[],...go]):go}let wr=!1;for(const[pn,Rt]of Object.entries(lr))wr=Jt(ln,pn,Rt)||wr;return ln&&!(ln.trackedChangeDetailLines==null&&$==null)&&!Kle(ln.trackedChangeDetailLines,$)&&(ln.trackedChangeDetailLines=$,wr=!0),ia&&ln&&!Yle(ln.customAttributes,Is)&&(ln.customAttributes=Is,wr=!0),vn(ln)||wr},Cr=ln=>{const lr=!!(ln.resolvedTime||ln.resolvedById||ln.resolvedByEmail||ln.resolvedByName);return lr&&St(ln),qn(ln)||lr};if(Zt==="add"){const ln=We();if(ln){if(!Cr(ln))return;ke==null||ke.add(ln),bt({type:D.UPDATE,comment:qe(ln)});return}Pr({superdoc:R,comment:ze,broadcastChanges:pe}),ke==null||ke.add(ze)}else if(Zt==="update"){const ln=We();if(!ln||!Cr(ln))return;ke==null||ke.add(ln),bt({type:D.UPDATE,comment:qe(ln)})}else if(Zt==="resolve"){const ln=We(),lr={id:X.resolvedById??((ct=R==null?void 0:R.user)==null?void 0:ct.id)??null,email:X.resolvedByEmail??((vt=R==null?void 0:R.user)==null?void 0:vt.email)??null,name:X.resolvedByName??((Ft=R==null?void 0:R.user)==null?void 0:Ft.name)??null,decision:X.decision??null,superdoc:R};ln&&!ln.resolvedTime&&ln.resolveComment({...lr,reconciliationToken:q1})}}finally{V0(Me)}},zr=(R=[])=>{var X,pe,xe;return{insertedMark:((X=R.find(({mark:ke})=>{var Me;return((Me=ke==null?void 0:ke.type)==null?void 0:Me.name)==="trackInsert"}))==null?void 0:X.mark)??null,deletionMark:((pe=R.find(({mark:ke})=>{var Me;return((Me=ke==null?void 0:ke.type)==null?void 0:Me.name)==="trackDelete"}))==null?void 0:pe.mark)??null,formatMark:((xe=R.find(({mark:ke})=>{var Me;return((Me=ke==null?void 0:ke.type)==null?void 0:Me.name)==="trackFormat"}))==null?void 0:xe.mark)??null}},Kn=({superdoc:R,editor:X,changeIds:pe,broadcastChanges:xe=!0})=>{var Me;if(!(!R||!(X!=null&&X.state)||!Array.isArray(pe)||!pe.length||!(((Me=X==null?void 0:X.options)==null?void 0:Me.documentId)!=null&&String(X.options.documentId))))for(const He of new Set(pe.map(Ie=>Ie!=null?String(Ie):null).filter(Boolean))){const Ie=fl.getTrackChanges(X.state,He);Ie.length&&E3({marks:zr(Ie),newEditorState:X.state})}},Gn=(R=null,X=null,pe=null)=>{const xe=Number.isFinite(R);ue.value=xe?R:null,Ce.value=xe&&X!=null?String(X):null;const ke=pe??X;Ue.value=xe&&ke!=null?String(ke):null},ni=()=>{const R=ue.value;return Number.isFinite(R)?R:null},Di=()=>{ue.value=null,Ce.value=null,Ue.value=null},Ro=(R,X,pe,xe=1e3)=>{k[R]&&clearTimeout(k[R]),k[R]=setTimeout(()=>{pe&&pe.emit("comments-update",X),delete k[R]},xe)},Si=(R,X)=>{var Me,He,Ie,Xe,Ke;if((X==null?void 0:X.source)!=="document-editor")return null;const pe=(X==null?void 0:X.documentId)??null,xe=((He=(Me=R==null?void 0:R.activeEditor)==null?void 0:Me.options)==null?void 0:He.documentId)??null;if(!pe||!xe||pe!==xe)return null;let ke;try{ke=(Ke=(Xe=(Ie=R==null?void 0:R.activeEditor)==null?void 0:Ie.doc)==null?void 0:Xe.selection)==null?void 0:Ke.current}catch{return null}if(typeof ke!="function")return null;try{return ke()}catch{return null}},Gs=(R,X=null)=>{var He,Ie,Xe,Ke;const pe=Pe(R),xe=Si(R,s.activeSelection),ke={type:D.PENDING,pendingSelection:xe};if(R.emit("comments-update",ke),pe){const wt=(He=pe.getCapabilityState)==null?void 0:He.call(pe);return wt&&wt.canWrite===!1?{ok:!1,reason:wt.reason}:Promise.resolve((Ie=pe.captureCurrentSelection)==null?void 0:Ie.call(pe)).then(ct=>{var Ft,Zt;if(!(ct!=null&&ct.ok))return{ok:!1,reason:(ct==null?void 0:ct.reason)??"editing-range-required",detail
532:ct==null?void 0:ct.detail};oe.value=ct.target??null;const vt=pe.documentId??((Zt=(Ft=R==null?void 0:R.activeEditor)==null?void 0:Ft.options)==null?void 0:Zt.documentId)??null;return K.value=ri({selection:{source:Wm,documentId:vt,page:1,selectionBounds:{}},documentId:vt,parentCommentId:null}),R.config.isInternal||(K.value.isInternal=!1),Gn(X,"pending"),Da(null),H.value=K.value.commentId,{ok:!0}}).catch(ct=>({ok:!1,reason:"selection-capture-failed",detail:(ct==null?void 0:ct.message)??String(ct)}))}const Me={...s.activeSelection};return Me.selectionBounds={...Me.selectionBounds},(Xe=s.selectionPosition)!=null&&Xe.source&&s.selectionPosition.source!=="pdf"&&(s.selectionPosition.source=null),K.value=ri({selection:Me,documentId:Me.documentId,parentCommentId:null}),R.config.isInternal||(K.value.isInternal=!1),(Ke=R.activeEditor)!=null&&Ke.commands&&R.activeEditor.commands.insertComment({...K.value.getValues(),commentId:"pending",skipEmit:!0}),K.value.selection.source==="document-editor"&&s.selectionPosition&&(s.selectionPosition.source=Wm),Gn(X,"pending"),Da(null),H.value=K.value.commentId,{ok:!0}},Oo=R=>{var pe;const X=Lt(R).entry;return X?Number.isFinite(X.start)?X.start:Number.isFinite(X.pos)?X.pos:Number.isFinite(X.from)?X.from:Number.isFinite(X.to)?X.to:Number.isFinite(X.pageIndex)&&Number.isFinite((pe=X==null?void 0:X.bounds)==null?void 0:pe.top)?X.pageIndex*1e6+X.bounds.top:null:null},Hi=(R,X)=>(R.createdTime??0)-(X.createdTime??0),cn=(R,X)=>{const pe=Oo(R),xe=Oo(X),ke=Number.isFinite(pe),Me=Number.isFinite(xe);return ke&&Me&&pe!==xe?pe-xe:ke&&!Me?-1:!ke&&Me?1:Hi(R,X)},Fn=(R,X)=>{const pe=[],xe=[],ke=new Map,Me=Sj(R);return R.forEach(He=>{var Ke;if(!gi(He))return;const Ie=((Ke=Me.get(He))==null?void 0:Ke.commentId)??null,Xe=He.trackedChange?null:He.parentCommentId||Ie;He.resolvedTime?xe.push(He):!Xe&&!He.resolvedTime?pe.push({...He}):Xe&&(ke.has(Xe)||ke.set(Xe,[]),ke.get(Xe).push(He))}),{parentComments:pe.sort(X),resolvedComments:xe.sort(X)}},dr=R=>Fn(re.value,R),rr=dt(()=>dr(Hi)),je=dt(()=>Fn(ne.value,Hi)),Je=dt(()=>{var R;return((R=rr.value)==null?void 0:R.parentComments.some(X=>X.trackedChange&&!X.resolvedTime))??!1}),Ut=dt(()=>dr(cn)),un=R=>W.includes(R),Xt=dt(()=>s.documents),Zn=dt(()=>l),Bi=(R,X)=>{const pe=R.getContainerLocation(X);return{top:pe.top+R.selectionBounds.top,left:pe.left+R.selectionBounds.left}},ri=({selection:R,documentId:X,parentCommentId:pe,...xe})=>ot({selection:R,documentId:X,parentCommentId:pe,...xe}),ot=({selection:R,documentId:X,parentCommentId:pe,...xe})=>{let ke;return X?ke=s.getDocument(X):R&&(ke=s.getDocument(R.documentId)),ke||(ke=s.documents[0]),Od({fileId:ke.id,fileType:ke.type,parentCommentId:pe,creatorId:s.user.id,creatorEmail:s.user.email,creatorName:s.user.name,creatorImage:s.user.image,commentText:q.value,selection:R,...xe})},jt=R=>{var pe,xe,ke,Me,He,Ie,Xe,Ke;const X=!!K.value;if(q.value="",Q.value=[],K.value=null,oe.value=null,s.selectionPosition=null,X&&io(),mt(R)){if(X)try{(Ie=(He=(Me=(ke=(xe=(pe=R==null?void 0:R.activeEditor)==null?void 0:pe.host)==null?void 0:xe.getHandles)==null?void 0:ke.call(xe))==null?void 0:Me.selection)==null?void 0:He.clear)==null||Ie.call(He)}catch{}return}(Ke=(Xe=R==null?void 0:R.activeEditor)==null?void 0:Xe.commands)==null||Ke.removeComment({commentId:"pending"})},gr=({superdoc:R,comment:X,skipEditorUpdate:pe=!1,broadcastChanges:xe=!0,isHydration:ke=!1})=>{var wt,ct,vt;if(p()&&!ke)return u();const Me=!pe&&!ke?Pe(R):null;if(Me&&!X.trackedChange){const Ft=T3(K.value?q.value:X.commentText),Zt=K.value?Q.value:X.mentions??[],an=K.value?oe.value:null,Kt=X.parentCommentId?String(X.parentCommentId):(K.value,null);return(async()=>{try{return await(Kt?Me.reply({parentCommentId:Kt,text:Ft,...Zt.length?{mentions:Zt}:{}}):Me.commitPendingComment({text:Ft,target:an,...Zt.length?{mentions:Zt}:{}}))}catch(tn){return{ok:!1,reason:"adapter-threw",detail:(tn==null?void 0:tn.message)??String(tn)}}})().then(tn=>{var kr,ir,ii;if(!fr(Me))return{ok:!1,reason:"adapter-stale"};if(!(tn!=null&&tn.ok))return xe&&R.emit("comments-update",{type:D.PENDING,rejected:!0,reason:(tn==null?void 0:tn.reason)??"v2-create-failed",...tn!=null&&tn.committed?{committed:!0}:{}}),tn;const Bn=Oa({superdoc:R,adapter:Me,documentId:Me.documentId,items:tn.items}),Rn=!!K.value;Rn&&jt(R);const Fr=((kr=Bn==null?void 0:Bn.added)==null?void 0:kr.commentId)??null;return Rn&&Fr&&(Jn(R,Fr),Da(Fr)),xe&&R.emit("comments-update",{type:D.ADD,comment:((ii=(ir=Bn==null?void 0:Bn.added)==null?void 0:ir.getValues)==null?void 0:ii.call(ir))??null}),{ok:!0,comment:(Bn==null?void 0:Bn.added)??null}})}let He=re.value.find(Ft=>Ft.commentId===H.value);He||(He=X);const Ie=Od(X.getValues());
532K.value?Ie.setText({text:q.value,suppressUpdate:!0}):Ie.setText({text:X.commentText,suppressUpdate:!0}),Ie.selection.source=((ct=(wt=K.value)==null?void 0:wt.selection)==null?void 0:ct.source)??Ie.selection.source,He&&(Ie.isInternal=He.isInternal),R.config.isInternal||(Ie.isInternal=!1),re.value.push(Ie);const Xe=!!K.value;jt(R),Xe&&(H.value=Ie.commentId,Da(Ie.commentId)),!pe&&!X.trackedChange&&((vt=R.activeEditor)!=null&&vt.commands)&&!X.parentCommentId&&R.activeEditor.commands.insertComment({...Ie.getValues(),skipEmit:!0});const Ke={type:D.ADD,comment:Ie.getValues()};return xe&&(Hm(R,Ke),R.emit("comments-update",Ke)),{ok:!0,comment:Ie}},$n=({superdoc:R,comment:X,skipEditorUpdate:pe=!1,broadcastChanges:xe=!0})=>gr({superdoc:R,comment:X,skipEditorUpdate:pe,broadcastChanges:xe}),Pr=({superdoc:R,comment:X,skipEditorUpdate:pe=!1,broadcastChanges:xe=!0})=>gr({superdoc:R,comment:X,skipEditorUpdate:pe,broadcastChanges:xe,isHydration:!0}),ui=({commentId:R,superdoc:X})=>{var wt,ct;if(p())return Promise.resolve(u());const pe=re.value.findIndex(vt=>vt.commentId===R),xe=re.value[pe];if(!xe)return Promise.resolve({ok:!1,reason:"comment-not-found"});const{commentId:ke,importedId:Me}=xe,{fileId:He}=xe,Ie=Pe(X);if(Ie&&!xe.trackedChange)return(async()=>{try{return await Ie.delete({commentId:ke})}catch(vt){return{ok:!1,reason:"adapter-threw",detail:(vt==null?void 0:vt.message)??String(vt)}}})().then(vt=>{if(!fr(Ie))return{ok:!1,reason:"adapter-stale"};if(!(vt!=null&&vt.ok))return X.emit("comments-update",{type:D.DELETED,rejected:!0,comment:xe.getValues(),reason:(vt==null?void 0:vt.reason)??"v2-delete-failed",...vt!=null&&vt.committed?{committed:!0}:{}}),vt;const Ft=new Set((Array.isArray(vt.removedCommentIds)?vt.removedCommentIds:[]).map(me).filter(Boolean));if(Ft.has(me(ke))){Me!=null&&Ft.add(me(Me));let Zt=!0;for(;Zt;){Zt=!1;for(const an of re.value){const Kt=me(an==null?void 0:an.parentCommentId);if(!(!Kt||!Ft.has(Kt)))for(const tn of[an==null?void 0:an.commentId,an==null?void 0:an.importedId].map(me).filter(Boolean))Ft.has(tn)||(Ft.add(tn),Zt=!0)}}re.value=re.value.filter(an=>![an==null?void 0:an.commentId,an==null?void 0:an.importedId].map(me).filter(Boolean).some(Kt=>Ft.has(Kt))),Ft.has(me(H.value))&&io()}else Oa({superdoc:X,adapter:Ie,documentId:Ie.documentId??He,items:vt.items??[],pruneStale:vt.complete!==!1});return X.emit("comments-update",{type:D.DELETED,comment:xe.getValues(),changes:[{key:"deleted",commentId:ke,fileId:He}]}),{ok:!0}});(ct=(wt=X.activeEditor)==null?void 0:wt.commands)==null||ct.removeComment({commentId:ke,importedId:Me}),re.value.splice(pe,1);const Xe=re.value.filter(vt=>vt.parentCommentId===ke).map(vt=>vt.commentId||vt.importedId);re.value=re.value.filter(vt=>!Xe.includes(vt.commentId)),(H.value===ke||Xe.includes(H.value))&&io();const Ke={type:D.DELETED,comment:xe.getValues(),changes:[{key:"deleted",commentId:ke,fileId:He}]};return X.emit("comments-update",Ke),Hm(X,Ke),Promise.resolve({ok:!0})},jr=({superdoc:R,documentId:X,removedIds:pe}={})=>{const xe=new Set([...pe instanceof Set?pe:pe??[]].map(vt=>me(vt)).filter(Boolean));if(!xe.size)return{ok:!0,removedIds:[]};const ke=X!=null?String(X):null,Me=vt=>{if(ke==null)return!0;const Ft=(vt==null?void 0:vt.fileId)!=null?String(vt.fileId):null;return Ft==null?!0:Ft===ke},He=vt=>!vt||vt.trackedChange===!0||M0(vt)?!1:Me(vt),Ie=new Set(xe);let Xe=!0;for(;Xe;){Xe=!1;for(const vt of re.value){if(!He(vt))continue;const Ft=jn(vt),Zt=Ft.some(Kt=>Ie.has(Kt)),an=Ie.has(me(vt==null?void 0:vt.parentCommentId))||Ie.has(me(vt==null?void 0:vt.threadingParentCommentId));if(!(!Zt&&!an))for(const Kt of Ft)Ie.has(Kt)||(Ie.add(Kt),Xe=!0)}}const Ke=[...re.value];re.value=re.value.filter(vt=>He(vt)?!jn(vt).some(Ft=>Ie.has(Ft)):!0);const wt=Ke.filter(vt=>!re.value.includes(vt));if(wt.length===0)return{ok:!0,removedIds:[]};const ct=me(H.value);return ct&&Ie.has(ct)&&io(),wt.forEach(vt=>{var an;const Ft=typeof vt.getValues=="function"?vt.getValues():vt,Zt={type:D.DELETED,comment:Ft,changes:[{key:"deleted",commentId:Ft==null?void 0:Ft.commentId,fileId:Ft==null?void 0:Ft.fileId}]};(an=R==null?void 0:R.emit)==null||an.call(R,"comments-update",Zt)}),{ok:!0,removedIds:[...Ie]}},Zr=({superdoc:R,documentId:X,lifecycle:pe}={})=>{var Kt,tn,Bn;const xe=me(pe==null?void 0:pe.commentId),ke=pe==null?void 0:pe.status;if(!xe||ke!=="open"&&ke!=="resolved")return null;const Me=me(X),He=re.value.filter(Rn=>{if(!Rn||Rn.trackedChange===!0||M0(Rn))return!1;const Fr=me(Rn.fileId);return Me==null||Fr==null||Fr===Me}),Ie=new Map,Xe=new Map;for(const Rn of He){for(const kr of[Rn.commentId,Rn.importedId].map(me).filter(
532Boolean))Ie.has(kr)||Ie.set(kr,Rn);const Fr=me(Rn.parentCommentId);if(Fr){const kr=Xe.get(Fr)??[];kr.push(Rn),Xe.set(Fr,kr)}}let Ke=Ie.get(xe)??null;const wt=new Set;for(;(Ke==null?void 0:Ke.parentCommentId)!=null;){const Rn=me(Ke.parentCommentId);if(!Rn||wt.has(Rn))break;wt.add(Rn);const Fr=Ie.get(Rn);if(!Fr)break;Ke=Fr}if(!Ke)return null;const ct=[],vt=[Ke],Ft=new Set;for(;vt.length>0;){const Rn=vt.shift();if(!(!Rn||Ft.has(Rn))){Ft.add(Rn),ct.push(Rn);for(const Fr of[Rn.commentId,Rn.importedId].map(me).filter(Boolean))vt.push(...Xe.get(Fr)??[])}}const Zt=ke==="resolved",an=Date.now();for(const Rn of ct)Rn.resolvedTime=Zt?Rn.resolvedTime??an:null,Rn.resolvedById=Zt?((Kt=R==null?void 0:R.user)==null?void 0:Kt.id)??null:null,Rn.resolvedByEmail=Zt?((tn=R==null?void 0:R.user)==null?void 0:tn.email)??null:null,Rn.resolvedByName=Zt?((Bn=R==null?void 0:R.user)==null?void 0:Bn.name)??null:null;return{added:null,lifecycleUpdated:ct.length}},ro=async({superdoc:R,adapter:X,fileId:pe,operation:xe,eventType:ke,rejectionFallbackReason:Me,rejectionEventExtras:He={},validateOutcome:Ie,successEventBuilder:Xe})=>{var Zt,an,Kt;let Ke;try{Ke=await xe()}catch(tn){Ke={ok:!1,reason:"adapter-threw",detail:(tn==null?void 0:tn.message)??String(tn)}}if(!fr(X))return{ok:!1,reason:"adapter-stale"};if(!(Ke!=null&&Ke.ok)){const tn={type:ke,rejected:!0,reason:(Ke==null?void 0:Ke.reason)??Me,...Ke!=null&&Ke.committed?{committed:!0}:{},...(Ke==null?void 0:Ke.code)!==void 0?{code:Ke.code}:{},...(Ke==null?void 0:Ke.detail)!==void 0?{detail:Ke.detail}:{},...He};return(Zt=R==null?void 0:R.emit)==null||Zt.call(R,"comments-update",tn),Ke}const wt=Ie==null?void 0:Ie({outcome:Ke});if((wt==null?void 0:wt.ok)===!1){const tn={ok:!1,committed:wt.committed??!0,reason:wt.reason??Me,...wt.code!==void 0?{code:wt.code}:{},...wt.detail!==void 0?{detail:wt.detail}:{}},Bn={type:ke,rejected:!0,reason:tn.reason,...tn.committed?{committed:!0}:{},...tn.code!==void 0?{code:tn.code}:{},...tn.detail!==void 0?{detail:tn.detail}:{},...He};return(an=R==null?void 0:R.emit)==null||an.call(R,"comments-update",Bn),tn}const ct=X.documentId??pe,vt=Zr({superdoc:R,documentId:ct,lifecycle:Ke.threadLifecycle})??Oa({superdoc:R,adapter:X,documentId:ct,items:Ke.items??[],pruneStale:Ke.complete!==!1}),Ft=(Xe==null?void 0:Xe({outcome:Ke,reconciled:vt}))??null;return Ft&&((Kt=R==null?void 0:R.emit)==null||Kt.call(R,"comments-update",Ft)),{ok:!0,items:Ke.items??[],reconciled:vt,...Ke.complete===!1?{complete:!1}:{},...Ke.visibleWindowSource!=null?{visibleWindowSource:Ke.visibleWindowSource}:{},...Ke.threadLifecycle!=null?{threadLifecycle:Ke.threadLifecycle}:{},...Ke.mutationPath!=null?{mutationPath:Ke.mutationPath}:{}}},Go=({outcome:R,adapter:X,fileId:pe})=>(R.items??[]).map(xe=>X.mapV2CommentToUseCommentInput(xe,{fileId:pe,fileType:null})).filter(Boolean),er=R=>typeof R!="string"||R.replace(/<[^>]*>/g,"").replace(/&nbsp;/gi," ").trim().length===0,is=R=>!R||R.event==="omit"||R.changeId==null?null:ri({documentId:R.documentId,commentId:R.changeId,trackedChange:!0,trackedChangeText:R.trackedChangeText,trackedChangeType:R.trackedChangeType,trackedChangeDisplayType:R.trackedChangeDisplayType,semanticColorKey:R.semanticColorKey,semanticColor:R.semanticColor,deletedText:R.deletedText,trackedChangeLabel:typeof R.trackedChangeLabel=="string"&&R.trackedChangeLabel.length>0?R.trackedChangeLabel:null,trackedChangeDetailLines:CO(R.trackedChangeDetailLines),trackedChangeImagePreview:EO(R.trackedChangeImagePreview),...Object.prototype.hasOwnProperty.call(R,"customAttributes")?{customAttributes:SO(R.customAttributes)}:{},createdTime:R.date,creatorId:R.authorId??null,creatorName:R.author,creatorEmail:R.authorEmail,creatorImage:R.authorImage,isInternal:!1,importedAuthor:R.importedAuthor,...Object.prototype.hasOwnProperty.call(R,"importedId")?{importedId:R.importedId!=null?String(R.importedId):null}:{},trackedChangeStory:R.trackedChangeStory??null,trackedChangeStoryKind:R.trackedChangeStoryKind??null,trackedChangeStoryLabel:R.trackedChangeStoryLabel??"",trackedChangeAnchorKey:R.trackedChangeAnchorKey??null,trackedChangeCanonicalId:R.trackedChangeCanonicalId??null,trackedChangePositionAliases:Ve(R.trackedChangePositionAliases),selection:{source:Wm,selectionBounds:R.coords??null}}),di=({superdoc:R,commentItems:X=[],trackedChangeItems:pe=[]}={})=>{var ct,vt,Ft;const xe=Pe(R),ke=z(R);if(!xe||!ke||typeof xe.mapV2CommentToUseCommentInput!="function"||typeof ke.mapV2TrackedChangeToCommentParam
532s!="function")return ne.value=[],{ok:!1,reason:"adapter-unavailable"};const Me=((ct=R==null?void 0:R.activeEditor)==null?void 0:ct.documentId)??((Ft=(vt=R==null?void 0:R.activeEditor)==null?void 0:vt.options)==null?void 0:Ft.documentId)??xe.documentId??ke.documentId??null,He=Me!=null?s.getDocument(String(Me)):null,Ie=X.filter(Zt=>!Wx(Zt)).map(Zt=>xe.mapV2CommentToUseCommentInput(Zt,{fileId:Me,fileType:(He==null?void 0:He.type)??null})).filter(Boolean),Xe=new Map;for(const Zt of Ie)Zt.trackedChange!==!0&&Zt.trackedChangeThreadParentId&&!Zt.parentCommentId&&er(Zt.commentText)&&Xe.set(String(Zt.commentId),String(Zt.trackedChangeThreadParentId));const Ke=Ie.filter(Zt=>!Xe.has(String(Zt.commentId))).map(Zt=>{const an=Zt.parentCommentId?Xe.get(String(Zt.parentCommentId)):null;return an&&(Zt.threadingParentCommentId=an,Zt.trackedChangeThreadParentId??(Zt.trackedChangeThreadParentId=an)),Od(Zt)}),wt=pe.map(Zt=>ke.mapV2TrackedChangeToCommentParams(Zt)).map(Zt=>is(Zt)).filter(Boolean);return ne.value=[...Ke,...wt],{ok:!0,count:ne.value.length}},Hr=()=>{ne.value=[]},No=R=>{const X=(R==null?void 0:R.commentId)??(R==null?void 0:R.importedId);return X!=null?String(X):null},Mo=R=>(R==null?void 0:R.parentCommentId)!=null?String(R.parentCommentId):null,Ti=({outcome:R,adapter:X,fileId:pe,commentId:xe,expectedResolved:ke,operation:Me})=>{const He=xe!=null?String(xe):null,Ie=R==null?void 0:R.threadLifecycle;if(Ie!=null){const an=me(Ie.commentId),Kt=Ie.status==="resolved";return an===He&&Kt===ke?{ok:!0}:{ok:!1,reason:`v2-${Me}-receipt-lifecycle-mismatch`,detail:{expected:{commentId:He,status:ke?"resolved":"open"},observed:Ie}}}const Xe=Go({outcome:R,adapter:X,fileId:pe}),Ke=Xe.find(an=>No(an)===He)??null,wt=Ke!=null&&Ke.parentCommentId?Xe.find(an=>No(an)===Mo(Ke))??null:Ke,ct=No(wt);if(!wt||!ct)return{ok:!1,reason:`v2-${Me}-refresh-missing`,detail:`comment ${He} was absent from the refreshed v2 comment list after ${Me}`};const vt=[wt,...Xe.filter(an=>Mo(an)===ct)],Ft=an=>!!(an!=null&&an.resolvedTime);if(vt.filter(an=>Ft(an)!==ke).length===0)return{ok:!0};const Zt=Ft(wt);return vt.some(an=>Ft(an)!==Zt)?{ok:!1,reason:`v2-${Me}-refresh-split-thread`,detail:{rootId:ct,expected:ke?"resolved":"open",observed:vt.map(an=>({commentId:No(an),parentCommentId:Mo(an),status:Ft(an)?"resolved":"open"}))}}:{ok:!1,reason:ke?`v2-${Me}-refresh-still-open`:`v2-${Me}-refresh-still-resolved`,detail:`comment ${ct} remained ${Zt?"resolved":"open"} after ${Me}`}},_o=async({superdoc:R,parentCommentId:X,text:pe,mentions:xe=[],trackedChangeTarget:ke}={})=>{if(p())return u();const Me=Pe(R);if(!Me)return{ok:!1,reason:"v2-comments-adapter-missing"};const He=X!=null?String(X):null;if(!He)return{ok:!1,reason:"parent-comment-id-missing"};const Ie=T3(pe);if(Ie.length===0)return{ok:!1,reason:"comment-text-empty"};let Xe=null;if(ke!=null){const ct=(ke==null?void 0:ke.trackedChangeId)!=null?String(ke.trackedChangeId):null;if(!ct)return{ok:!1,reason:"tracked-change-id-missing"};if(ct!==He)return{ok:!1,reason:"tracked-change-target-mismatch"};const vt=Qle(ke.story);Xe={kind:"trackedChange",trackedChangeId:ct,...ke.side!=null?{side:ke.side}:{},...vt?{story:vt}:{}}}const Ke=re.value.find(ct=>String(ct.commentId)===He||ct.trackedChange===!0&&String(ct.trackedChangeCanonicalId)===He),wt=(Ke==null?void 0:Ke.fileId)??Me.documentId??null;return ro({superdoc:R,adapter:Me,fileId:wt,operation:async()=>{const ct=await Me.reply({parentCommentId:He,text:Ie,...xe.length?{mentions:xe}:{}});return ct!=null&&ct.ok||(ct==null?void 0:ct.code)!=="TARGET_NOT_FOUND"||!Xe?ct:Me.commitPendingComment({text:Ie,target:Xe,...xe.length?{mentions:xe}:{}})},eventType:D.ADD,rejectionFallbackReason:"v2-reply-failed",rejectionEventExtras:Ke?{comment:qe(Ke)}:{},successEventBuilder:({reconciled:ct})=>{var vt,Ft;return{type:D.ADD,comment:((Ft=(vt=ct==null?void 0:ct.added)==null?void 0:vt.getValues)==null?void 0:Ft.call(vt))??null}}})},yn=async({superdoc:R,commentId:X,text:pe}={})=>{if(p())return u();const xe=Pe(R);if(!xe)return{ok:!1,reason:"v2-comments-adapter-missing"};const ke=X!=null?String(X):null;if(!ke)return{ok:!1,reason:"comment-id-missing"};const Me=T3(pe);if(Me.length===0)return{ok:!1,reason:"comment-text-empty"};const He=re.value.find(Xe=>String(Xe.commentId)===ke),Ie=(He==null?void 0:He.fileId)??xe.documentId??null;return ro({superdoc:R,adapter:xe,fileId:Ie,operation:()=>xe.edit({commentId:ke,text:Me}),eventType:D.UPDATE,rejectionFallbackReason:"v2-edit-failed",rejectionEventExtras:He?{comment:qe(He),changes:[{key:"text",value:Me}]}:{},successEventBuilder:()=>{const Xe=re.value.find(Ke=>String(Ke.commentId)===ke)??He;return Xe?{type:D.UPDATE,comment:qe(Xe),changes:[{key:"text",value:Xe.commentText??Me}]}:null}})},Nn=async({superdoc:R,commentId:X}={})=>
532{if(p())return u();if(f())return d();const pe=Pe(R);if(!pe)return{ok:!1,reason:"v2-comments-adapter-missing"};const xe=X!=null?String(X):null;if(!xe)return{ok:!1,reason:"comment-id-missing"};const ke=re.value.find(Ie=>String(Ie.commentId)===xe),Me=(ke==null?void 0:ke.fileId)??pe.documentId??null,He=await ro({superdoc:R,adapter:pe,fileId:Me,operation:()=>pe.resolve({commentId:xe}),eventType:D.RESOLVED,rejectionFallbackReason:"v2-resolve-failed",rejectionEventExtras:ke?{comment:qe(ke)}:{},validateOutcome:({outcome:Ie})=>Ti({outcome:Ie,adapter:pe,fileId:Me,commentId:xe,expectedResolved:!0,operation:"resolve"}),successEventBuilder:()=>{const Ie=re.value.find(Xe=>String(Xe.commentId)===xe)??ke;return Ie?{type:D.RESOLVED,comment:qe(Ie)}:null}});if(He!=null&&He.ok){const Ie=re.value.find(wt=>String(wt.commentId)===xe),Xe=!!(Ie!=null&&Ie.resolvedTime),Ke=H.value!=null?String(H.value):null;Xe&&Ke===xe&&io()}return He},yr=async({superdoc:R,commentId:X}={})=>{if(p())return u();if(f())return d();const pe=Pe(R);if(!pe)return{ok:!1,reason:"v2-comments-adapter-missing"};const xe=X!=null?String(X):null;if(!xe)return{ok:!1,reason:"comment-id-missing"};const ke=re.value.find(He=>String(He.commentId)===xe),Me=(ke==null?void 0:ke.fileId)??pe.documentId??null;return ro({superdoc:R,adapter:pe,fileId:Me,operation:()=>pe.reopen({commentId:xe}),eventType:D.UPDATE,rejectionFallbackReason:"v2-reopen-failed",rejectionEventExtras:ke?{comment:qe(ke),changes:[{key:"resolvedTime",value:null}]}:{},validateOutcome:({outcome:He})=>Ti({outcome:He,adapter:pe,fileId:Me,commentId:xe,expectedResolved:!1,operation:"reopen"}),successEventBuilder:()=>{const He=re.value.find(Ie=>String(Ie.commentId)===xe);return!He||He.resolvedTime?null:{type:D.UPDATE,comment:qe(He),changes:[{key:"resolvedTime",value:null}]}}})},fr=R=>R?tt.value===R:!1,Ri=R=>R?xt.value===R:!1,Co=R=>new Set([...jn(R),R==null?void 0:R.commentId,R==null?void 0:R.importedId,R==null?void 0:R.trackedChangeCanonicalId,R==null?void 0:R.trackedChangeAnchorKey,R==null?void 0:R.parentCommentId,R==null?void 0:R.threadingParentCommentId,R==null?void 0:R.trackedChangeParentId,R==null?void 0:R.trackedChangeThreadParentId].map(X=>me(X)).filter(Boolean)),uu=({documentId:R,visibleIds:X})=>{var ke;const pe=new Set([...X,H.value,te.value,M.value,(ke=K.value)==null?void 0:ke.commentId,Ce.value,Ue.value].map(Me=>me(Me)).filter(Boolean));let xe=!0;for(;xe;){xe=!1;for(const Me of re.value){if(!So(Me,R))continue;const He=Co(Me);if([...He].some(Ie=>pe.has(Ie)))for(const Ie of He)pe.has(Ie)||(pe.add(Ie),xe=!0)}}re.value=re.value.filter(Me=>!So(Me,R)||Me===K.value?!0:[...Co(Me)].some(He=>pe.has(He)))},nc=({superdoc:R,commentsAdapter:X,trackedChangesAdapter:pe,documentId:xe,commentItems:ke,trackedChangeItems:Me,requestedCommentIds:He,requestedTrackedChangeIds:Ie,unresolvedCommentIds:Xe,trackedList:Ke,sourceCoverageRevision:wt,evaluatedRevision:ct,patch:vt}={})=>S0("store.reviewWindow.apply","store-reconciliation",{commentItemCount:Array.isArray(ke)?ke.length:null,trackedItemCount:Array.isArray(Me)?Me.length:null},()=>{var Fr,kr,ir,ii,Do;if(!fr(X))return{ok:!1,reason:"comments-adapter-stale"};if(!Ri(pe))return{ok:!1,reason:"tracked-changes-adapter-stale"};const Ft=xe!=null?String(xe):null,Zt=((Fr=R==null?void 0:R.activeEditor)==null?void 0:Fr.documentId)??((ir=(kr=R==null?void 0:R.activeEditor)==null?void 0:kr.options)==null?void 0:ir.documentId)??null;if(!Ft)return{ok:!1,reason:"document-mismatch"};for(const En of[X.documentId,pe.documentId,Zt])if(En==null||String(En)!==Ft)return{ok:!1,reason:"document-mismatch"};if(!Array.isArray(ke)||!Array.isArray(Me))return{ok:!1,reason:"items-invalid"};if((Ke==null?void 0:Ke.complete)!==!1||(Ke==null?void 0:Ke.visibleWindowSource)!=="visible-window")return{ok:!1,reason:"tracked-list-not-partial-visible-window"};if(typeof X.mapV2CommentToUseCommentInput!="function"||typeof pe.mapV2TrackedChangeToCommentParams!="function")return{ok:!1,reason:"adapter-mapper-missing"};let an=ke;if(typeof X.seedReviewCatalog=="function"){const En=X.seedReviewCatalog(ke,{sourceCoverageRevision:wt,evaluatedRevision:ct});if((En==null?void 0:En.ok)!==!0)return{ok:!1,reason:(En==null?void 0:En.reason)??"comment-catalog-seed-failed"};const ws=(ii=X.selectVisibleReviewComments)==null?void 0:ii.call(X);(ws==null?void 0:ws.ok)===!0&&Array.isArray(ws.items)&&(!Array.isArray(ws.unresolvedIds)||ws.unresolvedIds.length===0)&&(an=ws.items)}const Kt=((Do=Ft?s.getDocument(Ft):null)==null?void 0:Do.type)??null;let tn,Bn;try{tn=an.filter(En=>!Wx(En)).map(En=>X.mapV2CommentToUseCommentInput(En,{fileId:Ft,fileType:Kt}
532)).filter(Boolean),Bn=Me.map(En=>pe.mapV2TrackedChangeToCommentParams(En)).filter(Boolean)}catch(En){return{ok:!1,reason:"mapper-failed",detail:(En==null?void 0:En.message)??String(En)}}if(typeof vt!="function")return{ok:!1,reason:"patch-missing"};const Rn=new Set([...Array.isArray(He)?He:[],...Array.isArray(Ie)?Ie:[],...Array.isArray(Xe)?Xe:[],...an.flatMap(En=>[En==null?void 0:En.id,En==null?void 0:En.commentId,En==null?void 0:En.importedId]),...Me.flatMap(En=>[En==null?void 0:En.id,En==null?void 0:En.changeId]),...tn.flatMap(En=>[En==null?void 0:En.commentId,En==null?void 0:En.importedId,En==null?void 0:En.parentCommentId,En==null?void 0:En.trackedChangeThreadParentId]),...Bn.flatMap(En=>[En==null?void 0:En.changeId,En==null?void 0:En.trackedChangeCanonicalId,En==null?void 0:En.trackedChangeAnchorKey])].map(En=>me(En)).filter(Boolean));return vt(()=>{rf({superdoc:R,adapter:pe,documentId:Ft,items:Me,preparedParams:Bn,pruneStale:!1}),Oa({superdoc:R,adapter:X,documentId:Ft,items:an,preparedInputs:tn,pruneStale:!1}),uu({documentId:Ft,visibleIds:Rn})}),{ok:!0,commentItems:tn.length,trackedItems:Bn.length}}),Oa=({superdoc:R,adapter:X,documentId:pe,items:xe,preparedInputs:ke=null,pruneStale:Me=!0,hydrationGeneration:He}={})=>S0("store.comments.reconcile","store-reconciliation",{documentId:pe??null,itemCount:Array.isArray(xe)?xe.length:null,hydrationGeneration:He??null},()=>{var Ml,xs;if(!X||!Array.isArray(xe))return{added:null};if(!fr(X))return{added:null,dropped:"adapter-stale"};const Ie=pe??X.documentId??null,Xe=Ie!=null?String(Ie):null,Ke=((Ml=Ie?s.getDocument(Ie):null)==null?void 0:Ml.type)??null,wt=fn=>typeof fn!="string"?!0:fn.replace(/<[^>]*>/g,"").replace(/&nbsp;/gi," ").trim().length===0,ct=fn=>!fn||fn.trackedChange===!0||!fn.trackedChangeThreadParentId||fn.parentCommentId?!1:wt(fn.commentText),vt=H.value!=null?String(H.value):null,Ft=vt?re.value.find(fn=>String(fn.commentId)===vt)??null:null,Zt=Ft!=null&&K.value!=null&&(Ft===K.value||K.value.commentId!=null&&String(Ft.commentId??"")===String(K.value.commentId)),an=Ft!=null&&!Zt&&Ft.trackedChange!==!0&&!M0(Ft)&&(Xe==null||Ft.fileId==null||String(Ft.fileId)===Xe),Kt=new Map,tn=new Map,Bn=[],Rn=Array.isArray(ke)?ke:xe.filter(fn=>!Wx(fn)).map(fn=>X.mapV2CommentToUseCommentInput(fn,{fileId:Ie,fileType:Ke})).filter(Boolean);for(const fn of Rn){if(ct(fn)){tn.set(String(fn.commentId),String(fn.trackedChangeThreadParentId)),I("hydrate:drop-v2-sidecar-comment",{commentId:fn.commentId??null,importedId:fn.importedId??null,parentCommentId:fn.parentCommentId??null,trackedChangeParentId:fn.trackedChangeParentId??null,trackedChangeThreadParentId:fn.trackedChangeThreadParentId??null,trackedChangeSide:fn.trackedChangeSide??null,commentText:fn.commentText??null});continue}Bn.push(fn)}for(const fn of Bn){const _r=fn.parentCommentId!=null?String(fn.parentCommentId):null,Eo=_r?tn.get(_r):null;Eo&&(fn.threadingParentCommentId=Eo,fn.trackedChangeThreadParentId==null&&(fn.trackedChangeThreadParentId=Eo));const La=fn.commentId!=null?String(fn.commentId):null;La&&Kt.set(La,fn)}const Fr=fn=>
532{if(Xe==null)return!0;const _r=(fn==null?void 0:fn.fileId)!=null?String(fn.fileId):null;return _r==null?!0:_r===Xe},kr=((xs=K.value)==null?void 0:xs.commentId)!=null?String(K.value.commentId):null,ir=fn=>!fn||!K.value?!1:fn===K.value||kr!=null&&String(fn.commentId??"")===kr,ii=fn=>!fn||ir(fn)||fn.trackedChange===!0||M0(fn)?!1:fn.commentId!=null,Do=(fn,_r)=>{fn.commentText=_r.commentText??fn.commentText,fn.mentions=Array.isArray(_r.mentions)?_r.mentions:[],fn.isInternal=typeof _r.isInternal=="boolean"?_r.isInternal:fn.isInternal,typeof _r.resolvedTime=="number"?(fn.resolvedTime=_r.resolvedTimeWasSynthesized===!0&&typeof fn.resolvedTime=="number"?fn.resolvedTime:_r.resolvedTime,fn.resolvedByEmail=_r.resolvedByEmail??null,fn.resolvedByName=_r.resolvedByName??null):(fn.resolvedTime=null,fn.resolvedByEmail=null,fn.resolvedByName=null),_r.parentCommentId!==void 0?fn.parentCommentId=_r.parentCommentId:delete fn.parentCommentId,_r.trackedChangeParentId!==void 0?fn.trackedChangeParentId=_r.trackedChangeParentId:delete fn.trackedChangeParentId,_r.trackedChangeThreadParentId!==void 0?fn.trackedChangeThreadParentId=_r.trackedChangeThreadParentId:fn.trackedChangeThreadParentId=void 0,_r.trackedChangeSide!==void 0?fn.trackedChangeSide=_r.trackedChangeSide:fn.trackedChangeSide=void 0,_r.threadingParentCommentId!==void 0?fn.threadingParentCommentId=_r.threadingParentCommentId:delete fn.threadingParentCommentId},En=[],ws=new Set,Nl=[];for(const fn of re.value){if(!ii(fn)||!Fr(fn)){En.push(fn);continue}const _r=String(fn.commentId),Eo=Kt.get(_r);Eo&&(Do(fn,Eo),ws.add(_r),En.push(fn)),!Eo&&!Me&&En.push(fn)}for(const[fn,_r]of Kt.entries()){if(ws.has(fn))continue;const Eo=Od(_r);En.push(Eo),Nl.push(Eo)}return re.value=En,an&&vt&&!En.some(fn=>String(fn.commentId)===vt)&&io(),{added:Nl[Nl.length-1]??null}}),ta=async({superdoc:R,commentId:X}={})=>{var Xe,Ke,wt,ct,vt;const pe=me(X),xe=Pe(R),ke=(Ke=(Xe=R==null?void 0:R.activeEditor)==null?void 0:Xe.doc)==null?void 0:Ke.comments;if(!pe)return{ok:!1,reason:"comment-id-missing"};if(!xe||!fr(xe))return{ok:!1,reason:"comments-adapter-stale"};if(typeof(ke==null?void 0:ke.get)!="function")return{ok:!1,reason:"document-api-unavailable"};let Me;try{Me=await ke.get({commentId:pe})}catch(Ft){return{ok:!1,reason:"comment-read-failed",detail:(Ft==null?void 0:Ft.message)??String(Ft)}}if(!fr(xe))return{ok:!1,reason:"comments-adapter-stale"};const He=((wt=Oa({superdoc:R,adapter:xe,documentId:xe.documentId,items:[Me],pruneStale:!1}))==null?void 0:wt.added)??re.value.find(Ft=>String((Ft==null?void 0:Ft.commentId)??"")===pe||String((Ft==null?void 0:Ft.importedId)??"")===pe)??null,Ie={type:D.ADD,comment:((ct=He==null?void 0:He.getValues)==null?void 0:ct.call(He))??null};return(vt=R==null?void 0:R.emit)==null||vt.call(R,"comments-update",Ie),{ok:!0,comment:He}},ys=R=>{jt(R)},du=R=>typeof R!="string"?null:R.replace(/\s*\(imported\)\s*$/u,"").trim()||null,na=R=>{if(!R)return null;try{if(R.isDestroyed===!0)return null;const X=R.view;if(!X||X.isDestroyed===!0||X.destroyed===!0)return null;const pe=X.state;return pe?{view:X,state:pe}:null}catch{return null}},Gu=R=>R!=null&&String(R).length>0?String(R):null,Ja=R=>{const X=Gu(R),pe=X?[[X,x.get(X)]]:Array.from(x.entries());let xe=0;for(const[ke,Me]of pe)Me&&(x.delete(ke),Me.timeoutHandle!==null&&Me.timeoutHandle!==void 0&&clearTimeout(Me.timeoutHandle),xe+=1);return xe},Na=R=>{var He,Ie;const X=na(R);if(!X)return null;let pe=[];try{pe=fl.getTrackChanges(X.state)??[]}catch{return null}const xe=fl==null?void 0:fl.enumerateStructuralRowChanges;let ke=[];if(typeof xe=="function")try{ke=xe(X.state)??[]}catch{ke=[]}let Me=[];if(typeof E0=="function")try{Me=((Ie=(He=E0(R))==null?void 0:He.getAll)==null?void 0:Ie.call(He))??[]}catch{Me=[]}return{...X,trackedChanges:pe,structuralChanges:ke,storySnapshots:Me}},Oc=(R,X,pe=null)=>{if(!R||!X)return!1;const xe=pe??Na(R);return xe?(bh(R,X,xe.trackedChanges,{editorState:xe.state,editorView:xe.view}),bs({superdoc:X,editor:R,snapshots:xe.storySnapshots,documentState:xe.state,resolveFromEditor:!1}),Sh({superdoc:X,editor:R,structuralChanges:xe.structuralChanges}),!0):!1},Ts=R=>{var X,pe,xe;if(!R||x.get(R.documentId)!==R)return!1;try{const ke=(pe=(X=R.editor)==null?void 0:X.options)==null?void 0:pe.documentId;if(ke!=null&&String(ke)!==R.documentId)return!1;const Me=s.getDocument(R.documentId);if(!Me||((xe=Me.getEditor)==null?void 0:xe.call(Me))!==R.editor)return!1}catch{return!1}return!0},fu=R=>{if(!Ts(R))return x.get(R==null?void 0:R.documentId)===R&&x.delete(R.documentId),!1;const X=Na(R.editor);if(!X||!Ts(R))return x.get(R.documentId)===R&&x.delete(R.documentId),!1;try{return Oc(R.editor,R.superdoc,X)}finally{x.get(R.documentId)===R&&x.delete(R.documentId)}},qo=({editor:R,superdoc:X,documentId:pe,defer:xe=!0})=>{const ke=Gu(pe);if(!ke||!R||!X)return!1;Ja(ke);const Me={documentId:ke,editor:R,superdoc:X,generation:++T,timeoutHandle:null};return x.set(ke,Me),xe?(Me.timeoutHandle=setTimeout(()=>{Me.timeoutHandle=null,fu(Me)},0),!0):fu(Me)};function Ei(R){const X=R!=null?String(R):null;if(!X)return;Ja(X);const pe=re.value.filter(Me=>Mc(Me,X,{allowSingleDocumentMismatch:!0}));if(!pe.length)return;const xe=new Set;if(pe.forEach(Me=>{jn(Me).forEach(He=>xe.add(He))}),re.value=re.value.filter(Me=>!pe.includes(Me)),xe.size){const Me={...Be.value};xe.forEach(He=>{delete Me[He]}),Be.value=Me}const ke=H.value!=null?String(H.value):null;ke&&xe.has(ke)&&io()}function Il(R){Ei(R)}const Rl=async({superdoc:R,editor:X,comments:pe,documentId:xe,replacedFile:ke=!1})=>{var He;const Me=s.getDocument(xe);if(Me!=null&&Me.commentThreadingProfile&&(Me.commentThreadingProfile.value=((He=X==null?void 0:X.converter)==null?void 0:He.commentThreadingProfile)||null),ke&&Il(xe),pe.forEach(Ie=>{const Xe=Array.isArray(Ie.elements)?Ie.elements:[],Ke=uf(Xe);if(!Ke&&!Ie.trackedChange)return;const wt=du(Ie.creatorName),ct=wt?`${wt}
532 (imported)`:null,vt=Od({fileId:xe,fileType:Me.type,docxCommentJSON:Xe.length?Xe:null,commentId:Ie.commentId,isInternal:!1,parentCommentId:Ie.parentCommentId,trackedChangeParentId:Ie.trackedChangeParentId,trackedChangeThreadParentId:Ie.trackedChangeThreadParentId,creatorId:null,creatorName:wt,createdTime:Ie.createdTime,creatorEmail:Ie.creatorEmail,importedAuthor:{...ct?{name:ct}:{},email:Ie.creatorEmail},commentText:Ke,resolvedTime:Ie.isDone?Date.now():null,resolvedById:null,resolvedByEmail:Ie.isDone?Ie.creatorEmail:null,resolvedByName:Ie.isDone?ct||"(Imported)":null,trackedChange:Ie.trackedChange||!1,trackedChangeText:Ie.trackedChangeText,trackedChangeType:Ie.trackedChangeType,trackedChangeDisplayType:Ie.trackedChangeDisplayType,deletedText:Ie.trackedDeletedText,origin:Ie.origin||"word",threadingMethod:Ie.threadingMethod,threadingStyleOverride:Ie.threadingStyleOverride,threadingParentCommentId:Ie.threadingParentCommentId,originalXmlStructure:Ie.originalXmlStructure});Pr({superdoc:R,comment:vt})}),ke){qo({editor:X,superdoc:R,documentId:xe,defer:!1});return}qo({editor:X,superdoc:R,documentId:xe})},bh=(R,X,pe=null,xe={})=>{var Fr;const{reopenResolved:ke=!1,refreshExisting:Me=!1,broadcastChanges:He=!0,editorState:Ie=null,editorView:Xe=null}=xe,Ke=Ie?{state:Ie,view:Xe}:na(R);if(!(Ke!=null&&Ke.state))return;const wt=Ke.state,ct=pe??fl.getTrackChanges(wt),vt=gle(ct),Ft=((Fr=R==null?void 0:R.options)==null?void 0:Fr.documentId)!=null?String(R.options.documentId):null;if(!Ft)return;const Zt=new Set,an=new Map;re.value.forEach(kr=>{if(!(kr!=null&&kr.trackedChange)||!So(kr,Ft)||!t(kr))return;const ir=[kr.commentId,kr.importedId].map(ii=>ii!=null?String(ii):null).filter(Boolean);if(kr.resolvedTime){ke||ir.forEach(ii=>Zt.add(ii));return}ir.forEach(ii=>{an.set(ii,kr),Me||Zt.add(ii)})});const Kt=new Map;for(const kr of ct){const ir=kr.mark.attrs.id;Kt.has(ir)||Kt.set(ir,[]),Kt.get(ir).push(kr)}const tn=new Set;vt.forEach(({insertedMark:kr,deletionMark:ir,formatMark:ii})=>{const Do=(kr==null?void 0:kr.mark.attrs.id)||(ir==null?void 0:ir.mark.attrs.id)||(ii==null?void 0:ii.mark.attrs.id);if(Do==null)return;const En=String(Do);tn.has(En)||(tn.add(En),!(!Me&&Zt.has(En))&&(an.get(En),{...kr&&{insertedMark:kr.mark},...ir&&{deletionMark:ir.mark},...ii&&{formatMark:ii.mark}},E3({trackedChangesForId:Kt.get(Do)||[]})))});const Bn=Ke.view;try{if(!Bn||R.view!==Bn||Bn.isDestroyed===!0||Bn.destroyed===!0)return}catch{return}const{tr:Rn}=wt;Rn.setMeta(Ule,{type:"force"}),Bn.dispatch(Rn)},hu=({suppressedIds:R,activeDocumentId:X,superdoc:pe=null,broadcastChanges:xe=!0})=>{if(!(R instanceof Set)||!R.size||!X)return;const ke=[];if(re.value=re.value.filter(Ie=>{if(!(Ie!=null&&Ie.trackedChange)||!t(Ie)||lf(Ie)||!So(Ie,X))return!0;const Xe=Ie.commentId!=null?String(Ie.commentId):null,Ke=Ie.importedId!=null?String(Ie.importedId):null;return Xe&&R.has(Xe)||Ke&&R.has(Ke)?(ke.push(Ie),!1):!0}),!ke.length)return;const Me=new Set;ke.forEach(Ie=>{var wt;Ie.commentId!=null&&Me.add(String(Ie.commentId)),Ie.importedId!=null&&Me.add(String(Ie.importedId));const Xe=qe(Ie),Ke={type:D.DELETED,comment:Xe,changes:[{key:"deleted",commentId:Xe.commentId,fileId:Xe.fileId}]};xe&&(Hm(pe,Ke),(wt=pe==null?void 0:pe.emit)==null||wt.call(pe,"comments-update",Ke))});const He=H.value!=null?String(H.value):null;He&&Me.has(He)&&io()},Nc=R=>{var X;return R?R.fileId!=null?String(R.fileId):R.documentId!=null?String(R.documentId):((X=R.selection)==null?void 0:X.documentId)!=null?String(R.selection.documentId):null:null},vs=()=>{var X;const R=Array.isArray(s.documents)?s.documents:(X=s.documents)==null?void 0:X.value;return Array.isArray(R)?R:[]},el=()=>{var X;const R=vs();return R.length!==1?null:((X=R[0])==null?void 0:X.id)!=null?String(R[0].id):null},Mc=(R,X,pe={})=>{const{allowSingleDocumentMismatch:xe=!1}=pe;if(!X)return!1;const ke=Nc(R);if(ke){if(ke===X)return!0;const Me=el();return xe&&Me===X}return el()===X},So=(R,X)=>Mc(R,X,{allowSingleDocumentMismatch:!0}),Xd=R=>{const X=typeof R=="string"?R.toLowerCase():"";return X?X==="insert"||X==="insertion"||X==="trackinsert"||X==="tableinsert"||X==="paragraphsplit"?"insertion":X==="delete"||X==="deleti
532on"||X==="trackdelete"||X==="tabledelete"?"deletion":X:null},Zd=({comment:R,decision:X}={})=>{const pe=X==="accept"||X==="reject"?X:null;if(!pe)return!1;const xe=Xd(R==null?void 0:R.trackedChangeDisplayType)??Xd(R==null?void 0:R.trackedChangeType);return pe==="accept"&&xe==="insertion"||pe==="reject"&&xe==="deletion"},rc=R=>{const X=me(R.commentId),pe=me(R.trackedChangeCanonicalId);return[X,...pe&&pe!==X?[]:[R.importedId,pe,R.trackedChangeAnchorKey,...Ve(R.trackedChangePositionAliases)]].map(xe=>me(xe)).filter(Boolean)},qu=R=>{const X=R.map((He,Ie)=>Ie),pe=He=>{let Ie=He;for(;X[Ie]!==Ie;)Ie=X[Ie];for(;X[He]!==He;){const Xe=X[He];X[He]=Ie,He=Xe}return Ie},xe=(He,Ie)=>{const Xe=pe(He),Ke=pe(Ie);Xe!==Ke&&(X[Math.max(Xe,Ke)]=Math.min(Xe,Ke))},ke=new Map;R.forEach((He,Ie)=>{rc(He).forEach(Xe=>{const Ke=ke.get(Xe);Ke===void 0?ke.set(Xe,Ie):xe(Ie,Ke)})});const Me=new Map;return R.forEach((He,Ie)=>{const Xe=pe(Ie),Ke=Me.get(Xe)??[];Ke.push(He),Me.set(Xe,Ke)}),Me},Qd=R=>{const X=new Map;return R.forEach(([pe,...xe])=>{if(!pe||xe.length===0)return;const ke=xe.find(Me=>Me.resolvedTime!=null);pe.resolvedTime==null&&ke&&(pe.resolvedTime=ke.resolvedTime,pe.resolvedById=ke.resolvedById,pe.resolvedByEmail=ke.resolvedByEmail,pe.resolvedByName=ke.resolvedByName,pe.trackedChangeDecision=ke.trackedChangeDecision),pe.trackedChangePositionAliases=Ve([...Ve(pe.trackedChangePositionAliases),...xe.flatMap(Me=>[Me.commentId,Me.importedId,Me.trackedChangeCanonicalId,...Ve(Me.trackedChangePositionAliases)])]),xe.forEach(Me=>X.set(Me,pe))}),X},Dc=R=>{const X=new Map;return R.forEach((pe,xe)=>{const ke=me(xe.commentId),Me=me(pe.commentId);ke&&Me&&X.set(ke,Me)}),X},sm=(R,X)=>{const pe=xe=>{const ke=me(xe.value);ke&&R.has(ke)&&(xe.value=R.get(ke))};pe(H),pe(te),re.value.forEach(xe=>{if(!So(xe,X))return;const ke={};for(const Me of["trackedChangeThreadParentId","trackedChangeParentId","threadingParentCommentId","parentCommentId"]){const He=R.get(me(xe==null?void 0:xe[Me]));
532He&&(xe[Me]=He,ke[Me]=He)}Object.keys(ke).length&&typeof xe.updateIdentityValues=="function"&&xe.updateIdentityValues(ke)})},Jd=R=>{const X=re.value.filter(ke=>t(ke)&&So(ke,R)),pe=qu(X),xe=Qd(pe);return xe.size?(re.value=re.value.filter(ke=>!xe.has(ke)),sm(Dc(xe),R),xe.size):0},ic=(R,X,pe,xe=null,{broadcastChanges:ke=!0}={})=>S0("store.trackedChanges.pruneStaleComments","store-reconciliation",{activeDocumentId:pe??null,liveIdCount:R instanceof Set?R.size:null,liveAnchorKeyCount:X instanceof Set?X.size:null},()=>{if(!(R instanceof Set)||!pe)return;const Me=new Set,He=[],Ie=[...re.value];if(re.value=re.value.filter(ct=>{if(!(ct!=null&&ct.trackedChange)||!So(ct,pe))return!0;const vt=ct.commentId!=null?String(ct.commentId):null,Ft=ct.importedId!=null?String(ct.importedId):null,Zt=ct.trackedChangeAnchorKey!=null?String(ct.trackedChangeAnchorKey):null,an=!!(vt&&R.has(vt)),Kt=!!(Ft&&R.has(Ft)),tn=!!(Zt&&(X!=null&&X.has(Zt)));if(!vt&&!Ft&&!Zt||an||Kt||tn||ct.resolvedTime)return!0;const Bn=S.get(ct);return Bn?(ct.resolvedTime=Bn.resolvedTime??Date.now(),ct.resolvedById=Bn.resolvedById??null,ct.resolvedByEmail=Bn.resolvedByEmail??null,ct.resolvedByName=Bn.resolvedByName??null,ct.trackedChangeDecision=Bn.trackedChangeDecision??null,He.push(ct),!0):(vt&&Me.add(vt),Ft&&Me.add(Ft),!1)}),Jd(pe),He.forEach(ct=>{var Zt;if(!re.value.includes(ct))return;const vt=qe(ct),Ft={type:D.UPDATE,comment:vt};ke&&(Hm(xe,Ft),(Zt=xe==null?void 0:xe.emit)==null||Zt.call(xe,"comments-update",Ft))}),!Me.size)return;let Xe=!0;for(;Xe;)Xe=!1,re.value=re.value.filter(ct=>{if(!So(ct,pe))return!0;const vt=ct.parentCommentId!=null?String(ct.parentCommentId):null,Ft=hn(ct)!=null?String(hn(ct)):null;if(!(vt&&Me.has(vt)||Ft&&Me.has(Ft))||ct.resolvedTime)return!0;const Zt=ct.commentId!=null?String(ct.commentId):null,an=ct.importedId!=null?String(ct.importedId):null;return Zt&&Me.add(Zt),an&&Me.add(an),Xe=!0,!1});Ie.filter(ct=>{if(!So(ct,pe))return!1;const vt=ct.commentId!=null?String(ct.commentId):null,Ft=ct.importedId!=null?String(ct.importedId):null;return vt&&Me.has(vt)||Ft&&Me.has(Ft)}).forEach(ct=>{var Zt;const vt=qe(ct),Ft={type:D.DELETED,comment:vt,changes:[{key:"deleted",commentId:vt.commentId,fileId:vt.fileId}]};ke&&(Hm(xe,Ft),(Zt=xe==null?void 0:xe.emit)==null||Zt.call(xe,"comments-update",Ft))});const Ke=H.value!=null?String(H.value):null,wt=Ie.some(ct=>{const vt=ct.commentId!=null?String(ct.commentId):null,Ft=ct.importedId!=null?String(ct.importedId):null;return So(ct,pe)&&(vt&&vt===Ke||Ft&&Ft===Ke)});Ke&&Me.has(Ke)&&wt&&io()}),Wu=({superdoc:R,comment:X,decision:pe}={})=>{var He,Ie;if(!(X!=null&&X.trackedChange)||Zd({comment:X,decision:pe}))return 0;const xe=Ma(X);if(!xe.size)return 0;const ke={email:((He=R==null?void 0:R.user)==null?void 0:He.email)??null,name:((Ie=R==null?void 0:R.user)==null?void 0:Ie.name)??null,superdoc:R,reconciliationToken:q1};let Me=0;
532return Ku(X).forEach(Xe=>{!Xe||Xe===X||Xe.resolvedTime||[hn(Xe),Xe.threadingParentCommentId,Xe.parentCommentId].map(Ke=>me(Ke)).filter(Boolean).some(Ke=>xe.has(Ke))&&typeof Xe.resolveComment=="function"&&(Xe.resolveComment(ke),Me+=1)}),Me},Ma=R=>{const X=new Set(jn(R));(R==null?void 0:R.trackedChangeCanonicalId)!=null&&X.add(String(R.trackedChangeCanonicalId));const pe=(R==null?void 0:R.trackedChangeAnchorKey)!=null?String(R.trackedChangeAnchorKey):null;if(pe&&(X.add(pe),pe.startsWith("tc::"))){const xe=pe.slice(pe.lastIndexOf("::")+2);xe&&X.add(xe)}return X},Ku=R=>{const X=[],pe=new Set;for(const xe of Ma(R))for(const ke of Ee.value.get(String(xe))??[])pe.has(ke)||(pe.add(ke),X.push(ke));return X},ef=R=>{const X=R&&typeof R=="object"?R:null;if(!(X!=null&&X.success))return new Set;const pe=new Set,xe=ke=>{const Me=ke&&typeof ke=="object"?ke:null;(Me==null?void 0:Me.kind)!=="entity"||Me.entityType!=="trackedChange"||Me.entityId!=null&&String(Me.entityId).length>0&&pe.add(String(Me.entityId))};return Array.isArray(X.removed)&&X.removed.forEach(xe),Array.isArray(X.invalidatedRefs)&&X.invalidatedRefs.forEach(xe),pe},ra=R=>{const X=new Set;return(R==null?void 0:R.decidedId)!=null&&String(R.decidedId).length>0&&X.add(String(R.decidedId)),Array.isArray(R==null?void 0:R.decidedIds)&&R.decidedIds.forEach(pe=>{pe!=null&&String(pe).length>0&&X.add(String(pe))}),ef(R==null?void 0:R.receipt).forEach(pe=>X.add(pe)),X},wh=({comment:R,decision:X}={})=>{if(!(R!=null&&R.trackedChange)||!Zd({comment:R,decision:X}))return 0;const pe=Ma(R);if(!pe.size)return 0;let xe=0;return Ku(R).forEach(ke=>{if(!ke||ke===R)return;const Me=me(ke.trackedChangeParentId),He=me(ke.trackedChangeThreadParentId),Ie=me(ke.threadingParentCommentId),Xe=me(ke.parentCommentId);(Me&&pe.has(Me)||He&&pe.has(He)||Ie&&pe.has(Ie)||Xe&&pe.has(Xe))&&(delete ke.trackedChangeParentId,ke.trackedChangeThreadParentId=void 0,ke.trackedChangeSide=void 0,delete ke.threadingParentCommentId,Xe&&pe.has(Xe)&&delete ke.parentCommentId,xe+=1)}),xe},am=(R=[],{documentId:X}={})=>{const pe=me(X);if(!Array.isArray(R)||R.length===0||!pe)return;const xe=Be.value||{};let ke=!1;const Me=(Ie,Xe,Ke,wt)=>me(Ie==null?void 0:Ie[Xe])!==Ke?!1:(Ie[Xe]=wt,!0),He=(Ie,Xe)=>(Ie==null?void 0:Ie.trackedChange)&&So(Ie,pe)&&[Ie.commentId,Ie.importedId,Ie.trackedChangeCanonicalId,...jn(Ie)].map(Ke=>me(Ke)).includes(Xe);for(const Ie of R){const Xe=me(Ie==null?void 0:Ie.from),Ke=me(Ie==null?void 0:Ie.to);if(!Xe||!Ke||Xe===Ke)continue;const wt=re.value.find(ir=>He(ir,Xe));if(!wt)continue;const ct=me(wt.commentId),vt=me(wt.trackedChangeCanonicalId),Ft=Lt(wt).entry,Zt=![wt.commentId,wt.importedId,wt.trackedChangeCanonicalId].map(ir=>me(ir)).includes(Xe)&&ct!=null&&vt!=null&&ct===vt,an={};for(const ir of["commentId","importedId"])Me(wt,ir,Xe,Ke)&&(an[ir]=Ke);Me(wt,"trackedChangeCanonicalId",Xe,Ke)&&(an.trackedChangeCanonicalId=Ke),Zt&&(wt.commentId=Ke,wt.trackedChangeCanonicalId=Ke,an.commentId=Ke,an.trackedChangeCanonicalId=Ke);const Kt=r(wt.trackedChangeAnchorKey),tn=(Kt==null?void 0:Kt.storyKey)??gt(lt(wt)),Bn=i(tn,Ke),Rn=new Set([Xe]);Zt&&(ct&&Rn.add(ct),vt&&Rn.add(vt)),(wt.trackedChangeAnchorKey==null||Rn.has(Kt==null?void 0:Kt.rawId))&&(wt.trackedChangeAnchorKey=Bn),wt.trackedChangePositionAliases=Ve([...Array.isArray(wt.trackedChangePositionAliases)?wt.trackedChangePositionAliases:[],Xe]);const Fr=new Set([Xe]);Zt&&(ct&&Fr.add(ct),vt&&Fr.add(vt)),re.value.forEach(ir=>{if(ir===wt||!So(ir,pe))return;const ii={};for(const Do of["trackedChangeThreadParentId","trackedChangeParentId","threadingParentCommentId","parentCommentId"])Fr.has(me(ir==null?void 0:ir[Do]))&&(ir[Do]=Ke,ii[Do]=Ke);Object.keys(ii).length&&typeof ir.updateIdentityValues=="function"&&ir.updateIdentityValues(ii)}),Object.keys(an).length&&typeof wt.updateIdentityValues=="function"&&wt.updateIdentityValues(an);const kr=Ft??[xe[Xe],xe[n(Xe)]].find(ir=>ir&&Hn(ir,wt));if(kr)for(const ir of[Ke,Bn])xe[ir]===void 0&&(xe[ir]=kr,ke=!0);Fr.has(me(H.value))&&(H.value=Ke),Fr.has(me(te.value))&&(te.value=Ke)}ke&&(Be.value={...xe})},tf=({superdoc:R,comment:X,decidedId:pe,decidedIds:xe,documentId:ke}={})=>{const Me=new Set((Array.isArray(xe)||xe instanceof Set?Array.from(xe):[pe]).map(vt=>
532me(vt)).filter(Boolean)),He=me(ke);if(!Me.size||!He)return{removed:!1,removedIds:new Set};const Ie=new Set;let Xe=!1;const Ke=X?re.value.indexOf(X):-1,wt=X!=null&&X.trackedChange?Ma(X):new Set;if(Ke>=0&&So(X,He)&&Array.from(wt).some(vt=>Me.has(vt))?(wt.forEach(vt=>Ie.add(vt)),re.value.splice(Ke,1),Xe=!0):re.value=re.value.filter(vt=>{if(!(vt!=null&&vt.trackedChange)||!So(vt,He))return!0;const Ft=Ma(vt);return Array.from(Ft).some(Zt=>Me.has(Zt))?(Xe=!0,Ft.forEach(Zt=>Ie.add(Zt)),!1):!0}),!Xe)return{removed:!1,removedIds:Ie};const ct=H.value!=null?String(H.value):null;return ct&&Ie.has(ct)&&io(),{removed:!0,removedIds:Ie}},Yu=({adapter:R,documentId:X}={})=>{const pe=me(X);if(!R||!pe)return{removed:0,removedIds:new Set};const xe=new Set,ke=me(H.value);let Me=!1;const He=re.value.filter(Xe=>{if(!(Xe!=null&&Xe.trackedChange)||!So(Xe,pe))return!0;const Ke=Ma(Xe);return Ke.forEach(wt=>xe.add(wt)),ke&&Ke.has(ke)&&(Me=!0),!1}),Ie=re.value.length-He.length;return Ie>0&&(re.value=He),Me&&io(),{removed:Ie,removedIds:xe}},xh=(R,X)=>{if(!(!X||typeof(R==null?void 0:R.clearActiveTrackedChangeTargetIfMatches)!="function"))try{R.clearActiveTrackedChangeTargetIfMatches(X)}catch{}},nf=async({superdoc:R,receipt:X}={})=>{var xe;const pe=(xe=R==null?void 0:R.activeEditor)==null?void 0:xe.documentMutationReadiness;if(!((X==null?void 0:X.success)!==!0||typeof(X==null?void 0:X.txId)!="string"||!X.txId||typeof(pe==null?void 0:pe.whenPainted)!="function"))try{await pe.whenPainted(X);const ke=globalThis.requestAnimationFrame;typeof ke=="function"&&await new Promise(Me=>{let He=!1;const Ie=()=>{He||(He=!0,clearTimeout(Xe),Me())},Xe=setTimeout(Ie,250);ke(()=>ke(()=>setTimeout(Ie,0)))})}catch{}},kh=({superdoc:R,comment:X,decision:pe})=>{var ct,vt,Ft,Zt;const xe=m(R);if(xe)return{ok:!1,reason:xe};if(!(X!=null&&X.trackedChange))return{ok:!1};const ke=z(R);if(ke){if(pe!=="accept"&&pe!=="reject")return Promise.resolve({ok:!1,reason:"decision-invalid"});const an=(X==null?void 0:X.trackedChangeCanonicalId)!=null?String(X.trackedChangeCanonicalId):(X==null?void 0:X.commentId)!=null?String(X.commentId):(vt=(ct=X==null?void 0:X.trackedChangeAnchorKey)==null?void 0:ct.startsWith)!=null&&vt.call(ct,"tc::body::")?X.trackedChangeAnchorKey.slice(10):null,Kt=an!=null&&String(H.value??"")===an;return S0("store.trackedChanges.sidebarDecision","command",{decision:pe,decidedId:an},()=>(async()=>{try{return await(pe==="accept"?ke.accept(X):ke.reject(X))}catch(tn){return{ok:!1,reason:"adapter-threw",detail:(tn==null?void 0:tn.message)??String(tn)}}})().then(async tn=>{var kr,ir,ii;if(!Ri(ke))return{ok:!1,reason:"adapter-stale"};if(!(tn!=null&&tn.ok))return{ok:!1,reason:tn==null?void 0:tn.reason,detail:tn==null?void 0:tn.detail};const Bn=ra(tn),Rn=Bn.size?Bn:Ma(X),Fr=(tn==null?void 0:tn.documentId)??ke.documentId??((kr=R==null?void 0:R.activeEditor)==null?void 0:kr.documentId)??((ii=(ir=R==null?void 0:R.activeEditor)==null?void 0:ir.options)==null?void 0:ii.documentId)??null;return!Rn.size||!Fr?{ok:!1,committed:!0,reason:"decision-scope-missing"}:(Rn.forEach(Do=>xh(ke,Do)),await nf({superdoc:R,receipt:tn.receipt}),Wu({superdoc:R,comment:X,decision:pe}),wh({comment:X,decision:pe}),tf({superdoc:R,comment:X,decidedIds:Rn,documentId:Fr}),Kt&&io(),{ok:!0,success:!0})}))}const Me=R==null?void 0:R.activeEditor;if(!Me)return{ok:!1};const He=X.commentId??X.importedId;if(!He)return{ok:!1};const Ie=X.trackedChangeStory??void 0,Xe=typeof Me.doc=="object"?Me.doc:null;if((Ft=Xe==null?void 0:Xe.trackChanges)!=null&&Ft.decide)try{const an=Ie?{id:He,story:Ie}:{id:He};return Promise.resolve(Xe.trackChanges.decide({decision:pe,target:an})).then(Kt=>({ok:!0,success:!!(Kt!=null&&Kt.success)}))}catch(an){if(Ie)return{ok:!1,error:an}}const Ke=pe==="accept"?"acceptTrackedChangeById":"rejectTrackedChangeById",wt=(Zt=Me.commands)==null?void 0:Zt[Ke];return typeof wt!="function"?{ok:!1}:{ok:!0,success:!!wt(He)}},pu=async({superdoc:R,adapter:X,documentId:pe,upsertIds:xe=[],removedIds:ke=[],remappedPairs:Me=[],allResolved:He}={})=>{var Ft;const Ie=X??z(R);if(!Ie)return{ok:!1,reason:"adapter-missing"};if(!Ri(Ie))return{ok:!1,reason:"adapter-stale"};const Xe=pe??Ie.documentId??((Ft=R==null?void 0:R.activeEditor)==null?void 0:Ft.documentId)??null;if(He&&Xe==null)return{ok:!1,reason:"document-id-missing"};if(He)return{ok:!0,items:[],resolvedIds:[],unresolvedIds:[],allResolved:!0,removedRows:S0("store.trackedChanges.allResolved","store-reconciliation",{documentId:String(Xe),logicalTargetCount:He.logicalTargetCount??null,physicalCarrierCount:He.physicalCarrierCount??null},()=>Yu({adapter:Ie,documentId:Xe})).removed};const Ke=new Set(Array.from(ke??[]).map(Zt=>
532me(Zt)).filter(Boolean)),wt=[...new Set(Array.from(xe??[]).map(Zt=>me(Zt)).filter(Boolean))],ct=new Set((Array.isArray(Me)?Me:[]).map(Zt=>me(Zt==null?void 0:Zt.from)).filter(Boolean)),vt=new Set([...Ke].filter(Zt=>!ct.has(Zt)));return vt.size>0&&Xe!=null&&tf({superdoc:R,decidedIds:vt,documentId:Xe}),{ok:!0,items:[],resolvedIds:[],unresolvedIds:wt,removedIds:[...vt]}},_h=R=>{const X=new Map,pe=new Set;let xe=0,ke=0;const Me=(Ie,Xe,Ke)=>{const wt=me(Xe);if(!wt)return;const ct=Ie.get(wt)??new Set;ct.add(Ke),Ie.set(wt,ct)},He=Ie=>{Ie!=null&&Ie.trackedChange&&(R&&!So(Ie,R)||(pe.add(Ie),Me(X,Ie.commentId,Ie),Me(X,Ie.importedId,Ie),Me(X,Ie.trackedChangeCanonicalId,Ie),Me(X,Ie.trackedChangeAnchorKey,Ie),jn(Ie).forEach(Xe=>Me(X,Xe,Ie))))};return re.value.forEach(He),{add:He,work:()=>({trackedRowsIndexed:pe.size,invalidatedIdMembershipChecks:0,incomingAliasLookups:xe,candidateVisits:ke}),candidates({changeId:Ie,importedId:Xe,anchorKey:Ke,canonicalId:wt,positionAliases:ct=[]}={}){const vt=new Set,Ft=Zt=>{const an=me(Zt);if(!an)return;xe+=1;const Kt=X.get(an);Kt&&(ke+=Kt.size,Kt.forEach(tn=>vt.add(tn)))};
532return new Set([Ie,Xe,wt,Ke,...ct]).forEach(Ft),vt}}},rf=({superdoc:R,adapter:X,documentId:pe,items:xe,pruneStale:ke=!0,preparedParams:Me=null,liveIds:He=null,liveAnchorKeys:Ie=null,hydrationGeneration:Xe}={})=>S0("store.trackedChanges.reconcile","store-reconciliation",{documentId:pe??null,itemCount:Array.isArray(xe)?xe.length:null,pruneStale:ke,hydrationGeneration:Xe??null},()=>{var Kt;if(!X||!Array.isArray(xe)||!Ri(X))return;const Ke=pe??X.documentId??((Kt=R==null?void 0:R.activeEditor)==null?void 0:Kt.documentId)??null,wt=Ie instanceof Set?Ie:new Set,ct=He instanceof Set?He:new Set;let vt=0;const Ft=_h(Ke==null?null:String(Ke)),Zt=CE("store.trackedChanges.batchIdentity","store-reconciliation",{itemCount:xe.length}),an=Array.isArray(Me)?Me:xe.map(tn=>X.mapV2TrackedChangeToCommentParams(tn));try{for(const tn of an)if(tn){if(tn.event==="omit"){tn.changeId!=null&&ct.add(String(tn.changeId));continue}Ke&&tn.documentId==null&&(tn.documentId=Ke),tn.changeId!=null&&ct.add(String(tn.changeId)),tn.trackedChangeAnchorKey!=null&&wt.add(String(tn.trackedChangeAnchorKey)),Tr({superdoc:R,params:tn,broadcastChanges:!1,trackedChangeIdentityIndex:Ft}),vt+=1}}finally{V0(Zt,Ft.work())}return!Ke||!ke?(Ke&&Jd(String(Ke)),{liveIds:ct,liveAnchorKeys:wt,appliedCount:vt}):(ic(ct,wt,String(Ke),R,{broadcastChanges:!1}),{liveIds:ct,liveAnchorKeys:wt,appliedCount:vt})}),Ch=(R=null)=>{const X=R==null?null:String(R);return re.value.filter(pe=>{if((pe==null?void 0:pe.trackedChange)!==!0)return!1;if(X==null)return!0;const xe=(pe==null?void 0:pe.documentId)??(pe==null?void 0:pe.fileId)??null;return xe!=null&&String(xe)===X}).length},lm=({superdoc:R,editor:X,broadcastChanges:pe=!0})=>{var Ke;if(!R||!X)return;const xe=((Ke=X==null?void 0:X.options)==null?void 0:Ke.documentId)!=null?String(X.options.documentId):null;if(!xe)return;const ke=Na(X);if(!ke)return;const Me=ke.trackedChanges,He=new Set;Me.forEach(wt=>{var vt,Ft;const ct=(Ft=(vt=wt==null?void 0:wt.mark)==null?void 0:vt.attrs)==null?void 0:Ft.id;ct!=null&&He.add(String(ct))});const Ie=ke.storySnapshots,Xe=new Set(Ie.map(wt=>wt==null?void 0:wt.anchorKey).filter(wt=>typeof wt=="string"&&wt.length>0));ic(He,Xe,xe,R,{broadcastChanges:pe}),bh(X,R,Me,{reopenResolved:!0,refreshExisting:!0,broadcastChanges:pe,editorState:ke.state,editorView:ke.view}),bs({superdoc:R,editor:X,broadcastChanges:pe,snapshots:Ie,documentState:ke.state}),Sh({superdoc:R,editor:X,broadcastChanges:pe,structuralChanges:ke.structuralChanges})},Sh=({superdoc:R,editor:X,broadcastChanges:pe=!0,structuralChanges:xe=null})=>{var Ie;const ke=((Ie=X==null?void 0:X.options)==null?void 0:Ie.documentId)!=null?String(X.options.documentId):null;if(!ke)return;const Me=fl==null?void 0:fl.enumerateStructuralRowChanges;if(typeof Me!="function")return;let He=xe;if(!Array.isArray(He)){const Xe=na(X);if(!Xe)return;try{He=Me(Xe.state)??[]}catch{He=[]}}for(const Xe of He){if(!(Xe!=null&&Xe.decidable)||!(Xe!=null&&Xe.wholeTable))continue;const Ke=o(Xe);if(!Ke)continue;const wt=n(Ke),ct=Xe.subtype==="table-insert"?"tableInsert":"tableDelete",vt=Xe.side==="insertion"?"trackInsert":"trackDelete",Ft=String(Ke),Zt=wt!=null?String(wt):null,an={event:re.value.find(Kt=>{if(!(Kt!=null&&Kt.trackedChange)||!So(Kt,ke))return!1;const tn=Kt.trackedChangeAnchorKey!=null?String(Kt.trackedChangeAnchorKey):null;if(Zt&&tn)return tn===Zt;const Bn=Kt.commentId!=null?String(Kt.commentId):null,Rn=Kt.importedId!=null?String(Kt.importedId):null;return Bn===Ft||Rn===Ft})?"update":"add",changeId:Ke,trackedChangeText:"",trackedChangeType:vt,trackedChangeDisplayType:ct,deletedText:null,authorId:null,authorEmail:Xe.authorEmail||null,authorImage:Xe.authorImage||null,date:Xe.date||null,author:Xe.author||null,importedAuthor:Xe.importedAuthor?{name:Xe.importedAuthor}:null,semanticColorKey:Xe.semanticColorKey??null,semanticColor:Xe.semanticColor??null,documentId:ke,coords:null,trackedChangeStory:e,trackedChangeStoryKind:"body",trackedChangeStoryLabel:"",trackedChangeAnchorKey:wt};Tr({superdoc:R,params:an,broadcastChanges:pe})}},bs=({superdoc:R,editor:X,broadcastChanges:pe=!0,snapshots:xe=null,documentState:ke=void 0,resolveFromEditor:Me=!0})=>{var Xe;const He=((Xe=X==null?void 0:X.options)==null?void 0:Xe.documentId)!=null?String(X.options.documentId):null;if(!He)return;let Ie=xe;if(!Array.isArray(Ie)){if(typeof E0!="function"||!na(X))return;let Ke=null;try{Ke=E0(X)}catch{return}if(!Ke)return;try{Ie=Ke.getAll()}catch{return}}for(const Ke of Ie)Ke.storyKind!=="body"&&mu({superdoc:R,editor:X,snapshot:Ke,documentId:He,broadcastChanges:pe,documentState:ke,resolveFromEditor:Me})},Lc=R=>
532(R==null?void 0:R.type)!=="structural"?(R==null?void 0:R.type)??null:(R==null?void 0:R.subtype)==="table-delete"?"tableDelete":"tableInsert",Xu=R=>(R==null?void 0:R.type)!=="structural"?(R==null?void 0:R.type)??null:(R==null?void 0:R.subtype)==="table-delete"?"trackDelete":"trackInsert",of=R=>R?R.type==="delete"?!0:R.type==="structural"&&R.subtype==="table-delete":!1,sf=({editor:R,snapshot:X,documentId:pe,event:xe,resolveFromEditor:ke=!0})=>{var ct;const Me=Xu(X),He=Lc(X),Ie={event:xe,changeId:X.runtimeRef.rawId,trackedChangeText:of(X)?"":X.excerpt??"",trackedChangeType:Me,trackedChangeDisplayType:He,semanticColorKey:X.semanticColorKey??null,semanticColor:X.semanticColor??null,deletedText:of(X)?X.excerpt??"":null,authorId:X.authorId,authorEmail:X.authorEmail,authorImage:X.authorImage,date:X.date,author:X.author,documentId:pe,coords:null,trackedChangeStory:X.story,trackedChangeStoryKind:X.storyKind,trackedChangeStoryLabel:X.storyLabel,trackedChangeAnchorKey:X.anchorKey};if(!ke||typeof _O!="function")return Ie;let Xe=null;try{Xe=_O(R,{kind:"entity",entityType:"trackedChange",entityId:X.runtimeRef.rawId,story:X.story})}catch{Xe=null}const Ke=((ct=Xe==null?void 0:Xe.editor)==null?void 0:ct.state)??null;if(!Ke)return Ie;let wt=[];try{wt=fl.getTrackChanges(Ke,Xe.change.rawId)??[]}catch{wt=[]}return E3({marks:zr(wt)}),Ie},mu=({superdoc:R,editor:X,snapshot:pe,documentId:xe,broadcastChanges:ke,documentState:Me,resolveFromEditor:He})=>{var Ke;if(!((Ke=pe==null?void 0:pe.runtimeRef)!=null&&Ke.rawId))return;const Ie=re.value.find(wt=>{if(!(wt!=null&&wt.trackedChange))return!1;const ct=wt.trackedChangeAnchorKey!=null?String(wt.trackedChangeAnchorKey):null;return ct&&pe.anchorKey?ct===pe.anchorKey:ct||pe.anchorKey?!1:wt.commentId===pe.runtimeRef.rawId||wt.importedId===pe.runtimeRef.rawId}),Xe=sf({editor:X,snapshot:pe,documentId:xe,event:Ie?"update":"add",resolveFromEditor:He});Tr({superdoc:R,params:Xe,broadcastChanges:ke,documentState:Me}),Ie&&(Ie.trackedChangeStory=pe.story,Ie.trackedChangeStoryKind=pe.storyKind,Ie.trackedChangeStoryLabel=pe.storyLabel,Ie.trackedChangeAnchorKey=pe.anchorKey)},af=R=>R?(Array.isArray(R)?R:[R]).filter(Boolean):[],Eh=()=>{const R=[];return re.value.forEach(X=>{const pe=X.getValues(),xe=pe.commentText,ke=af(pe.docxCommentJSON),Me=ke.length?ke:Pc(xe);R.push({...pe,commentJSON:Me})}),R},Pc=R=>{const X=new xO({mode:"text",isHeadless:!0,content:R,extensions:kO()}).getJSON();return Array.isArray(X==null?void 0:X.content)?X.content.filter(Boolean):[]},Ah=(R,X={})=>{if(R==null)return;const pe=(X==null?void 0:X.retainMissingTrackedChangeGeometry)===!0,xe=pe&&(X==null?void 0:X.retainedTrackedChangeIds)!=null?new Set(Array.from(X.retainedTrackedChangeIds,Xe=>me(Xe)).filter(Boolean)):null,ke=Be.value||{},Me={};Object.entries(R).forEach(([Xe,Ke])=>{Me[Xe]=Ke;const wt=(Ke==null?void 0:Ke.kind)==="trackedChange"&&(Ke==null?void 0:Ke.storyKey)==="body"&&(Ke==null?void 0:Ke.threadId)!=null?String(Ke.threadId):null;wt&&Me[wt]===void 0&&(Me[wt]=Ke);const ct=typeof(Ke==null?void 0:Ke.key)=="string"?Ke.key:null;ct&&Me[ct]===void 0&&(Me[ct]=Ke)});const He=(Xe,Ke)=>{for(const wt of jn(Xe)){const ct=Ke[wt];if(ct!==void 0&&Hn(ct,Xe))return ct}return null},Ie=(Xe,Ke,wt=[])=>{const ct=[...jn(Ke),...wt.map(vt=>me(vt)).filter(Boolean)];for(const vt of new Set(ct))Me[vt]===void 0&&(Me[vt]=Xe)};re.value.forEach(Xe=>{if(!(Xe!=null&&Xe.trackedChange)||Xe.resolvedTime)return;const Ke=He(Xe,Me);if(Ke){Ie(Ke,Xe);return}if(!pe||xe&&!jn(Xe).some(ct=>xe.has(ct)))return;const wt=He(Xe,ke);wt&&Ie(wt,Xe,[wt.key,wt.threadId])}),Be.value=Me},Th=()=>{Be.value={}},lf=R=>{if(!(R!=null&&R.trackedChange))return!1;const X=R==null?void 0:R.trackedChangeDisplayType;return X==="tableInsert"||X==="tableDelete"?!0:[R==null?void 0:R.commentId,R==null?void 0:R.importedId,R==null?void 0:R.trackedChangeAnchorKey].map(pe=>pe!=null?String(pe):"").filter(Boolean).some(pe=>pe.includes("word:structural:"))},tl=new WeakMap,nl=R=>{var Ie,Xe;if(!R)return{ranges:[],ids:new Set};const X=tl.get(R);if(X)return X;const pe=[],xe=new Set,ke=Ke=>{Ke!=null&&Ke!==""&&xe.add(String(Ke))},Me=fl==null?void 0:fl.enumerateStructuralRowChanges;if(typeof Me=="function"){let Ke=[];try{Ke=Me(R)??[]}catch{Ke=[]}for(const wt of Ke){if(!(wt!=null&&wt.decidable)||!(wt!=null&&wt.wholeTable))continue;const ct=Number(wt.tableFrom),vt=Number(wt.tableTo);Number.isFinite(ct)&&Number.isFinite(vt)&&pe.push({from:ct,to:vt}),ke(wt.id),ke(wt.revisionId),ke(wt.revisionGroupId),ke(wt.sourceId);for(const Ft of wt.rows||[]){const Zt=(Xe=(Ie=Ft==null?void 0:Ft.node)==null?void 0:Ie.attrs)==null?void 0:Xe.trackChange;ke(Zt==null?void 0:Zt.id),ke(Zt==null?void 0:Zt.sourceId)}}}const He={ranges:pe,ids:xe};return tl.set(R,He),He},gu=R=>{var pe,xe;const X=(xe=(pe=s.getDocument(R))==null?void 0:pe.getEditor)==null?void 0:xe.call(pe);return nl(X==null?void 0:X.state).ranges},Ol=(R,X)=>!(X!=null&&X.length)||!(R!=null&&R.length)?!1:R.every(pe=>{const xe=Number(pe==null?void 0:pe.from),ke=Number(pe==null?void 0:pe.to);return!Number.isFinite(xe)||!Number.isFinite(ke)?!1:X.some(Me=>xe>=Me.from&&ke<=Me.to)}),Ih=R=>
532{if(!(R!=null&&R.trackedChange)||lf(R))return!1;const X=gu(R==null?void 0:R.fileId);if(!X.length)return!1;const pe=Lt(R).entry,xe=rn(pe);return xe?X.some(ke=>xe.start>=ke.from&&xe.end<=ke.to):!1},yu=dt(()=>{var R;return(R=rr.value)==null?void 0:R.parentComments.filter(X=>!X.resolvedTime).filter(X=>!it(X)||Et(X)?!0:!!Lt(X).entry).filter(X=>!Ih(X))}),cf=dt(()=>yu.value.flatMap(R=>{const{key:X,entry:pe}=Lt(R);return Sle({comment:R,positionKey:X,positionEntry:pe,fallbackId:me(R==null?void 0:R.commentId)??jn(R)[0]??null})})),ya=R=>R==null?null:String(R),Da=(R=null)=>{te.value=ya(R)},io=()=>{H.value=null,Da(null)},Rh=(R,X)=>R==null||X==null?!1:cf.value.some(pe=>{var xe;return String(pe.id)===String(R)&&String(((xe=pe.comment)==null?void 0:xe.commentId)??pe.threadId??"")===String(X)}),Zu=R=>{Rh(te.value,R)||Da(null)};function oc(){const R=me(H.value);if(!R)return!1;const X=$e(R),pe=me(X==null?void 0:X.commentId);return!pe||pe===R?!1:(H.value=pe,Zu(pe),!0)}const Oh=({documentMode:R,commentsVisible:X,trackChangesVisible:pe}={})=>{typeof R=="string"&&(y.documentMode=R),typeof X=="boolean"&&(y.commentsVisible=X),typeof pe
532=="boolean"&&(y.trackChangesVisible=pe)},sc=R=>{if(Array.isArray(R))return R.map(He=>sc(He)).flat().filter(Boolean);if(!R||typeof R!="object")return R;const X=He=>{if(!He)return He;const Ie={...He};return delete Ie.fontSize,delete Ie.fontFamily,delete Ie.eastAsiaFontFamily,Object.keys(Ie).length?Ie:void 0},pe=He=>{var Ke;if(!He)return He;const Ie=typeof He.type=="string"?He.type:(Ke=He.type)==null?void 0:Ke.name,Xe=He!=null&&He.attrs?{...He.attrs}:void 0;return Ie==="textStyle"&&Xe?{...He,attrs:X(Xe)}:{...He,attrs:Xe}},xe=He=>Array.isArray(He)?He.filter(Boolean).map(Ie=>pe(Ie)):void 0,ke=He=>He&&typeof He=="object"?{...He}:void 0;if(!Array.isArray(R.content))return{type:R.type,...R.text!==void 0?{text:R.text}:{},...R.attrs?{attrs:ke(R.attrs)}:{},...R.marks?{marks:xe(R.marks)}:{}};const Me=R.content.map(He=>sc(He)).flat().filter(Boolean);return R.type==="run"?Me:{type:R.type,...R.attrs?{attrs:ke(R.attrs)}:{},...R.marks?{marks:xe(R.marks)}:{},content:Me}},uf=R=>{const X=Array.isArray(R)?R:R?[R]:[];if(X.some(pe=>{var xe;return(xe=pe==null?void 0:pe.content)==null?void 0:xe.length}))try{const pe=sc(X),xe=Array.isArray(pe)?pe:pe?[pe]:[];return xe.length?new xO({mode:"text",isHeadless:!0,content:{type:"doc",content:xe},loadFromSchema:!0,extensions:kO()}).getHTML():null}catch(pe){console.warn("Failed to convert comment",pe);return}};return{COMMENT_EVENTS:D,isDebugging:b,hasInitializedComments:P,hasSyncedCollaborationComments:V,editingCommentId:M,activeComment:H,activeFloatingCommentInstanceId:te,commentDialogs:Z,overlappingComments:L,overlappedIds:W,suppressInternalExternal:U,pendingComment:K,currentCommentText:q,currentCommentMentions:Q,commentsList:re,reviewDirectoryList:ne,isCommentsListVisible:st,isReviewDirectoryActive:At,isReviewDirectoryLoading:yt,generalCommentIds:fe,editorCommentIds:Ge,commentsParentElement:ee,editorCommentPositions:Be,hasInitializedLocations:F,isCommentHighlighted:he,floatingCommentsOffset:Oe,sortedConversations:ye,visibleConversations:B,skipSelectionUpdate:be,isFloatingCommentsReady:ie,instantSidebarAlignmentTargetY:ue,instantSidebarAlignmentThreadId:Ce,instantSidebarAlignmentInstanceId:Ue,getConfig:Zn,documentsWithConverations:Xt,getGroupedComments:rr,getGroupedReviewDirectory:je,hasOpenTrackedChanges:Je,getCommentsByPosition:Ut,getFloatingComments:yu,getFloatingCommentInstances:cf,getCommentAliasIds:jn,getTrackedChangeThread:le,getCommentPositionKey:Pn,getCommentPosition:Wn,getCommentAnchoredText:qr,getCommentAnchorData:Yr,resolveCommentPositionEntry:Lt,getCommentDocumentId:Nc,belongsToDocument:Mc,viewingVisibility:y,isViewingMode:Fe,shouldRenderReviewInViewing:Le,init:Y,setViewingVisibility:Oh,getComment:$e,setActiveComment:Jn,getCommentLocation:Bi,hasOverlapId:un,getPendingComment:ri,showAddComment:Gs,addComment:$n,addHydratedComment:Pr,cancelComment:ys,deleteComment:ui,removePendingComment:jt,cancelImportedTrackedChangeBootstrap:Ja,removeCommentsForDocument:Ei,setReviewDirectoryFromV2:di,clearReviewDirectory:Hr,processLoadedDocxComments:Rl,translateCommentsForExport:Eh,handleEditorLocationsUpdate:Ah,clearEditorCommentPositions:Th,handleTrackedChangeUpdate:Tr,refreshTrackedChangeCommentsByIds:Kn,syncResolvedCommentsWithDocument:kn,syncTrackedChangePositionsWithDocument:$t,setActiveFloatingCommentInstance:Da,requestInstantSidebarAlignment:Gn,peekInstantSidebarAlignment:ni,clearInstantSidebarAlignment:Di,syncTrackedChangeComments:lm,decideTrackedChangeFromSidebar:kh,v2CommentsAdapter:tt,setV2CommentsAdapter:De,getV2CommentsAdapter:Pe,applyReviewWindowFromV2:nc,reconcileCommentsFromV2:Oa,announceV2CommentCreated:ta,dropCommentsFromMutationImpact:jr,isV2EditorActive:mt,replyCommentV2:_o,editCommentV2:yn,resolveCommentV2:Nn,reopenCommentV2:yr,v2TrackedChangesAdapter:xt,setV2TrackedChangesAdapter:de,getV2TrackedChangesAdapter:z,getV2TrackedChangeRowCount:Ch,reconcileTrackedChangeMutationFromV2:pu,reconcileTrackedChangesFromV2:rf,remapTrackedChangeIdentities:am}}),Ej='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"/></svg>',Aj='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"/></svg>',Jle='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM625 177L497 305c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L591 143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>',ece='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M144 0a80 80 0 1 1 0 160A80 80 0 1 1 144 0zM512 0a80 80 0 1 1 0 160A80 80 0 1 1 512 0zM0 298.7C0 239.8 47.8 192 106.7 192l42.7 0c15.9 0 31 3.5 44.6 9.7c-1.3 7.2-1.9 14.7-1.9 22.3c0 38.2 16.8 72.5 43.3 96c-.2 0-.4 0-.7 0L21.3 320C9.6 320 0 310.4 0 298.7zM405.3 320c-.2 0-.4 0-.7 0c26.6-23.5 43.3-57.8 43.3-96c0-7.6-.7-15-1.9-22.3c13.6-6.3 28.7-9.7 44.6-9.7l42.7 0C592.2 192 640 239.8 640 298.7c0 11.8-9.6 21.3-21.3 21.3l-213.3 0zM224 224a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zM128 485.3C128 411.7 187.7 352 261.3 352l117.3 0C452.3 352 512 411.7 512 485.3c0 14.7-11.9 26.7-26.7 26.7l-330.7 0c-14.7 0-26.7-11.9-26.7-26.7z"/></svg>',SE='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>',Tj='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>',Ij='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"/></svg>',Rj='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"/></svg>',Qf={comment:Ej,caretDown:Aj,internal:Jle,external:ece,markDone:SE,acceptChange:SE,rejectChange:Tj,overflow:Ij,reopen:Rj},tce=.38,nce=".superdoc-comment-highlight",rce=e=>{if(typeof(e==null?void 0:e.getBoundingClientRect)!="function")return!1;const t=e.getBoundingClientRect();return!Number.isFinite(t.top)||!Number.isFinite(t.bottom)?!1:t.bottom>0&&t.top<window.innerHeight},ice=e=>e?e.split(",").map(t=>
532t.trim()).filter(Boolean):[],oce=e=>{const t=[];return e?(e.split(",").forEach(n=>{const r=n.indexOf("=");r<=0||t.push(n.slice(0,r),n.slice(r+1))}),t.filter(Boolean)):t},sce=()=>Math.round(window.innerHeight*tce),Oj=(e,t)=>{var i;const n=(i=t==null?void 0:t.bounds)==null?void 0:i.top;if(!Number.isFinite(n)||typeof(e==null?void 0:e.getBoundingClientRect)!="function")return null;const r=e.getBoundingClientRect().top+n;return r<0||r>=window.innerHeight?null:r},ace=e=>{if(typeof document>"u")return null;const t=new Set((e??[]).map(i=>String(i)).filter(Boolean));if(t.size===0)return null;let n=null;const r=document.querySelectorAll(nce);for(const i of r){const o=new Set([...ice(i.getAttribute("data-comment-ids")),...oce(i.getAttribute("data-comment-imported-ids"))]);if(![...t].some(l=>o.has(l))||!rce(i))continue;const s=i.getBoundingClientRect().top;Number.isFinite(s)&&(n=n==null?s:Math.min(n,s))}return n},lce=(e,t,n,r)=>null,cce="Arial, Helvetica, sans-serif";function iT(){const e=fh();return{uiFontFamily:dt(()=>{var n,r,i;const t=(i=(r=(n=e==null?void 0:e.proxy)==null?void 0:n.$superdoc)==null?void 0:r.config)==null?void 0:i.uiDisplayFallbackFont;return typeof t=="string"&&t.trim()?t.trim():cce})}}var uce={class:"comments-dropdown"},dce=["onClick"],fce={key:0,class:"comments-dropdown__option-icon"},hce=["innerHTML"],pce={class:"comments-dropdown__option-label"},Nj=li({__name:"CommentsDropdown",props:{options:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},contentStyle:{type:Object,default:()=>({})}},emits:["select"],setup(e,{emit:t}){const n=e,r=t,i=Ne(!1),o=Ne(null),s=Ne(null),l=Ne({top:"0px",left:"0px"}),u=dt(()=>({...n.contentStyle,position:"fixed",top:l.value.top,left:l.value.left,zIndex:1200})),d=I=>{n.disabled&&I||(i.value=I)},f=()=>{n.disabled||d(!i.value)},p=()=>{i.value&&d(!1)},m=()=>{var H;if(!o.value)return;const I=o.value.getBoundingClientRect(),D=((H=s.value)==null?void 0:H.offsetWidth)??0,P=window.innerWidth||document.documentElement.clientWidth||0,V=8;let ee=I.left;const F=Math.max(V,P-D-V);ee=Math.min(Math.max(V,ee),F),l.value={top:`${I.bottom+4}px`,left:`${ee}px`}},y=I=>{I.stopPropagation(),f()},b=I=>{I!=null&&I.disabled||(r("select",I==null?void 0:I.key,I),p())},k=I=>!!(I!=null&&I.iconString)||!!(I!=null&&I.icon),S=I=>I!=null&&I.iconString?I.iconString:typeof(I==null?void 0:I.icon)=="function"?I.icon(I):(I==null?void 0:I.icon)||null,x=m1({name:"CommentsDropdownOptionIcon",props:{option:{type:Object,required:!0}},setup(I){return()=>S(I.option)}}),T=I=>{var ee,F;if(!i.value)return;const D=I.target;if(!(D instanceof Element))return;const P=(ee=o.value)==null?void 0:ee.contains(D),V=(F=s.value)==null?void 0:F.contains(D);P||V||p()},C=I=>{I.key==="Escape"&&p()};return pr(i,async I=>{I&&(await Sn(),m())}),pr(i,I=>{I?(document.addEventListener("pointerdown",T,!0),document.addEventListener("keydown",C,!0),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0)):(document.removeEventListener("pointerdown",T,!0),document.removeEventListener("keydown",C,!0),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0))}),Hs(()=>{document.removeEventListener("pointerdown",T,!0),document.removeEventListener("keydown",C,!0),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}),(I,D)=>(Ze(),ut("div",uce,[et("div",{ref_key:"triggerRef",ref:o,class:"comments-dropdown__trigger",onClick:y},[y1(I.$slots,"default",{},void 0,!0)],512),(Ze(),ei(Hy,{to:"body"},[i.value?(Ze(),ut("div",{key:0,ref_key:"menuRef",ref:s,class:"comments-dropdown__menu",style:Ai(u.value)},[(Ze(!0),ut(Dr,null,ki(e.options,P=>(Ze(),ut("div",{key:P.key,class:Wr(["comments-dropdown__option",{"sd-disabled":P.disabled}]),onClick:V=>b(P)},[k(P)?(Ze(),ut("span",fce,[P.iconString?(Ze(),ut("span",{key:0,innerHTML:P.iconString},null,8,hce)):(Ze(),ei(Yt(x),{key:1,option:P},null,8,["option"]))])):gn("",!0),et("span",pce,Un(P.label),1)],10,dce))),128))],4)):gn("",!0)]))]))}},[["__scopeId","data-v-7eced80a"]]),mce={class:"sd-comment-option"},gce=["innerHTML"],yce={class:"sd-option-state"},vce=["innerHTML"],AO=li({__name:"InternalDropdown",props:{state:{type:String,required:!1},isDisabled:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const n=t,r=e,{uiFontFamily:i}=iT(),o=[{label:"Internal",key:"internal",iconString:Qf.internal,backgroundColor:"var(--sd-ui-comments-internal-bg, #CDE6E6)"},{label:"External",key:"external",iconString:Qf.external,backgroundColor:"var(--sd-ui-comments-external-bg, #F5CFDA)"}],s=dt(()=>{var p;return(p=o.find(m=>m.key===d.value))==null?void 0:p.label}),l=dt(()=>{if(!r.state)return{};const p=o.find(y=>y.key===d.value);if(!p)return{};const m={backgroundColor:p.backgroundColor};return r.isDisabled&&(m.opacity=.5,m.cursor="default"),m}),u=(p,m=!1)=>{var y;d.value=p,f.value=(y=o.find(b=>b.key===p))==null?void 0:y.iconString,!m&&n("select",p)},d=Ne(r.state),f=Ne(null);return pr(()=>r.state,p=>{u(p)}),po(()=>{u(r.state,!0)}),(p,m)=>(Ze(),ut("div",{class:"sd-internal-dropdown",style:Ai(l.value),"data-sd-part":"dropdown-trigger"},[wo(Nj,{options:o,onSelect:m[0]||(m[0]=y=>u(y)),disabled:e.isDisabled,"content-style":{fontFamily:Yt(i)}},{default:vl(()=>[et("div",mce,[et("div",{class:"sd-active-icon",innerHTML:f.value},null,8,gce),et("div",yce,Un(s.value),1),et("div",{class:"sd-dropdown-caret",innerHTML:Yt(Qf).caretDown},null,8,vce)])]),_:1},8,["disabled","content-style"])],4))}},[["__scopeId","data-v-138d641e"]]);function bce(e){const t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>=12?"PM":"AM",o=n%12||12,s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],l=t.getDate();return`${`${o}:${r.toString().padStart(2,"0")}${i}`} ${s} ${l}`}var fa=Object.freeze({RESOLVE_OWN:"RESOLVE_OWN",RESOLVE_OTHER:"RESOLVE_OTHER",REJECT_OWN:"REJECT_OWN",REJECT_OTHER:"REJECT_OTHER",COMMENTS_OVERFLOW_OWN:"COMMENTS_OVERFLOW",COMMENTS_OVERFLOW_OTHER:"COMMENTS_OVERFLOW_OTHER",COMMENTS_DELETE_OWN:"COMMENTS_DELETE_OWN",COMMENTS_DELETE_OTHER:"COMMENTS_DELETE_OTHER",UPLOAD_VERSION:"UPLOAD_VERSION",VERSION_HISTORY:"VERSION_HISTORY"}),Fo=Object.freeze({EDITOR:"editor",SUGGESTER:"suggester",VIEWER:"viewer"}),wce=Object.freeze({[fa.RESOLVE_OWN]:{internal:[Fo.EDITOR],external:[Fo.EDITOR]},[fa.RESOLVE_OTHER]:{internal:[Fo.EDITOR],external:[Fo.EDITOR]},[fa.REJECT_OWN]:{internal:[Fo.EDITOR,Fo.SUGGESTER],external:[Fo.EDITOR,Fo.SUGGESTER]},[fa.REJECT_OTHER]:{internal:[Fo.EDITOR],external:[Fo.EDITOR]},[fa.COMMENTS_OVERFLOW_OWN]:{internal:[Fo.EDITOR,Fo.SUGGESTER],external:[Fo.EDITOR,Fo.SUGGESTER]},[fa.COMMENTS_OVERFLOW_OTHER]:{internal:[Fo.EDITOR],external:[Fo.EDITOR]},[fa.COMMENTS_DELETE_OWN]:{internal:[Fo.EDITOR,Fo.SUGGESTER],external:[Fo.EDITOR,Fo.SUGGESTER]},[fa.COMMENTS_DELETE_OTHER]:{internal:[Fo.EDITOR],external:[Fo.EDITOR]},[fa.UPLOAD_VERSION]:{internal:[Fo.EDITOR],external:[]},[fa.VERSION_HISTORY]:{internal:[Fo.EDITOR],external:[]}}),xce=(e={})=>{var n,r,i,o,s,l;if(typeof e.permissionResolver=="function")return e.permissionResolver;if(typeof((r=(n=e.superdoc)==null?void 0:n.config)==null?void 0:r.permissionResolver)=="function")return e.superdoc.config.permissionResolver;const t=(l=(s=(o=(i=e.superdoc)==null?void 0:i.config)==null?void 0:o.modules)==null?void 0:s.comments)==null?void 0:l.permissionResolver;return typeof t=="function"?t:null}
532,kce=(e,t,n)=>{var i,o;const r=n?"internal":"external";return((o=(i=wce[e])==null?void 0:i[r])==null?void 0:o.includes(t))??!1},Lf=(e,t,n,r={})=>{var l,u;const i=kce(e,t,n),o=xce(r);if(typeof o!="function")return i;const s=o({permission:e,role:t,isInternal:n,defaultDecision:i,comment:r.comment??null,currentUser:r.currentUser??((u=(l=r.superdoc)==null?void 0:l.config)==null?void 0:u.user)??null,superdoc:r.superdoc??null,trackedChange:r.trackedChange??null});return typeof s=="boolean"?s:i},_ce={class:"user-container"},Cce=["src"],Sce={key:1,class:"user-bg"},Mj=li({__name:"Avatar",props:{user:{type:Object,required:!0}},setup(e){const t=(n,r)=>{var i;if(!(!n&&!r)){if(n){const o=n.trim().split(/\s+/).filter(s=>/^[a-zA-Z]/.test(s));if(o.length>=2)return(o[0][0]+o[o.length-1][0]).toUpperCase();if(o.length===1)return o[0][0].toUpperCase()}return((i=r==null?void 0:r.substring(0,1))==null?void 0:i.toUpperCase())||null}};return(n,r)=>(Ze(),ut("div",_ce,[e.user.image?(Ze(),ut("img",{key:0,class:"user-bg",src:e.user.image.startsWith("http")?e.user.image:`data:image/png;base64,${e.user.image}`},null,8,Cce)):(Ze(),ut("span",Sce,Un(t(e.user.name,e.user.email)),1))]))}},[["__scopeId","data-v-c95b2073"]]),Ece={class:"card-section comment-header"},Ace={class:"comment-header-left"},Tce={class:"user-info"},Ice={class:"user-name"},Rce={key:0,class:"imported-tag"},Oce={key:0,class:"user-timestamp"},Nce=["data-disabled-reason","aria-disabled","innerHTML"],Mce=["data-disabled-reason","aria-disabled","innerHTML"],Dce=["data-disabled-reason","aria-disabled","innerHTML"],Lce={class:"overflow-menu__icon"},Pce=["innerHTML"],EE=li({__name:"CommentHeader",props:{timestamp:{type:Number,required:!1},config:{type:Object,required:!0},comment:{type:Object,required:!1},isPendingInput:{type:Boolean,required:!1,default:!1},isActive:{type:Boolean,default:!1},resolveDisabledReason:{type:String,default:null},rejectDisabledReason:{type:String,default:null},reopenDisabledReason:{type:String,default:null},reopenSupported:{type:Boolean,default:!1},writeDisabledReason:{type:String,default:null}},emits:["resolve","reject","reopen","overflow-select"],setup(e,{emit:t}){const n=t,r=qd(),i=e,{proxy:o}=fh(),s=o.$superdoc.config.role,l=o.$superdoc.config.isInternal,u=M=>{var re;const Z=o.$superdoc.config.user,L={id:M==null?void 0:M.creatorId,email:M==null?void 0:M.creatorEmail};if(_B({current:Z,other:L}))return!0;const W=Ym(Z),U=Ym(L);if(W.hasId||W.hasEmail||U.hasId||U.hasEmail||(M==null?void 0:M.origin)!=null||(re=M==null?void 0:M.importedAuthor)!=null&&re.name)return!1;const q=Yw(Z==null?void 0:Z.name),Q=Yw(M==null?void 0:M.creatorName);return!!(q&&Q&&q===Q)},d=M=>{const Z=o.$superdoc.config.user,L=Ym(Z),W=Ym({id:M==null?void 0:M.creatorId,email:M==null?void 0:M.creatorEmail,name:M==null?void 0:M.creatorName});if(L.hasId&&W.hasId)return L.id.toLowerCase()===W.id.toLowerCase();if(L.hasEmail&&W.hasEmail)return L.email===W.email;if(L.hasId||L.hasEmail||W.hasId||W.hasEmail)return!1;const U=Yw(M==null?void 0:M.creatorName);if(!U)return!0;const q=Yw(Z==null?void 0:Z.name);return!!(q&&q===U)},f=dt(()=>{var M;return(M=i.comment)!=null&&M.trackedChange?d(i.comment):u(i.comment)}),p=dt(()=>vC(i.comment)),{uiFontFamily:m}=iT(),y=Object.freeze({edit:{label:"Edit",key:"edit"},delete:{label:"Delete",key:"delete"}}),b=dt(()=>i.config.readOnly!==!0),k=dt(()=>{var Z,L,W;const M=(W=(L=(Z=o.$superdoc)==null?void 0:Z.interactionConfig)==null?void 0:L.trackedChanges)==null?void 0:W.allowDecisions;return typeof M=="boolean"?M:b.value}),S=dt(()=>!(!i.comment||i.comment.resolvedTime||r.pendingComment||i.isPendingInput)),x=dt(()=>{if(!S.value)return!1;if(i.comment.trackedChange){if(!k.value)return!1}else if(!b.value||i.config.allowResolve===!1)return!1;if(i.comment.parentCommentId||p.value)return!1;const M={comment:i.comment,currentUser:o.$superdoc.config.user,superdoc:o.$superdoc};return f.value?Lf(fa.RESOLVE_OWN,s,l,M):Lf(fa.RESOLVE_OTHER,s,l,M)}),T=dt(()=>{if(!S.value||!i.comment.trackedChange||!k.value)return!1;const M={comment:i.comment,currentUser:o.$superdoc.config.user,superdoc:o.$superdoc};return f.value?Lf(fa.REJECT_OWN,s,l,M):Lf(fa.REJECT_OTHER,s,l,M)}),C=dt(()=>
532{if(!b.value||i.config.allowResolve===!1||!i.reopenSupported||!i.comment||!i.comment.resolvedTime||r.pendingComment||i.isPendingInput||i.comment.parentCommentId||p.value||i.comment.trackedChange)return!1;const M={comment:i.comment,currentUser:o.$superdoc.config.user,superdoc:o.$superdoc};return f.value?Lf(fa.RESOLVE_OWN,s,l,M):Lf(fa.RESOLVE_OTHER,s,l,M)}),I=dt(()=>!(!S.value||i.comment.trackedChange||i.isPendingInput||D.value.length===0)),D=dt(()=>{if(!b.value)return[];if(!S.value)return[];if(i.writeDisabledReason)return[];const M=[],Z=new Set;u(i.comment)&&Z.add("edit");const L=u(i.comment),W={comment:i.comment,currentUser:o.$superdoc.config.user,superdoc:o.$superdoc};return(L&&Lf(fa.COMMENTS_DELETE_OWN,s,l,W)||!L&&Lf(fa.COMMENTS_DELETE_OTHER,s,l,W))&&Z.add("delete"),Z.forEach(U=>M.push(y[U])),M}),P=()=>{var M;if((M=i.comment)!=null&&M.trackedChange){if(!k.value)return}else if(!b.value||i.config.allowResolve===!1)return;i.resolveDisabledReason||n("resolve")},V=()=>{k.value&&(i.rejectDisabledReason||n("reject"))},ee=()=>{!b.value||i.config.allowResolve===!1||i.reopenDisabledReason||n("reopen")},F=M=>{b.value&&n("overflow-select",M)},H=dt(()=>{var M;return!(!(i.comment.origin!=null||(M=i.comment.importedAuthor)!=null&&M.name)||u(i.comment))}),te=dt(()=>{if(i.isPendingInput)return o.$superdoc.config.user;const M=i.comment.getCommentUser();if(M!=null&&M.name){const Z=M.name.replace(/\s*\(imported\)\s*/gi,"").trim();if(Z)return{...M,name:Z}}return M});return(M,Z)=>(Ze(),ut("div",Ece,[et("div",Ace,[wo(Mj,{user:te.value,class:"avatar"},null,8,["user"]),et("div",Tce,[et("div",Ice,[Md(Un(te.value.name),1),H.value?(Ze(),ut("span",Rce,"IMPORTED")):gn("",!0)]),i.comment.createdTime?(Ze(),ut("div",Oce,Un(Yt(bce)(i.comment.createdTime)),1)):gn("",!0)])]),et("div",{class:Wr(["overflow-menu",{"is-visible":i.isActive}])},[x.value?(Ze(),ut("div",{key:0,class:Wr(["overflow-menu__icon",{"sd-is-disabled":!!e.resolveDisabledReason}]),"data-comment-action":"resolve","data-disabled-reason":e.resolveDisabledReason||null,"aria-disabled":!!e.resolveDisabledReason,innerHTML:Yt(Qf).markDone,onClick:Gr(P,["stop","prevent"])},null,10,Nce)):gn("",!0),T.value?(Ze(),ut("div",{key:1,class:Wr(["overflow-menu__icon",{"sd-is-disabled":!!e.rejectDisabledReason}]),"data-comment-action":"reject","data-disabled-reason":e.rejectDisabledReason||null,"aria-disabled":!!e.rejectDisabledReason,innerHTML:Yt(Qf).rejectChange,onClick:Gr(V,["stop","prevent"])},null,10,Mce)):gn("",!0),C.value?(Ze(),ut("div",{key:2,class:Wr(["overflow-menu__icon overflow-menu__icon--reopen",{"sd-is-disabled":!!e.reopenDisabledReason}]),"data-disabled-reason":e.reopenDisabledReason||null,"data-comment-reopen":!0,"aria-disabled":!!e.reopenDisabledReason,title:"Reopen comment",innerHTML:Yt(Qf).reopen,onClick:Gr(ee,["stop","prevent"])},null,10,Dce)):gn("",!0),I.value?(Ze(),ei(Nj,{key:3,"data-comment-action":"overflow",options:D.value,onSelect:F,"content-style":{fontFamily:Yt(m)}},{default:vl(()=>[et("div",Lce,[et("div",{class:"overflow-icon",innerHTML:Yt(Qf).overflow},null,8,Pce)])]),_:1},8,["options","content-style"])):gn("",!0)],2)]))}},[["__scopeId","data-v-f2f11c96"]]),Bce={class:"input-section"},jce={class:"comment-composer"},Fce=["aria-expanded","aria-controls","aria-activedescendant"],zce=["id","aria-selected","data-sd-comment-mention-option","onMousedown"],Uce={class:"comment-mention-option__name"},Vce={key:0,class:"comment-mention-option__email"},Hce=0,I3=li({__name:"CommentInput",props:{users:{type:Array,required:!1,default:()=>[]},config:{type:Object,required:!0},isFocused:{type:Boolean,default:!1},includeHeader:{type:Boolean,default:!0},comment:{type:Object,required:!1}},emits:["focus"],setup(e,{expose:t,emit:n}){const o=n,s=e,{currentCommentText:l,currentCommentMentions:u}=Hd(qd()),d=Ne(null),f=Ne(null),p=Ne(""),m=Ne(0),y=`sd-comment-mention-list-${++Hce}`,b=Q=>o("focus",Q),k=()=>d.value,S=Q=>{var re,ne;(ne=(re=k())==null?void 0:re.focus)==null||ne.call(re,Q)},x=()=>{const Q=k();if(!Q)return;Q.style.height="28px";const re=Q.scrollHeight||28,ne=Math.min(Math.max(re,28),132);Q.style.height=`${ne}px`,Q.style.overflowY=re>132?"auto":"hidden"},T=()=>{Sn(x)},C=Q=>String(Q??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),I=Q=>{const re=String(Q??"");if(!re||re==="<p></p>")return"";if(typeof document>"u")return re.replace(/<br\s*\/?>/gi,`
533`).replace(/<[^>]+>/g,"");const ne=document.createElement("div");return ne.innerHTML=re,ne.innerText||ne.textContent||""},D=Q=>{const re=String(Q??"").replace(/\r\n/g,`
534`).trim();return re?re.split(/\n{2,}/).map(ne=>`<p>${C(ne).replace(/\n/g,"<br>")}</p>`).join(""):"<p></p>"},P=dt({get:()=>I(l.value),set:Q=>{l.value=D(Q)}}),V=Q=>{var re,ne;return((re=Q==null?void 0:Q.name)==null?void 0:re.trim())||((ne=Q==null?void 0:Q.email)==null?void 0:ne.trim())||""},ee=Q=>String((Q==null?void 0:Q.id)??(Q==null?void 0:Q.email)??(Q==null?void 0:Q.name)??""),F=Q=>{var re;return(Q==null?void 0:Q.role)==="viewer"||(Q==null?void 0:Q.access)==="viewer"||typeof(Q==null?void 0:Q.access)=="object"&&((re=Q.access)==null?void 0:re.role)==="viewer"},H=Q=>({...(Q==null?void 0:Q.id)!=null?{id:Q.id}:{},...(Q==null?void 0:Q.name)!=null?{name:Q.name}:{},...(Q==null?void 0:Q.email)!=null?{email:Q.email}:{}}),te=dt(()=>{if(f.value==null)return[];const Q=p.value.toLocaleLowerCase();return s.users.filter(re=>!F(re)&&V(re)).filter(re=>{var ge;const ne=V(re).toLocaleLowerCase(),J=((ge=re==null?void 0:re.email)==null?void 0:ge.toLocaleLowerCase())??"";return!Q||ne.startsWith(Q)||J.startsWith(Q)}).slice(0,8)}),M=dt(()=>te.value.length>0),Z=dt(()=>{const Q=te.value[m.value];return Q?`${y}-${ee(Q)}`:void 0}),L=Q=>{const re=P.value.slice(0,Q),ne=/(?:^|\s)@([^\s@]{0,40})$/.exec(re);f.value=ne?Q-ne[1].length-1:null,p.value=(ne==null?void 0:ne[1])??"",m.value=0},W=Q=>{u.value=u.value.filter(re=>P.value.includes(`@${V(re)}`)),L(Q.target.selectionStart??P.value.length),x()},U=Q=>{var le;if(f.value==null)return;const re=f.value,ne=((le=d.value)==null?void 0:le.selectionStart)??P.value.length,J=`@${V(Q)}`,ge=H(Q);P.value=`${P.value.slice(0,re)}${J}${P.value.slice(ne)}`,u.value.some(ve=>ee(ve)===ee(ge))||(u.value=[...u.value,ge]),f.value=null,p.value="",
534Sn(()=>{var Ee,st;const ve=re+J.length;(Ee=d.value)==null||Ee.focus(),(st=d.value)==null||st.setSelectionRange(ve,ve),x()})},q=Q=>{if(M.value){if(Q.key==="ArrowDown"||Q.key==="ArrowUp"){Q.preventDefault(),Q.stopPropagation();const re=Q.key==="ArrowDown"?1:-1;m.value=(m.value+re+te.value.length)%te.value.length;return}if(Q.key==="Enter"){Q.preventDefault(),Q.stopPropagation();const re=te.value[m.value];re&&U(re);return}Q.key==="Escape"&&(Q.preventDefault(),Q.stopPropagation(),f.value=null)}};return po(T),pr(l,T),t({focus:S}),(Q,re)=>(Ze(),ut("div",Bce,[e.includeHeader?(Ze(),ei(EE,{key:0,config:e.config,comment:e.comment,"is-pending-input":!0},null,8,["config","comment"])):gn("",!0),et("div",{class:Wr(["comment-entry",{"sd-input-active":e.isFocused}])},[et("div",jce,[Lu(et("textarea",{ref_key:"inputRef",ref:d,"onUpdate:modelValue":re[0]||(re[0]=ne=>P.value=ne),class:"superdoc-field",role:"combobox","aria-autocomplete":"list","aria-expanded":M.value,"aria-controls":M.value?y:void 0,"aria-activedescendant":Z.value,"data-sd-comment-mention-input":"","data-sd-comment-text":"",placeholder:"Add a comment",rows:"1",onInput:W,onKeydown:q,onFocus:re[1]||(re[1]=ne=>b(!0)),onBlur:re[2]||(re[2]=ne=>b(!1))},null,40,Fce),[[yg,P.value]]),M.value?(Ze(),ut("div",{key:0,id:y,class:"comment-mention-list",role:"listbox","data-sd-comment-mention-list":""},[(Ze(!0),ut(Dr,null,ki(te.value,(ne,J)=>(Ze(),ut("button",{id:`${y}-${ee(ne)}`,key:ee(ne),type:"button",class:Wr(["comment-mention-option",{"comment-mention-option--active":J===m.value}]),role:"option","aria-selected":J===m.value,"data-sd-comment-mention-option":ee(ne),onMousedown:Gr(ge=>U(ne),["prevent"])},[et("span",Uce,Un(V(ne)),1),ne.email?(Ze(),ut("span",Vce,Un(ne.email),1)):gn("",!0)],42,zce))),128))])):gn("",!0)])],2)]))}},[["__scopeId","data-v-87953125"]]),$ce=["aria-label","data-comment-instance-id","data-comment-thread-id","data-comment-position-key","data-comment-page-index"],Gce={key:0,class:"existing-internal-input"},qce={class:"new-comment-input-wrapper"},Wce={class:"reply-actions"},Kce=["disabled"],Yce={key:0,class:"resolved-badge"},Xce=["innerHTML"],Zce={key:1,class:"existing-internal-input"},Qce={key:0,class:"card-section comment-body"},Jce=["data-track-change-semantic-color-key"],eue={key:0},tue={class:"change-type tracked-change-label"},nue={key:0,class:"tracked-change-detail-lines"},rue={key:0,class:"tracked-change-text"},iue={key:1,class:"change-type"},oue={class:"change-type"},sue={key:1},aue={class:"tracked-change-text is-inserted"},lue={key:2},cue={class:"tracked-change-text is-inserted"},uue={key:3},due={key:4},fue={key:5},hue={key:6},pue={class:"tracked-change-text"},mue={key:7},gue={class:"tracked-change-text is-deleted"},yue={class:"tracked-change-text is-inserted"},vue={key:8},bue={class:"tracked-change-text is-deleted"},wue={key:9},xue={class:"tracked-change-text is-inserted"},kue=["data-track-change-image-preview-role"],_ue=["src","alt"],Cue={key:1,class:"card-section comment-body"},Sue=["innerHTML"],Eue={key:1,class:"comment"},Aue={key:2,class:"reply-expanded"},Tue={class:"reply-input-wrapper"},Iue={class:"reply-actions"},Rue=["onClick"],Oue=["onClick","disabled","data-disabled-reason"],Nue={class:"collapsed-avatars"},Mue={key:3,class:"comment-separator"},Due={key:2,class:"tracked-change-decision-alert",role:"alert"},Lue={class:"tracked-change-decision-alert__message"},Pue=["disabled","data-disabled-reason"],Bue={key:1,class:"reply-expanded"},jue={class:"reply-input-wrapper"},Fue={class:"reply-actions"},zue=["disabled","data-disabled-reason"],TO=3,IO=90,oT=li({__name:"CommentDialog",props:{comment:{type:Object,required:!0},autoFocus:{type:Boolean,default:!1},parent:{type:Object,required:!1},floatingInstanceId:{type:String,default:null},floatingPageIndex:{type:Number,default:null},floatingPositionEntry:{type:Object,default:null},isFloatingInstanceActive:{type:Boolean,default:void 0},threadComments:{type:Array,default:null}},emits:["click-outside","ready","dialog-exit","resize"],setup(e,{emit:t}){const n=t,r=e,{proxy:i}=fh(),o=tv(),s=qd(),{addComment:l,cancelComment:u,deleteComment:d,getCommentAliasIds:f,removePendingComment:p,getCommentDocumentId:m,requestInstantSidebarAlignment:y,resolveCommentPositionEntry:b,clearInstantSidebarAlignment:k,setActiveFloatingCommentInstance:S}=s,{suppressInternalExternal:x,getConfig:T,activeComment:C,activeFloatingCommentInstanceId:I,floatingCommentsOffset:D,pendingComment:P,currentCommentText:V,currentCommentMentions:ee,isDebugging:F,editingCommentId:H,editorCommentPositions:te,isCommentHighlighted:M}=Hd(s),Z=Ne(!0),L=Ne(null),W=Ne(new Map),U=Ne(null),q=[[0,0],[-3,0],[TO,0],[0,-3],[0,TO]],Q=je=>{const Je=typeof(je==null?void 0:je.width)=="number"&&Number.isFinite(je.width)?je.width:null,Ut=typeof(je==null?void 0:je.height)=="number"&&Number.isFinite(je.height)?je.height:null;if(!Je||!Ut||Je<=0||Ut<=0)return{};const un=Math.min(IO/Je,IO/Ut,1);return{width:`${Math.max(1,Math.round(Je*un))}px`,height:`${Math.max(1,Math.round(Ut*un))}px`}}
534,re=[".comments-dropdown__option-label",".comments-dropdown__menu",".comments-dropdown__option",".comments-dropdown__option-icon",".comments-dropdown__trigger",".superdoc-comment-highlight",".sd-editor-comment-highlight",".sd-editor-tracked-change-highlight","[data-track-change-id]",".track-insert",".track-insert-dec",".track-delete",".track-delete-dec",".track-format",".track-format-dec"].join(","),ne=je=>Je=>{je&&(Je?(W.value.set(je,Je),H.value===je&&Sn(()=>{le(je)})):W.value.delete(je))},J=(je,Je,Ut)=>{var Xt;const un=(Xt=je==null?void 0:je.getBoundingClientRect)==null?void 0:Xt.call(je);return!un||![un.left,un.top,un.right,un.bottom].every(Number.isFinite)||un.width<=0||un.height<=0?!1:q.some(([Zn,Bi])=>{const ri=Je+Zn,ot=Ut+Bi;return ri>=un.left&&ri<=un.right&&ot>=un.top&&ot<=un.bottom})},ge=(je,Je)=>{if(!Number.isFinite(je)||!Number.isFinite(Je))return null;const Ut=document.querySelectorAll(re);for(const un of Ut)if(un instanceof HTMLElement&&J(un,je,Je))return un;return null},le=je=>{var Je,Ut;(Ut=(Je=W.value.get(je))==null?void 0:Je.focus)==null||Ut.call(Je)},ve=Ne(null),Ee=je=>je.resolvedTime?je.commentId:je.importedId||je.commentId,st=je=>je?je.trackedChange&&je.trackedChangeCanonicalId!=null?String(je.trackedChangeCanonicalId):je.commentId!=null?String(je.commentId):null:null,At=je=>{if(!(je!=null&&je.trackedChange))return null;const Je=st(je);if(!Je)return null;const Ut={kind:"trackedChange",trackedChangeId:Je};return je.trackedChangeStory&&(Ut.story=je.trackedChangeStory),je.semanticColorKey==="move-from"&&(Ut.side="source"),je.semanticColorKey==="move-to"&&(Ut.side="destination"),Ut},yt=(je,Je)=>{var un;const Ut=(un=je==null?void 0:je.bounds)==null?void 0:un[Je];return Number.isFinite(Ut)?Ut:null},Ge=(je,Je)=>{if(!je||!Je||je.pageIndex!==Je.pageIndex)return!1;const Ut=yt(je,"top"),un=yt(Je,"top");return Ut!=null&&un!=null&&Math.abs(Ut-un)<.5},Be=(je,Je)=>{const Ut=yt(je,"left"),un=yt(Je,"left"),Xt=yt(je,"right"),Zn=yt(Je,"right");return[Ut,un,Xt,Zn].some(Bi=>Bi==null)?!1:un<Xt&&Ut<Zn},he=(je,Je)=>{const Ut=je==null?void 0:je.start,un=je==null?void 0:je.end,Xt=Je==null?void 0:Je.start,Zn=Je==null?void 0:Je.end;return[Ut,un,Xt,Zn].every(Number.isFinite)?Xt<=un&&Ut<=Zn:!1},Oe=(je,Je)=>!je||!Je||je.kind&&Je.kind&&je.kind!==Je.kind||je.storyKey&&Je.storyKey&&je.storyKey!==Je.storyKey?!1:Je.start===je.start&&Je.end===je.end?!0:Ge(je,Je)&&Be(je,Je)&&he(je,Je),ye=je=>{const Je=new Set(f(je)),{key:Ut,entry:un}=b(je);return Ut&&Je.add(Ut),un?(Object.entries(te.value??{}).forEach(([Xt,Zn])=>{Oe(un,Zn)&&Je.add(Xt)}),[...Je]):[...Je]},B=(je,Je,Ut=24)=>{if(!Number.isFinite(Je)||typeof(je==null?void 0:je.getBoundingClientRect)!="function")return!1;const un=je.getBoundingClientRect().top;return Number.isFinite(un)&&Math.abs(un-Je)<=Ut},be=dt(()=>r.floatingInstanceId??r.comment.commentId??null),ie=dt(()=>typeof r.isFloatingInstanceActive=="boolean"?r.isFloatingInstanceActive:C.value!==r.comment.commentId?!1:r.floatingInstanceId==null?!0:I.value===r.floatingInstanceId),fe=dt(()=>r.comment.resolvedTime?r.comment.trackedChange?r.comment.trackedChangeDecision==="reject"?"Rejected":"Accepted":"Resolved":null),ue=dt(()=>P.value&&P.value.commentId===r.comment.commentId),Ce=dt(()=>je=>{const Je=Lr.value;return Ue.value&&je===Je.length-1?!0:Je.length>1&&je!==Je.length-1}),Ue=dt(()=>!T.readOnly&&ie.value&&!r.comment.resolvedTime&&!Lt.value),K=()=>({ok:!1,reason:"read-only-document"}),oe=()=>{var je;return((je=T.value)==null?void 0:je.readOnly)===!0},Fe=()=>{var Je,Ut,un;const je=(un=(Ut=(Je=i.$superdoc)==null?void 0:Je.interactionConfig)==null?void 0:Ut.trackedChanges)==null?void 0:un.allowDecisions;return typeof je=="boolean"?!je:oe()},Le=()=>({ok:!1,reason:oe()?"read-only-document":"tracked-change-decisions-disabled"}),tt=Ne(!1),De=Ne(!1),Pe=Ne(!1),mt=()=>{var je;if(oe())return K();if(rn.value)return{ok:!1,reason:((je=kn.value)==null?void 0:je.reason)??"v2-write-unavailable"};tt.value=!0,Sn(()=>{var Je,Ut;(Ut=(Je=L.value)==null?void 0:Je.focus)==null||Ut.call(Je),n("resize")})},xt=dt(()=>{const je=r.comment;return Array.isArray(r.threadComments)?[...r.threadComments].sort((Je,Ut)=>Je.commentId===je.commentId?-1:Ut.commentId===je.commentId?1:Je.createdTime-Ut.createdTime):je.trackedChange?s.getTrackedChangeThread(je):s.commentsList.filter(Je=>{const Ut=Je.parentCommentId===je.commentId,un=Je.commentId===je.commentId;return Ut||un}).sort((Je,Ut)=>Je.commentId===je.commentId?-1:Ut.commentId===je.commentId?1:Je.createdTime-Ut.createdTime)}),de=dt(()=>r.comment.trackedChangeLabel?r.comment.trackedChangeLabel:r.comment.trackedChange?"Tracked change discussion":r.comment.creatorName?`Comment by ${r.comment.creatorName}`:"Comment thread"),z=Ne(!1),Y=Ne(null),me=Ne(!1),Ve=dt(()=>!z.value),lt=dt(()=>({"is-truncated":Ve.value,"is-scrollable":z.value&&me.value})),gt=()=>{z.value=!z.value,Sn(()=>n("resize"))},dn=je=>{Y.value=je??null},Hn=()=>
534{if(z.value)return;const je=Y.value;if(!je){me.value=!1;return}me.value=je.scrollHeight>je.clientHeight+1};pr(Y,()=>{Sn(Hn)});const br=()=>H.value?xt.value.some(je=>je.commentId===H.value):!1;pr(ie,je=>{je||((tt.value||br())&&(V.value="",ee.value=[],H.value=null),z.value=!1,ur.value=!1,tt.value=!1,Sn(()=>n("resize")))});const ur=Ne(!1),tr=dt(()=>xt.value.slice(1)),Br=dt(()=>ur.value?!1:tr.value.length>=2),Lr=dt(()=>Br.value?[xt.value[0],tr.value[tr.value.length-1]].filter(Boolean):xt.value);pr(dt(()=>{const je=Lr.value[0];return je?JSON.stringify({commentId:je.commentId,commentText:je.commentText,trackedChange:je.trackedChange,trackedChangeText:je.trackedChangeText,deletedText:je.deletedText,trackedChangeLabel:je.trackedChangeLabel,trackedChangeDisplayType:je.trackedChangeDisplayType,trackedChangeDetailLines:je.trackedChangeDetailLines}):""}),()=>{Sn(Hn)});const $e=dt(()=>Br.value?tr.value.length-1:0),Bt=dt(()=>{if(!Br.value)return[];const je=tr.value.slice(0,-1),Je=new Set;return je.map(Ut=>typeof Ut.getCommentUser=="function"?Ut.getCommentUser():{name:Ut.creatorName,email:Ut.creatorEmail||Ut.email}).filter(Ut=>{if(!Ut)return!1;const un=Ut.email||Ut.name;return Je.has(un)?!1:(Je.add(un),!0)}).slice(0,3)}),hn=()=>{ur.value=!0,qe(),Sn(()=>n("resize"))},Pn=dt(()=>r.comment.resolvedTime?!0:T.value.readOnly),jn=dt(()=>je=>ie.value&&H.value===je.commentId),Lt=dt(()=>!H.value||!ie.value?!1:xt.value.some(je=>je.commentId===H.value)),St=dt(()=>T.value.readOnly||!i.$superdoc.config.isInternal||$t.value?!1:!x.value&&!r.comment.trackedChange),Te=dt(()=>V.value&&V.value!=="<p></p>"),qe=async()=>{var ot,jt,gr,$n,Pr,ui,jr,Zr,ro,Go,er,is;const je=i.$superdoc.activeEditor,Je=(je==null?void 0:je.editorVersion)===2?(je==null?void 0:je.v2Comments)??null:null,Ut=!!((ot=r.comment)!=null&&ot.trackedChange),un=sce(),Xt=r.floatingInstanceId!=null,Zn=(gr=(jt=ve.value)==null?void 0:jt.getBoundingClientRect)==null?void 0:gr.call(jt).top,Bi=!r.comment.resolvedTime&&(C.value!==r.comment.commentId||Xt&&be.value!==I.value);let ri=un;if(Je){const di=!Ut&&!r.comment.resolvedTime&&String((($n=r.comment)==null?void 0:$n.trackedChangeParentId)??"").trim()?r.comment.trackedChangeParentId:null,Hr=(je==null?void 0:je.editorVersion)===2&&(Ut||di!=null)?(je==null?void 0:je.v2TrackedChanges)??null:null,No=di!=null?s.getComment(di):null,Mo=Ut?r.comment:No!=null&&No.trackedChange?No:di;let Ti=await(Hr?Hr.focusTrackedChange(Mo):Je.focusComment(r.comment));return!Ut&&(Ti==null?void 0:Ti.reason)==="tracked-change-anchor-not-found"&&(Ti=await Je.focusComment(r.comment)),Ti!=null&&Ti.ok?(r.comment.resolvedTime||(C.value=r.comment.commentId,r.floatingInstanceId&&S(r.floatingInstanceId)),Bi&&!Xt?y(un,r.comment.commentId,r.floatingInstanceId??null):Bi&&Number.isFinite(Zn)?y(Zn,r.comment.commentId,r.floatingInstanceId):k(),Ti):(k(),Ti)}if(je){const{entry:di}=b(r.comment),Hr=r.floatingPositionEntry??di,No=Number.isFinite(r.floatingPageIndex)&&((ui=(Pr=r.comment)==null?void 0:Pr.trackedChangeStory)==null?void 0:ui.storyType)==="headerFooterPart",Mo=Oj(r.parent,Hr),Ti=No?null:ace(ye(r.comment)),_o=Number.isFinite(Ti)?Ti:Mo,yn=B(ve.value,_o),Nn=Ee(r.comment);let yr=null;if(Ut)if(r.comment.trackedChangeStory&&(r.comment.trackedChangeStory,{...Number.isFinite(r.floatingPageIndex)?{pageIndex:r.floatingPageIndex}:{}}),r.comment.resolvedTime)(jr=je.commands)==null||jr.setCursorById(Nn);else{const fr=r.comment.commentId;(Zr=je.commands)!=null&&Zr.setCursorById(Nn,{activeCommentId:fr})||(ro=je.commands)==null||ro.setActiveComment({commentId:fr})}else{if(r.comment.resolvedTime)(Go=je.commands)==null||Go.setCursorById(Nn);else{const fr=r.comment.commentId;(er=je.commands)!=null&&er.setCursorById(Nn,{activeCommentId:fr})||(is=je.commands)==null||is.setActiveComment({commentId:fr})}r.comment.commentId,yr=yn?null:lce()}Number.isFinite(Ti)?ri=Ti:Number.isFinite(Mo)?ri=Mo:Number.isFinite(yr)&&(ri=yr)}Bi&&!Xt?r.floatingInstanceId?y(ri,r.comment.commentId,r.floatingInstanceId):y(ri,r.comment.commentId):k(),r.comment.resolvedTime||(C.value=r.comment.commentId,r.floatingInstanceId&&S(r.floatingInstanceId))},it=je=>{var un,Xt,Zn,Bi,ri,ot;const Je=je.target instanceof Element?je.target:(un=je.target)==null?void 0:un.parentElement,Ut=document.elementFromPoint(je.clientX,je.clientY);if(!((Xt=Je==null?void 0:Je.closest)!=null&&Xt.call(Je,re)||(Zn=Ut==null?void 0:Ut.closest)!=null&&Zn.call(Ut,re)||ge(je.clientX,je.clientY)||M.value)&&!((ri=(Bi=je.target).closest)!=null&&ri.call(Bi,".comments-dialog")&&!((ot=ve.value)!=null&&ot.contains(je.target)))){if(ue.value){u(i.$superdoc);return}
534ie.value&&(D.value=0,n("dialog-exit"),C.value=null,s.setActiveComment(i.$superdoc,C.value),M.value=!1)}},Et=async()=>{var Ut;if(oe())return K();if(rn.value)return{ok:!1,reason:((Ut=kn.value)==null?void 0:Ut.reason)??"v2-write-unavailable"};if($t.value&&sn.value&&!ue.value){if(De.value)return{ok:!1,reason:"reply-submit-in-flight"};De.value=!0;try{const un=st(r.comment),Xt=At(r.comment),Zn=await s.replyCommentV2({superdoc:i.$superdoc,parentCommentId:un,text:V.value,...ee.value.length?{mentions:ee.value}:{},...Xt?{trackedChangeTarget:Xt}:{}});return Zn!=null&&Zn.ok?(tt.value=!1,V.value="",ee.value=[],Sn(()=>n("resize")),Zn):(Sn(()=>n("resize")),Zn)}finally{De.value=!1}}if(ue.value){if(Pe.value)return{ok:!1,reason:"comment-submit-in-flight"};Pe.value=!0}const je={documentId:r.comment.fileId,isInternal:P.value?P.value.isInternal:Z.value,parentCommentId:P.value?null:r.comment.commentId};P.value&&(je.selection=P.value.selection.getValues());const Je=s.getPendingComment(je);!P.value&&V.value&&Je.setText({text:V.value,suppressUpdate:!0}),Promise.resolve().then(()=>l({superdoc:i.$superdoc,comment:Je})).catch(un=>{console.error("[SuperDoc] addComment failed",un)}).finally(()=>{Pe.value=!1,tt.value=!1,Sn(()=>n("resize"))})},$t=dt(()=>{var je,Je;return((Je=(je=i.$superdoc)==null?void 0:je.activeEditor)==null?void 0:Je.editorVersion)===2}),sn=dt(()=>{var je,Je;return $t.value?((Je=(je=i.$superdoc)==null?void 0:je.activeEditor)==null?void 0:Je.v2Comments)??null:null}),Tn=dt(()=>{var je,Je;return $t.value?((Je=(je=i.$superdoc)==null?void 0:je.activeEditor)==null?void 0:Je.v2TrackedChanges)??null:null}),kn=dt(()=>{var un,Xt;if(!sn.value)return null;const je=s.viewingVisibility.documentMode,Je=ue.value?"comments.createFromSelection":null,Ut=((Xt=(un=sn.value).getCapabilityState)==null?void 0:Xt.call(un,Je))??null;return je==="viewing"&&!ue.value?{...Ut??{},canWrite:!1,reason:"review-surface-read-only"}:Ut}),rn=dt(()=>{if(!$t.value)return!1;const je=kn.value;return je?je.canWrite===!1:!1}),Wn=dt(()=>{var je;return De.value?"reply-submit-in-flight":rn.value?((je=kn.value)==null?void 0:je.reason)??"v2-write-unavailable":null}),qr=dt(()=>{var Ut,un;if(!Tn.value)return null;const je=s.viewingVisibility.documentMode,Je=((un=(Ut=Tn.value).getCapabilityState)==null?void 0:un.call(Ut))??null;return je==="viewing"&&(Je==null?void 0:Je.canDecide)!==!1?{canDecide:!1,reason:"review-surface-read-only"}:Je}),Yr=je=>{var Je;if($t.value&&(je!=null&&je.trackedChange)){if(!Tn.value)return"v2-tracked-change-adapter-missing";const Ut=qr.value;return Ut&&Ut.canDecide===!1?Ut.reason??"v2-tracked-change-unavailable":null}return rn.value?((Je=kn.value)==null?void 0:Je.reason)??"v2-write-unavailable":null},gi=je=>{var Je;if($t.value&&(je!=null&&je.trackedChange)){if(!Tn.value)return"v2-tracked-change-adapter-missing";const Ut=qr.value;return Ut&&Ut.canDecide===!1?Ut.reason??"v2-tracked-change-unavailable":null}return rn.value?((Je=kn.value)==null?void 0:Je.reason)??"v2-write-unavailable":null},Jn=()=>{var je,Je;return $t.value?sn.value?(je=T.value)!=null&&je.readOnly?"read-only-document":rn.value?((Je=kn.value)==null?void 0:Je.reason)??"v2-write-unavailable":null:"v2-comments-adapter-missing":null},Tr=dt(()=>{var je;return!$t.value||!rn.value?null:((je=kn.value)==null?void 0:je.reason)??"v2-write-unavailable"}),zr=(je,Je)=>{U.value={decision:je,reason:(Je==null?void 0:Je.reason)??null},Sn(()=>n("resize"))},Kn=()=>{U.value&&(U.value=null,Sn(()=>n("resize")))},Gn=dt(()=>{const je=U.value;if(!je)return null;const Je=je.decision==="reject"?"reject":"accept";return je.reason==="stale-catalog"?`Couldn't ${Je} this change because the review list is stale.`:`Couldn't ${Je} this change.`}),ni=()=>{const je=U.value;if(je){if(U.value=null,je.decision==="reject"){Di();return}Ro()}},Di=async()=>{var Je;if(r.comment.trackedChange){if(Fe())return Le()}else if(oe())return K();const je=i.$superdoc.config.onTrackedChangeBubbleReject;if(r.comment.trackedChange){if($t.value){const un=await s.decideTrackedChangeFromSidebar({superdoc:i.$superdoc,comment:r.comment,decision:"reject"});if(!(un!=null&&un.ok)||un.success===!1){zr("reject",un);return}
534Kn(),typeof je=="function"&&je(r.comment,i.$superdoc.activeEditor),Sn(()=>{var Xt,Zn;s.lastUpdate=new Date,C.value=null,s.setActiveComment(i.$superdoc,C.value),(Zn=(Xt=i.$superdoc).focus)==null||Zn.call(Xt,{preventScroll:!0})});return}let Ut=!0;if(typeof je=="function")je(r.comment,i.$superdoc.activeEditor);else{const un=await s.decideTrackedChangeFromSidebar({superdoc:i.$superdoc,comment:r.comment,decision:"reject"});Ut=!!(un!=null&&un.ok)&&un.success!==!1}Ut&&r.comment.resolveComment({id:o.user.id,email:o.user.email,name:o.user.name,superdoc:i.$superdoc,decision:"reject",reconciliationToken:q1})}else if($t.value&&sn.value){if(!((Je=await s.deleteComment({superdoc:i.$superdoc,commentId:r.comment.commentId}))!=null&&Je.ok))return}else s.deleteComment({superdoc:i.$superdoc,commentId:r.comment.commentId});Sn(()=>{var Ut,un;s.lastUpdate=new Date,C.value=null,s.setActiveComment(i.$superdoc,C.value),(un=(Ut=i.$superdoc).focus)==null||un.call(Ut)})},Ro=async()=>{var Ut,un;if(r.comment.trackedChange){if(Fe())return Le()}else{if(oe())return K();if(((Ut=T.value)==null?void 0:Ut.allowResolve)===!1)return{ok:!1,reason:"resolve-disabled"}}const je=i.$superdoc.config.onTrackedChangeBubbleAccept;if(r.comment.trackedChange&&$t.value){const Xt=await s.decideTrackedChangeFromSidebar({superdoc:i.$superdoc,comment:r.comment,decision:"accept"});if(!(Xt!=null&&Xt.ok)||Xt.success===!1){zr("accept",Xt);return}Kn(),typeof je=="function"&&je(r.comment,i.$superdoc.activeEditor),Sn(()=>{var Zn,Bi;s.lastUpdate=new Date,C.value=null,s.setActiveComment(i.$superdoc,C.value),(Bi=(Zn=i.$superdoc).focus)==null||Bi.call(Zn,{preventScroll:!0})});return}let Je=!0;if(r.comment.trackedChange&&typeof je=="function")je(r.comment,i.$superdoc.activeEditor);else if(r.comment.trackedChange){const Xt=await s.decideTrackedChangeFromSidebar({superdoc:i.$superdoc,comment:r.comment,decision:"accept"});Je=!!(Xt!=null&&Xt.ok)&&Xt.success!==!1}else if($t.value&&sn.value){if(!((un=await s.resolveCommentV2({superdoc:i.$superdoc,commentId:r.comment.commentId}))!=null&&un.ok))return}else r.comment.resolveComment({id:o.user.id,email:o.user.email,name:o.user.name,superdoc:i.$superdoc});r.comment.trackedChange&&!$t.value&&Je&&r.comment.resolveComment({id:o.user.id,email:o.user.email,name:o.user.name,superdoc:i.$superdoc,decision:"accept",reconciliationToken:q1}),Sn(()=>{var Xt,Zn;s.lastUpdate=new Date,C.value=null,s.setActiveComment(i.$superdoc,C.value),(Zn=(Xt=i.$superdoc).focus)==null||Zn.call(Xt)})},Si=async()=>{var je,Je;if(oe())return K();if(((je=T.value)==null?void 0:je.allowResolve)===!1)return{ok:!1,reason:"resolve-disabled"};!$t.value||!sn.value||(Je=await s.reopenCommentV2({superdoc:i.$superdoc,commentId:r.comment.commentId}))!=null&&Je.ok&&Sn(()=>{var Ut,un;s.lastUpdate=new Date,s.setActiveComment(i.$superdoc,C.value),(un=(Ut=i.$superdoc).focus)==null||un.call(Ut)})},Gs=(je,Je)=>{var Ut;if(oe())return K();switch(je){case"edit":V.value=((Ut=Je==null?void 0:Je.commentText)==null?void 0:Ut.value)??(Je==null?void 0:Je.commentText)??"",ee.value=Array.isArray(Je==null?void 0:Je.mentions)?[...Je.mentions]:[],C.value=r.comment.commentId,r.floatingInstanceId&&S(r.floatingInstanceId),H.value=Je.commentId,s.setActiveComment(i.$superdoc,C.value),Sn(()=>{le(Je.commentId)});break;case"delete":d({superdoc:i.$superdoc,commentId:Je.commentId});break}},Oo=async je=>{if(oe())return K();if($t.value&&sn.value){const Je=await s.editCommentV2({superdoc:i.$superdoc,commentId:je.commentId,text:V.value});return Je!=null&&Je.ok&&(H.value=null,p(i.$superdoc)),Je}H.value=null,je.setText({text:V.value,superdoc:i.$superdoc}),p(i.$superdoc)},Hi=je=>{if(oe())return K();const Je=!!P.value,Ut=je.toLowerCase()==="internal";Je?P.value.isInternal=Ut:r.comment.setIsInternal({isInternal:Ut,superdoc:i.$superdoc})},cn=dt(()=>{const je={};return(ie.value||ue.value||Lt.value)&&(je.zIndex=50),je}),Fn=je=>typeof je=="string"?new Date(je).getTime():je,dr=je=>{H.value=null,tt.value=!1,u(i.$superdoc)},rr=dt(()=>{const je=i.$superdoc.users;return r.comment.isInternal===!0?je.filter(Je=>{var Ut;return Je.access==="internal"||((Ut=Je.access)==null?void 0:Ut.role)==="internal"}):je});return po(()=>{r.autoFocus&&Sn(()=>qe()),ue.value&&Sn(()=>{var je,Je;(Je=(je=L.value)==null?void 0:je.focus)==null||Je.call(je,{preventScroll:!0})}),Sn(()=>{const je=r.floatingInstanceId??(r.comment.importedId!==void 0?r.comment.importedId:r.comment.commentId);n("ready",{commentId:je,elementRef:ve}),Hn()})}),pr(Ue,je=>{je&&Sn(()=>{var Je,Ut;(Ut=(Je=L.value)==null?void 0:Je.focus)==null||Ut.call(Je,ue.value?{preventScroll:!0}:void 0)})},{immediate:!0}),pr(H,je=>{if(!je||!ie.value)return;const Je=xt.value.find(Ut=>Ut.commentId===je);!Je||Je.trackedChange||Sn(()=>{le(je)})}),pr(()=>{var je;return((je=T.value)==null?void 0:je.readOnly)===!0},je=>{je&&(tt.value=!1,xt.value.some(Je=>Je.commentId===H.value)&&(H.value=null),ue.value&&u(i.$superdoc),Sn(()=>n("resize")))},{immediate:!0}),pr(rn,je=>{je&&(tt.value=!1,Sn(()=>n("resize")))}),(je,Je)=>{var un;const Ut=gK("click-outside");return Lu((Ze(),ut("div",{class:Wr(["comments-dialog",{"is-active":ie.value||ue.value,"is-resolved":r.comment.resolvedTime}]),onClick:Gr(qe,["stop","prevent"]),style:Ai(cn.value),ref_key:"commentDialogElement",ref:ve,role:"dialog","aria-label":de.value,"data-sd-part":"comment-thread","data-editor-ui-surface":"","data-comment-instance-id":r.floatingInstanceId??"","data-comment-thread-id":r.comment.commentId??"","data-comment-position-key":r.comment.trackedChangeAnchorKey??"","data-comment-page-index":Number.isFinite(r.floatingPageIndex)?r.floatingPageIndex:""},[ue.value?(Ze(),ut(Dr,{key:0},[St.value?(Ze(),ut("div",Gce,[wo(AO,{onClick:Je[0]||(Je[0]=Gr(()=>{},["stop","prevent"])),class:"sd-internal-dropdown","is-disabled":!1,state:Yt(P).isInternal?"internal":"external",onSelect:Hi},null,8,["state"])])):gn("",!0),wo(EE,{config:Yt(T),comment:r.comment,"is-pending-input"
534:!0},null,8,["config","comment"]),et("div",qce,[wo(I3,{ref_key:"commentInput",ref:L,users:rr.value,config:Yt(T),comment:r.comment,"include-header":!1},null,8,["users","config","comment"])]),et("div",Wce,[et("button",{class:"sd-button reply-btn-cancel",onClick:Gr(dr,["stop","prevent"])},"Cancel"),et("button",{class:Wr(["sd-button primary reply-btn-primary",{"sd-is-disabled":!Te.value||Pe.value}]),onClick:Gr(Et,["stop","prevent"]),disabled:!Te.value||Pe.value}," Comment ",10,Kce)])],64)):(Ze(),ut(Dr,{key:1},[fe.value?(Ze(),ut("div",Yce,[et("span",{class:"resolved-badge__icon",innerHTML:Yt(Qf).markDone},null,8,Xce),Md(" "+Un(fe.value),1)])):gn("",!0),St.value?(Ze(),ut("div",Zce,[wo(AO,{onClick:Je[1]||(Je[1]=Gr(()=>{},["stop","prevent"])),class:"sd-internal-dropdown","is-disabled":Pn.value,state:e.comment.isInternal?"internal":"external",onSelect:Hi},null,8,["is-disabled","state"])])):gn("",!0),(Ze(!0),ut(Dr,null,ki(Lr.value,(Xt,Zn)=>{var Bi,ri,ot;return Ze(),ut("div",{key:Xt.commentId,class:"conversation-item"},[wo(EE,{config:Yt(T),timestamp:Fn(Xt.createdTime),comment:Xt,"is-active":ie.value,"resolve-disabled-reason":Yr(Xt),"reject-disabled-reason":gi(Xt),"reopen-supported":$t.value&&!!sn.value,"reopen-disabled-reason":Jn(),"write-disabled-reason":Tr.value,onResolve:Ro,onReject:Di,onReopen:Si,onOverflowSelect:jt=>Gs(jt,Xt)},null,8,["config","timestamp","comment","is-active","resolve-disabled-reason","reject-disabled-reason","reopen-supported","reopen-disabled-reason","write-disabled-reason","onOverflowSelect"]),Xt.trackedChange?(Ze(),ut("div",Qce,[et("div",{class:Wr(["tracked-change",Zn===0?lt.value:void 0]),"data-track-change-semantic-color-key":Xt.semanticColorKey??void 0,ref_for:!0,ref:Zn===0?dn:void 0},[Xt.trackedChangeLabel?(Ze(),ut("div",eue,[et("span",tue,Un(Xt.trackedChangeLabel),1),Xt.trackedChangeDetailLines&&Xt.trackedChangeDetailLines.length?(Ze(),ut("div",nue,[(Ze(!0),ut(Dr,null,ki(Xt.trackedChangeDetailLines,(jt,gr)=>(Ze(),ut("div",{key:gr,class:"tracked-change-detail-line"},[jt.excerpt?(Ze(),ut("span",rue,'"'+Un(jt.excerpt)+'"',1)):gn("",!0),jt.excerpt?(Ze(),ut("span",iue," — ")):gn("",!0),et("span",oue,Un(jt.label),1)]))),128))])):gn("",!0)])):Xt.trackedChangeDisplayType==="hyperlinkAdded"?(Ze(),ut("div",sue,[Je[2]||(Je[2]=et("span",{class:"change-type"},"Added hyperlink ",-1)),et("span",aue,'"'+Un(Xt.trackedChangeText)+'"',1)])):Xt.trackedChangeDisplayType==="hyperlinkModified"?(Ze(),ut("div",lue,[Je[3]||(Je[3]=et("span",{class:"change-type"},"Changed hyperlink to ",-1)),et("span",cue,'"'+Un(Xt.trackedChangeText)+'"',1)])):Xt.trackedChangeDisplayType==="paragraphSplit"?(Ze(),ut("div",uue,[...Je[4]||(Je[4]=[et("span",{class:"change-type"},"Added new line",-1)])])):Xt.trackedChangeDisplayType==="tableInsert"?(Ze(),ut("div",due,[...Je[5]||(Je[5]=[et("span",{class:"change-type"},"Added table",-1)])])):Xt.trackedChangeDisplayType==="tableDelete"?(Ze(),ut("div",fue,[...Je[6]||(Je[6]=[et("span",{class:"change-type"},"Deleted table",-1)])])):Xt.trackedChangeType==="trackFormat"?(Ze(),ut("div",hue,[Je[7]||(Je[7]=et("span",{class:"change-type"},"Format: ",-1)),et("span",pue,Un(Xt.trackedChangeText),1)])):Xt.trackedChangeType==="both"?(Ze(),ut("div",mue,[Je[8]||(Je[8]=et("span",{class:"change-type"},"Replaced ",-1)),et("span",gue,'"'+Un(Xt.deletedText)+'"',1),Je[9]||(Je[9]=et("span",{class:"change-type"}," with ",-1)),et("span",yue,'"'+Un(Xt.trackedChangeText)+'"',1)])):Xt.deletedText?(Ze(),ut("div",vue,[Je[10]||(Je[10]=et("span",{class:"change-type"},"Deleted ",-1)),et("span",bue,'"'+Un(Xt.deletedText)+'"',1)])):Xt.trackedChangeText?(Ze(),ut("div",wue,[Je[11]||(Je[11]=et("span",{class:"change-type"},"Added ",-1)),et("span",xue,'"'+Un(Xt.trackedChangeText)+'"',1)])):gn("",!0),(Bi=Xt.trackedChangeImagePreview)!=null&&Bi.src?(Ze(),ut("div",{key:10,class:"tracked-change-image-preview","data-track-change-image-preview-role":Xt.trackedChangeImagePreview.role??void 0},[et("img",{class:"tracked-change-image-preview__image",src:Xt.trackedChangeImagePreview.src,alt:Xt.trackedChangeImagePreview.alt||"Tracked image preview",style:Ai(Q(Xt.trackedChangeImagePreview)),loading:"lazy",decoding:"async"},null,12,_ue)],8,kue)):gn("",!0)],10,Jce),Ve.value&&me.value&&Zn===0?(Ze(),ut("div",{key:0,class:"show-more-toggle",onClick:Gr(gt,["stop","prevent"])}," Show more ")):gn("",!0),z.value&&me.value&&Zn===0?(Ze(),ut("div",{key:1,class:"show-more-toggle",onClick:Gr(gt,["stop","prevent"])}," Show less ")):gn("",!0)])):gn("",!0),Xt.trackedChange?gn("",!0):(Ze(),ut("div",Cue,[!Yt(F)&&!jn.value(Xt)?(Ze(),ut("div",{key:0,class:Wr(["comment",Zn===0?lt.value:void 0]),ref_for:!0,ref:Zn===0?dn:void 0,innerHTML:Xt.commentText},null,10,Sue)):Yt(F)&&!jn.value(Xt)?(Ze(),ut("div",Eue,Un((ri=Yt(te)[Xt.importedId!==void 0?Xt.importedId:Xt.commentId])==null?void 0:ri.bounds),1)):(Ze(),ut("div",Aue,[et("div",Tue,[wo(I3,{ref_for:!0,ref:ne(Xt.commentId),users:[],config:Yt(T),"include-header":!1,comment:Xt},null,8,["config","comment"])]),et("div",Iue,[et("button",{class:"sd-button reply-btn-cancel",onClick:Gr(jt=>dr(),["stop","prevent"])},"Cancel",8,Rue),et("button",{class:Wr(["sd-button primary reply-btn-primary",{"sd-is-disabled":!Te.value||rn.value}]),onClick:Gr(jt=>Oo(Xt),["stop","prevent"]),disabled:!Te.value||rn.value,"data-disabled-reason":rn.value?((ot=kn.value)==null?void 0:ot.reason)??null:null}," Update ",10,Oue)])])),Ve.value&&me.value&&Zn===0&&!jn.value(Xt)?(Ze(),ut("div",{key:3,class:"show-more-toggle",onClick:Gr(gt,["stop","prevent"])}," Show more ")):gn("",!0),z.value&&me.value&&Zn===0&&!jn.value(Xt)?(Ze(),ut("div",{key:4,class:"show-more-toggle",onClick:Gr(gt,["stop","prevent"])}," Show less ")):gn("",!0)])),Br.value&&Zn===0?(Ze(),ut(Dr,{key:2},[Je[12]||(Je[12]=et("div",{class:"comment-separator"},null,-1)),et("div",{class:"collapsed-replies",onClick:Gr(hn,["stop","prevent"])},[et("div",Nue,[(Ze(!0),ut(Dr,null,ki(Bt.value,jt=>(Ze(),ei(Mj,{key:jt.email||jt.name,user:jt,class:"mini-avatar"},null,8,["user"]))),128))]),et("span",null,Un($e.value)+" more "+Un($e.value===1?"reply":"replies"),1)])],64)):gn("",!0),Ce.value(Zn)?(Ze(),ut("div",Mue)):gn("",!0)])}),128)),U.value?(Ze(),ut("div",Due,[et("span",Lue,Un(Gn.value),1),et("button",{type:"button",class:"sd-button tracked-change-decision-alert__retry",onClick:Gr(ni,["stop","prevent"])}," Retry ")])):gn("",!0),Ue.value&&!Yt(T).readOnly?(Ze(),ut(Dr,{key:3},[tt.value?(Ze(),ut("div",Bue,[et("div",jue,[wo(I3,{ref_key:"commentInput",ref:L,users:rr.value,config:Yt(T),comment:r.comment,"include-header":!1},null,8,["users","config","comment"])]),et("div",Fue,[et("button",{class:"sd-button reply-btn-cancel",onClick:Gr(dr,["stop","prevent"])},"Cancel"),et("button",{class:Wr(["sd-button primary reply-btn-primary",{"sd-is-disabled":!Te.value||rn.value||De.value}]),onClick:Gr(Et,["stop","prevent"]),disabled:!Te.value||rn.value||De.value,"data-disabled-reason":Wn.value}
534," Reply ",10,zue)])])):(Ze(),ut("button",{key:0,type:"button",class:Wr(["reply-pill",{"sd-is-disabled":rn.value}]),onClick:Gr(mt,["stop","prevent"]),disabled:rn.value,"data-disabled-reason":rn.value?((un=kn.value)==null?void 0:un.reason)??null:null}," Reply or add others with @ ",10,Pue))],64)):gn("",!0)],64))],14,$ce)),[[Ut,it]])}}},[["__scopeId","data-v-bc46ac97"]]),Uue=["tabindex","aria-posinset","aria-setsize","aria-label","data-comment-instance-id","data-comment-thread-id","data-comment-position-key","data-comment-page-index","data-review-directory-index"],RO=li({__name:"ReviewDirectoryListItem",props:{item:{type:Object,required:!0},index:{type:Number,required:!0},total:{type:Number,required:!0},tabIndex:{type:Number,default:-1}},emits:["focus-item","navigate"],setup(e,{emit:t}){const n=e,r=t,{activeComment:i,editingCommentId:o,pendingComment:s}=Hd(qd()),l=Ne(null),u=Ne(112),d=Ne(typeof IntersectionObserver>"u"),f=Ne(!1);let p=null,m=null;const y=dt(()=>new Set((n.item.threadComments??[]).flatMap(D=>[D==null?void 0:D.commentId,D==null?void 0:D.importedId,D==null?void 0:D.trackedChangeCanonicalId]).filter(D=>D!=null).map(String))),b=dt(()=>{var P;const D=(P=s.value)==null?void 0:P.commentId;return f.value||i.value!=null&&y.value.has(String(i.value))||o.value!=null&&y.value.has(String(o.value))||D!=null&&y.value.has(String(D))}),k=dt(()=>d.value||b.value),S=dt(()=>k.value?void 0:{minHeight:`${Math.max(1,u.value)}px`}),x=dt(()=>{const D=n.item.comment,P=(D==null?void 0:D.trackedChangeLabel)??(D==null?void 0:D.commentText)??(D==null?void 0:D.trackedChangeText)??"Review item";return String(P).replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim().slice(0,160)||"Review item"}),T=()=>{var P,V;const D=(V=(P=l.value)==null?void 0:P.getBoundingClientRect)==null?void 0:V.call(P).height;Number.isFinite(D)&&D>0&&(u.value=D)},C=()=>{f.value=!0,r("focus-item",n.index)},I=D=>{var P,V;["ArrowDown","ArrowUp","Home","End"].includes(D.key)&&((V=(P=D.target)==null?void 0:P.closest)!=null&&V.call(P,'input, textarea, select, button, [contenteditable="true"]')||(D.preventDefault(),r("navigate",{index:n.index,key:D.key})))};return po(()=>{typeof IntersectionObserver<"u"&&(p=new IntersectionObserver(D=>{const P=D[0];P&&(d.value=P.isIntersecting,P.isIntersecting&&Sn(T))},{root:null,rootMargin:"600px 0px"}),p.observe(l.value)),typeof ResizeObserver<"u"&&(m=new ResizeObserver(T),m.observe(l.value)),Sn(T)}),Hs(()=>{p==null||p.disconnect(),m==null||m.disconnect()}),(D,P)=>(Ze(),ut("div",{ref_key:"shell",ref:l,class:"comment-item",role:"listitem",tabindex:e.tabIndex,"aria-posinset":e.index+1,"aria-setsize":e.total,"aria-label":x.value,style:Ai(S.value),"data-comment-instance-id":e.item.floatingInstanceId??"","data-comment-thread-id":e.item.comment.commentId??"","data-comment-position-key":e.item.comment.trackedChangeAnchorKey??"","data-comment-page-index":Number.isFinite(e.item.floatingPageIndex)?e.item.floatingPageIndex:"","data-review-directory-index":e.index,onFocusin:C,onFocusout:P[0]||(P[0]=V=>{var ee,F;return f.value=((F=(ee=l.value)==null?void 0:ee.contains)==null?void 0:F.call(ee,V.relatedTarget))===!0}),onKeydown:I},[k.value?(Ze(),ei(oT,{key:0,comment:e.item.comment,"thread-comments":e.item.threadComments,"floating-instance-id":e.item.floatingInstanceId,"floating-page-index":e.item.floatingPageIndex,"floating-position-entry":e.item.floatingPositionEntry,"is-floating-instance-active":e.item.isFloatingInstanceActive,onResize:T},null,8,["comment","thread-comments","floating-instance-id","floating-page-index","floating-position-entry","is-floating-instance-active"])):gn("",!0)],44,Uue))}},[["__scopeId","data-v-29650a06"]]),Vue=["aria-busy"],Hue={key:0},$ue={key:1},Gue="headerFooterPart",que=li({__name:"commentsList",props:{showMainComments:{type:Boolean,default:!0},showResolvedComments:{type:Boolean,default:!0}},setup(e){const t=e,n=qd(),r=Ne(null),i=Ne(0),o=$b(n,"isCommentsListVisible"),s=dt(()=>n.getFloatingCommentInstances),{activeComment:l,activeFloatingCommentInstanceId:u,commentsList:d,reviewDirectoryList:f,isReviewDirectoryActive:p,isReviewDirectoryLoading:m}=Hd(n),y=dt(()=>p.value?n.getGroupedReviewDirectory:n.getGroupedComments),b=dt(()=>p.value?f.value:d.value),k=te=>[te==null?void 0:te.commentId,te==null?void 0:te.importedId,te==null?void 0:te.trackedChangeCanonicalId].filter(M=>M!=null).map(String),S=dt(()=>{const te=new Map;for(const M of b.value){const Z=[M];for(const L of k(M))te.set(L,Z)}for(const M of b.value){const Z=[M==null?void 0:M.parentCommentId,M==null?void 0:M.threadingParentCommentId,M==null?void 0:M.trackedChangeThreadParentId].filter(L=>L!=null).map(String).map(L=>te.get(L)).find(Boolean);Z&&!Z.includes(M)&&Z.push(M)}return te}),x=te=>{for(const M of k(te)){const Z=S.value.get(M);if(Z)return Z}return[te]},T=te=>{var Z;const M=s.value.filter(L=>{var W;return((W=L==null?void 0:L.comment)==null?void 0:W.commentId)===(te==null?void 0:te.commentId)});return M.length<2?[]:te!=null&&te.trackedChange?((Z=te==null?void 0:te.trackedChangeStory)==null?void 0:Z.storyType)!==Gue?[]:M:[]},C=te=>{var M;return!((M=te==null?void 0:te.comment)!=null&&M.commentId)||l.value!==te.comment.commentId?!1:u.value==null?te.isPrimary===!0:String(u.value)===String(te.id)},I=te=>{const M=T(te);return M.length?M.map(Z=>({id:Z.id,comment:te,floatingInstanceId:String(Z.id),floatingPageIndex:Z.pageIndex,floatingPositionEntry:Z.positionEntry??null,isFloatingInstanceActive:C(Z),threadComments:x(te)})):[{id:te.commentId,comment:te,floatingInstanceId:null,floatingPageIndex:null,floatingPositionEntry:null,isFloatingInstanceActive:void 0,threadComments:x(te)}]},D=dt(()=>y.value.parentComments.flatMap(te=>I(te))),P=dt(()=>{var te,M;return t.showResolvedComments&&((M=(te=y.value)==null?void 0:te.resolvedComments)==null?void 0:M.length)>0}),V=dt(()=>y.value.resolvedComments.map(te=>({id:te.commentId,comment:te,floatingInstanceId:null,floatingPageIndex:null,floatingPositionEntry:null,isFloatingInstanceActive:void 0,threadComments:x(te)}))),ee=dt(()=>t.showMainComments?D.value.length:0),F=dt(()=>ee.value+(P.value?V.value.length:0));pr(F,te=>{i.value=Math.max(0,Math.min(i.value,te-1))});const H=async({index:te,key:M})=>{var U,q,Q,re;
534const Z=F.value-1;if(Z<0)return;const L=M==="Home"?0:M==="End"?Z:M==="ArrowUp"?Math.max(0,te-1):Math.min(Z,te+1);i.value=L,await Sn();const W=(q=(U=r.value)==null?void 0:U.querySelector)==null?void 0:q.call(U,`[data-review-directory-index="${L}"]`);(Q=W==null?void 0:W.scrollIntoView)==null||Q.call(W,{block:"nearest"}),(re=W==null?void 0:W.focus)==null||re.call(W,{preventScroll:!0})};return po(()=>{o.value=!0}),Hs(()=>{o.value=!1}),(te,M)=>(Ze(),ut("div",{ref_key:"listRoot",ref:r,class:"comments-list",role:"list","aria-busy":Yt(p)&&Yt(m)?"true":"false"},[e.showMainComments?(Ze(),ut("div",Hue,[(Ze(!0),ut(Dr,null,ki(D.value,(Z,L)=>(Ze(),ei(RO,{key:Z.id,item:Z,index:L,total:F.value,"tab-index":L===i.value?0:-1,onFocusItem:M[0]||(M[0]=W=>i.value=W),onNavigate:H},null,8,["item","index","total","tab-index"]))),128))])):gn("",!0),P.value?(Ze(),ut("div",$ue,[M[2]||(M[2]=et("div",{class:"comment-title"},"Resolved",-1)),(Ze(!0),ut(Dr,null,ki(V.value,(Z,L)=>(Ze(),ei(RO,{key:Z.id,item:Z,index:ee.value+L,total:F.value,"tab-index":ee.value+L===i.value?0:-1,onFocusItem:M[1]||(M[1]=W=>i.value=W),onNavigate:H},null,8,["item","index","total","tab-index"]))),128))])):gn("",!0)],8,Vue))}},[["__scopeId","data-v-89244745"]]),Wue=class extends qA.default{constructor(t,n){super();Ao(this,"element");Ao(this,"config",{comments:[],element:null,commentsStore:null});this.config={...this.config,...t},this.element=this.config.element,this.app=null,this.superdoc=n,this.stopDirectoryObservers=[],this.directorySnapshots={comments:null,trackChanges:null},this.directoryItemRefs={comments:null,trackChanges:null},this.directoryGeneration=0,this.open()}syncDirectory(){var i;const t=(i=this.superdoc)==null?void 0:i.commentsStore;if(!t)return;const n=this.directorySnapshots.comments,r=this.directorySnapshots.trackChanges;t.isReviewDirectoryLoading=n==null||r==null,!(n==null&&r==null)&&t.setReviewDirectoryFromV2({superdoc:this.superdoc,commentItems:n??[],trackedChangeItems:r??[]})}startDirectoryObservers(){var i,o;const t=++this.directoryGeneration,n=(s,l)=>{const u=p=>{var y,b;if(t!==this.directoryGeneration)return;if(((p==null?void 0:p.listStatus)??(p==null?void 0:p.status))!=="ready"){(y=this.superdoc)!=null&&y.commentsStore&&(this.superdoc.commentsStore.isReviewDirectoryLoading=!0);return}const m=Array.isArray(p.items)?p.items:[];if(this.directoryItemRefs[l]===m){(b=this.superdoc)!=null&&b.commentsStore&&(this.superdoc.commentsStore.isReviewDirectoryLoading=this.directorySnapshots.comments==null||this.directorySnapshots.trackChanges==null);return}this.directoryItemRefs[l]=m,this.directorySnapshots[l]=m,this.syncDirectory()},d=s.observe(p=>{u(p)}),f=()=>u(s.getSnapshot());return typeof globalThis.queueMicrotask=="function"?globalThis.queueMicrotask(f):Promise.resolve().then(f),d},r=(i=this.superdoc)==null?void 0:i.ui;r&&((o=this.superdoc)!=null&&o.commentsStore&&(this.superdoc.commentsStore.isReviewDirectoryActive=!0,this.superdoc.commentsStore.isReviewDirectoryLoading=!0),this.stopDirectoryObservers=[n(r.comments,"comments"),n(r.trackChanges,"trackChanges")])}createVueApp(){var n,r,i,o,s,l;this.app=UA(que);const t=(i=(r=(n=this.superdoc)==null?void 0:n.app)==null?void 0:r._context)==null?void 0:i.provides;t&&((s=(o=this.app)==null?void 0:o._context)!=null&&s.provides)&&Object.setPrototypeOf(this.app._context.provides,t),(l=this.superdoc)!=null&&l.pinia&&(By(this.superdoc.pinia),this.app.use(this.superdoc.pinia),this.app.config.globalProperties.$pinia=this.superdoc.pinia),this.app.directive("click-outside",z5),this.app.config.globalProperties.$superdoc=this.superdoc,!this.element&&this.config.selector&&(this.element=document.getElementById(this.config.selector)),this.container=this.app.mount(this.element),this.startDirectoryObservers()}close(){var t;this.directoryGeneration+=1;for(const n of this.stopDirectoryObservers.splice(0))n==null||n();this.directorySnapshots={comments:null,trackChanges:null},this.directoryItemRefs={comments:null,trackChanges:null},(t=this.superdoc)!=null&&t.commentsStore&&(this.superdoc.commentsStore.clearReviewDirectory(),this.superdoc.commentsStore.isReviewDirectoryActive=!1,this.superdoc.commentsStore.isReviewDirectoryLoading=!1),this.app&&(this.app.unmount(),this.app=null,this.container=null,this.element=null)}
534open(){this.app||this.createVueApp()}},Kue=96,Yue=".superdoc__right-sidebar",Xue=".sd-pdf-viewer-page",R3=Object.freeze({min:10,max:100,padding:0}),AE=e=>{const t=e&&typeof e=="object"?e:{},n=(s,l)=>typeof s=="number"&&Number.isFinite(s)&&s>0?s:l,r=n(t.min,R3.min),i=n(t.max,R3.max),o=typeof t.padding=="number"&&Number.isFinite(t.padding)&&t.padding>=0?t.padding:R3.padding;return{min:Math.min(r,i),max:Math.max(r,i),padding:o}},Dj=(e,t)=>!(e>0)||!(t>0)?null:Math.round(e/t*100),Lj=(e,t,n)=>{const r=Dj(e-n.padding,t);return r===null?null:Math.max(1,Math.round(Math.min(n.max,Math.max(n.min,r))))},Zue=(e,t,n)=>e>0?Number.isFinite(t)&&t>0?e/t*HZ:n>0?e/n:e:null,Que=e=>{var i;if(!e||typeof e!="object")return 0;const t=e.widestPageWidthPx;if(typeof t=="number"&&Number.isFinite(t))return t;let n=0;const r=e.pages;if(Array.isArray(r))for(const o of r){const s=(i=o==null?void 0:o.base)==null?void 0:i.widthPx;typeof s=="number"&&Number.isFinite(s)&&s>n&&(n=s)}return n},OO=e=>{var i,o,s,l,u,d;if(!e)return null;let t=0;try{t=Que((o=(i=e.pageMetrics)==null?void 0:i.getSnapshot)==null?void 0:o.call(i))}catch{t=0}if(t>0)return t;try{const f=(s=e.getPages)==null?void 0:s.call(e);if(Array.isArray(f))for(const p of f){const m=(l=p==null?void 0:p.size)==null?void 0:l.w;typeof m=="number"&&Number.isFinite(m)&&m>t&&(t=m)}}catch{t=0}if(t>0)return t;let n=null;try{n=((u=e.getPageStyles)==null?void 0:u.call(e))??null}catch{n=null}const r=(d=n==null?void 0:n.pageSize)==null?void 0:d.width;return typeof r=="number"&&Number.isFinite(r)&&r>0?r*Kue:null};function Jue({getSuperdoc:e,superdocContainerWidth:t,isReady:n,activeZoom:r,zoomMode:i,viewportMetrics:o,showCommentsSidebar:s,rightSidebarRef:l,superdocRoot:u,documents:d}){var C,I,D;const f=()=>{var ee;if(!((d==null?void 0:d.value)??[]).some(F=>(F==null?void 0:F.type)==="application/pdf"))return null;const P=u.value;if(!(P!=null&&P.querySelectorAll))return null;let V=0;for(const F of P.querySelectorAll(Xue)){const H=Number(F.clientWidth)||Number((ee=F.getBoundingClientRect)==null?void 0:ee.call(F).width)||0;let te=NaN;typeof window<"u"&&typeof window.getComputedStyle=="function"&&(te=Number.parseFloat(window.getComputedStyle(F).getPropertyValue("--scale-factor")));const M=(r.value??100)/100,Z=Zue(H,te,M);Z!==null&&Z>V&&(V=Z)}return V>0?V:null},p=()=>{var H,te,M,Z;const P=e();if(!P)return null;const V=[],ee=(d==null?void 0:d.value)??[];for(const L of ee){if((L==null?void 0:L.type)!=="application/vnd.openxmlformats-officedocument.wordprocessingml.document")continue;const W=OO((H=L.getEditor)==null?void 0:H.call(L));W!==null&&V.push(W)}if(V.length===0){const L=OO(P.activeEditor);L!==null&&V.push(L)}const F=f();if(F!==null&&V.push(F),V.length>0)return Math.max(...V);if(P.activeEditor){const L=(M=(te=u.value)==null?void 0:te.querySelector)==null?void 0:M.call(te,".superdoc__document"),W=Number(L==null?void 0:L.clientWidth)||Number((Z=L==null?void 0:L.getBoundingClientRect)==null?void 0:Z.call(L).width)||0;if(W>0){const U=(r.value??100)/100;return U>0?W/U:W}}return null},m=()=>{var ee,F,H;if(!(s!=null&&s.value))return 0;const P=(l==null?void 0:l.value)??((F=(ee=u.value)==null?void 0:ee.querySelector)==null?void 0:F.call(ee,Yue)),V=Number(P==null?void 0:P.offsetWidth)||Number((H=P==null?void 0:P.getBoundingClientRect)==null?void 0:H.call(P).width)||0;return V>0?V:0},y=(P,V)=>{var H,te;const ee=AE((te=(H=P.config)==null?void 0:H.zoom)==null?void 0:te.fitWidth),F=Lj(V.availableWidth,V.documentWidth,ee);F!==null&&F!==r.value&&(r.value=F,P.emit("zoomChange",{zoom:F,mode:"fit-width"}))},b=()=>{const P=e();if(!P)return;const V=t.value;if(!(V>0)||!n.value)return;const ee=p();if(ee===null)return;const F=V-m(),H=Dj(F,ee);if(H===null)return;const te=Object.freeze({availableWidth:F,documentWidth:ee,fitZoom:H}),M=o.value;(!M||M.availableWidth!==F||M.documentWidth!==ee||M.fitZoom!==H)&&(o.value=te),(!M||M.fitZoom!==H||Math.round(M.documentWidth)!==Math.round(ee))&&P.emit("viewport-change",te),i.value==="fit-width"&&y(P,te)};pr(t,()=>{Sn(()=>b())}),pr(n,P=>{P&&b()}),pr(i,P=>{P==="fit-width"&&b()}),s&&pr(s,()=>{Sn(()=>b())});const k=()=>{Sn(()=>b())},S=()=>{Sn(()=>b())},x=()=>{Sn(()=>b())},T=e();return(C=T==null?void 0:T.on)==null||C.call(T,"editorCreate",k),(I=T==null?void 0:T.on)==null||I.call(T,"pagination-update",S),(D=T==null?void 0:T.on)==null||D.call(T,"pdf:document-ready",x),Hs(()=>{var P,V,ee;(P=T==null?void 0:T.off)==null||P.call(T,"editorCreate",k),(V=T==null?void 0:T.off)==null||V.call(T,"pagination-update",S),(ee=T==null?void 0:T.off)==null||ee.call(T,"pdf:document-ready",x)}),{evaluateViewport:b}}var NO=["#1f6feb","#d1242f","#8250df","#bf3989","#1a7f37","#9a6700","#bc4c00","#0969da","#cf222e","#6639ba","#116329","#7d4e00"],ede=e=>e?`${typeof e.name=="string"?e.name:""} ${typeof e.email=="string"?e.email:""}`:"",tde=e=>{let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0},nde=e=>NO[tde(ede(e))%NO.length],sb=e=>typeof e=="string"&&e.length>0,rde=e=>{if(!e||e.enabled===!1)return;const t=e.overrides&&typeof e.overrides=="object"?e.overrides:void 0,n=typeof e.resolve=="function"?e.resolve:void 0;return r=>{const i=r??{};if(t){if(sb(i.email)&&sb(t[i.email]))return t[i.email];if(sb(i.name)&&sb(t[i.name]))return t[i.name]}if(n)try{const o=n(i);if(sb(o))return o}catch{}return nde(i)}},ide=e=>!!(e!=null&&e.trackedChange),ode=e=>e,sde=(e,t,n,r=e)=>!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)?!1:(Number.isFinite(r)?r:e)<t||e>n,ade=({comment:e,anchorTop:t,anchorBottom:n,viewportTop:r,viewportBottom:i})=>ide(e)&&sde(t,r,i,n),lde=({comment:e,anchorTop:t,anchorBottom:n,cardHeight:r,viewportTop:i,viewportBottom:o})=>!ade({comment:e,anchorTop:t,anchorBottom:n,viewportTop:i,viewportBottom:o})||!Number.isFinite(r)?null:(Number.isFinite(n)?n:t)<i?Math.min(t,i-r-1):t,cde=({id:e,visibleIds:t,activeCommentInstanceId:n})=>{var r;return e?!!(e==="pending"||n!=null&&String(e)===String(n)||(r=t==null?void 0:t.has)!=null&&r.call(t,e)):!1},MO=({previousIds:e,currentIds:t,removedId:n})=>{if(!Array.isArray(e)||!(t instanceof Set)||!n)return null;const r=e.indexOf(n);if(r<0)return null;for(let i=r+1;i<e.length;i+=1){const o=e[i];if(t.has(o))return o}for(let i=r-1;i>=0;i-=1){const o=e[i];if(t.has(o))return o}return null},ude=["data-comment-id","data-comment-instance-id","data-comment-thread-id","data-comment-position-key","data-comment-page-index"],jm={},dde=li({__name:"FloatingComments",props:{currentDocument:{type:Object,required:!0},parent:{type:Object,required:!0}},setup(e){const r=new Set(["auto","scroll","hidden","clip"]),i=(Te,qe,it)=>{if(qe>=0){Te[qe].top=Te[qe].anchorTop;let Et=Te[qe].top+Te[qe].height+it;
534for(let sn=qe+1;sn<Te.length;sn++)Te[sn].top=Math.max(Te[sn].anchorTop,Et),Et=Te[sn].top+Te[sn].height+it;Et=Te[qe].top-it;for(let sn=qe-1;sn>=0;sn--){const Tn=Et-Te[sn].height;Te[sn].top=Math.min(Te[sn].anchorTop,Tn),Et=Te[sn].top-it}const $t=Math.min(...Te.map(sn=>sn.top));if($t<0){const sn=Math.abs($t);for(const Tn of Te)Tn.top+=sn}}else for(let Et=1;Et<Te.length;Et++){const $t=Te[Et-1],sn=$t.top+$t.height+it;Te[Et].top<sn&&(Te[Et].top=sn)}},o=e,s=tv(),l=qd(),{clearInstantSidebarAlignment:u}=l,{activeComment:d,activeFloatingCommentInstanceId:f,editorCommentPositions:p,pendingComment:m,editingCommentId:y,instantSidebarAlignmentTargetY:b,instantSidebarAlignmentThreadId:k,instantSidebarAlignmentInstanceId:S}=Hd(l),{activeZoom:x}=Hd(s),T=dt(()=>{var it;const Te=l.getFloatingCommentInstances;if(!Array.isArray(Te))return[];const qe=(it=o.currentDocument)==null?void 0:it.id;return qe==null?Te:Te.filter(Et=>l.belongsToDocument(Et.comment,String(qe),{allowSingleDocumentMismatch:!0}))}),C=Ne(null),I=Ne(0),D=Ne(0),P=Ne(!1),V=Ne(null),ee=Ne(0),F=Te=>{var it;const qe=(it=m.value)==null?void 0:it.commentId;return qe?typeof Te=="object"?(Te==null?void 0:Te.commentId)===qe:Te===qe||Te==="pending":!1},H=Te=>(Te==null?void 0:Te.commentId)??(Te==null?void 0:Te.importedId)??null,te=dt(()=>{const Te=new Map,qe=new Map;for(const it of T.value){(it==null?void 0:it.id)!=null&&Te.set(String(it.id),it);const Et=H(it==null?void 0:it.comment);if(Et==null)continue;const $t=String(Et),sn=qe.get($t)??[];sn.push(it),qe.set($t,sn)}return{byId:Te,byThreadId:qe}}),M=(Te,qe=null)=>{var $t,sn;if(Te==null)return null;const it=String(Te),Et=te.value.byThreadId.get(it)??[];if(!Et.length)return null;if(qe!=null){const Tn=Et.find(kn=>String(kn.id)===String(qe));if(Tn)return Tn.id}return(($t=Et.find(Tn=>Tn.isPrimary))==null?void 0:$t.id)??((sn=Et[0])==null?void 0:sn.id)??null},Z=dt(()=>d.value?M(d.value,f.value):null),L=Te=>{if(typeof Te=="number")return Number.isFinite(Te)?Te:null;if(typeof Te!="string"||Te.trim()==="")return null;const qe=Number(Te);return Number.isFinite(qe)?qe:null},W=Ne({...jm}),U=Ne(new Set),q=Ne({});let Q=null;const re=new Set;let ne=null;const J=()=>{ne==null&&(ne=requestAnimationFrame(()=>{ne=null,ee.value+=1}))},ge=Te=>{var qe,it,Et,$t,sn;if(o.currentDocument.type==="application/pdf"){const Tn=(x.value??100)/100,kn=L((Et=(it=(qe=Te==null?void 0:Te.comment)==null?void 0:qe.selection)==null?void 0:it.selectionBounds)==null?void 0:Et.top);return kn==null?null:kn*Tn}return(sn=($t=Te==null?void 0:Te.positionEntry)==null?void 0:$t.bounds)==null?void 0:sn.top},le=(Te,qe)=>{var Et,$t,sn,Tn,kn;if(o.currentDocument.type==="application/pdf"){const rn=(x.value??100)/100,Wn=L((sn=($t=(Et=Te==null?void 0:Te.comment)==null?void 0:Et.selection)==null?void 0:$t.selectionBounds)==null?void 0:sn.bottom);return Wn!=null?Wn*rn:qe}const it=(kn=(Tn=Te==null?void 0:Te.positionEntry)==null?void 0:Tn.bounds)==null?void 0:kn.bottom;return Number.isFinite(it)?it:qe},ve=dt(()=>{const Te=[];for(const qe of T.value){const it=qe==null?void 0:qe.id,Et=H(qe==null?void 0:qe.comment),$t=ge(qe);if(it==null||Et==null||!Number.isFinite($t))continue;const sn=ode($t,qe.comment);Te.push({id:it,threadId:Et,instance:qe,top:sn,anchorBottom:le(qe,sn)})}return Te}),Ee=()=>{var Et,$t,sn,Tn;const Te=p.value.pending;if(typeof((Et=Te==null?void 0:Te.bounds)==null?void 0:Et.top)=="number"&&!isNaN(Te.bounds.top))return Te.bounds.top;const qe=o.currentDocument.type==="application/pdf"?(x.value??100)/100:1,it=L((Tn=(sn=($t=m.value)==null?void 0:$t.selection)==null?void 0:sn.selectionBounds)==null?void 0:Tn.top);return it==null?null:it*qe},st=Te=>cde({id:Te==null?void 0:Te.id,visibleIds:U.value,activeCommentInstanceId:Z.value,comment:Te==null?void 0:Te.commentRef}),At=()=>{var sn,Tn;const Te=C.value;if(!Te)return null;const qe=Te.getBoundingClientRect();if(!Number.isFinite(qe.top)||!Number.isFinite(window.innerHeight))return null;let it=0,Et=window.innerHeight;for(let kn=Te.parentElement;kn;kn=kn.parentElement){const rn=window.getComputedStyle(kn).overflowY;if(!["auto","scroll","hidden","clip"].includes(rn))continue;const Wn=kn.getBoundingClientRect();!Number.isFinite(Wn.top)||!Number.isFinite(Wn.bottom)||(it=Math.max(it,Wn.top),Et=Math.min(Et,Wn.bottom))}if(Et<=it)return null;const $t=(Tn=(sn=o.parent)==null?void 0:sn.getBoundingClientRect)==null?void 0:Tn.call(sn);if($t&&Number.isFinite($t.top)&&Number.isFinite($t.bottom)){const kn=Math.max(it,$t.top),rn=Math.min(Et,$t.bottom);rn>kn&&(it=kn,Et=rn)}return{top:it-qe.top,bottom:Et-qe.top}},yt=dt(()=>k.value?M(k.value,S.value):null),Ge=dt(()=>{var gi;ee.value;const Te=ve.value,qe=m.value&&m.value.fileId===o.currentDocument.id;if(!Te.length&&!T.value.length&&!qe)return[];const it=[],Et=At()??{top:0,bottom:Math.max(0,((gi=o.parent)==null?void 0:gi.clientHeight)||window.innerHeight||0)},$t=Et.top-600,sn=Et.bottom+600,Tn=qe?"pending":Z.value,kn=new Set,rn=({id:Jn,threadId:Tr,instance:zr,top:Kn,anch
534orBottom:Gn,hasAnchorGeometry:ni})=>{const Di=String(Jn);kn.has(Di)||(kn.add(Di),it.push({id:Jn,threadId:Tr,pageIndex:(zr==null?void 0:zr.pageIndex)??null,anchorTop:Kn,anchorBottom:Gn,hasAnchorGeometry:ni,top:Kn,height:W.value[Jn]||110,commentRef:zr.comment,instanceRef:zr}))};for(const Jn of Te){const{id:Tr,threadId:zr,instance:Kn,top:Gn,anchorBottom:ni}=Jn,Di=Tn!=null&&String(Tr)===String(Tn),Ro=y.value!=null&&String(zr)===String(y.value);!Di&&!Ro&&(ni<$t||Gn>sn)||rn({id:Tr,threadId:zr,instance:Kn,top:Gn,anchorBottom:ni,hasAnchorGeometry:!0})}const Wn=[];if(Tn&&Tn!=="pending"){const Jn=te.value.byId.get(String(Tn));Jn&&Wn.push(Jn)}if(y.value!=null){const Jn=te.value.byThreadId.get(String(y.value))??[],Tr=Jn.find(zr=>zr.isPrimary)??Jn[0];Tr&&Wn.push(Tr)}for(const Jn of Wn){const Tr=Jn.id,zr=H(Jn.comment);Tr==null||zr==null||kn.has(String(Tr))||rn({id:Tr,threadId:zr,instance:Jn,top:Et.top,anchorBottom:Et.top,hasAnchorGeometry:!1})}if(qe){const Jn=Ee();typeof Jn=="number"&&!isNaN(Jn)&&it.push({id:"pending",anchorTop:Jn,anchorBottom:Jn,hasAnchorGeometry:!0,top:Jn,height:W.value.pending||110,commentRef:m.value})}it.sort((Jn,Tr)=>Jn.anchorTop-Tr.anchorTop);const qr=[];for(const Jn of it){const Tr=Jn.hasAnchorGeometry?lde({comment:Jn.commentRef,anchorTop:Jn.anchorTop,anchorBottom:Jn.anchorBottom,cardHeight:Jn.height,viewportTop:Et.top,viewportBottom:Et.bottom}):null;Tr==null?qr.push(Jn):Jn.top=Tr}const Yr=Tn?qr.findIndex(Jn=>Jn.id===Tn):-1;return i(qr,Yr,15),it}),Be=dt(()=>{var Te,qe;return ee.value,Math.max(0,((Te=o.parent)==null?void 0:Te.clientHeight)||0,((qe=o.parent)==null?void 0:qe.scrollHeight)||0)}),he=()=>{Q&&Q.disconnect(),Q=new IntersectionObserver(Te=>{const qe=new Set(U.value);for(const it of Te){const Et=it.target.dataset.commentId;Et&&(it.isIntersecting?qe.add(Et):qe.delete(Et))}U.value=qe},{rootMargin:"600px 0px 600px 0px"})},Oe=()=>{if(!Q)return;const Te=new Set;for(const qe of Ge.value){const it=q.value[qe.id];it&&(Te.add(it),re.has(it)||(Q.observe(it),re.add(it)))}for(const qe of re)Te.has(qe)||(Q.unobserve(qe),re.delete(qe))},ye=(Te,qe)=>{qe<=0||qe===W.value[Te]||(jm[Te]=qe,W.value={...W.value,[Te]:qe})},B=Te=>{if(!Te)return;const{elementRef:qe,commentId:it}=Te;qe&&Sn(()=>{var $t;const Et=($t=qe.value)==null?void 0:$t.getBoundingClientRect();!Et||Et.height<=0||it&&ye(it,Et.height)})},be=Te=>{const qe=Te==null?void 0:Te.id;qe&&Sn(()=>{const it=q.value[qe];if(!it)return;const Et=it.querySelector(".comments-dialog");if(!Et)return;ye(qe,Et.getBoundingClientRect().height);const $t=qe===Z.value,sn=qe==="pending",Tn=!!y.value&&!!d.value&&(Te==null?void 0:Te.threadId)!=null&&String(Te.threadId)===String(d.value);!$t&&!sn&&!Tn||(Ve(Ge.value.map(kn=>kn.id)),dn(()=>Ge.value.map(kn=>kn.id)))})},ie=Te=>{!Te&&V.value!=null||(P.value=Te)},fe=(Te,qe,it)=>{if(!Number.isFinite(qe)){it==null||it(!1);return}const Et=q.value[Te];if(!Et){it==null||it(!1);return}const $t=Et.getBoundingClientRect().top;D.value+=qe-$t,it==null||it(!0)},ue=(Te,qe)=>{if(qe)q.value[Te]=qe,Q&&!re.has(qe)&&(Q.observe(qe),re.add(qe));else{const it=q.value[Te];it&&Q&&(Q.unobserve(it),re.delete(it)),delete q.value[Te]}};let Ce=[],Ue=null,K=[],oe=null,Fe=!1,Le=0,tt=null,De=null,Pe=null,mt=null,xt=null;const de=new Set,z=()=>{Pe=null,mt=null,V.value=null,ie(!1)},Y=Te=>{var Et,$t,sn,Tn,kn;if(!Pe)return;const qe=($t=(Et=(Te==null?void 0:Te.target)instanceof Element?Te.target:null)==null?void 0:Et.closest)==null?void 0:$t.call(Et,"[data-comment-action]"),it=(sn=qe==null?void 0:qe.getAttribute)==null?void 0:sn.call(qe,"data-comment-action");(it==="resolve"||it==="reject")&&((kn=(Tn=C.value)==null?void 0:Tn.contains)!=null&&kn.call(Tn,qe))||z()},me=()=>{Ce.forEach(clearTimeout),Ce=[]},Ve=Te=>{for(const qe of Te.filter(Boolean)){const it=q.value[qe];if(!it)continue;const Et=it.querySelector(".comments-dialog");Et&&ye(qe,Et.getBoundingClientRect().height)}},lt=50,gt=350,dn=Te=>{me();const qe=typeof Te=="function"?Te:()=>Te;Ce.push(setTimeout(()=>Ve(qe()),lt)),Ce.push(setTimeout(()=>Ve(qe()),gt))},Hn=()=>{u(),requestAnimationFrame(()=>{ie(!1)})},br=(Te,qe)=>{!Te||!Number.isFinite(qe)||(ie(!0),Sn(()=>{Ve([Te]),fe(Te,qe,()=>{Hn()})}))},ur=()=>{oe=null,Le+=1,tt!=null&&(cancelAnimationFrame(tt),tt=null),ie(!1)},tr=()=>{!Pe&&!oe||(z(),ur(),ie(!0),D.value=0,xt!=null&&cancelAnimationFrame(xt),xt=requestAnimationFrame(()=>{xt=null,!Pe&&!oe&&ie(!1)}))},Br=()=>{tr(),J()},Lr=()=>{var qe;const Te=it=>{!(it!=null&&it.addEventListener)||de.has(it)||(it.addEventListener("scroll",Br,{passive:!0}),de.add(it))};Te(o.parent);for(let it=(qe=C.value)==null?void 0:qe.parentElement;it;it=it.parentElement)r.has(window.getComputedStyle(it).overflowY)&&Te(it);Te(window)},$e=()=>{var Te;
534for(const qe of de)(Te=qe.removeEventListener)==null||Te.call(qe,"scroll",Br);de.clear()},Bt=()=>{if(!oe||Fe)return;Fe=!0;const Te=Le;tt!=null&&(cancelAnimationFrame(tt),tt=null),ie(!0),Sn(()=>{if(Fe=!1,Te!==Le){Bt();return}const{key:qe,targetClientY:it}=oe;Ve([qe]),fe(qe,it,Et=>{if(Te===Le){if(!Et){ie(!1);return}tt=requestAnimationFrame(()=>{tt=null,Te===Le&&ie(!1)})}})})},hn=(Te,qe)=>{var $t,sn;const it=MO({previousIds:K,currentIds:qe,removedId:Te}),Et=(sn=($t=it?q.value[it]:null)==null?void 0:$t.getBoundingClientRect)==null?void 0:sn.call($t).top;return!it||!Number.isFinite(Et)?(ur(),!1):(oe={key:it,targetClientY:Et},Le+=1,Bt(),!0)},Pn=Te=>{var kn,rn,Wn,qr,Yr,gi,Jn,Tr,zr;const qe=(rn=(kn=Te==null?void 0:Te.target)==null?void 0:kn.closest)==null?void 0:rn.call(kn,"[data-comment-action]"),it=(Wn=qe==null?void 0:qe.getAttribute)==null?void 0:Wn.call(qe,"data-comment-action");if(it!=="resolve"&&it!=="reject"||(z(),((qr=qe.getAttribute)==null?void 0:qr.call(qe,"aria-disabled"))==="true"))return;const Et=(Jn=(gi=(Yr=qe.closest)==null?void 0:Yr.call(qe,"[data-comment-id]"))==null?void 0:gi.getAttribute)==null?void 0:Jn.call(gi,"data-comment-id");if(!Et||String(Z.value??"")===String(Et))return;const $t=Ge.value.filter(Kn=>{var Gn;return(Gn=Kn.commentRef)==null?void 0:Gn.trackedChange}).map((Kn,Gn)=>({id:Kn.id,index:Gn,top:Kn.top})).filter(Kn=>Number.isFinite(Kn.top)).sort((Kn,Gn)=>Kn.top-Gn.top||Kn.index-Gn.index).map(Kn=>Kn.id),sn=MO({previousIds:$t,currentIds:new Set($t),removedId:Et}),Tn=(zr=(Tr=sn?q.value[sn]:null)==null?void 0:Tr.getBoundingClientRect)==null?void 0:zr.call(Tr).top;!sn||!Number.isFinite(Tn)||(Pe={removedKey:Et,targetKey:sn,targetClientY:Tn,applied:!1},mt=Et,V.value=sn,ie(!0))};pr(Z,(Te,qe)=>{if(me(),!(Pe!=null&&mt!=null&&[Te,qe].some($t=>$t!=null&&String($t)===String(mt)))){if(mt=null,Te)z(),ur();else if(qe){const $t=new Set(Ge.value.map(sn=>sn.id));$t.has(qe)?ur():hn(qe,$t)}}const it=[Te,qe],Et=Te&&Te===yt.value&&Number.isFinite(b.value);Sn(()=>{if(Et){Ve(it);return}dn(it)})}),pr([Z,yt,b],([Te,qe,it])=>{!Te||!qe||Te!==qe||!Number.isFinite(it)||br(Te,it)}),pr(y,()=>{me(),Sn(()=>{dn(()=>Ge.value.map(Te=>Te.id))})}),pr(d,()=>{if(Ue&&clearTimeout(Ue),!d.value){if(u(),oe){Bt();return}ie(!1),D.value=0;return}if(!(F(d.value)?m.value:l.getComment(d.value)))return;const Te=F(d.value)?"pending":Z.value;if(Te){if(Te===yt.value&&Number.isFinite(b.value)){ie(!0);return}Sn(()=>{Ue=setTimeout(()=>{var rn,Wn;const it=q.value[Te];if(!it)return;const Et=(Wn=(rn=o.parent)==null?void 0:rn.getBoundingClientRect)==null?void 0:Wn.call(rn);if(!Et)return;const $t=Ge.value.find(qr=>qr.id===Te),sn=Te==="pending"?Ee():$t==null?void 0:$t.anchorTop;if(typeof sn!="number"||isNaN(sn))return;const Tn=it.getBoundingClientRect().top,kn=Et.top+sn;D.value+=kn-Tn},400)})}}),pr(x,()=>{if(o.currentDocument.type==="application/pdf"){for(const Te in jm)delete jm[Te];W.value={},I.value+=1}});let jn=new Set,Lt=null,St=null;return pr(Ge,Te=>{const qe=Z.value?Te.find(Kn=>Kn.id===Z.value):null,it=typeof(qe==null?void 0:qe.anchorTop)=="number"&&Number.isFinite(qe.anchorTop)?qe.anchorTop:null,Et=it!=null&&Lt!=null&&Math.abs(it-Lt)>1,$t=typeof(qe==null?void 0:qe.top)=="number"&&Number.isFinite(qe.top)?qe.top:null,sn=$t!=null&&St!=null&&Math.abs($t-St)>1;Et&&D.value!==0&&!Number.isFinite(b.value)?(D.value=0,ie(!1)):sn&&D.value!==0&&!Number.isFinite(b.value)&&!oe&&(ie(!0),D.value+=St-$t,De!=null&&cancelAnimationFrame(De),De=requestAnimationFrame(()=>{De=null,!oe&&!Number.isFinite(b.value)&&ie(!1)})),Lt=it,St=$t;const Tn=Te.map(Kn=>Kn.id),kn=new Set(Tn);if(Pe&&!Pe.applied&&!kn.has(Pe.removedKey)){const{targetKey:Kn,targetClientY:Gn}=Pe;Pe.applied=!0,kn.has(Kn)&&Number.isFinite(Gn)?(oe={key:Kn,targetClientY:Gn},Le+=1,Bt()):z()}if(Pe!=null&&Pe.applied&&!kn.has(Pe.targetKey)&&z(),oe&&!kn.has(oe.key)){const Kn=oe.key;hn(Kn,kn)||(ie(!1),D.value=0)}const rn=new Set(U.value);let Wn=!1,qr=-1/0,Yr=1/0;const gi=C.value;if(gi){const Kn=gi.getBoundingClientRect();qr=-Kn.top-600,Yr=-Kn.top+window.innerHeight+600}const Jn=new Map(Te.map(Kn=>[Kn.id,Kn]));for(const Kn of kn)if(!rn.has(Kn)){const Gn=Jn.get(Kn);(!Gn||Gn.top>=qr&&Gn.top<=Yr)&&(rn.add(Kn),Wn=!0)}for(const Kn of rn)kn.has(Kn)||(rn.delete(Kn),Wn=!0);
534Wn&&(U.value=rn);for(const Kn of jn)kn.has(Kn)||delete jm[Kn];const Tr=jn.size!==kn.size||[...jn].some(Kn=>!kn.has(Kn)),zr=K.length!==Tn.length||K.some((Kn,Gn)=>Kn!==Tn[Gn]);if(Tr){const Kn={};for(const Gn of kn)jm[Gn]&&(Kn[Gn]=jm[Gn]);W.value=Kn,Sn(()=>{for(const Gn of Te){const ni=q.value[Gn.id];if(!ni)continue;const Di=ni.querySelector(".comments-dialog");Di&&ye(Gn.id,Di.getBoundingClientRect().height)}})}oe&&(Tr||zr)&&Bt(),jn=kn,Sn(()=>{K=Tn,Oe()})}),po(()=>{he(),Lr(),window.addEventListener("resize",J,{passive:!0}),document.addEventListener("pointerdown",Y,!0),Sn(Oe)}),Hs(()=>{me(),Ue&&clearTimeout(Ue),z(),ur(),De!=null&&(cancelAnimationFrame(De),De=null),xt!=null&&(cancelAnimationFrame(xt),xt=null),$e(),window.removeEventListener("resize",J),document.removeEventListener("pointerdown",Y,!0),ne!=null&&(cancelAnimationFrame(ne),ne=null),Q&&(Q.disconnect(),Q=null,re.clear())}),(Te,qe)=>(Ze(),ut("div",{class:"section-wrapper",ref_key:"floatingCommentsContainer",ref:C,onClickCapture:Pn,style:Ai({minHeight:Be.value+"px",transition:P.value?"none":void 0})},[et("div",{class:"sidebar-container",style:Ai({transform:`translateY(${D.value}px)`,transition:P.value?"none":void 0})},[(Ze(!0),ut(Dr,null,ki(Ge.value,it=>{var Et,$t;return Ze(),ut("div",{key:it.id,ref_for:!0,ref:sn=>ue(it.id,sn),"data-comment-id":it.id,"data-comment-instance-id":it.id,"data-comment-thread-id":it.threadId,"data-comment-position-key":((Et=it.instanceRef)==null?void 0:Et.positionKey)??"","data-comment-page-index":it.pageIndex??"",class:Wr([{"is-direct-decision-continuity-target":it.id===V.value},"comment-placeholder"]),style:Ai({top:it.top+"px",height:it.height+"px",transition:P.value?"none":void 0})},[st(it)?(Ze(),ei(oT,{key:it.id+I.value,onReady:B,onResize:sn=>be(it),class:"floating-comment",parent:e.parent,comment:it.commentRef,"floating-instance-id":it.id,"floating-page-index":it.pageIndex,"floating-position-entry":(($t=it.instanceRef)==null?void 0:$t.positionEntry)??null,"is-floating-instance-active":it.id===Z.value},null,8,["onResize","parent","comment","floating-instance-id","floating-page-index","floating-position-entry","is-floating-instance-active"])):gn("",!0)],14,ude)}),128))],4)],36))}},[["__scopeId","data-v-d8d03209"]]),fde={class:"superdoc__pdf-comments-layer pdf-comments-layer","aria-hidden":"false"},hde=["data-id","data-comment-id","data-page-number","onClick","onKeydown"],pde="pdf",mde="#078383",gde="#B1124B",yde=li({__name:"PdfCommentsLayer",emits:["anchor-activate"],setup(e,{emit:t}){const n=t,r=qd(),i=tv(),{activeComment:o}=Hd(r),{documents:s,activeZoom:l}=Hd(i),{proxy:u}=fh(),d=C=>typeof C=="number"?Number.isFinite(C):typeof C=="string"&&C.trim()!==""?Number.isFinite(Number(C)):!1,f=C=>!!C&&d(C.top)&&d(C.left)&&d(C.right)&&d(C.bottom),p=dt(()=>{const C=Array.isArray(s.value)?s.value:[];return new Set(C.filter(I=>(I==null?void 0:I.type)===Qp).map(I=>String(I.id)))}),m=C=>{var D;const I=(C==null?void 0:C.fileId)??(C==null?void 0:C.documentId)??((D=C==null?void 0:C.selection)==null?void 0:D.documentId);return I!=null?String(I):null},y=C=>{const I=(C==null?void 0:C.commentId)??(C==null?void 0:C.importedId);return I!=null&&String(I)!==""?String(I):null},b=C=>{const I=p.value;if(!I.size)return!1;const D=m(C);return D?I.has(D):I.size===1},k=C=>{const I=Math.min(Number(C.top),Number(C.bottom)),D=Math.max(Number(C.top),Number(C.bottom));return{top:I,left:Math.min(Number(C.left),Number(C.right)),right:Math.max(Number(C.left),Number(C.right)),bottom:D}},S=dt(()=>{const C=r.getFloatingComments;return Array.isArray(C)?C.filter(I=>{var D;return((D=I==null?void 0:I.selection)==null?void 0:D.source)===pde}).filter(I=>!I.resolvedTime).filter(I=>y(I)!==null).filter(I=>{var D;return f((D=I.selection)==null?void 0:D.selectionBounds)}).filter(I=>b(I)).map(I=>{var V;const D=y(I),P=k(I.selection.selectionBounds);return{commentId:D,page:((V=I.selection)==null?void 0:V.page)??null,isInternal:I.isInternal!==!1,bounds:P}}):[]}),x=C=>{const I=(l.value??100)/100,{top:D,left:P,right:V,bottom:ee}=C.bounds,F=o.value===C.commentId,H=(C.isInternal?mde:gde)+(F?"66":"33");return{position:"absolute",top:D*I+"px",left:P*I+"px",width:(V-P)*I+"px",height:(ee-D)*I+"px",backgroundColor:H}},T=C=>{r.setActiveComment(u.$superdoc,C.commentId),n("anchor-activate",C.commentId)};return(C,I)=>(Ze(),ut("div",fde,[(Ze(!0),ut(Dr,null,ki(S.value,D=>(Ze(),ut("div",{key:D.commentId,class:"sd-comment-anchor sd-highlight",role:"button",tabindex:"0","data-id":D.commentId,"data-comment-id":D.commentId,"data-page-number":D.page,style:Ai(x(D)),onClick:Gr(P=>T(D),["stop","prevent"]),onKeydown:[Nd(Gr(P=>T(D),["stop","prevent"]),["enter"]),Nd(Gr(P=>T(D),["stop","prevent"]),["space"])]},null,44,hde))),128))]))}},[["__scopeId","data-v-b5ad4c58"]]),vde=({proxy:e,layers:t,documents:n,modules:r})=>{var H,te;const i=dt(()=>{var Z;const M=((Z=r.value)==null?void 0:Z.whiteboard)??r.whiteboard;return M===!1||M==null?null:M}),o=(H=e==null?void 0:e.$superdoc)==null?void 0:H.whiteboard,s=Zs([]),l=Sl({}),u=Sl({}),d=Ne(!1),f=Ne(0),p=Ne(0),m=Ne(1),y=Ne(((te=i.value)==null?void 0:te.enabled)??!1),b=()=>{var Z;if(d.value)return;f.value+=1;const M=p.value||s.value.length;M&&f.value>
534=M&&(d.value=!0,(Z=e==null?void 0:e.$superdoc)==null||Z.emit("whiteboard:ready",{whiteboard:o}))},k=M=>{var L;if(!M)return;const Z=(L=n.value)==null?void 0:L[0];Z&&Z.type==="application/pdf"&&S(M)},S=M=>{const{pageIndex:Z,width:L,height:W,originalWidth:U,originalHeight:q}=M,Q={width:L,height:W,originalWidth:U,originalHeight:q};o==null||o.setPageSize(Z,Q),l[Z]=Q;const re=o==null?void 0:o.getPage(Z);re&&re.setSize(Q),o&&(s.value=o.getPages().sort((ne,J)=>ne.pageIndex-J.pageIndex).map(ne=>Us(ne)),p.value=s.value.length),Sn(()=>{ee(),b()})},x=M=>{var Z;(Z=e==null?void 0:e.$superdoc)==null||Z.emit("whiteboard:change",M)},T=M=>{M.forEach(Z=>{const L=l[Z.pageIndex];L&&Z.setSize(L)}),s.value=M.map(Z=>Us(Z)),p.value=s.value.length,Sn(()=>ee())},C=M=>{var Z;y.value=M,(Z=e==null?void 0:e.$superdoc)==null||Z.emit("whiteboard:enabled",M)},I=M=>{m.value=M},D=M=>{var Z;(Z=e==null?void 0:e.$superdoc)==null||Z.emit("whiteboard:tool",M)},P=()=>{var Z;const M=(Z=n.value)==null?void 0:Z[0];M&&M.type==="application/pdf"&&V({doc:M})},V=({doc:M})=>{s.value.forEach(Z=>{var J,ge;const L=`${M.id}-page-${Z.pageIndex+1}
534`,W=document.querySelector(`[data-page-id="${L}"]`);if(!W)return;const U=W.getBoundingClientRect(),q=l[Z.pageIndex]||{},Q=q.originalWidth??((J=Z.size)==null?void 0:J.originalWidth)??U.width,re=q.originalHeight??((ge=Z.size)==null?void 0:ge.originalHeight)??U.height,ne={width:U.width,height:U.height,originalWidth:Q,originalHeight:re};l[Z.pageIndex]=ne,Z.setSize(ne)})},ee=()=>{var L,W,U;const M=(W=(L=t.value)==null?void 0:L.getBoundingClientRect)==null?void 0:W.call(L);if(!M)return;const Z=(U=n.value)==null?void 0:U[0];Z&&Z.type==="application/pdf"&&F({doc:Z,layerBounds:M})},F=({doc:M,layerBounds:Z})=>{s.value.forEach(L=>{const W=`${M.id}-page-${L.pageIndex+1}`,U=document.querySelector(`[data-page-id="${W}"]`);if(!U)return;const q=U.getBoundingClientRect();u[L.pageIndex]={top:q.top-Z.top,left:q.left-Z.left}})};return o&&(o.on("change",x),o.on("setData",T),o.on("enabled",C),o.on("opacity",I),o.on("tool",D)),Hs(()=>{o&&(o.off("change",x),o.off("setData",T),o.off("opacity",I),o.off("enabled",C),o.off("tool",D))}),{whiteboard:o,whiteboardModuleConfig:i,whiteboardPages:s,whiteboardPageSizes:l,whiteboardPageOffsets:u,whiteboardEnabled:y,whiteboardOpacity:m,whiteboardReady:d,handleWhiteboardPageReady:k,updateWhiteboardPageSizes:P,updateWhiteboardPageOffsets:ee}},bde=["data-page-index"],wde=li({__name:"WhiteboardPage",props:{whiteboard:{type:Object,required:!0},page:{type:Object,required:!0},pageSize:{type:Object,default:null},pageOffset:{type:Object,default:null},enabled:{type:Boolean,default:!0}},setup(e){const t=e,n=Ne(null),r=()=>{const d=n.value;!d||!t.page||(t.page.mount(d),t.pageSize&&t.page.resize(t.pageSize.width,t.pageSize.height))},i=d=>{var x,T;if(!t.page||!(d!=null&&d.dataTransfer)||!t.enabled||t.whiteboard.getTool()!=="select")return;d.preventDefault(),d.stopPropagation();const f=n.value;if(!f)return;const p=f.getBoundingClientRect(),m=d.clientX-p.left,y=d.clientY-p.top,b=(x=t.pageSize)==null?void 0:x.width,k=((T=t.pageSize)==null?void 0:T.originalWidth)??b,S=Number.isFinite(b)&&Number.isFinite(k)&&k?b/k:1;o(d,m,y,S)||s(d,m,y)||l(d,m,y)||u(d,m,y)},o=(d,f,p,m)=>{const y=d.dataTransfer.getData("application/sticker");if(!y)return!1;const b=(t.whiteboard.getType("stickers")||[]).find(k=>k.id===y);return b!=null&&b.src?(t.page.addImage({stickerId:b.id,x:f,y:p,src:b.src,width:Number.isFinite(b.width)?b.width*m:b.width,height:Number.isFinite(b.height)?b.height*m:b.height,type:"sticker"}),!0):!1},s=(d,f,p,m)=>{const y=Array.from(d.dataTransfer.files||[]).find(k=>k.type.startsWith("image/"));if(!y)return!1;const b=new FileReader;return b.onload=()=>{typeof b.result=="string"&&t.page.addImage({x:f,y:p,src:b.result,type:"image"})},b.readAsDataURL(y),!0},l=(d,f,p)=>{const m=d.dataTransfer.getData("application/comment");if(!m)return!1;const y=(t.whiteboard.getType("comments")||[]).find(b=>b.id===m);return y!=null&&y.text?(t.page.addText({x:f,y:p,content:y.text}),!0):!1},u=(d,f,p)=>{const m=d.dataTransfer.getData("text/plain");return m?(t.page.addText({x:f,y:p,content:m}),!0):!1};return pr(()=>{var d,f;return[t.page,(d=t.pageSize)==null?void 0:d.width,(f=t.pageSize)==null?void 0:f.height]},()=>{Sn(r)}),po(()=>{r()}),Hs(()=>{var d;(d=t.page)==null||d.destroy()}),(d,f)=>{var p,m,y,b,k,S;return Ze(),ut("div",{ref_key:"containerRef",ref:n,class:"whiteboard-page","data-page-index":e.page.pageIndex,onDragover:f[0]||(f[0]=Gr(()=>{},["prevent"])),onDrop:Gr(i,["prevent"]),style:Ai({width:(((p=e.pageSize)==null?void 0:p.width)??((m=e.page.size)==null?void 0:m.width))+"px",height:(((y=e.pageSize)==null?void 0:y.height)??((b=e.page.size)==null?void 0:b.height))+"px",transform:`translate(${((k=e.pageOffset)==null?void 0:k.left)??0}px, ${((S=e.pageOffset)==null?void 0:S.top)??0}px)`})},null,44,bde)}}},[["__scopeId","data-v-c876c9b5"]]),xde=li({__name:"WhiteboardLayer",props:{whiteboard:{type:Object,required:!0},pages:{type:Array,default:()=>[]},pageSizes:{type:Object,default:()=>({})},pageOffsets:{type:Object,default:()=>({})},enabled:{type:Boolean,default:!0},interactive:{type:Boolean,default:null},opacity:{type:Number,default:1}},setup(e){const t=e,n=dt(()=>t.interactive==null?t.enabled:t.interactive);return(r,i)=>(Ze(),ut("div",{class:"whiteboard-layer","aria-hidden":"true",style:Ai({opacity:e.opacity,pointerEvents:n.value?"auto":"none"})},[(Ze(!0),ut(Dr,null,ki(e.pages,o=>{var s,l;return Ze(),ei(wde,{key:o.pageIndex,page:o,"page-size":(s=e.pageSizes)==null?void 0:s[o.pageIndex],"page-offset":(l=e.pageOffsets)==null?void 0:l[o.pageIndex],whiteboard:e.whiteboard,enabled:e.enabled},null,8,["page","page-size","page-offset","whiteboard","enabled"])}),128))],4))}},[["__scopeId","data-v-54546c3d"]]),kde={class:"superdoc-html-viewer"},_de={class:"superdoc-html-viewer__document"},Cde=["innerHTML"],Sde=li({__name:"HtmlViewer",props:{fileSource:{type:[File,Blob],required:!0},documentId:{type:String,required:!0}},emits:["ready","selection-change"],setup(e,{emit:t}){const n=e,r=Ne(""),i=t,o=()=>{const u=window.getSelection();console.debug("selection from html viewer",u),i("selection-change",u)},s=u=>new Promise((d,f)=>{const p=new FileReader;p.onload=m=>{const y=m.target.result;d(y)},p.onerror=m=>f(m),p.readAsText(u)}),l=async()=>{try{const u=await s(n.fileSource);r.value=u,i("ready",n.documentId)}catch(u){i("error",u),console.error("Error loading document",u)}};return po(()=>{l()}),(u,d)=>(Ze(),ut("div",kde,[et("div",_de,[et("div",{class:"superdoc-html-viewer__content",innerHTML:r.value,onMouseup:o},null,40,Cde)])]))}},[["__scopeId","data-v-da3494ba"]]),Ede=(e,t,n=()=>!0)=>{const r=new Set(t.map(String)),i=new Set;e.forEach(s=>{if(!n(s))return;const l=s.commentId!=null?String(s.commentId):null,u=s.importedId!=null?String(s.importedId):null;!(l&&r.has(l))&&!(u&&r.has(u))||(l&&i.add(l),u&&i.add(u))});let o=!0;for(;o;)o=!1,e.forEach(s=>{if(!n(s))return;const l=s.commentId!=null?String(s.commentId):null,u=s.importedId!=null?String(s.importedId):null,d=s.parentCommentId!=null?String(s.parentCommentId):null,f=vC(s),p=f!=null?String(f):null,m=l&&i.has(l)||u&&i.has(u),y=d&&i.has(d)||p&&i.has(p
534);if(!m&&!y)return;const b=i.size;l&&i.add(l),u&&i.add(u),i.size>b&&(o=!0)});return i},DO=Ne(!1);function cu(){return{isHighContrastMode:DO,setHighContrastMode:t=>{DO.value=t}}}var TE=new Set(["auto","sidebar","inline"]),Ade=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),O3=(...e)=>e.find(t=>t!==void 0),LO=e=>{if(typeof e=="string")return e.trim()||void 0;if(typeof HTMLElement<"u"&&e instanceof HTMLElement)return e};function Tde(e){const t=e;return typeof(t==null?void 0:t.closest)=="function"&&t.closest(".track-change-focused")!=null}function Pj(e){if(!e||e===!1||typeof e!="object")return e;const t={...e},n=Ade(e.responsive)?e.responsive:{},r=O3(e.layout,e.displayMode),i=LO(O3(n.target,e.compactMeasurementSelector)),o=O3(n.breakpoint,e.compactBreakpointPx),s=e.displayMode;TE.has(s)||delete t.displayMode;const l=LO(e.compactMeasurementSelector);l===void 0?delete t.compactMeasurementSelector:t.compactMeasurementSelector=l;const u=e.compactBreakpointPx;typeof u=="number"&&Number.isFinite(u)&&u>=0||delete t.compactBreakpointPx,delete t.layout,delete t.responsive,TE.has(r)&&(t.layout=r);const d={};return i!==void 0&&(d.target=i),typeof o=="number"&&Number.isFinite(o)&&o>=0&&(d.breakpoint=o),Object.keys(d).length>0&&(t.responsive=d),t}var PO=".superdoc__document",Ide=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0,Rde=e=>e+320+24;function Ode({commentsModuleConfig:e,superdocRoot:t,layers:n}){const r=Ne(0),i=Ne(!1);let o=null,s=null,l=null,u=[];const d=S=>{var C,I;if(!(S instanceof HTMLElement)||((C=typeof window<"u"?window.getComputedStyle(S):null)==null?void 0:C.display)==="contents")return!1;const x=Number(S.clientWidth??0),T=Number(((I=S.getBoundingClientRect)==null?void 0:I.call(S).width)??0);return Number.isFinite(x)&&x>0||Number.isFinite(T)&&T>0},f=()=>{var C,I;const S=t.value,x=(I=(C=e.value)==null?void 0:C.responsive)==null?void 0:I.target;if(d(x))return x;if(typeof x=="string"&&x.trim().length>0&&typeof document<"u"){let D=null;try{D=document.querySelector(x.trim())}catch{D=null}if(d(D))return D}let T=(S==null?void 0:S.parentElement)??null;for(;T;){if(d(T))return T;T=T.parentElement}return d(S)||S instanceof HTMLElement?S:null},p=()=>{const S=typeof window<"u"?window.ResizeObserver:void 0;if(typeof S>"u")return;const x=f();x!==s&&(o&&(o.disconnect(),o=null),s=x,s&&(o=new S(()=>{k()}),o.observe(s)))},m=()=>{var T;p();const S=Number((s==null?void 0:s.clientWidth)??0);if(Number.isFinite(S)&&S>0)return S;const x=Number(((T=s==null?void 0:s.getBoundingClientRect)==null?void 0:T.call(s).width)??0);return Number.isFinite(x)&&x>0?x:0},y=()=>{var C,I;const S=typeof window<"u"?window.ResizeObserver:void 0;if(typeof S>"u")return;const x=((I=(C=t.value)==null?void 0:C.querySelector)==null?void 0:I.call(C,PO))??null,T=[n.value,x].filter((D,P,V)=>D instanceof HTMLElement&&V.indexOf(D)===P);T.length===u.length&&T.every((D,P)=>D===u[P])||(l&&(l.disconnect(),l=null),u=T,T.length&&(l=new S(()=>{k()}),T.forEach(D=>l.observe(D))))},b=()=>{var I,D,P,V;y();const S=(D=(I=t.value)==null?void 0:I.querySelector)==null?void 0:D.call(I,PO),x=n.value,T=Number((S==null?void 0:S.clientWidth)??((P=S==null?void 0:S.getBoundingClientRect)==null?void 0:P.call(S).width)??0);if(Number.isFinite(T)&&T>0)return T;const C=Number((x==null?void 0:x.clientWidth)??((V=x==null?void 0:x.getBoundingClientRect)==null?void 0:V.call(x).width)??0);return Number.isFinite(C)&&C>0?C:816},k=()=>{var D;const S=m(),x=e.value,T=(x==null?void 0:x.layout)??"sidebar";if(T==="sidebar"){r.value=S,i.value=!1;return}if(T==="inline"){r.value=S,i.value=!0;return}if(!(Number.isFinite(S)&&S>0))return;r.value=S;const C=(D=x==null?void 0:x.responsive)==null?void 0:D.breakpoint;if(Ide(C)){i.value=S<C;return}const I=Rde(b());i.value=S<I};return Hs(()=>{o&&(o.disconnect(),o=null),s=null,l&&(l.disconnect(),l=null),u=[]}),{superdocContainerWidth:r,isCompactCommentsMode:i,recalculateCompactCommentsMode:k,ensureCompactMeasurementObserver:p}}var BO=320,hp=12,Nde=220,Mde=16,Dde=500,jO=".superdoc-comment-highlight[data-comment-ids]",FO="data-comment-ids",Lde=".sd-comment-anchor",N3=(e,t,n)=>Math.min(Math.max(e,t),n),Ld=e=>Number(e),Pu=e=>Number.isFinite(e),sT=e=>(e==null?void 0:e.commentId)??(e==null?void 0:e.importedId)??null,zO=e=>String(e||"").split(",").map(t=>
534t.trim()).filter(Boolean),Pde=e=>{var s;const t=e==null?void 0:e.value;if(!t)return null;const n=Ld(t.ts);if(!Pu(n)||Date.now()-n>Dde)return null;const r=Ld(t.x),i=Ld((s=t.anchorRect)==null?void 0:s.bottom),o=Pu(i)?i:Ld(t.y);return!Pu(r)||!Pu(o)?null:{x:r,y:o}},Bde=({rootEl:e,comment:t,pendingComment:n})=>{var l;if(n!=null&&n.value&&(t==null?void 0:t.commentId)===((l=n.value)==null?void 0:l.commentId)){const u=e.querySelectorAll(jO);for(const d of u)if(zO(d.getAttribute(FO)).includes("pending")&&typeof d.getBoundingClientRect=="function")return d.getBoundingClientRect()}const r=sT(t);if(!r)return null;const i=String(r),o=e.querySelectorAll(jO);for(const u of o)if(zO(u.getAttribute(FO)).includes(i)&&typeof u.getBoundingClientRect=="function")return u.getBoundingClientRect();const s=e.querySelector(`[data-track-change-id="${i}"]`);return s&&typeof s.getBoundingClientRect=="function"?s.getBoundingClientRect():null},jde=(e,t)=>{var i,o;const{entry:n}=e(sT(t)),r=Ld((i=n==null?void 0:n.bounds)==null?void 0:i.bottom);return Pu(r)?r:Ld((o=n==null?void 0:n.bounds)==null?void 0:o.top)},Fde=({selectionPosition:e,comment:t,pendingComment:n})=>{var r,i,o,s;return((r=e.value)==null?void 0:r.source)==="pdf"||((i=t==null?void 0:t.selection)==null?void 0:i.source)==="pdf"||((s=(o=n.value)==null?void 0:o.selection)==null?void 0:s.source)==="pdf"},zde=({rootEl:e,layersRect:t,comment:n})=>{const r=sT(n);if(r==null)return NaN;const i=e.querySelector(`${Lde}[data-id="${String(r)}"]`);return!i||typeof i.getBoundingClientRect!="function"?NaN:Ld(i.getBoundingClientRect().bottom)-Ld(t.top)},Ude=({comment:e,pendingComment:t,selectionPosition:n,activeZoom:r})=>{var s,l,u,d,f;if(!t.value||(e==null?void 0:e.commentId)!==((s=t.value)==null?void 0:s.commentId))return NaN;const i=Ld((l=n.value)==null?void 0:l.bottom);if(Pu(i))return i*(((u=n.value)==null?void 0:u.source)==="pdf"?(r.value??100)/100:1);const o=Ld((d=n.value)==null?void 0:d.top);return Pu(o)?o*(((f=n.value)==null?void 0:f.source)==="pdf"?(r.value??100)/100:1):NaN},Vde=({top:e,left:t})=>({top:`${Math.round(e)}px`,left:`${Math.round(t)}px`,right:"auto"}),Hde=({rootRect:e,layersRect:t,anchorBottom:n,anchorClientX:r=NaN})=>{const i=N3(t.top-e.top+n+Mde,hp,Math.max(hp,e.height-Nde)),o=Math.max(hp,e.width-BO-hp);let s;if(Pu(r))s=N3(r-e.left+hp,hp,o);else{const l=e.width-(t.left-e.left+t.width)+hp;s=N3(e.width-l-BO,hp,o)}return{top:i,left:s}};function $de({activeComment:e,pendingComment:t,activeCompactComment:n,showCommentsSidebar:r,selectionPosition:i,activeZoom:o,superdocRoot:s,layers:l,documents:u,resolveCommentPositionEntry:d,clearActiveComment:f,clearPendingComment:p}){const m={top:"12px",right:"12px"},y=Ne(0),b=Ne({x:null,y:null,ts:0,anchorRect:null});let k=null,S=null;const x=()=>{b.value={x:null,y:null,ts:0,anchorRect:null}},T=(P,V,ee)=>{var H;if(!((H=u.value)!=null&&H.some(te=>te.type==="application/pdf")))return!1;const F=P.querySelector(".superdoc__compact-comment-popover");return!n.value||!F||F.contains(V)||ee?!1:(t.value&&p(),f(),x(),!0)},C=P=>{var H,te,M;const V=s.value;if(!V||!((H=l.value)!=null&&H.contains(P.target)))return;const ee=((te=(typeof document.elementsFromPoint=="function"?document.elementsFromPoint(P.clientX,P.clientY):[]).find(Z=>(Z==null?void 0:Z.nodeType)===1&&V.contains(Z)&&Z.closest("[data-track-change-id], .superdoc-comment-highlight, .sd-comment-anchor")))==null?void 0:te.closest("[data-track-change-id], .superdoc-comment-highlight, .sd-comment-anchor"))??(((M=P.target)==null?void 0:M.nodeType)===1?P.target.closest("[data-track-change-id], .superdoc-comment-highlight, .sd-comment-anchor"):null);if(T(V,P.target,ee)||P.button!==0||P.pointerType!=="mouse")return;const F=ee&&typeof ee.getBoundingClientRect=="function"?ee.getBoundingClientRect():null;F&&(b.value={x:P.clientX,y:F.bottom,ts:Date.now(),anchorRect:{left:F.left,right:F.right,top:F.top,bottom:F.bottom}})},I=dt(()=>{y.value;const P=n.value;if(!P)return m;const V=s.value,ee=l.value;if(!V||!ee)return m;const F=V.getBoundingClientRect(),H=ee.getBoundingClientRect(),te=Pde(b),M=te?null:Bde({rootEl:V,comment:P,pendingComment:t});let Z=NaN,L=NaN;return te?(Z=te.y-H.top,L=te.x):M?(Z=M.bottom-H.top,L=M.left):Z=jde(d,P),!Pu(Z)&&Fde({selectionPosition:i,comment:P,pendingComment:t})&&(Z=zde({rootEl:V,layersRect:H,comment:P})),Pu(Z)||(Z=Ude({comment:P,pendingComment:t,selectionPosition:i,activeZoom:o})),Pu(Z)?Vde(Hde({rootRect:F,layersRect:H,anchorBottom:Z,anchorClientX:L})):m});return pr([e,t,i,o,r,b],()=>{const P=typeof window<"u"?window.requestAnimationFrame:null,V=typeof window<"u"?window.cancelAnimationFrame:null;k!=null&&(V==null||V(k)),P&&(k=P(()=>{y.value+=1,k=null}))},{deep:!1}),pr(n,(P,V)=>{if(!V&&P){const ee=document.activeElement;ee instanceof HTMLElement&&(S=ee)}},{deep:!1}),pr(t,(P,V)=>{!V&&P&&x()}),po(()=>{document.addEventListener("pointerdown",C,!0)}),Hs(()=>{document.removeEventListener("pointerdown",C,!0);const P=typeof window<"u"?window.cancelAnimationFrame:null;k!=null&&(P==null||P(k),k=null),S=null}),{compactCommentPopoverStyle:I,closeCompactCommentPopover:()=>{n.value&&(t.value&&p(),f(),S&&typeof S.focus=="function"&&S.focus(),S=null)},resetClickAnchor:x}}function bl(...e){const t={};for(const n of e)if(!(typeof n!="object"||n===null))for(const[r,i]of Object.entries(n))i!==void 0&&(t[r]=i);return t}function qp(...e){for(const t of e)if(t!==void 0)return t}function Gde(e,t){const n=bl(e,t),r=bl(e==null?void 0:e.responsive,t==null?void 0:t.responsive);return Object.keys(r).length>0?n.responsive=r:delete n.responsive,n}var M3=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Jw(e={}){var f,p;const t=M3(e.hyperlinks)?e.hyperlinks:{},n=typeof t.onActivate=="function",r=M3(e.ui)?e.ui:{},i=M3(r.linkPopover)?r.linkPopover:{},o=e.hyperlinks===!1,s=e.ui===!1||r.linkPopover===!1,l=[{value:t.onActivate,source:"hyperlinks.onActivate"},{value:i.popoverResolver,source:"compatibility"},{value:(p=(f=e.modules)==null?void 0:f.links)==null?void 0:p.popoverResolver,source:"compatibility"}].find(({value:m})=>m!==void 0),u=o||!n&&s,d=!u&&typeof(l==null?void 0:l.value)=="function"?l.value:void 0;return{handler:d,handlerSource:d?l.source:void 0,editableActivationDisabled:u,builtInEditorDisabled:s,interceptsNavigationOnly:o||n}}function qde(e,t){if(!e||typeof e.entityId!="string"||e.entityType!=="comment"&&e.entityType!=="trackedChange")return null;const n=typeof t=="function"?t(e.entityId):null;if(e.entityType==="comment"&&(n!=null&&n.trackedChange))return e.entityId;const r=(n==null?void 0:n.commentId)??(n==null?void 0:n.importedId)??e.entityId;return r!=null?String(r):null}var Wde=new Set(["shell","receipt"]),UO=/^[a-zA-Z][a-zA-Z0-9_-]{0,127}$/,Kde=/^[a-z][a-z0-9-]*(?::[a-z][a-z0-9-]*)?$/;function Bj(e){var n;if(!e||typeof e!="object")return{};const t=e.reason??(e.failureSource==="receipt"?(n=e.failure)==null?void 0:n.code:void 0);return{...Wde.has(e.failureSource)?{failureSource:e.failureSource}:{},...typeof t=="string"&&UO.test(t)?{reason:t}:{},...typeof e.inputKind=="string"&&UO.test(e.inputKind)?{inputKind:e.inputKind}:{},...typeof e.editableCommandKind=="string"&&e.editableCommandKind.length<=128&&Kde.test(e.editableCommandKind)?{editableCommandKind:e.editableCommandKind}:{}}}function jj(e){const t=new Map,n=r=>typeof r=="string"&&r.length>0?r:"__default__";
534return{shouldNotify(r,i){if(!e(i))return!1;const o=n(r);let s=t.get(o);return s||(s=new WeakSet,t.set(o,s)),s.has(i)?!1:(s.add(i),!0)},clear(r){t.delete(n(r))}}}var Yde="no-author-configured",Xde="author-required",Zde="This edit needs an author identity. Set `user.name` in your SuperDoc configuration and reopen the document to make tracked or revision-overlapping edits.";function VO(e){return typeof e=="string"&&e.includes(Yde)}function Fj(e){if(!e||e.type!=="mutation:rejected")return!1;if(e.failureSource==="receipt"){const t=e.failure;return t?t.code==="PRECONDITION_FAILED"&&VO(t.message):!1}return e.failureSource==="shell"?e.reason==="author-required"?!0:e.reason==="PRECONDITION_FAILED"&&VO(e.message):!1}function Qde(){return jj(Fj)}function Jde(e,t){return(t==null?void 0:t.schemaVersion)!==1||t.decision!=="accept"&&t.decision!=="reject"?null:{documentId:typeof e=="string"?e:null,decision:t.decision,requestedCount:t.requestedCount,successfulCount:t.appliedCount,permissionDeniedCount:t.deniedCount}}var efe=new Set(["keydown","beforeinput","compositionend","cut","paste","drop","pointerup","programmatic"]),tfe=new Set(["insert-text","replace-text","delete-backward","delete-forward","plain-text-paste","clipboard-paste","image-delete","image-drop","image-paste","image-move","sdt-move","structural:enter-split-paragraph","structural:enter-insert-paragraph-before","structural:enter-insert-paragraph-after","structural:enter-list-outdent","structural:enter-list-exit","structural:shift-enter-line-break","structural:mod-enter-page-break","structural:backspace-boundary-merge-with-previous","structural:delete-boundary-merge-with-next","structural:list-indent","structural:list-outdent","tab:paragraph-insert-tab","tab:list-indent-range","tab:list-outdent-range","tab:table-append-row"]),nfe=new Set(["beforeinput","compositionend","cut","paste","drop"]),rfe=new Set(["shell","receipt"]),ife="edit-rejected",ofe="This edit couldn’t be completed. Adjust the selection and try again.";function sfe(e){return!!(e&&e.type==="mutation:rejected"&&e.origin==="document-surface"&&rfe.has(e.failureSource)&&efe.has(e.inputKind)&&(tfe.has(e.editableCommandKind)||e.editableCommandKind==null&&nfe.has(e.inputKind)))}function afe(e,t){return{error:new Error(ofe,{cause:Bj(t)}),code:ife,editor:null,...typeof e=="string"&&e.length>0?{documentId:e}:{}}}function lfe(){return jj(sfe)}var cfe=e=>!!(e!=null&&e.anchor&&(e!=null&&e.focus)&&(e.anchor.blockId!==e.focus.blockId||e.anchor.blockOffset!==e.focus.blockOffset)),ufe=(e,t)=>{if(!e||e.rangeCount<1||e.isCollapsed||!t)return!1;const n=e.getRangeAt(0);return!t.contains(n.startContainer)&&!t.contains(n.endContainer)},dfe=(e,t)=>e!=="editing"&&e!=="suggesting"?!1:cfe(t),ffe=["DOCX_PASSWORD_REQUIRED","DOCX_PASSWORD_INVALID"],hfe=3e4,qc={title:"Password Required",invalidTitle:"Incorrect Password",description:"This document is password protected. Enter the password to open it.",placeholder:"Enter password",inputAriaLabel:"Document password",submitLabel:"Open",cancelLabel:"Cancel",busyLabel:"Decrypting…",invalidMessage:"Incorrect password. Please try again.",timeoutMessage:"Timed out while decrypting. Please try again.",genericErrorMessage:"Unable to decrypt this document."};function pfe({getSurfaceManager:e,getPasswordPromptConfig:t,onUnhandled:n}){const r=[],i=Zs(null),o=new Map;let s=!1;function l(b,k,S){var C;if(!b||!ffe.includes(k)||t()===!1||!e())return!1;const x=o.get(b.id);if(x)return clearTimeout(x.timer),x.resolve({success:!1,errorCode:k}
534),o.delete(b.id),!0;const T=r.find(I=>I.doc.id===b.id);return T?(T.errorCode=k,T.originalException=S,!0):(((C=i.value)==null?void 0:C.doc.id)===b.id||(r.push({doc:b,errorCode:k,originalException:S}),f()),!0)}function u(b){if(!b)return;const k=o.get(b.id);k&&(clearTimeout(k.timer),k.resolve({success:!0}),o.delete(b.id))}function d(){s=!0;for(const[,b]of o)clearTimeout(b.timer),b.resolve({success:!1,errorCode:"destroyed"});o.clear(),r.length=0,i.value=null}function f(){if(s||i.value||r.length===0)return;const b=r.shift();b&&p(b).catch(k=>{i.value=null,console.error("[SuperDoc] Password prompt error:",k),n==null||n(b.doc,b.errorCode,b.originalException),f()})}async function p({doc:b,errorCode:k,originalException:S}){const x=e();if(!x||s)return;const T=m(),C=V=>(b.password=V,b.editorMountNonce++,new Promise(ee=>{const F=setTimeout(()=>{o.delete(b.id),ee({success:!1,errorCode:"timeout"})},hfe);o.set(b.id,{resolve:ee,timer:F})})),I={documentId:b.id,errorCode:k,texts:T.texts,attemptPassword:C},D=y(T,{documentId:b.id,errorCode:k,texts:T.texts});if(D.suppressed){n==null||n(b,k,S),f();return}i.value={doc:b,surfaceHandle:null};let P;if(D.component)P=x.open({mode:"dialog",closeOnBackdrop:!1,ariaLabel:T.texts.title,component:Us(D.component),props:{...D.props,passwordPrompt:I}});else if(D.render){const V=D.render;P=x.open({mode:"dialog",closeOnBackdrop:!1,ariaLabel:T.texts.title,render:ee=>V({container:ee.container,passwordPrompt:I,resolve:ee.resolve,close:ee.close,surfaceId:ee.surfaceId,mode:ee.mode})})}else{const V=(await ag(async()=>{const{default:F}=await import("./PasswordPromptSurface-Ciu8aSmK.es-B6K1wtAj.js");return{default:F}},[])).default,ee=`password-prompt-${b.id}`;P=x.open({id:ee,mode:"dialog",closeOnBackdrop:!1,ariaLabelledBy:`sd-password-prompt-heading-${ee}`,component:Us(V),props:{passwordPrompt:I}})}i.value={doc:b,surfaceHandle:P},await P.result,i.value=null,f()}function m(){const b=t();if(b===!1)return{enabled:!1,texts:qc};const k=typeof b=="object"&&b!==null?b:{};if(k.component!=null&&typeof k.render=="function")throw new Error('modules.surfaces.passwordPrompt cannot provide both "component" and "render". Use one or the other.');return{enabled:!0,texts:{title:k.title??qc.title,invalidTitle:k.invalidTitle??qc.invalidTitle,description:k.description??qc.description,placeholder:k.placeholder??qc.placeholder,inputAriaLabel:k.inputAriaLabel??qc.inputAriaLabel,submitLabel:k.submitLabel??qc.submitLabel,cancelLabel:k.cancelLabel??qc.cancelLabel,busyLabel:k.busyLabel??qc.busyLabel,invalidMessage:k.invalidMessage??qc.invalidMessage,timeoutMessage:k.timeoutMessage??qc.timeoutMessage,genericErrorMessage:k.genericErrorMessage??qc.genericErrorMessage},component:k.component,props:k.props,render:k.render,resolver:k.resolver}}function y(b,k){if(typeof b.resolver=="function"){const S=b.resolver(k);if(S!=null&&S.type!=="default"){if(S.type==="none")return{suppressed:!0};if(S.type==="custom")return{component:S.component,props:S.props};if(S.type==="external")return{render:S.render}}}return b.component!=null?{component:b.component,props:b.props}:typeof b.render=="function"?{render:b.render}:{builtin:!0}}return{handleEncryptionError:l,handleEditorReady:u,destroy:d}}function HO(e,{getCurrentSession:t,applySlice:n,onSettled:r}){return()=>{if(e===t())try{n(e.getSnapshot())}catch{}r()}}var To={findPlaceholder:"Find",findAriaLabel:"Find text",replacePlaceholder:"Replace",replaceAriaLabel:"Replace text",noResultsLabel:"No results",previousMatchLabel:"Previous match (Shift+Enter)",previousMatchAriaLabel:"Previous match",nextMatchLabel:"Next match (Enter)",nextMatchAriaLabel:"Next match",closeLabel:"Close (Escape)",closeAriaLabel:"Close find and replace",replaceLabel:"Replace",replaceAllLabel:"All",toggleReplaceLabel:"Toggle replace",toggleReplaceAriaLabel:"Toggle replace",matchCaseLabel:"Aa",matchCaseAriaLabel:"Match case",regexLabel:".*",regexAriaLabel:"Use regular expression",invalidPatternLabel:"Invalid pattern",ignoreDiacriticsLabel:"ä≡a",ignoreDiacriticsAriaLabel:"Ignore diacritics"};function mfe(e){if(!e)return null;const t=e.extensionStorage,n=e.storage,r=(t==null?void 0:t.Search)??(n==null?void 0:n.Search);if(r!=null&&r.searchIndex||r!=null&&r.searchResults)return r;const i=e.extensionStorage??e.storage;if(i)for(const o of Object.keys(i)){const s=i[o];if(s&&typeof s=="object"&&"searchIndex"in s&&"searchResults"in s)return s}return null}function gfe({getSurfaceManager:e,getActiveEditor:t,activeEditorRef:n,getFindReplaceConfig:r,getSuperDocUI:i}){let o=null,s=null,l=null,u=!1,d=!1;const f=Ne(!1);let p=null;const m=Ne(""),y=Ne(""),b=Ne(!1),k=Ne(!1),S=Ne(!1),x=Ne(!1),T=Ne(0),C=Ne(-1),I=Ne(!0),D=Ne(!0),P=Ne(!1),V=Ne(!0),ee=Ne(!1),F=Ne(null);let H=To;const te=dt(()=>m.value?T.value===0?H.noResultsLabel:`${C.value+1} of ${T.value}
534`:""),M=dt(()=>T.value>0),Z=dt(()=>M.value&&!P.value&&I.value),L=dt(()=>Z.value&&D.value);let W=null,U=null;function q(K){var oe;return typeof((oe=K==null?void 0:K.commands)==null?void 0:oe.setSearchSession)=="function"}function Q(){var K;try{const oe=(K=typeof i=="function"?i():null)==null?void 0:K.search;return oe&&(typeof oe.find=="function"||typeof oe.search=="function")?oe:null}catch{return null}}function re(K){K&&(T.value=typeof K.total=="number"?K.total:0,C.value=typeof K.activeIndex=="number"?K.activeIndex:-1,I.value=K.canReplace===!0,D.value=typeof K.canReplaceAll=="boolean"?K.canReplaceAll:K.canReplace===!0,F.value=K.reason==="search-invalid-pattern"?H.invalidPatternLabel:null)}function ne(){if(l){J();return}if(s){if(!m.value){try{s.commands.clearSearchSession()}catch{}T.value=0,C.value=-1;return}try{const K=s.commands.setSearchSession(m.value,{caseSensitive:b.value,ignoreDiacritics:k.value,highlight:!0,searchModel:Oe().includeDeletedText?"raw":"visible"});T.value=K.matches.length,C.value=K.activeMatchIndex}catch{}}}function J(){const K=l;if(K){if(!m.value){try{K.clear()}catch{}T.value=0,C.value=-1,F.value=null;return}try{const oe={caseSensitive:b.value,regex:S.value},Fe=Oe().includeDeletedText===!0;re(typeof K.find=="function"?K.find(m.value,{...oe,includeTrackedDeletions:Fe}):K.search(m.value,{...oe,includeDeletedText:Fe}))}catch{}}}function ge(){W&&clearTimeout(W),W=setTimeout(ne,150)}pr(m,()=>{f.value&&ge()}),pr(b,()=>{f.value&&ne()}),pr(k,()=>{f.value&&ne()}),pr(S,()=>{f.value&&ne()});let le=!0;function ve(){if(M.value){if(l){try{l.next(),re(l.getSnapshot())}catch{}return}if(s)try{const K=s.commands.nextSearchMatch();C.value=K.activeMatchIndex}catch{}}}function Ee(){if(M.value){if(l){try{l.previous(),re(l.getSnapshot())}catch{}return}if(s)try{const K=s.commands.previousSearchMatch();C.value=K.activeMatchIndex}catch{}}}function st(){if(le&&!P.value&&M.value){if(l){if(!I.value)return;const K=l;P.value=!0;const oe=HO(K,{getCurrentSession:()=>l,applySlice:re,onSettled:()=>{P.value=!1}});let Fe=null;try{Fe=K.replace(y.value)}catch{}Fe&&typeof Fe.then=="function"?Promise.resolve(Fe).then(oe,oe):oe();return}if(s)try{const K=s.commands.replaceSearchMatch(y.value);T.value=K.matches.length,C.value=K.activeMatchIndex}catch{}}}function At(){if(le&&!P.value&&M.value){if(l){if(!I.value||!D.value)return;const K=l;P.value=!0;const oe=HO(K,{getCurrentSession:()=>l,applySlice:re,onSettled:()=>{P.value=!1}});let Fe=null;try{Fe=K.replaceAll(y.value)}catch{}Fe&&typeof Fe.then=="function"?Promise.resolve(Fe).then(oe,oe):oe();return}if(s)try{s.commands.replaceAllSearchMatches(y.value),T.value=0,C.value=-1}catch{}}}function yt(){if(l){try{re(l.getSnapshot())}catch{}return}const K=mfe(s);if(!K)return;const oe=K.searchResults,Fe=Array.isArray(oe)?oe.length:0,Le=K.activeMatchIndex??-1;Fe!==T.value&&(T.value=Fe),Le!==C.value&&(C.value=Le)}function Ge(){Be(),U=setInterval(yt,200)}function Be(){W&&clearTimeout(W),W=null,U&&clearInterval(U),U=null}function he(){m.value="",y.value="",b.value=!1,k.value=!1,S.value=!1,F.value=null,x.value=!1,T.value=0,C.value=-1,I.value=!0,D.value=!0,P.value=!1}function Oe(){const K=typeof r=="function"?r():void 0;if(K===!1||K==null)return{enabled:!1,texts:To,replaceEnabled:!0};if(K===!0)return{enabled:!0,texts:To,replaceEnabled:!0};const oe=typeof K=="object"?K:{};if(oe.component!=null&&typeof oe.render=="function")throw new Error('Search configuration cannot provide both "component" and "render". Use one or the other.');return{enabled:!0,texts:{findPlaceholder:oe.findPlaceholder??To.findPlaceholder,findAriaLabel:oe.findAriaLabel??To.findAriaLabel,replacePlaceholder:oe.replacePlaceholder??To.replacePlaceholder,replaceAriaLabel:oe.replaceAriaLabel??To.replaceAriaLabel,noResultsLabel:oe.noResultsLabel??To.noResultsLabel,previousMatchLabel:oe.previousMatchLabel??To.previousMatchLabel,previousMatchAriaLabel:oe.previousMatchAriaLabel??To.previousMatchAriaLabel,nextMatchLabel:oe.nextMatchLabel??To.nextMatchLabel,nextMatchAriaLabel:oe.nextMatchAriaLabel??To.nextMatchAriaLabel,closeLabel:oe.closeLabel??To.closeLabel,closeAriaLabel:oe.closeAriaLabel??To.closeAriaLabel,replaceLabel:oe.replaceLabel??To.replaceLabel,replaceAllLabel:oe.replaceAllLabel??To.replaceAllLabel,toggleReplaceLabel:oe.toggleReplaceLabel??To.toggleReplaceLabel,toggleReplaceAriaLabel:oe.toggleReplaceAriaLabel??To.toggleReplaceAriaLabel,matchCaseLabel:oe.matchCaseLabel??To.matchCaseLabel,matchCaseAriaLabel:oe.matchCaseAriaLabel??To.matchCaseAriaLabel,regexLabel:oe.regexLabel??To.regexLabel,regexAriaLabel:oe.regexAriaLabel??To.regexAriaLabel,invali
534dPatternLabel:oe.invalidPatternLabel??To.invalidPatternLabel,ignoreDiacriticsLabel:oe.ignoreDiacriticsLabel??To.ignoreDiacriticsLabel,ignoreDiacriticsAriaLabel:oe.ignoreDiacriticsAriaLabel??To.ignoreDiacriticsAriaLabel},replaceEnabled:oe.replaceEnabled??!0,includeDeletedText:oe.includeDeletedText??!1,component:oe.component,props:oe.props,render:oe.render,resolver:oe.resolver,floating:oe.floating&&typeof oe.floating=="object"?oe.floating:void 0}}function ye(K,oe){if(typeof K.resolver=="function"){const Fe=K.resolver(oe);if(Fe!=null&&Fe.type!=="default"){if(Fe.type==="none")return{suppressed:!0};if(Fe.type==="custom")return{component:Fe.component,props:Fe.props};if(Fe.type==="external")return{render:Fe.render}}}return K.component!=null?{component:K.component,props:K.props}:typeof K.render=="function"?{render:K.render}:{builtin:!0}}function B(K,oe){return{findQuery:m,replaceText:y,caseSensitive:b,ignoreDiacritics:k,regex:S,showReplace:x,matchCount:T,activeMatchIndex:C,matchLabel:te,hasMatches:M,canReplace:Z,canReplaceAll:L,replaceCanMutate:I,replacePending:P,ignoreDiacriticsSupported:V,regexSupported:ee,searchError:F,replaceEnabled:K.replaceEnabled??!0,texts:K.texts,goNext:ve,goPrev:Ee,replaceCurrent:st,replaceAll:At,registerFocusFn:Fe=>{p=Fe},close:Fe=>oe(Fe)}}function be(K){return{get findQuery(){return K.findQuery.value},set findQuery(oe){K.findQuery.value=oe},get replaceText(){return K.replaceText.value},set replaceText(oe){K.replaceText.value=oe},get caseSensitive(){return K.caseSensitive.value},set caseSensitive(oe){K.caseSensitive.value=oe},get ignoreDiacritics(){return K.ignoreDiacritics.value},set ignoreDiacritics(oe){K.ignoreDiacritics.value=oe},get regex(){return K.regex.value},set regex(oe){K.regex.value=oe},get regexSupported(){return K.regexSupported.value},get searchError(){return K.searchError.value},get replaceCanMutate(){return K.replaceCanMutate.value},get showReplace(){return K.showReplace.value},set showReplace(oe){K.showReplace.value=oe},get matchCount(){return K.matchCount.value},get activeMatchIndex(){return K.activeMatchIndex.value},get matchLabel(){return K.matchLabel.value},get hasMatches(){return K.hasMatches.value},get canReplace(){return K.canReplace.value},get canReplaceAll(){return K.canReplaceAll?K.canReplaceAll.value:K.canReplace.value},get replacePending(){return K.replacePending.value},get ignoreDiacriticsSupported(){return K.ignoreDiacriticsSupported.value},replaceEnabled:K.replaceEnabled,texts:K.texts,goNext:K.goNext,goPrev:K.goPrev,replaceCurrent:K.replaceCurrent,replaceAll:K.replaceAll,registerFocusFn:K.registerFocusFn,close:K.close}}function ie(K){var oe;if(K){if(typeof((oe=K==null?void 0:K.commands)==null?void 0:oe.clearSearchSession)=="function"){try{K.commands.clearSearchSession()}catch{}return}if(l&&K===s)try{l.clear()}catch{}}}function fe(){var K;try{if(u||!e()||!t())return!1;if(o&&f.value)return!0;const oe=Oe();if(!oe.enabled||ye(oe,{texts:oe.texts,replaceEnabled:oe.replaceEnabled??!0}).suppressed)return!1;if(!q(t())){const Fe=Q();if(!Fe)return!1;try{if(((K=Fe.getSnapshot)==null?void 0:K.call(Fe).available)!==!0)return!1}catch{return!1}}return!0}catch{return!1}}async function ue(){if(u)return;const K=e();if(K){if(o&&f.value){p==null||p();return}if(!d){d=!0;try{const oe=t();if(!oe){d=!1;return}const Fe=Oe();if(!Fe.enabled){d=!1;return}const Le=ye(Fe,{texts:Fe.texts,replaceEnabled:Fe.replaceEnabled??!0});if(Le.suppressed){d=!1;return}he(),H=Fe.texts,le=Fe.replaceEnabled??!0;const tt={placement:"top-right",autoFocus:!0,width:420,...Fe.floating};if(s&&s!==oe&&ie(s),s=oe,l=q(oe)?null:Q(),V.value=!l,ee.value=!!l,l)try{re(l.getSnapshot())}catch{}p=null;let De=()=>{};const Pe=B(Fe,de=>De(de));let mt;if(Le.component)mt=K.open({mode:"floating",ariaLabel:Fe.texts.findAriaLabel,closeOnEscape:!0,floating:tt,component:Us(Le.component),props:{...Le.props,findReplace:Pe}});else if(Le.render){const de=Le.render;mt=K.open({mode:"floating",ariaLabel:Fe.texts.findAriaLabel,closeOnEscape:!0,floating:tt,render:z=>de({container:z.container,findReplace:be(Pe),resolve:z.resolve,close:z.close,surfaceId:z.surfaceId,mode:z.mode})})}else{let de;try{de=(await ag(async()=>{const{default:Y}=await import("./FindReplaceSurface-B5dzB2sG.es-BD7ACN6N.js");return{default:Y}},[])).default}catch{d=!1;return}if(u||o&&f.value){d=!1;return}const z=t()||oe;s!==z&&(ie(s),s=z,l=q(z)?null:Q(),V.value=!l),mt=K.open({mode:"floating",ariaLabel:Fe.texts.findAriaLabel,component:Us(de),closeOnEscape:!0,floating:tt,props:{findReplace:Pe}})}De=de=>mt.close(de??"programmatic"),o=mt,f.value=!0,d=!1,Ge();const xt=mt.id;mt.result.then(()=>{(o==null?void 0:o.id)===xt?(Be(),ie(s),o=null,f.value=!1,p=null):ie(oe!==s?oe:null)})}catch(oe){throw d=!1,oe}}}}function Ce(){o&&o.close("programmatic")}n&&pr(n,(K,oe)=>{!f.value||!o||K!==oe&&(ie(oe),Ce())});function Ue(){u=!0,Be(),Ce(),s=null,l=null,p=null}return{open:ue,close:Ce,isOpen:f,wouldOpen:fe,destroy:Ue}}var W1=null;function D3(e){e!=null&&(W1=e)}function yfe(e){W1===e&&(W1=null)}function vfe(e){return W1===null||W1===e}function bfe(e,{focusInside:t,owner:n}){if(e.defaultPrevented)return!1;if(t)return!0;const r=document.activeElement;return(!r||r===document.body||r===document.documentElement)&&vfe(n)}var wfe=/^(https?|mailto|tel):/i,xfe=/^(javascript|data|vbscript):/i,kfe=/^[a-z][a-z0-9+.-]*:/i;function _fe(e){if(typeof e!="string")return null;const t=e.trim();return t?t.startsWith("#")?{href:t}:xfe.test(t)?null:kfe.test(t)?wfe.test(t)?{href:t}:null:{href:t}:null}var Cfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
534<path d="M0 64C0 46.3 14.3 32 32 32l48 0 16 0 128 0c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128L96 480l-16 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-160L48 96 32 96C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64L112 96l0 128 112 0zM112 288l0 128 144 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0-112 0z"/></svg>',Sfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-58.7 0L160 416l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l58.7 0L224 96l-64 0c-17.7 0-32-14.3-32-32z"/></svg>',Efe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M16 64c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 53 43 96 96 96s96-43 96-96l0-128-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 88.4-71.6 160-160 160s-160-71.6-160-160L64 96 48 96C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32z"/></svg>',$O='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M40 48C26.7 48 16 58.7 16 72l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24L40 48zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM16 232l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24zM40 368c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0z"/></svg>',Afe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. (bullet shapes modified)--><path fill-rule="evenodd" d="M192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM64 48 A48 48 0 1 0 64 144 A48 48 0 1 0 64 48 Z M64 68 A28 28 0 1 1 64 124 A28 28 0 1 1 64 68 Z M64 208 A48 48 0 1 0 64 304 A48 48 0 1 0 64 208 Z M64 228 A28 28 0 1 1 64 284 A28 28 0 1 1 64 228 Z M64 368 A48 48 0 1 0 64 464 A48 48 0 1 0 64 368 Z M64 388 A28 28 0 1 1 64 444 A28 28 0 1 1 64 388 Z"/></svg>
535`,Tfe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. (bullet shapes modified)--><path d="M192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM16 48 L112 48 L112 144 L16 144 Z M16 208 L112 208 L112 304 L16 304 Z M16 368 L112 368 L112 464 L16 464 Z"/></svg>
536`,Ife='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"/></svg>',Rfe=`<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
537<g clip-path="url(#clip0_0_1)">
538<path d="M260 54C242.3 54 228 68.3 228 86C228 103.7 242.3 118 260 118H480C497.7 118 512 103.7 512 86C512 68.3 497.7 54 480 54H260ZM260 224C242.3 224 228 238.3 228 256C228 273.7 242.3 288 260 288H480C497.7 288 512 273.7 512 256C512 238.3 497.7 224 480 224H260ZM260 394C242.3 394 228 408.3 228 426C228 443.7 242.3 458 260 458H480C497.7 458 512 443.7 512 426C512 408.3 497.7 394 48
5380 394H260Z" fill="currentColor"/>
539<path d="M131.823 9.18182V111H110.296V29.6151H109.7L86.3828 44.2315V25.1406L111.589 9.18182H131.823ZM163.132 112.293C159.85 112.293 157.033 111.133 154.68 108.812C152.36 106.459 151.2 103.642 151.2 100.361C151.2 97.1127 152.36 94.3286 154.68 92.0085C157.033 89.6884 159.85 88.5284 163.132 88.5284C166.314 88.5284 169.098 89.6884 171.484 92.0085C173.87 94.3286 175.064 97.1127 175.064 100.361C175.064 102.548 174.5 104.554 173.373 106.376C172.279 108.166 170.838 109.608 169.048 110.702C167.258 111.762 165.286 112.293 163.132 112.293Z" fill="currentColor"/>
540<path d="M62.37 284V268.489L98.6129 234.93C101.695 231.947 104.281 229.263 106.369 226.876C108.49 224.49 110.097 222.153 111.191 219.866C112.285 217.546 112.832 215.044 112.832 212.359C112.832 209.376 112.152 206.808 110.793 204.653C109.434 202.466 107.578 200.792 105.225 199.632C102.872 198.439 100.204 197.842 97.2209 197.842C94.1054 197.842 91.3875 198.472 89.0675 199.732C86.7474 200.991 84.9576 202.797 83.6982 205.151C82.4387 207.504 81.8089 210.304 81.8089 213.553H61.3757C61.3757 206.891 62.8838 201.107 65.8999 196.202C68.916 191.296 73.1418 187.501 78.5774 184.817C84.013 182.132 90.2772 180.79 97.37 180.79C104.662 180.79 111.009 182.082 116.411 184.668C121.847 187.22 126.073 190.766 129.089 195.307C132.105 199.848 133.613 205.051 133.613 210.918C133.613 214.762 132.851 218.557 131.326 222.303C129.835 226.048 127.166 230.207 123.322 234.781C119.477 239.322 114.058 244.774 107.065 251.138L92.1996 265.705V266.401H134.955V284H62.37ZM163.132 285.293C159.85 285.293 157.033 284.133 154.68 281.812C152.36 279.459 151.2 276.642 151.2 273.361C151.2 270.113 152.36 267.329 154.68 265.009C157.033 262.688 159.85 261.528 163.132 261.528C166.314 261.528 169.098 262.688 171.484 265.009C173.87 267.329 175.064 270.113 175.064 273.361C175.064 275.548 174.5 277.554 173.373 279.376C172.279 281.166 170.838 282.608 169.048 283.702C167.258 284.762 165.286 285.293 163.132 285.293Z" fill="currentColor"/>
541<path d="M98.7745 451.392C91.3503 451.392 84.738 450.116 78.9379 447.564C73.1708 444.979 68.6135 441.432 65.266 436.925C61.9516 432.384 60.2447 427.147 60.1452 421.214H81.8214C81.954 423.7 82.766 425.888 84.2575 427.777C85.7821 429.633 87.8039 431.075 90.3228 432.102C92.8417 433.13 95.6755 433.643 98.8242 433.643C102.105 433.643 105.006 433.063 107.525 431.903C110.043 430.743 112.016 429.136 113.441 427.081C114.866 425.026 115.578 422.656 115.578 419.972C115.578 417.254 114.816 414.851 113.292 412.763C111.8 410.642 109.646 408.984 106.828 407.791C104.044 406.598 100.73 406.001 96.8853 406.001H87.3896V390.192H96.8853C100.133 390.192 103 389.628 105.486 388.501C108.005 387.375 109.961 385.817 111.353 383.828C112.745 381.806 113.441 379.453 113.441 376.768C113.441 374.216 112.828 371.979 111.601 370.057C110.408 368.101 108.718 366.577 106.53 365.483C104.376 364.389 101.857 363.842 98.9734 363.842C96.0567 363.842 93.3886 364.373 90.9691 365.433C88.5496 366.461 86.6107 367.936 85.1523 369.858C83.694 371.78 82.9151 374.034 82.8157 376.619H62.1836C62.283 370.753 63.9568 365.582 67.2049 361.108C70.453 356.634 74.828 353.137 80.3299 350.618C85.8649 348.066 92.1126 346.79 99.0728 346.79C106.099 346.79 112.248 348.066 117.517 350.618C122.787 353.17 126.881 356.617 129.797 360.959C132.747 365.268 134.205 370.107 134.172 375.476C134.205 381.177 132.432 385.933 128.853 389.744C125.306 393.556 120.683 395.975 114.982 397.003V397.798C122.472 398.759 128.173 401.361 132.084 405.604C136.028 409.813 137.984 415.083 137.951 421.413C137.984 427.214 136.31 432.367 132.929 436.875C129.582 441.383 124.958 444.929 119.059 447.514C113.159 450.099 106.398 451.392 98.7745 451.392ZM163.132 451.293C159.85 451.293 157.033 450.133 154.68 447.812C152.36 445.459 151.2 442.642 151.2 439.361C151.2 436.113 152.36 433.329 154.68 431.009C157.033 428.688 159.85 427.528 163.132 427.528C166.314 427.528 169.098 428.688 171.484 431.009C173.87 433.329 175.064 436.113 175.064 439.361C175.064 441.548 174.5 443.554 173.373 445.376C172.279 447.166 170.838 448.608 169.048 449.702C167.258 450.762 165.286 451.293 163.132 451.293Z" fill="currentColor"/>
542</g>
543<defs>
544<clipPath id="clip0_0_1">
545<rect width="512" height="512" fill="white"/>
546</clipPath>
547</defs>
548</svg>
549`,Ofe=`<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
550<g clip-path="url(#clip0_1_12)">
551<path d="M260 54C242.3 54 228 68.3 228 86C228 103.7 242.3 118 260 118H480C497.7 118 512 103.7 512 86C512 68.3 497.7 54 480 54H260ZM260 224C242.3 224 228 238.3 228 256C228 273.7 242.3 288 260 288H480C497.7 288 512 273.7 512 256C512 238.3 497.7 224 480 224H260ZM260 394C242.3 394 228 408.3 228 426C228 443.7 242.3 458 260 458H480C497.7 458 512 443.7 512 426C512 408.3 497.7 394 48
5510 394H260Z" fill="currentColor"/>
552<path d="M119.768 25.1818V127H98.2415V45.6151H97.6449L74.3281 60.2315V41.1406L99.5341 25.1818H119.768ZM179.863 76.0909C179.863 88.4536 178.205 99.822 174.891 110.196C171.61 120.57 166.572 130.182 159.777 139.031H139.543C142.128 135.75 144.531 131.74 146.752 127C148.972 122.26 150.911 117.09 152.569 111.489C154.226 105.854 155.518 100.021 156.446 93.9886C157.374 87.9564 157.838 81.9905 157.838 76.0909C157.838 68.2358 157.026 60.3144 155.402 52.3267C153.811 44.3059 151.624 36.8816 148.84 30.054C146.089 23.1932 142.99 17.5753 139.543 13.2003H159.777C166.572 22.0497 171.61 31.6615 174.891 42.0355C178.205 52.4096 179.863 63.7614 179.863 76.0909Z" fill="currentColor"/>
553<path d="M55.7841 300V284.489L92.027 250.93C95.1094 247.947 97.6946 245.263 99.7827 242.876C101.904 240.49 103.511 238.153 104.605 235.866C105.699 233.546 106.246 231.044 106.246 228.359C106.246 225.376 105.566 222.808 104.207 220.653C102.848 218.466 100.992 216.792 98.6392 215.632C96.286 214.439 93.6179 213.842 90.6349 213.842C87.5194 213.842 84.8016 214.472 82.4815 215.732C80.1615 216.991 78.3717 218.797 77.1122 221.151C75.8527 223.504 75.223 226.304 75.223 229.553H54.7898C54.7898 222.891 56.2978 217.107 59.3139 212.202C62.33 207.296 66.5559 203.501 71.9915 200.817C77.4271 198.132 83.6913 196.79 90.7841 196.79C98.0758 196.79 104.423 198.082 109.825 200.668C115.261 203.22 119.487 206.766 122.503 211.307C125.519 215.848 127.027 221.051 127.027 226.918C127.027 230.762 126.265 234.557 124.74 238.303C123.249 242.048 120.58 246.207 116.736 250.781C112.891 255.322 107.472 260.774 100.479 267.138L85.6136 281.705V282.401H128.369V300H55.7841ZM179.863 249.091C179.863 261.454 178.205 272.822 174.891 283.196C171.61 293.57 166.572 303.182 159.777 312.031H139.543C142.128 308.75 144.531 304.74 146.752 300C148.972 295.26 150.911 290.09 152.569 284.489C154.226 278.854 155.518 273.021 156.446 266.989C157.374 260.956 157.838 254.991 157.838 249.091C157.838 241.236 157.026 233.314 155.402 225.327C153.811 217.306 151.624 209.882 148.84 203.054C146.089 196.193 142.99 190.575 139.543 186.2H159.777C166.572 195.05 171.61 204.661 174.891 215.036C178.205 225.41 179.863 236.761 179.863 249.091Z" fill="currentColor"/>
554<path d="M89.3175 473.392C81.8932 473.392 75.281 472.116 69.4808 469.564C63.7138 466.979 59.1565 463.432 55.8089 458.925C52.4946 454.384 50.7876 449.147 50.6882 443.214H72.3643C72.4969 445.7 73.3089 447.888 74.8004 449.777C76.325 451.633 78.3468 453.075 80.8658 454.102C83.3847 455.13 86.2185 455.643 89.3672 455.643C92.6484 455.643 95.5485 455.063 98.0675 453.903C100.586 452.743 102.558 451.136 103.984 449.081C105.409 447.026 106.121 444.656 106.121 441.972C106.121 439.254 105.359 436.851 103.835 434.763C102.343 432.642 100.189 430.984 97.3715 429.791C94.5874 428.598 91.273 428.001 87.4283 428.001H77.9325V412.192H87.4283C90.6764 412.192 93.5433 411.628 96.0291 410.501C98.5481 409.375 100.504 407.817 101.896 405.828C103.288 403.806 103.984 401.453 103.984 398.768C103.984 396.216 103.371 393.979 102.144 392.057C100.951 390.101 99.2607 388.577 97.0732 387.483C94.9188 386.389 92.3999 385.842 89.5163 385.842C86.5997 385.842 83.9316 386.373 81.5121 387.433C79.0926 388.461 77.1536 389.936 75.6953 391.858C74.237 393.78 73.4581 396.034 73.3587 398.619H52.7266C52.826 392.753 54.4998 387.582 57.7479 383.108C60.996 378.634 65.371 375.137 70.8729 372.618C76.4079 370.066 82.6555 368.79 89.6158 368.79C96.6423 368.79 102.79 370.066 108.06 372.618C113.33 375.17 117.424 378.617 120.34 382.959C123.29 387.268 124.748 392.107 124.715 397.476C124.748 403.177 122.975 407.933 119.396 411.744C115.849 415.556 111.226 417.975 105.525 419.003V419.798C113.015 420.759 118.716 423.361 122.627 427.604C126.571 431.813 128.527 437.083 128.494 443.413C128.527 449.214 126.853 454.367 123.472 458.875C120.125 463.383 115.501 466.929 109.602 469.514C103.702 472.099 96.9406 473.392 89.3175 473.392ZM179.863 421.091C179.863 433.454 178.205 444.822 174.891 455.196C171.61 465.57 166.572 475.182 159.777 484.031H139.543C142.128 480.75 144.531 476.74 146.752 472C148.972 467.26 150.911 462.09 152.569 456.489C154.226 450.854 155.518 445.021 156.446 438.989C157.374 432.956 157.838 426.991 157.838 421.091C157.838 413.236 157.026 405.314 155.402 397.327C153.811 389.306 151.624 381.882 148.84 375.054C146.089 368.193 142.99 362.575 139.543 358.2H159.777C166.572 367.05 171.61 376.661 174.891 387.036C178.205 397.41 179.863 408.761 179.863 421.091Z" fill="currentColor"/>
555</g>
556<defs>
557<clipPath id="clip0_1_12">
558<rect width="512" height="512" fill="white"/>
559</clipPath>
560</defs>
561</svg>
562`,Nfe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
563  <path fill="currentColor" d="M260 54c-17.7 0-32 14.3-32 32s14.3 32 32 32l220 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L260 54zm0 170c-17.7 0-32 14.3-32 32s14.3 32 32 32l220 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-220 0zm0 170c-17.7 0-32 14.3-32 32s14.3 32 32 32l220 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-220 0z"/>
564  <text fill="currentColor" font-family="Georgia, serif" font-weight="bold" font-size="120" text-anchor="end" x="210" y="86" dominant-baseline="central">I.</text>
565  <text fill="currentColor" font-family="Georgia, serif" font-weight="bold" font-size="120" text-anchor="end" x="210" y="256" dominant-baseline="central">II.</text>
566  <text fill="currentColor" font-family="Georgia, serif" font-weight="bold" font-size="120" text-anchor="end" x="210" y="426" dominant-baseline="central">III.</text>
567</svg>
568`,Mfe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
569  <path fill="currentColor" d="M260 54C242.3 54 228 68.3 228 86C228 103.7 242.3 118 260 118H480C497.7 118 512 103.7 512 86C512 68.3 497.7 54 480 54H260ZM260 224C242.3 224 228 238.3 228 256C228 273.7 242.3 288 260 288H480C497.7 288 512 273.7 512 256C512 238.3 497.7 224 480 224H260ZM260 394C242.3 394 228 408.3 228 426C228 443.7 242.3 458 260 458H480C497.7 458 512 443.7 512 426C512 408.3 497.7 394 480 394H260Z"/>
570  <text fill="currentColor" font-family="Georgia, serif" font-weight="bold" font-size="120" text-anchor="end" x="210" y="86" dominant-baseline="central">i.</text>
571  <text fill="currentColor" font-family="Georgia, serif" font-weight="bold" font-size="120" text-anchor="end" x="210" y="256" dominant-baseline="central">ii.</text>
572  <text fill="currentColor" font-family="Georgia, serif" font-weight="bold" font-size="120" text-anchor="end" x="210" y="426" dominant-baseline="central">iii.</text>
573</svg>
574`,Dfe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
575  <path fill="currentColor" d="M260 54c-17.7 0-32 14.3-32 32s14.3 32 32 32l220 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L260 54zm0 170c-17.7 0-32 14.3-32 32s14.3 32 32 32l220 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-220 0zm0 170c-17.7 0-32 14.3-32 32s14.3 32 32 32l220 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-220 0z"/>
576  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="86" dominant-baseline="central">A.</text>
577  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="256" dominant-baseline="central">B.</text>
578  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="426" dominant-baseline="central">C.</text>
579</svg>
580`,Lfe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
581  <path fill="currentColor" d="M260 54c-17.7 0-32 14.3-32 32s14.3 32 32 32l220 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L260 54zm0 170c-17.7 0-32 14.3-32 32s14.3 32 32 32l220 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-220 0zm0 170c-17.7 0-32 14.3-32 32s14.3 32 32 32l220 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-220 0z"/>
582  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="86" dominant-baseline="central">A)</text>
583  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="256" dominant-baseline="central">B)</text>
584  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="426" dominant-baseline="central">C)</text>
585</svg>
586`,Pfe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
587  <path fill="currentColor" d="M260 54C242.3 54 228 68.3 228 86C228 103.7 242.3 118 260 118H480C497.7 118 512 103.7 512 86C512 68.3 497.7 54 480 54H260ZM260 224C242.3 224 228 238.3 228 256C228 273.7 242.3 288 260 288H480C497.7 288 512 273.7 512 256C512 238.3 497.7 224 480 224H260ZM260 394C242.3 394 228 408.3 228 426C228 443.7 242.3 458 260 458H480C497.7 458 512 443.7 512 426C512 408.3 497.7 394 480 394H260Z"/>
588  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="74" dominant-baseline="central">a.</text>
589  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="244" dominant-baseline="central">b.</text>
590  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="414" dominant-baseline="central">c.</text>
591</svg>
592`,Bfe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
593  <path fill="currentColor" d="M260 54C242.3 54 228 68.3 228 86C228 103.7 242.3 118 260 118H480C497.7 118 512 103.7 512 86C512 68.3 497.7 54 480 54H260ZM260 224C242.3 224 228 238.3 228 256C228 273.7 242.3 288 260 288H480C497.7 288 512 273.7 512 256C512 238.3 497.7 224 480 224H260ZM260 394C242.3 394 228 408.3 228 426C228 443.7 242.3 458 260 458H480C497.7 458 512 443.7 512 426C512 408.3 497.7 394 480 394H260Z"/>
594  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="74" dominant-baseline="central">a)</text>
595  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="244" dominant-baseline="central">b)</text>
596  <text fill="currentColor" font-family="sans-serif" font-weight="bold" font-size="140" text-anchor="end" x="210" y="414" dominant-baseline="central">c)</text>
597</svg>
598`,jfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>',GO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"/></svg>',Ffe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"/></svg>',zfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z"/></svg>',Ufe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 48
5980c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"/></svg>',Vfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M448 64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32L32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32z"/></svg>',Hfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3L0 176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"/></svg>',$fe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM.2 268.6c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6l0 158.6c0 13.3-15.3 20.8-25.8 12.6L.2 268.6z"/></svg>',Gfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 28.7 28.7 0 64 0L352 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64L64 192c-35.3 0-64-28.7-64-64L0 64zM160 352c0-17.7 14.3-32 32-32l0-16c0-44.2 35.8-80 80-80l144 0c17.7 0 32-14.3 32-32l0-32 0-90.5c37.3 13.2 64 48.7 64 90.5l0 32c0 53-43 96-96 96l-144 0c-8.8 0-16 7.2-16 16l0 16c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-128z"/></svg>',qfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L355.7 253.5 400.2 96 503 96 497 120.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l11-44.1C577.6 61.3 554.7 32 523.5 32L376.1 32l-.3 0L204.5 32c-22 0-41.2 15-46.6 36.4l-6.3 25.2L38.8 5.1zm168 131.7c.1-.3 .2-.7 .3-1L217 96l116.7 0L301.3 210.8l-94.5-74.1zM243.3 416L192 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-42.2 0 17.6-62.1L272.9 311 243.3 416z"/></svg>',Wfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"/></svg>',Kfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM329 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-95 95-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L329 305z"/></svg>',Yfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM305 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47z"/></svg>',Xfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M152.1 38.2c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 113C-2.3 103.6-2.3 88.4 7 79s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zm0 160c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM48 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/></svg>',qO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
598<path d="M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l293.1 0c-3.1-8.8-3.7-18.4-1.4-27.8l15-60.1c2.8-11.3 8.6-21.5 16.8-29.7l40.3-40.3c-32.1-31-75.7-50.1-123.9-50.1l-91.4 0zm435.5-68.3c-15.6-15.6-40.9-15.6-56.6 0l-29.4 29.4 71 71 29.4-29.4c15.6-15.6 15.6-40.9 0-56.6l-14.4-14.4zM375.9 417c-4.1 4.1-7 9.2-8.4 14.9l-15 60.1c-1.4 5.5 .2 11.2 4.2 15.2s9.7 5.6 15.2 4.2l60.1-15c5.6-1.4 10.8-4.3 14.9-8.4L576.1 358.7l-71-71L375.9 417z"/></svg>',WO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"/></svg>',Zfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128z"/></svg>',Qfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416 32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-1.8 0 18-48 159.6 0 18 48-1.8 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-25.8 0L254 52.8zM279.8 304l-111.6 0L224 155.1 279.8 304z"/></svg>',Jfe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 0C28.7 0 0 28.7 0 64L0 320l384 0 0-160-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM0 416l64 0 0-64L0 352l0 64zm288 32l-80 0 0 64 80 0 0-64zm-112 0l-80 0 0 64 80 0 0-64zM64 448L0 448c0 35.3 28.7 64 64 64l0-64zm256 0l0 64c35.3 0 64-28.7 64-64l-64 0zm64-32l0-64-64 0 0 64 64 0z"/></svg>',ehe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg>',the='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M352 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9L370.7 96 201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 141.3l41.4 41.4c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-128c0-17.7-14.3-32-32-32L352 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"/></svg>',nhe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"/></svg>',rhe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M177.9 494.1c-18.7 18.7-49.1 18.7-67.9 0L17.9 401.9c-18.7-18.7-18.7-49.1 0-67.9l50.7-50.7 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 50.7-50.7c18.7-18.7 49.1-18.7 67.9 0l92.1 92.1c18.7 18.7 18.7 49.1 0 67.9L177.9 494.1z"/></svg>',ihe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M339.3 367.1c27.3-3.9 51.9-19.4 67.2-42.9L568.2 74.1c12.6-19.5 9.4-45.3-7.6-61.2S517.7-4.4 499.1 9.6L262.4 187.2c-24 18-38.2 46.1-38.4 76.1L339.3 367.1zm-19.6 25.4l-116-104.4C143.9 290.3 96 339.6 96 400c0 3.9 .2 7.8 .6 11.6C98.4 429.1 86.4 448 68.8 448L64 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0c61.9 0 112-50.1 112-112c0-2.5-.1-5-.2-7.5z"/></svg>',ohe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5s0 0 0 0l0-71.7c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5L224 416l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7L24 512c-13.3 0-24-10.7-24-24l0-4.7c0-6.4 2.5-12.5 7-17z"/></svg>
599`,she='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M224 96l16-32 32-16-32-16-16-32-16 32-32 16 32 16 16 32zM80 160l26.7-53.3L160 80l-53.3-26.7L80 0 53.3 53.3 0 80l53.3 26.7L80 160zm352 128l-26.7 53.3L352 368l53.3 26.7L432 448l26.7-53.3L512 368l-53.3-26.7L432 288zm70.6-193.8L417.8 9.4C411.5 3.1 403.3 0 395.2 0c-8.2 0-16.4 3.1-22.6 9.4L9.4 372.5c-12.5 12.5-12.5 32.8 0 45.3l84.9 84.9c6.3 6.3 14.4 9.4 22.6 9.4 8.2 0 16.4-3.1 22.6-9.4l363.1-363.2c12.5-12.5 12.5-32.8 0-45.2zM359.5 203.5l-50.9-50.9 86.6-86.6 50.9 50.9-86.6 86.6z"/></svg>
599',ahe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 256l0-96 160 0 0 96L64 256zm0 64l160 0 0 96L64 416l0-96zm224 96l0-96 160 0 0 96-160 0zM448 256l-160 0 0-96 160 0 0 96zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"/></svg>',lhe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 160 0 0-256L64 160zm384 0l-160 0 0 256 160 0 0-256z"/></svg>',che='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M406.6 374.6l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224l-293.5 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288l293.5 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/></svg>',uhe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M256 0c17.7 0 32 14.3 32 32l0 32 32 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-64 64c-12.5 12.5-32.8 12.5-45.3 0l-64-64c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8l32 0 0-32c0-17.7 14.3-32 32-32zM169.4 393.4l64-64c12.5-12.5 32.8-12.5 45.3 0l64 64c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9zM32 224l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c12.5 12.5 12.5 32.8 0 45.3l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3l64-64c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 32 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-64-64zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg>',ex='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"/></svg>',L3='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M135.2 17.7C140.6 6.8 151.7 0 163.8 0L284.2 0c12.1 0 23.2 6.8 28.6 17.7L320 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 7.2-14.3zM32 128l384 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-320zm96 64c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16z"/></svg>',bo={undo:Rj,redo:Wfe,bold:Cfe,italic:Sfe,underline:Efe,color:Qfe,link:GO,image:jfe,tableOfContents:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="96 96 448 448"><!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M96 160C96 124.7 124.7 96 160 96L480 96C515.3 96 544 124.7 544 160L544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 160zM160 160L160 224L224 224L224 160L160 160zM480 160L288 160L288 224L480 224L480 160zM160 288L160 352L224 352L224 288L160 288zM480 288L288 288L288 352L480 352L480 288zM160 416L160 480L224 480L224 416L160 416zM480 416L288 416L288 480L480 480L480 416z"></path></svg>
600`,watermark:`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewB
600ox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path fill="currentColor" fill-rule="evenodd" d="M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM109.2 254.3L150.8 230.3L312.1 349.7L267.0 375.7L236.9 351.5L169.4 390.5L175.2 428.7L130.2 454.7ZM162.6 344.8L200.7 322.8L153.6 285.3Z"/></svg>
601`,pageNumber:`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 384 512"><!--!Page outline from Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path fill="currentColor" fill-rule="evenodd" d="M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM128 216L176 216L176 264L208 264L208 216L256 216L256 264L304 264L304 312L256 312L256 344L304 344L304 392L256 392L256 440L208 440L208 392L176 392L176 440L128 440L128 392L80 392L80 344L128 344L128 312L80 312L80 264L128 264ZM176 312L208 312L208 344L176 344Z"/></svg>
602`,alignLeft:Ffe,alignRight:Ufe,alignCenter:zfe,alignJustify:Vfe,bulletList:$O,bulletListDisc:$O,bulletListCircle:Afe,bulletListSquare:Tfe,numberedList:Ife,numberedListDecimal:Rfe,numberedListDecimalParen:Ofe,numberedListUpperRoman:Nfe,numberedListLowerRoman:Mfe,numberedListUpperAlpha:Dfe,numberedListUpperAlphaParen:Lfe,numberedListLowerAlpha:Pfe,numberedListLowerAlphaParen:Bfe,indentLeft:$fe,indentRight:Hfe,directionLtr:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm12 8l-4-4v3H5v2h12v3l4-4z"/></svg>
603`,directionRtl:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M10 10v5h2V4h2v11h2V4h2V2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4zm-2 7v-3l-4 4 4 4v-3h12v-2H8z"/></svg>
604`,pageBreak:Jfe,copyFormat:Gfe,clearFormatting:qfe,trackChanges:Xfe,trackChangesFinal:Zfe,trackChangesOriginal:WO,trackChangesAccept:Kfe,trackChangesReject:Yfe,documentMode:qO,documentEditingMode:qO,documentSuggestingMode:Ej,documentViewingMode:WO,colorOption:ehe,colorOptionCheck:SE,linkInput:GO,removeLink:Tj,openLink:the,overflow:Ij,dropdownCaretUp:nhe,dropdownCaretDown:Aj,ruler:rhe,paintbrush:ihe,highlight:ohe,ai:she,table:ahe,tableActions:lhe,splitCell:che,mergeCells:uhe,addRowBefore:ex,addRowAfter:ex,addColumnBefore:ex,addColumnAfter:ex,deleteRow:L3,deleteColumn:L3,deleteTable:L3,deleteBorders:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M32 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm96-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM320 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-320a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM224 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0-448a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 96a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 288a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm192 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 320a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM416 192a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64z"/></svg>',fixTables:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M352 320c88.4 0 160-71.6 160-160c0-15.3-2.2-30.1-6.2-44.2c-3.1-10.8-16.4-13.2-24.3-5.3l-76.8 76.8c-3 3-7.1 4.7-11.3 4.7L336 192c-8.8 0-16-7.2-16-16l0-57.4c0-4.2 1.7-8.3 4.7-11.3l76.8-76.8c7.9-7.9 5.4-2
6041.2-5.3-24.3C382.1 2.2 367.3 0 352 0C263.6 0 192 71.6 192 160c0 19.1 3.4 37.5 9.5 54.5L19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L297.5 310.5c17 6.2 35.4 9.5 54.5 9.5zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"/></svg>',lineHeight:`<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="3 4 18 16"><path stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 10V5m0 0L4 7m2-2 2 2m-2 7v5m0 0 2-2m-2 2-2-2m8-10h8m0 5h-8m0 5h8"></path></svg>
605`,search:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"/></svg>
606`,cut:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M278.1 256L444.5 89.6c4.7-4.7 4.7-12.3 0-17-32.8-32.8-86-32.8-118.8 0L210.2 188.1l-24.9-24.9c4.3-10.9 6.7-22.8 6.7-35.3 0-53-43-96-96-96S0 75 0 128s43 96 96 96c4.5 0 9-.3 13.4-.9L142.3 256l-32.9 32.9c-4.4-.6-8.8-.9-13.4-.9-53 0-96 43-96 96s43 96 96 96 96-43 96-96c0-12.5-2.4-24.3-6.7-35.3l24.9-24.9L325.7 439.4c32.8 32.8 86 32.8 118.8 0 4.7-4.7 4.7-12.3 0-17L278.1 256zM96 160c-17.6 0-32-14.4-32-32s14.4-32 32-32 32 14.4 32 32-14.4 32-32 32zm0 256c-17.6 0-32-14.4-32-32s14.4-32 32-32 32 14.4 32 32-14.4 32-32 32z"/>
606</svg>',copy:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M320 448v40c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V120c0-13.3 10.7-24 24-24h72v296c0 30.9 25.1 56 56 56h168zm0-344V0H152c-13.3 0-24 10.7-24 24v368c0 13.3 10.7 24 24 24h272c13.3 0 24-10.7 24-24V128H344c-13.2 0-24-10.8-24-24zm121-31L375 7A24 24 0 0 0 358.1 0H352v96h96v-6.1a24 24 0 0 0 -7-17z"/></svg>',paste:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 184c0-30.9 25.1-56 56-56h136V56c0-13.3-10.7-24-24-24h-80.6C204.3 12.9 183.6 0 160 0s-44.3 12.9-55.4 32H24C10.7 32 0 42.7 0 56v336c0 13.3 10.7 24 24 24h104V184zm32-144c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm184 248h104v200c0 13.3-10.7 24-24 24H184c-13.3 0-24-10.7-24-24V184c0-13.3 10.7-24 24-24h136v104c0 13.2 10.8 24 24 24zm104-38.1V256h-96v-96h6.1a24 24 0 0 1 17 7l65.9 65.9a24 24 0 0 1 7 17z"/></svg>',strikethrough:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M161.3 144c3.2-17.2 14-30.1 33.7-38.6c21.1-9 51.8-12.3 88.6-6.5c11.9 1.9 48.8 9.1 60.1 12c17.1 4.5 34.6-5.6 39.2-22.7s-5.6-34.6-22.7-39.2c-14.3-3.8-53.6-11.4-66.6-13.4c-44.7-7-88.3-4.2-123.7 10.9c-36.5 15.6-64.4 44.8-71.8 87.3c-.1 .6-.2 1.1-.2 1.7c-2.8 23.9 .5 45.6 10.1 64.6c4.5 9 10.2 16.9 16.7 23.9L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-209.9 0-.4-.1-1.1-.3c-36-10.8-65.2-19.6-85.2-33.1c-9.3-6.3-15-12.6-18.2-19.1c-3.1-6.1-5.2-14.6-3.8-27.4zM348.9 337.2c2.7 6.5 4.4 15.8 1.9 30.1c-3 17.6-13.8 30.8-33.9 39.4c-21.1 9-51.7 12.3-88.5 6.5c-18-2.9-49.1-13.5-74.4-22.1c-5.6-1.9-11-3.7-15.9-5.4c-16.8-5.6-34.9 3.5-40.5 20.3s3.5 34.9 20.3 40.5c3.6 1.2 7.9 2.7 12.7 4.3c0 0 0 0 0 0s0 0 0 0c24.9 8.5 63.6 21.7 87.6 25.6c0 0 0 0 0 0l.2 0c44.7 7 88.3 4.2 123.7-10.9c36.5-15.6 64.4-44.8 71.8-87.3c3.6-21 2.7-40.4-3.1-58.1l-75.7 0c7 5.6 11.4 11.2 13.9 17.2z"/></svg>
607`,formattingMarks:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><text x="12" y="18" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="20" font-weight="700" fill="currentColor">¶</text></svg>
608`},dhe={key:0,class:"link-title"},fhe={key:1,class:"link-title"},hhe={key:2,class:"link-title"},phe={key:3,class:"link-title"},mhe={key:4,class:"link-input-wrapper"},ghe={class:"input-row text-input-row"},yhe=["readonly","onKeydown"],vhe={class:"input-row url-input-row"},bhe=["innerHTML"],whe=["readonly","onKeydown"],xhe=["innerHTML"],khe={key:0,class:"input-row link-buttons"},_he=["innerHTML"],Che={key:5,class:"input-row go-to-anchor clickable"},zj=li({__name:"LinkInput",props:{showInput:{type:Boolean,default:!0},showLink:{type:Boolean,default:!0},goToAnchor:{type:Function,default:()=>{}},ui:{type:Object,default:null},linkItem:{type:Object,default:null},closePopover:{type:Function,default:()=>{}},href:{type:String,default:null},target:{type:String,default:null},rel:{type:String,default:null},tooltip:{type:String,default:null},clickedElement:{type:Object,default:null},hyperlinkTarget:{type:Object,default:null},hyperlinkText:{type:String,default:null},textTarget:{type:Object,default:null},restoreSelection:{type:Function,default:()=>{}},documentMode:{type:String,default:null}},setup(e){const t=e,{isHighContrastMode:n}=cu(),r=Ne(!1),i=()=>{var H,te,M,Z,L;if(typeof t.hyperlinkText=="string"&&t.hyperlinkText)return t.hyperlinkText;const ee=(M=(te=(H=t.ui)==null?void 0:H.selection)==null?void 0:te.getSnapshot)==null?void 0:M.call(te);if(typeof(ee==null?void 0:ee.quotedText)=="string"&&ee.quotedText)return ee.quotedText;const F=((Z=t.clickedElement)==null?void 0:Z.innerText)??((L=t.clickedElement)==null?void 0:L.textContent);return typeof F=="string"?F:""},o=()=>{var H,te,M,Z,L,W,U,q,Q;if(typeof t.href=="string"&&t.href)return t.href;const ee=(W=(L=(Z=(M=(te=(H=t.ui)==null?void 0:H.toolbar)==null?void 0:te.getSnapshot)==null?void 0:M.call(te))==null?void 0:Z.commands)==null?void 0:L.link)==null?void 0:W.value;if(typeof ee=="string"&&ee)return ee;const F=(Q=(q=(U=t.linkItem)==null?void 0:U.attributes)==null?void 0:q.value)==null?void 0:Q.href;return typeof F=="string"?F:""},s=()=>{var ee,F,H,te;return t.documentMode??((te=(H=(F=(ee=t.ui)==null?void 0:ee.document)==null?void 0:F.getSnapshot)==null?void 0:H.call(F))==null?void 0:te.mode)??null},l=Ne(""),u=Ne(""),d=Ne(!1),f=/^[a-z][a-z0-9+.-]*:/i,p=dt(()=>{const ee=u.value.trim();return ee?ee.startsWith("#")||f.test(ee)?ee:"https://"+ee:""}),m=dt(()=>p.value?_fe(p.value):null),y=dt(()=>m.value!==null),b=Ne(!1),k=dt(()=>!d.value&&b.value),S=dt(()=>!y.value),x=dt(()=>s()==="viewing"),T=()=>{var F;const ee=(F=m.value)==null?void 0:F.href;ee&&window.open(ee,"_blank","noopener")},C=()=>{const ee=document.querySelector(".link-input-ctn input");ee&&ee.focus()};po(()=>{l.value=i(),u.value=o(),b.value=!!u.value,d.value=u.value.startsWith("#"),t.showInput&&!x.value&&C()});const I=ee=>{var H,te;const F=t.ui;return(H=F==null?void 0:F.commands)!=null&&H.execute?((te=t.restoreSelection)==null||te.call(t),F.commands.execute("link",ee)):!1},D=()=>{var H;if(x.value)return;if(!u.value){I({href:null,hyperlinkTarget:t.hyperlinkTarget}),t.closePopover();return}if(!y.value){r.value=!0;return}const ee=(H=m.value)==null?void 0:H.href;if(!ee){r.value=!0;return}const F={href:ee,currentText:i(),hyperlinkTarget:t.hyperlinkTarget,textTarget:t.textTarget};l.value?F.text=l.value:k.value||(F.text=ee),I(F),t.closePopover()},P=()=>{I({href:null,hyperlinkTarget:t.hyperlinkTarget}),t.closePopover()},V=ee=>{t.goToAnchor&&t.goToAnchor(ee)};return(ee,F)=>(Ze(),ut("div",{class:Wr(["link-input-ctn",{"high-contrast":Yt(n)}])},[d.value?(Ze(),ut("div",dhe,"Page anchor")):x.value?(Ze(),ut("div",fhe,"Link details")):k.value?(Ze(),ut("div",hhe,"Edit link")):(Ze(),ut("div",phe,"Add link")),e.showInput&&!d.value?(Ze(),ut("div",mhe,[et("div",ghe,[F[4]||(F[4]=et("div",{class:"input-icon text-input-icon"},"T",-1)),Lu(et("input",{type:"text",name:"text",placeholder:"Text","onUpdate:modelValue":F[0]||(F[0]=H=>l.value=H),readonly:x.value,onKeydown:Nd(Gr(D,["stop","prevent"]),["enter"])},null,40,yhe),[[yg,l.value]])]),et("div",vhe,[et("div",{class:"input-icon",innerHTML:Yt(bo).linkInput},null,8,bhe),Lu(et("input",{type:"text",name:"link",placeholder:"Type or paste a link",class:Wr({"sd-error":r.value}),"onUpdate:modelValue":F[1]||(F[1]=H=>u.value=H),readonly:x.value,onKeydown:[Nd(Gr(D,["stop","prevent"]),["enter"]),F[2]||(F[2]=H=>r.value=!1)]},null,42,whe),[[yg,u.value]]),et("div",{class:Wr(["open-link-icon",{"sd-disabled":!y.value}]),innerHTML:Yt(bo).openLink,onClick:T,"data-item":"btn-link-open"},null,10,xhe)]),x.value?gn("",!0):(Ze(),ut("div",khe,[k.value?(Ze(),ut("button",{key:0,class:"remove-btn",onClick:P,"data-item":"btn-link-remove"},[et("div",{class:"remove-btn__icon",innerHTML:Yt(bo).removeLink},null,8,_he),F[5]||(F[5]=Md(" Remove ",-1))])):gn("",!0),et("button",{class:Wr(["sd-submit-btn",{"disable-btn":S.value}]),onClick:D,"data-item":"btn-link-apply"}," Apply ",2)]))])):d.value?(Ze(),ut("div",Che,[et("a",{onClick:F[3]||(F[3]=Gr(H=>V(u.value),["stop","prevent"]))},"Go to "+Un(u.value.startsWith("#_")?u.value.substring(2):u.value),1)])):gn("",!0)],2))}},[["__scopeId","data-v-3e4bd44e"]]);function She(e){let t=e;for(;t;){const n=window.getComputedStyle(t).overflowY;if(/(auto|scroll)/.test(n)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return document.scrollingElement||document.documentElement}function Uj(e,t={behavior:"smooth",block:"start"}){var f;if(!e)return;const n=She(e),r=n.getBoundingClientRect(),i=e.getBoundingClientRect(),o=n===(document.scrollingElement||document.documentElement)?0:r.top,s=i.top-o+n.scrollTop,l=(f=window.getComputedStyle(n).scrollPaddingTop)==null?void 0:f.trim(),u=l!=null&&l.endsWith("px")?Number(l.slice(0,-2)):0,d=Number.isFinite(u)&&u>=0?u:0;n.scrollTo({top:t.block==="start"?s-d:s-n.clientHeight+e.offsetHeight,behavior:t.behavior})}var Ehe="link-popover",Ahe=500,The=4,Ihe=e=>!!(e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"),H0=e=>!!(e&&typeof e=="object"&&!Array.isArray(e));function Rhe(e){if(!H0(e)||e.kind!=="inline"||e.nodeType!=="hyperlink")return!1;const t=H0(e.anchor)?e.anchor:null,n=t&&H0(t.start)?t.start:null,r=t&&H0(t.end)?t.end:null;return typeof(n==null?void 0:n.blockId)=="string"&&typeof n.offset=="number"&&typeof(r==null?void 0:r.blockId)=="string"&&typeof r.offset=="number"}function Ohe(e){return H0(e)?e.type==="default"||e.type==="suppress"||e.type==="none"?!0:e.type==="custom"?e.component!=null:e.type==="external"||e.type==="render"?typeof e.render=="function":!1:!1}function KO(e){return e instanceof Error?e:new Error(String(e))}function Nhe(e){return typeof e!="string"?"":e.split(/\s+/).map(t=>t.trim().toLowerCase()).filter(t=>
608t==="noopener"||t==="noreferrer").filter((t,n,r)=>r.indexOf(t)===n).join(",")}function Mhe(e,t){const n=Nhe(e);if(t!=="_blank")return n;const r=n?n.split(","):[];return r.includes("noopener")||r.unshift("noopener"),r.join(",")}function Dhe(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):String(e).replace(/['"\\]/g,"\\$&")}function Lhe(e){try{return decodeURIComponent(e)}catch{return e}}function Vj(e){var n,r;const t=(n=e==null?void 0:e.dataset)==null?void 0:n.sourceAnchor;if(!t)return null;try{const i=(r=JSON.parse(t))==null?void 0:r.sourceRef;if(!H0(i))return null;const o=typeof i.partUri=="string"?i.partUri:void 0,s=typeof i.xpathLikePath=="string"?i.xpathLikePath:void 0;return o||s?{partUri:o,xpathLikePath:s}:null}catch{return null}}function Phe(e){var n,r;const t=(r=(n=Vj(e))==null?void 0:n.xpathLikePath)==null?void 0:r.match(/w:p\[ordinal=(\d+)\]/);return t?Number(t[1]):null}function Bhe(e,t){var o,s,l,u;const n=Phe(e),r=(l=(s=(o=t==null?void 0:t.blocks)==null?void 0:o.list)==null?void 0:s.call(o))==null?void 0:l.blocks,i=Array.isArray(r)?r.find(d=>d.ordinal===n):null;return typeof(i==null?void 0:i.nodeId)=="string"?i.nodeId:(u=e==null?void 0:e.dataset)==null?void 0:u.blockId}function YO(e,t){var y,b,k,S,x,T;const n=(y=e==null?void 0:e.closest)==null?void 0:y.call(e,"[data-block-id][data-pm-start]"),r=Bhe(n,t);if(!r||!n||!(e!=null&&e.ownerDocument))return null;const i=Number((b=e==null?void 0:e.dataset)==null?void 0:b.pmStart),o=Number((k=e==null?void 0:e.dataset)==null?void 0:k.pmEnd);if(Number.isFinite(i)&&Number.isFinite(o)&&o>i){const C=Number((S=n==null?void 0:n.dataset)==null?void 0:S.pmStart),I=Number.isFinite(C)&&i>=C,D=I?i-C:i,P=I?o-C:o;return D<0||P<=D?null:{kind:"selection",start:{kind:"text",blockId:r,offset:D},end:{kind:"text",blockId:r,offset:P}}}const s=e.ownerDocument.defaultView,l=s==null?void 0:s.NodeFilter,u=s==null?void 0:s.Node;if(!l||!u)return null;let d=0;const f=e.ownerDocument.createTreeWalker(n,l.SHOW_ELEMENT|l.SHOW_TEXT);let p=f.nextNode();for(;p&&p!==e;)p.nodeType===u.TEXT_NODE&&!e.contains(p)&&(d+=((x=p.textContent)==null?void 0:x.length)??0),p=f.nextNode();if(p!==e)return null;const m=d+(((T=e.textContent)==null?void 0:T.length)??0);return m<=d?null:{kind:"selection",start:{kind:"text",blockId:r,offset:d},end:{kind:"text",blockId:r,offset:m}}}function jhe(e){var n,r;const t=(n=e==null?void 0:e.closest)==null?void 0:n.call(e,"[data-source-anchor]");return((r=Vj(t))==null?void 0:r.partUri)??null}function XO(e){return e.startsWith("/")?e:`/${e}`}function P3(e){if(typeof e!="string")return"";try{return new URL(e,window.location.href).href}catch{return e}}function B3(e){return typeof(e==null?void 0:e.externalTarget)=="string"&&e.externalTarget?e.externalTarget:typeof(e==null?void 0:e.anchor)=="string"&&e.anchor?`#${e.anchor}`:""}function Hj(e){var r,i;const t=(r=e==null?void 0:e.anchor)==null?void 0:r.start,n=(i=e==null?void 0:e.anchor)==null?void 0:i.end;return typeof(t==null?void 0:t.blockId)!="string"||typeof(t==null?void 0:t.offset)!="number"||typeof(n==null?void 0:n.blockId)!="string"||typeof(n==null?void 0:n.offset)!="number"||t.blockId!==n.blockId?null:{kind:"selection",start:{kind:"text",blockId:t.blockId,offset:t.offset},end:{kind:"text",blockId:n.blockId,offset:n.offset}}}function Fhe(e,t){var r,i,o,s;const n=Hj(t);return n?n.start.blockId===((r=e==null?void 0:e.start)==null?void 0:r.blockId)&&n.start.offset===((i=e==null?void 0:e.start)==null?void 0:i.offset)&&n.end.blockId===((o=e==null?void 0:e.end)==null?void 0:o.blockId)&&n.end.offset===((s=e==null?void 0:e.end)==null?void 0:s.offset):!1}function zhe(e,t,n){var s,l;if(typeof t!="string"||!t)return null;const r=(l=(s=e==null?void 0:e.query)==null?void 0:s.match)==null?void 0:l.call(s,{select:{type:"text",pattern:t,caseSensitive:!0},require:"any"}),i=(Array.isArray(r==null?void 0:r.items)?r.items:[]).map(u=>u==null?void 0:u.target).filter(u=>{var d,f;return(u==null?void 0:u.kind)==="selection"&&!!((d=u==null?void 0:u.start)!=null&&d.blockId)&&!!((f=u==null?void 0:u.end)!=null&&f.blockId)}),o=typeof n=="string"?i.filter(u=>u.start.blockId===n&&u.end.blockId===n):i;return o.length===1?o[0]:typeof n=="string"?null:i.length===1?i[0]:null}function ZO(e){return!!(e&&typeof e.closest=="function"&&e.closest(".superdoc-toc-entry"))}function Uhe({getSurfaceManager:e,getActiveEditor:t,getUi:n,getActivationHandler:r,getActivationHandlerSource:i=()=>null,getBuiltInEditorDisabled:o=()=>!1,shouldInterceptNavigationOnlyHyperlinks:s=()=>!1,getLayerElement:l,emitException:u}){let d=null,f=null,p=0;const m=new WeakMap;function y(){p+=1}function b(U,q){var J,ge,le;
608if(!U||!d||d.handle!==U)return;const Q=d;(J=Q.unbindPointerDown)==null||J.call(Q);const re=(le=(ge=Q.element.ownerDocument)==null?void 0:ge.defaultView)==null?void 0:le.Node,ne=re!=null&&Q.pointerDownTarget instanceof re&&Q.element.contains(Q.pointerDownTarget);(q==null?void 0:q.status)==="closed"&&q.reason===void 0&&ne&&(f={href:Q.href,element:Q.element,closedAt:Date.now()}),d=null}function k(U="closed"){var Q,re,ne;y();const q=d;d=null,f=null,(Q=q==null?void 0:q.unbindPointerDown)==null||Q.call(q),(ne=(re=q==null?void 0:q.handle)==null?void 0:re.close)==null||ne.call(re,U)}function S(U){return{id:Ehe,mode:"floating",closeOnEscape:!0,floating:{top:U.position.top,left:U.position.left,autoFocus:!0,closeOnOutsidePointerDown:!0,width:"auto"}}}function x(U,q){var J,ge;const Q={href:U.href,element:U.element,handle:q,pointerDownTarget:null,unbindPointerDown:null},re=U.element.ownerDocument,ne=le=>{Q.pointerDownTarget=le.target??null};re.addEventListener("pointerdown",ne,!0),Q.unbindPointerDown=()=>re.removeEventListener("pointerdown",ne,!0),d=Q,f=null,(ge=(J=q.result)==null?void 0:J.then)==null||ge.call(J,le=>b(q,le),()=>b(q))}function T(U,q){var Q;return((Q=U==null?void 0:U.querySelector)==null?void 0:Q.call(U,`a[name='${q}'], [data-bookmark-marker='start'][data-bookmark-name='${q}']`))??null}async function C(U){var J,ge;const q=(ge=(J=t())==null?void 0:J.authoring)==null?void 0:ge.setSelectionTarget;if(typeof q!="function")return;const Q={kind:"story",storyType:"body"},re={kind:"text",blockId:U,offset:0,story:Q},ne={kind:"selection",start:re,end:re,story:Q};try{await Promise.resolve(q({target:ne,collapse:"start",focus:!0}))}catch{}}async function I(U,{placeCaret:q=!1}={}){var At,yt,Ge,Be,he,Oe,ye,B,be,ie;if(typeof U!="string"||!U.startsWith("#"))return;const Q=Lhe(U.slice(1)),re=(At=t())==null?void 0:At.doc,ne=(yt=re==null?void 0:re.bookmarks)==null?void 0:yt.get;if(typeof ne!="function"){const fe=T(((he=(Be=(Ge=n())==null?void 0:Ge.viewport)==null?void 0:Be.getHost)==null?void 0:he.call(Be))??null,Dhe(Q));fe&&Uj(fe,{block:"start",behavior:"instant"});return}let J=null;try{J=await Promise.resolve(ne.call(re.bookmarks,{target:{kind:"entity",entityType:"bookmark",name:Q}})),J??(J=null)}catch{return}const ge=(Oe=J==null?void 0:J.address)==null?void 0:Oe.story;if(ge&&ge.storyType!=="body")return;const le=(B=(ye=J==null?void 0:J.range)==null?void 0:ye.from)==null?void 0:B.blockId;if(typeof le!="string")return;q&&await C(le);const ve=(be=n())==null?void 0:be.viewport,Ee=ve==null?void 0:ve.scrollIntoView;if(typeof Ee!="function")return;const st={kind:"text",blockId:le,range:{start:0,end:0}};for(let fe=0;fe<The;fe+=1)try{if(((ie=await Promise.resolve(Ee.call(ve,{target:st,block:"start",behavior:"instant"})))==null?void 0:ie.success)!==!1)return}catch{return}}async function D(U){var At,yt,Ge,Be,he,Oe,ye;const q=(At=U.editor)==null?void 0:At.doc;let Q;try{Q=await Promise.resolve((Ge=(yt=q==null?void 0:q.hyperlinks)==null?void 0:yt.list)==null?void 0:Ge.call(yt))}catch{return null}const re=Array.isArray(Q==null?void 0:Q.stories)?Q.stories:[],ne=(he=(Be=U.element)==null?void 0:Be.dataset)==null?void 0:he.linkRid,J=((Oe=U.element)==null?void 0:Oe.textContent)??"",ge=P3(U.href),le=YO(U.element,q),ve=jhe(U.element),Ee=re.filter(B=>typeof(B==null?void 0:B.partUri)=="string"),st=ve&&Ee.length>0?Ee.filter(B=>XO(B.partUri)===XO(ve)):re;for(const B of st){const be=Array.isArray(B==null?void 0:B.hyperlinks)?B.hyperlinks:[],ie=async xt=>{var de,z;if(!(xt!=null&&xt.hyperlinkNodeId)||!(B!=null&&B.storyId)||xt.address)return xt;try{const Y=await Promise.resolve((z=(de=q==null?void 0:q.hyperlinks)==null?void 0:de.get)==null?void 0:z.call(de,{storyId:B.storyId,hyperlinkNodeId:xt.hyperlinkNodeId}));return Y!=null&&Y.success&&Y.hyperlink?Y.hyperlink:xt}catch{return xt}},fe=async xt=>{if(!le)return null;const de=(await Promise.all(xt.map(ie))).filter(z=>Fhe(le,z.address));return de.length===1?de[0]:null},ue=ne?be.filter(xt=>xt.rId===ne):[],Ce=ue.filter(xt=>xt.text===J),Ue=be.filter(xt=>P3(B3(xt))===ge&&xt.text===J),K=be.filter(xt=>xt.text===J),oe=be.filter(xt=>{var z,Y;const de=P3(B3(xt));return J&&de===ge&&((Y=(z=xt.text)==null?void 0:z.includes)==null?void 0:Y.call(z,J))}),Fe=Ce.length===1?Ce[0]:null,Le=Ue.length===1?Ue[0]:null,tt=K.length===1?K[0]:null,De=oe.length===1?oe[0]:null,Pe=ue.length===1?ue[0]:null,mt=Fe??await fe(Ce)??Le??await fe(Ue)??tt??await fe(K)??De??await fe(oe)??Pe??await fe(ue);if(mt!=null&&mt.hyperlinkNodeId&&(B!=null&&B.storyId)){const xt=await ie(mt),de=Hj(xt.address);return{storyId:B.storyId,hyperlinkNodeId:xt.hyperlinkNodeId,href:B3(xt),text:xt.text,targetKind:xt.targetKind,address:Rhe(xt.address)?xt.address:void 0,textTarget:de??zhe(q,xt.text,(ye=le==null?void 0:le.start)==null?void 0:ye.blockId)}}}return null}function P(U){const q=m.get(U);if(q)return q;const Q=D(U);return m.set(U,Q),Q}function V(U){if(!f)return!1;const q=f.element===U.element&&f.href===U.href,Q=Date.now()-f.closedAt<=Ahe;return!q||!Q?!1:(f=null,!0)}function ee(U,q){const Q=e();if(!(Q!=null&&Q.open))return;const re=p;queueMicrotask(()=>{re===p&&x(U,Q.open(q))})}function F(U){if(k("replace"),U.isAnchorLink&&ZO(U.element)){I(U.href,{placeCaret:U.documentMode!=="viewing"});return}if(U.defaultAction==="navigate"){if(U.isAnchorLink)I(U.href);else if(U.href){const J=U.target||"_self",ge=Mhe(U.rel,J);ge?window.open(U.href,J,ge):window.open(U.href,J)}return}if(o())return;const q=()=>k("closed"),Q=J=>{q(),I(J,{placeCaret:!0})},re=p,ne=J=>{var ge;re===p&&ee(U,{...S(U),component:Us(zj),props:{href:(J==null?void 0:J.href)||U.href,target:U.target,rel:U.rel,tooltip:U.tooltip,clickedElement:U.element,hyperlinkTarget:J,hyperlinkText:J==null?void 0:J.text,textTarget:(J==null?void 0:J.textTarget)??YO(U.element,(ge=U.editor)==null?void 0:ge.doc),documentMode:U.documentMode,ui:n(),closePopover:q,goToAnchor:Q}})};P(U).then(ne,()=>ne(null))}function H(U,q){k("replace");const Q=()=>k("closed");ee(U,{...S(U),component:Us(q.component),props:{...q.props,editor:U.editor,href:U.href,closePopover:Q}})}function te(U,q){k("replace");const Q=q.render;ee(U,{...S(U),render:re=>{try{const ne={container:re.container,editor:U.editor,href:U.href};return q.type==="render"?Q({...ne,close:()=>re.close("closed")}):Q({...ne,closePopover:()=>re.close("closed")})}catch(ne){const J=q.type==="render";if(u({error:KO(ne),source:J?"hyperlinks.onActivate.render":"linkPopoverExternalRender"}),re.close("external-error"),!J){const ge=p;queueMicrotask(()=>{ge===p&&F(U)})}return}}})}function M(U){var J,ge;const q=(ge=(J=l())==null?void 0:J.getBoundingClientRect)==null?void 0:ge.call(J),Q=typeof(q==null?void 0:q.left)=="number"?q.left:0,re=typeof(q==null?void 0:q.top)=="number"?q.top:0,ne={editor:t(),href:U.href,target:U.target,rel:U.rel,tooltip:U.tooltip,element:U.element,clientX:U.clientX,clientY:U.clientY,isAnchorLink:U.href.startsWith("#"),documentMode:U.documentMode,defaultAction:U.documentMode==="viewing"||U.editableText===!1||U.href.startsWith("#")&&ZO(U.element)?"navigate":"edit",position:{left:`${Math.max(0,U.clientX-Q)}px`,top:`${Math.max(0,U.clientY-re)}px`},getDocumentTarget:async()=>{var le;return((le=await P(ne))==null?void 0:le.address)??null},closePopover:()=>k("closed")};return ne}function Z(U){const q=r();if(typeof q!="function")return{type:"default"};const Q=i()==="hyperlinks.onActivate",re=Q?"hyperlinks.onActivate":"linkPopoverResolver",ne=()=>Q?{type:"suppress"}:{type:"default"};try{const J=q(U);
608return Ihe(J)?(Promise.resolve(J).catch(()=>{}),u({error:new Error(Q?"hyperlinks.onActivate must return synchronously; Promises are not supported.":"The hyperlink activation handler must return synchronously."),source:re}),ne()):J==null?{type:"default"}:Ohe(J)?J:(u({error:new Error(Q?"hyperlinks.onActivate returned an invalid result.":"The hyperlink activation handler returned an invalid result."),source:re}),ne())}catch(J){return u({error:KO(J),source:re}),ne()}}function L(U){if(!(U!=null&&U.element)||typeof U.href!="string")return;if(y(),d&&d.element===U.element&&d.href===U.href){k("toggle");return}if(V(U))return;const q=M(U);if(U.editableText===!1&&!s()){F(q);return}const Q=Z(q);if(Q.type==="suppress"||Q.type==="none"){k("none");return}if(Q.type==="custom"){H(q,Q);return}if(Q.type==="external"||Q.type==="render"){te(q,Q);return}F(q)}function W(){k("destroyed")}return{handleLinkClick:L,closeCurrentPopover:k,destroy:W}}var Vhe=Object.freeze({editorVersion:2,commands:null,state:null,view:null}),Hhe=["text.insert","text.replace","text.deleteBackward","text.deleteForward","text.paste","history.undo","history.redo","structural.splitBlock","structural.indent","structural.outdent"],QO=["comments.create","comments.resolve","comments.reopen","comments.delete","comments.reply","comments.edit","trackedChanges.accept","trackedChanges.reject","trackedChanges.acceptAll","trackedChanges.rejectAll"],$he=["trackedChanges.setAuthoringMode"];function ab(e){return e.state!=="ready"?e.state:e.documentMode==="viewing"?"review-ready":"editing-ready"}function tx(e){return e==="review-ready"||e==="editing-ready"}function JO(e){switch(e){case"text.insert":return"text.insert";case"text.replace":return"text.replace";case"text.deleteBackward":return"text.deleteBackward";case"text.deleteForward":return"text.deleteForward";case"text.paste":return"text.pastePlain";case"history.undo":return"history.undo";case"history.redo":return"history.redo";case"structural.splitBlock":return"structural.enter";case"structural.indent":return"structural.listIndent";case"structural.outdent":return"structural.listOutdent";default:return null}}function e7(e){switch(e){case"comments.create":return"comments.createFromSelection";case"comments.resolve":return"review.commentResolve";case"comments.reopen":return"review.commentReopen";case"comments.delete":return"review.commentDelete";case"comments.reply":return"review.commentReply";case"comments.edit":return"review.commentEdit";case"trackedChanges.accept":case"trackedChanges.reject":return"review.trackedChangeDecide";case"trackedChanges.acceptAll":return"trackedChanges.acceptAll";case"trackedChanges.rejectAll":return"trackedChanges.rejectAll";default:return null}}function $j(e,t){return e.editableSubset.commands.find(n=>n.command===t)??null}function Ghe(e){return(e==null?void 0:e.status)==="supported"||(e==null?void 0:e.enabled)===!0}function qhe(e){return(e==null?void 0:e.rejectionCode)??(e==null?void 0:e.reason)??null}function Whe(e){return(e==null?void 0:e.detail)??void 0}function nx(e,t){return Ghe($j(e,t))}function t7(e,t){const n=$j(e,t),r=qhe(n);return r?{reason:Gj(r),detail:Whe(n)}
608:e.documentMode==="viewing"?{reason:"document-readonly",detail:"review-surface-read-only"}:{reason:"command-unsupported",detail:`unsupported:${t}`}}function n7(e,t){const n=t==null?void 0:t.reason;return e==="history.undo"?n==="NO_EFFECT"||n==="apply-rejected"?"no-effect":"nothing-to-undo":n==="NO_EFFECT"||n==="apply-rejected"?"no-effect":"nothing-to-redo"}function Gj(e){switch(e){case"host-saving":return"host-saving";case"document-readonly":return"document-readonly";case"selection-invalidated":case"review-target-invalidated":return"selection-invalidated";case"review-command-unavailable":return"review-command-unavailable";case"review-surface-read-only":return"document-readonly";case"editing-selection-required":return"selection-unsupported";case"format-target-unsupported":case"selection-target-unsupported":case"input-target-unsupported":case"composition-target-unsupported":case"enter-context-unsupported":case"boundary-merge-unsupported":case"tracked-structural-edit-unsupported":case"comment-anchor-create-unsupported":case"comment-anchor-move-unsupported":return"target-unsupported";case"unsupported-command":return"command-unsupported";case"editing-mount-required":case"host-not-ready":case"host-disposed":return"runtime-not-ready";default:return"command-failed"}}function Khe(e){var le;const{id:t,documentId:n,root:r,host:i,getLegacyEditorProjection:o,onUnregister:s}=e;let l=i.getSnapshot(),u=!1,d=!1,f=null,p=0,m=0,y=null,b=null,k=null,S=null;const x=new Map,T=new Set;function C(ve){for(const Ee of Array.from(T))try{Ee(ve)}catch{}}function I(){p+=1,x.clear()}function D(ve){const Ee=`v2-runtime-pos-${m++}`;return x.set(Ee,ve),{runtimeId:t,tokenId:Ee,revision:p}}function P(ve){return ve.runtimeId!==t?{ok:!1,reason:"wrong-runtime-token"}:ve.revision!==p||!x.has(ve.tokenId)?{ok:!1,reason:"stale-position-token"}:{ok:!0}}function V(){var ve;return((ve=i.getHandles().editing)==null?void 0:ve.selection)??null}function ee(){var Ee;const ve=((Ee=V())==null?void 0:Ee.getSnapshot())??null;return ve?{isRange:ve.anchor!==ve.focus,isEmpty:ve.anchor===ve.focus,text:"",anchor:D(ve.anchor),focus:D(ve.focus)}:null}function F(){const ve=V();ve!==S&&(y==null||y(),y=null,S=ve,ve&&(y=ve.subscribe(Ee=>{I(),C({type:"selection-change",selection:Ee?{isRange:Ee.anchor!==Ee.focus,isEmpty:Ee.anchor===Ee.focus,text:"",anchor:D(Ee.anchor),focus:D(Ee.focus)}:{isRange:!1,isEmpty:!0,text:""}})})))}function H(){var Ee;const ve=((Ee=i.getDocumentFacade)==null?void 0:Ee.call(i))??null;return(ve==null?void 0:ve.available)===!0?ve.doc:null}function te(){const ve=H();return!!(ve!=null&&ve.comments&&ve.trackChanges)}function M(ve){if(!tx(ab(ve)))return[];const Ee=Hhe.filter(At=>{const yt=JO(At);return yt!==null&&nx(ve,yt)}),st=te()?QO.filter(At=>{const yt=e7(At);return yt!==null&&nx(ve,yt)}):[];return[...Ee,...st,...$he]}function Z(ve=l){const Ee=ab(ve),st=Ee!=="disposed",At=M(ve);return{lifecycle:{canFocus:st,canDispose:!0},selection:{canReadSelectedText:!0,canReadSelectionSnapshot:!0,canMintPositionTokens:!0},commands:{canDispatch:tx(Ee)&&At.length>0,supportedCommands:At},layout:{supported:!0,hasSyncSnapshot:!0},zoom:{supported:!0,min:25,max:400},navigation:{supported:!1,targets:[]},persistence:{canSave:!0,canExportDocx:!0},comments:{supported:!0,canMutate:ve.commentCommandsReason!=="author-required"&&["comments.create","comments.resolve","comments.reopen","comments.delete","comments.reply","comments.edit"].some(yt=>At.includes(yt))},trackedChanges:{supported:!0,canDecide:At.includes("trackedChanges.accept")||At.includes("trackedChanges.reject"),canToggleAuthoring:tx(Ee)}}}function L(){const ve=i.getPageMetricsSnapshot();return{pageCount:ve.pages.length,currentPage:1,zoom:ve.zoom.percent}}function W(ve=l){return{id:t,kind:"v2",documentId:n,state:ab(ve),documentMode:ve.documentMode,reason:ve.reason,capabilities:Z(ve)}}function U(ve){return(ve==null?void 0:ve.success)===!0?(I(),{status:"committed",receipt:ve}):ve&&"failure"in ve?{status:"receipt-failure",failure:ve.failure}:{status:"rejected",reason:"command-failed"}}function q(ve,Ee){return Ee?Ee.noop===!0?{status:"history-noop",reason:n7(ve,Ee),result:Ee}:(I(),{status:"history-committed",result:Ee}):{status:"rejected",reason:"command-failed"}}async function Q(ve){var yt,Ge,Be,he,Oe,ye,B,be,ie,fe,ue,Ce,Ue,K,oe,Fe,Le,tt,De,Pe,mt,xt,de,z,Y,me;const Ee=e7(ve.kind);if(Ee&&!nx(l,Ee)){const Ve=t7(l,Ee);return{status:"rejected",reason:Ve.reason,detail:Ve.detail}}const st=JO(ve.kind);if((ve.kind==="history.undo"||ve.kind==="history.redo")&&st&&!nx(l,st)){const Ve=t7(l,st);return{status:"rejected",reason:Ve.reason,detail:Ve.detail}}const At=H();if(!At)return QO.includes(ve.kind)?{status:"rejected",reason:"review-command-unavailable"}:null;try{switch(ve.kind){case"comments.create":{const Ve=await((Ge=(yt=At.selection)==null?void 0:yt.current)==null?void 0:Ge.call(yt)),lt=(Ve==null?void 0:Ve.empty)===!1?Ve.target:void 0;return U(await((he=(Be=At.comments)==null?void 0:Be.create)==null?void 0:he.call(Be,{text:ve.text,...lt?{target:lt}:{}})))}case"comments.resolve":return U(await((ye=(Oe=At.comments)==null?void 0:Oe.patch)==null?void 0:ye.call(Oe,{commentId:ve.commentId,status:"resolved"})));case"comments.reopen":return U(await((be=(B=At.comments)==null?void 0:B.patch)==null?void 0:be.call(B,{commentId:ve.commentId,status:"active"})));
608case"comments.delete":return U(await((fe=(ie=At.comments)==null?void 0:ie.delete)==null?void 0:fe.call(ie,{commentId:ve.commentId})));case"comments.reply":return U(await((Ce=(ue=At.comments)==null?void 0:ue.create)==null?void 0:Ce.call(ue,{parentCommentId:ve.parentCommentId,text:ve.text})));case"comments.edit":return U(await((K=(Ue=At.comments)==null?void 0:Ue.patch)==null?void 0:K.call(Ue,{commentId:ve.commentId,text:ve.text})));case"trackedChanges.accept":return U(await((Fe=(oe=At.trackChanges)==null?void 0:oe.decide)==null?void 0:Fe.call(oe,{decision:"accept",target:{kind:"id",id:ve.id}})));case"trackedChanges.reject":return U(await((tt=(Le=At.trackChanges)==null?void 0:Le.decide)==null?void 0:tt.call(Le,{decision:"reject",target:{kind:"id",id:ve.id}})));case"trackedChanges.acceptAll":return U(await((Pe=(De=At.trackChanges)==null?void 0:De.decide)==null?void 0:Pe.call(De,{decision:"accept",target:{kind:"all"}})));case"trackedChanges.rejectAll":return U(await((xt=(mt=At.trackChanges)==null?void 0:mt.decide)==null?void 0:xt.call(mt,{decision:"reject",target:{kind:"all"}})));case"history.undo":return q("history.undo",await((z=(de=At.history)==null?void 0:de.undo)==null?void 0:z.call(de)));case"history.redo":return q("history.redo",await((me=(Y=At.history)==null?void 0:Y.redo)==null?void 0:me.call(Y)));default:return null}}catch(Ve){return{status:"rejected",reason:"command-failed",detail:Ve instanceof Error?Ve.message:String(Ve)}}}function re(ve){l=ve,I(),F(),C({type:"state-change",state:ab(ve)}),C({type:"capabilities-change",capabilities:Z(ve)}),ve.state==="disposed"&&!u&&(u=!0,b==null||b(),k==null||k(),y==null||y(),y=null,C({type:"disposed"}),T.clear(),d||(d=!0,s==null||s(t)))}b=i.subscribe(re),k=((le=i.subscribePageMetrics)==null?void 0:le.call(i,()=>{C({type:"layout-change",layout:L()})}))??null,F();async function ne(ve){const Ee=ab(l);if(Ee==="disposed")return{status:"rejected",reason:"runtime-not-ready"};if(Ee==="saving")return{status:"rejected",reason:"host-saving"};if(!tx(Ee))return{status:"rejected",reason:"runtime-not-ready"};const st="at"in ve?ve.at:"range"in ve?ve.range:void 0;if(st){const Be=P(st);return Be.ok?{status:"rejected",reason:"target-unsupported",detail:"positioned dispatch is deferred until the shared runtime can target host selections explicitly"}:{status:"rejected",reason:Be.reason}}if(ve.kind==="trackedChanges.setAuthoringMode")return i.setDocumentMode(ve.mode==="tracked"?"suggesting":"editing"),I(),{status:"committed"};const At=await Q(ve);if(At)return At;let yt=null;switch(ve.kind){case"text.insert":yt={kind:"text.insert",text:ve.text};break;case"text.replace":yt={kind:"text.replace",text:ve.text};break;case"text.deleteBackward":yt={kind:"text.deleteBackward"};break;case"text.deleteForward":yt={kind:"text.deleteForward"};break;case"text.paste":yt={kind:"text.pastePlain",text:ve.text};break;case"history.undo":yt={kind:"history.undo"};break;case"history.redo":yt={kind:"history.redo"};break;case"structural.splitBlock":yt={kind:"structural.enter"};break;case"structural.indent":yt={kind:"structural.listIndent"};break;case"structural.outdent":yt={kind:"structural.listOutdent"};break;default:return{status:"rejected",reason:"command-unsupported",detail:ve.kind}}const Ge=await i.dispatch(yt);switch(Ge.status){case"committed":return I(),{status:"committed",receipt:Ge.receipt};case"history-committed":return I(),{status:"history-committed",result:Ge.result};case"history-noop":return{status:"history-noop",reason:n7(ve.kind,Ge.result),result:Ge.result};case"receipt-failure":return{status:"receipt-failure",failure:Ge.failure};case"rejected":return{status:"rejected",reason:Gj(Ge.rejection.code),detail:Ge.rejection.detail}}}async function J(ve){if(u||l.state==="disposed")return!1;const Ee=f==null?void 0:f.focus;return Ee&&typeof Ee.focus=="function"?await Ee.focus({restoreSelection:ve==null?void 0:ve.restoreSelection,preventScroll:ve==null?void 0:ve.preventScroll})!==!1:typeof r.focus=="function"?(r.focus({preventScroll:ve==null?void 0:ve.preventScroll}),!0):!1}async function ge(){u||(await i.dispose(),u||(u=!0,b==null||b(),k==null||k(),y==null||y(),y=null,C({type:"disposed"}),T.clear(),d||(d=!0,s==null||s(t))))}return{runtime:{id:t,kind:"v2",documentId:n,root:r,getCapabilities:()=>Z(),getSnapshot:()=>W(),setDocumentMode(ve){i.setDocumentMode(ve)},getDocumentMode:()=>i.getDocumentMode(),setTrackedChangesRenderOptions(ve){i.setTrackedChangesRenderOptions(ve)},getLegacyEditorProjection:()=>(o==null?void 0:o())??Vhe,focus:J,dispose:ge,dispatch:ne,getSelectedText:()=>"",getSelectionSnapshot:ee,getToolbarState(){return{activeMarks:[],disabled:["formatting.applyMark","formatting.applyParagraph"]}},getLayoutSnapshot:L,save:()=>i.save(),exportDocx:ve=>i.save({format:"docx",commentExportMode:(ve==null?void 0:ve.commentsType)==="clean"?"strip":"preserve"}),async setZoom(ve){const Ee=i.setZoom(ve);return Ee.status==="ok"?{status:"committed"}:{status:"rejected",reason:Ee.reason==="host-disposed"?"runtime-not-ready":"target-unsupported",detail
608:Ee.reason}},async reveal(ve){if(ve.kind==="position"){const Ee=P(ve.position);if(!Ee.ok)return{status:"rejected",reason:Ee.reason}}return{status:"rejected",reason:"capability-unsupported",detail:`${ve.kind} reveal is not exposed through the shared runtime yet`}},subscribe(ve){return T.add(ve),()=>{T.delete(ve)}}},attachMountHandle(ve){f=ve,F()}}}var r7=".superdoc-toolbar";function Yhe(e){return Array.isArray(e)?e:e&&typeof e=="object"&&Array.isArray(e.items)?e.items:[]}function Xhe(e){if(e&&typeof e=="object"){const t=e;return t.target??t.address??t.handle??e}return e}function r_(e){return typeof e=="function"}function qj(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function bC(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function Zhe(e){return bC(e)&&e.kind==="text"&&Array.isArray(e.segments)&&e.segments.length>0}function Qhe(e){return bC(e)&&e.kind==="story"&&(e.storyType==="headerFooterSlot"||e.storyType==="headerFooterPart")}function Jhe(e){var n;if(!r_((n=e.selection)==null?void 0:n.current))return{handled:!1,reason:"page-field-selection-unavailable"};let t;try{t=e.selection.current({includeText:!1})}catch{return{handled:!1,reason:"page-field-selection-unavailable"}}return qj(t)?{handled:!1,reason:"page-field-selection-async"}:!bC(t)||!Zhe(t.target)?{handled:!1,reason:"page-field-selection-unavailable"}:Qhe(t.target.story)?{handled:!0,target:t.target}:{handled:!1,reason:"page-field-context-unavailable"}}function j3(e,t){return!r_(e)||!r_(t)?!1:(Promise.resolve().then(()=>e()).then(n=>{for(const r of Yhe(n))try{Promise.resolve(t({target:Xhe(r)})).catch(()=>{})}catch{}}).catch(()=>{}),!0)}function epe(e){return{focusToolbar:()=>{var s;const i=e.resolveToolbarElement();if(!i)return{handled:!1,reason:"no-toolbar"};const o=typeof i.matches=="function"&&i.matches(r7)?i:((s=i.querySelector)==null?void 0:s.call(i,r7))??i;return o?(o.hasAttribute("tabindex")||o.setAttribute("tabindex","0"),typeof o.focus!="function"?{handled:!1,reason:"no-toolbar"}:(o.focus(),!0)):{handled:!1,reason:"no-toolbar"}},updateFields:()=>{var s,l,u,d,f,p;const i=e.getDocumentApi();if(!i)return{handled:!1,reason:"document-api-unavailable"};let o=j3((s=i.toc)==null?void 0:s.list,(l=i.toc)==null?void 0:l.update);return o=j3((u=i.fields)==null?void 0:u.list,(d=i.fields)==null?void 0:d.rebuild)||o,o=j3((f=i.index)==null?void 0:f.list,(p=i.index)==null?void 0:p.rebuild)||o,o?!0:{handled:!1,reason:"field-update-workflow-unavailable"}},insertPageField:i=>{var u;if(i==="page"&&e.pageNumberCommand)return e.pageNumberCommand.isEnabled()?(e.pageNumberCommand.execute().catch(()=>{}),!0):{handled:!1,reason:"page-field-context-unavailable"};const o=e.getDocumentApi();if(!o)return{handled:!1,reason:"document-api-unavailable"};if(!r_((u=o.fields)==null?void 0:u.insert))return{handled:!1,reason:"page-field-insert-unavailable"};const s=Jhe(o);if(!s.handled||!s.target)return{handled:!1,reason:s.reason??"page-field-context-unavailable"};const l=i==="page"?"PAGE":"NUMPAGES";try{const d=o.fields.insert({at:s.target,instruction:l,mode:"raw"});if(qj(d))d.catch(()=>{});else if(bC(d)&&d.success===!1)return{handled:!1,reason:"page-field-insert-failed"}}catch{return{handled:!1,reason:"page-field-insert-failed"}}return!0}}}function tpe(e){let t=null;return n=>{const r=t;let i;const o=new Promise(l=>{i=l});t=o;const s=async()=>{try{return await e(n)}finally{t===o&&(t=null),i()}};return r?r.then(s):s()}}var i_="data-superdoc-runtime-id";function npe(e,t){e.setAttribute(i_,t)}function i7(e){e.removeAttribute(i_)}function rpe(e,t){let n,r;switch(e){case"collaboration-access-denied":n="access-denied",r="The collaboration server rejected access to this room.";break;case"collaboration-connection-failed":n="connection-failed",r="The collaboration connection failed.";break;case"collaboration-sync-timeout":n="sync-timeout",r="The collaboration room did not finish synchronizing in time.";break;default:return null}return{error:new Error(r),code:e,collaborationReason:n,documentId:t,editor:null}}function ipe(e){const t=e.telemetry;return t===null||(t==null?void 0:t.enabled)===!1?null:{enabled:!0,endpoint:t==null?void 0:t.endpoint,metadata:t==null?void 0:t.metadata,licenseKey:e.licenseKey!==void 0?e.licenseKey:(t==null?void 0:t.licenseKey)??"community-and-eval-agplv3"}}function ope(e){const t=new WeakSet;return{trackDocumentOpen(n,r,i=null){n&&t.has(n)||(n&&t.add(n),e.trackDocumentOpen(r,i))}}}function spe(e){const t=ipe(e);return t?ope(new xoe(t)):null}var ape="PKG-payload-",lpe=new Set(["main-document-fallback"]),cpe=new Set(["dangling-content-type-override","dangling-internal-relationship","relationship-id-collision","parts-not-referenced-from-known-rels"]);function o7(e,t={}){if(!e||typeof e.code!="string")return null;const{code:n,severity:r,message:i}=e,o=r==="error",s=r==="warn"&&lpe.has(n);if(!o&&!s||cpe.has(n)&&!o)return null;const l=n.startsWith(ape)?"PERFORMANCE_ERROR":"PARSE_ERROR";return{error:new Error(i||n),diagnosticCode:l,diagnosticStage:"unzip",severity:o?"error":"warn",internalCode:n,documentId:t.documentId??null,editor:t.editor??null,message:i||n}}function upe(e,t={}){if(!e||typeof e.code!="string")return null;const{code:n,reason:r,severity:i}=e;if(i!=="error"&&i!=="warn"||n==="render.exact-content-hydration-failed")return null;let o;if(n.includes("page-geometry.failed")||n.includes("section-metadata.failed")||n.includes("page-furniture.failed")||n==="render.provider-error")o="RENDER_ERROR";else if(n.includes("unsupported"))o="UNSUPPORTED_FEATURE";else if(n.includes("degraded"))o=typeof r=="string"&&(r.includes("retained ")||r.includes("localized resolve "))?"RENDER_ERROR":"PERFORMANCE_ERROR";else if(i==="error")o="RENDER_ERROR";else return null;const s=r||n;return{error:new Error(s),diagnosticCode:o,diagnosticStage:"render",severity:i,internalCode:n,documentId:t.documentId??null,editor:t.editor??null,message:s}}var s7={OpenRenderNoProgressError:"PERFORMANCE_ERROR",BoundedLocalPageCapError:"PERFORMANCE_ERROR",MountedEnginePassInterrupt:"RENDER_ERROR",RenderSchedulerWaitError:"RENDER_ERROR"}
608,dpe=new Set(["open-failed","source-load-failed"]),a7=new Map([["input-too-large-for-inline-review","unzip"]]);function fpe(e,t,n={}){const{bootErrorName:r,documentId:i,editor:o}=n;if(r&&s7[r]){const l=t||r;return{error:new Error(l),diagnosticCode:s7[r],diagnosticStage:"render",severity:"error",internalCode:r,documentId:i??null,editor:o??null,message:l}}if(a7.has(e)){const l=t||e;return{error:new Error(l),diagnosticCode:"PERFORMANCE_ERROR",diagnosticStage:a7.get(e),severity:"error",internalCode:e,documentId:i??null,editor:o??null,message:l}}if(!dpe.has(e))return null;const s=t||e;return{error:new Error(s),diagnosticCode:"PARSE_ERROR",diagnosticStage:"unzip",severity:"error",internalCode:e,documentId:i??null,editor:o??null,message:s}}var hpe=new Set(["SSIG-SECT-parse-error","SSIG-PAGE-parse-error","SSIG-SETTINGS-parse-error","SSIG-USAGE-body-parse-error","SSIG-USAGE-numbering-parse-error"]);function ppe(e,t={}){if(!e||typeof e.code!="string")return null;const{code:n,severity:r,message:i}=e;return!hpe.has(n)||r!=="error"?null:{error:new Error(i||n),diagnosticCode:"PARSE_ERROR",diagnosticStage:"parse",severity:r,internalCode:n,documentId:t.documentId??null,editor:t.editor??null,message:i||n}}function mpe(e,t={}){const n=e&&typeof e=="object"&&typeof e.name=="string"&&e.name||"export-failed",r=e&&typeof e=="object"&&typeof e.message=="string"&&e.message||"DOCX export failed";return{error:e,diagnosticCode:"RENDER_ERROR",diagnosticStage:"export",severity:"error",internalCode:n,documentId:t.documentId??null,editor:t.editor??null,message:r}}function rx(e){return typeof(e==null?void 0:e.generation)=="number"?e.generation:0}function gpe(){const e=new Map,t=new Map;return{shouldEmit(n,r,i){const o=n??"";let s=e.get(o);(!s||t.get(o)!==r)&&(s=new Set,e.set(o,s),t.set(o,r));const l=i??"";return s.has(l)?!1:(s.add(l),!0)}}}function ype(e,t,n){return!!e&&e.internalCode===t&&n.length>0}var Wj=li({__name:"SurfaceExternalMount",props:{surfaceId:{type:String,required:!0},mode:{type:String,required:!0},request:{type:Object,required:!0},render:{type:Function,required:!0},resolve:{type:Function,required:!0},close:{type:Function,required:!0}},setup(e){const t=e,n=Ne(null);let r=null;function i(){var s;o(),!(!n.value||!t.render)&&(r=((s=t.render({container:n.value,surfaceId:t.surfaceId,mode:t.mode,request:t.request,resolve:t.resolve,close:t.close}))==null?void 0:s.destroy)??null)}function o(){typeof r=="function"&&r(),r=null,n.value&&(n.value.innerHTML="")}return po(i),Hs(o),pr(()=>t.surfaceId,()=>{i()}),(s,l)=>(Ze(),ut("div",{ref_key:"container",ref:n,class:"sd-surface-external-mount"},null,512))}},[["__scopeId","data-v-b2412c5d"]]),IE=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "),vpe=["aria-labelledby","aria-label"],bpe=["id"],wpe={class:"sd-surface-dialog__content"},xpe=li({__name:"SurfaceDialog",props:{surface:{type:Object,required:!0},scrollLockTarget:{type:Object,default:null}},emits:["close"],setup(e,{emit:t}){const n=e,r=t,i=Ne(null),o=dt(()=>n.surface.request.title?`sd-surface-title-${n.surface.id}`:void 0),s=dt(()=>o.value??n.surface.request.ariaLabelledBy??void 0),l=dt(()=>s.value?void 0:n.surface.request.ariaLabel);let u=null;function d(D){if(!i.value)return;const P=i.value.querySelectorAll(IE);if(P.length===0)return;const V=P[0],ee=P[P.length-1];D.shiftKey&&document.activeElement===V?(D.preventDefault(),ee.focus()):!D.shiftKey&&document.activeElement===ee&&(D.preventDefault(),V.focus())}function f(){if(!i.value)return;const D=i.value.querySelector(IE);D?D.focus():i.value.focus()}let p=null,m="";function y(){var D;if(n.scrollLockTarget)p=n.scrollLockTarget;else{const P=(D=i.value)==null?void 0:D.closest(".superdoc");p=(P==null?void 0:P.querySelector(".superdoc__layers"))??P}p&&(m=p.style.overflow,p.style.overflow="hidden")}function b(){p&&(p.style.overflow=m,p=null,m="")}function k(D){if(D.key==="Tab"){d(D);return}D.key==="Escape"&&n.surface.request.closeOnEscape!==!1&&(D.stopPropagation(),r("close"))}function S(D){D.target===D.currentTarget&&(D.preventDefault(),n.surface.request.closeOnBackdrop!==!1&&r("close"))}const x=dt(()=>({surfaceId:n.surface.id,mode:"dialog",request:n.surface.request,resolve:n.surface.resolve,close:n.surface.close})),T=dt(()=>({...n.surface.props??{},...x.value})),C=dt(()=>{var P;const D=(P=n.surface.request.dialog)==null?void 0:P.maxWidth;
608if(D!=null)return typeof D=="number"?`${D}px`:D}),I=dt(()=>{const D={};return C.value&&(D["max-width"]=C.value),D});return po(async()=>{u=document.activeElement,y(),await Sn(),f()}),pr(()=>n.scrollLockTarget,(D,P)=>{D!==P&&(b(),y())}),Hs(()=>{b(),u&&typeof u.focus=="function"&&u.focus(),u=null}),(D,P)=>(Ze(),ut("div",{class:"sd-surface-dialog-backdrop",onMousedown:Gr(S,["self"]),onKeydown:k},[et("div",{ref_key:"dialogRef",ref:i,class:"sd-surface-dialog",style:Ai(I.value),role:"dialog","aria-modal":"true","aria-labelledby":s.value,"aria-label":l.value,tabindex:"-1"},[e.surface.request.title?(Ze(),ut("div",{key:0,id:o.value,class:"sd-surface-dialog__title"},Un(e.surface.request.title),9,bpe)):gn("",!0),et("div",wpe,[e.surface.render?(Ze(),ei(Wj,{key:0,"surface-id":e.surface.id,mode:"dialog",request:e.surface.request,render:e.surface.render,resolve:e.surface.resolve,close:e.surface.close},null,8,["surface-id","request","render","resolve","close"])):e.surface.component?(Ze(),ei(LD(e.surface.component),DD(g1({key:1},T.value)),null,16)):gn("",!0)])],12,vpe)],32))}},[["__scopeId","data-v-582b6534"]]),kpe=["aria-labelledby","aria-label"],_pe=["id"],Cpe={class:"sd-surface-floating__content"},Spe=li({__name:"SurfaceFloating",props:{surface:{type:Object,required:!0}},setup(e,{expose:t}){const n=e,r=Ne(null);t({rootEl:r});const i=Ne({}),o=dt(()=>n.surface.request.title?`sd-surface-title-${n.surface.id}`:void 0),s=dt(()=>o.value??n.surface.request.ariaLabelledBy??void 0),l=dt(()=>s.value?void 0:n.surface.request.ariaLabel),u=dt(()=>n.surface.request.floating??{}),d=dt(()=>{const C=u.value;return C.top!=null||C.right!=null||C.bottom!=null||C.left!=null}),f=dt(()=>{const C=["sd-surface-floating"];if(!d.value){const I=u.value.placement??"top-right";C.push(`sd-surface-floating--${I}`)}return C});function p(C){if(C!=null)return typeof C=="number"?`${C}px`:C}const m=dt(()=>{const C=u.value,I={};return C.top!=null&&(I.top=p(C.top)),C.right!=null&&(I.right=p(C.right)),C.bottom!=null&&(I.bottom=p(C.bottom)),C.left!=null&&(I.left=p(C.left)),C.width!=null&&(I.width=p(C.width)),C.maxWidth!=null&&(I["max-width"]=p(C.maxWidth)),C.maxHeight!=null&&(I["max-height"]=p(C.maxHeight)),{...I,...i.value}});async function y(){if(i.value={},!d.value)return;await Sn(),await new Promise(H=>requestAnimationFrame(H));const C=r.value,I=C==null?void 0:C.parentElement;if(!C||!I)return;const D=8,P=C.getBoundingClientRect(),V=I.getBoundingClientRect(),ee={},F=u.value;if(F.left!=null&&F.right==null){const H=P.left-V.left,te=Math.max(D,V.width-P.width-D),M=Math.min(Math.max(H,D),te);M!==H&&(ee.left=`${M}px`)}if(F.top!=null&&F.bottom==null){const H=P.top-V.top,te=Math.max(D,V.height-P.height-D),M=Math.min(Math.max(H,D),te);M!==H&&(ee.top=`${M}px`)}i.value=ee}pr(u,y,{deep:!0});const b=dt(()=>({surfaceId:n.surface.id,mode:"floating",request:n.surface.request,resolve:n.surface.resolve,close:n.surface.close})),k=dt(()=>({...n.surface.props??{},...b.value}));let S=null,x=!1,T=null;return po(async()=>{var I;if(y(),window.addEventListener("resize",y),typeof ResizeObserver<"u"&&((I=r.value)!=null&&I.parentElement)&&(T=new ResizeObserver(y),T.observe(r.value.parentElement),T.observe(r.value)),u.value.autoFocus===!1||(await Sn(),!r.value))return;const C=r.value.querySelector("[data-sd-autofocus]")??r.value.querySelector(IE);C&&(S=document.activeElement,C.focus(),x=!0)}),Hs(()=>{window.removeEventListener("resize",y),T==null||T.disconnect(),T=null,x&&S&&typeof S.focus=="function"&&S.focus(),S=null,x=!1}),(C,I)=>(Ze(),ut("div",{ref_key:"floatingRef",ref:r,class:Wr(f.value),style:Ai(m.value),role:"dialog","aria-labelledby":s.value,"aria-label":l.value,"data-editor-ui-surface":""},[e.surface.request.title?(Ze(),ut("div",{key:0,id:o.value,class:"sd-surface-floating__title"},Un(e.surface.request.title),9,_pe)):gn("",!0),et("div",Cpe,[e.surface.render?(Ze(),ei(Wj,{key:0,"surface-id":e.surface.id,mode:"floating",request:e.surface.request,render:e.surface.render,resolve:e.surface.resolve,close:e.surface.close},null,8,["surface-id","request","render","resolve","close"])):e.surface.component?(Ze(),ei(LD(e.surface.component),DD(g1({key:1},k.value)),null,16)):gn("",!0)])],14,kpe))}},[["__scopeId","data-v-cd2be5db"]]),Epe=li({__name:"SurfaceHost",props:{geometryTarget:{type:Object,default:null}},setup(e){const t=e,n=VA("surfaceManager",null),r=dt(()=>(n==null?void 0:n.activeDialog.value)??null),i=dt(()=>(n==null?void 0:n.activeFloating.value)??null),o=dt(()=>r.value!=null||i.value!=null),s=Ne(null),l=Ne(null),u=Ne({}),d=new Set(["hidden","scroll","auto","clip"]);function f(Z){const L=[];let W=Z.parentElement;for(;W;){const U=getComputedStyle(W);(d.has(U.overflowX)||d.has(U.overflowY))&&L.push(W),W=W.parentElement}return L}function p(Z,L){let W=0,U=0,q=window.innerWidth,Q=window.innerHeight;for(const ne of L){const J=ne.getBoundingClientRect(),ge=getComputedStyle(ne);d.has(ge.overflowX)&&(U=Math.max(U,J.left),q=Math.min(q,J.right)),d.has(ge.overflowY)&&(W=Math.max(W,J.top),Q=Math.min(Q,J.bottom))}const re=Z.getBoundingClientRect();return W=Math.max(W,re.top),U=Math.max(U,re.left),q=Math.min(q,re.right),Q=Math.min(Q,re.bottom),{top:W,left:U,width:Math.max(q-U,0),height:Math.max(Q-W,0)}}let m=null,y=[],b=0,k=null;function S(){if(!m)return;const{top:Z,left:L,width:W,height:U}=p(m,y);u.value={position:"fixed",top:`${Z}px`,left:`${L}px`,width:`${W}px`,height:`${U}px`}}function x(){b||(b=requestAnimationFrame(()=>{b=0,S()}))}function T(){if(m=t.geometryTarget??null,!!m){y=f(m),S(),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),k=new ResizeObserver(x),k.observe(m);for(const Z of y)k.observe(Z)}}function C(){b&&(cancelAnimationFrame(b),b=0),window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x),k&&(k.disconnect(),k=null),m=null,y=[]}pr(o,Z=>{Z?T():C()}),pr(()=>t.geometryTarget,Z=>{Z&&o.value&&!m&&T()}),po(()=>{o.value&&T()});function I(Z){const L=i.value;!L||L.settled||r.value||Z.key==="Escape"&&L.request.closeOnEscape!==!1&&(Z.stopPropagation(),n.close(L.id))}let D=!1;function P(){D||(document.addEventListener("keydown",I,!0),D=!0)}function V(){D&&(document.removeEventListener("keydown",I,!0),D=!1)}function ee(Z){var U;const L=i.value;if(!L||L.settled||r.value)return;const W=(U=l.value)==null?void 0:U.rootEl;W&&!W.contains(Z.target)&&n.close(L.id)}let F=!1;function H(){F||(document.addEventListener("pointerdown",ee,!0),F=!0)}function te(){F&&(document.removeEventListener("pointerdown",ee,!0),F=!1)}pr(i,Z=>{var L;Z&&!Z.settled?(P(),(L=Z.request.floating)!=null&&L.closeOnOutsidePointerDown?H():te()):(V(),te())},{immediate:!0}),Hs(()=>{C(),V(),te()});function M(){const Z=r.value;Z&&!Z.settled&&n.close(Z.id)}
608return(Z,L)=>(Ze(),ei(Hy,{to:"body"},[o.value?(Ze(),ut("div",{key:0,ref_key:"hostRef",ref:s,class:"sd-surface-host",style:Ai(u.value)},[i.value?(Ze(),ei(Spe,{key:i.value.id,surface:i.value,ref_key:"floatingRef",ref:l},null,8,["surface"])):gn("",!0)],4)):gn("",!0),r.value?(Ze(),ei(xpe,{key:r.value.id,surface:r.value,"scroll-lock-target":Yt(m),onClose:M},null,8,["surface","scroll-lock-target"])):gn("",!0)]))}},[["__scopeId","data-v-dad99b67"]]),Ape=["innerHTML"],Tpe={class:"superdoc__document document"},Ipe={class:"floating-comments"},l7="superdoc:v2-tracked-change-carriers-restamped",c7=!1,Rpe=3,Ope=li({__name:"SuperDoc",emits:["selection-update"],setup(e,{emit:t}){var Pl;const n=uK(()=>ag(()=>import("./PdfViewer-B8y_9or_.es-C0gnlv-Z.js"),[])),r=$=>$.password??ie.$superdoc.config.password,i=$=>{const se=$==null?void 0:$.v2Collaboration,ze=se&&typeof se=="object"&&"value"in se?se.value:se;if(ze==null)return{state:"absent"};const We=xj({v2Collaboration:ze,documentType:($==null?void 0:$.type)??null,documentCount:l.value.length,...typeof window<"u"?{authEndpointBaseUrl:window.location.href}:{}});if(!We.ok)return{state:"invalid",failure:{code:We.reason==="invalid-room-mode"?"collaboration-open-intent-invalid":"collaboration-config-invalid",message:`SuperDoc rejected the v2 collaboration configuration (${We.reason}).`}};const{providerFamily:bt,...Jt}=We.target;return{state:"valid",config:{providerType:bt,...Jt}}},o=tv(),s=qd(),{documents:l,isReady:u,areDocumentsReady:d,selectionPosition:f,activeSelection:p,activeZoom:m,zoomMode:y,measurementUnit:b,viewportMetrics:k}=Hd(o),{handlePageReady:S,modules:x,user:T,getDocument:C}=o,I=VA("surfaceManager",null),D=pfe({getSurfaceManager:()=>I,getPasswordPromptConfig:()=>{var $,se,ze,We;return(We=(ze=(se=($=ie.$superdoc)==null?void 0:$.config)==null?void 0:se.modules)==null?void 0:ze.surfaces)==null?void 0:We.passwordPrompt},onUnhandled:($,se,ze)=>{var We;(We=ie.$superdoc)==null||We.emit("exception",{error:(ze==null?void 0:ze.error)??new Error(`Password prompt unhandled: ${se}`),editor:(ze==null?void 0:ze.editor)??null,code:se,documentId:$==null?void 0:$.id})}}),{getConfig:P,documentsWithConverations:V,commentsList:ee,pendingComment:F,activeComment:H,skipSelectionUpdate:te,commentsByDocument:M,isCommentsListVisible:Z,isFloatingCommentsReady:L,generalCommentIds:W,hasSyncedCollaborationComments:U,editorCommentPositions:q,hasInitializedLocations:Q,isCommentHighlighted:re,hasOpenTrackedChanges:ne}=Hd(s),{showAddComment:J,handleEditorLocationsUpdate:ge,handleTrackedChangeUpdate:le,refreshTrackedChangeCommentsByIds:ve,syncTrackedChangePositionsWithDocument:Ee,syncTrackedChangeComments:st,addComment:At,addHydratedComment:yt,getComment:Ge,resolve
608CommentPositionEntry:Be,belongsToDocument:he,COMMENT_EVENTS:Oe,requestInstantSidebarAlignment:ye,peekInstantSidebarAlignment:B,clearInstantSidebarAlignment:be}=s,{proxy:ie}=fh();s.proxy=ie;const fe=spe(ie.$superdoc.config),ue=Lle(ie.$superdoc.config),Ce=Us(ue.EditorComponent),Ue=ue.RulerComponent?Us(ue.RulerComponent):null,K=dt(()=>{const $=Yt(s.getFloatingComments);return Array.isArray($)?$:[]}),{isHighContrastMode:oe}=cu(),{uiFontFamily:Fe}=iT(),Le=()=>s.viewingVisibility.documentMode==="viewing",tt=()=>{var $,se;return!!((se=($=ie==null?void 0:ie.$superdoc)==null?void 0:$.config)!=null&&se.allowSelectionInViewMode)},De=dt(()=>Le()&&s.viewingVisibility.commentsVisible===!0),Pe=dt(()=>{var $,se,ze;return((ze=(se=($=ie==null?void 0:ie.$superdoc)==null?void 0:$.uiConfig)==null?void 0:se.search)==null?void 0:ze.enabled)===!0});dt(()=>Le()&&s.viewingVisibility.trackChangesVisible===!0);const mt=dt(()=>s.shouldRenderReviewInViewing),xt=dt(()=>{var $;return ie.$superdoc.config.proofing!==void 0?ie.$superdoc.config.proofing:($=ie.$superdoc.config.layoutEngineOptions)==null?void 0:$.proofing}),de=dt(()=>{var ze,We,bt;const $=x.comments;if($===!1||$==null)return null;const se=(bt=(We=(ze=ie.$superdoc)==null?void 0:ze.uiConfig)==null?void 0:We.comments)==null?void 0:bt.options;return!se||Object.keys(se).length===0?$:Gde($,se)}),z=dt(()=>{const $={"--sd-ui-font-family":Fe.value},se=de.value;if(!se)return $;se.highlightHoverColor&&($["--sd-comments-highlight-hover"]=se.highlightHoverColor);const ze={...se.trackChangeHighlightColors||{},...se.trackChangeActiveHighlightColors||{}};return ze.insertBorder&&($["--sd-tracked-changes-insert-border"]=ze.insertBorder),ze.insertBackground&&($["--sd-tracked-changes-insert-background"]=ze.insertBackground),ze.deleteBorder&&($["--sd-tracked-changes-delete-border"]=ze.deleteBorder),ze.deleteBackground&&($["--sd-tracked-changes-delete-background"]=ze.deleteBackground),ze.formatBorder&&($["--sd-tracked-changes-format-border"]=ze.formatBorder),$}),Y=Ne(null),me=Ne(null),Ve=Ne(null),lt=Ne(null),gt=Ne(!1),dn=Sl({top:null,right:"-25px",zIndex:101}),{superdocContainerWidth:Hn,isCompactCommentsMode:br,recalculateCompactCommentsMode:ur,ensureCompactMeasurementObserver:tr}=Ode({commentsModuleConfig:de,superdocRoot:Y,layers:me}),Br=dt(()=>!0),Lr=Zs(null),$e=Ne(!1),Bt=Ne(!1),hn=Ne(null);let Pn=0,jn=0,Lt=null;const St=dt(()=>ie.$superdoc.activeEditor),Te=()=>{var $;return(($=ie.$superdoc)==null?void 0:$.ui)??null},qe=Object.freeze({enabled:!1,active:!1,supported:!1}),it=gfe({getSurfaceManager:()=>I,getActiveEditor:()=>{var $;return($=ie.$superdoc)==null?void 0:$.activeEditor},activeEditorRef:St,getFindReplaceConfig:()=>{var $,se,ze;return(ze=(se=($=ie.$superdoc)==null?void 0:$.uiConfig)==null?void 0:se.search)!=null&&ze.enabled?ie.$superdoc.uiConfig.search.options:!1},getSuperDocUI:Te}),Et=()=>{var $;return I||(typeof(($=ie.$superdoc)==null?void 0:$.openSurface)!="function"?null:{open:se=>ie.$superdoc.openSurface(se)})},$t=()=>{var se;const $=Jw((se=ie.$superdoc)==null?void 0:se.config);return $.editableActivationDisabled?()=>({type:"none"}):$.handler},rn=Uhe({getSurfaceManager:Et,getActiveEditor:()=>{var $;return($=ie.$superdoc)==null?void 0:$.activeEditor},getUi:Te,getActivationHandler:$t,getActivationHandlerSource:()=>{var $;return Jw(($=ie.$superdoc)==null?void 0:$.config).handlerSource},getBuiltInEditorDisabled:()=>{var $;return Jw(($=ie.$superdoc)==null?void 0:$.config).builtInEditorDisabled},shouldInterceptNavigationOnlyHyperlinks:()=>{var $;return Jw(($=ie.$superdoc)==null?void 0:$.config).interceptsNavigationOnly},getLayerElement:()=>me.value,emitException:$=>{var se,ze;(ze=ie.$superdoc)==null||ze.emit("exception",{...$,editor:((se=ie.$superdoc)==null?void 0:se.activeEditor)??null})}}),Wn=((Pl=ie.$superdoc.config.modules)==null?void 0:Pl.pdf)||{},qr=()=>{var $;gt.value&&(gt.value=!1,st({superdoc:ie.$superdoc,editor:($=ie.$superdoc)==null?void 0:$.activeEditor}))},Yr=()=>{gt.value=!0,Sn(()=>{qr()})},gi=($,se)=>{const ze=C($);ze.isReady=!0,ze.container=se,d.value&&(ie.$superdoc.config.collaboration||(u.value=!0)),ks(),L.value=!0,Q.value=!0,ie.$superdoc.broadcastPdfDocumentReady()},Jn=()=>
608{if(!f.value||!me.value)return null;const $=f.value.source==="pdf"?(m.value??100)/100:1,se=Number(f.value.top);return Number.isFinite(se)?me.value.getBoundingClientRect().top+se*$:null},Tr=async()=>{var se;if(((se=await J(ie.$superdoc,Jn()))==null?void 0:se.ok)===!1||!Br.value)return;const $=Ja();$&&Oc($)},zr=async $=>{const se={comments:()=>Tr()};$ in se&&await se[$](p.value,f.value),p.value=null,dn.top=null},Kn=()=>dn.top=null,Gn=new Map,ni=new Map,Di=new Map,Ro=new Map;let Si=0;const Gs=$=>{var ze;const se=Di.get($);if(se){Di.delete($);try{(ze=se.unbind)==null||ze.call(se)}catch(We){console.warn("[SuperDoc] v2 command-shortcut unbind failed",We)}}},Oo=()=>{var se;const $=(se=ie.$superdoc)==null?void 0:se.toolbar;return!$||typeof $.getToolbarItemByName!="function"?null:()=>{var We,bt;const ze=$.getToolbarItemByName("link");!ze||((We=ze.disabled)==null?void 0:We.value)===!0||(ze.expand&&typeof ze.expand=="object"&&"value"in ze.expand&&(ze.expand.value=!0),(bt=$.updateToolbarState)==null||bt.call($))}},Hi=({documentId:$,bindEditShortcuts:se})=>{if(!$||(Gs($),typeof se!="function"))return;const ze=Oo(),We=se({commandRoute:{executeAsync:(bt,Jt)=>{const vn=Te();return vn?G0(vn,bt,Jt):Promise.resolve(c7)},getState:bt=>{var Jt;return((Jt=Te())==null?void 0:Jt.commands.get(bt).getState())??qe}},...ze?{openLinkWorkflow:ze}:{}});Di.set($,{unbind:We})},cn=$=>{var ze;const se=Ro.get($);if(se){Ro.delete($);try{(ze=se.unbind)==null||ze.call(se)}catch(We){console.warn("[SuperDoc] v2 session-shortcut unbind failed",We)}}},Fn=({documentId:$,bindSessionShortcuts:se,documentApi:ze})=>{if(!$||(cn($),typeof se!="function"))return;const We=se({routes:epe({resolveToolbarElement:()=>{var bt,Jt;return((Jt=(bt=ie.$superdoc)==null?void 0:bt.toolbar)==null?void 0:Jt.toolbarContainer)??null},getDocumentApi:()=>ze??null,pageNumberCommand:{isEnabled:()=>{var bt;return((bt=Te())==null?void 0:bt.commands.get("page-number-insert").getState().enabled)===!0},execute:()=>{const bt=Te();return bt?G0(bt,"page-number-insert"):Promise.resolve(c7)}}}),isMutationAllowed:()=>!Le()});Ro.set($,{unbind:We})},dr=($,se)=>{$!=null&&$.id&&(se?Gn.set($.id,se):Gn.delete($.id))},rr=$=>{Gs($),cn($);const se=C($),ze=(se==null?void 0:se.provider)??null;ze&&ie.$superdoc.provider===ze&&(ie.$superdoc.provider=void 0),se&&(ze!=null&&ze.sendStateless)&&(se.provider=null);const We=ni.get($);if(!We)return;ie.$superdoc.unregisterEditorRuntime(We.runtimeId),ni.delete($);const bt=Gn.get($);bt&&i7(bt)},je=({documentId:$,host:se,mount:ze,facade:We})=>{const bt=Gn.get($);if(!bt)return console.warn("[SuperDoc] v2 runtime host root unavailable; skipping runtime registration for",$),!1;ni.has($)&&rr($);const Jt=`v2:${$}:${++Si}`,vn=Khe({id:Jt,documentId:$,root:bt,host:se,getLegacyEditorProjection:()=>We,onUnregister:qn=>{ie.$superdoc.unregisterEditorRuntime(qn);const Cr=ni.get($);Cr&&Cr.runtimeId===qn&&ni.delete($);const ln=Gn.get($);ln&&i7(ln)}});return vn.attachMountHandle(ze??null),npe(bt,Jt),ie.$superdoc.registerE
608ditorRuntime(vn.runtime),ni.set($,{runtimeId:Jt,adapter:vn}),ie.$superdoc.setActiveRuntime(Jt,"v2-editor-ready"),!0},Je=ue.createReviewWindowController({applyReviewWindow:($,se)=>{var ze,We,bt,Jt,vn,qn;return((qn=s.applyReviewWindowFromV2)==null?void 0:qn.call(s,{superdoc:$==null?void 0:$.superdoc,commentsAdapter:$==null?void 0:$.commentsAdapter,trackedChangesAdapter:$==null?void 0:$.trackedChangesAdapter,documentId:$==null?void 0:$.documentId,commentItems:(ze=se==null?void 0:se.comments)==null?void 0:ze.items,trackedChangeItems:(We=se==null?void 0:se.trackedChanges)==null?void 0:We.items,requestedCommentIds:(bt=se==null?void 0:se.comments)==null?void 0:bt.requestedIds,requestedTrackedChangeIds:(Jt=se==null?void 0:se.trackedChanges)==null?void 0:Jt.requestedIds,unresolvedCommentIds:(vn=se==null?void 0:se.comments)==null?void 0:vn.unresolvedCommentIds,trackedList:{complete:!1,visibleWindowSource:"visible-window"},patch:Cr=>s.$patch(Cr)}))??{ok:!1,reason:"store-action-missing"}}}),Ut=Ne({}),un=gpe(),Xt=Qde(),Zn=lfe(),Bi=$=>typeof $=="string"&&$.length>0?`document:${$}`:"document:default",ri=$=>{const se=Bi($);Xt.clear(se),Zn.clear(se)},ot=($,se)=>{Xt.shouldNotify(Bi($),se)&&ie.$superdoc.emit("exception",{error:new Error(Zde,{cause:Bj(se)}),code:Xde,editor:null,...typeof $=="string"&&$.length>0?{documentId:$}:{}})},jt=($,se)=>{Zn.shouldNotify(Bi($),se)&&ie.$superdoc.emit("exception",afe($,se))},gr=($,se)=>{$&&(Ut.value={...Ut.value,[$]:se})},$n=$=>{if(!$||!Ut.value[$])return;const se={...Ut.value};delete se[$],Ut.value=se},Pr=($=null)=>{var Jt,vn,qn,Cr;const se=(Jt=ie.$superdoc)==null?void 0:Jt.activeEditor,ze=$??(se==null?void 0:se.documentId)??((vn=se==null?void 0:se.options)==null?void 0:vn.documentId)??null;if(!ze){(se==null?void 0:se.editorVersion)===2&&ie.$superdoc.setActiveEditor(null);return}if($&&(se==null?void 0:se.editorVersion)===2){const ln=se.documentId??((qn=se.options)==null?void 0:qn.documentId)??null;if(ln&&ln!==$)return}const We=ze?C(ze):null;We&&(We.isReady=!1,typeof We.setEditor=="function"&&We.setEditor(null));const bt=ni.has(ze);rr(ze),!bt&&(se==null?void 0:se.editorVersion)===2&&(se.documentId??((Cr=se.options)==null?void 0:Cr.documentId)??null)===ze&&ie.$superdoc.setActiveEditor(null)},ui=$=>{const se=typeof($==null?void 0:$.getExtensionManager)=="function"?$.getExtensionManager():null;if(!se)return null;const ze=se.commands;return{commands:{execute:(We,bt)=>ze.execute(We,bt),getState:We=>{const bt=ze.get(We);return bt?{enabled:!(bt.getState()??{}).disabled,reason:null}:null},list:()=>ze.list().map(We=>{const bt=We.getState()??{};return bt.label?{id:We.id,label:bt.label}:{id:We.id}})},diagnostics:{getSnapshot:()=>se.diagnostics()}}},jr=$=>{const se=l.value.find(We=>We.id===$),ze=ie.$superdoc.config.documents.find(We=>We.id===$);se&&(se.fieldContext={}),ze&&(ze.fieldContext={})},Zr=$=>{var Qu,jl,Yo,Lg,Dh;if(!$)return;$n($.documentId??null),ri($.documentId??null);const{host:se,firstPartyCommandMutation:ze,mount:We,documentId:bt,capabilities:Jt,editCommands:vn,bindEditShortcuts:qn,bindSessionShortcuts:Cr,commentsAdapter:ln,trackedChangesAdapter:lr,contextMenu:wr,documentApi:pn,documentMutationReadiness:Rt,documentApiUnavailableReason:Nr,pageMetrics:Sr,pageLayout:Qr,pageFurniture:oi,presence:Ki,lock:$i,connection:Gi,collaborationProvider:Mr,fonts:qs,replaceFile:ti,upgradeToCollaboration:so,documentOpenToken:Ji}=$;fe==null||fe.trackDocumentOpen(Ji??null,bt??null);const Ws=tpe(async(mn={})=>{if(!se||typeof se.save!="function")throw new Error("v2-editor: save unavailable");return se.save(mn)}),ba=async(mn={})=>{const Mn=(mn==null?void 0:mn.commentsType)==="clean"?"strip":"preserve",cr=await Ws({format:"docx",commentExportMode:Mn});return new Blob([cr],{type:Ho})},wa=async mn=>{if(typeof ti!="function")throw new Error("v2-editor: replaceFile unavailable");const Mn=await ti(mn);return((Mn==null?void 0:Mn.state)==="review-ready"||(Mn==null?void 0:Mn.state)==="editing-ready")&&jr(bt),Mn},Bl=async(mn,Mn)=>{if(typeof so!="function")throw new Error("v2-editor: upgradeToCollaboration unavailable");return so(mn,Mn)},Fc=(mn={})=>We!=null&&We.focus&&typeof We.focus.focus=="function"?We.focus.focus(mn):!1,Xr=(mn,Mn=void 0)=>{const cr={ok:!1,reason:mn};return Mn&&(cr.detail=Mn),cr},sl=mn=>Array.isArray(mn==null?void 0:mn.items)?mn.items:[],al=mn=>{const Mn=Number(mn);return Number.isFinite(Mn)&&Mn>0?Math.floor(Mn):0},os=async({text:mn,occurrence:Mn=0}={})=>{var Lo;
608if(typeof mn!="string"||mn.length===0)return Xr("invalid-text","text must be a non-empty string");if(!(pn!=null&&pn.query)||typeof pn.query.match!="function")return Xr("query-unavailable","activeEditor.doc.query.match is not available");const cr=al(Mn),si=await pn.query.match({select:{type:"text",pattern:mn},limit:cr+1}),Oi=sl(si),Er=Oi[cr]??null;return Er!=null&&Er.target?{ok:!0,item:Er,target:Er.target,ref:typeof((Lo=Er==null?void 0:Er.handle)==null?void 0:Lo.ref)=="string"?Er.handle.ref:null,text:mn,occurrence:cr,total:Number.isFinite(Number(si==null?void 0:si.total))?Number(si.total):Oi.length}:Xr("text-not-found",`text not found: ${mn}`)},Nh=(mn,Mn)=>{if(!mn||typeof mn!="object"||mn.kind!=="selection"||Mn!=="start"&&Mn!=="end")return mn;const cr=Mn==="start"?mn.start:mn.end;return cr?{kind:"selection",start:cr,end:cr,...mn.story?{story:mn.story}:{}}:mn},Mh=async({target:mn,collapse:Mn=null,focus:cr=!0}={})=>{var Lo,aa,zc;if(!mn||typeof mn!="object")return Xr("invalid-target","target must be a SelectionTarget object");const si=Nh(mn,Mn),Oi=((zc=((aa=(Lo=se==null?void 0:se.getHandles)==null?void 0:Lo.call(se))==null?void 0:aa.editing)??null)==null?void 0:zc.selectionTargets)??null;if(typeof(Oi==null?void 0:Oi.apply)!="function")return Xr("selection-target-unavailable","editing.selectionTargets.apply is not available");let Er;try{Er=Oi.apply(si)}catch(ll){const ff=ll instanceof Error?ll.message:String(ll);return Xr("selection-target-threw",ff)}return Er!=null&&Er.ok?(cr!==!1&&await Promise.resolve(Fc()),{ok:!0,mode:Er.mode??"range"}):Xr((Er==null?void 0:Er.reason)??"selection-target-rejected",Er==null?void 0:Er.detail)},Mg=()=>ie.$superdoc.config.documentMode==="suggesting"?"tracked":"direct",Dg=()=>{var cr,si,Oi;const mn=((Oi=((si=(cr=se==null?void 0:se.getHandles)==null?void 0:cr.call(se))==null?void 0:si.editing)??null)==null?void 0:Oi.selection)??null;if(typeof(mn==null?void 0:mn.toSelectionTarget)!="function")return Xr("selection-target-unavailable","editing.selection.toSelectionTarget is not available");const Mn=mn.toSelectionTarget();if(!Mn||Mn.kind==="rejected"){const Er=(Mn==null?void 0:Mn.rejection)??{};return Xr(Er.reason??Er.code??"selection-target-rejected",Er.detail)}return!Mn.target||typeof Mn.target!="object"?Xr("selection-target-rejected","selection target was not produced"):{ok:!0,target:Mn.target,mode:Mn.mode??"range",story:Mn.story}},sv=(mn,Mn)=>{const cr=(mn==null?void 0:mn.failure)??mn;return Xr((cr==null?void 0:cr.code)??(mn==null?void 0:mn.reason)??Mn,(cr==null?void 0:cr.message)??(cr==null?void 0:cr.detail)??(mn==null?void 0:mn.detail))},fi={focusEditable:Fc,readBlocks:(mn={includeText:!0})=>{var Mn,cr;return(cr=(Mn=pn==null?void 0:pn.blocks)==null?void 0:Mn.list)==null?void 0:cr.call(Mn,mn)},setSelectionTarget:(mn={})=>Mh(mn),setSelectionByText:async(mn={})=>{const Mn=await os(mn);if(!Mn.ok)return Mn;const cr=await Mh({target:Mn.target,collapse:(mn==null?void 0:mn.collapse)??null,focus:mn==null?void 0:mn.focus});return cr.ok?{ok:!0,mode:cr.mode,text:Mn.text,occurrence:Mn.occurrence,target:Mn.target}:cr},replaceTextByText:async({findText:mn,replacement:Mn,occurrence:cr=0,mode:si="direct"}={})=>{var aa;if(typeof Mn!="string")return Xr("invalid-replacement","replacement must be a string");if(!(pn!=null&&pn.text)||typeof pn.text.replace!="function")return Xr("text-replace-unavailable","activeEditor.doc.text.replace is not available");const Oi=await os({text:mn,occurrence:cr});if(!Oi.ok)return Oi;const Er=Oi.ref?{ref:Oi.ref,text:Mn,mode:si}:{target:Oi.target,text:Mn,mode:si},Lo=await pn.text.replace(Er);return(Lo==null?void 0:Lo.ok)===!1?Xr(Lo.reason??"text-replace-failed",Lo.detail):(await Promise.resolve((aa=Rt==null?void 0:Rt.whenPainted)==null?void 0:aa.call(Rt,Lo)),{ok:!0,receipt:Lo,text:Mn,replacedText:mn,occurrence:al(cr)})},replaceSelection:async({target:mn,replacement:Mn="",mode:cr="direct"}={})=>{var Oi;if(!mn||typeof mn!="object")return Xr("invalid-target","target must be a SelectionTarget object");if(typeof Mn!="string")return Xr("invalid-replacement","replacement must be a string");if(!(pn!=null&&pn.text)||typeof pn.text.replace!="function")return Xr("text-replace-unavailable","activeEditor.doc.text.replace is not available");const si=await pn.text.replace({target:mn,text:Mn,mode:cr});return(si==null?void 0:si.ok)===!1?Xr(si.reason??"text-replace-failed",
608si.detail):(await Promise.resolve((Oi=Rt==null?void 0:Rt.whenPainted)==null?void 0:Oi.call(Rt,si)),{ok:!0,receipt:si,text:Mn})},serializeSelectionToClipboard:async({includeHtml:mn=!0}={})=>{if(!(pn!=null&&pn.clipboard)||typeof pn.clipboard.serializeSelection!="function")return Xr("clipboard-serialize-unavailable","activeEditor.doc.clipboard.serializeSelection is not available");const Mn=Dg();if(!Mn.ok)return Mn;let cr;try{cr=await pn.clipboard.serializeSelection({target:Mn.target,includeHtml:mn!==!1})}catch(si){return Xr("clipboard-serialize-threw",si instanceof Error?si.message:String(si))}return cr!=null&&cr.payload?{ok:!0,payload:cr.payload,plan:cr.plan,target:Mn.target,mode:Mn.mode}:Xr("clipboard-serialize-failed","clipboard serialization did not return a payload")},pasteClipboardPayload:async({payload:mn,target:Mn=null,mode:cr=Mg(),fallback:si=void 0}={})=>{var zc;if(!mn||typeof mn!="object")return Xr("invalid-clipboard-payload","payload must be a ClipboardPayload object");if(!(pn!=null&&pn.clipboard)||typeof pn.clipboard.insert!="function")return Xr("clipboard-insert-unavailable","activeEditor.doc.clipboard.insert is not available");let Oi=Mn,Er=null;if(!Oi){const ll=Dg();if(!ll.ok)return ll;Oi=ll.target,Er=ll.mode}if(!Oi||typeof Oi!="object")return Xr("invalid-target","target must be a SelectionTarget or ClipboardTarget object");const Lo={payload:mn,target:Oi,changeMode:cr==="tracked"?"tracked":"direct",...si!==void 0?{fallback:si}:{}},aa=await pn.clipboard.insert(Lo);return!aa||aa.success===!1||aa.ok===!1?sv(aa,"clipboard-insert-failed"):(await Promise.resolve((zc=Rt==null?void 0:Rt.whenPainted)==null?void 0:zc.call(Rt,aa)),{ok:!0,receipt:aa,target:Oi,mode:Er})},pastePlainText:async({text:mn,target:Mn=null,mode:cr=Mg()}={})=>typeof mn!="string"?Xr("invalid-text","text must be a string"):fi.pasteClipboardPayload({payload:{source:"api",items:[{type:"text/plain",kind:"string",data:mn}]},target:Mn,mode:cr})},Ko={editorVersion:2,documentId:bt,host:se,mount:We,options:{documentId:bt,documentMode:ie.$superdoc.config.documentMode},capabilities:Jt??((Qu=se==null?void 0:se.getCapabilities)==null?void 0:Qu.call(se))??null,save:Ws,exportDocx:ba,replaceFile:wa,upgradeToCollaboration:Bl,doc:pn??null,documentMutationReadiness:Rt??null,documentApiUnavailableReason:Nr??null,focus:Fc,authoring:fi,editCommands:vn??null,v2Comments:ln??null,v2TrackedChanges:lr??null,contextMenu:wr??null,pageMetrics:Sr??null,pageLayout:Qr??null,pageFurniture:oi??null,presence:Ki??null,lock:$i??null,connection:Gi??null,provider:Mr??null,reviewWindow:{getDiagnostics:()=>Je.getDiagnostics(),getSnapshot:()=>{var mn;return((mn=Je.getSnapshot)==null?void 0:mn.call(Je))??null},subscribe:mn=>{var Mn;return((Mn=Je.subscribe)==null?void 0:Mn.call(Je,mn))??(()=>{})}},extensions:ui(se),fonts:qs??((jl=se==null?void 0:se.getFontRuntime)==null?void 0:jl.call(se))??null,commands:null,state:null,view:null},xa=C(bt);if(xa&&(xa.isReady=!0,typeof xa.setEditor=="function"&&xa.setEditor(Ko)),je({documentId:bt,host:se,mount:We,facade:Ko})||ie.$superdoc.setActiveEditor(Ko),Mr){const mn=Us(Mr);ie.$superdoc.provider=mn,xa&&(xa.provider=mn)}ie.$superdoc.broadcastEditorCreate(Ko),se&&ze&&MX(ie.$superdoc,se,ze),Hi({documentId:bt,bindEditShortcuts:qn}),Fn({documentId:bt,bindSessionShortcuts:Cr,documentApi:pn}),Mr&&i(C(bt)).state==="valid"&&ra({editor:Ko}),Sr&&Qr&&La();const uc=((Yo=ie.$superdoc.config.modules)==null?void 0:Yo.comments)!==!1;ln&&uc&&((Lg=s.setV2CommentsAdapter)==null||Lg.call(s,ln)),lr&&uc&&((Dh=s.setV2TrackedChangesAdapter)==null||Dh.call(s,lr)),(ln||lr)&&Je.setContext({superdoc:ie.$superdoc,documentId:bt,commentsAdapter:ln??null,trackedChangesAdapter:lr??null,resolveReviewWindow:mn=>se.resolveReviewWindow(mn)}),d.value&&!ie.$superdoc.config.collaboration&&(u.value=!0),L.value=!0,Q.value=!0},ro=Ne(!1),Go=Zs(null),er=Ne(!1);let is=0,di=0,Hr=0;const No=({editor:$,sourceEditor:se,surface:ze="body",headerId:We=null,sectionType:bt=null}={})=>{var qn;const Jt=((qn=ie.$superdoc)==null?void 0:qn.activeEditor)??null,vn=$??se??Jt??void 0;return{editor:vn,sourceEditor:se??vn,surface:ze,headerId:We,sectionType:bt}},Mo=($={})=>{ie.$superdoc.emit("editor-update",No($))},Ti=()=>{is&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(is),di&&clearTimeout(di),is=0,di=0},_o=($=Rpe)=>{Ti();const se=()=>{is=0,di=0,Na(),ro.value&&bs.value&&!f.value&&$>0&&_o($-1)};if(typeof requestAnimationFrame=="function"){is=requestAnimationFrame(se);return}di=setTimeout(se,0)},yn=()=>{Hr&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Hr),Hr=0},Nn=()=>{ro.value=!1,Go.value=null,Ti(),Na()},yr=($,se)=>{if(!$||$.rangeCount<1||$.isCollapsed||!se)return!1;const ze=$.getRangeAt(0);return se.contains(ze.startContainer)&&se.contains(ze.endContainer)},fr=()=>{var Jt,vn,qn,Cr,ln,lr,wr,pn,Rt,Nr,Sr,Qr,oi,Ki,$i,Gi,Mr,qs,ti,so,Ji,Ws,ba,wa,Bl,Fc;if(Hr=0,!Br.value)return;let $=null;try{$=((Cr=(qn=(vn=(Jt=ie.$superdoc)==null?void 0:Jt.activeEditor)==null?void 0:vn.host)==null?void 0:qn.getHandles)==null?void 0:Cr.call(qn))??null}catch{$=null}const se=(lr=(ln=ie.$superdoc)==null?void 0:ln.config)==null?void 0:lr.documentMode;if(se==="editing"||se==="suggesting"){const Xr=((Rt=(pn=(wr=$==null?void 0:$.editing)==null?void 0:wr.selection)==null?void 0:pn.getSnapshot)==null?void 0:Rt.call(pn))??null,sl=(Qr=(Sr=(Nr=$==null?void 0:$.editing)==null?void 0:Nr.selection)==null?void 0:Sr.toSelectionTarget)==null?void 0:Qr.call(Sr);if(sl?sl.kind==="ok"&&sl.mode==="range":dfe(se,Xr)){const al=nc();if(ufe(((oi=window.getSelection)==null?void 0:oi.call(window))??null,al)){Nn();return}ro.value=!0,Go.value=Xr,_o();return}}else if(se!=="viewing"){Nn();return}const ze=nc(),We=((Ki=window.getSelection)==null?void 0:Ki.call(window))??null;if(!yr(We,ze)){const Xr=(Gi=($i=$==null?void 0:$.selection)==null?void 0:$i.toSelectionTarget)==null?void 0:Gi.call($i),sl=(Xr==null?void 0:Xr.kind)==="ok"&&Xr.mode==="range";if(sl&&F.value){ro.value=!0,Go.value=((qs=(Mr=$==null?void 0:$.selection)==null?void 0:Mr.getSnapshot)==null?void 0:qs.call(Mr))??null,(so=(ti=$==null?void 0:$.selection)==null?void 0:ti.syncVisibleOverlay)==null||so.call(ti),_o();return}sl&&er.value&&((Ws=(Ji=$==null?void 0:$.selection)==null?void 0:Ji.clear)==null||Ws.call(Ji),er.value=!1),Nn();return}const bt=(wa=(ba=$==null?void 0:$.selection)==null?void 0:ba.applyDomSelection)==null?void 0:wa.call(ba,We);if(!(bt!=null&&bt.ok)||bt.mode!=="range"){Nn();return}er.value=!0,ro.value=!0,Go.value=((Fc=(Bl=$==null?void 0:$.selection)==null?void 0:Bl.getSnapshot)==null?void 0:Fc.call(Bl))??null,_o()},Ri=()=>
608{if(Br.value){if(yn(),typeof requestAnimationFrame!="function"){fr();return}Hr=requestAnimationFrame(fr)}},Co=()=>{Ri()},uu=({hasRangeSelection:$,snapshot:se}={})=>{if(b1(ie.$superdoc,"selection:changed",()=>({hasRangeSelection:$,selection:se})),ro.value=$===!0,Go.value=$===!0?se??null:null,ro.value){_o();return}Ti(),Na()},nc=()=>{var $,se,ze,We;return(($=Lr.value)==null?void 0:$.mountContainer)??((We=(ze=(se=ie.$superdoc)==null?void 0:se.activeEditor)==null?void 0:ze.mount)==null?void 0:We.container)??null},Oa=$=>{var ze;const se=String($);return(ze=globalThis.CSS)!=null&&ze.escape?globalThis.CSS.escape(se):se.replace(/["\\]/g,"\\$&")},ta=()=>{var bt,Jt;const $=Go.value,se=nc();if(!$||!(se!=null&&se.querySelector))return null;const ze=$.anchor??null,We=[ze==null?void 0:ze.fragmentId,ze==null?void 0:ze.blockId,(Jt=(bt=ze==null?void 0:ze.position)==null?void 0:bt.anchor)==null?void 0:Jt.nativeId].filter(vn=>vn!=null&&vn!=="");for(const vn of We){const qn=Oa(vn),Cr=se.querySelector(`[data-source-node-id="${qn}"]`)??se.querySelector(`[data-layout-block-ref="${qn}"]`)??se.querySelector(`[data-layout-fragment-id="${qn}"]`);if(Cr instanceof HTMLElement)return Cr}return null};function ys($=null){var We;const se=(We=window.getSelection)==null?void 0:We.call(window);if(!se||se.rangeCount<1||se.isCollapsed)return null;const ze=se.getRangeAt(0);if(!ze)return null;if($){const{startContainer:bt,endContainer:Jt}=ze;if(!$.contains(bt)||!$.contains(Jt))return null}try{const bt=ze.getBoundingClientRect();return!bt||bt.width<=0&&bt.height<=0?null:bt}catch{return null}}const du=$=>{if(!$||!me.value)return null;const se=me.value.getBoundingClientRect();return{top:$.top-se.top,left:$.left-se.left,right:$.right-se.left,bottom:$.bottom-se.top,width:$.width,height:$.height}},na=$=>{var ze;let se=$;for(;se&&se.nodeType===1;){const We=(ze=se.dataset)==null?void 0:ze.pageIndex;if(We!=null&&We!==""){const bt=Number(We);if(Number.isFinite(bt))return bt}se=se.parentElement}return null},Gu=()=>{var bt,Jt,vn,qn,Cr,ln;if(!ro.value||!bs.value)return null;const $=ys(nc()),se=du($)??((bt=Ja())==null?void 0:bt.bounds)??null;if(!se)return null;const ze=((qn=(vn=(Jt=ie.$superdoc)==null?void 0:Jt.activeEditor)==null?void 0:vn.options)==null?void 0:qn.documentId)??((ln=(Cr=ie.$superdoc)==null?void 0:Cr.activeEditor)==null?void 0:ln.documentId);if(!ze)return null;const We=na(ta());return s1({selectionBounds:se,page:We!=null?We+1:1,documentId:ze,source:Wm})},Ja=()=>{if(!me.value)return null;const $=ta();if(!$)return null;const se=$.getBoundingClientRect();if(!se||se.width<=0&&se.height<=0)return null;const ze=me.value.getBoundingClientRect(),We={top:se.top-ze.top,left:se.left-ze.left,right:se.right-ze.left,bottom:se.bottom-ze.top,width:se.width,height:se.height},bt=na($);return{threadId:"pending",key:"pending",kind:"pending",storyKey:"body",bounds:We,...bt!=null?{pageIndex:bt}:{},...hn.value!=null?{generation:hn.value}:{}}},Na=()=>{if(!Br.value)return;if(!ro.value){p.value=null,Ie();return}const $=Gu();if(!$){p.value=null,Ie();return}He($)},Oc=$=>{$&&ge({...q.value??{},pending:$})},Ts=ue.createGeometryPublisher({getLayersContainer:()=>me.value??null,isCommentsEnabled:()=>!!de.value&&mt.value,publishPositions:($,se)=>ge($,se),clearPositions:()=>{var $;($=s.clearEditorCommentPositions)==null||$.call(s)},readCurrentPositions:()=>q.value??{},setGeometryAvailable:$=>{const se=!!$;$e.value=se,se&&(Bt.value=!0,hn.value=Ts.getLastEpoch())}}),fu=($="tracked-change-restamp")=>{jn=Math.max(jn,3),Lt=$},qo=()=>{const $=jn>0?Lt??"tracked-change-restamp":"render-epoch-handoff";return jn>0&&(jn-=1),jn<=0&&(Lt=null),{retainMissingTrackedChangeGeometry:!0,reason:$}},Ei=()=>{jn=0,Lt=null},Il=$=>typeof $=="function"?$():$,Rl=($,se=void 0)=>{if(Lr.value=$,Pn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Pn),typeof requestAnimationFrame!="function"){Ts.publish(Lr.value,Il(se));return}Pn=requestAnimationFrame(()=>{Pn=0,Ts.publish(Lr.value,Il(se))})},bh=$=>{$&&(Rl($,()=>qo()),ro.value&&_o())},hu=Zs(null),Nc=new Map;let vs=null;const el=$=>{var bt;if(!($!=null&&$.snapshot))return;const se=$.snapshot,ze=$.stage;if(typeof HTMLElement<"u"&&ze instanceof HTMLElement){vs=ze;const Jt=(bt=ze.dataset)==null?void 0:bt.superdocV2DocumentId;Jt&&Nc.set(Jt,ze)}hu.value=se;const We=Array.isArray(se.pages)?se.pages.length:0;ie.$superdoc.emit("pagination-update",{totalPages:We,superdoc:ie.$superdoc}),Sn(()=>{fn(),il()})},Mc=$=>{var ze,We,bt,Jt,vn;rn.destroy(),yn(),Ti(),Pn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Pn),Pn=0,Lr.value=null,hn.value=null,$e.value=!1,Bt.value=!1,Ei(),Ts.reset(),ro.value=!1,Go.value=null,p.value=null,Ie(),hu.value=null;const se=($==null?void 0:$.documentId)==null?null:String($.documentId);ri(se),(ze=s.cancelImportedTrackedChangeBootstrap)==null||ze.call(s,se??void 0),se&&Nc.delete(se),vs&&(se==null||((We=vs.dataset)==null?void 0:We.superdocV2DocumentId)===se)&&(vs=null),Je.reset("render-cleared"),(bt=s.setV2CommentsAdapter)==null||bt.call(s,null),(Jt=s.setV2TrackedChangesAdapter)==null||Jt.call(s,null),(vn=s.clearEditorCommentPositions)==null||vn.call(s),Pr(($==null?void 0:$.documentId)??null),La()},So=($,se)=>{var vn,qn,Cr,ln,lr,wr,pn,Rt;if(!se||(b1(ie.$superdoc,se.type,()=>({...se,documentId:($==null?void 0:$.id)??null})),se.type==="mutation:committed"&&se.origin==="extension"))return;const ze=($==null?void 0:$.id)??null;if(se.type==="collaboration:document-replaced"&&jr(ze),se.type==="review-mutation:started"){Je.beginMutation(se.reviewMutation);return}if(se.type==="review-mutation:aborted"){Je.settleMutation((vn=se.reviewMutation)==null?void 0:vn.token,{outcome:"aborted",resumeDomains:["comments","trackedChanges"],trackedRowCount:((qn=s.getV2TrackedChangeRowCount)==null?void 0:qn.call(s,ze))??null});return}if(se.type==="reviewTarget:changed"){lm(se.next);return}if(se.type==="collaboration:remote-changed"){se.reviewChanged!==!1&&(Je.invali
608date("collaboration:remote-review-changed"),Je.refreshCommittedWindow("collaboration:remote-review-changed"));return}if(se.type==="source:complete"){ie.$superdoc.broadcastSourceComplete();return}if(se.type==="source:signals-complete"){const Nr=rx(se);for(const Sr of se.diagnostics??[]){const Qr=ppe(Sr,{documentId:ze,editor:null});Qr&&un.shouldEmit(ze,Nr,Qr.internalCode)&&ie.$superdoc.emit("exception",Qr)}ie.$superdoc.broadcastSourceSignalsComplete();return}if(se.type==="mutation:rejected"){(Cr=se.reviewMutation)!=null&&Cr.token&&Je.settleMutation(se.reviewMutation.token,{outcome:"rejected",resumeDomains:["comments","trackedChanges"],trackedRowCount:((ln=s.getV2TrackedChangeRowCount)==null?void 0:ln.call(s,ze))??null}),Fj(se)?ot(ze,se):jt(ze,se);return}if(se.type==="mutation:committed"){const Nr=Jde(ze,se.trackedChangeBulkDecision);Nr&&ie.$superdoc.emit("tracked-changes:bulk-decision",Nr),Mo()}if(se.type!=="mutation:committed")return;se.origin==="history"?Je.refreshCommittedWindow(`history-${se.direction}`):se.reviewSidecarOnly===!0&&Je.refreshCommittedWindow("review-sidecar-committed");const We=UD(se);aX({event:se,commentsStore:s,superdoc:ie.$superdoc,documentId:ze}),Array.isArray(We==null?void 0:We.remappedPairs)&&We.remappedPairs.length>0&&((lr=s.remapTrackedChangeIdentities)==null||lr.call(s,We.remappedPairs,{documentId:ze})),We&&fu("tracked-change-mutation");const bt=((wr=ie.$superdoc)==null?void 0:wr.activeEditor)??null,Jt=We?(pn=s.reconcileTrackedChangeMutationFromV2)==null?void 0:pn.call(s,{superdoc:ie.$superdoc,adapter:(bt==null?void 0:bt.v2TrackedChanges)??null,documentId:ze,...We}):Promise.resolve({ok:!0});if((Rt=se.reviewMutation)!=null&&Rt.token){const Nr=se.reviewMutation,Sr=!!((We==null?void 0:We.allResolved)??se.trackedChangeAllResolved),Qr=oi=>{var $i;const Ki=Sr&&(oi==null?void 0:oi.ok)===!0&&(oi==null?void 0:oi.allResolved)===!0;Je.settleMutation(Nr.token,{outcome:"committed",allResolved:Ki,resumeDomains:Ki?["comments"]:["comments","trackedChanges"],trackedRowCount:(($i=s.getV2TrackedChangeRowCount)==null?void 0:$i.call(s,ze))??null})};Promise.resolve(Jt).then(Qr,()=>Qr(null));return}Promise.resolve(Jt).catch(()=>{})},Xd=$=>{rn.handleLinkClick($)},Zd=async $=>{var se;try{await((se=s.announceV2CommentCreated)==null?void 0:se.call(s,{superdoc:ie.$superdoc,commentId:$==null?void 0:$.commentId}))}catch(ze){console.warn("[SuperDoc][v2] context-menu comment reconciliation failed",ze)}},rc=($=void 0)=>{if(Br.value&&Ts.getLastPayload()){if(Pn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Pn),typeof requestAnimationFrame!="function"){Ts.recollect(Il($));return}Pn=requestAnimationFrame(()=>{Pn=0,Ts.recollect(Il($))})}},qu=()=>{if(!Br.value)return;try{Je.refreshCommittedWindow("document-mode-change")}catch(se){console.warn("[SuperDoc][v2] document-mode review-window refresh failed",se)}const $=()=>{var se;Br.value&&(mt.value?Lr.value?Rl(Lr.value):rc():((se=s.clearEditorCommentPositions)==null||se.call(s),$e.value=!1))};Sn(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>$()):$()})},Qd=$=>{switch($){case"editing-mount-required":return"SuperDoc could not load the document editor because the page did not provide a mount container.";case"source-load-failed":return"SuperDoc could not load the document editor because the document source could not be prepared.";case"unsupported-cdn-v2-editor":return"SuperDoc could not load the document editor because this build does not include the V2 runtime.";case"v2-integration-unavailable":return"SuperDoc could not load the document editor because the bundled V2 runtime is unavailable in this environment.";case"worker-init-failed":return"SuperDoc could not load the document editor because the browser worker failed to start.";case"input-too-large-for-inline-review":return"SuperDoc could not load the document editor because this document is too large to open without the browser worker.";case"collaboration-unsupported-huge-document":return"SuperDoc could not load the document editor because large documents cannot be opened with collaboration enabled yet.";case"collaboration-v1-config-unsupported":return"SuperDoc v2 cannot use modules.collaboration because it is the SuperDoc v1 collaboration API. SuperDoc did not attach the provider or change the document. Configure Document.collaboration with a v2 room instead.";case"collaboration-room-format-unsupported":return"SuperDoc v2 cannot open this collaboration state because it is not stored in the SuperDoc v2 room format. No changes were made.";case"collaboration-room-format-conflict":return"SuperDoc v2 found conflicting room formats in one collaboration document. No changes were made.";case"collaboration-room-corrupt":return"SuperDoc v2 found a structurally invalid collaboration room. No changes were made.";case"collaboration-v2-room-missing":return'SuperDoc v2 could not find a committed v2 collaboration room. No changes were made. Use roomMode: "create" only when creating a new room.';case"collaboration-v2-room-already-exists":return'SuperDoc v2 was asked to create a collaboration room that already exists. Use roomMode: "join" to open it.';case"collaboration-v2-room-initializing":return"The SuperDoc v2 collaboration room has not completed initialization. This open attempt did n
608ot modify it.";case"collaboration-v2-room-bootstrap-stalled":return"The SuperDoc v2 collaboration room bootstrap appears stalled. This open attempt did not modify it. Preserve the room data if a create retry cannot recover it.";case"collaboration-open-intent-invalid":return"SuperDoc v2 received an invalid collaboration room mode. No provider was connected.";case"collaboration-config-invalid":return"SuperDoc v2 received an invalid collaboration configuration. No provider was connected.";default:return"SuperDoc could not load the document editor."}},Dc=$=>typeof $=="string"&&$.trim().length>0?$.trim():null,sm=$=>{Pr(($==null?void 0:$.documentId)??null);const se=typeof($==null?void 0:$.reason)=="string"&&$.reason.length>0?$.reason:"open-failed",ze=Dc($==null?void 0:$.detail),We=typeof($==null?void 0:$.documentId)=="string"&&$.documentId.length>0?$.documentId:null,bt=rpe(se,We),Jt=(bt==null?void 0:bt.error.message)??Qd(se),vn=$!=null&&$.workerFailure&&typeof $.workerFailure=="object"?$.workerFailure:null;gr(We,{reason:se,message:Jt,detail:ze,...vn?{workerFailure:vn}:{}});const qn={...ze?{detail:ze}:{},...We?{documentId:We}:{},...vn?{workerFailure:vn}:{},reason:se};se==="collaboration-v1-config-unsupported"||se==="collaboration-room-format-unsupported"||se==="collaboration-room-format-conflict"||se==="collaboration-room-corrupt"||se==="collaboration-v2-room-missing"||se==="collaboration-v2-room-already-exists"||se==="collaboration-v2-room-initializing"||se==="collaboration-v2-room-bootstrap-stalled"||se==="collaboration-open-intent-invalid"||se==="collaboration-config-invalid"?console.warn(`[SuperDoc] ${Jt}`,qn):console.error(`[SuperDoc] ${Jt}`,qn),ie.$superdoc.emit("exception",bt??{error:new Error(Jt),code:se,...We?{documentId:We}:{},editor:null,...vn?{workerFailure:vn}:{}});const Cr=fpe(se,ze,{documentId:We,editor:null,bootErrorName:typeof($==null?void 0:$.bootErrorName)=="string"?$.bootErrorName:void 0}),ln=Array.isArray($==null?void 0:$.diagnostics)?$.diagnostics:[],lr=rx($),wr=ln.map(Rt=>({record:Rt,diagnostic:o7(Rt,{documentId:We,editor:null})})).filter(Rt=>Rt.diagnostic),pn=ype(Cr,se,wr);Cr&&!pn&&ie.$superdoc.emit("exception",Cr);for(const{diagnostic:Rt}of wr)un.shouldEmit(We,lr,Rt.internalCode)&&ie.$superdoc.emit("exception",Rt)},Jd=($,se)=>{var Jt;const ze=($==null?void 0:$.id)??null,We=(Jt=se==null?void 0:se.snapshot)==null?void 0:Jt.diagnostics;if(!Array.isArray(We)||We.length===0)return;const bt=rx(se);for(const vn of We){const qn=upe(vn,{documentId:ze,editor:null});qn&&un.shouldEmit(ze,bt,qn.internalCode)&&ie.$superdoc.emit("exception",qn)}},ic=($,se)=>{const ze=($==null?void 0:$.id)??(typeof(se==null?void 0:se.documentId)=="string"?se.documentId:null),We=se==null?void 0:se.diagnostics;if(!Array.isArray(We)||We.length===0)return;const bt=rx(se);for(const Jt of We){const vn=o7(Jt,{documentId:ze,editor:null});vn&&un.shouldEmit(ze,bt,vn.internalCode)&&ie.$superdoc.emit("exception",vn)}},Wu=($,se)=>{var ze,We;(We=(ze=ie.$superdoc)==null?void 0:ze.activateRuntimeFromEventTarget)==null||We.call(ze,$.target,se)},Ma=$=>Wu($,"focusin"),Ku=$=>Wu($,"pointerdown"),ef=$=>Wu($,"mousedown"),ra=({editor:$})=>{ie.$superdoc.emit("collaboration-ready",{editor:$}),Sn(()=>{u.value=!0;const se=new URLSearchParams(window.location.search).get("commentId");se&&cf(se)})};let wh=0;const am=()=>{wh=Date.now()+250},tf=()=>Date.now()<wh,Yu=$=>{var ze;const se=Y.value;se&&(!($.target instanceof Node)||!se.contains($.target)||((ze=me.value)!=null&&ze.contains($.target)&&(Tde($.target)||s.setActiveComment(ie.$superdoc,null),s.removePendingComment(ie.$superdoc),Ih()),am()))},xh=$=>{var ln,lr,wr,pn,Rt,Nr,Sr,Qr,oi,Ki,$i,Gi,Mr,qs;const se=((wr=(lr=(ln=ie.$superdoc).listeners)==null?void 0:lr.call(ln,"fonts-resolved"))==null?void 0:wr.length)>0?ie.$superdoc.listeners("fonts-resolved")[0]:null,ze=ie.$superdoc.config.useLayoutEngine!==!1,We=$.isNewFile,bt=(pn=ie.$superdoc.config)==null?void 0:pn.benchmarkExecutionMode,Jt=((Rt=ie.$superdoc.config)==null?void 0:Rt.benchmarkTraceEnabled)===!0,vn=i($),qn=vn.state==="valid"?vn.config:null,Cr=ie.$superdoc.config.v2CollaborationPreflightFailure??(vn.state==="invalid"?vn.failure:null);return{isDebug:ie.$superdoc.config.isDebug||!1,documentId:$.id,user:ie.$superdoc.user,users:ie.$superdoc.users,colors:ie.$superdoc.colors,role:ie.$superdoc.config.role,
608interaction:ie.$superdoc.interactionConfig,html:$.html,markdown:$.markdown,documentMode:ie.$superdoc.config.documentMode,...bt?{benchmarkExecutionMode:bt}:{},...Jt?{benchmarkTraceEnabled:!0}:{},allowSelectionInViewMode:ie.$superdoc.config.allowSelectionInViewMode,rulers:$.rulers,rulerContainer:En.value,isInternal:ie.$superdoc.config.isInternal,annotations:ie.$superdoc.config.annotations,isCommentsEnabled:!!de.value,isAiEnabled:(Nr=ie.$superdoc.config.modules)==null?void 0:Nr.ai,contextMenuConfig:(()=>{var ti,so;return(ti=ie.$superdoc.config.modules)!=null&&ti.slashMenu&&!((so=ie.$superdoc.config.modules)!=null&&so.contextMenu)&&console.warn("[SuperDoc] modules.slashMenu is deprecated. Use modules.contextMenu instead."),ie.$superdoc.uiConfig.contextMenu.options})(),slashMenuConfig:((Sr=ie.$superdoc.config.modules)==null?void 0:Sr.contextMenu)??((Qr=ie.$superdoc.config.modules)==null?void 0:Qr.slashMenu),comments:{highlightColors:(oi=de.value)==null?void 0:oi.highlightColors,highlightOpacity:(Ki=de.value)==null?void 0:Ki.highlightOpacity},trackedChanges:($i=ie.$superdoc.config.modules)==null?void 0:$i.trackChanges,experimental:ie.$superdoc.config.experimental,...qn?{v2Collaboration:qn}:{},...Cr?{collaborationPreflightFailure:Cr}:{},onCollaborationReady:ra,onCommentsUpdate:Sh,onFontsResolved:se,onPageCountKnown:ie.$superdoc.config.onPageCountKnown??null,onReviewWindowCommitted:ti=>{var so,Ji;(so=Je.onCommittedPagePaint)==null||so.call(Je,{...ti,documentId:$.id}),(Ji=Ts.noteCommittedPageWindow)==null||Ji.call(Ts,ti)},fontAssets:ie.$superdoc.config.fonts,workerUrls:ie.$superdoc.config.workerUrls,fieldContext:$.fieldContext,fieldUpdatePolicy:ie.$superdoc.config.fieldUpdatePolicy,workerStartupTimeoutMs:ie.$superdoc.config.workerStartupTimeoutMs,proofing:xt.value,isNewFile:We,password:r($),handleImageUpload:ie.$superdoc.config.handleImageUpload,externalExtensions:ie.$superdoc.config.editorExtensions||[],extensions:ie.$superdoc.config.extensions||[],...Wn!=null&&Wn.pdfLib?{pdfLib:Wn.pdfLib}:typeof __SUPERDOC_BUILD__<"u"&&__SUPERDOC_BUILD__==="cdn-iife"?{}:{loadPdfJs:async()=>{const[ti,so]=await Promise.all([ag(()=>import("./pdf-D-oSvAqu.js"),[]),ag(()=>import("./pdf.worker.min-t-CYmkGJ.es-Gp5bGJbs.js"),[])]);return ti.GlobalWorkerOptions.workerSrc=so.default,ti}},suppressDefaultDocxStyles:ie.$superdoc.config.suppressDefaultDocxStyles,disableContextMenu:!ie.$superdoc.uiConfig.contextMenu.enabled||ie.$superdoc.config.disableContextMenu===!0,jsonOverride:ie.$superdoc.config.jsonOverride,viewOptions:ie.$superdoc.config.viewOptions,contained:ie.$superdoc.config.contained,styleNonce:ie.$superdoc.config.cspNonce,documentLoading:ie.$superdoc.uiConfig.loading.enabled,linkPopoverResolver:$t(),layoutEngineOptions:ze?{...ie.$superdoc.config.layoutEngineOptions||{},proofing:xt.value,debugLabel:((Gi=ie.$superdoc.config.layoutEngineOptions)==null?void 0:Gi.debugLabel)??$.name??$.id,zoom:(m.value??100)/100,emitCommentPositionsInViewing:Le()&&mt.value,enableCommentsInViewing:De.value,contentControlsChrome:ie.$superdoc.uiConfig.contentControls.options.chrome,resolveTrackedChangeColor:rde((qs=(Mr=ie.$superdoc.config.modules)==null?void 0:Mr.trackChanges)==null?void 0:qs.authorColors)}:void 0,permissionResolver:(ti={})=>ie.$superdoc.canPerformPermission({role:ie.$superdoc.config.role,isInternal:ie.$superdoc.config.isInternal,...ti})}},nf=new Set(["commentText","isInternal","parentCommentId","trackedChangeParentId","trackedChangeThreadParentId","threadingParentCommentId","trackedChange","trackedChangeType","trackedChangeText","trackedChangeDisplayType","semanticColorKey","semanticColor","trackedChangeStory","trackedChangeStoryKind","trackedChangeStoryLabel","trackedChangeAnchorKey","trackedChangeLabel","trackedChangeDetailLines","deletedText","resolvedTime","resolvedById","resolvedByEmail","resolvedByName","importedAuthor","docxCommentJSON"]),kh=($,se={})=>{if(!(!$||se.isDone===void 0)&&!(se.resolvedTime!=null||se.resolvedById!=null||se.resolvedByEmail!=null||se.resolvedByName!=null)){if(se.isDone){$.resolvedTime=$.resolvedTime||Date.now(),$.resolvedById=$.resolvedById||se.creatorId||null,$.resolvedByEmail=$.resolvedByEmail||se.creatorEmail||null,$.resolvedByName=$.resolvedByName||se.creatorName||null;return}$.resolvedTime=null,$.resolvedById=null,$.resolvedByEmail=null,$.resolvedByName=null}},pu=($,se,ze)=>{!$||!se||(Array.isArray(se.elements)&&($.docxCommentJSON=se.elements),Object.entries(se).forEach(([We,bt])=>{bt!==void 0&&We!=="text"&&We!=="elements"&&nf.has(We)&&($[We]=bt)}),ze!==void 0&&($.commentText=ze),kh($,se))},_h=($={})=>{const se={...$};return!se.commentText&&se.text&&(se.commentText=se.text),!se.docxCommentJSON&&Array.isArray(se.elements)&&(se.docxCommentJSON=se.elements),kh(se,se),se},rf=$=>{if(Number.isFinite(B()))return;if($==null){be();return}const se=me.value,{key:ze,entry:We}=Be($),bt=Oj(se,We);if(Number.isFinite(bt)){ye(bt,$,ze??$);return}be()},Ch=$=>$==null||H.value==null?!1:String(H.value)===String($),lm=$=>{if(($==null?void 0:$.origin)!=="document"||tf())return;const se=qde($,Ge);se&&(rf(se),H.value=se,re.value=!0,setTimeout(()=>{re.value=!1},0))},Sh=($={})=>{var qn,Cr,ln,lr,wr,pn;let{activeCommentId:se,type:ze,comment:We}=$,bt=Object.prototype.hasOwnProperty.call($,"activeCommentId");const Jt=Rt=>{const Nr=[Rt==null?void 0:Rt.importedId,Rt==null?void 0:Rt.commentId].filter(
608Boolean).map(Sr=>String(Sr));return[...new Set(Nr)]},vn=Rt=>{var Qr,oi,Ki;const Nr=[Rt==null?void 0:Rt.importedId,Rt==null?void 0:Rt.commentId].filter(Boolean).map($i=>String($i)),Sr=((Ki=(oi=(Qr=ie.$superdoc)==null?void 0:Qr.activeEditor)==null?void 0:oi.options)==null?void 0:Ki.documentId)!=null?String(ie.$superdoc.activeEditor.options.documentId):null;for(const $i of Nr){const Gi=ee.value.find(Mr=>{const qs=(Mr==null?void 0:Mr.commentId)!=null?String(Mr.commentId):null,ti=(Mr==null?void 0:Mr.importedId)!=null?String(Mr.importedId):null;return qs===$i||ti===$i?!Sr||typeof he!="function"?!0:he(Mr,Sr):!1});if(Gi){const Mr=(Gi==null?void 0:Gi.commentId)??(Gi==null?void 0:Gi.importedId)??$i;return{id:Mr!=null?String(Mr):null,existingComment:Gi}}}return{id:Nr[0]||null,existingComment:null}};if(ze==="replayCompleted"&&Yr(),Oe!=null&&Oe.ADD&&ze===Oe.ADD&&We){We=_h(We);const Rt=(qn=ie.$superdoc)==null?void 0:qn.user;Rt&&(We.creatorId||(We.creatorId=Rt.id),We.creatorName||(We.creatorName=Rt.name),We.creatorEmail||(We.creatorEmail=Rt.email)),We.createdTime||(We.createdTime=Date.now());const Nr=We.documentId||((ln=(Cr=l.value)==null?void 0:Cr[0])==null?void 0:ln.id);!We.documentId&&Nr&&(We.documentId=Nr),!We.fileId&&Nr&&(We.fileId=Nr);const{id:Sr,existingComment:Qr}=vn(We);if(Sr&&!Qr){const oi=Od(We);yt({superdoc:ie.$superdoc,comment:oi,skipEditorUpdate:!0})}}if(Oe!=null&&Oe.UPDATE&&ze===Oe.UPDATE&&We){const{id:Rt,existingComment:Nr}=vn(We);if(Rt){const Sr=We.commentText||We.text;if(Nr)pu(Nr,We,Sr);else{const Qr=Od(_h(We));yt({superdoc:ie.$superdoc,comment:Qr,skipEditorUpdate:!0})}}}if(Oe!=null&&Oe.DELETED&&ze===Oe.DELETED&&We){const Rt=Jt(We);if(Rt.length){const Nr=((pn=(wr=(lr=ie.$superdoc)==null?void 0:lr.activeEditor)==null?void 0:wr.options)==null?void 0:pn.documentId)!=null?String(ie.$superdoc.activeEditor.options.documentId):null,Sr=oi=>!Nr||typeof he!="function"?!0:he(oi,Nr),Qr=Ede(ee.value,Rt,Sr);if(Qr.size){const oi=[...ee.value];ee.value=ee.value.filter(Mr=>{if(!Sr(Mr))return!0;const qs=Mr.commentId!=null?String(Mr.commentId):null,ti=Mr.importedId!=null?String(Mr.importedId):null;return!(qs&&Qr.has(qs)||ti&&Qr.has(ti))});const Ki=H.value!=null?String(H.value):null,$i=Ki!=null?oi.find(Mr=>{const qs=Mr.commentId!=null?String(Mr.commentId):null,ti=Mr.importedId!=null?String(Mr.importedId):null;return qs===Ki||ti===Ki}):null,Gi=$i?Sr($i):!1;Ki&&Qr.has(Ki)&&Gi&&(se=null,bt=!0)}}}ze==="trackedChange"&&le({superdoc:ie.$superdoc,params:$}),bt&&se!=null&&tf()&&(bt=!1),bt&&(se==null||!Ch(se))&&rf(se),Sn(()=>{F.value||(bt&&s.setActiveComment(ie.$superdoc,se),bt&&(re.value=!0,setTimeout(()=>{re.value=!1},0)))}),typeof ie.$superdoc.config.onCommentsUpdate=="function"&&ie.$superdoc.config.onCommentsUpdate($)},bs=dt(()=>!!de.value),Lc=dt(()=>Array.isArray(l.value)?l.value.filter($=>($==null?void 0:$.type)===Qp):[]),Xu=dt(()=>Lc.value.length>0),of=dt(()=>Xu.value&&bs.value),sf=dt(()=>new Set(Lc.value.map($=>String($.id)))),mu=$=>typeof $=="number"?Number.isFinite($):typeof $=="string"&&$.trim()!==""?Number.isFinite(Number($)):!1,af=$=>{var ze;const se=(ze=$==null?void 0:$.selection)==null?void 0:ze.selectionBounds;return!!se&&mu(se.top)&&mu(se.left)&&mu(se.right)&&mu(se.bottom)},Eh=$=>{var ze;const se=($==null?void 0:$.fileId)??($==null?void 0:$.documentId)??((ze=$==null?void 0:$.selection)==null?void 0:ze.documentId);return se!=null?String(se):null},Pc=$=>{const se=sf.value;if(!se.size)return!1;const ze=Eh($);return ze?se.has(ze):se.size===1},Ah=$=>{var se;return((se=$==null?void 0:$.selection)==null?void 0:se.source)==="pdf"&&af($)&&Pc($)},Th=dt(()=>{if(!Xu.value)return!1;const $=K.value.some(ze=>Ah(ze)),se=Ah(F.value);return $||se}),lf=dt(()=>{var se;const $=((se=de.value)==null?void 0:se.layout)??"sidebar";return!TE.has($)||$==="sidebar"?!0:$==="inline"?!1:$!=="auto"?!0:!br.value}),tl=dt(()=>Br.value&&!$e.value&&!Bt.value&&!Th.value||!mt.value||!lf.value?!1:F.value||(K.value.length>0||ne.value)&&u.value&&me.value&&bs.value&&!Z.value),nl=dt(()=>{if(tl.value||!bs.value)return null;if(F.value)return F.value;if(!H.value)return null;const $=Ge(H.value)??null;return Br.value&&lf.value&&($!=null&&$.trackedChange)&&!Th.value?null:$}),{compactCommentPopoverStyle:gu,closeCompactCommentPopover:Ol,resetClickAnchor:Ih}=$de({activeComment:H,pendingComment:F,activeCompactComment:nl,showCommentsSidebar:tl,superdocRoot:Y,layers:me,documents:l,resolve
608CommentPositionEntry:Be,selectionPosition:f,activeZoom:m,clearActiveComment:()=>s.setActiveComment(ie.$superdoc,null),clearPendingComment:()=>s.removePendingComment(ie.$superdoc)}),yu=dt(()=>{var $;return bs.value?f.value&&dn.top&&!(($=P.value)!=null&&$.readOnly):!1});dt(()=>{var $;return bs.value?!(($=P.value)!=null&&$.readOnly)&&f.value:!1}),pr(tl,$=>{ie.$superdoc.broadcastSidebarToggle($)}),Jue({getSuperdoc:()=>ie.$superdoc,superdocContainerWidth:Hn,isReady:u,activeZoom:m,zoomMode:y,viewportMetrics:k,showCommentsSidebar:tl,rightSidebarRef:Ve,superdocRoot:Y,documents:l});const cf=$=>{ie.$superdoc.scrollToComment($)},ya=()=>{rc()},Da=$=>{var ze,We;if(!Br.value)return;const se=Array.isArray((ze=$==null?void 0:$.detail)==null?void 0:ze.itemIds)?$.detail.itemIds.map(bt=>bt==null?"":String(bt)).filter(Boolean):[];fu(((We=$==null?void 0:$.detail)==null?void 0:We.refreshReason)??"tracked-change-restamp"),rc({retainMissingTrackedChangeGeometry:!0,...se.length>0?{retainedTrackedChangeIds:se}:{},reason:"tracked-change-restamp"})};po(()=>{var $,se,ze,We,bt,Jt,vn,qn,Cr;document.addEventListener("contextmenu",Yu,!0),document.addEventListener("keydown",X,!0),(se=($=ie.$superdoc)==null?void 0:$.on)==null||se.call($,"search:open",uf),D3(oc),(ze=Y.value)==null||ze.addEventListener("pointerdown",sc,!0),(We=Y.value)==null||We.addEventListener("focusin",sc,!0),(bt=Y.value)==null||bt.addEventListener(l7,Da),typeof window<"u"&&(window.addEventListener("scroll",ya,!0),window.addEventListener("resize",ya,!0)),document.addEventListener("focusin",Ma,!0),document.addEventListener("pointerdown",Ku,!0),document.addEventListener("mousedown",ef,!0),document.addEventListener("pointerup",Co,!0),document.addEventListener("mouseup",Co,!0),document.addEventListener("selectionchange",Co),(vn=(Jt=ie.$superdoc)==null?void 0:Jt.on)==null||vn.call(Jt,"document-mode-change",qu),(Cr=(qn=ie.$superdoc)==null?void 0:qn.on)==null||Cr.call(qn,"active-editor-change",La),ur(),tr()}),pr(mt,$=>{var se;Br.value&&($?Lr.value&&Rl(Lr.value):((se=s.clearEditorCommentPositions)==null||se.call(s),$e.value=!1))}),pr(me,()=>{rc()});function io($){var se,ze;return($.metaKey||$.ctrlKey)&&!$.altKey&&((ze=(se=$.key)==null?void 0:se.toLowerCase)==null?void 0:ze.call(se))==="f"}function Rh($){return($.metaKey||$.ctrlKey)&&$.shiftKey&&!$.altKey&&($.code==="Digit8"||$.key==="8"||$.key==="*")}function Zu(){var We,bt,Jt,vn;const $=Y.value,se=document.activeElement;if(!(se instanceof Node))return!1;if($!=null&&$.contains(se))return!0;const ze=(Jt=(bt=(We=ie.$superdoc)==null?void 0:We.activeEditor)==null?void 0:bt.view)==null?void 0:Jt.dom;return ze instanceof Node&&(se===ze||((vn=ze.contains)==null?void 0:vn.call(ze,se)))}const oc={};function Oh($){io($)&&Pe.value&&bfe($,{focusInside:Zu(),owner:oc})&&it.wouldOpen()&&($.preventDefault(),$.stopPropagation(),D3(oc),it.open())}function sc(){D3(oc)}function uf(){Pe.value&&it.open()}function R($){var se,ze;Rh($)&&(Br.value||Zu()&&($.preventDefault(),$.stopPropagation(),(ze=(se=ie.$superdoc).toggleFormattingMarks)==null||ze.call(se)))}function X($){if($.key==="Escape"&&nl.value){$.preventDefault(),$.stopPropagation(),Ol();return}Oh($),!$.defaultPrevented&&R($)}function pe($){Oh($),!$.defaultPrevented&&R($)}Hs(()=>{var $,se,ze,We,bt,Jt,vn,qn,Cr,ln;($=s.cancelImportedTrackedChangeBootstrap)==null||$.call(s),D.destroy(),it.destroy(),rn.destroy(),yn(),Ti(),rl(),_r();for(const lr of Array.from(ni.keys()))rr(lr);for(const lr of Array.from(Di.keys()))Gs(lr);for(const lr of Array.from(Ro.keys()))cn(lr);ni.clear(),Gn.clear(),document.removeEventListener("contextmenu",Yu,!0),document.removeEventListener("keydown",X,!0),(ze=(se=ie.$superdoc)==null?void 0:se.off)==null||ze.call(se,"search:open",uf),(We=Y.value)==null||We.removeEventListener("pointerdown",sc,!0),(bt=Y.value)==null||bt.removeEventListener("focusin",sc,!0),(Jt=Y.value)==null||Jt.removeEventListener(l7,Da),yfe(oc),typeof window<"u"&&(window.removeEventListener("scroll",ya,!0),window.removeEventListener("resize",ya,!0)),Pn&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(Pn),Pn=0),document.removeEventListener("focusin",Ma,!0),document.removeEventListener("pointerdown",Ku,!0),document.removeEventListener("mousedown",ef,!0),document.removeEventListener("pointerup",Co,!0),document.removeEventListener("mouseup",Co,!0),document.removeEventListener("selectionchange",Co
608),(qn=(vn=ie.$superdoc)==null?void 0:vn.off)==null||qn.call(vn,"document-mode-change",qu),(ln=(Cr=ie.$superdoc)==null?void 0:Cr.off)==null||ln.call(Cr,"active-editor-change",La)});const xe=Ne(null),ke=Ne(!1),Me=dt(()=>{if(!f.value||f.value.source==="document-editor")return{x:null,y:null};const $=f.value.source==="pdf"?(m.value??100)/100:1,se=f.value.top*$,ze=f.value.left*$,We=f.value.right*$,bt=f.value.bottom*$;return{zIndex:500,borderRadius:"4px",top:se+"px",left:ze+"px",height:Math.abs(se-bt)+"px",width:Math.abs(ze-We)+"px"}}),He=$=>{var vn,qn;if(Le()&&!tt()){Ie();return}if(!$.selectionBounds||!bs.value)return;Ie();const se=window.matchMedia("(max-width: 768px)").matches;if(Xe({startX:$.selectionBounds.left,startY:$.selectionBounds.top,x:$.selectionBounds.right,y:$.selectionBounds.bottom,source:$.source}),!f.value)return;const ze=Math.abs(f.value.left-f.value.right)>5,We=Math.abs(f.value.top-f.value.bottom)>5;if(!ze||!We){(vn=xe.value)!=null&&vn.style&&(xe.value.style.pointerEvents="none"),Ie();return}p.value=$;const bt=$.source==="pdf"||((qn=$.source)==null?void 0:qn.value)==="pdf"?(m.value??100)/100:1,Jt=$.selectionBounds.top*bt;dn.top=Jt+"px",dn.right=se?"0":"-25px"},Ie=()=>{f.value=null,dn.top=null},Xe=({startX:$,startY:se,x:ze,y:We,source:bt,page:Jt})=>{if(!(typeof $=="number"||typeof se=="number")&&!(typeof ze=="number"||typeof We=="number")){Ie();return}if(!f.value){if(se==null||$==null)return;f.value={top:se,left:$,right:$,bottom:se,startX:$,startY:se,source:bt,page:Jt??null}}typeof $=="number"&&(f.value.startX=$),typeof se=="number"&&(f.value.startY=se),typeof We=="number"&&(We<f.value.startY?f.value.top=We:f.value.bottom=We),typeof ze=="number"&&(ze<f.value.startX?f.value.left=ze:f.value.right=ze)},Ke=$=>{var bt;const se=$==null?void 0:$.clientX,ze=$==null?void 0:$.clientY;if(typeof se!="number"||typeof ze!="number")return null;const We=document.elementsFromPoint(se,ze).find(Jt=>{var vn;return((vn=Jt==null?void 0:Jt.dataset)==null?void 0:vn.pdfPage)!=null});if(We){const Jt=Number((bt=We.dataset)==null?void 0:bt.pageNumber);return Number.isFinite(Jt)?Jt:null}return null},wt=$=>{Ie(),xe.value.style.pointerEvents="auto",Sn(()=>{ke.value=!0,xe.value.style.pointerEvents="none";const se=Ke($);if(xe.value.style.pointerEvents="auto",!se){ke.value=!1,xe.value.style.pointerEvents="none";return}const ze=xe.value.getBoundingClientRect(),We=m.value/100,bt=($.clientX-ze.left)/We,Jt=($.clientY-ze.top)/We;Xe({startX:bt,startY:Jt,page:se,source:"pdf"}),xe.value.addEventListener("mousemove",ct)})},ct=$=>{if(!ke.value)return;const se=xe.value.getBoundingClientRect(),ze=m.value/100,We=($.clientX-se.left)/ze,bt=($.clientY-se.top)/ze;Xe({x:We,y:bt})},vt=$=>{if(!ke.value||(xe.value.removeEventListener("mousemove",ct),!f.value))return;const se=f.value.page??Ke($),ze=s1({selectionBounds:{top:f.value.top,left:f.value.left,right:f.value.right,bottom:f.value.bottom},page:se??1,documentId:l.value[0].id,source:"pdf"});He(ze),xe.value.style.pointerEvents="none"},Ft=dt(()=>{var se;if(!ie.$superdoc.uiConfig.comments.enabled)return!1;const $=(se=ie.$superdoc.config.modules)==null?void 0:se.comments;return!$||$===!1?!1:!$.readOnly}),Zt=Ne(!1),an=Ne(null),Kt=$=>$&&typeof $=="object"&&"value"in $?$.value:$,tn=$=>{var bt,Jt;if(!Br.value||!$||$.type!=="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||((bt=ie.$superdoc.config.viewOptions)==null?void 0:bt.layout)==="web"||ie.$superdoc.uiConfig.ruler.suppressed||!Kt($.rulers)||!Zt.value)return!1;const se=(Jt=ie.$superdoc)==null?void 0:Jt.activeEditor;if(!se||se.editorVersion!==2)return!1;const ze=Kt($.id),We=an.value;return ze&&We&&ze!==We?!1:!!(se.pageMetrics&&se.pageLayout)},Bn=Ne({}),Rn=Ne(null);let Fr=null,kr=null,ir=0,ii=null,Do=null;const En=dt(()=>{var $,se,ze;return((ze=(se=($=ie.$superdoc)==null?void 0:$.uiConfig)==null?void 0:se.ruler)==null?void 0:ze.container)??null}),ws=()=>{var se;const $=En.value;return $?typeof $=="string"?((se=typeof document<"u"?document:globalThis.document)==null?void 0:se.querySelector($))??null:typeof HTMLElement<"u"&&$ instanceof HTMLElement?$:null:null},Nl=()=>{var $,se,ze,We,bt;return((se=($=ie.$superdoc)==null?void 0:$.activeEditor)==null?void 0:se.documentId)??((bt=(We=(ze=ie.$superdoc)==null?void 0:ze.activeEditor)==null?void 0:We.options)==null?void 0:bt.documentId)??null},Ml=()=>{if(En.value)return ws();const $=Nl();return $==null?null:Gn.get($)??Gn.get(String($))??null},xs=()=>{const $=Nl(),se=$==null?vs:Nc.get(String($))??null;if(!(se!=null&&se.isConnected))return null;const ze=Array.from(se.children).find(bt=>{var Jt;return((Jt=bt.dataset)==null?void 0:Jt.v2PaintWrapper)==="true"})??se,We=Array.from(ze.children).filter(bt=>{var Jt;return(Jt=bt.classList)==null?void 0:Jt.contains("superdoc-page")});return(We.find(bt=>{var Jt;return Number((Jt=bt.dataset)==null?void 0:Jt.pageIndex)===ir})??We[0]??ze).getBoundingClientRect()},fn=()=>
608{if(!Br.value){Bn.value={},Rn.value=null;return}const $=Ml();if(!$){Bn.value={},Rn.value=null;return}const se=xs();if(!se){Bn.value={},Rn.value=null;return}const ze=$.getBoundingClientRect(),We=Math.max(0,se.left-ze.left),bt=Math.max(0,ze.right-se.right);Bn.value={paddingLeft:`${We}px`,paddingRight:`${bt}px`},Rn.value={left:se.left,top:se.top,width:se.width,height:se.height}},_r=()=>{const $=Do;Do=null,ii=null,ir=0;try{$==null||$()}catch{}},Eo=$=>{var se,ze,We;if(_r(),!!$){ii=$;try{ir=((ze=(se=$.getActiveRulerContext)==null?void 0:se.call($))==null?void 0:ze.pageIndex)??0,Do=((We=$.subscribeActiveRulerContext)==null?void 0:We.call($,bt=>{if(ii!==$)return;const Jt=(bt==null?void 0:bt.pageIndex)??0;Jt!==ir&&(ir=Jt,Sn(()=>fn()))}))??null}catch{_r()}}},La=()=>{var ze,We;const $=(ze=ie.$superdoc)==null?void 0:ze.activeEditor,se=($==null?void 0:$.documentId)??((We=$==null?void 0:$.options)==null?void 0:We.documentId)??null;if(an.value=se,($==null?void 0:$.editorVersion)!==2||!$.pageMetrics||!$.pageLayout){rl(),_r(),Bn.value={},Zt.value=!1;return}ii!==$.pageLayout&&Eo($.pageLayout),Zt.value=!0,Sn(()=>{fn(),il()})},rl=()=>{typeof window<"u"&&window.removeEventListener("scroll",fn,!0);try{Fr==null||Fr.disconnect()}catch{}Fr=null;try{kr==null||kr.disconnect()}catch{}kr=null},il=()=>{if(rl(),typeof window<"u"&&window.addEventListener("scroll",fn,!0),typeof ResizeObserver>"u")return;const $=me.value,se=Ml();$&&(Fr=new ResizeObserver(()=>fn()),Fr.observe($)),se&&(kr=new ResizeObserver(()=>fn()),kr.observe(se))},Bc=($,se)=>{!$||!se||($.documentMarginsLastChange=se.pageMargins??null,ie.$superdoc.emit("page-margins-change",{documentId:$.id,editorVersion:2,sectionId:se.sectionId,sectionIndex:se.sectionIndex,side:se.side,value:se.value,pageMargins:se.pageMargins}))},va=$=>{bs.value&&(Ie(),ke.value=!0,wt($))},df=({selectionBounds:$,documentId:se,page:ze})=>{if(!$||!se)return;const We=s1({selectionBounds:$,documentId:se,page:ze,source:"pdf"});He(We)},jc=$=>{var se,ze;(ze=(se=me.value)==null?void 0:se.querySelectorAll(".superdoc__sub-document"))==null||ze.forEach(We=>{We.querySelector(".sd-pdf-viewer")||($===1?(We.style.transformOrigin="",We.style.transform="",We.style.width=""):(We.style.transformOrigin="top left",We.style.transform=`scale(${$})`,We.style.width=`${100/$}%`))})};let ol=!1;const ks=()=>{if(ol||ie.$superdoc.config.useLayoutEngine!==!1)return;const $=(m.value??100)/100;$!==1&&(ol=!0,Sn(()=>jc($)))};pr(()=>m.value,$=>{var bt,Jt,vn,qn,Cr;const se=($??100)/100,ze=$??100,We=((Jt=(bt=ie.$superdoc)==null?void 0:bt.activeEditor)==null?void 0:Jt.pageMetrics)??null;if(Br.value&&((qn=(vn=ie.$superdoc)==null?void 0:vn.activeEditor)==null?void 0:qn.editorVersion)===2&&(We!=null&&We.setZoom))try{We.setZoom(ze)}catch(ln){console.warn("[SuperDoc][v2] setZoom failed",ln)}else ol=!0,jc(se);(Cr=oo())==null||Cr.updateScale(se),Sn(()=>{cc(),oa()})}),pr(K,()=>{Q.value||(Q.value=!0)});const{whiteboardModuleConfig:Wi,whiteboard:Dl,whiteboardPages:go,whiteboardPageSizes:ac,whiteboardPageOffsets:ia,whiteboardEnabled:Is,whiteboardOpacity:Ll,handleWhiteboardPageReady:lc,updateWhiteboardPageSizes:cc,updateWhiteboardPageOffsets:oa}=vde({proxy:ie,layers:me,documents:l,modules:x}),oo=()=>Array.isArray(lt.value)?lt.value[0]:lt.value,sa=dt(()=>Xu.value&&!!Wi.value),Wo=dt(()=>Is.value);return($,se)=>{var ze;return Ze(),ut("div",{ref_key:"superdocRoot",ref:Y,class:Wr(["superdoc",{"superdoc--with-sidebar":tl.value,"superdoc--web-layout":((ze=Yt(ie).$superdoc.config.viewOptions)==null?void 0:ze.layout)==="web","superdoc--contained":Yt(ie).$superdoc.config.contained,"high-contrast":Yt(oe)}]),style:Ai(z.value),onKeydown:pe},[et("div",{class:"superdoc__layers layers",ref_key:"layers",ref:me,role:"group"},[yu.value?(Ze(),ut("div",{key:0,class:"superdoc__tools tools",style:Ai(dn)},[et("div",{class:"tools-item","data-id":"is-tool",onMousedown:se[0]||(se[0]=Gr(We=>zr("comments"),["stop","prevent"]))},[et("div",{class:"superdoc__tools-icon",innerHTML:Yt(Qf).comment},null,8,Ape)],32)],4)):gn("",!0),et("div",Tpe,[bs.value?(Ze(),ut("div",{key:0,class:"superdoc__selection-layer selection-layer",onMousedown:wt,onMouseup:vt,ref_key:"selectionLayer",ref:xe},[Yt(f)&&Ft.value?(Ze(),ut("div",{key:0,style:Ai(Me.value),class:"superdoc__temp-selection temp-selection sd-highlight sd-initial-highlight"},null,4)):gn("",!0)],544)):gn("",!0),(Ze(!0),ut(Dr,null,ki(Yt(l),We=>(Ze(),ut("div",{class:"superdoc__sub-document sub-document",key:`${We.id}:${We.editorMountNonce}`,ref_for:!0,ref:bt=>dr(We,bt)},[We.type===Yt("application/pdf")?(Ze(),ei(Yt(n),{key:0,file:We.data,"file-id":We.id,"initial-scale":(Yt(m)??100)/100,config:Yt(Wn),onSelectionRaw:df,onByp
608assSelection:va,onPageRendered:Yt(lc),onDocumentReady:se[1]||(se[1]=({documentId:bt,viewerContainer:Jt})=>gi(bt,Jt)),ref_for:!0,ref_key:"pdfViewerRef",ref:lt},null,8,["file","file-id","initial-scale","config","onPageRendered"])):gn("",!0),We.type===Yt("application/vnd.openxmlformats-officedocument.wordprocessingml.document")&&Yt(Ue)&&tn(We)?(Ze(),ut(Dr,{key:1},[En.value?(Ze(),ei(Hy,{key:0,to:En.value},[et("div",{class:"v2-ruler-host",style:Ai(Bn.value)},[wo(Yt(Ue),{"page-layout":Yt(ie).$superdoc.activeEditor.pageLayout,"measurement-unit":Yt(b),"active-page-rect":Rn.value,onPageMarginsChange:bt=>Bc(We,bt)},null,8,["page-layout","measurement-unit","active-page-rect","onPageMarginsChange"])],4)],8,["to"])):(Ze(),ut("div",{key:1,class:"v2-ruler-host",style:Ai(Bn.value)},[wo(Yt(Ue),{"page-layout":Yt(ie).$superdoc.activeEditor.pageLayout,"measurement-unit":Yt(b),"active-page-rect":Rn.value,onPageMarginsChange:bt=>Bc(We,bt)},null,8,["page-layout","measurement-unit","active-page-rect","onPageMarginsChange"])],4))],64)):gn("",!0),We.type===Yt("application/vnd.openxmlformats-officedocument.wordprocessingml.document")?(Ze(),ei(Yt(Ce),{key:2,"file-source":We.data,"document-id":We.id,options:xh(We),"measurement-unit":Yt(b),onV2EditorReady:Zr,onV2EditorFailed:sm,onV2Render:bh,onV2RenderCleared:Mc,onV2SelectionChanged:uu,onV2HostEvent:bt=>So(We,bt),onV2LinkClick:Xd,onV2CommentCreated:Zd,onV2PageMetrics:el,onV2RenderReadiness:bt=>Jd(We,bt),onV2OpenDiagnostics:bt=>ic(We,bt)},null,8,["file-source","document-id","options","measurement-unit","onV2HostEvent","onV2RenderReadiness","onV2OpenDiagnostics"])):gn("",!0),We.type===Yt("text/html")?(Ze(),ei(Sde,{key:3,onReady:se[2]||(se[2]=bt=>gi(bt,null)),onSelectionChange:He,"file-source":We.data,"document-id":We.id},null,8,["file-source","document-id"])):gn("",!0)]))),128)),sa.value?(Ze(),ei(xde,{key:1,class:"superdoc__whiteboard-layer",whiteboard:Yt(Dl),pages:Yt(go),"page-sizes":Yt(ac),"page-offsets":Yt(ia),enabled:Yt(Is),interactive:Wo.value,opacity:Yt(Ll)},null,8,["whiteboard","pages","page-sizes","page-offsets","enabled","interactive","opacity"])):gn("",!0),of.value?(Ze(),ei(yde,{key:2,onAnchorActivate:Kn})):gn("",!0)])],512),tl.value?(Ze(),ut("div",{key:0,ref_key:"rightSidebarRef",ref:Ve,class:"superdoc__right-sidebar right-sidebar"},[et("div",Ipe,[Yt(Q)&&(K.value.length>0||Yt(F))?(Ze(!0),ut(Dr,{key:0},ki(Yt(V),We=>(Ze(),ei(dde,{parent:me.value,"current-document":We},null,8,["parent","current-document"]))),256)):gn("",!0)])],512)):gn("",!0),nl.value?(Ze(),ut("div",{key:1,class:"superdoc__compact-comment-popover",style:Ai(Yt(gu))},[wo(oT,{comment:nl.value,parent:me.value},null,8,["comment","parent"])],4)):gn("",!0),wo(Epe,{"geometry-target":me.value},null,8,["geometry-target"])],38)}}},[["__scopeId","data-v-7bbf01da"]]),Kj="devtools-plugin:setup",Yj="dev.esm.pinia",Kr={disabledAppRefCounts:new Map,hook:null,originalHookEmit:null,isHookPropertyPatched:!1,originalHookPropertyDescriptor:null,hookPropertyValue:void 0,isQueuePropertyPatched:!1,originalQueuePropertyDescriptor:null,queuePropertyValue:void 0,queue:null,originalQueuePush:null},Xj=(e,t)=>e===Kj&&(t==null?void 0:t.id)===Yj&&(t==null?void 0:t.app)&&Kr.disabledAppRefCounts.has(t.app),Npe=e=>Array.isArray(e)&&Xj(Kj,e[0]),Mpe=e=>{if(Kr.isQueuePropertyPatched){Kr.queuePropertyValue=e;return}globalThis.__VUE_DEVTOOLS_PLUGINS__=e},Dpe=e=>{const t=globalThis.__VUE_DEVTOOLS_PLUGINS__;if(Array.isArray(t))for(let n=t.length-1;n>=0;n--){const[r]=t[n];(r==null?void 0:r.id)===Yj&&(r==null?void 0:r.app)===e&&t.splice(n,1)}},Zj=()=>{const{queue:e,originalQueuePush:t}=Kr;e&&typeof t=="function"&&(e.push=t),Kr.queue=null,Kr.originalQueuePush=null},Qj=()=>{const{hook:e,originalHookEmit:t}=Kr;e&&typeof t=="function"&&(e.emit=t),Kr.hook=null,Kr.originalHookEmit=null},Tb=()=>{const e=globalThis.__VUE_DEVTOOLS_PLUGINS__;if(e==null){Mpe([]),Tb();return}if(!Array.isArray(e))return;const t=e;if(Kr.queue===t)return;Zj();const n=t.push;typeof n=="function"&&(Kr.queue=t,Kr.originalQueuePush=n,t.push=function(...i){const o=i.filter(s=>!Npe(s));return o.length===0?this.length:n.apply(this,o)})},Lpe=()=>{if(Kr.isQueuePropertyPatched){Tb();return}const e=Object.getOwnPropertyDescriptor(globalThis,"__VUE_DEVTOOLS_PLUGINS__");
608if((e==null?void 0:e.configurable)===!1){Tb();return}Kr.originalQueuePropertyDescriptor=e??null,Kr.queuePropertyValue=globalThis.__VUE_DEVTOOLS_PLUGINS__,Object.defineProperty(globalThis,"__VUE_DEVTOOLS_PLUGINS__",{configurable:!0,enumerable:(e==null?void 0:e.enumerable)??!0,get(){return Kr.queuePropertyValue},set(t){Kr.queuePropertyValue=t,Tb()}}),Kr.isQueuePropertyPatched=!0,Tb()},Ppe=()=>{if(!Kr.isQueuePropertyPatched)return;const{queuePropertyValue:e,originalQueuePropertyDescriptor:t}=Kr;delete globalThis.__VUE_DEVTOOLS_PLUGINS__,t?"value"in t?Object.defineProperty(globalThis,"__VUE_DEVTOOLS_PLUGINS__",{configurable:t.configurable,enumerable:t.enumerable,writable:t.writable,value:e}):(Object.defineProperty(globalThis,"__VUE_DEVTOOLS_PLUGINS__",t),typeof t.set=="function"&&t.set.call(globalThis,e)):e!==void 0&&(globalThis.__VUE_DEVTOOLS_PLUGINS__=e),Kr.isQueuePropertyPatched=!1,Kr.originalQueuePropertyDescriptor=null,Kr.queuePropertyValue=void 0},ix=()=>{const e=globalThis==null?void 0:globalThis.__VUE_DEVTOOLS_GLOBAL_HOOK__;if(!e||typeof e.emit!="function"||Kr.hook===e)return;Qj();const t=e.emit;Kr.hook=e,Kr.originalHookEmit=t,e.emit=function(r,...i){const[o]=i;if(!Xj(r,o))return t.call(this,r,...i)}},Bpe=()=>{if(Kr.isHookPropertyPatched){ix();return}const e=Object.getOwnPropertyDescriptor(globalThis,"__VUE_DEVTOOLS_GLOBAL_HOOK__");if((e==null?void 0:e.configurable)===!1){ix();return}Kr.originalHookPropertyDescriptor=e??null,Kr.hookPropertyValue=globalThis.__VUE_DEVTOOLS_GLOBAL_HOOK__,Object.defineProperty(globalThis,"__VUE_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:(e==null?void 0:e.enumerable)??!0,get(){return Kr.hookPropertyValue}
608,set(t){Kr.hookPropertyValue=t,ix()}}),Kr.isHookPropertyPatched=!0,ix()},jpe=()=>{if(!Kr.isHookPropertyPatched)return;const{hookPropertyValue:e,originalHookPropertyDescriptor:t}=Kr;delete globalThis.__VUE_DEVTOOLS_GLOBAL_HOOK__,t?"value"in t?Object.defineProperty(globalThis,"__VUE_DEVTOOLS_GLOBAL_HOOK__",{configurable:t.configurable,enumerable:t.enumerable,writable:t.writable,value:e}):(Object.defineProperty(globalThis,"__VUE_DEVTOOLS_GLOBAL_HOOK__",t),typeof t.set=="function"&&t.set.call(globalThis,e)):e!==void 0&&(globalThis.__VUE_DEVTOOLS_GLOBAL_HOOK__=e),Kr.isHookPropertyPatched=!1,Kr.originalHookPropertyDescriptor=null,Kr.hookPropertyValue=void 0},Fpe=()=>{Kr.disabledAppRefCounts.size>0||(Qj(),jpe(),Zj(),Ppe())},zpe=(e,t)=>{if(!t)return()=>{};const n=Kr.disabledAppRefCounts.get(e)??0;return Kr.disabledAppRefCounts.set(e,n+1),Bpe(),Lpe(),()=>{const r=Kr.disabledAppRefCounts.get(e);r&&(r===1?Kr.disabledAppRefCounts.delete(e):Kr.disabledAppRefCounts.set(e,r-1),Fpe())}},Upe=({disablePiniaDevtools:e=!1}={})=>{const t=UA(Ope),n=Vae(),r=zpe(t,e);let i,o,s;try{t.use(n),e&&Dpe(t),t.directive("click-outside",z5),i=tv(),o=qd(),s=cu()}catch(l){throw r(),l}if(typeof t.unmount=="function"){const l=t.unmount.bind(t);t.unmount=(...u)=>(r(),l(...u))}return{app:t,pinia:n,superdocStore:i,commentsStore:o,highContrastModeStore:s}},Vpe={docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",pdf:"application/pdf",zip:"application/zip",html:"text/html",txt:"text/plain;charset=utf-8",json:"application/json"},Hpe=e=>!e||typeof e.toLowerCase!="function"?"application/octet-stream":Vpe[e.toLowerCase()]||"application/octet-stream",UM,u7=typeof Blob=="function"?(UM=Object.getOwnPropertyDescriptor(Blob.prototype,"size"))==null?void 0:UM.get:void 0,$pe=e=>{if(!u7)return!1;try{return u7.call(e),!0}catch{return!1}},Gpe=(e,t)=>{const n=Hpe(t);if($pe(e))return e instanceof Blob?e:new Blob([e],{type:e.type||n});if(e instanceof ArrayBuffer)return new Blob([e],{type:n});if(ArrayBuffer.isView(e)){const{buffer:r,byteOffset:i,byteLength:o}=e,s=r.slice(i,i+o);return new Blob([s],{type:n})}if(typeof e=="string")return new Blob([e],{type:n});throw e==null?new TypeError("createDownload requires a Blob, ArrayBuffer, or ArrayBufferView."):new TypeError(`Cannot create download from value of type ${typeof e}`)},d7=(e,t,n)=>{const r=Gpe(e,n);if(typeof URL>"u"||typeof URL.createObjectURL!="function"||typeof document>"u"||typeof document.createElement!="function")return r;const i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=`${t}.${n}`;const s=document.body&&typeof document.body.appendChild=="function";return s&&document.body.appendChild(o),o.click(),s&&document.body.removeChild(o),typeof URL.revokeObjectURL=="function"&&setTimeout(()=>URL.revokeObjectURL(i),0),r},f7=e=>{const t=e.toLowerCase();return t.endsWith(".docx")?e.slice(0,-5):t.endsWith(".pdf")?e.slice(0,-4):e},ry,x_,VM,qpe=(VM=class{constructor(){Cn(this,ry,new Map);Cn(this,x_,1)}idFor(e){const t=Ae(this,ry).get(e);if(t!==void 0)return t;const n=Ew(this,x_)._++;return Ae(this,ry).set(e,n),n}has(e){return Ae(this,ry).has(e)}},ry=new WeakMap,x_=new WeakMap,VM);function Wpe(e){const t=typeof e.email=="string"&&e.email.length>0?e.email:null;return t?`email:${t}`:`label:${e.actorLabel}`}function Kpe(e,t){const n=e.displayName??null,r=e.email??null,i={clientId:t};return n&&(i.name=n),r&&(i.email=r),typeof e.color=="string"&&e.color.length>0&&(i.color=e.color),i}function Ype(e){const t={clientId:0};(e==null?void 0:e.id)!=null&&(t.id=e.id),(e==null?void 0:e.name)!=null&&(t.name=e.name),(e==null?void 0:e.email)!=null&&(t.email=e.email);const n=e==null?void 0:e.color;return typeof n=="string"&&n.length>0&&(t.color=n),t}function Xpe(e){const t=new qpe;let n=new Set;return{registry:t,next(r){const i=[],o=new Set,s=new Set;for(const d of r.remoteActors){const f=Wpe(d);if(s.has(f))continue;s.add(f);const p=t.idFor(f);o.add(p),i.push(Kpe(d,p))}const l=[];for(const d of o)n.has(d)||l.push(d);const u=[];for(const d of n)o.has(d)||u.push(d);return n=o,{states:[Ype(e()),...i],added:l,removed:u}}}}var Sd,HM,Zpe=(HM=class{constructor(){Cn(this,Sd,new Map)}on(e,t){const n=Ae(this,Sd).get(e);n?n.push(t):Ae(this,Sd).set(e,[t])}emit(e,...t){const n=Ae(this,Sd).get(e);if(n)for(const r of n)r.apply(this,t)}off(e,t){const n=Ae(this,Sd).get(e);n&&(t?Ae(this,Sd).set(e,n.filter(r=>r!==t)):Ae(this,Sd).delete(e))}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};this.on(e,n)}removeAllListeners(){Ot(this,Sd,new Map)}},Sd=new WeakMap,HM);function Qpe(e){return e.flatMap(t=>[t[0],t[1]])}function h7(e="id"){return`${e}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function p7(e={}){const{value:t="",left:n,top:r,width:i,height:o,fontSize:s=16,fontFamily:l="Arial, sans-serif",color:u="#000",background:d="transparent",resize:f="none"}=e,p=document.createElement("textarea");p.value=t;const m=p.style;return m.position="absolute",n!=null&&(m.left=`${n}px`),r!=null&&(m.top=`${r}px`),i!=null&&(m.width=typeof i=="number"?`${i}px`:i),o!=null&&(m.height=typeof o=="number"?`${o}px`:o),m.minWidth=120,m.fontSize=typeof s=="number"?`${s}
608px`:s,m.fontFamily=l,m.color=u,m.background=d,m.border="2px solid #3c97fe80",m.padding="2px 4px",m.margin="0",m.zIndex="1000",m.overflow="hidden",m.resize=f,m.outline="none",p}var ox=18,Yc,Uo,ps,gl,$a,Xc,Ff,Tp,Ed,Zc,iy,Vo,yl,zf,oy,sy,ay,ly,Vn,Jj,eme,tme,nme,rme,eF,tF,nF,RE,rF,iF,OE,oF,NE,Kx,sF,aF,yd,D0,ME,lF,e2,cF,uF,dF,fF,hF,pF,$M,Jpe=($M=class{constructor(e){Cn(this,Vn);Ao(this,"pageIndex",null);Ao(this,"strokes",[]);Ao(this,"text",[]);Ao(this,"images",[]);Ao(this,"size",null);Ao(this,"originalSize",null);Cn(this,Yc,null);Cn(this,Uo,null);Cn(this,ps,null);Cn(this,gl,null);Cn(this,$a,null);Cn(this,Xc,null);Cn(this,Ff,new Set);Cn(this,Tp,!1);Cn(this,Ed,null);Cn(this,Zc,[]);Cn(this,iy,null);Cn(this,Vo,"select");Cn(this,yl,!1);Cn(this,zf,null);Cn(this,oy,"#2293fb");Cn(this,sy,5);Cn(this,ay,null);Cn(this,ly,null);Cn(this,e2,e=>{var n;if(!Ae(this,zf)||!Ae(this,yl)||Ae(this,Vo)!=="select")return;const t=(n=e.target)==null?void 0:n.tagName;t==="INPUT"||t==="TEXTAREA"||(e.key==="Backspace"||e.key==="Delete")&&(e.preventDefault(),Ye(this,Vn,lF).call(this),Ye(this,Vn,yd).call(this))});Ye(this,Vn,Jj).call(this,e)}setTool(e){Ot(this,Vo,e),Ye(this,Vn,Kx).call(this),Ye(this,Vn,D0).call(this),this.render()}getTool(){return Ae(this,Vo)}setEnabled(e){Ot(this,yl,!!e),Ye(this,Vn,Kx).call(this),Ye(this,Vn,D0).call(this),this.render()}isEnabled(){return Ae(this,yl)}setSize(e){if(!e)return;const{width:t,height:n,originalWidth:r,originalHeight:i}=e;this.size={width:t,height:n},this.originalSize={width:r??null,height:i??null}}resize(e,t){Ae(this,Uo)&&(Ae(this,Uo).size({width:e,height:t}),Ye(this,Vn,NE).call(this),this.render())}mount(e){var r,i;if(!e||Ae(this,Uo)&&Ae(this,Xc)===e)return;Ae(this,Uo)&&this.destroy();const t=((r=this.size)==null?void 0:r.width)||e.clientWidth||1,n=((i=this.size)==null?void 0:i.height)||e.clientHeight||1;Ot(this,Xc,e),Ot(this,Uo,new(Ae(this,Yc)).Stage({container:e,width:t,height:n})),Ot(this,ps,new(Ae(this,Yc)).Layer),Ot(this,gl,new(Ae(this,Yc)).Layer),Ae(this,Uo).add(Ae(this,ps)),Ae(this,Uo).add(Ae(this,gl)),Ye(this,Vn,NE).call(this),Ye(this,Vn,Kx).call(this),Ye(this,Vn,oF).call(this),this.render()}render(){Ae(this,ps)&&(Ae(this,$a)&&(Ae(this,$a).destroy(),Ot(this,$a,null)),Ae(this,ps).find(".wb-text").forEach(e=>e.destroy()),Ae(this,gl).destroyChildren(),this.renderStrokes(),this.renderText(),this.renderImages(),Ae(this,ps).batchDraw(),Ae(this,gl).batchDraw())}renderStrokes(){this.strokes.forEach(e=>{const{points:t,strokeWidth:n}=Ye(this,Vn,eF).call(this,e),r=new(Ae(this,Yc)).Line({points:Qpe(t),stroke:e.color||Ae(this,oy),strokeWidth:n,lineCap:"round",lineJoin:"round",globalCompositeOperation:e.type==="erase"?"destination-out":"source-over"});r.name("wb-stroke"),Ae(this,gl).add(r)})}renderText(){this.text.forEach(e=>{const{x:t,y:n,width:r,fontSize:i}=Ye(this,Vn,nF).call(this,e),o=new(Ae(this,Yc)).Text({x:t,y:n,text:e.content,fontSize:i,fontFamily:"Arial, sans-serif",fill:"#2293fb",draggable:Ae(this,Vo)==="select",width:r});o.name("wb-text"),o._whiteboardId=e.id,Ye(this,Vn,sF).call(this,o,e),Ae(this,ps).add(o)})}renderImages(){var i;const e=((i=Ae(this,ps))==null?void 0:i.find(".wb-image"))??[],t=new Map;e.forEach(o=>{t.set(o._whiteboardId,o)});const n=new Set(this.images.map(o=>o.id));e.forEach(o=>{n.has(o._whiteboardId)||o.destroy()});const r=(o,s)=>{const{x:l,y:u,width:d,height:f}=Ye(this,Vn,rF).call(this,o),p=t.get(o.id);if(p){Number.isFinite(l)&&p.x(l),Number.isFinite(u)&&p.y(u),Number.isFinite(d)&&p.width(d),Number.isFinite(f)&&p.height(f),p.draggable(Ae(this,Vo)==="select");return}if(Ae(this,Ff).has(o.id))return;Ae(this,Ff).add(o.id);const m=new window.Image;m.crossOrigin="Anonymous",m.onload=()=>{if(t.get(o.id)){Ae(this,Ff).delete(o.id);return}if(!Ae(this,ps)){Ae(this,Ff).delete(o.id);return}const y=new(Ae(this,Yc)).Image({x:l,y:u,image:m,width:d??m.width,height:f??m.height,draggable:Ae(this,Vo)==="select"});y.name(s),y._whiteboardId=o.id,Ye(this,Vn,aF).call(this,y,o),Ae(this,ps).add(y),Ae(this,ps).batchDraw(),Ae(this,Ff).delete(o.id)},m.onerror=()=>{Ae(this,Ff).delete(o.id)},m.src=o.src};
608this.images.forEach(o=>r(o,"wb-image"))}destroy(){Ae(this,Uo)&&Ae(this,Uo).destroy(),Ot(this,Uo,null),Ot(this,ps,null),Ot(this,gl,null),Ot(this,Xc,null),Ot(this,Tp,!1),Ot(this,Ed,null),Ot(this,Zc,[]),Ot(this,zf,null),Ot(this,$a,null),window.removeEventListener("keydown",Ae(this,e2))}toJSON(){return{strokes:this.strokes,text:this.text,images:this.images}}applyData(e={}){const t=Array.isArray(e.strokes)?e.strokes:[],n=Array.isArray(e.text)?e.text:[],r=Array.isArray(e.images)?e.images:[];this.strokes=t,this.text=n,this.images=r,this.render()}addStroke(e){if(!e||!Array.isArray(e.points))return;const{pointsN:t,widthN:n}=Ye(this,Vn,tF).call(this,e);this.strokes.push({pointsN:t,widthN:n,color:e.color,type:e.type})}addText(e){if(!e||typeof e.content!="string")return;const{xN:t,yN:n,widthN:r,fontSizeN:i}=Ye(this,Vn,RE).call(this,e);this.text.push({id:e.id??h7("text"),xN:t,yN:n,content:e.content,fontSizeN:i,widthN:r}),this.render(),Ye(this,Vn,yd).call(this)}addImage(e){if(!e||!e.src)return;const{xN:t,yN:n,widthN:r,heightN:i}=Ye(this,Vn,iF).call(this,e),o={id:e.id??h7("image"),stickerId:e.stickerId??(e.type==="sticker"?e.id??null:null),xN:t,yN:n,src:e.src,widthN:r,heightN:i,type:e.type??"image"};this.images.push(o),this.render(),Ye(this,Vn,yd).call(this)}},Yc=new WeakMap,Uo=new WeakMap,ps=new WeakMap,gl=new WeakMap,$a=new WeakMap,Xc=new WeakMap,Ff=new WeakMap,Tp=new WeakMap,Ed=new WeakMap,Zc=new WeakMap,iy=new WeakMap,Vo=new WeakMap,yl=new WeakMap,zf=new WeakMap,oy=new WeakMap,sy=new WeakMap,ay=new WeakMap,ly=new WeakMap,Vn=new WeakSet,Jj=function(e){Ot(this,Yc,e.Renderer),Ot(this,yl,e.enabled),this.pageIndex=e.pageIndex,Ot(this,ay,e.onChange),Ot(this,ly,e.onToolChange)},eme=function(e,t){var i,o;const n=((i=this.size)==null?void 0:i.width)||1,r=((o=this.size)==null?void 0:o.height)||1;return{xN:e/n,yN:t/r}},tme=function(e,t){var i,o;const n=((i=this.size)==null?void 0:i.width)||1,r=((o=this.size)==null?void 0:o.height)||1;return{x:e*n,y:t*r}},nme=function(e,t){var i,o;const n=((i=this.size)==null?void 0:i.width)||1,r=((o=this.size)==null?void 0:o.height)||1;return{wN:e/n,hN:t/r}},rme=function(e,t){var i,o;const n=((i=this.size)==null?void 0:i.width)||1,r=((o=this.size)==null?void 0:o.height)||1;return{width:e*n,height:t*r}},eF=function(e){const{width:t=1,height:n=1}=this.size||{};return{points:(Array.isArray(e.pointsN)?e.pointsN:[]).map(r=>[r[0]*t,r[1]*n]),strokeWidth:Number.isFinite(e.widthN)?e.widthN*((t+n)/2):Ae(this,sy)}},tF=function(e){const{width:t=1,height:n=1}=this.size||{};return{pointsN:(Array.isArray(e.points)?e.points:[]).map(r=>[r[0]/t,r[1]/n]),widthN:Number.isFinite(e.width)?e.width/((t+n)/2):void 0}},nF=function(e){const{width:t=1,height:n=1}=this.size||{};return{x:(e.xN??0)*t,y:(e.yN??0)*n,width:Number.isFinite(e.widthN)?e.widthN*t:void 0,fontSize:Number.isFinite(e.fontSizeN)?e.fontSizeN*n:ox}},RE=function(e){var i;const{width:t=1,height:n=1}=this.size||{},r=((i=this.originalSize)==null?void 0:i.height)??n;return{xN:(e.x??0)/t,yN:(e.y??0)/n,widthN:Number.isFinite(e.width)?e.width/t:null,fontSizeN:Number.isFinite(e.fontSize)?e.fontSize/r:ox/r}},rF=function(e){const{width:t=1,height:n=1}=this.size||{};return{x:(e.xN??0)*t,y:(e.yN??0)*n,width:Number.isFinite(e.widthN)?e.widthN*t:void 0,height:Number.isFinite(e.heightN)?e.heightN*n:void 0}},iF=function(e){const{width:t=1,height:n=1}=this.size||{};return{xN:(e.x??0)/t,yN:(e.y??0)/n,widthN:Number.isFinite(e.width)?e.width/t:null,heightN:Number.isFinite(e.height)?e.height/n:null}},OE=function(){var n,r;const e=(n=this.size)==null?void 0:n.width,t=((r=this.originalSize)==null?void 0:r.width)??e;return!Number.isFinite(e)||!Number.isFinite(t)||!t?1:e/t},oF=function(){!Ae(this,Uo)||!Ae(this,ps)||(Ae(this,Uo).on("mousedown touchstart",e=>{Ye(this,Vn,uF).call(this,e)}),Ae(this,Uo).on("mousemove touchmove",e=>{Ye(this,Vn,dF).call(this,e)}),Ae(this,Uo).on("mouseup touchend",e=>{Ye(this,Vn,fF).call(this,e)}),Ae(this,Uo).on("click tap",e=>{Ye(this,Vn,cF).call(this,e)}),window.addEventListener("keydown",Ae(this,e2)))},NE=function(){var t,n;const e=Math.min(window.devicePixelRatio||1,1.5);(t=Ae(this,ps))!=null&&t.getCanvas&&Ae(this,ps).getCanvas().setPixelRatio(e),(n=Ae(this,gl))!=null&&n.getCanvas&&Ae(this,gl).getCanvas().setPixelRatio(e)},Kx=function(){if(!Ae(this,gl))return;const e=Ae(this,Vo)==="draw"||Ae(this,Vo)==="erase",t=!!(Ae(this,yl)&&e);Ae(this,gl).listening(t)},sF=function(e,t){e.on("click tap",n=>{Ae(this,Vo)!=="select"||!Ae(this,yl)||(n.cancelBubble=!0,Ye(this,Vn,ME).call(this,e))}),e.on("dragend",()=>{var i,o;const{xN:n,yN:r}=Ye(this,Vn,RE).call(this,{x:e.x(),y:e.y(),fontSize:t.fontSizeN?t.fontSizeN*(((i=this.size)==null?void 0:i.height)||1):ox,width:t.widthN?t.widthN*(((o=this.size)==null?void 0:o.width)||1):null});t.xN=n,t.yN=r,Ye(this,Vn,yd).call(this)}),e.on("transform",()=>{e.scaleY(1),e.setAttrs({width:e.width()*e.scaleX(),scaleX:1})}),e.on("transformend",()=>{var i,o;e.setAttrs({width:Math.max(1,e.width()*e.scaleX()),scaleX:1,scaleY:1}
608);const n=e.width(),r=((i=this.size)==null?void 0:i.width)||1;t.widthN=n/r,t.xN=e.x()/r,t.yN=e.y()/(((o=this.size)==null?void 0:o.height)||1),Ye(this,Vn,yd).call(this)}),e.on("dblclick dbltap",n=>{Ae(this,Vo)!=="select"||!Ae(this,yl)||(n.cancelBubble=!0,Ye(this,Vn,pF).call(this,e,t))})},aF=function(e,t){e.on("click tap",n=>{Ae(this,Vo)!=="select"||!Ae(this,yl)||(n.cancelBubble=!0,Ye(this,Vn,ME).call(this,e))}),e.on("dragend",()=>{var i,o;const n=((i=this.size)==null?void 0:i.width)||1,r=((o=this.size)==null?void 0:o.height)||1;t.xN=e.x()/n,t.yN=e.y()/r,Ye(this,Vn,yd).call(this)}),e.on("transformend",()=>{var u,d;const n=e.scaleX(),r=e.scaleY(),i=Math.max(1,e.width()*n),o=Math.max(1,e.height()*r);e.scale({x:1,y:1}),e.width(i),e.height(o);const s=((u=this.size)==null?void 0:u.width)||1,l=((d=this.size)==null?void 0:d.height)||1;t.widthN=i/s,t.heightN=o/l,t.xN=e.x()/s,t.yN=e.y()/l,Ye(this,Vn,yd).call(this)})},yd=function(){Ae(this,ay)&&Ae(this,ay).call(this)},D0=function(){var e;Ae(this,$a)&&(Ae(this,$a).destroy(),Ot(this,$a,null),Ot(this,zf,null),(e=Ae(this,ps))==null||e.batchDraw())},ME=function(e){if(!Ae(this,ps))return;Ot(this,zf,e);const t=e.name&&e.name()==="wb-text",n=t?["middle-left","middle-right"]:["top-left","top-right","bottom-left","bottom-right"],r=(i,o)=>o.width<20?i:t?{...o,height:i.height,y:i.y}:o.height<20?i:o;Ae(this,$a)?(Ae(this,$a).nodes([e]),Ae(this,$a).enabledAnchors(n),Ae(this,$a).boundBoxFunc(r)):(Ot(this,$a,new(Ae(this,Yc)).Transformer({nodes:[e],enabledAnchors:n,rotateEnabled:!1,keepRatio:!1,boundBoxFunc:r})),Ae(this,ps).add(Ae(this,$a))),Ae(this,ps).batchDraw()},lF=function(){if(!Ae(this,zf))return;const e=Ae(this,zf),t={"wb-text":()=>{const n=e._whiteboardId;this.text=this.text.filter(r=>r.id!==n)},"wb-image":()=>{const n=e._whiteboardId;this.images=this.images.filter(r=>r.id!==n)}}[e.name&&e.name()];t&&t(),e.destroy(),Ye(this,Vn,D0).call(this),this.render()},e2=new WeakMap,cF=function(e){if(!Ae(this,yl)||!Ae(this,Uo))return;const t={text:()=>{const n=Ae(this,Uo).getPointerPosition();n&&Ye(this,Vn,hF).call(this,n.x,n.y)},select:()=>{(e==null?void 0:e.target)===Ae(this,Uo)&&Ye(this,Vn,D0).call(this)}}[Ae(this,Vo)];t&&t()},uF=function(){if(!Ae(this,yl)||Ae(this,Vo)!=="draw"&&Ae(this,Vo)!=="erase")return;Ot(this,Tp,!0);const e=Ae(this,Uo).getPointerPosition();if(!e)return;const t=Ae(this,Vo)==="erase",n=Ae(this,sy)*Ye(this,Vn,OE).call(this);Ot(this,Zc,[e.x,e.y]),Ot(this,Ed,new(Ae(this,Yc)).Line({points:Ae(this,Zc),stroke:Ae(this,oy),strokeWidth:t?n*3:n,lineCap:"round",lineJoin:"round",globalCompositeOperation:t?"destination-out":"source-over"})),Ot(this,iy,n),Ae(this,gl).add(Ae(this,Ed))},dF=function(){if(!Ae(this,yl)||Ae(this,Vo)!=="draw"&&Ae(this,Vo)!=="erase"||!Ae(this,Tp)||!Ae(this,Ed))return;const e=Ae(this,Uo).getPointerPosition();e&&(Ae(this,Zc).push(e.x,e.y),Ae(this,Ed).points(Ae(this,Zc)),Ae(this,gl).batchDraw())},fF=function(){if(!Ae(this,yl)||Ae(this,Vo)!=="draw"&&Ae(this,Vo)!=="erase"||!Ae(this,Tp)||!Ae(this,Ed))return;Ot(this,Tp,!1);const e=[];for(let r=0;r<Ae(this,Zc).length;r+=2)e.push([Ae(this,Zc)[r],Ae(this,Zc)[r+1]]);const t=Ae(this,Vo)==="erase",n=Ae(this,iy)??Ae(this,sy);this.addStroke({points:e,color:Ae(this,oy),width:t?n*3:n,type:t?"erase":"draw"}),Ye(this,Vn,yd).call(this),Ot(this,Ed,null),Ot(this,Zc,[]),Ot(this,iy,null)},hF=function(e,t){if(!Ae(this,Xc))return;const n=ox*Ye(this,Vn,OE).call(this),r=p7({left:e,top:t,height:Math.ceil(n*1.4),background:"transparent",fontSize:n,color:"#2293fb"});Ae(this,Xc).append(r),r.focus(),r.select();let i=!1;const o=()=>{if(i)return;i=!0;const s=r.value.trim();s&&(this.addText({x:e,y:t,content:s}),Ae(this,Vo)==="text"&&Ae(this,ly)&&Ae(this,ly).call(this,"select")),r.parentNode===Ae(this,Xc)&&Ae(this,Xc).removeChild(r)};r.addEventListener("keydown",s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),o()),s.key==="Escape"&&(s.preventDefault(),o())}),r.addEventListener("blur",o)},pF=function(e,t){if(!Ae(this,Xc)||!Ae(this,Uo))return;Ye(this,Vn,D0).call(this);const n=e.position(),r=p7({value:e.text(),left:n.x,top:n.y,width:Math.max(e.width(),120),height:Math.max(e.height(),24),fontSize:e.fontSize(),fontFamily:e.fontFamily(),color:e.fill?e.fill():"#2293fb",background:"white",resize:"both"});Ae(this,Xc).appendChild(r),r.focus(),r.select();let i=!1;const o=()=>
608{if(i)return;i=!0;const s=r.value.trim();s&&(e.text(s),t.content=s,Ae(this,ps).batchDraw(),Ye(this,Vn,yd).call(this)),r.parentNode&&r.parentNode.removeChild(r)};r.addEventListener("keydown",s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),o()),s.key==="Escape"&&(s.preventDefault(),o())}),r.addEventListener("blur",o)},$M),t2,k_,Qc,n2,cy,Ru,uy,dy,fy,hy,$d,mF,DE,LE,GM,ime=(GM=class extends Zpe{constructor(t={}){super();Cn(this,$d);Cn(this,t2,null);Cn(this,k_,null);Cn(this,Qc,new Map);Cn(this,n2,new Map);Cn(this,cy,"select");Cn(this,Ru,!1);Cn(this,uy,1);Cn(this,dy,null);Cn(this,fy,null);Cn(this,hy,null);Ye(this,$d,mF).call(this,t)}register(t,n){Ae(this,n2).set(t,n)}getType(t){return Ae(this,n2).get(t)}setTool(t){Ot(this,cy,t),Ae(this,Qc).forEach(n=>n.setTool(t)),this.emit("tool",t)}getTool(){return Ae(this,cy)}setEnabled(t){Ot(this,Ru,t),Ae(this,Qc).forEach(n=>n.setEnabled(Ae(this,Ru))),this.emit("enabled",Ae(this,Ru)),Ae(this,hy)&&Ae(this,hy).call(this,Ae(this,Ru))}isEnabled(){return Ae(this,Ru)}setOpacity(t){const n=t;Ot(this,uy,Number.isFinite(n)?Math.min(1,Math.max(0,n)):1),this.emit("opacity",Ae(this,uy))}getOpacity(){return Ae(this,uy)}getPages(){return Array.from(Ae(this,Qc).values())}rerender(){Ae(this,Qc).forEach(t=>t.render())}setPageSize(t,n){Ye(this,$d,DE).call(this,t).setSize(n)}getPage(t){return Ae(this,Qc).get(t)}getWhiteboardData(){var r,i;const t={},n={};for(const o of Ae(this,Qc).values())t[o.pageIndex]=o.toJSON(),o.size&&(n[o.pageIndex]={width:o.size.width,height:o.size.height,originalWidth:((r=o.originalSize)==null?void 0:r.width)??null,originalHeight:((i=o.originalSize)==null?void 0:i.height)??null});return{pages:t,meta:{pageSizes:n},version:1}}setWhiteboardData(t){Ae(this,Qc).clear();const n=(t==null?void 0:t.pages)||{};Object.keys(n).forEach(r=>{const i=Number(r),o=Number.isNaN(i)?r:i;Ye(this,$d,DE).call(this,o).applyData(n[r])}),this.emit("setData",this.getPages()),Ae(this,fy)&&Ae(this,fy).call(this,this.getPages()),Ye(this,$d,LE).call(this)}},t2=new WeakMap,k_=new WeakMap,Qc=new WeakMap,n2=new WeakMap,cy=new WeakMap,Ru=new WeakMap,uy=new WeakMap,dy=new WeakMap,fy=new WeakMap,hy=new WeakMap,$d=new WeakSet,mF=function(t){Ot(this,t2,t.Renderer),Ot(this,k_,t.superdoc),Ot(this,Ru,t.enabled),Ot(this,dy,t.onChange),Ot(this,fy,t.onSetData),Ot(this,hy,t.onEnabledChange)},DE=function(t){const n=Ae(this,Qc).get(t);if(n)return n;const r=new Jpe({Renderer:Ae(this,t2),enabled:Ae(this,Ru),pageIndex:t,onChange:()=>{Ye(this,$d,LE).call(this)},onToolChange:i=>{this.setTool(i)}});return r.setTool(Ae(this,cy)),r.setEnabled(Ae(this,Ru)),Ae(this,Qc).set(t,r),r},LE=function(){const t=this.getWhiteboardData();this.emit("change",t),Ae(this,dy)&&Ae(this,dy).call(this,t)},GM);N_();var ome=Math.PI/180;function sme(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}var Zm=typeof wl<"u"?wl:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},An={_global:Zm,version:"10.2.5",isBrowser:sme(),isUnminified:/param/.test((function(e){}).toString()),dblClickWindow:400,getAngle(e){return An.angleDeg?e*ome:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return An.DD.isDragging},isTransforming(){var e,t;return(t=(e=An.Transformer)===null||e===void 0?void 0:e.isTransforming())!==null&&t!==void 0?t:!1},isDragReady(){return!!An.DD.node},releaseCanvasOnDestroy:!0,document:Zm.document,_injectGlobal(e){typeof Zm.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),Zm.Konva=e}},rs=e=>{An[e.prototype.getClassName()]=e};An._injectGlobal(An);var ame=`Konva.js unsupported environment.
609
610Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
611
612To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
613
614bash: npm install canvas
615js: import "konva/canvas-backend";
616
617or
618
619bash: npm install skia-canvas
620js: import "konva/skia-backend";
621`,m7=()=>
621{if(typeof document>"u")throw new Error(ame)},Du=class gF{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new gF(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){const n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){const n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,s=this.m[0]*-r+this.m[2]*n,l=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=s,this.m[3]=l,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){const r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,s=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=s,this}multiply(t){const n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],s=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],l=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=s,this.m[5]=l,this}invert(){const t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,s=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),l=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=s,this.m[5]=l,this}getMatrix(){return this.m}decompose(){const t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],s=this.m[5],l=t*i-n*r,u={x:o,y:s,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){const d=Math.sqrt(t*t+n*n);u.rotation=n>0?Math.acos(t/d):-Math.acos(t/d),u.scaleX=d,u.scaleY=l/d,u.skewX=(t*r+n*i)/l,u.skewY=0}else if(r!=0||i!=0){const d=Math.sqrt(r*r+i*i);u.rotation=Math.PI/2-(i>0?Math.acos(-r/d):-Math.acos(r/d)),u.scaleX=l/d,u.scaleY=d,u.skewX=0,u.skewY=(t*r+n*i)/l}return u.rotation=_t._getRotation(u.rotation),u}},lme="[object Array]",cme="[object Number]",ume="[object String]",dme="[object Boolean]",fme=Math.PI/180,hme=180/Math.PI,lb="#",pme="",mme="0",gme="Konva warning: ",g7="Konva error: ",yme="rgb(",F3={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
621ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},vme=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,sx=[],cb=null,bme=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,16)},_t={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===lme},_isNumber(e){return Object.prototype.toString.call(e)===cme&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===ume},_isBoolean(e){return Object.prototype.toString.call(e)===dme},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;const t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){sx.push(e),sx.length===1&&bme(function(){const t=sx;sx=[],t.forEach(function(n){n()})})},createCanvasElement(){m7();const e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return m7(),document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){const n=_t.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(lb,pme);const t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let e=(Math.random()*16777215<<0).toString(16);for(;e.length<6;)e=mme+e;return lb+e},isCanvasFarblingActive(){if(cb!==null)return cb;if(typeof document>"u")return cb=!1,!1;const e=this.createCanvasElement();e.width=10,e.height=10;const t=e.getContext("2d",{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle="#282828",t.fillRect(0,0,10,10);const n=t.getImageData(0,0,10,10).data;let r=!1;for(let i=0;i<100;i++)if(n[i*4]!==40||n[i*4+1]!==40||n[i*4+2]!==40||n[i*4+3]!==255){r=!0;break}return cb=r,this.releaseCanvas(e),cb},getHitColor(){const e=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(e):e},getHitColorKey(e,t,n){return this.isCanvasFarblingActive()&&(e=Math.round(e/5)*5,t=Math.round(t/5)*5,n=Math.round(n/5)*5),lb+this._rgbToHex(e,t,n)},getSnappedHexColor(e){const t=this._hexToRgb(e);return lb+this._rgbToHex(Math.round(t.r/5)*5,Math.round(t.g/5)*5,Math.round(t.b/5)*5)},getRGB(e){let t;return e in F3?(t=F3[e],{r:t[0],g:t[1],b:t[2]}):e[0]===lb?this._hexToRgb(e.substring(1)):e.substr(0,4)===yme?(t=vme.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",_t._namedColorToRBA(e)||_t._hex3ColorToRGBA(e)||_t._hex4ColorToRGBA(e)||_t._hex6ColorToRGBA(e)||_t._hex8ColorToRGBA(e)||_t._rgbColorToRGBA(e)||_t._rgbaColorToRGBA(e)||_t._hslColorToRGBA(e)},_namedColorToRBA(e){const t=F3[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];const t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];const t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if(e[0]==="#"&&e.length===9)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if(e[0]==="#"&&e.length===5)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let s,l,u;if(i===0)return u=o*255,{r:Math.round(u),g:Math.round(u),b:Math.round(u),a:1};o<.5?s=o*(1+i):s=o+i-o*i;const d=2*o-s,f=[0,0,0];for(let p=0;p<3;p++)l=r+1/3*-(p-1),l<0&&l++,l>1&&l--,6*l<1?u=d+(s-d)*6*l:2*l<1?u=s:3*l<2?u=d+(s-d)*(2/3-l)*6:u=d,f[p]=u*255;return{r:Math.round(f[0]),g:Math.round(f[1]),b:Math.round(f[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)},cloneObject(e){const t={};for(const n in e)this._isPlainObject(e[n])?t[n]=this.cloneObject(e[n]):this._isArray(e[n])?t[n]=this.cloneArray(e[n]):t[n]=e[n];return t},cloneArray(e){return e.slice(0)},degToRad(e){return e*fme},radToDeg(e){return e*hme},_degToRad(e){return _t.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),_t.degToRad(e)},_radToDeg(e){return _t.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),_t.radToDeg(e)},_getRotation(e){return An.angleDeg?_t.radToDeg(e):e},_capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)},throw(e){throw new Error(g7+e)},error(e){console.error(g7+e)},warn(e){An.showWarnings&&console.warn(gme+e)},each(e,t){for(const n in e)t(n,e[n])},_inRange(e,t,n){return t<=e&&e<n},_getProjectionToSegment(e,t,n,r,i,o){let s,l,u;const d=(e-n)*(e-n)+(t-r)*(t-r);if(d==0)s=e,l=t,u=(i-n)*(i-n)+(o-r)*(o-r);else{const f=((i-e)*(n-e)+(o-t)*(r-t))/d;f<0?(s=e,l=t,u=(e-i)*(e-i)+(t-o)*(t-o)):f>
6211?(s=n,l=r,u=(n-i)*(n-i)+(r-o)*(r-o)):(s=e+f*(n-e),l=t+f*(r-t),u=(s-i)*(s-i)+(l-o)*(l-o))}return[s,l,u]},_getProjectionToLine(e,t,n){const r=_t.cloneObject(e);let i=Number.MAX_VALUE;return t.forEach(function(o,s){if(!n&&s===t.length-1)return;const l=t[(s+1)%t.length],u=_t._getProjectionToSegment(o.x,o.y,l.x,l.y,e.x,e.y),d=u[0],f=u[1],p=u[2];p<i&&(r.x=d,r.y=f,i=p)}),r},_prepareArrayForTween(e,t,n){const r=[],i=[];if(e.length>t.length){const s=t;t=e,e=s}for(let s=0;s<e.length;s+=2)r.push({x:e[s],y:e[s+1]});for(let s=0;s<t.length;s+=2)i.push({x:t[s],y:t[s+1]});const o=[];return i.forEach(function(s){const l=_t._getProjectionToLine(s,r,n);o.push(l.x),o.push(l.y)}),o},_prepareToStringify(e){let t;e.visitedByCircularReferenceRemoval=!0;for(const n in e)if(e.hasOwnProperty(n)&&e[n]&&typeof e[n]=="object"){if(t=Object.getOwnPropertyDescriptor(e,n),e[n].visitedByCircularReferenceRemoval||_t._isElement(e[n]))if(t.configurable)delete e[n];else return null;else if(_t._prepareToStringify(e[n])===null)if(t.configurable)delete e[n];else return null}return delete e.visitedByCircularReferenceRemoval,e},_assign(e,t){for(const n in t)e[n]=t[n];return e},_getFirstPointerId(e){return e.touches?e.changedTouches[0].identifier:e.pointerId||999},releaseCanvas(...e){An.releaseCanvasOnDestroy&&e.forEach(t=>{t.width=0,t.height=0})},drawRoundedRectPath(e,t,n,r){let i=t<0?t:0,o=n<0?n:0;t=Math.abs(t),n=Math.abs(n);let s=0,l=0,u=0,d=0;typeof r=="number"?s=l=u=d=Math.min(r,t/2,n/2):(s=Math.min(r[0]||0,t/2,n/2),l=Math.min(r[1]||0,t/2,n/2),d=Math.min(r[2]||0,t/2,n/2),u=Math.min(r[3]||0,t/2,n/2)),e.moveTo(i+s,o),e.lineTo(i+t-l,o),e.arc(i+t-l,o+l,l,Math.PI*3/2,0,!1),e.lineTo(i+t,o+n-d),e.arc(i+t-d,o+n-d,d,0,Math.PI/2,!1),e.lineTo(i+u,o+n),e.arc(i+u,o+n-u,u,Math.PI/2,Math.PI,!1),e.lineTo(i,o+s),e.arc(i+s,o+s,s,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(e,t,n,r,i){r=Math.abs(r);for(let o=0;o<n;o++){const s=t[(o-1+n)%n],l=t[o],u=t[(o+1)%n],d={x:l.x-s.x,y:l.y-s.y},f={x:u.x-l.x,y:u.y-l.y},p=Math.hypot(d.x,d.y),m=Math.hypot(f.x,f.y);let y;typeof i=="number"?y=i:y=o<i.length?i[o]:0,y=r*Math.cos(Math.PI/n)*M
621ath.min(1,y/r*2);const b={x:d.x/p,y:d.y/p},k={x:f.x/m,y:f.y/m},S={x:l.x-b.x*y,y:l.y-b.y*y},x={x:l.x+k.x*y,y:l.y+k.y*y};o===0?e.moveTo(S.x,S.y):e.lineTo(S.x,S.y),e.arcTo(l.x,l.y,x.x,x.y,y)}}};function wme(e){const t=[],n=e.length,r=_t;for(let i=0;i<n;i++){let o=e[i];r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),t.push(o)}return t}var y7=",",xme="(",kme=")",_me="([",Cme="])",Sme=";",Eme="()",Ame="=",v7=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],Tme=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],Ime=100,ax=null;function b7(){if(ax!==null)return ax;try{const e=_t.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(ax=!1,!1)}catch{return ax=!1,!1}}var wC=class{constructor(e){this.canvas=e,An.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,t){let n=this.traceArr,r=n.length,i="",o,s,l,u;for(o=0;o<r;o++)s=n[o],l=s.method,l?(u=s.args,i+=l,e?i+=Eme:_t._isArray(u[0])?i+=_me+u.join(y7)+Cme:(t&&(u=u.map(d=>typeof d=="number"?Math.floor(d):d)),i+=xme+u.join(y7)+kme)):(i+=s.property,e||(i+=Ame+s.val)),i+=Sme;return i}clearTrace(){this.traceArr=[]}_trace(e){let t=this.traceArr,n;t.push(e),n=t.length,n>=Ime&&t.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){const t=e.attrs.lineCap;t&&this.setAttr("lineCap",t)}_applyOpacity(e){const t=e.getAbsoluteOpacity();t!==1&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){const t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}_applyMiterLimit(e){const t=e.attrs.miterLimit;t!=null&&this.setAttr("miterLimit",t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,i,o){this._context.arc(e,t,n,r,i,o)}arcTo(e,t,n,r,i){this._context.arcTo(e,t,n,r,i)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,i,o){this._context.bezierCurveTo(e,t,n,r,i,o)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,t){const n=arguments;if(n.length===2)return this._context.createImageData(e,t);if(n.length===1)return this._context.createImageData(e)}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,i,o){return this._context.createRadialGradient(e,t,n,r,i,o)}drawImage(e,t,n,r,i,o,s,l,u){const d=arguments,f=this._context;d.length===3?f.drawImage(e,t,n):d.length===5?f.drawImage(e,t,n,r,i):d.length===9&&f.drawImage(e,t,n,r,i,o,s,l,u)}ellipse(e,t,n,r,i,o,s,l){this._context.ellipse(e,t,n,r,i,o,s,l)}isPointInPath(e,t,n,r){return n?this._context.isPointInPath(n,e,t,r):this._context.isPointInPath(e,t,r)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}
621roundRect(e,t,n,r,i){this._context.roundRect(e,t,n,r,i)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,i,o){this._context.setTransform(e,t,n,r,i,o)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,i,o){this._context.transform(e,t,n,r,i,o)}translate(e,t){this._context.translate(e,t)}_enableTrace(){let e=this,t=v7.length,n=this.setAttr,r,i;const o=function(s){let l=e[s],u;e[s]=function(){return i=wme(Array.prototype.slice.call(arguments,0)),u=l.apply(e,arguments),e._trace({method:s,args:i}),u}};for(r=0;r<t;r++)o(v7[r]);e.setAttr=function(){n.apply(e,arguments);const s=arguments[0];let l=arguments[1];(s==="shadowOffsetX"||s==="shadowOffsetY"||s==="shadowBlur")&&(l=l/this.canvas.getPixelRatio()),e._trace({property:s,val:l})}}_applyGlobalCompositeOperation(e){const t=e.attrs.globalCompositeOperation;!t||t==="source-over"||this.setAttr("globalCompositeOperation",t)}};Tme.forEach(function(e){Object.defineProperty(wC.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});var Rme=class extends wC{constructor(e,{willReadFrequently:t=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:t})}_fillColor(e){const t=e.fill();this.setAttr("fillStyle",t),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const t=e._getLinearGradient();t&&(this.setAttr("fillStyle",t),e._fillFunc(this))}_fillRadialGradient(e){const t=e._getRadialGradient();t&&(this.setAttr("fillStyle",t),e._fillFunc(this))}_fill(e){const t=e.fill(),n=e.getFillPriority();if(t&&n==="color"){this._fillColor(e);return}const r=e.getFillPatternImage();if(r&&n==="pattern"){this._fillPattern(e);return}const i=e.getFillLinearGradientColorStops();if(i&&n==="linear-gradient"){this._fillLinearGradient(e);return}const o=e.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(e);return}t?this._fillColor(e):r?this._fillPattern(e):i?this._fillLinearGradient(e):o&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const t=e.getStrokeLinearGradientStartPoint(),n=e.getStrokeLinearGradientEndPoint(),r=e.getStrokeLinearGradientColorStops(),i=this.createLinearGradient(t.x,t.y,n.x,n.y);if(r){for(let o=0;o<r.length;o+=2)i.addColorStop(r[o],r[o+1]);this.setAttr("strokeStyle",i)}}_stroke(e){const t=e.dash(),n=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!n){this.save();const r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(e),t&&e.dashEnabled()&&(this.setLineDash(t),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),n||this.restore()}}_applyShadow(e){var t,n,r;const i=(t=e.getShadowRGBA())!==null&&t!==void 0?t:"black",o=(n=e.getShadowBlur())!==null&&n!==void 0?n:5,s=(r=e.getShadowOffset())!==null&&r!==void 0?r:{x:0,y:0},l=e.getAbsoluteScale(),u=this.canvas.getPixelRatio(),d=l.x*u,f=l.y*u;this.setAttr("shadowColor",i),this.setAttr("shadowBlur",o*Math.min(Math.abs(d),Math.abs(f))),this.setAttr("shadowOffsetX",s.x*d),this.setAttr("shadowOffsetY",s.y*f)}},Ome=class extends wC{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const t=e.getStrokeScaleEnabled();if(!t){this.save();const i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(e);const n=e.hitStrokeWidth(),r=n==="auto"?e.strokeWidth():n;this.setAttr("lineWidth",r),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),t||this.restore(
621)}}},lx;function Nme(){if(lx)return lx;const e=_t.createCanvasElement(),t=e.getContext("2d");return lx=(function(){return(An._global.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)})(),_t.releaseCanvas(e),lx}var aT=class{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const t=(e||{}).pixelRatio||An.pixelRatio||Nme();this.pixelRatio=t,this._canvas=_t.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const t=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/t,this.getHeight()/t)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const t=this.pixelRatio;this.getContext()._context.scale(t,t)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const t=this.pixelRatio;this.getContext()._context.scale(t,t)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,t){this.setWidth(e||0),this.setHeight(t||0)}toDataURL(e,t){try{return this._canvas.toDataURL(e,t)}catch{try{return this._canvas.toDataURL()}catch(r){return _t.error("Unable to get data URL. "+r.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}},Ap=class extends aT{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new Rme(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}},lT=class extends aT{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new Ome(this),this.setSize(e.width,e.height)}},Ni={get isDragging(){let e=!1;return Ni._dragElements.forEach(t=>{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){let e;return Ni._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];Ni._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=_t._getFirstPointerId(e));const s=o._changedPointerPositions.find(l=>l.id===n.pointerId);if(s){if(n.dragStatus!=="dragging"){const l=i.dragDistance();if(Math.max(Math.abs(s.x-n.startPointerPos.x),Math.abs(s.y-n.startPointerPos.y))<l||(i.startDrag({evt:e}),!i.isDragging()))return}i._setDragPosition(e,n),t.push(i)}}),t.forEach(n=>{n.getStage()&&n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];Ni._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(Ni.justDragged=!0,An._mouseListenClick=!1,An._touchListenClick=!1,An._pointerListenClick=!1,n.dragStatus="stopped");const o=n.node.getLayer()||n.node instanceof An.Stage&&n.node;o&&t.indexOf(o)===-1&&t.push(o)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){Ni._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&Ni._dragElements.delete(n)})}};An.isBrowser&&(window.addEventListener("mouseup",Ni._endDragBefore,!0),window.addEventListener("touchend",Ni._endDragBefore,!0),window.addEventListener("touchcancel",Ni._endDragBefore,!0),window.addEventListener("mousemove",Ni._drag),window.addEventListener("touchmove",Ni._drag),window.addEventListener("mouseup",Ni._endDragAfter,!1),window.addEventListener("touchend",Ni._endDragAfter,!1),window.addEventListener("touchcancel",Ni._endDragAfter,!1));function tm(e){return _t._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||_t._isBoolean(e)?e:Object.prototype.toString.call(e)}function yF(e){return e>255?255:e<0?0:Math.round(e)}function _n(){if(An.isUnminified)return function(e,t){return _t._isNumber(e)||_t.warn(tm(e)+' is a not val
621id value for "'+t+'" attribute. The value should be a number.'),e}}function xC(e){if(An.isUnminified)return function(t,n){let r=_t._isNumber(t),i=_t._isArray(t)&&t.length==e;return!r&&!i&&_t.warn(tm(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}function cT(){if(An.isUnminified)return function(e,t){return _t._isNumber(e)||e==="auto"||_t.warn(tm(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function Ag(){if(An.isUnminified)return function(e,t){return _t._isString(e)||_t.warn(tm(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function vF(){if(An.isUnminified)return function(e,t){const n=_t._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||_t.warn(tm(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function Mme(){if(An.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(_t._isArray(e)?e.forEach(function(r){_t._isNumber(r)||_t.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}
621):_t.warn(tm(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function Hu(){if(An.isUnminified)return function(e,t){return e===!0||e===!1||_t.warn(tm(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function Dme(e){if(An.isUnminified)return function(t,n){return t==null||_t.isObject(t)||_t.warn(tm(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var ub="get",db="set",Qe={addGetterSetter(e,t,n,r,i){Qe.addGetter(e,t,n),Qe.addSetter(e,t,r,i),Qe.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){const r=ub+_t._capitalize(t);e.prototype[r]=e.prototype[r]||function(){const i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){const i=db+_t._capitalize(t);e.prototype[i]||Qe.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){const i=db+_t._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){const o=n.length,s=_t._capitalize,l=ub+s(t),u=db+s(t);e.prototype[l]=function(){const f={};for(let p=0;p<o;p++){const m=n[p];f[m]=this.getAttr(t+s(m))}return f};const d=Dme(n);e.prototype[u]=function(f){const p=this.attrs[t];r&&(f=r.call(this,f,t)),d&&d.call(this,f,t);for(const m in f)f.hasOwnProperty(m)&&this._setAttr(t+s(m),f[m]);return f||n.forEach(m=>{this._setAttr(t+s(m),void 0)}),this._fireChangeEvent(t,p,f),i&&i.call(this),this},Qe.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){const n=_t._capitalize(t),r=db+n,i=ub+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){_t.error("Adding deprecated "+t);const i=ub+_t._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){_t.error(o);const s=this.attrs[t];return s===void 0?n:s},Qe.addSetter(e,t,r,function(){_t.error(o)}),Qe.addOverloadedGetterSetter(e,t)},backCompat(e,t){_t.each(t,function(n,r){const i=e.prototype[r],o=ub+_t._capitalize(n),s=db+_t._capitalize(n);function l(){i.apply(this,arguments),_t.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=l,e.prototype[o]=l,e.prototype[s]=l})},afterSetFilter(){this._filterUpToDate=!1}};function Lme(e){const t=/(\w+)\(([^)]+)\)/g;let n;for(;(n=t.exec(e))!==null;){const[,r,i]=n;switch(r){case"blur":{const o=parseFloat(i.replace("px",""));return function(s){this.blurRadius(o*.5);const l=An.Filters;l&&l.Blur&&l.Blur.call(this,s)}}case"brightness":{const o=i.includes("%")?parseFloat(i)/100:parseFloat(i);return function(s){this.brightness(o);const l=An.Filters;l&&l.Brightness&&l.Brightness.call(this,s)}}case"contrast":{const o=parseFloat(i);return function(s){const l=100*(Math.sqrt(o)-1);this.contrast(l);const u=An.Filters;u&&u.Contrast&&u.Contrast.call(this,s)}}case"grayscale":return function(o){const s=An.Filters;s&&s.Grayscale&&s.Grayscale.call(this,o)};case"sepia":return function(o){const s=An.Filters;s&&s.Sepia&&s.Sepia.call(this,o)};case"invert":return function(o){const s=An.Filters;s&&s.Invert&&s.Invert.call(this,o)};default:_t.warn(`CSS filter "${r}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}var Yx="absoluteOpacity",w7="allEventListeners",Pf="absoluteTransform",x7="absoluteScale",Fm="canvas",Pme="Change",Bme="children",jme="konva",PE="listening",Fme="mouseenter",zme="mouseleave",Ume="pointerenter",Vme="pointerleave",Hme="touchenter",$me="touchleave",k7="set",_7="Shape",Xx=" ",C7="stage",bp="transform",Gme="Stage",BE="visible",qme=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Xx),Wme=1,In=class Ib{constructor(t){this._id=Wme++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===bp||t===Pf)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){let r=this._cache.get(t);return(r===void 0||(t===bp||t===Pf)&&r.dirty===!0)&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(Xx);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(Fm)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Pf&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Fm)){const{scene:t,filter:n,hit:r}=this._cache.get(Fm);_t.releaseCanvas(t._canvas,n._canvas,r._canvas),this._cache.delete(Fm)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){const n=t||{};let r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),s=n.pixelRatio,l=n.x===void 0?Math.floor(r.x):n.x,u=n.y===void 0?Math.floor(r.y):n.y,d=n.offset||0,f=n.drawBorder||!1,p=n.hitCanvasPixelRatio||1;if(!i||!o){_t.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const m=Math.abs(Math.round(r.x)-l)>.5?1:0,y=Math.abs(Math.round(r.y)-u)>.5?1:0;i+=d*2+m,o+=d*2+y,l-=d,u-=d;const b=new Ap({pixelRatio:s,width:i,height:o}),k=new Ap({pixelRatio:s,width:0,height:0,willReadFrequently:!0}),S=new lT({pixelRatio:p,width:i,height:o}
621),x=b.getContext(),T=S.getContext(),C=new Ap({width:b.width/b.pixelRatio+Math.abs(l),height:b.height/b.pixelRatio+Math.abs(u),pixelRatio:b.pixelRatio}),I=C.getContext();return S.isCache=!0,b.isCache=!0,this._cache.delete(Fm),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(b.getContext()._context.imageSmoothingEnabled=!1,k.getContext()._context.imageSmoothingEnabled=!1),x.save(),T.save(),I.save(),x.translate(-l,-u),T.translate(-l,-u),I.translate(-l,-u),C.x=l,C.y=u,this._isUnderCache=!0,this._clearSelfAndDescendantCache(Yx),this._clearSelfAndDescendantCache(x7),this.drawScene(b,this,C),this.drawHit(S,this),this._isUnderCache=!1,x.restore(),T.restore(),f&&(x.save(),x.beginPath(),x.rect(0,0,i,o),x.closePath(),x.setAttr("strokeStyle","red"),x.setAttr("lineWidth",5),x.stroke(),x.restore()),_t.releaseCanvas(C._canvas),this._cache.set(Fm,{scene:b,filter:k,hit:S,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(Fm)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){const r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}];let i=1/0,o=1/0,s=-1/0,l=-1/0;const u=this.getAbsoluteTransform(n);return r.forEach(function(d){const f=u.point(d);i===void 0&&(i=s=f.x,o=l=f.y),i=Math.min(i,f.x),o=Math.min(o,f.y),s=Math.max(s,f.x),l=Math.max(l,f.y)}),{x:i,y:o,width:s-i,height:l-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);const r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){const n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){let t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),s,l,u,d;if(!t||t.length===0)return r;if(this._filterUpToDate)return i;let f=!0;for(let m=0;m<t.length;m++)if(typeof t[m]=="string"&&b7(),typeof t[m]!="string"||!b7()){f=!1;break}const p=r.pixelRatio;if(i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio),f){const m=t.join(" ");return o.save(),o.setAttr("filter",m),o.drawImage(r._canvas,0,0,r.getWidth()/p,r.getHeight()/p),o.restore(),this._filterUpToDate=!0,i}try{for(s=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/p,r.getHeight()/p),l=o.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<s;u++)d=t[u],typeof d=="string"&&(d=Lme(d)),d.call(this,l),o.putImageData(l,0,0)}catch(m){_t.error("Unable to apply filter. "+m.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,i}on(...t){const n=t[0],r=t[1];if(t[2],this._cache&&this._cache.delete(w7),t.length===3)return this._delegate.apply(this,t);const i=n.split(Xx);for(let o=0;o<i.length;o++){const s=i[o].split("."),l=s[0],u=s[1]||"";this.eventListeners[l]||(this.eventListeners[l]=[]),this.eventListeners[l].push({name:u,handler:r})}return this}off(t,n){let r=(t||"").split(Xx),i=r.length,o,s,l,u,d,f;if(this._cache&&this._cache.delete(w7),!t)for(s in this.eventListeners)this._off(s);for(o=0;o<i;o++)if(l=r[o],u=l.split("."),d=u[0],f=u[1],d)this.eventListeners[d]&&this._off(d,f,n);else for(s in this.eventListeners)this._off(s,f,n);return this}dispatchEvent(t){const n={target:this,type:t.type,evt:t};return this.fire(t.type,n),this}addEventListener(t,n){return this.on(t,function(r){n.call(this,r.evt)}
621),this}removeEventListener(t){return this.off(t),this}_delegate(t,n,r){const i=this;return this.on(t,function(o){const s=o.target.findAncestors(n,!0,i);for(let l=0;l<s.length;l++)o=_t.cloneObject(o),o.currentTarget=s[l],r.call(s[l],o)}),this}remove(){return this.isDragging()&&this.stopDrag(),Ni._dragElements.delete(this._id),Ni._dragElements.forEach((t,n)=>{this.isAncestorOf(t.node)&&Ni._dragElements.delete(n)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Pf),this._clearSelfAndDescendantCache(Yx),this._clearSelfAndDescendantCache(x7),this._clearSelfAndDescendantCache(C7),this._clearSelfAndDescendantCache(BE),this._clearSelfAndDescendantCache(PE)}_remove(){this._clearCaches();const t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){const n="get"+_t._capitalize(t);return _t._isFunction(this[n])?this[n]():this.attrs[t]}getAncestors(){let t=this.getParent(),n=[];for(;t;)n.push(t),t=t.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{let n,r;if(!t)return this;for(n in t)n!==Bme&&(r=k7+_t._capitalize(n),_t._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(PE,this._isListening)}_isListening(t){if(!this.listening())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isListening(t):!0}isVisible(){return this._getCache(BE,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);const r=this.getLayer();let i=!1;Ni._dragElements.forEach(s=>{s.dragStatus==="dragging"&&(s.node.nodeType==="Stage"||s.node.getLayer()===r)&&(i=!0)});const o=!n&&!An.hitOnDragEnabled&&(i||An.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let t=this.getDepth(),n=this,r=0,i,o,s,l;function u(f){for(i=[],o=f.length,s=0;s<o;s++)l=f[s],r++,l.nodeType!==_7&&(i=i.concat(l.getChildren().slice())),l._id===n._id&&(s=o);i.length>0&&i[0].getDepth()<=t&&u(i)}const d=this.getStage();return n.nodeType!==Gme&&d&&u(d.getChildren()),r}getDepth(){let t=0,n=this.parent;for(;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(bp),this._clearSelfAndDescendantCache(Pf)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;const n=t.getPointerPosition();if(!n)return null;const r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);const i=this.getAbsoluteTransform(t).getMatrix(),o=new Du,s=this.offset();return o.m=i.slice(),o.translate(s.x,s.y),o.getTranslation()}setAbsolutePosition(t){const{x:n,y:r,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(bp);const o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(t.x,t.y),t={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(i),this.setPosition({x:t.x,y:t.y}),this._clearCache(bp),this._clearSelfAndDescendantCache(Pf),this}_setTransform(t){let n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){const t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){let n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){let r=[],i=this.getParent(),o,s;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,s=0;s<o;s++)t(r[s])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return _t.warn("Node has no parent. moveToTop function is ignored."),!1;const t=this.index;return t<this.parent.getChildren().length-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return _t.warn("Node has no parent. moveUp function is ignored."),!1;const t=this.index;return t<this.parent.getChildren().length-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return _t.warn("Node has no parent. moveDown function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return _t.warn("Node has no parent. moveToBottom function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return _t.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&_t.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Yx,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let t=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){let t=this.getAttrs(),n,r,i,o,s;const l={attrs:{},className:this.getClassName()};for(n in t)r=t[n],s=_t.isObject(r)&&!_t._isPlainObject(r)&&!_t._isArray(r),!s&&(i=typeof this[n]=="function"&&this[n],delete t[n],o=i?i.c
621all(this):null,t[n]=r,o!==r&&(l.attrs[n]=r));return _t._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){const i=[];n&&this._isMatch(t)&&i.push(this);let o=this.parent;for(;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);let n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i<r;i++)if(o=n[i],_t.isValidSelector(o)||(_t.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),_t.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),_t.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){const t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(C7,this._getStage)}_getStage(){const t=this.getParent();return t?t.getStage():null}fire(t,n={},r){return n.target=n.target||this,r?this._fireAndBubble(t,n):this._fire(t,n),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(Pf,this._getAbsoluteTransform)}_getAbsoluteTransform(t){let n;if(t)return n=new Du,this._eachAncestorReverse(function(r){const i=r.transformsEnabled();i==="all"?n.multiply(r.getTransform()):i==="position"&&n.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},t),n;{n=this._cache.get(Pf)||new Du,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,s=this.attrs.offsetX||0,l=this.attrs.offsetY||0;n.translate(i-s,o-l)}return n.dirty=!1,n}}getAbsoluteScale(t){let n=this;for(;n;)n._isUnderCache&&(t=n),n=n.getParent();const r=this.getAbsoluteTransform(t).decompose();return{x:r.scaleX,y:r.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(bp,this._getTransform)}_getTransform(){var t,n;const r=this._cache.get(bp)||new Du;r.reset();const i=this.x(),o=this.y(),s=An.getAngle(this.rotation()),l=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,u=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,d=this.attrs.skewX||0,f=this.attrs.skewY||0,p=this.attrs.offsetX||0,m=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),s!==0&&r.rotate(s),(d!==0||f!==0)&&r.skew(d,f),(l!==1||u!==1)&&r.scale(l,u),(p!==0||m!==0)&&r.translate(-1*p,-1*m),r.dirty=!1,r}clone(t){let n=_t.cloneObject(this.attrs),r,i,o,s,l;for(r in t)n[r]=t[r];const u=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],o=i.length,s=0;s<o;s++)l=i[s],l.name.indexOf(jme)<0&&(u.eventListeners[r]||(u.eventListeners[r]=[]),u.eventListeners[r].push(l));return u}_toKonvaCanvas(t){t=t||{};const n=this.getClientRect(),r=this.getStage(),i=t.x!==void 0?t.x:Math.floor(n.x),o=t.y!==void 0?t.y:Math.floor(n.y),s=t.pixelRatio||1,l=new Ap({width:t.width||Math.ceil(n.width)||(r?r.width():0),height:t.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:s}),u=l.getContext(),d=new Ap({width:l.width/l.pixelRatio+Math.abs(i),height:l.height/l.pixelRatio+Math.abs(o),pixelRatio:l.pixelRatio});return t.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||o)&&u.translate(-1*i,-1*o),this.drawScene(l,void 0,d),u.restore(),l}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};const n=t.mimeType||null,r=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(n,r);return t.callback&&t.callback(i),i}toImage(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,_t._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)},t==null?void 0:t.mimeType,t==null?void 0:t.quality)}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():An.dragDistance}_off(t,n,r){let i=this.eventListeners[t],o,s,l;for(o=0;o<i.length;o++)if(s=i[o].name,l=i[o].handler,(s!=="konva"||n==="konva")&&(!n||s===n)&&(!r||r===l)){if(i.splice(o,1),i.length===0){delete this.eventListeners[t];break}o--}}_fireChangeEvent(t,n,r){this._fire(t+Pme,{oldVal:n,newVal:r})}addName(t){if(!this.hasName(t)){const n=this.name(),r=n?n+" "+t:t;this.name(r)}return this}hasName(t){if(!t)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(t)!==-1:!1}removeName(t){const n=(this.name()||"").split(/\s/g),r=n.indexOf(t);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(t,n){const r=this[k7+_t._capitalize(t)];return _t._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(An.autoDrawEnabled){const t=this.getLayer()||this.get
621Stage();t==null||t.batchDraw()}}_setAttr(t,n){const r=this.attrs[t];r===n&&!_t.isObject(n)||(n==null?delete this.attrs[t]:this.attrs[t]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(t,r,n),this._requestDraw())}_setComponentAttr(t,n,r){let i;r!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][n]=r,this._fireChangeEvent(t,i,r))}_fireAndBubble(t,n,r){n&&this.nodeType===_7&&(n.target=this);const i=[Fme,zme,Ume,Vme,Hme,$me];if(!(i.indexOf(t)!==-1&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r))){this._fire(t,n);const o=i.indexOf(t)!==-1&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,t,n,r):this._fireAndBubble.call(this.parent,t,n))}}_getProtoListeners(t){var n,r;const{nodeType:i}=this,o=Ib.protoListenerMap.get(i)||{};let s=o==null?void 0:o[t];if(s===void 0){s=[];let l=Object.getPrototypeOf(this);for(;l;){const u=(r=(n=l.eventListeners)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:[];s.push(...u),l=Object.getPrototypeOf(l)}o[t]=s,Ib.protoListenerMap.set(i,o)}return s}_fire(t,n){n=n||{},n.currentTarget=this,n.type=t;const r=this._getProtoListeners(t);if(r){const o=r.slice();for(let s=0;s<o.length;s++)o[s].handler.call(this,n)}const i=this.eventListeners[t];if(i){const o=i.slice(),s=o.length;for(let u=0;u<o.length;u++)o[u].handler.call(this,n);const l=this.eventListeners[t];if(l)for(let u=s;u<l.length;u++)l[u].handler.call(this,n)}}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){const n=t?t.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition();if(!r)return;const o=r._getPointerById(n)||r._changedPointerPositions[0]||i;Ni._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n,startEvent:t})}startDrag(t,n=!0){Ni._dragElements.has(this._id)||this._createDragElement(t);const r=Ni._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:r.startEvent&&r.startEvent.evt||t&&t.evt},n)}_setDragPosition(t,n){const r=this.getStage()._getPointerById(n.pointerId);if(!r)return;let i={x:r.x-n.offset.x,y:r.y-n.offset.y};const o=this.dragBoundFunc();if(o!==void 0){const s=o.call(this,i,t);s?i=s:_t.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(t){const n=Ni._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Ni._endDragBefore(t),Ni._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Ni._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){if(!(t.evt.button===void 0||An.dragButtons.indexOf(t.evt.button)>=0)||this.isDragging())return;let n=!1;Ni._dragElements.forEach(r=>{this.isAncestorOf(r.node)&&(n=!0)}),n||this._createDragElement(t)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const t=Ni._dragElements.get(this._id),n=t&&t.dragStatus==="dragging",r=t&&t.dragStatus==="ready";
621n?this.stopDrag():r&&Ni._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return _t.haveIntersection(r,this.getClientRect())}static create(t,n){return _t._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){let r=Ib.prototype.getClassName.call(t),i=t.children,o,s,l;n&&(t.attrs.container=n),An[r]||(_t.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const u=An[r];if(o=new u(t.attrs),i)for(s=i.length,l=0;l<s;l++)o.add(Ib._createNode(i[l]));return o}};In.protoListenerMap=new Map;In.prototype.nodeType="Node";In.prototype._attrsAffectingSize=[];In.prototype.eventListeners={};In.prototype.on(qme,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(bp),this._clearSelfAndDescendantCache(Pf)});In.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(BE)});In.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(PE)});In.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(Yx)});var mo=Qe.addGetterSetter;mo(In,"zIndex");mo(In,"absolutePosition");mo(In,"position");mo(In,"x",0,_n());mo(In,"y",0,_n());mo(In,"globalCompositeOperation","source-over",Ag());mo(In,"opacity",1,_n());mo(In,"name","",Ag());mo(In,"id","",Ag());mo(In,"rotation",0,_n());Qe.addComponentsGetterSetter(In,"scale",["x","y"]);mo(In,"scaleX",1,_n());mo(In,"scaleY",1,_n());Qe.addComponentsGetterSetter(In,"skew",["x","y"]);mo(In,"skewX",0,_n());mo(In,"skewY",0,_n());Qe.addComponentsGetterSetter(In,"offset",["x","y"]);mo(In,"offsetX",0,_n());mo(In,"offsetY",0,_n());mo(In,"dragDistance",void 0,_n());mo(In,"width",0,_n());mo(In,"height",0,_n());mo(In,"listening",!0,Hu());mo(In,"preventDefault",!0,Hu());mo(In,"filters",void 0,function(e){return this._filterUpToDate=!1,e});mo(In,"visible",!0,Hu());mo(In,"transformsEnabled","all",Ag());mo(In,"size");mo(In,"dragBoundFunc");mo(In,"draggable",!1,Hu());Qe.backCompat(In,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Ac=class extends In{constructor(){super(...arguments),this.children=[]}getChildren(e){const t=this.children||[];return e?t.filter(e):t}hasChildren(){return this.getChildren().length>0}
621removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let n=0;n<e.length;n++)this.add(e[n]);return this}const t=e[0];return t.getParent()?(t.moveTo(this),this):(this._validateAdd(t),t.index=this.getChildren().length,t.parent=this,t._clearCaches(),this.getChildren().push(t),this._fire("add",{child:t}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const t=this._generalFind(e,!0);return t.length>0?t[0]:void 0}_generalFind(e,t){const n=[];return this._descendants(r=>{const i=r._isMatch(e);return i&&n.push(r),!!(i&&t)}),n}_descendants(e){let t=!1;const n=this.getChildren();for(const r of n){if(t=e(r),t)return!0;if(r.hasChildren()&&(t=r._descendants(e),t))return!0}return!1}toObject(){const e=In.prototype.toObject.call(this);
621return e.children=[],this.getChildren().forEach(t=>{e.children.push(t.toObject())}),e}isAncestorOf(e){let t=e.getParent();for(;t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){const t=In.prototype.clone.call(this,e);return this.getChildren().forEach(function(n){t.add(n.clone())}),t}getAllIntersections(e){const t=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(e)&&t.push(n)}),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),!this.isCached()&&((t=this.children)===null||t===void 0||t.forEach(function(n){n._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(t,n){t.index=n}),this._requestDraw()}drawScene(e,t,n){const r=this.getLayer(),i=e||r&&r.getCanvas(),o=i&&i.getContext(),s=this._getCanvasCache(),l=s&&s.scene,u=i&&i.isCache;if(!this.isVisible()&&!u)return this;if(l){o.save();const d=this.getAbsoluteTransform(t).getMatrix();o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,t,n);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;const n=this.getLayer(),r=e||n&&n.hitCanvas,i=r&&r.getContext(),o=this._getCanvasCache();if(o&&o.hit){i.save();const s=this.getAbsoluteTransform(t).getMatrix();i.transform(s[0],s[1],s[2],s[3],s[4],s[5]),this._drawCachedHitCanvas(i),i.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,n,r){var i;const o=t&&t.getContext(),s=this.clipWidth(),l=this.clipHeight(),u=this.clipFunc(),d=typeof s=="number"&&typeof l=="number"||u,f=n===this;if(d){o.save();const m=this.getAbsoluteTransform(n);let y=m.getMatrix();o.transform(y[0],y[1],y[2],y[3],y[4],y[5]),o.beginPath();let b;if(u)b=u.call(this,o,this);
621else{const k=this.clipX(),S=this.clipY();o.rect(k||0,S||0,s,l)}o.clip.apply(o,b),y=m.copy().invert().getMatrix(),o.transform(y[0],y[1],y[2],y[3],y[4],y[5])}const p=!f&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";p&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(m){m[e](t,n,r)}),p&&o.restore(),d&&o.restore()}getClientRect(e={}){var t;const n=e.skipTransform,r=e.relativeTo;let i,o,s,l,u={x:1/0,y:1/0,width:0,height:0};const d=this;(t=this.children)===null||t===void 0||t.forEach(function(m){if(!m.visible())return;const y=m.getClientRect({relativeTo:d,skipShadow:e.skipShadow,skipStroke:e.skipStroke});y.width===0&&y.height===0||(i===void 0?(i=y.x,o=y.y,s=y.x+y.width,l=y.y+y.height):(i=Math.min(i,y.x),o=Math.min(o,y.y),s=Math.max(s,y.x+y.width),l=Math.max(l,y.y+y.height)))});const f=this.find("Shape");let p=!1;for(let m=0;m<f.length;m++)if(f[m]._isVisible(this)){p=!0;break}return p&&i!==void 0?u={x:i,y:o,width:s-i,height:l-o}:u={x:0,y:0,width:0,height:0},n?u:this._transformedRect(u,r)}};Qe.addComponentsGetterSetter(Ac,"clip",["x","y","width","height"]);Qe.addGetterSetter(Ac,"clipX",void 0,_n());Qe.addGetterSetter(Ac,"clipY",void 0,_n());Qe.addGetterSetter(Ac,"clipWidth",void 0,_n());Qe.addGetterSetter(Ac,"clipHeight",void 0,_n());Qe.addGetterSetter(Ac,"clipFunc");var K1=new Map,bF=An._global.PointerEvent!==void 0;function z3(e){return K1.get(e)}function uT(e){return{evt:e,pointerId:e.pointerId}}function wF(e,t){return K1.get(e)===t}function xF(e,t){a1(e),t.getStage()&&(K1.set(e,t),bF&&t._fire("gotpointercapture",uT(new PointerEvent("gotpointercapture"))))}function a1(e,t){const n=K1.get(e);if(!n)return;const r=n.getStage();r&&r.content,K1.delete(e),bF&&n._fire("lostpointercapture",uT(new PointerEvent("lostpointercapture")))}var Kme="Stage",Yme="string",S7="px",Xme="mouseout",kF="mouseleave",_F="mouseover",CF="mouseenter",SF="mousemove",EF="mousedown",AF="mouseup",Rb="pointermove",Ob="pointerdown",$0="pointerup",Nb="pointercancel",Zme="lostpointercapture",cx="pointerout",Mb="pointerleave",ux="pointerover",dx="pointerenter",jE="contextmenu",TF="touchstart",IF="touchend",RF="touchmove",OF="touchcancel",FE="wheel",Qme=5,Jme=[[CF,"_pointerenter"],[EF,"_pointerdown"],[SF,"_pointermove"],[AF,"_pointerup"],[kF,"_pointerleave"],[TF,"_pointerdown"],[RF,"_pointermove"],[IF,"_pointerup"],[OF,"_pointercancel"],[_F,"_pointerover"],[FE,"_wheel"],[jE,"_contextmenu"],[Ob,"_pointerdown"],[Rb,"_pointermove"],[$0,"_pointerup"],[Nb,"_pointercancel"],[Mb,"_pointerleave"],[Zme,"_lostpointercapture"]],U3={mouse:{[cx]:Xme,[Mb]:kF,[ux]:_F,[dx]:CF,[Rb]:SF,[Ob]:EF,[$0]:AF,[Nb]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[cx]:"touchout",[Mb]:"touchleave",[ux]:"touchover",[dx]:"touchenter",[Rb]:RF,[Ob]:TF,[$0]:IF,[Nb]:OF,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[cx]:cx,[Mb]:Mb,[ux]:ux,[dx]:dx,[Rb]:Rb,[Ob]:Ob,[$0]:$0,[Nb]:Nb,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Db=e=>e.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",A0=e=>{const t=Db(e);if(t==="pointer")return An.pointerEventsEnabled&&U3.pointer;if(t==="touch")return U3.touch;if(t==="mouse")return U3.mouse};function E7(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&_t.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}var ege="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",l1=[],kC=class extends Ac{constructor(e){super(E7(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),l1.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{E7(this.attrs)}),this._checkVisibility()}_validateAdd(e){const t=e.getType()==="Layer",n=e.getType()==="FastLayer";t||n||_t.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===Yme){let t;if(e.charAt(0)==="."){const n=e.slice(1);e=document.getElementsByClassName(n)[0]}else e.charAt(0)!=="#"?t=e:t=e.slice(1),e=document.getElementById(t);if(!e)throw"Can not find container in document with id "+t}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const e=this.children,t=e.length;for(let n=0;n<t;n++)e[n].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),Ac.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&_t._isInDocument(e)&&this.container().removeChild(e);const t=l1.indexOf(this);return t>-1&&l1.splice(t,1),_t.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(_t.warn(ege),null)}_getPointerById(e){return this._pointerPositions.find(t=>
621t.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();const t=new Ap({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach(function(i){if(!i.isVisible())return;const o=i._toKonvaCanvas(e);n.drawImage(o._canvas,e.x,e.y,o.getWidth()/o.getPixelRatio(),o.getHeight()/o.getPixelRatio())}),t}getIntersection(e){if(!e)return null;const t=this.children,n=t.length-1;for(let r=n;r>=0;r--){const i=t[r].getIntersection(e);if(i)return i}return null}_resizeDOM(){const e=this.width(),t=this.height();this.content&&(this.content.style.width=e+S7,this.content.style.height=t+S7),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach(n=>{n.setSize({width:e,height:t}),n.draw()})}add(e,...t){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.add(arguments[r]);return this}super.add(e);const n=this.children.length;return n>Qme&&_t.warn("The stage has "+n+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),An.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return wF(e,this)}setPointerCapture(e){xF(e,this)}releaseCapture(e){a1(e)}getLayers(){return this.children}_bindContentEvents(){An.isBrowser&&Jme.forEach(([e,t])=>{this.content.addEventListener(e,n=>{this[t](n)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const t=A0(e.type);t&&this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const t=A0(e.type);t&&this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){const t=A0(e.type),n=Db(e.type);if(!t)return;this.setPointersPositions(e);const r=this._getTargetShape(n),i=!(An.isDragging()||An.isTransforming())||An.hitOnDragEnabled;r&&i?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):i&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){const t=A0(e.type),n=Db(e.type);if(!t)return;this.setPointersPositions(e);let r=!1;this._changedPointerPositions.forEach(i=>{const o=this.getIntersection(i);if(Ni.justDragged=!1,An["_"+n+"ListenClick"]=!0,!o||!o.isListening()){this[n+"ClickStartShape"]=void 0;return}An.capturePointerEventsEnabled&&o.setPointerCapture(i.id),this[n+"ClickStartShape"]=o,o._fireAndBubble(t.pointerdown,{evt:e,pointerId:i.id}),r=!0;const s=e.type.indexOf("touch")>=0;o.preventDefault()&&e.cancelable&&s&&e.preventDefault()}),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){const t=A0(e.type),n=Db(e.type);if(!t)return;const r=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(An.isDragging()&&Ni.node.preventDefault()&&e.cancelable&&r&&e.preventDefault(),this.setPointersPositions(e),!(!(An.isDragging()||An.isTransforming())||An.hitOnDragEnabled))return;const i={};let o=!1;const s=this._getTargetShape(n);this._changedPointerPositions.forEach(l=>{const u=z3(l.id)||this.getIntersection(l),d=l.id,f={evt:e,pointerId:d},p=s!==u;if(p&&s&&(s._fireAndBubble(t.pointerout,{...f},u),s._fireAndBubble(t.pointerleave,{...f},u)),u){if(i[u._id])return;i[u._id]=!0}u&&u.isListening()?(o=!0,p&&(u._fireAndBubble(t.pointerover,{...f},s),u._fireAndBubble(t.pointerenter,{...f},s),this[n+"targetShape"]=u),u._fireAndBubble(t.pointermove,{...f})):s&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:d}),this[n+"targetShape"]=null)}),o||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const t=A0(e.type),n=Db(e.type);if(!t)return;this.setPointersPositions(e);const r=this[n+"ClickStartShape"],i=this[n+"ClickEndShape"],o={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=z3(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),o[u._id])return;o[u._id]=!0}const d=l.id,f={evt:e,pointerId:d};let p=!1;An["_"+n+"InDblClickWindow"]?(p=!0,clearTimeout(this[n+"DblTimeout"])):Ni.justDragged||(An["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout(function(){An["_"+n+"InDblClickWindow"]=!1}
621,An.dblClickWindow),u&&u.isListening()?(s=!0,this[n+"ClickEndShape"]=u,u._fireAndBubble(t.pointerup,{...f}),An["_"+n+"ListenClick"]&&r&&r===u&&(u._fireAndBubble(t.pointerclick,{...f}),p&&i&&i===u&&u._fireAndBubble(t.pointerdblclick,{...f}))):(this[n+"ClickEndShape"]=null,s||(this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),s=!0),An["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:d}),p&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:d}))}),s||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),An["_"+n+"ListenClick"]=!1,e.cancelable&&n!=="touch"&&n!=="pointer"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);const t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(jE,{evt:e}):this._fire(jE,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(FE,{evt:e}):this._fire(FE,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const t=z3(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble($0,uT(e)),a1(e.pointerId)}_lostpointercapture(e){a1(e.pointerId)}setPointersPositions(e){const t=this._getContentPosition();let n=null,r=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,i=>{this._pointerPositions.push({id:i.identifier,x:(i.clientX-t.left)/t.scaleX,y:(i.clientY-t.top)/t.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,i=>{this._changedPointerPositions.push({id:i.identifier,x:(i.clientX-t.left)/t.scaleX,y:(i.clientY-t.top)/t.scaleY})})):(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:_t._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:_t._getFirstPointerId(e)}])}_setPointerPosition(e){_t.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Ap({width:this.width(),height:this.height()}),this.bufferHitCanvas=new lT({pixelRatio:1,width:this.width(),height:this.height()}),!An.isBrowser)return;const e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}cache(){return _t.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}
621batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};kC.prototype.nodeType=Kme;rs(kC);Qe.addGetterSetter(kC,"container");An.isBrowser&&document.addEventListener("visibilitychange",()=>{l1.forEach(e=>{e.batchDraw()})});var NF="hasShadow",MF="shadowRGBA",DF="patternImage",LF="linearGradient",PF="radialGradient",fx;function V3(){return fx||(fx=_t.createCanvasElement().getContext("2d"),fx)}var c1={};function tge(e){const t=this.attrs.fillRule;t?e.fill(t):e.fill()}function nge(e){e.stroke()}function rge(e){const t=this.attrs.fillRule;t?e.fill(t):e.fill()}function ige(e){e.stroke()}function oge(){this._clearCache(NF)}function sge(){this._clearCache(MF)}function age(){this._clearCache(DF)}function lge(){this._clearCache(LF)}function cge(){this._clearCache(PF)}var bn=class extends In{constructor(e){super(e);let t,n=0;for(;t=_t.getHitColor(),!(t&&!(t in c1));)if(n++,n>=1e4){_t.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),t=_t.getRandomColor();break}this.colorKey=t,c1[t]=this}getContext(){return _t.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return _t.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(NF,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(DF,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const e=V3().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){const t=new Du;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(An.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const n=t.getMatrix(),r=typeof DOMMatrix>"u"?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(LF,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const t=V3(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),i=t.createLinearGradient(n.x,n.y,r.x,r.y);for(let o=0;o<e.length;o+=2)i.addColorStop(e[o],e[o+1]);return i}}_getRadialGradient(){return this._getCache(PF,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const t=V3(),n=this.fillRadialGradientStartPoint(),r=this.fillRadialGradientEndPoint(),i=t.createRadialGradient(n.x,n.y,this.fillRadialGradientStartRadius(),r.x,r.y,this.fillRadialGradientEndRadius());for(let o=0;o<e.length;o+=2)i.addColorStop(e[o],e[o+1]);return i}}getShadowRGBA(){return this._getCache(MF,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const e=_t.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){const t=this.getStage();if(!t)return!1;const n=t.bufferHitCanvas;return n.getContext().clear(),this.drawHit(n,void 0,!0),n.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return In.prototype.destroy.call(this),delete c1[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var t;if(!(!((t=this.attrs.perfectDrawEnabled)!==null&&t!==void 0)||t))return!1;const n=e||this.hasFill(),r=this.hasStroke(),i=this.getAbsoluteOpacity()!==1;if(n&&r&&i)return!0;const o=this.hasShadow(),s=this.shadowForStrokeEnabled();return!!(n&&r&&o&&s)}setStrokeHitEnabled(e){_t.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let t=!1,n=this.getParent();for(;n;){if(n.isCached()){t=!0;break}n=n.getParent()}
621const r=e.skipTransform,i=e.relativeTo||t&&this.getStage()||void 0,o=this.getSelfRect(),s=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,l=o.width+s,u=o.height+s,d=!e.skipShadow&&this.hasShadow(),f=d?this.shadowOffsetX():0,p=d?this.shadowOffsetY():0,m=l+Math.abs(f),y=u+Math.abs(p),b=d&&this.shadowBlur()||0,k={width:m+b*2,height:y+b*2,x:-(s/2+b)+Math.min(f,0)+o.x,y:-(s/2+b)+Math.min(p,0)+o.y};return r?k:this._transformedRect(k,i)}drawScene(e,t,n){const r=this.getLayer(),i=(e||r.getCanvas()).getContext(),o=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow();let u;const d=t===this;if(!this.isVisible()&&!d)return this;if(o){i.save();const f=this.getAbsoluteTransform(t).getMatrix();return i.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedSceneCanvas(i),i.restore(),this}if(!s)return this;if(i.save(),this._useBufferCanvas()){u=this.getStage();const f=n||u.bufferCanvas,p=f.getContext();n?(p.save(),p.setTransform(1,0,0,1,0,0),p.clearRect(0,0,f.width,f.height),p.restore()):p.clear(),p.save(),p._applyLineJoin(this),p._applyMiterLimit(this);const m=this.getAbsoluteTransform(t).getMatrix();p.transform(m[0],m[1],m[2],m[3],m[4],m[5]),s.call(this,p,this),p.restore();const y=f.pixelRatio;l&&i._applyShadow(this),d||(i._applyOpacity(this),i._applyGlobalCompositeOperation(this)),i.drawImage(f._canvas,f.x||0,f.y||0,f.width/y,f.height/y)}else{if(i._applyLineJoin(this),i._applyMiterLimit(this),!d){const f=this.getAbsoluteTransform(t).getMatrix();i.transform(f[0],f[1],f[2],f[3],f[4],f[5]),i._applyOpacity(this),i._applyGlobalCompositeOperation(this)}l&&i._applyShadow(this),s.call(this,i,this)}return i.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;const r=this.getLayer(),i=e||r.hitCanvas,o=i&&i.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||_t.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){o.save();const d=this.getAbsoluteTransform(t).getMatrix();return o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),o._applyLineJoin(this),o._applyMiterLimit(this),this!==t){const d=this.getAbsoluteTransform(t).getMatrix();o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}return s.call(this,o,this),o.restore(),this}drawHitFromCache(e=0){const t=this._getCanvasCache(),n=this._getCachedSceneCanvas(),r=t.hit,i=r.getContext(),o=r.getWidth(),s=r.getHeight();i.clear(),i.drawImage(n._canvas,0,0,o,s);try{const l=i.getImageData(0,0,o,s),u=l.data,d=u.length,f=_t._hexToRgb(this.colorKey);for(let p=0;p<d;p+=4)u[p+3]>e?(u[p]=f.r,u[p+1]=f.g,u[p+2]=f.b,u[p+3]=255):u[p+3]=0;i.putImageData(l,0,0)}catch(l){_t.error("Unable to draw hit graph from cached scene canvas. "+l.message)}return this}hasPointerCapture(e){return wF(e,this)}setPointerCapture(e){xF(e,this)}releaseCapture(e){a1(e)}};bn.prototype._fillFunc=tge;bn.prototype._strokeFunc=nge;bn.prototype._fillFuncHit=rge;bn.prototype._strokeFuncHit=ige;bn.prototype._centroid=!1;bn.prototype.nodeType="Shape";rs(bn);bn.prototype.eventListeners={};bn.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",oge);bn.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",sge);bn.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",age);bn.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",lge);bn.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",cge);Qe.addGetterSetter(bn,"stroke",void 0,vF());Qe.addGetterSetter(bn,"strokeWidth",2,_n());Qe.addGetterSetter(bn,"fillAfterStrokeEnabled",!1);Qe.addGetterSetter(bn,"hitStrokeWidth","auto",cT());Qe.addGetterSetter(bn,"strokeHitEnabled",!0,Hu());Qe.addGetterSetter(bn,"perfectDrawEnabled",!0,Hu());Qe.addGetterSetter(bn,"shadowForStrokeEnabled",!0,Hu());Qe.addGetterSetter(bn,"lineJoin");Qe.addGetterSetter(bn,"lineCap");
621Qe.addGetterSetter(bn,"miterLimit");Qe.addGetterSetter(bn,"sceneFunc");Qe.addGetterSetter(bn,"hitFunc");Qe.addGetterSetter(bn,"dash");Qe.addGetterSetter(bn,"dashOffset",0,_n());Qe.addGetterSetter(bn,"shadowColor",void 0,Ag());Qe.addGetterSetter(bn,"shadowBlur",0,_n());Qe.addGetterSetter(bn,"shadowOpacity",1,_n());Qe.addComponentsGetterSetter(bn,"shadowOffset",["x","y"]);Qe.addGetterSetter(bn,"shadowOffsetX",0,_n());Qe.addGetterSetter(bn,"shadowOffsetY",0,_n());Qe.addGetterSetter(bn,"fillPatternImage");Qe.addGetterSetter(bn,"fill",void 0,vF());Qe.addGetterSetter(bn,"fillPatternX",0,_n());Qe.addGetterSetter(bn,"fillPatternY",0,_n());Qe.addGetterSetter(bn,"fillLinearGradientColorStops");Qe.addGetterSetter(bn,"strokeLinearGradientColorStops");Qe.addGetterSetter(bn,"fillRadialGradientStartRadius",0);Qe.addGetterSetter(bn,"fillRadialGradientEndRadius",0);Qe.addGetterSetter(bn,"fillRadialGradientColorStops");Qe.addGetterSetter(bn,"fillPatternRepeat","repeat");Qe.addGetterSetter(bn,"fillEnabled",!0);Qe.addGetterSetter(bn,"strokeEnabled",!0);Qe.addGetterSetter(bn,"shadowEnabled",!0);Qe.addGetterSetter(bn,"dashEnabled",!0);Qe.addGetterSetter(bn,"strokeScaleEnabled",!0);Qe.addGetterSetter(bn,"fillPriority","color");Qe.addComponentsGetterSetter(bn,"fillPatternOffset",["x","y"]);Qe.addGetterSetter(bn,"fillPatternOffsetX",0,_n());Qe.addGetterSetter(bn,"fillPatternOffsetY",0,_n());Qe.addComponentsGetterSetter(bn,"fillPatternScale",["x","y"]);Qe.addGetterSetter(bn,"fillPatternScaleX",1,_n());Qe.addGetterSetter(bn,"fillPatternScaleY",1,_n());Qe.addComponentsGetterSetter(bn,"fillLinearGradientStartPoint",["x","y"]);Qe.addComponentsGetterSetter(bn,"strokeLinearGradientStartPoint",["x","y"]);Qe.addGetterSetter(bn,"fillLinearGradientStartPointX",0);Qe.addGetterSetter(bn,"strokeLinearGradientStartPointX",0);Qe.addGetterSetter(bn,"fillLinearGradientStartPointY",0);Qe.addGetterSetter(bn,"strokeLinearGradientStartPointY",0);Qe.addComponentsGetterSetter(bn,"fillLinearGradientEndPoint",["x","y"]);Qe.addComponentsGetterSetter(bn,"strokeLinearGradientEndPoint",["x","y"]);Qe.addGetterSetter(bn,"fillLinearGradientEndPointX",0);Qe.addGetterSetter(bn,"strokeLinearGradientEndPointX",0);Qe.addGetterSetter(bn,"fillLinearGradientEndPointY",0);Qe.addGetterSetter(bn,"strokeLinearGradientEndPointY",0);Qe.addComponentsGetterSetter(bn,"fillRadialGradientStartPoint",["x","y"]);Qe.addGetterSetter(bn,"fillRadialGradientStartPointX",0);Qe.addGetterSetter(bn,"fillRadialGradientStartPointY",0);Qe.addComponentsGetterSetter(bn,"fillRadialGradientEndPoint",["x","y"]);Qe.addGetterSetter(bn,"fillRadialGradientEndPointX",0);Qe.addGetterSetter(bn,"fillRadialGradientEndPointY",0);Qe.addGetterSetter(bn,"fillPatternRotation",0);Qe.addGetterSetter(bn,"fillRule",void 0,Ag());Qe.backCompat(bn,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var uge="beforeDraw",dge="draw",BF=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],fge=BF.length,Tg=class extends Ac{constructor(e){super(e),this.canvas=new Ap,this.hitCanvas=new lT({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e<t.children.length-1?t.content.insertBefore(this.getNativeCanvasElement(),t.children[e+1].getCanvas()._canvas):t.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){In.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!In.prototype.moveUp.call(this))return!1;const e=this.getStage();return!e||!e.content?!1:(e.content.removeChild(this.getNativeCanvasElement()),this.index<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[this.index+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(In.prototype.moveDown.call(this)){const e=this.getStage();if(e){const t=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),t[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(In.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const t=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),t[1].getCanvas()._canvas))}return!0}return!1}
621getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return In.prototype.remove.call(this),e&&e.parentNode&&_t._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:t}){return this.canvas.setSize(e,t),this.hitCanvas.setSize(e,t),this._setSmoothEnabled(),this}_validateAdd(e){const t=e.getType();t!=="Group"&&t!=="Shape"&&_t.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e={...e},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),In.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){_t.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){_t.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,_t.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let t=1,n=!1;for(;;){for(let r=0;r<fge;r++){const i=BF[r],o=this._getIntersection({x:e.x+i.x*t,y:e.y+i.y*t}),s=o.shape;if(s)return s;if(n=!!o.antialiased,!o.antialiased)break}if(n)t+=1;else return null}}_getIntersection(e){const t=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(e.x*t),Math.round(e.y*t),1,1).data,r=n[3];if(r===255){const i=c1[_t.getHitColorKey(n[0],n[1],n[2])];return i?{shape:i}:{antialiased:!0}}else if(r>0)return{antialiased:!0};return{}}drawScene(e,t,n){const r=this.getLayer(),i=e||r&&r.getCanvas();return this._fire(uge,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Ac.prototype.drawScene.call(this,i,t,n),this._fire(dge,{node:this}),this}drawHit(e,t){const n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),Ac.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){_t.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return _t.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return _t.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Tg.prototype.nodeType="Layer";rs(Tg);Qe.addGetterSetter(Tg,"imageSmoothingEnabled",!0);Qe.addGetterSetter(Tg,"clearBeforeDraw",!0);Qe.addGetterSetter(Tg,"hitGraphEnabled",!0,Hu());var dT=class extends Tg{constructor(e){super(e),this.listening(!1),_t.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};dT.prototype.nodeType="FastLayer";rs(dT);var jy=class extends Ac{_validateAdd(e){const t=e.getType();t!=="Group"&&t!=="Shape"&&_t.throw("You may only add groups and shapes to groups.")}};jy.prototype.nodeType="Group";rs(jy);var H3=(function(){return Zm.performance&&Zm.performance.now?function(){return Zm.performance.now()}:function(){return new Date().getTime()}})(),nv=class L0{constructor(t,n){this.id=L0.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:H3(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){let n=[];return t&&(n=Array.isArray(t)?t:[t]),this.layers=n,this}getLayers(){return this.layers}addLayer(t){const n=this.layers,r=n.length;for(let i=0;i<r;i++)if(n[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const t=L0.animations,n=t.length;for(let r=0;r<n;r++)if(t[r].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=H3(),L0._addAnimation(this),this}stop(){return L0._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const n=t.id,r=this.animations,i=r.length;for(let o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const t={},n=this.animations;for(let r=0;r<n.length;r++){const i=n[r],o=i.layers,s=i.func;i._updateFrameObject(H3());const l=o.length;let u;if(s?u=s.call(i,i.frame)!==!1:u=!0,!!u)for(let d=0;d<l;d++){const f=o[d];f._id!==void 0&&(t[f._id]=f)}}for(const r in t)t.hasOwnProperty(r)&&t[r].batchDraw()}static _animationLoop(){const t=L0;
621t.animations.length?(t._runFrames(),_t.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,_t.requestAnimFrame(this._animationLoop))}};nv.animations=[];nv.animIdCounter=0;nv.animRunning=!1;var hge={node:1,duration:1,easing:1,onFinish:1,yoyo:1},pge=1,A7=2,T7=3,I7=["fill","stroke","shadowColor"],mge=0,gge=class{constructor(e,t,n,r,i,o,s){this.prop=e,this.propFunc=t,this.begin=r,this._pos=r,this.duration=o,this._change=0,this.prevPos=0,this.yoyo=s,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=i-this.begin,this.pause()}fire(e){const t=this[e];t&&t()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=A7,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=T7,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const e=this.getTimer()-this._startTime;this.state===A7?this.setTime(e):this.state===T7&&this.setTime(this.duration-e)}pause(){this.state=pge,this.fire("onPause")}getTimer(){return new Date().getTime()}},_C=class hs{constructor(t){const n=this,r=t.node,i=r._id,o=t.easing||u1.Linear,s=!!t.yoyo;let l,u;typeof t.duration>"u"?l=.3:t.duration===0?l=.001:l=t.duration,this.node=r,this._id=mge++;const d=r.getLayer()||(r instanceof An.Stage?r.getLayers():null);d||_t.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new nv(function(){n.tween.onEnterFrame()},d),this.tween=new gge(u,function(f){n._tweenFunc(f)},o,0,1,l*1e3,s),this._addListeners(),hs.attrs[i]||(hs.attrs[i]={}),hs.attrs[i][this._id]||(hs.attrs[i][this._id]={}),hs.tweens[i]||(hs.tweens[i]={});for(u in t)hge[u]===void 0&&this._addAttr(u,t[u]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){const r=this.node,i=r._id;let o,s,l,u,d;const f=hs.tweens[i][t];f&&delete hs.attrs[i][f][t];let p=r.getAttr(t);if(_t._isArray(n))if(o=[],s=Math.max(n.length,p.length),t==="points"&&n.length!==p.length&&(n.length>p.length?(u=p,p=_t._prepareArrayForTween(p,n,r.closed())):(l=n,n=_t._prepareArrayForTween(n,p,r.closed()))),t.indexOf("fill")===0)for(let m=0;m<s;m++)if(m%2===0)o.push(n[m]-p[m]);else{const y=_t.colorToRGBA(p[m]);d=_t.colorToRGBA(n[m]),p[m]=y,o.push({r:d.r-y.r,g:d.g-y.g,b:d.b-y.b,a:d.a-y.a})}else for(let m=0;m<s;m++)o.push(n[m]-p[m]);else I7.indexOf(t)!==-1?(p=_t.colorToRGBA(p),d=_t.colorToRGBA(n),o={r:d.r-p.r,g:d.g-p.g,b:d.b-p.b,a:d.a-p.a}):o=n-p;hs.attrs[i][this._id][t]={start:p,diff:o,end:n,trueEnd:l,trueStart:u},hs.tweens[i][t]=this._id}_tweenFunc(t){const n=this.node,r=hs.attrs[n._id][this._id];let i,o,s,l,u,d,f,p;for(i in r){if(o=r[i],s=o.start,l=o.diff,p=o.end,_t._isArray(s))if(u=[],f=Math.max(s.length,p.length),i.indexOf("fill")===0)for(d=0;d<f;d++)d%2===0?u.push((s[d]||0)+l[d]*t):u.push("rgba("+Math.round(s[d].r+l[d].r*t)+","+Math.round(s[d].g+l[d].g*t)+","+Math.round(s[d].b+l[d].b*t)+","+(s[d].a+l[d].a*t)+")");else for(d=0;d<f;d++)u.push((s[d]||0)+l[d]*t);else I7.indexOf(i)!==-1?u="rgba("+Math.round(s.r+l.r*t)+","+Math.round(s.g+l.g*t)+","+Math.round(s.b+l.b*t)+","+(s.a+l.a*t)+")":u=s+l*t;n.setAttr(i,u)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const t=this.node,n=hs.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const t=this.node,n=hs.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()}
621,this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const t=this.node._id,n=this._id,r=hs.tweens[t];this.pause(),this.anim&&this.anim.stop();for(const i in r)delete hs.tweens[t][i];delete hs.attrs[t][n],hs.tweens[t]&&(Object.keys(hs.tweens[t]).length===0&&delete hs.tweens[t],Object.keys(hs.attrs[t]).length===0&&delete hs.attrs[t])}};_C.attrs={};_C.tweens={};In.prototype.to=function(e){const t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new _C(e).play()};var u1={BackEaseIn(e,t,n,r){return n*(e/=r)*e*(2.70158*e-1.70158)+t},BackEaseOut(e,t,n,r){return n*((e=e/r-1)*e*(2.70158*e+1.70158)+1)+t},BackEaseInOut(e,t,n,r){let i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){let s=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i<Math.abs(n)?(i=n,s=o/4):s=o/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(e-=1))*Math.sin((e*r-s)*(2*Math.PI)/o))+t)},ElasticEaseOut(e,t,n,r,i,o){let s=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i<Math.abs(n)?(i=n,s=o/4):s=o/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*e)*Math.sin((e*r-s)*(2*Math.PI)/o)+n+t)},ElasticEaseInOut(e,t,n,r,i,o){let s=0;return e===0?t:(e/=r/2)===2?t+n:(o||(o=r*(.3*1.5)),!i||i<Math.abs(n)?(i=n,s=o/4):s=o/(2*Math.PI)*Math.asin(n/i),e<1?-.5*(i*Math.pow(2,10*(e-=1))*Math.sin((e*r-s)*(2*Math.PI)/o))+t:i*Math.pow(2,-10*(e-=1))*Math.sin((e*r-s)*(2*Math.PI)/o)*.5+n+t)},BounceEaseOut(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t},BounceEaseIn(e,t,n,r){return n-u1.BounceEaseOut(r-e,0,n,r)+t},BounceEaseInOut(e,t,n,r){return e<r/2?u1.BounceEaseIn(e*2,0,n,r)*.5+t:u1.BounceEaseOut(e*2-r,0,n,r)*.5+n*.5+t},EaseIn(e,t,n,r){return n*(e/=r)*e+t},EaseOut(e,t,n,r){return-n*(e/=r)*(e-2)+t},EaseInOut(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},StrongEaseIn(e,t,n,r){return n*(e/=r)*e*e*e*e+t},StrongEaseOut(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t},StrongEaseInOut(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t},Linear(e,t,n,r){return n*e/r+t}},R7=_t._assign(An,{Util:_t,Transform:Du,Node:In,Container:Ac,Stage:kC,stages:l1,Layer:Tg,FastLayer:dT,Group:jy,DD:Ni,Shape:bn,shapes:c1,Animation:nv,Tween:_C,Easings:u1,Context:wC,Canvas:aT}),mh=class extends bn{_sceneFunc(e){const t=An.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=An.getAngle(n?360-this.angle():this.angle()),i=Math.cos(Math.min(r,Math.PI)),o=1,s=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),l=Math.sin(Math.min(r,Math.PI/2)),u=i*(i>0?e:t),d=o*t,f=s*(s>0?e:t),p=l*(l>0?t:e);return{x:u,y:n?-1*p:f,width:d-u,height:p-f}}};mh.prototype._centroid=!0;mh.prototype.className="Arc";mh.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];rs(mh);Qe.addGetterSetter(mh,"innerRadius",0,_n());Qe.addGetterSetter(mh,"outerRadius",0,_n());Qe.addGetterSetter(mh,"angle",0,_n());Qe.addGetterSetter(mh,"clockwise",!1,Hu());function zE(e,t,n,r,i,o,s){const l=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),u=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),d=s*l/(l+u),f=s*u/(l+u);return[n-d*(i-e),r-d*(o-t),n+f*(i-e),r+f*(o-t)]}function O7(e,t){const n=e.length,r=[];for(let i=2;i<n-2;i+=2){const o=zE(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t);isNaN(o[0])||(r.push(o[0]),r.push(o[1]),r.push(e[i]),r.push(e[i+1]),r.push(o[2]),r.push(o[3]))}return r}function yge(e){const t=[[e[0],e[2],e[4],e[6]],[e[1],e[3],e[5],e[7]]],n=[];for(const r of t){const i=-3*r[0]+9*r[1]-9*r[2]+3*r[3];if(i!==0){const o=6*r[0]-12*r[1]+6*r[2],s=-3*r[0]+3*r[1],l=o*o-4*i*s;if(l>=0){const u=Math.sqrt(l);n.push((-o+u)/(2*i)),n.push((-o-u)/(2*i))}}}return n.filter(r=>r>0&&r<1).flatMap(r=>t.map(i=>{const o=1-r;return o*o*o*i[0]+3*o*o*r*i[1]+3*o*r*r*i[2]+r*r*r*i[3]}))}var gh=class extends bn{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const t=this.points(),n=t.length,r=this.tension(),i=this.closed(),o=this.bezier();if(!n)return;let s=0;if(e.beginPath(),e.moveTo(t[0],t[1]),r!==0&&n>4){const l=this.getTensionPoints(),u=l.length;for(s=i?0:4,i||e.quadraticCurveTo(l[0],l[1],l[2],l[3]);s<u-2;)e.bezierCurveTo(l[s++],l[s++],l[s++],l[s++],l[s++],l[s++]);i||e.quadraticCurveTo(l[u-2],l[u-1],t[n-2],t[n-1])}else if(o)for(s=2;s<n;)e.bezierCurveTo(t[s++],t[s++],t[s++],t[s++],t[s++],t[s++]);else for(s=2;s<n;s+=2)e.lineTo(t[s],t[s+1]);i?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():O7(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),t=e.length,n=this.tension(),r=zE(e[t-2],e[t-1],e[0],e[1],e[2],e[3],n),i=zE(e[t-4],e[t-3],e[t-2],e[t-1],e[0],e[1],n),o=O7(e,n);
621return[r[2],r[3]].concat(o).concat([i[0],i[1],e[t-2],e[t-1],i[2],i[3],r[0],r[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:this.bezier()?e=[e[0],e[1],...yge(this.points()),e[e.length-2],e[e.length-1]]:e=this.points();let t=e[0],n=e[0],r=e[1],i=e[1],o,s;for(let l=0;l<e.length/2;l++)o=e[l*2],s=e[l*2+1],t=Math.min(t,o),n=Math.max(n,o),r=Math.min(r,s),i=Math.max(i,s);return{x:t,y:r,width:n-t,height:i-r}}};gh.prototype.className="Line";gh.prototype._attrsAffectingSize=["points","bezier","tension"];rs(gh);Qe.addGetterSetter(gh,"closed",!1);Qe.addGetterSetter(gh,"bezier",!1);Qe.addGetterSetter(gh,"tension",0,_n());Qe.addGetterSetter(gh,"points",[],Mme());var vge=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,
621-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],bge=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.122555206
62171147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],wge=[[1],[1,1],[1,2,1],[1,3,3,1]],N7=(e,t,n)=>{let r,i;const s=n/2;r=0;for(let l=0;l<20;l++)i=s*vge[20][l]+s,r+=bge[20][l]*xge(e,t,i);return s*r},M7=(e,t,n)=>{n===void 0&&(n=1);const r=e[0]-2*e[1]+e[2],i=t[0]-2*t[1]+t[2],o=2*e[1]-2*e[0],s=2*t[1]-2*t[0],l=4*(r*r+i*i),u=4*(r*o+i*s),d=o*o+s*s;if(l===0)return n*Math.sqrt(Math.pow(e[2]-e[0],2)+Math.pow(t[2]-t[0],2));const f=u/(2*l),p=d/l,m=n+f,y=p-f*f,b=m*m+y>0?Math.sqrt(m*m+y):0,k=f*f+y>0?Math.sqrt(f*f+y):0,S=f+Math.sqrt(f*f+y)!==0?y*Math.log(Math.abs((m+b)/(f+k))):0;return Math.sqrt(l)/2*(m*b-f*k+S)};function xge(e,t,n){const r=UE(1,n,e),i=UE(1,n,t),o=r*r+i*i;return Math.sqrt(o)}var UE=(e,t,n)=>{const r=n.length-1;let i,o;if(r===0)return 0;if(e===0){o=0;for(let s=0;s<=r;s++)o+=wge[r][s]*Math.pow(1-t,r-s)*Math.pow(t,s)*n[s];return o}else{i=new Array(r);for(let s=0;s<r;s++)i[s]=r*(n[s+1]-n[s]);return UE(e-1,t,i)}},D7=(e,t,n)=>{let r=1,i=e/t,o=(e-n(i))/t,s=0;for(;r>.001;){const l=n(i+o),u=Math.abs(e-l)/t;if(u<r)r=u,i+=o;else{const d=n(i-o),f=Math.abs(e-d)/t;f<r?(r=f,i-=o):o/=2}if(s++,s>500)break}return i},su=class Wl extends bn{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Wl.parsePathData(this.data()),this.pathLength=Wl.getPathLength(this.dataArray)}_sceneFunc(t){const n=this.dataArray;t.beginPath();let r=!1;for(let i=0;i<n.length;i++){const o=n[i].command,s=n[i].points;switch(o){case"L":t.lineTo(s[0],s[1]);break;case"M":t.moveTo(s[0],s[1]);break;case"C":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"Q":t.quadraticCurveTo(s[0],s[1],s[2],s[3]);break;case"A":const l=s[0],u=s[1],d=s[2],f=s[3],p=s[4],m=s[5],y=s[6],b=s[7],k=d>f?d:f,S=d>f?1:d/f,x=d>f?f/d:1;t.translate(l,u),t.rotate(y),t.scale(S,x),t.arc(0,0,k,p,p+m,1-b),t.scale(1/S,1/x),t.rotate(-y),t.translate(-l,-u);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){let t=[];this.dataArray.forEach(function(u){if(u.command==="A"){const d=u.points[4],f=u.points[5],p=u.points[4]+f;let m=Math.PI/180;
621if(Math.abs(d-p)<m&&(m=Math.abs(d-p)),f<0)for(let y=d-m;y>p;y-=m){const b=Wl.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],y,0);t.push(b.x,b.y)}else for(let y=d+m;y<p;y+=m){const b=Wl.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],y,0);t.push(b.x,b.y)}}else if(u.command==="C")for(let d=0;d<=1;d+=.01){const f=Wl.getPointOnCubicBezier(d,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);t.push(f.x,f.y)}else t=t.concat(u.points)});let n=t[0],r=t[0],i=t[1],o=t[1],s,l;for(let u=0;u<t.length/2;u++)s=t[u*2],l=t[u*2+1],isNaN(s)||(n=Math.min(n,s),r=Math.max(r,s)),isNaN(l)||(i=Math.min(i,l),o=Math.max(o,l));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(t){return Wl.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPathLength(t){let n=0;for(let r=0;r<t.length;++r)n+=t[r].pathLength;return n}static getPointAtLengthOfDataArray(t,n){let r,i=0,o=n.length;if(!o)return null;for(;i<o&&t>n[i].pathLength;)t-=n[i].pathLength,++i;if(i===o)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return n[i].command==="M"?(r=n[i].points.slice(0,2),{x:r[0],y:r[1]}):{x:n[i].start.x,y:n[i].start.y};const s=n[i],l=s.points;switch(s.command){case"L":return Wl.getPointOnLine(t,s.start.x,s.start.y,l[0],l[1]);case"C":return Wl.getPointOnCubicBezier(D7(t,Wl.getPathLength(n),k=>N7([s.start.x,l[0],l[2],l[4]],[s.start.y,l[1],l[3],l[5]],k)),s.start.x,s.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return Wl.getPointOnQuadraticBezier(D7(t,Wl.getPathLength(n),k=>M7([s.start.x,l[0],l[2]],[s.start.y,l[1],l[3]],k)),s.start.x,s.start.y,l[0],l[1],l[2],l[3]);case"A":const u=l[0],d=l[1],f=l[2],p=l[3],m=l[5],y=l[6];let b=l[4];return b+=m*t/s.pathLength,Wl.getPointOnEllipticalArc(u,d,f,p,b,y)}return null}static getPointOnLine(t,n,r,i,o,s,l){s=s??n,l=l??r;const u=this.getLineLength(n,r,i,o);if(u<1e-10)return{x:n,y:r};if(i===n)return{x:s,y:l+(o>r?t:-t)};const d=(o-r)/(i-n),f=Math.sqrt(t*t/(1+d*d))*(i<n?-1:1),p=d*f;if(Math.abs(l-r-d*(s-n))<1e-10)return{x:s+f,y:l+p};const m=((s-n)*(i-n)+(l-r)*(o-r))/(u*u),y=n+m*(i-n),b=r+m*(o-r),k=this.getLineLength(s,l,y,b),S=Math.sqrt(t*t-k*k),x=Math.sqrt(S*S/(1+d*d))*(i<n?-1:1),T=d*x;return{x:y+x,y:b+T}}static getPointOnCubicBezier(t,n,r,i,o,s,l,u,d){function f(b){return b*b*b}function p(b){return 3*b*b*(1-b)}function m(b){return 3*b*(1-b)*(1-b)}function y(b){return(1-b)*(1-b)*(1-b)}return{x:u*f(t)+s*p(t)+i*m(t)+n*y(t),y:d*f(t)+l*p(t)+o*m(t)+r*y(t)}}static getPointOnQuadraticBezier(t,n,r,i,o,s,l){function u(p){return p*p}function d(p){return 2*p*(1-p)}function f(p){return(1-p)*(1-p)}return{x:s*u(t)+i*d(t)+n*f(t),y:l*u(t)+o*d(t)+r*f(t)}}static getPointOnEllipticalArc(t,n,r,i,o,s){const l=Math.cos(s),u=Math.sin(s),d={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:t+(d.x*l-d.y*u),y:n+(d.x*u+d.y*l)}}static parsePathData(t){if(!t)return[];let n=t;const r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(let p=0;p<r.length;p++)n=n.replace(new RegExp(r[p],"g"),"|"+r[p]);const i=n.split("|"),o=[],s=[];let l=0,u=0;const d=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let f;for(let p=1;p<i.length;p++){let m=i[p],y=m.charAt(0);for(m=m.slice(1),s.length=0;f=d.exec(m);)s.push(f[0]);let b=[],k=y==="A"||y==="a"?0:-1;for(let S=0,x=s.length;S<x;S++){const T=s[S];if(T==="00"){b.push(0,0),k>=0&&(k+=2,k>=7&&(k-=7));continue}if(k>=0){if(k===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(T)){b.push(parseInt(T[0],10)),b.push(parseInt(T[1],10)),b.push(parseFloat(T.slice(2))),k+=3,k>=7&&(k-=7);continue}if(T==="11"||T==="10"||T==="01"){b.push(parseInt(T[0],10)),b.push(parseInt(T[1],10)),k+=2,k>=7&&(k-=7);continue}if(T==="0"||T==="1"){b.push(parseInt(T,10)),k+=1,k>=7&&(k-=7);continue}}else if(k===4){if(/^[01]\d+(?:\.\d+)?$/.test(T)){b.push(parseInt(T[0],10)),b.push(parseFloat(T.slice(1))),k+=2,k>=7&&(k-=7);continue}if(T==="0"||T==="1"){b.push(parseInt(T,10)),k+=1,k>=7&&(k-=7);continue}}const C=parseFloat(T);isNaN(C)?b.push(0):b.push(C),k+=1,k>=7&&(k-=7)}else{const C=parseFloat(T);isNaN(C)?b.push(0):b.push(C)}}for(;b.length>0&&!isNaN(b[0]);){let S="",x=[];const T=l,C=u;let I,D,P,V,ee,F,H,te,M,Z;switch(y){case"l":l+=b.shift(),u+=b.shift(),S="L",x.push(l,u);break;case"L":l=b.shift(),u=b.shift(),x.push(l,u);break;case"m":const L=b.shift(),W=b.shift();if(l+=L,u+=W,S="M",o.length>2&&o[o.length-1].command==="z"){for(let U=o.length-2;U>=0;U--)if(o[U].command==="M"){l=o[U].points[0]+L,u=o[U].points[1]+W;break}}x.push(l,u),y="l";break;case"M":l=b.shift(),u=b.shift(),S="M",x.push(l,u),y="L";break;case"h":l+=b.shift(),S="L",x.push(l,u);break;case"H":l=b.shift(),S="L",x.push(l,u);break;case"v":u+=b.shift(),S="L",x.push(l,u);break;case"V":u=b.shift(),S="L",x.push(l,u);break;case"C":x.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),x.push(l,u);break;case"c":x.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),S="C",x.push(l,u);break;case"S":D=l,P=u,I=o[o.length-1],I.command==="C"&&(D=l+(l-I.points[2]),P=u+(u-I.points[3])),x.push(D,P,b.shift(),b.shift()),l=b.shift(),u=b.shift(),S="C",x.push(l,u);break;case"s":D=l,P=u,I=o[o.length-1],I.command==="C"&&(D=l+(l-I.points[2]),P=u+(u-I.points[3])),x.push(D,P,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),S="C",x.push(l,u);break;case"Q":x.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),x.push(l,u);break;case"q":x.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),S="Q",x.push(l,u);break;case"T":D=l,P=u,I=o[o.length-1],I.command==="Q"&&(D=l+(l-I.points[0]),P=u+(u-I.points[1])),l=b.shift(),u=b.shift(),S="Q",x.push(D,P,l,u);break;case"t":D=l,P=u,I=o[o.length-1],I.command==="Q"&&(D=l+(l-I.points[0]),P=u+(u-I.points[1])),l+=b.shift(),u+=b.shift(),S="Q",x.push(D,P,l,u);break;case"A":V=b.shift(),ee=b.shift(),F=b.shift(),H=b.shift(),te=b.shift(),M=l,Z=u,l=b.shift(),u=b.shift(),S="A",x=this.convertEndpointToCenterParameterization(M,Z,l,u,H,te,V,ee,F);break;case"a":V=b.shift(),ee=b.shift(),F=b.shift(),H=b.shift(),te=b.shift(),M=l,Z=u,l+=b.shift(),u+=b.shift(),S="A",x=this.convertEndpointToCenterParameterization(M,Z,l,u,H,te,V,ee,F);break}o.push({command:S||y,points:x,start:{x:T,y:C},pathLength:this.calcLength(T,C,S||y,x)})}(y==="z"||y==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(t,n,r,i){let o,s,l,u;const d=Wl;switch(r){case"L":return d.getLineLength(t,n,i[0],i[1]);case"C":return N7([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return M7([t,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;const f=i[4],p=i[5],m=i[4]+p;let y=Math.PI/180;
621if(Math.abs(f-m)<y&&(y=Math.abs(f-m)),s=d.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),p<0)for(u=f-y;u>m;u-=y)l=d.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),o+=d.getLineLength(s.x,s.y,l.x,l.y),s=l;else for(u=f+y;u<m;u+=y)l=d.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),o+=d.getLineLength(s.x,s.y,l.x,l.y),s=l;return l=d.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],m,0),o+=d.getLineLength(s.x,s.y,l.x,l.y),o}return 0}static convertEndpointToCenterParameterization(t,n,r,i,o,s,l,u,d){const f=d*(Math.PI/180),p=Math.cos(f)*(t-r)/2+Math.sin(f)*(n-i)/2,m=-1*Math.sin(f)*(t-r)/2+Math.cos(f)*(n-i)/2,y=p*p/(l*l)+m*m/(u*u);y>1&&(l*=Math.sqrt(y),u*=Math.sqrt(y));let b=Math.sqrt((l*l*(u*u)-l*l*(m*m)-u*u*(p*p))/(l*l*(m*m)+u*u*(p*p)));o===s&&(b*=-1),isNaN(b)&&(b=0);const k=b*l*m/u,S=b*-u*p/l,x=(t+r)/2+Math.cos(f)*k-Math.sin(f)*S,T=(n+i)/2+Math.sin(f)*k+Math.cos(f)*S,C=function(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])},I=function(H,te){return(H[0]*te[0]+H[1]*te[1])/(C(H)*C(te))},D=function(H,te){return(H[0]*te[1]<H[1]*te[0]?-1:1)*Math.acos(I(H,te))},P=D([1,0],[(p-k)/l,(m-S)/u]),V=[(p-k)/l,(m-S)/u],ee=[(-1*p-k)/l,(-1*m-S)/u];let F=D(V,ee);return I(V,ee)<=-1&&(F=Math.PI),I(V,ee)>=1&&(F=0),s===0&&F>0&&(F=F-2*Math.PI),s===1&&F<0&&(F=F+2*Math.PI),[x,T,l,u,P,F,f,s]}};su.prototype.className="Path";su.prototype._attrsAffectingSize=["data"];rs(su);Qe.addGetterSetter(su,"data");var Ig=class extends gh{_sceneFunc(e){super._sceneFunc(e);const t=Math.PI*2,n=this.points();let r=n;const i=this.tension()!==0&&n.length>4;i&&(r=this.getTensionPoints());const o=this.pointerLength(),s=n.length;let l,u;if(i){const p=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[s-2],n[s-1]],m=su.calcLength(r[r.length-4],r[r.length-3],"C",p),y=su.getPointOnQuadraticBezier(Math.min(1,1-o/m),p[0],p[1],p[2],p[3],p[4],p[5]);l=n[s-2]-y.x,u=n[s-1]-y.y}else l=n[s-2]-n[s-4],u=n[s-1]-n[s-3];const d=(Math.atan2(u,l)+t)%t,f=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[s-2],n[s-1]),e.rotate(d),e.moveTo(0,0),e.lineTo(-o,f/2),e.lineTo(-o,-f/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),i?(l=(r[0]+r[2])/2-n[0],u=(r[1]+r[3])/2-n[1]):(l=n[2]-n[0],u=n[3]-n[1]),e.rotate((Math.atan2(-u,-l)+t)%t),e.moveTo(0,0),e.lineTo(-o,f/2),e.lineTo(-o,-f/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x,y:e.y-t,width:e.width,height:e.height+t*2}}};Ig.prototype.className="Arrow";rs(Ig);Qe.addGetterSetter(Ig,"pointerLength",10,_n());Qe.addGetterSetter(Ig,"pointerWidth",10,_n());Qe.addGetterSetter(Ig,"pointerAtBeginning",!1);Qe.addGetterSetter(Ig,"pointerAtEnding",!0);var rv=class extends bn{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};rv.prototype._centroid=!0;rv.prototype.className="Circle";rv.prototype._attrsAffectingSize=["radius"];rs(rv);Qe.addGetterSetter(rv,"radius",0,_n());var nm=class extends bn{_sceneFunc(e){const t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}};nm.prototype.className="Ellipse";nm.prototype._centroid=!0;nm.prototype._attrsAffectingSize=["radiusX","radiusY"];rs(nm);Qe.addComponentsGetterSetter(nm,"radius",["x","y"]);Qe.addGetterSetter(nm,"radiusX",0,_n());Qe.addGetterSetter(nm,"radiusY",0,_n());var $u=class jF extends bn{constructor(t){super(t),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",n=>{this._removeImageLoad(n.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",this._loadListener)}_removeImageLoad(t){t&&t.removeEventListener&&t.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const t=!!this.cornerRadius(),n=this.hasShadow();return t&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let s;if(o){const l=this.attrs.cropWidth,u=this.attrs.cropHeight;l&&u?s=[o,this.cropX(),this.cropY(),l,u,0,0,n,r]:s=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?_t.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),o&&(i&&t.clip(),t.drawImage.apply(t,s))}_hitFunc(t){const n=this.width(),r=this.height(),i=this.cornerRadius();t.beginPath(),i?_t.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n,r;return(r=(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width)!==null&&r!==void 0?r:0}
621getHeight(){var t,n,r;return(r=(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height)!==null&&r!==void 0?r:0}static fromURL(t,n,r=null){const i=_t.createImageElement();i.onload=function(){n(new jF({image:i}))},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};$u.prototype.className="Image";$u.prototype._attrsAffectingSize=["image"];rs($u);Qe.addGetterSetter($u,"cornerRadius",0,xC(4));Qe.addGetterSetter($u,"image");Qe.addComponentsGetterSetter($u,"crop",["x","y","width","height"]);Qe.addGetterSetter($u,"cropX",0,_n());Qe.addGetterSetter($u,"cropY",0,_n());Qe.addGetterSetter($u,"cropWidth",0,_n());Qe.addGetterSetter($u,"cropHeight",0,_n());var FF=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],kge="Change.konva",_ge="none",VE="up",HE="right",$E="down",GE="left",Cge=FF.length,fT=class extends jy{constructor(e){super(e),this.on("add.konva",function(t){this._addListeners(t.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let t=this,n;const r=function(){t._sync()};for(n=0;n<Cge;n++)e.on(FF[n]+kge,r)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),t=this.getTag(),n,r,i,o,s,l,u;if(e&&t){switch(n=e.width(),r=e.height(),i=t.pointerDirection(),o=t.pointerWidth(),u=t.pointerHeight(),s=0,l=0,i){case VE:s=n/2,l=-1*u;break;case HE:s=n+o,l=r/2;break;case $E:s=n/2,l=r+u;break;case GE:s=-1*o,l=r/2;break}t.setAttrs({x:-1*s,y:-1*l,width:n,height:r}),e.setAttrs({x:-1*s,y:-1*l})}}};fT.prototype.className="Label";rs(fT);var Rg=class extends bn{_sceneFunc(e){const t=this.width(),n=this.height(),r=this.pointerDirection(),i=this.pointerWidth(),o=this.pointerHeight(),s=this.cornerRadius();let l=0,u=0,d=0,f=0;typeof s=="number"?l=u=d=f=Math.min(s,t/2,n/2):(l=Math.min(s[0]||0,t/2,n/2),u=Math.min(s[1]||0,t/2,n/2),f=Math.min(s[2]||0,t/2,n/2),d=Math.min(s[3]||0,t/2,n/2)),e.beginPath(),e.moveTo(l,0),r===VE&&(e.lineTo((t-i)/2,0),e.lineTo(t/2,-1*o),e.lineTo((t+i)/2,0)),e.lineTo(t-u,0),e.arc(t-u,u,u,Math.PI*3/2,0,!1),r===HE&&(e.lineTo(t,(n-o)/2),e.lineTo(t+i,n/2),e.lineTo(t,(n+o)/2)),e.lineTo(t,n-f),e.arc(t-f,n-f,f,0,Math.PI/2,!1),r===$E&&(e.lineTo((t+i)/2,n),e.lineTo(t/2,n+o),e.lineTo((t-i)/2,n)),e.lineTo(d,n),e.arc(d,n-d,d,Math.PI/2,Math.PI,!1),r===GE&&(e.lineTo(0,(n+o)/2),e.lineTo(-1*i,n/2),e.lineTo(0,(n-o)/2)),e.lineTo(0,l),e.arc(l,l,l,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,t=0,n=this.pointerWidth(),r=this.pointerHeight(),i=this.pointerDirection(),o=this.width(),s=this.height();return i===VE?(t-=r,s+=r):i===$E?s+=r:i===GE?(e-=n*1.5,o+=n):i===HE&&(o+=n*1.5),{x:e,y:t,width:o,height:s}}};Rg.prototype.className="Tag";rs(Rg);Qe.addGetterSetter(Rg,"pointerDirection",_ge);Qe.addGetterSetter(Rg,"pointerWidth",0,_n());Qe.addGetterSetter(Rg,"pointerHeight",0,_n());Qe.addGetterSetter(Rg,"cornerRadius",0,xC(4));var T2=class extends bn{_sceneFunc(e){const t=this.cornerRadius(),n=this.width(),r=this.height();e.beginPath(),t?_t.drawRoundedRectPath(e,n,r,t):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}};T2.prototype.className="Rect";rs(T2);Qe.addGetterSetter(T2,"cornerRadius",0,xC(4));var rm=class extends bn{_sceneFunc(e){const t=this._getPoints(),n=this.radius(),r=this.sides(),i=this.cornerRadius();if(e.beginPath(),i)_t.drawRoundedPolygonPath(e,t,r,n,i);else{e.moveTo(t[0].x,t[0].y);for(let o=1;o<t.length;o++)e.lineTo(t[o].x,t[o].y)}e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,t=this.attrs.radius||0,n=[];for(let r=0;r<e;r++)n.push({x:t*Math.sin(r*2*Math.PI/e),y:-1*t*Math.cos(r*2*Math.PI/e)});return n}getSelfRect(){const e=this._getPoints();let t=e[0].x,n=e[0].x,r=e[0].y,i=e[0].y;return e.forEach(o=>{t=Math.min(t,o.x),n=Math.max(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.y)}),{x:t,y:r,width:n-t,height:i-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};rm.prototype.className="RegularPolygon";rm.prototype._centroid=!0;
621rm.prototype._attrsAffectingSize=["radius"];rs(rm);Qe.addGetterSetter(rm,"radius",0,_n());Qe.addGetterSetter(rm,"sides",0,_n());Qe.addGetterSetter(rm,"cornerRadius",0,xC(4));var L7=Math.PI*2,Og=class extends bn{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,L7,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),L7,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};Og.prototype.className="Ring";Og.prototype._centroid=!0;Og.prototype._attrsAffectingSize=["innerRadius","outerRadius"];rs(Og);Qe.addGetterSetter(Og,"innerRadius",0,_n());Qe.addGetterSetter(Og,"outerRadius",0,_n());var Wd=class extends bn{constructor(e){super(e),this._updated=!0,this.anim=new nv(()=>{const t=this._updated;return this._updated=!1,t}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const t=this.animation(),n=this.frameIndex(),r=n*4,i=this.animations()[t],o=this.frameOffsets(),s=i[r+0],l=i[r+1],u=i[r+2],d=i[r+3],f=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,u,d),e.closePath(),e.fillStrokeShape(this)),f)if(o){const p=o[t],m=n*2;e.drawImage(f,s,l,u,d,p[m+0],p[m+1],u,d)}else e.drawImage(f,s,l,u,d,0,0,u,d)}_hitFunc(e){const t=this.animation(),n=this.frameIndex(),r=n*4,i=this.animations()[t],o=this.frameOffsets(),s=i[r+2],l=i[r+3];if(e.beginPath(),o){const u=o[t],d=n*2;e.rect(u[d+0],u[d+1],s,l)}else e.rect(0,0,s,l);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),t=this.animation();e<this.animations()[t].length/4-1?this.frameIndex(e+1):this.frameIndex(0)}};Wd.prototype.className="Sprite";rs(Wd);Qe.addGetterSetter(Wd,"animation");Qe.addGetterSetter(Wd,"animations");Qe.addGetterSetter(Wd,"frameOffsets");Qe.addGetterSetter(Wd,"image");Qe.addGetterSetter(Wd,"frameIndex",0,_n());Qe.addGetterSetter(Wd,"frameRate",17,_n());Qe.backCompat(Wd,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var im=class extends bn{_sceneFunc(e){const t=this.innerRadius(),n=this.outerRadius(),r=this.numPoints();e.beginPath(),e.moveTo(0,0-n);for(let i=1;i<r*2;i++){const o=i%2===0?n:t,s=o*Math.sin(i*Math.PI/r),l=-1*o*Math.cos(i*Math.PI/r);e.lineTo(s,l)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};im.prototype.className="Star";im.prototype._centroid=!0;im.prototype._attrsAffectingSize=["innerRadius","outerRadius"];rs(im);Qe.addGetterSetter(im,"numPoints",5,_n());Qe.addGetterSetter(im,"innerRadius",0,_n());Qe.addGetterSetter(im,"outerRadius",0,_n());function wp(e){return[...e].reduce((t,n,r,i)=>{if(new RegExp("\\p{Emoji}","u").test(n)){const o=i[r+1];o&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(o)?(t.push(n+o),i[r+1]=""):t.push(n)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[r+1]||""))?t.push(n+i[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?t[t.length-1]+=n:n&&t.push(n);return t},[])}var T0="auto",Sge="center",zF="inherit",fb="justify",Ege="Change.konva",UF="2d",P7="-",VF="left",Age="text",Tge="Text",Ige="top",Rge="bottom",B7="middle",HF="normal",Oge="px ",hx=" ",Nge="right",j7="rtl",Mge="word",Dge="char",F7="none",$3="…",$F=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Lge=$F.length,hb=null;function Pge(){if(hb!==null)return hb;hb=!1;try{const e=document.createElement("canvas");e.width=10,e.height=10;const t=e.getContext(UF);if(t){t.globalAlpha=0,t.shadowColor="black",t.shadowBlur=5,t.shadowOffsetX=5,t.shadowOffsetY=5,t.fillStyle="black",t.font="10px Arial",t.fillText("X",0,10);const n=t.getImageData(0,0,10,10).data;for(let r=3;r<n.length;r+=4)if(n[r]>0){hb=!0;break}}}catch{}return hb}function Bge(e){return e.split(",").map(t=>{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var px;function G3(){return px||(px=_t.createCanvasElement().getContext(UF),px)}function jge(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Fge(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}
621function zge(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}var ko=class extends bn{constructor(e){super(zge(e)),this._partialTextX=0,this._partialTextY=0;for(let t=0;t<Lge;t++)this.on($F[t]+Ege,this._setTextData);this._setTextData()}_sceneFunc(e){var t,n;const r=this.textArr,i=r.length;if(!this.text())return;let o=this.padding(),s=this.fontSize(),l=this.lineHeight()*s,u=this.verticalAlign(),d=this.direction(),f=0,p=this.align(),m=this.getWidth(),y=this.letterSpacing(),b=this.charRenderFunc(),k=this.fill(),S=this.textDecoration(),x=this.underlineOffset(),T=S.indexOf("underline")!==-1,C=S.indexOf("line-through")!==-1,I;d=d===zF?e.direction:d;let D=l/2,P=B7;if(!An.legacyTextRendering){const V=this.measureSize("M");P="alphabetic",D=(((t=V.fontBoundingBoxAscent)!==null&&t!==void 0?t:V.actualBoundingBoxAscent)-((n=V.fontBoundingBoxDescent)!==null&&n!==void 0?n:V.actualBoundingBoxDescent))/2+l/2}for(d===j7&&e.setAttr("direction",d),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",P),e.setAttr("textAlign",VF),u===B7?f=(this.getHeight()-i*l-o*2)/2:u===Rge&&(f=this.getHeight()-i*l-o*2),e.translate(o,f+o),I=0;I<i;I++){let V=0,ee=0;const F=r[I],H=F.text,te=F.width,M=F.lastInParagraph;if(e.save(),p===Nge?V+=m-te-o*2:p===Sge&&(V+=(m-te-o*2)/2),T){e.save(),e.beginPath();const L=x??(An.legacyTextRendering?Math.round(s/2):Math.round(s/4)),W=V,U=D+ee+L;e.moveTo(W,U);const q=p===fb&&!M?m-o*2:te;e.lineTo(W+Math.round(q),U),e.lineWidth=s/15,e.strokeStyle=this._getLinearGradient()||k,e.stroke(),e.restore()}const Z=V;if(d!==j7&&(y!==0||p===fb||b)){const L=H.split(" ").length-1,W=wp(H);for(let U=0;U<W.length;U++){const q=W[U];
621if(q===" "&&!M&&p===fb&&(V+=(m-o*2-te)/L),this._partialTextX=V,this._partialTextY=D+ee,this._partialText=q,b){e.save();const Q=r.slice(0,I).reduce((re,ne)=>re+wp(ne.text).length,0);b({char:q,index:U+Q,x:V,y:D+ee,lineIndex:I,column:U,isLastInLine:M,width:this.measureSize(q).width,context:e})}e.fillStrokeShape(this),b&&e.restore(),V+=this.measureSize(q).width+y}}else y!==0&&e.setAttr("letterSpacing",`${y}px`),this._partialTextX=V,this._partialTextY=D+ee,this._partialText=H,e.fillStrokeShape(this);if(C){e.save(),e.beginPath();const L=An.legacyTextRendering?0:-Math.round(s/4),W=Z;e.moveTo(W,D+ee+L);const U=p===fb&&!M?m-o*2:te;e.lineTo(W+Math.round(U),D+ee+L),e.lineWidth=s/15,e.strokeStyle=this._getLinearGradient()||k,e.stroke(),e.restore()}e.restore(),i>1&&(D+=l)}}_hitFunc(e){const t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){const t=_t._isString(e)?e:e==null?"":e+"";return this._setAttr(Age,t),this}getWidth(){return this.attrs.width===T0||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===T0||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return _t.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var t,n,r,i,o,s,l,u,d,f,p;let m=G3(),y=this.fontSize(),b;m.save(),m.font=this._getContextFont(),b=m.measureText(e),m.restore();const k=y/100;return{actualBoundingBoxAscent:(t=b.actualBoundingBoxAscent)!==null&&t!==void 0?t:71.58203125*k,actualBoundingBoxDescent:(n=b.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(r=b.actualBoundingBoxLeft)!==null&&r!==void 0?r:-7.421875*k,actualBoundingBoxRight:(i=b.actualBoundingBoxRight)!==null&&i!==void 0?i:75.732421875*k,alphabeticBaseline:(o=b.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(s=b.emHeightAscent)!==null&&s!==void 0?s:100*k,emHeightDescent:(l=b.emHeightDescent)!==null&&l!==void 0?l:-20*k,fontBoundingBoxAscent:(u=b.fontBoundingBoxAscent)!==null&&u!==void 0?u:91*k,fontBoundingBoxDescent:(d=b.fontBoundingBoxDescent)!==null&&d!==void 0?d:21*k,hangingBaseline:(f=b.hangingBaseline)!==null&&f!==void 0?f:72.80000305175781*k,ideographicBaseline:(p=b.ideographicBaseline)!==null&&p!==void 0?p:-21*k,width:b.width,height:y}}_getContextFont(){return this.fontStyle()+hx+this.fontVariant()+hx+(this.fontSize()+Oge)+Bge(this.fontFamily())}_addTextLine(e){this.align()===fb&&(e=e.trim());const t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){const t=this.letterSpacing(),n=e.length;return G3().measureText(e).width+t*n}_setTextData(){let e=this.text().split(`
622`),t=+this.fontSize(),n=0,r=this.lineHeight()*t,i=this.attrs.width,o=this.attrs.height,s=i!==T0&&i!==void 0,l=o!==T0&&o!==void 0,u=this.padding(),d=i-u*2,f=o-u*2,p=0,m=this.wrap(),y=m!==Dge&&m!==F7,b=this.ellipsis();this.textArr=[],G3().font=this._getContextFont();const k=b?this._getTextWidth($3):0;for(let S=0,x=e.length;S<x;++S){let T=e[S],C=this._getTextWidth(T);if(s&&C>d)for(;T.length>0;){let I=0,D=wp(T).length,P="",V=0;for(;I<D;){const ee=I+D>>>1,F=wp(T).slice(0,ee+1).join(""),H=this._getTextWidth(F);(b&&l&&p+r>f?H+k:H)<=d?(I=ee+1,P=F,V=H):D=ee}if(P){if(y){const ee=wp(T),F=wp(P),H=ee[F.length],te=H===hx||H===P7;let M;if(te&&V<=d)M=F.length;else{const Z=F.lastIndexOf(hx),L=F.lastIndexOf(P7);M=Math.max(Z,L)+1}M>0&&(I=M,P=ee.slice(0,I).join(""),V=this._getTextWidth(P))}if(P=P.trimRight(),this._addTextLine(P),n=Math.max(n,V),p+=r,this._shouldHandleEllipsis(p)){this._tryToAddEllipsisToLastLine();break}if(T=wp(T).slice(I).join("").trimLeft(),T.length>0&&(C=this._getTextWidth(T),C<=d)){this._addTextLine(T),p+=r,n=Math.max(n,C);break}}else break}else this._addTextLine(T),p+=r,n=Math.max(n,C),this._shouldHandleEllipsis(p)&&S<x-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),l&&p+r>f)break}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){const t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,i=r!==T0&&r!==void 0,o=r-this.padding()*2;return this.wrap()===F7||i&&e+n>o}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,t=e!==T0&&e!==void 0,n=e-this.padding()*2,r=this.ellipsis(),i=this.textArr[this.textArr.length-1];!i||!r||(t&&(this._getTextWidth(i.text+$3)<n||(i.text=i.text.slice(0,i.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(i.text+$3))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,t=this.hasShadow();return e&&t||t&&this.getAbsoluteOpacity()!==1&&Pge()?!0:super._useBufferCanvas()}};ko.prototype._fillFunc=jge;ko.prototype._strokeFunc=Fge;ko.prototype.className=Tge;ko.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];rs(ko);Qe.overWriteSetter(ko,"width",cT());Qe.overWriteSetter(ko,"height",cT());Qe.addGetterSetter(ko,"direction",zF);Qe.addGetterSetter(ko,"fontFamily","Arial");Qe.addGetterSetter(ko,"fontSize",12,_n());Qe.addGetterSetter(ko,"fontStyle",HF);Qe.addGetterSetter(ko,"fontVariant",HF);Qe.addGetterSetter(ko,"padding",0,_n());Qe.addGetterSetter(ko,"align",VF);Qe.addGetterSetter(ko,"verticalAlign",Ige);Qe.addGetterSetter(ko,"lineHeight",1,_n());Qe.addGetterSetter(ko,"wrap",Mge);Qe.addGetterSetter(ko,"ellipsis",!1,Hu());Qe.addGetterSetter(ko,"letterSpacing",0,_n());Qe.addGetterSetter(ko,"text","",Ag());Qe.addGetterSetter(ko,"textDecoration","");Qe.addGetterSetter(ko,"underlineOffset",void 0,_n());Qe.addGetterSetter(ko,"charRenderFunc",void 0);var Uge="",GF="normal";function qF(e){e.fillText(this.partialText,0,0)}function WF(e){e.strokeText(this.partialText,0,0)}var ea=class extends bn{constructor(e){super(e),this.dummyCanvas=_t.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncCh
622ange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return su.getPathLength(this.dataArray)}_getPointAtLength(e){return!this.attrs.data||e>this.pathLength?null:su.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=su.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const t=this.textDecoration(),n=this.fill(),r=this.fontSize(),i=this.glyphInfo,o=t.indexOf("underline")!==-1,s=t.indexOf("line-through")!==-1;o&&e.beginPath();for(let l=0;l<i.length;l++){e.save();const u=i[l].p0;e.translate(u.x,u.y),e.rotate(i[l].rotation),this.partialText=i[l].text,e.fillStrokeShape(this),o&&(l===0&&e.moveTo(0,r/2+1),e.lineTo(i[l].width,r/2+1)),e.restore()}if(o&&(e.strokeStyle=n,e.lineWidth=r/20,e.stroke()),s){e.beginPath();for(let l=0;l<i.length;l++){e.save();const u=i[l].p0;e.translate(u.x,u.y),e.rotate(i[l].rotation),l===0&&e.moveTo(0,0),e.lineTo(i[l].width,0),e.restore()}e.strokeStyle=n,e.lineWidth=r/20,e.stroke()}e.restore()}_hitFunc(e){e.beginPath();const t=this.glyphInfo;if(t.length>=1){const n=t[0].p0;e.moveTo(n.x,n.y)}for(let n=0;n<t.length;n++){const r=t[n].p1;e.lineTo(r.x,r.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return _t.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return ko.prototype.setText.call(this,e)}_getContextFont(){return ko.prototype._getContextFont.call(this)}_getTextSize(e){const t=this.dummyCanvas.getContext("2d");t.save(),t.font=this._getContextFont();const n=t.measureText(e);return t.restore(),{width:n.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const e=wp(this.text()),t=[];let n=0;for(let m=0;m<e.length;m++)t.push({char:e[m],width:this._getTextSize(e[m]).width}),n+=t[m].width;const{width:r,height:i}=this._getTextSize(this.attrs.text);if(this.textWidth=n,this.textHeight=i,this.glyphInfo=[],!this.attrs.data)return null;const o=this.letterSpacing(),s=this.align(),l=this.kerningFunc(),u=Math.max(0,n-r),d=Math.max(this.textWidth+((this.attrs.text||"").length-1)*o,0);let f=0;s==="center"&&(f=Math.max(0,this.pathLength/2-d/2)),s==="right"&&(f=Math.max(0,this.pathLength-d));let p=f;for(let m=0;m<t.length;m++){const y=this._getPointAtLength(p);if(!y)return;const b=t[m].char;let k=t[m].width+o;if(b===" "&&s==="justify"){const P=this.text().split(" ").length-1;k+=(this.pathLength-d)/P}const S=p+k,x=this._getPointAtLength(S>this.pathLength&&S-this.pathLength<=u?this.pathLength:S);if(!x)return;const T=su.getLineLength(y.x,y.y,x.x,x.y);let C=0;if(l)try{C=l(t[m-1].char,b)*this.fontSize()}catch{C=0}y.x+=C,x.x+=C,this.textWidth+=C;const I=su.getPointOnLine(C+T/2,y.x,y.y,x.x,x.y),D=Math.atan2(x.y-y.y,x.x-y.x);this.glyphInfo.push({transposeX:I.x,transposeY:I.y,text:e[m],rotation:D,p0:y,p1:x,width:T}),p+=k}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(u){e.push(u.p0.x),e.push(u.p0.y),e.push(u.p1.x),e.push(u.p1.y)});let t=e[0]||0,n=e[0]||0,r=e[1]||0,i=e[1]||0,o,s;for(let u=0;u<e.length/2;u++)o=e[u*2],s=e[u*2+1],t=Math.min(t,o),n=Math.max(n,o),r=Math.min(r,s),i=Math.max(i,s);const l=this.fontSize();return{x:t-l/2,y:r-l/2,width:n-t+l,height:i-r+l}}destroy(){return _t.releaseCanvas(this.dummyCanvas),super.destroy()}};ea.prototype._fillFunc=qF;ea.prototype._strokeFunc=WF;ea.prototype._fillFuncHit=qF;ea.prototype._strokeFuncHit=WF;ea.prototype.className="TextPath";ea.prototype._attrsAffectingSize=["text","fontSize","data"];rs(ea);Qe.addGetterSetter(ea,"data");Qe.addGetterSetter(ea,"fontFamily","Arial");Qe.addGetterSetter(ea,"fontSize",12,_n());Qe.addGetterSetter(ea,"fontStyle",GF);Qe.addGetterSetter(ea,"align","left");Qe.addGetterSetter(ea,"letterSpacing",0,_n());Qe.addGetterSetter(ea,"textBaseline","middle");Qe.addGetterSetter(ea,"fontVariant",GF);Qe.addGetterSetter(ea,"text",Uge);Qe.addGetterSetter(ea,"textDecoration","");Qe.addGetterSetter(ea,"kerningFunc",void 0);var KF="tr-konva",Vge=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${KF}`).join(" "),z7="nodesRect",Hge=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],$ge={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},Gge="ontouchstart"in An._global;function qge(e,t,n){if(e==="rotater")return n;t+=_t.degToRad($ge[e]||0);const r=(_t.radToDeg(t)%360+360)%360;return _t._inRange(r,337.5,360)||_t._inRange(r,0,22.5)?"ns-resize":_t._inRange(r,22.5,67.5)?"nesw-resize":_t._inRange(r,67.5,112.5)?"ew-resize":_t._inRange(r,112.5,157.5)?"nwse-resize":_t._inRange(r,157.5,202.5)?"ns-resize":_t._inRange(r,202.5,247.5)?"nesw-resize":_t._inRange(r,247.5,292.5)?"ew-resize":_t._inRange(r,292.5,337.5)?"nwse-resize":(_t.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}var o_=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function Wge(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}
622function YF(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:r,y:i}}function Kge(e,t){return YF(e,t,Wge(e))}function Yge(e,t,n){let r=t;for(let i=0;i<e.length;i++){const o=An.getAngle(e[i]),s=Math.abs(o-t)%(Math.PI*2);Math.min(s,Math.PI*2-s)<n&&(r=o)}return r}var qE=0,Ci=class extends jy{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._elementsCreated=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(Vge,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return _t.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return KF+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const t=e.filter(n=>n.isAncestorOf(this)?(_t.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=t,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(n=>{const r=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(n._attrsAffectingSize.length){const i=n._attrsAffectingSize.map(o=>o+"Change."+this._getEventNamespace()).join(" ");n.on(i,r)}n.on(Hge.map(i=>i+`.${this._getEventNamespace()}`).join(" "),r),n.on(`absoluteTransformChange.${this._getEventNamespace()}`,r),this._proxyDrag(n)}),this._resetTransformCache(),this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,n=>{t=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(n,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!t)return;const r=e.getAbsolutePosition(),i=r.x-t.x,o=r.y-t.y;this.nodes().forEach(s=>{if(s===e||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+i,y:l.y+o}),s.startDrag(n)}),t=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(z7),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(z7,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){const r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),i=e.getAbsoluteScale(n),o=e.getAbsolutePosition(n),s=r.x*i.x-e.offsetX()*i.x,l=r.y*i.y-e.offsetY()*i.y,u=(An.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2);return YF({x:o.x+s*Math.cos(u)+l*Math.sin(-u),y:o.y+l*Math.cos(u)+s*Math.sin(u),width:r.width*i.x,height:r.height*i.y,rotation:u},-An.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const e=[];this.nodes().map(l=>{const u=l.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),d=[{x:u.x,y:u.y},{x:u.x+u.width,y:u.y},{x:u.x+u.width,y:u.y+u.height},{x:u.x,y:u.y+u.height}],f=l.getAbsoluteTransform();d.forEach(function(p){const m=f.point(p);e.push(m)})});const t=new Du;t.rotate(-An.getAngle(this.rotation()));let n=1/0,r=1/0,i=-1/0,o=-1/0;e.forEach(function(l){const u=t.point(l);n===void 0&&(n=i=u.x,r=o=u.y),n=Math.min(n,u.x),r=Math.min(r,u.y),i=Math.max(i,u.x),o=Math.max(o,u.y)}),t.invert();const s=t.point({x:n,y:r});return{x:s.x,y:s.y,width:i-n,height:o-r,rotation:An.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}
622_createElements(){this._createBack(),o_.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(e){const t=new T2({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Gge?10:"auto"}),n=this;t.on("mousedown touchstart",function(r){n._handleMouseDown(r)}),t.on("dragstart",r=>{t.stopDrag(),r.cancelBubble=!0}),t.on("dragend",r=>{r.cancelBubble=!0}),t.on("mouseenter",()=>{const r=qge(e,An.getAngle(this.rotation()),this.rotateAnchorCursor());t.getStage().content&&(t.getStage().content.style.cursor=r),this._cursorChange=!0}),t.on("mouseout",()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(t)}_createBack(){const e=new bn({name:"back",width:0,height:0,sceneFunc(t,n){const r=n.getParent(),i=r.padding(),o=n.width(),s=n.height();if(t.beginPath(),t.rect(-i,-i,o+i*2,s+i*2),r.rotateEnabled()&&r.rotateLineVisible()){const l=r.rotateAnchorAngle(),u=r.rotateAnchorOffset(),d=_t.degToRad(l),f=Math.sin(d),p=-Math.cos(d),m=o/2,y=s/2;let b=1/0;p<0?b=Math.min(b,-y/p):p>0&&(b=Math.min(b,(s-y)/p)),f<0?b=Math.min(b,-m/f):f>0&&(b=Math.min(b,(o-m)/f));const k=m+f*b,S=y+p*b,x=_t._sign(s),T=k+f*u*x,C=S+p*u*x;t.moveTo(k,S),t.lineTo(T,C)}t.fillStrokeShape(n)},hitFunc:(t,n)=>{if(!this.shouldOverdrawWholeArea())return;const r=this.padding();t.beginPath(),t.rect(-r,-r,n.width()+r*2,n.height()+r*2),t.fillStrokeShape(n)}});this.add(e),this._proxyDrag(e),e.on("dragstart",t=>{t.cancelBubble=!0}),e.on("dragmove",t=>{t.cancelBubble=!0}),e.on("dragend",t=>{t.cancelBubble=!0}),this.on("dragmove",t=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const t=this._getNodeRect(),n=t.width,r=t.height,i=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/i),this.cos=Math.abs(n/i),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const o=e.target.getAbsolutePosition(),s=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-o.x,y:s.y-o.y},qE++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:e.evt,target:l})})}_handleMouseMove(e){let t,n,r;const i=this.findOne("."+this._movingAnchorName),o=i.getStage();o.setPointersPositions(e);const s=o.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=i.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,e)),i.setAbsolutePosition(l);const d=i.getAbsolutePosition();if(u.x===d.x&&u.y===d.y)return;if(this._movingAnchorName==="rotater"){const x=this._getNodeRect();t=i.x()-x.width/2,n=-i.y()+x.height/2;const T=An.getAngle(this.rotateAnchorAngle());let C=Math.atan2(-n,t)+Math.PI/2-T;x.height<0&&(C-=Math.PI);const I=An.getAngle(this.rotation())+C,D=An.getAngle(this.rotationSnapTolerance()),P=Kge(x,Yge(this.rotationSnaps(),I,D)-x.rotation);this._fitNodesInto(P,e);return}const f=this.shiftBehavior();let p;f==="inverted"?p=this.keepRatio()&&!e.shiftKey:f==="none"?p=this.keepRatio():p=this.keepRatio()||e.shiftKey;let m=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(p){const x=m?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(x.x-i.x(),2)+Math.pow(x.y-i.y(),2));const T=this.findOne(".top-left").x()>x.x?-1:1,C=this.findOne(".top-left").y()>x.y?-1:1;t=r*this.cos*T,n=r*this.sin*C,this.findOne(".top-left").x(x.x-t),this.findOne(".top-left").y(x.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(i.y());else if(this._movingAnchorName==="top-right"){if(p){const x=m?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(i.x()-x.x,2)+Math.pow(x.y-i.y(),2));const T=this.findOne(".top-right").x()<x.x?-1:1,C=this.findOne(".top-right").y()>x.y?-1:1;t=r*this.cos*T,n=r*this.sin*C,this.findOne(".top-right").x(x.x+t),this.findOne(".top-right").y(x.y-n)}var y=i.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(i.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(i.x());else if(this._movingAnchorName==="bottom-left"){if(p){const x=m?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(x.x-i.x(),2)+Math.pow(i.y()-x.y,2));const T=x.x<i.x()?-1:1,C=i.y()<x.y?-1:1;t=r*this.cos*T,n=r*this.sin*C,i.x(x.x-t),i.y(x.y+n)}y=i.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(i.y());else if(this._movingAnchorName==="bottom-right"){if(p){const x=m?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};r=Math.sqrt(Math.pow(i.x()-x.x,2)+Math.pow(i.y()-x.y,2));const T=this.findOne(".bottom-right").x()<x.x?-1:1,C=this.findOne(".bottom-right").y()<x.y?-1:1;t=r*this.cos*T,n=r*this.sin*C,this.findOne(".bottom-right").x(x.x+t),this.findOne(".bottom-right").y(x.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(m=this.centeredScaling()||e.altKey,m){const x=this.findOne(".top-left"),T=this.findOne(".bottom-right"),C=x.x(),I=x.y(),D=this.getWidth()-T.x(),P=this.getHeight()-T.y();T.move({x:-C,y:-I}),x.move({x:D,y:P})}const b=this.findOne(".top-left").getAbsolutePosition();t=b.x,n=b.y;const k=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),S=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:t,y:n,width:k,height:S,rotation:An.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var t;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const n=this.getNode();qE--,this._fire("transformend",{evt:e,target:n}),(t=this.getLayer())===null||t===void 0||t.batchDraw(),n&&this._nodes.forEac
622h(r=>{var i;r._fire("transformend",{evt:e,target:r}),(i=r.getLayer())===null||i===void 0||i.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,t){const n=this._getNodeRect(),r=1;if(_t._inRange(e.width,-this.padding()*2-r,r)){this.update();return}if(_t._inRange(e.height,-this.padding()*2-r,r)){this.update();return}const i=new Du;if(i.rotate(An.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const p=i.point({x:-this.padding()*2,y:0});e.x+=p.x,e.y+=p.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const p=i.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const p=i.point({x:0,y:-this.padding()*2});e.x+=p.x,e.y+=p.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const p=i.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const p=this.boundBoxFunc()(n,e);p?e=p:_t.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,s=new Du;s.translate(n.x,n.y),s.rotate(n.rotation),s.scale(n.width/o,n.height/o);const l=new Du,u=e.width/o,d=e.height/o;this.flipEnabled()===!1?(l.translate(e.x,e.y),l.rotate(e.rotation),l.translate(e.width<0?e.width:0,e.height<0?e.height:0),l.scale(Math.abs(u),Math.abs(d))):(l.translate(e.x,e.y),l.rotate(e.rotation),l.scale(u,d));const f=l.multiply(s.invert());this._nodes.forEach(p=>{var m;if(!p.getStage())return;const y=p.getParent().getAbsoluteTransform(),b=p.getTransform().copy();b.translate(p.offsetX(),p.offsetY());const k=new Du;k.multiply(y.copy().invert()).multiply(f).multiply(y).multiply(b);const S=k.decompose();p.setAttrs(S),(m=p.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(_t._getRotation(e.rotation)),this._nodes.forEach(p=>{this._fire("transform",{evt:t,target:p}),p._fire("transform",{evt:t,target:p})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e;const t=this._getNodeRect();this.rotation(_t._getRotation(t.rotation));const n=t.width,r=t.height,i=this.enabledAnchors(),o=this.resizeEnabled(),s=this.padding(),l=this.anchorSize(),u=this.find("._anchor");u.forEach(D=>{D.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:o&&i.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:l/2+s,visible:o&&i.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:o&&i.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:l/2+s,visible:o&&i.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:l/2-s,visible:o&&i.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:l/2+s,offsetY:l/2-s,visible:o&&i.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:l/2-s,visible:o&&i.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:l/2-s,offsetY:l/2-s,visible:o&&i.indexOf("bottom-right")>=0});const d=this.rotateAnchorAngle(),f=this.rotateAnchorOffset(),p=_t.degToRad(d),m=Math.sin(p),y=-Math.cos(p),b=n/2,k=r/2;let S=1/0;y<0?S=Math.min(S,-k/y):y>0&&(S=Math.min(S,(r-k)/y)),m<0?S=Math.min(S,-b/m):m>0&&(S=Math.min(S,(n-b)/m));const x=b+m*S,T=k+y*S,C=_t._sign(r);this._batchChangeChild(".rotater",{x:x+m*f*C,y:T+y*f*C-s*y,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(D=>D.draggable()),x:0,y:0});const I=this.anchorStyleFunc();I&&u.forEach(D=>{I(D)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);
622e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),jy.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(_t.error("You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead."),this):super.add(...e)}toObject(){return In.prototype.toObject.call(this)}clone(e){return In.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Ci.isTransforming=()=>qE>0;function Xge(e){return e instanceof Array||_t.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){o_.indexOf(t)===-1&&_t.warn("Unknown anchor name: "+t+". Available names are: "+o_.join(", "))}),e||[]}Ci.prototype.className="Transformer";rs(Ci);Qe.addGetterSetter(Ci,"enabledAnchors",o_,Xge);Qe.addGetterSetter(Ci,"flipEnabled",!0,Hu());Qe.addGetterSetter(Ci,"resizeEnabled",!0);Qe.addGetterSetter(Ci,"anchorSize",10,_n());Qe.addGetterSetter(Ci,"rotateEnabled",!0);Qe.addGetterSetter(Ci,"rotateLineVisible",!0);Qe.addGetterSetter(Ci,"rotationSnaps",[]);Qe.addGetterSetter(Ci,"rotateAnchorOffset",50,_n());Qe.addGetterSetter(Ci,"rotateAnchorAngle",0,_n());Qe.addGetterSetter(Ci,"rotateAnchorCursor","crosshair");Qe.addGetterSetter(Ci,"rotationSnapTolerance",5,_n());Qe.addGetterSetter(Ci,"borderEnabled",!0);Qe.addGetterSetter(Ci,"anchorStroke","rgb(0, 161, 255)");Qe.addGetterSetter(Ci,"anchorStrokeWidth",1,_n());Qe.addGetterSetter(Ci,"anchorFill","white");Qe.addGetterSetter(Ci,"anchorCornerRadius",0,_n());Qe.addGetterSetter(Ci,"borderStroke","rgb(0, 161, 255)");Qe.addGetterSetter(Ci,"borderStrokeWidth",1,_n());Qe.addGetterSetter(Ci,"borderDash");Qe.addGetterSetter(Ci,"keepRatio",!0);Qe.addGetterSetter(Ci,"shiftBehavior","default");Qe.addGetterSetter(Ci,"centeredScaling",!1);Qe.addGetterSetter(Ci,"ignoreStroke",!1);Qe.addGetterSetter(Ci,"padding",0,_n());Qe.addGetterSetter(Ci,"nodes");Qe.addGetterSetter(Ci,"node");Qe.addGetterSetter(Ci,"boundBoxFunc");Qe.addGetterSetter(Ci,"anchorDragBoundFunc");Qe.addGetterSetter(Ci,"anchorStyleFunc");Qe.addGetterSetter(Ci,"shouldOverdrawWholeArea",!1);Qe.addGetterSetter(Ci,"useSingleNodeRotation",!0);Qe.backCompat(Ci,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledH
622andlers:"enabledAnchors"});var yh=class extends bn{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,An.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};yh.prototype.className="Wedge";yh.prototype._centroid=!0;yh.prototype._attrsAffectingSize=["radius"];rs(yh);Qe.addGetterSetter(yh,"radius",0,_n());Qe.addGetterSetter(yh,"angle",0,_n());Qe.addGetterSetter(yh,"clockwise",!1);Qe.backCompat(yh,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function U7(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var Zge=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,39
6226,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Qge=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Jge(e,t){const n=e.data,r=e.width,i=e.height;let o,s,l,u,d,f,p,m,y,b,k,S,x,T,C,I,D,P,V,ee;const F=t+t+1,H=r-1,te=i-1,M=t+1,Z=M*(M+1)/2,L=new U7,W=Zge[t],U=Qge[t];let q=null,Q=L,re=null,ne=null;for(let J=1;J<F;J++)Q=Q.next=new U7,J===M&&(q=Q);Q.next=L,l=s=0;for(let J=0;J<i;J++){S=x=T=C=u=d=f=p=0,m=M*(I=n[s]),y=M*(D=n[s+1]),b=M*(P=n[s+2]),k=M*(V=n[s+3]),u+=Z*I,d+=Z*D,f+=Z*P,p+=Z*V,Q=L;for(let ge=0;ge<M;ge++)Q.r=I,Q.g=D,Q.b=P,Q.a=V,Q=Q.next;for(let ge=1;ge<M;ge++)o=s+((H<ge?H:ge)<<2),u+=(Q.r=I=n[o])*(ee=M-ge),d+=(Q.g=D=n[o+1])*ee,f+=(Q.b=P=n[o+2])*ee,p+=(Q.a=V=n[o+3])*ee,S+=I,x+=D,T+=P,C+=V,Q=Q.next;re=L,ne=q;for(let ge=0;ge<r;ge++)n[s+3]=V=p*W>>U,V!==0?(V=255/V,n[s]=(u*W>>U)*V,n[s+1]=(d*W>>U)*V,n[s+2]=(f*W>>U)*V):n[s]=n[s+1]=n[s+2]=0,u-=m,d-=y,f-=b,p-=k,m-=re.r,y-=re.g,b-=re.b,k-=re.a,o=l+((o=ge+t+1)<H?o:H)<<2,S+=re.r=n[o],x+=re.g=n[o+1],T+=re.b=n[o+2],C+=re.a=n[o+3],u+=S,d+=x,f+=T,p+=C,re=re.next,m+=I=ne.r,y+=D=ne.g,b+=P=ne.b,k+=V=ne.a,S-=I,x-=D,T-=P,C-=V,ne=ne.next,s+=4;l+=r}for(let J=0;J<r;J++){x=T=C=S=d=f=p=u=0,s=J<<2,m=M*(I=n[s]),y=M*(D=n[s+1]),b=M*(P=n[s+2]),k=M*(V=n[s+3]),u+=Z*I,d+=Z*D,f+=Z*P,p+=Z*V,Q=L;for(let le=0;le<M;le++)Q.r=I,Q.g=D,Q.b=P,Q.a=V,Q=Q.next;let ge=r;for(let le=1;le<=t;le++)s=ge+J<<2,u+=(Q.r=I=n[s])*(ee=M-le),d+=(Q.g=D=n[s+1])*ee,f+=(Q.b=P=n[s+2])*ee,p+=(Q.a=V=n[s+3])*ee,S+=I,x+=D,T+=P,C+=V,Q=Q.next,le<te&&(ge+=r);s=J,re=L,ne=q;for(let le=0;le<i;le++)o=s<<2,n[o+3]=V=p*W>>U,V>0?(V=255/V,n[o]=(u*W>>U)*V,n[o+1]=(d*W>>U)*V,n[o+2]=(f*W>>U)*V):n[o]=n[o+1]=n[o+2]=0,u-=m,d-=y,f-=b,p-=k,m-=re.r,y-=re.g,b-=re.b,k-=re.a,o=J+((o=le+M)<te?o:te)*r<<2,u+=S+=re.r=n[o],d+=x+=re.g=n[o+1],f+=T+=re.b=n[o+2],p+=C+=re.a=n[o+3],re=re.next,m+=I=ne.r,y+=D=ne.g,b+=P=ne.b,k+=V=ne.a,S-=I,x-=D,T-=P,C-=V,ne=ne.next,s+=r}}var e0e=function(t){const n=Math.round(this.blurRadius());n>0&&Jge(t,n)};Qe.addGetterSetter(In,"blurRadius",0,_n(),Qe.afterSetFilter);var t0e=function(e){const t=this.brightness()*255,n=e.data,r=n.length;for(let i=0;i<r;i+=4)n[i]+=t,n[i+1]+=t,n[i+2]+=t};Qe.addGetterSetter(In,"brightness",0,_n(),Qe.afterSetFilter);var n0e=function(e){const t=this.brightness(),n=e.data,r=n.length;for(let i=0;i<r;i+=4)n[i]=Math.min(255,n[i]*t),n[i+1]=Math.min(255,n[i+1]*t),n[i+2]=Math.min(255,n[i+2]*t)},r0e=function(e){const t=Math.pow((this.contrast()+100)/100,2),n=e.data,r=n.length;let i=150,o=150,s=150;for(let l=0;l<r;l+=4)i=n[l],o=n[l+1],s=n[l+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,s/=255,s-=.5,s*=t,s+=.5,s*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,s=s<0?0:s>255?255:s,n[l]=i,n[l+1]=o,n[l+2]=s};Qe.addGetterSetter(In,"contrast",0,_n(),Qe.afterSetFilter);var i0e=function(e){var t,n,r,i,o,s,l,u,d;const f=e.data,p=e.width,m=e.height,y=Math.min(1,Math.max(0,(n=(t=this.embossStrength)===null||t===void 0?void 0:t.call(this))!==null&&n!==void 0?n:.5)),b=Math.min(1,Math.max(0,(i=(r=this.embossWhiteLevel)===null||r===void 0?void 0:r.call(this))!==null&&i!==void 0?i:.5)),k=(l={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(s=(o=this.embossDirection)===null||o===void 0?void 0:o.call(this))!==null&&s!==void 0?s:"top-left"])!==null&&l!==void 0?l:315,S=!!((d=(u=this.embossBlend)===null||u===void 0?void 0:u.call(this))!==null&&d!==void 0&&d),x=y*10,T=b*255,C=k*Math.PI/180,I=Math.cos(C),D=Math.sin(C),P=128/1020*x,V=new Uint8ClampedArray(f),ee=new Float32Array(p*m);for(let Z=0,L=0;L<f.length;L+=4,Z++)ee[Z]=.2126*V[L]+.7152*V[L+1]+.0722*V[L+2];const F=[-1,0,1,-2,0,2,-1,0,1],H=[-1,-2,-1,0,0,0,1,2,1],te=[-p-1,-p,-p+1,-1,0,1,p-1,p,p+1],M=Z=>Z<0?0:Z>255?255:Z;for(let Z=1;Z<m-1;Z++)for(let L=1;L<p-1;L++){const W=Z*p+L;let U=0,q=0;U+=ee[W+te[0]]*F[0],q+=ee[W+te[0]]*H[0],U+=ee[W+te[1]]*F[1],q+=ee[W+te[1]]*H[1],U+=ee[W+te[2]]*F[2],q+=ee[W+te[2]]*H[2],U+=ee[W+te[3]]*F[3],q+=ee[W+te[3]]*H[3],U+=ee[W+te[5]]*F[5],q+=ee[W+te[5]]*H[5],U+=ee[W+te[6]]*F[6],q+=ee[W+te[6]]*H[6],U+=ee[W+te[7]]*F[7],q+=ee[W+te[7]]*H[7],U+=ee[W+te[8]]*F[8],q+=ee[W+te[8]]*H[8];
622const Q=M(T+(I*U+D*q)*P),re=W*4;if(S){const ne=Q-T;f[re]=M(V[re]+ne),f[re+1]=M(V[re+1]+ne),f[re+2]=M(V[re+2]+ne),f[re+3]=V[re+3]}else f[re]=f[re+1]=f[re+2]=Q,f[re+3]=V[re+3]}for(let Z=0;Z<p;Z++){let L=Z*4,W=((m-1)*p+Z)*4;f[L]=V[L],f[L+1]=V[L+1],f[L+2]=V[L+2],f[L+3]=V[L+3],f[W]=V[W],f[W+1]=V[W+1],f[W+2]=V[W+2],f[W+3]=V[W+3]}for(let Z=1;Z<m-1;Z++){let L=Z*p*4,W=(Z*p+(p-1))*4;f[L]=V[L],f[L+1]=V[L+1],f[L+2]=V[L+2],f[L+3]=V[L+3],f[W]=V[W],f[W+1]=V[W+1],f[W+2]=V[W+2],f[W+3]=V[W+3]}return e};Qe.addGetterSetter(In,"embossStrength",.5,_n(),Qe.afterSetFilter);Qe.addGetterSetter(In,"embossWhiteLevel",.5,_n(),Qe.afterSetFilter);Qe.addGetterSetter(In,"embossDirection","top-left",void 0,Qe.afterSetFilter);Qe.addGetterSetter(In,"embossBlend",!1,void 0,Qe.afterSetFilter);function q3(e,t,n,r,i){const o=n-t,s=i-r;if(o===0)return r+s/2;if(s===0)return r;let l=(e-t)/o;return l=s*l+r,l}var o0e=function(e){const t=e.data,n=t.length;let r=t[0],i=r,o,s=t[1],l=s,u,d=t[2],f=d,p;const m=this.enhance();if(m===0)return;for(let C=0;C<n;C+=4)o=t[C+0],o<r?r=o:o>i&&(i=o),u=t[C+1],u<s?s=u:u>l&&(l=u),p=t[C+2],p<d?d=p:p>f&&(f=p);i===r&&(i=255,r=0),l===s&&(l=255,s=0),f===d&&(f=255,d=0);let y,b,k,S,x,T;if(m>0)y=i+m*(255-i),b=r-m*(r-0),k=l+m*(255-l),S=s-m*(s-0),x=f+m*(255-f),T=d-m*(d-0);else{const C=(i+r)*.5;y=i+m*(i-C),b=r+m*(r-C);const I=(l+s)*.5;k=l+m*(l-I),S=s+m*(s-I);const D=(f+d)*.5;x=f+m*(f-D),T=d+m*(d-D)}for(let C=0;C<n;C+=4)t[C+0]=q3(t[C+0],r,i,b,y),t[C+1]=q3(t[C+1],s,l,S,k),t[C+2]=q3(t[C+2],d,f,T,x)};Qe.addGetterSetter(In,"enhance",0,_n(),Qe.afterSetFilter);var s0e=function(e){const t=e.data,n=t.length;for(let r=0;r<n;r+=4){const i=.34*t[r]+.5*t[r+1]+.16*t[r+2];t[r]=i,t[r+1]=i,t[r+2]=i}};Qe.addGetterSetter(In,"hue",0,_n(),Qe.afterSetFilter);Qe.addGetterSetter(In,"saturation",0,_n(),Qe.afterSetFilter);Qe.addGetterSetter(In,"luminance",0,_n(),Qe.afterSetFilter);var a0e=function(e){const t=e.data,n=t.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,s=this.luminance()*127,l=r*i*Math.cos(o*Math.PI/180),u=r*i*Math.sin(o*Math.PI/180),d=.299*r+.701*l+.167*u,f=.587*r-.587*l+.33*u,p=.114*r-.114*l-.497*u,m=.299*r-.299*l-.328*u,y=.587*r+.413*l+.035*u,b=.114*r-.114*l+.293*u,k=.299*r-.3*l+1.25*u,S=.587*r-.586*l-1.05*u,x=.114*r+.886*l-.2*u;let T,C,I,D;for(let P=0;P<n;P+=4)T=t[P+0],C=t[P+1],I=t[P+2],D=t[P+3],t[P+0]=d*T+f*C+p*I+s,t[P+1]=m*T+y*C+b*I+s,t[P+2]=k*T+S*C+x*I+s,t[P+3]=D},l0e=function(e){const t=e.data,n=t.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,s=r*i*Math.cos(o*Math.PI/180),l=r*i*Math.sin(o*Math.PI/180),u=.299*r+.701*s+.167*l,d=.587*r-.587*s+.33*l,f=.114*r-.114*s-.497*l,p=.299*r-.299*s-.328*l,m=.587*r+.413*s+.035*l,y=.114*r-.114*s+.293*l,b=.299*r-.3*s+1.25*l,k=.587*r-.586*s-1.05*l,S=.114*r+.886*s-.2*l;for(let x=0;x<n;x+=4){const T=t[x+0],C=t[x+1],I=t[x+2],D=t[x+3];t[x+0]=u*T+d*C+f*I,t[x+1]=p*T+m*C+y*I,t[x+2]=b*T+k*C+S*I,t[x+3]=D}};Qe.addGetterSetter(In,"hue",0,_n(),Qe.afterSetFilter);Qe.addGetterSetter(In,"saturation",0,_n(),Qe.afterSetFilter);Qe.addGetterSetter(In,"value",0,_n(),Qe.afterSetFilter);var c0e=function(e){const t=e.data,n=t.length;for(let r=0;r<n;r+=4)t[r]=255-t[r],t[r+1]=255-t[r+1],t[r+2]=255-t[r+2]},u0e=function(e,t,n){const r=e.data,i=t.data,o=e.width,s=e.height,l=n.polarCenterX||o/2,u=n.polarCenterY||s/2;let d=Math.sqrt(l*l+u*u),f=o-l,p=s-u;const m=Math.sqrt(f*f+p*p);d=m>d?m:d;const y=s,b=o,k=360/b*Math.PI/180;for(let S=0;S<b;S+=1){const x=Math.sin(S*k),T=Math.cos(S*k);for(let C=0;C<y;C+=1){f=Math.floor(l+d*C/y*T),p=Math.floor(u+d*C/y*x);let I=(p*o+f)*4;const D=r[I+0],P=r[I+1],V=r[I+2],ee=r[I+3];I=(S+C*o)*4,i[I+0]=D,i[I+1]=P,i[I+2]=V,i[I+3]=ee}}},d0e=function(e,t,n){const r=e.data,i=t.data,o=e.width,s=e.height,l=n.polarCenterX||o/2,u=n.polarCenterY||s/2;let d=Math.sqrt(l*l+u*u),f=o-l,p=s-u;const m=Math.sqrt(f*f+p*p);d=m>d?m:d;const y=s,b=o,k=0;let S,x;for(f=0;f<o;f+=1)for(p=0;p<s;p+=1){const T=f-l,C=p-u,I=Math.sqrt(T*T+C*C)*y/d;let D=(Math.atan2(C,T)*180/Math.PI+360+k)%360;D=D*b/360,S=Math.floor(D),x=Math.floor(I);let P=(x*o+S)*4;const V=r[P+0],ee=r[P+1],F=r[P+2],H=r[P+3];P=(p*o+f)*4,i[P+0]=V,i[P+1]=ee,i[P+2]=F,i[P+3]=H}}
622,f0e=function(e){const t=e.width,n=e.height;let r,i,o,s,l,u,d,f,p,m,y=Math.round(this.kaleidoscopePower());const b=Math.round(this.kaleidoscopeAngle()),k=Math.floor(t*(b%360)/360);if(y<1)return;const S=_t.createCanvasElement();S.width=t,S.height=n;const x=S.getContext("2d").getImageData(0,0,t,n);_t.releaseCanvas(S),u0e(e,x,{polarCenterX:t/2,polarCenterY:n/2});let T=t/Math.pow(2,y);for(;T<=8;)T=T*2,y-=1;T=Math.ceil(T);let C=T,I=0,D=C,P=1;for(k+T>t&&(I=C,D=0,P=-1),i=0;i<n;i+=1)for(r=I;r!==D;r+=P)o=Math.round(r+k)%t,p=(t*i+o)*4,l=x.data[p+0],u=x.data[p+1],d=x.data[p+2],f=x.data[p+3],m=(t*i+r)*4,x.data[m+0]=l,x.data[m+1]=u,x.data[m+2]=d,x.data[m+3]=f;for(i=0;i<n;i+=1)for(C=Math.floor(T),s=0;s<y;s+=1){for(r=0;r<C+1;r+=1)p=(t*i+r)*4,l=x.data[p+0],u=x.data[p+1],d=x.data[p+2],f=x.data[p+3],m=(t*i+C*2-r-1)*4,x.data[m+0]=l,x.data[m+1]=u,x.data[m+2]=d,x.data[m+3]=f;C*=2}d0e(x,e,{})};Qe.addGetterSetter(In,"kaleidoscopePower",2,_n(),Qe.afterSetFilter);Qe.addGetterSetter(In,"kaleidoscopeAngle",0,_n(),Qe.afterSetFilter);function mx(e,t,n){let r=(n*e.width+t)*4;const i=[];return i.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),i}function pb(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function h0e(e){const t=[0,0,0];for(let n=0;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1],t[2]+=e[n][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function p0e(e,t){const n=mx(e,0,0),r=mx(e,e.width-1,0),i=mx(e,0,e.height-1),o=mx(e,e.width-1,e.height-1),s=t||10;if(pb(n,r)<s&&pb(r,o)<s&&pb(o,i)<s&&pb(i,n)<s){const l=h0e([r,n,o,i]),u=[];for(let d=0;d<e.width*e.height;d++)u[d]=pb(l,[e.data[d*4],e.data[d*4+1],e.data[d*4+2]])<s?0:255;return u}}function m0e(e,t){for(let n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function g0e(e,t,n){const r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[];for(let l=0;l<n;l++)for(let u=0;u<t;u++){const d=l*t+u;let f=0;for(let p=0;p<i;p++)for(let m=0;m<i;m++){const y=l+p-o,b=u+m-o;if(y>=0&&y<n&&b>=0&&b<t){const k=y*t+b,S=r[p*i+m];f+=e[k]*S}}s[d]=f===2040?255:0}return s}function y0e(e,t,n){const r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[];for(let l=0;l<n;l++)for(let u=0;u<t;u++){const d=l*t+u;let f=0;for(let p=0;p<i;p++)for(let m=0;m<i;m++){const y=l+p-o,b=u+m-o;if(y>=0&&y<n&&b>=0&&b<t){const k=y*t+b,S=r[p*i+m];f+=e[k]*S}}s[d]=f>=1020?255:0}return s}function v0e(e,t,n){const r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[];for(let l=0;l<n;l++)for(let u=0;u<t;u++){const d=l*t+u;let f=0;for(let p=0;p<i;p++)for(let m=0;m<i;m++){const y=l+p-o,b=u+m-o;if(y>=0&&y<n&&b>=0&&b<t){const k=y*t+b,S=r[p*i+m];f+=e[k]*S}}s[d]=f}return s}var b0e=function(e){let t=p0e(e,this.threshold());return t&&(t=g0e(t,e.width,e.height),t=y0e(t,e.width,e.height),t=v0e(t,e.width,e.height),m0e(e,t)),e};Qe.addGetterSetter(In,"threshold",0,_n(),Qe.afterSetFilter);var w0e=function(e){const t=this.noise()*255,n=e.data,r=n.length,i=t/2;for(let o=0;o<r;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};Qe.addGetterSetter(In,"noise",.2,_n(),Qe.afterSetFilter);var x0e=function(e){let t=Math.ceil(this.pixelSize()),n=e.width,r=e.height,i=Math.ceil(n/t),o=Math.ceil(r/t),s=e.data;if(t<=0){_t.error("pixelSize value can not be <= 0");return}for(let l=0;l<i;l+=1)for(let u=0;u<o;u+=1){let d=0,f=0,p=0,m=0;const y=l*t,b=y+t,k=u*t,S=k+t;let x=0;for(let T=y;T<b;T+=1)if(!(T>=n))for(let C=k;C<S;C+=1){if(C>=r)continue;const I=(n*C+T)*4;d+=s[I+0],f+=s[I+1],p+=s[I+2],m+=s[I+3],x+=1}d=d/x,f=f/x,p=p/x,m=m/x;for(let T=y;T<b;T+=1)if(!(T>=n))for(let C=k;C<S;C+=1){if(C>=r)continue;const I=(n*C+T)*4;s[I+0]=d,s[I+1]=f,s[I+2]=p,s[I+3]=m}}};Qe.addGetterSetter(In,"pixelSize",8,_n(),Qe.afterSetFilter);var k0e=function(e){const t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t;for(let o=0;o<r;o+=1)n[o]=Math.floor(n[o]/i)*i};Qe.addGetterSetter(In,"levels",.5,_n(),Qe.afterSetFilter);var _0e=function(e){const t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue();for(let s=0;s<n;s+=4){const l=(.34*t[s]+.5*t[s+1]+.16*t[s+2])/255;t[s]=l*r,t[s+1]=l*i,t[s+2]=l*o,t[s+3]=t[s+3]}};Qe.addGetterSetter(In,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Qe.addGetterSetter(In,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Qe.addGetterSetter(In,"blue",0,yF,Qe.afterSetFilter);var C0e=function(e){const t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),s=this.alpha();for(let l=0;l<n;l+=4){const u=1-s;t[l]=r*s+t[l]*u,t[l+1]=i*s+t[l+1]*u,t[l+2]=o*s+t[l+2]*u}}
622;Qe.addGetterSetter(In,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Qe.addGetterSetter(In,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Qe.addGetterSetter(In,"blue",0,yF,Qe.afterSetFilter);Qe.addGetterSetter(In,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var S0e=function(e){const t=e.data,n=t.length;for(let r=0;r<n;r+=4){const i=t[r+0],o=t[r+1],s=t[r+2];t[r+0]=Math.min(255,i*.393+o*.769+s*.189),t[r+1]=Math.min(255,i*.349+o*.686+s*.168),t[r+2]=Math.min(255,i*.272+o*.534+s*.131)}},E0e=function(e){const n=e.data;for(let r=0;r<n.length;r+=4){const i=n[r],o=n[r+1],s=n[r+2];.2126*i+.7152*o+.0722*s>=128&&(n[r]=255-i,n[r+1]=255-o,n[r+2]=255-s)}return e},A0e=function(e){const t=this.threshold()*255,n=e.data,r=n.length;for(let i=0;i<r;i+=1)n[i]=n[i]<t?0:255};Qe.addGetterSetter(In,"threshold",.5,_n(),Qe.afterSetFilter);var T0e=R7.Util._assign(R7,{Arc:mh,Arrow:Ig,Circle:rv,Ellipse:nm,Image:$u,Label:fT,Tag:Rg,Line:gh,Path:su,Rect:T2,RegularPolygon:rm,Ring:Og,Sprite:Wd,Star:im,Text:ko,TextPath:ea,Transformer:Ci,Wedge:yh,Filters:{Blur:e0e,Brightness:n0e,Brighten:t0e,Contrast:r0e,Emboss:i0e,Enhance:o0e,Grayscale:s0e,HSL:a0e,HSV:l0e,Invert:c0e,Kaleidoscope:f0e,Mask:b0e,Noise:w0e,Pixelate:x0e,Posterize:k0e,RGB:_0e,RGBA:C0e,Sepia:S0e,Solarize:E0e,Threshold:A0e}}),I0e=["dialog","floating"],V7=["top-right","top-left","bottom-right","bottom-left","top-center","bottom-center"];function R0e(e){var i;if(!e||typeof e!="object")throw new Error("SurfaceManager: request must be a non-null object.");if(!I0e.includes(e.mode))throw new Error(`SurfaceManager: mode must be "dialog" or "floating", got "${e.mode}".`);const t="kind"in e&&e.kind!=null,n="component"in e&&e.component!=null,r="render"in e&&typeof e.render=="function";if(n&&r)throw new Error('SurfaceManager: request cannot provide both "component" and "render". Use one or the other.');if(!t&&!n&&!r)throw new Error('SurfaceManager: request must provide "kind" (intent-based) or "component"/"render" (direct-render).');if(e.mode==="floating"&&((i=e.floating)==null?void 0:i.placement)!=null&&!V7.includes(e.floating.placement))throw new Error(`SurfaceManager: floating.placement must be one of ${V7.join(", ")}, got "${e.floating.placement}".`)}var r2,i2,py,Js,Lb,Zx,XF,ZF,QF,JF,qM,O0e=(qM=class{constructor({getModuleConfig:e}){Cn(this,Js);Ao(this,"activeDialog",Zs(null));Ao(this,"activeFloating",Zs(null));Cn(this,r2,!1);Cn(this,i2,1);Cn(this,py);Ot(this,py,e)}open(e){if(Ae(this,r2))return Ye(this,Js,JF).call(this,e);R0e(e);const t=Ye(this,Js,ZF).call(this,e),{component:n,props:r,render:i}=Ye(this,Js,QF).call(this,t);let o,s=!1;const l=new Promise(y=>{o=b=>s?!1:(s=!0,y(b),!0)});let u;const d=y=>{o({status:"submitted",data:y})&&Ye(this,Js,Zx).call(this,u)},f=y=>{o({status:"closed",reason:y})&&Ye(this,Js,Zx).call(this,u)};u={id:t.id,mode:t.mode,request:t,component:n,props:r,render:i,resolve:d,close:f,settle:y=>o(y),get settled(){return s}};const p=t.mode==="dialog"?"activeDialog":"activeFloating",m=this[p].value;return m&&!m.settled&&m.settle({status:"replaced",replacedBy:t.id}),this[p].value=u,{id:t.id,mode:t.mode,close:y=>Ye(this,Js,Lb).call(this,u,y),result:l}}close(e,t){if(e!=null){const i=Ye(this,Js,XF).call(this,e);i&&Ye(this,Js,Lb).call(this,i,t);return}const n=this.activeDialog.value;if(n&&!n.settled){Ye(this,Js,Lb).call(this,n,t);return}const r=this.activeFloating.value;r&&!r.settled&&Ye(this,Js,Lb).call(this,r,t)}settleAll(e){for(const t of[this.activeDialog,this.activeFloating]){const n=t.value;n&&!n.settled&&n.settle(e),t.value=null}}destroy(){Ot(this,r2,!0),this.settleAll({status:"destroyed"})}},r2=new WeakMap,i2=new WeakMap,py=new WeakMap,Js=new WeakSet,Lb=function(e,t){e.settled||(e.settle({status:"closed",reason:t}),Ye(this,Js,Zx).call(this,e))},Zx=function(e){const t=e.mode==="dialog"?this.activeDialog:this.activeFloating;t.value===e&&(t.value=null)},XF=function(e){var t,n;return((t=this.activeDialog.value)==null?void 0:t.id)===e?this.activeDialog.value:((n=this.activeFloating.value)==null?void 0:n.id)===e?this.activeFloating.value:null},ZF=function(e){const t=e.id??`surface-${Ew(this,i2)._++}`,n=Ae(this,py).call(this)??{},r=e.mode==="dialog"?n.dialog:n.floating,i=e.mode==="dialog"?{maxWidth:r==null?void 0:r.maxWidth,...e.dialog}:e.dialog,o=e.mode==="floating"?{placement:(r==null?void 0:r.placement)??"top-right",width:r==null?void 0:r.width,maxWidth:r==null?void 0:r.maxWidth,maxHeight:r==null?void 0:r.maxHeight,autoFocus:(r==null?void 0:r.autoFocus)??!0,closeOnOutsidePointerDown:(r==null?void 0:r.closeOnOutsidePointerDown)??!1,...e.floating}:e.floating;return{...e,id:t,closeOnEscape:e.closeOnEscape??(r==null?void 0:r.closeOnEscape)??!0,closeOnBackdrop:e.mode==="dialog"?e.closeOnBackdrop??(r==null?void 0:r.closeOnBackdrop)??!0:!1,dialog:i,floating:o}},QF=function(e){var n;if("component"in e&&e.component!=null)return{component:e.component,props:e.props};if("render"in e&&typeof e.render=="function")return{render:e.render};const t=(n=Ae(this,py).call(this))==null?void 0:n.resolver;if(typeof t=="function"){const r=t(e);
622if(r!=null){if(r.type==="none")throw new Error(`SurfaceManager: resolver explicitly suppressed surface for kind "${e.kind}".`);if(r.type==="custom")return{component:r.component,props:r.props};if(r.type==="external")return{render:r.render}}}throw new Error(`SurfaceManager: no renderer resolved for kind "${e.kind}". Provide a resolver via surfaces.resolver, or use a direct-render request.`)},JF=function(e){return{id:(e==null?void 0:e.id)??`surface-${Ew(this,i2)._++}`,mode:(e==null?void 0:e.mode)??"dialog",close:()=>{},result:Promise.resolve({status:"destroyed"})}},qM),N0e="https://docs.superdoc.dev/guides/migration/document-api",H7=new Set;function M0e(e,t){H7.has(e)||(H7.add(e),console.warn(t))}var D0e={state:"editor.state",view:"editor.view",schema:"editor.schema",commands:"editor.commands",chain:"editor.chain()",can:"editor.can()",dispatch:"editor.dispatch()"},$7=Symbol.for("superdoc:rawEditor"),G7=new WeakMap;function q7(e){return!e||e[$7]?e:new Proxy(e,{get(t,n){if(n===$7)return t;const r=D0e[n];r&&M0e(`deprecated:${String(n)}`,`[SuperDoc] ${r} is deprecated and will be removed in a future version. Use the Document API (editor.doc) instead. See ${N0e}`);const i=Reflect.get(t,n,t);if(typeof i=="function"){let o=G7.get(t);return o||(o=new Map,G7.set(t,o)),o.has(n)||o.set(n,i.bind(t)),o.get(n)}return i}})}var W7=["review","original","final","off"],L0e=["original","markup","final"],P0e=["paired","independent"],K7=Symbol.for("@superdoc/trackChanges:normalized"),Y7=new Set;function W3(e,t){Y7.has(e)||(Y7.add(e),console.warn(`[SuperDoc] ${e} is deprecated — use ${t} instead.`))}function X7(e,t,n){return typeof e=="boolean"?e:typeof t=="boolean"?t:n}function B0e(e,t,n){return typeof e=="string"&&W7.includes(e)?e:typeof t=="string"&&W7.includes(t)?t:n}function j0e(e){return typeof e!="string"||!L0e.includes(e)?null:e}function F0e(e){return e==="markup"?"review":e}function z0e(e){return typeof e=="string"&&P0e.includes(e)?e:null}function U0e(e){return e==="grouped"?"paired":e==="separate"?"independent":null}function V0e(e){return e==="paired"?"grouped":"separate"}function Cu(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function K3(e){var T;const t=e[K7]===!0,n=Cu(e.viewing),r=j0e(n==null?void 0:n.trackedChanges);Cu(e.modules)||(e.modules={});const i=Cu(e.trackChanges),o=Cu(e.modules.trackChanges),s=Cu((T=e.layoutEngineOptions)==null?void 0:T.trackedChanges);t||(i&&Object.prototype.hasOwnProperty.call(i,"visible")&&W3("config.trackChanges.visible","config.viewing.trackedChanges"),o&&W3("config.modules.trackChanges","config.trackChanges for behavior and config.viewing.trackedChanges for viewing projection"),s&&W3("config.layoutEngineOptions.trackedChanges","config.viewing.trackedChanges for display and config.trackChanges.enabled for behavior"));const l=r?r==="markup":X7(i==null?void 0:i.visible,o==null?void 0:o.visible,!1),u=X7(i==null?void 0:i.enabled,o==null?void 0:o.enabled,typeof(s==null?void 0:s.enabled)=="boolean"?s.enabled:!0),d=U0e(i==null?void 0:i.replacementMode)??z0e(o==null?void 0:o.replacements)??"paired",f=Cu(i==null?void 0:i.authorColors)??Cu(o==null?void 0:o.authorColors),p=f||void 0,m=Cu(i==null?void 0:i.semanticColors)??Cu(o==null?void 0:o.semanticColors),y=m||void 0,b=e.documentMode==="viewing",k=b?l?"review":"original":"review",S=r?b?F0e(r):"review":B0e(o==null?void 0:o.mode,s==null?void 0:s.mode,k),x={visible:l,mode:S,enabled:u,replacements:d};return p&&(x.authorColors=p),y&&(x.semanticColors=y),e.modules.trackChanges=x,e.trackChanges={visible:l,enabled:u,replacementMode:V0e(d)},p&&(e.trackChanges.authorColors=p),y&&(e.trackChanges.semanticColors=y),Cu(e.layoutEngineOptions)||(e.layoutEngineOptions={}),e.layoutEngineOptions.trackedChanges={mode:S,enabled:u},typeof(n==null?void 0:n.comments)=="boolean"&&(Cu(e.comments)||(e.comments={}),e.comments.visible=n.comments),Object.defineProperty(e,K7,{value:!0,writable:!0,configurable:!0,enumerable:!1}),x}var WE=Object.freeze({id:null,name:"Default SuperDoc user",email:null});function H0e(e){return!e||typeof e!="object"?{...WE}:{...WE,...e}}var s_=Object.freeze({"font-family":"fontFamily","font-size":"fontSize",strikethrough:"strike","highlight-color":"highlight","text-color":"color","table-of-contents":"tableOfContents","page-number":"pageNumber","table-actions":"tableActions","text-align":"textAlign","bullet-list":"list","numbered-list":"numberedlist","indent-decrease":"indentleft","indent-increase":"indentright","line-height":"lineHeight","linked-style":"linkedStyles","measurement-unit":"measurementUnit","formatting-marks":"formattingMarks","copy-format":"copyFormat","clear-formatting":"clearFormatting","document-mode":"documentMode","track-changes-accept-selection":"acceptTrackedChangeBySelection","track-changes-reject-selection":"rejectTrackedChangeO
622nSelection"}),ez=Object.freeze({toolbar:!0,comments:!0,contextMenu:!0,loading:!0,search:!1,linkPopover:!1,ruler:!1,contentControls:!0}),$0e=Object.freeze(["left","center","right"]),G0e=Object.freeze({compact:32,default:80,wide:120});Object.freeze(Object.keys(ez));var Fs=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Z7(e,t){const n=e==null?void 0:e[t];return n===!1?!1:n===void 0?ez[t]:!0}function q0e(e,t){const n=e==null?void 0:e[t];return Fs(n)?n:{}}var Q7=Object.freeze(["level","readOnly","allowResolve","permissionResolver"]);function W0e(e){if(!Q7.some(n=>n in e))return e;const t={...e};for(const n of Q7)delete t[n];return t}function J7(e){const t={...e},n=qp(e.sections,e.customItems),r=qp(e.defaultItems,e.includeDefaultItems);return delete t.customItems,delete t.includeDefaultItems,bl(t,{sections:n,defaultItems:r})}var eN=Object.freeze({findPlaceholder:"findPlaceholder",findAriaLabel:"findAriaLabel",replacePlaceholder:"replacePlaceholder",replaceAriaLabel:"replaceAriaLabel",noResults:"noResultsLabel",previousMatchTitle:"previousMatchLabel",previousMatchAriaLabel:"previousMatchAriaLabel",nextMatchTitle:"nextMatchLabel",nextMatchAriaLabel:"nextMatchAriaLabel",closeTitle:"closeLabel",closeAriaLabel:"closeAriaLabel",replace:"replaceLabel",replaceAll:"replaceAllLabel",toggleReplaceTitle:"toggleReplaceLabel",toggleReplaceAriaLabel:"toggleReplaceAriaLabel",matchCase:"matchCaseLabel",matchCaseAriaLabel:"matchCaseAriaLabel",ignoreDiacritics:"ignoreDiacriticsLabel",ignoreDiacriticsAriaLabel:"ignoreDiacriticsAriaLabel",regex:"regexLabel",regexAriaLabel:"regexAriaLabel",invalidPattern:"invalidPatternLabel"});function K0e(e){return Fs(e)?Object.fromEntries(Object.entries(e).filter(([t,n])=>eN[t]!==void 0&&n!==void 0).map(([t,n])=>[eN[t],n])):{}}function tN(e){const t={...e};return delete t.strings,delete t.replaceControls,delete t.includeTrackedDeletions,bl(t,K0e(e.strings),{replaceEnabled:qp(e.replaceControls,e.replaceEnabled),includeDeletedText:qp(e.includeTrackedDeletions,e.includeDeletedText)})}var Y0e=Object.freeze({"text-color":"color","table-of-contents":"tableOfContents","page-number":"pageNumber","align-left":"alignLeft","align-right":"alignRight","align-center":"alignCenter","align-justify":"alignJustify","bullet-list":"bulletList","numbered-list":"numberedList","indent-decrease":"indentLeft","indent-increase":"indentRight","copy-format":"copyFormat","clear-formatting":"clearFormatting","track-changes-accept-selection":"trackChangesAccept","track-changes-reject-selection":"trackChangesReject","document-mode":"documentMode","document-mode-editing":"documentEditingMode","document-mode-suggesting":"documentSuggestingMode","document-mode-viewing":"documentViewingMode","highlight-color":"highlight","linked-style":"paintbrush","table-actions":"tableActions","split-cell":"splitCell","merge-cells":"mergeCells","insert-row-before":"addRowBefore","insert-row-after":"addRowAfter","insert-column-before":"addColumnBefore","insert-column-after":"addColumnAfter","delete-row":"deleteRow","delete-column":"deleteColumn","delete-table":"deleteTable","remove-borders":"deleteBorders","fix-tables":"fixTables","line-height":"lineHeight","formatting-marks":"formattingMarks"}),X0e=Object.freeze({"font-family":"fontFamily","font-size":"fontSize","highlight-color":"highlight","text-color":"color","table-of-contents":"tableOfContents","page-number":"pageNumber","table-actions":"tableActions","insert-row-before":"addRowBefore","insert-row-after":"addRowAfter","insert-column-before":"addColumnBefore","insert-column-after":"addColumnAfter","delete-row":"deleteRow","delete-column":"deleteColumn","delete-table":"deleteTable","remove-borders":"removeBorders","merge-cells":"mergeCells","split-cell":"splitCell","fix-tables":"fixTables","text-align":"textAlign","bullet-list":"bulletList","numbered-list":"numberedList","indent-decrease":"indentLeft","indent-increase":"indentRight","measurement-unit":"measurementUnit","track-changes-accept-selection":"trackChangesAccept","track-changes-reject-selection":"trackChangesReject","clear-formatting":"clearFormatting","copy-format":"copyFormat","line-height":"lineHeight","linked-style-label":"formatText","formatting-marks":"formattingMarks","document-mode-editing":"documentEditingMode","document-mode-suggesting":"documentSuggestingMode","document-mode-viewing":"documentViewingMode","document-mode-editing-description":"documentEditingModeDescription","document-mode-suggesting-description":"documentSuggestingModeDescription","document-mode-viewing-description":"documentViewingModeDescription","linked-style":"linkedStyles"});function a_(e,t){return t[e]??e}function Y3(e,t){if(!Fs(e))return;const n=Object.entries(e),r=n.filter(([o])=>t[o]===void 0),i=n.filter(([o])=>t[o]!==void 0);return Object.fromEntries([...r,...i].map(([o,s])=>[a_(o,t),s]))}function tz(e){return Array.isArray(e)?e.map(t=>a_(t,s_)):e}function nz(e){return Fs(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>
622[t,tz(n)])):e}function Z0e(e,t){if(!Fs(e)||!Array.isArray(t))return e;const n={...e};for(const r of t){if(!Fs(r))continue;const i=r.region??"center";n[i]===void 0&&(n[i]=[])}return n}var Q0e=Object.freeze({watermark:"center","page-number":"center","formatting-marks":"right","table-of-contents":"center"});function J0e(e,t){if(!Fs(e)||!Array.isArray(t))return e;const n=Object.fromEntries(Object.entries(e).map(([i,o])=>[i,Array.isArray(o)?[...o]:o])),r=new Set(Object.values(n).flatMap(i=>Array.isArray(i)?i:[]).map(i=>a_(i,s_)));for(const i of t){const o=a_(i,s_);if(r.has(o))continue;const s=Q0e[i];s&&(Array.isArray(n[s])||(n[s]=[]),n[s].push(i),r.add(o))}return n}function rz(e,t){return Z0e(J0e(e,t.includeItems),t.customItems)}function eye(e){return Array.isArray(e)?e.map(t=>{if(!Fs(t))return t;const{value:n,label:r,previewFamily:i}=t;return{key:n,value:n,label:r,...i?{props:{style:{fontFamily:i}}}:{}}}):e}function tye(e){return Array.isArray(e)?e.map(t=>{var o;if(!Fs(t)||typeof t.id!="string")return t;const n=t.size??"default",r=t.type==="separator"?void 0:G0e[n],i={...t,name:t.id,group:t.region,isNarrow:n==="compact",isWide:n==="wide",...r?{layoutWidth:r,style:{...t.style,width:`${r-2}px`}}:{}};return t.label&&(i.defaultLabel===void 0&&(i.defaultLabel=t.label),i.attributes={...t.attributes,ariaLabel:((o=t.attributes)==null?void 0:o.ariaLabel)??t.label}),t.type==="dropdown"&&Array.isArray(t.options)&&(i.options=t.options.map(s=>Fs(s)?{...s,key:s.value??s.id,value:s.value??s.id}:s),i.dropdownValueKey="value"),typeof t.onSelect=="function"&&(i.command=({item:s,argument:l,payload:u,...d})=>t.onSelect({...d,value:l})),delete i.id,delete i.region,delete i.size,delete i.onSelect,i}):e}function nye(e){const t={...e},n=qp(e.items,Fs(e.groups)?e.groups:void 0),r=Fs(e.items)&&Object.keys(e.items).length===0?{center:[]}:n,i=rz(r,e),o=i===void 0?e.groups:nz(i),s=Y3(e.icons,Y0e),l=bl(Y3(e.texts,{}),Y3(e.strings,X0e)),u=Array.isArray(e.includeItems)?new Set(e.includeItems):null,d=Fs(r)?new Set(Object.values(r).flatMap(f=>Array.isArray(f)?f:[])):new Set;return delete t.items,delete t.includeItems,delete t.overflow,delete t.responsiveTo,delete t.fontOptions,delete t.customItems,delete t.strings,bl(t,{groups:o,excludeItems:tz(e.excludeItems),icons:s,texts:l,hideButtons:e.overflow===void 0?e.hideButtons:e.overflow==="menu",responsiveToContainer:e.responsiveTo===void 0?e.responsiveToContainer:e.responsiveTo==="container",fonts:e.fontOptions===void 0?e.fonts:eye(e.fontOptions),customButtons:e.customItems===void 0?e.customButtons:tye(e.customItems),showFormattingMarksButton:u===null&&!d.has("formatting-marks")?e.showFormattingMarksButton:d.has("formatting-marks")||(u==null?void 0:u.has("formatting-marks")),showTableOfContentsButton:u===null&&!d.has("table-of-contents")?e.showTableOfContentsButton:d.has("table-of-contents")||(u==null?void 0:u.has("table-of-contents")),showWatermarkButton:d.has("watermark")||(u==null?void 0:u.has("watermark"))||!1,showPageNumberButton:d.has("page-number")||(u==null?void 0:u.has("page-number"))||!1})}function nN(e={}){var Z,L,W,U,q,Q,re,ne,J,ge,le,ve,Ee,st,At,yt;const t=e.ui,n=t===!1,r=Fs(t)?t:void 0,i=Ge=>!n&&Z7(r,Ge),o=Ge=>n?!1:(r==null?void 0:r[Ge])===void 0?void 0:Z7(r,Ge),s=Ge=>n?{}:q0e(r,Ge),l=n||o("ruler")===!1,u=n||o("linkPopover")===!1,d=u?void 0:qp(s("linkPopover").popoverResolver,(L=(Z=e.modules)==null?void 0:Z.links)==null?void 0:L.popoverResolver),f=o("contentControls")??(!n&&((U=(W=e.modules)==null?void 0:W.contentControls)==null?void 0:U.chrome)!=="none"),p=((Q=(q=e.modules)==null?void 0:q.contentControls)==null?void 0:Q.chrome)==="none"||(ne=(re=e.modules)==null?void 0:re.contentControls)==null?void 0:ne.chrome,m=s("toolbar"),y=nye(m),b=Fs(m.items),k=(J=e.modules)==null?void 0:J.toolbar,S=Fs(k)?k:{},x=((ge=e.modules)==null?void 0:ge.contextMenu)??((le=e.modules)==null?void 0:le.slashMenu),T=Fs(x)?x:{},C=(Ee=(ve=e.modules)==null?void 0:ve.surfaces)==null?void 0:Ee.findReplace,I=tN(Fs(C)?C:{}),D=Fs(S.groups)?nz(rz(S.groups,m)):S.groups,P=[y.groups,D],V=P.find(Fs),ee=P.find(Array.isArray),F=b?Object.keys(y.groups??{}):qp(ee,S.toolbarGroups,e.toolbarGroups),H=Array.isArray(F)?F:null,te=(Ge,Be)=>Object.prototype.hasOwnProperty.call(Ge,Be),M=V&&H?Object.fromEntries([...H.filter(Ge=>te(V,Ge)),...Object.keys(V).filter(Ge=>!$0e.includes(Ge))].map(Ge=>[Ge,V[Ge]])):V;return{enabled:!n,toolbar:{enabled:i("toolbar"),container:n?null:qp(y.container,S.selector,e.toolbar)??null,options:n?{}:{...bl(S,y),groups:M,toolbarGroups:F,icons:bl(e.toolbarIcons,S.icons,y.icons),texts:bl(e.toolbarTexts,S.texts,y.texts)}},comments:{enabled:o("comments")??(!n&&((st=e.modules)==null?void 0:st.comments)!==!1),options:n?{}:Pj(W0e(s("comments")))},contextMenu:{enabled:o("contextMenu")??(!n&&e.disableContextMenu!==!0),suppressed:n||o("contextMenu")===!1,options:n?{}:bl(J7(T),J7(s("contextMenu")))},loading:{enabled:i("loading")},search:{enabled:o("search")??(!n&&!!((yt=(At=e.modules)==null?void 0:At.surfaces)!=null&&yt.findReplace)),options:n?{}:bl(I,tN(s("search")))},linkPopover:{enabled:typeof d=="function",suppressed:u,options:bl(s("linkPopover"),{popoverResolver:d})},ruler:{enabled:o("ruler")??(!n&&!!e.rulers),suppressed:l,container:l?null:s("ruler").container??e.rulerContainer??null},contentControls:{enabled:f,options:f?bl({chrome:p},s("contentControls")):{chrome:"none"}}}}var gx=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),rye=e=>e==="read"||e==="write"||e==="resolve";function rN(e={}){var f;const t=gx(e.interaction)?e.interaction:{},n=gx(t.comments)?t.comments:{},r=gx(t.trackedChanges)?t.trackedChanges:{},i=gx((f=e.modules)==null?void 0:f.comments)?e.modules.comments:{}
622,o=(n.readOnly??i.readOnly??!1)===!0,s=(n.allowResolve??i.allowResolve??!0)!==!1,l=rye(n.level),u=l?n.level:o?"read":s?"resolve":"write",d=r.allowDecisions;return{comments:{level:u,readOnly:l?u==="read":o,allowResolve:l?u==="resolve":s},trackedChanges:{allowDecisions:typeof d=="boolean"?d:!o}}}var iN=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function oN(e={}){var i;const t=iN(e.surfaces)?e.surfaces:{},n=iN((i=e.modules)==null?void 0:i.surfaces)?e.modules.surfaces:{},r=t.resolver===void 0?n.resolver:t.resolver;return{resolver:typeof r=="function"?r:null,dialog:bl(n.dialog,t.dialog),floating:bl(n.floating,t.floating)}}var iye="https://docs.superdoc.dev/editor/fonts/";function oye(e){return e==="localhost"||e.endsWith(".localhost")||e==="0.0.0.0"||e==="::1"||e==="[::1]"||e.startsWith("127.")}function sye(e,t,n=typeof window>"u"?"":window.location.hostname){if(!oye(n)||!Array.isArray(e))return;const r=[...new Set(e.map(s=>s.trim()).filter(Boolean))].filter(s=>!t.has(s));if(r.length===0)return;for(const s of r)t.add(s);const i=r.length===1?"font":"fonts",o=r.map(s=>`"${s}"`).join(", ");console.warn(`[SuperDoc] Missing document ${i}: ${o}. The browser is using fallback fonts, which can change line and page breaks. Configure document fonts: ${iye}`)}var Xl,Qm,Jc,Jm,o2,KE,WM,aye=(WM=class{constructor(){Cn(this,o2);Cn(this,Xl,new Map);Cn(this,Qm,new Map);Cn(this,Jc,null);Cn(this,Jm,new Set)}register(e){if(Ae(this,Xl).has(e.id))throw new Error(`EditorRuntimeRegistry: duplicate runtime id "${e.id}"`);const t=e.root,n=t?Ae(this,Qm).get(t):void 0;if(n!==void 0&&n!==e.id)throw new Error(`EditorRuntimeRegistry: root element already registered to runtime "${n}"`);Ae(this,Xl).set(e.id,e),t&&Ae(this,Qm).set(t,e.id)}unregister(e){const t=Ae(this,Xl).get(e);return t?(Ae(this,Xl).delete(e),t.root&&Ae(this,Qm).delete(t.root),Ae(this,Jc)===e&&(Ot(this,Jc,null),Ye(this,o2,KE).call(this,{previousRuntimeId:e,nextRuntimeId:null,reason:"active-runtime-unregistered",legacyEditorProjection:null})),!0):!1}get(e){return Ae(this,Xl).get(e)??null}getAll(){return Array.from(Ae(this,Xl).values())}getAllByDocumentId(e){const t=[];for(const n of Ae(this,Xl).values())n.documentId===e&&t.push(n);return t}getActive(){return Ae(this,Jc)===null?null:Ae(this,Xl).get(Ae(this,Jc))}getActiveId(){return Ae(this,Jc)}setActive(e,t){var i,o;if(e!==null&&!Ae(this,Xl).has(e))throw new Error(`EditorRuntimeRegistry: cannot activate unknown runtime "${e}"`);
622if(e===Ae(this,Jc))return;const n=Ae(this,Jc);Ot(this,Jc,e);let r=null;e!==null&&(r=((o=(i=Ae(this,Xl).get(e)).getLegacyEditorProjection)==null?void 0:o.call(i))??null),Ye(this,o2,KE).call(this,{previousRuntimeId:n,nextRuntimeId:e,reason:t,legacyEditorProjection:r})}resolveFromEventTarget(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null;if(!t)return null;const n=t.closest(`[${i_}]`);if(!n)return null;const r=n.getAttribute(i_),i=r?this.get(r):null;return i&&i.root===n?i:null}subscribe(e){return Ae(this,Jm).add(e),()=>{Ae(this,Jm).delete(e)}}clear(){Ae(this,Xl).clear(),Ae(this,Qm).clear(),Ot(this,Jc,null),Ae(this,Jm).clear()}},Xl=new WeakMap,Qm=new WeakMap,Jc=new WeakMap,Jm=new WeakMap,o2=new WeakSet,KE=function(e){for(const t of Array.from(Ae(this,Jm)))try{t(e)}catch{}},WM),iz=[{name:"bold",commandId:"bold",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"italic",commandId:"italic",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"underline",commandId:"underline",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"strike",commandId:"strikethrough",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"clearFormatting",commandId:"clear-formatting",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"copyFormat",commandId:"copy-format",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"fontFamily",commandId:"font-family",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"fontSize",commandId:"font-size",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"color",commandId:"text-color",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"highlight",commandId:"highlight-color",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"textAlign",commandId:"text-align",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"list",commandId:"bullet-list",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"numberedlist",commandId:"numbered-list",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"indentleft",commandId:"indent-decrease",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"indentright",commandId:"indent-increase",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"lineHeight",commandId:"line-height",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"linkedStyles",commandId:"linked-style",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"link",commandId:"link",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"image",commandId:"image",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"watermark",commandId:null,instanceMethod:"ui.watermark.open",disposition:"host-routed",group:"center",note:"opens the shared Watermark dialog through superdoc.ui.watermark.open; the workflow owns scope, edit permissions, and apply"},{name:"pageNumber",commandId:"page-numbers-apply",instanceMethod:null,disposition:"controller-routed",group:"center",note:"opens the Page number popover: adds or changes the caret section numbers (position, first page, style, start) through page-numbers-apply, removes them through page-numbers-remove, or inserts at a header/footer cursor through page-number-insert"},{name:"table",commandId:"table-insert",instanceMethod:null,disposition:"controller-routed",group:"center"},{name:"tableActions",commandId:null,instanceMethod:null,disposition:"shell-owned",group:"center",memberCommandIds:["table-add-row-before","table-add-row-after","table-delete-row","table-add-column-before","table-add-column-after","table-delete-column","table-delete","table-merge-cells","table-split-cell","table-remove-borders"],note:"table editing dropdown is shell chrome; its member commands are controller-routed through the shared table-context facade (ui.tables / host.getTableContext()) and fail closed with table-context-unavailable when the caret is not in a table"},{name:"undo",commandId:"undo",instanceMethod:null,disposition:"controller-routed",group:"left"},{name:"redo",commandId:"redo",instanceMethod:null,disposition:"controller-routed",group:"left"},{name:"search",commandId:null,instanceMethod:null,disposition:"shell-owned",group:"right",note:"built-in search button; opens the shared find/replace surface (the same one Cmd/Ctrl+F opens) by emitting a `search:open` event on the SuperDoc instance, which the shell handles. The surface reads/drives the controller search surface (ui.search), backed by the single V2 host search session (host.search) which owns query, navigation, reveal, and replace. Find/navigation are always available when the host exposes search; replace/replaceAll mutate through the host session and fail closed (document-readonly) in viewing/read-only mode. If a runtime cannot expose search, the surface fails closed with search-unavailable"},{name:"zoom",commandId:"zoom",instanceMethod:null,disposition:"controller-routed",group:"right"},{name:"measurementUnit",commandId:"measurement-unit",instanceMethod:null,disposition:"controller-routed",group:"right"},{name:"ruler",commandId:null,instanceMethod:"toggleRuler",disposition:"host-routed",group:"right",note:"built-in shell toggles ruler visibility through the public SuperDoc.toggleRuler() instance method; the controller also routes the ruler command through it so custom UIs drive the same chrome (active state from config.rulers)"},{name:"formattingMarks",commandId:null,instanceMethod:"toggleFormattingMarks",disposition:"host-routed",group:"right",note:"built-in shell toggles n
622onprinting marks through the public SuperDoc.toggleFormattingMarks()/setShowFormattingMarks() instance methods (not a controller command)"},{name:"documentMode",commandId:"document-mode",instanceMethod:null,disposition:"controller-routed",group:"right"},{name:"acceptTrackedChangeBySelection",commandId:"track-changes-accept-selection",instanceMethod:null,disposition:"controller-routed",group:"right"},{name:"rejectTrackedChangeOnSelection",commandId:"track-changes-reject-selection",instanceMethod:null,disposition:"controller-routed",group:"right"},{name:"customButtons",commandId:null,instanceMethod:null,disposition:"shell-owned",group:"center",note:"consumer-defined buttons the rendered shell owns; their execution context surface is phase 2"}],oz=new Map(iz.map(e=>[e.name,e])),lye=iz.map(e=>e.name);function X3(e){return oz.get(e)??null}function cye(e){const t=oz.get(e);return(t==null?void 0:t.disposition)==="controller-routed"?t.commandId:null}var uye=(e,t)=>{let n=e.replace(/[^0-9.]/g,"");return n=parseFloat(n),isNaN(n)&&(n=t),n=parseFloat(n),n},dye=(e,t,n)=>{let r,i,o,s=0;n||(n={});const l=()=>{s=n.leading===!1?0:Date.now(),r=null,o=e(...i),r||(i=null)},u=(...d)=>{const f=Date.now();!s&&n.leading===!1&&(s=f);const p=t-(f-s);return i=d,p<=0||p>t?(r&&(clearTimeout(r),r=null),s=f,o=e(...d),r||(i=null)):!r&&n.trailing!==!1&&(r=setTimeout(l,p)),o};return u.cancel=function(){clearTimeout(r),s=0,r=i=null},u},fye={class:"sd-toolbar-icon"},hye=["innerHTML"],sN=li({__name:"ToolbarButtonIcon",props:{name:{type:String,required:!0},color:{type:String,default:null},icon:{type:String,default:null}},setup(e){const t=e,n=dt(()=>{if(t.name==="color")return{backgroundColor:t.color||"#111111"};if(t.name==="highlight")return{backgroundColor:t.color||"#D6D6D6"}}),r=dt(()=>["color","highlight"].includes(t.name));return(i,o)=>(Ze(),ut("div",fye,[et("div",{class:Wr(["sd-toolbar-icon__icon",[`sd-toolbar-icon__icon--${t.name}`]]),innerHTML:e.icon},null,10,hye),r.value?(Ze(),ut("div",{key:0,class:"color-bar",style:Ai(n.value)},null,4)):gn("",!0)]))}},[["__scopeId","data-v-65ecd5b1"]]),pye=["role","aria-label","aria-disabled"],mye=["data-item"],gye=["data-item"],yye={key:1,class:"sd-button-label"},vye=["data-item","aria-label"],bye=["innerHTML"],wye={key:2},xye=["onKeydown","id"],kye=["placeholder","onKeydown","id","data-item"],_ye=["data-item","innerHTML"],Cye={"aria-live":"polite",class:"sd-visually-hidden"},YE=li({__name:"ToolbarButton",props:{iconColor:{type:String,default:null},active:{type:Boolean,default:!1},isNarrow:{type:Boolean,default:!1},isWide:{type:Boolean,default:!1},toolbarItem:{type:Object,required:!0},defaultLabel:{type:String,default:null},isOverflowItem:{type:Boolean,default:!1},allowEnterPropagation:{type:Boolean,default:!1}},emits:["buttonClick","textSubmit","mainClick"],setup(e,{emit:t}){const n=t,{proxy:r}=fh(),i=e,{name:o,active:s,icon:l,label:u,hideLabel:d,iconColor:f,hasCaret:p,splitButton:m,disabled:y,expand:b,inlineTextInputVisible:k,hasInlineTextInput:S,minWidth:x,style:T,attributes:C}=i.toolbarItem,I=dt(()=>!!(m!=null&&m.value)&&!!(p!=null&&p.value)),D=dt(()=>(o==null?void 0:o.value)??""),P=Ne(""),V=Ne(null),{isHighContrastMode:ee}=cu();pr(()=>u==null?void 0:u.value,ve=>{document.activeElement!==V.value&&(P.value=ve==null?"":String(ve))},{immediate:!0});const F=()=>{S&&Sn(()=>{var ve,Ee;(ve=V.value)==null||ve.focus(),(Ee=V.value)==null||Ee.select()}),n("buttonClick")},H=ve=>{y!=null&&y.value||(ve==null||ve.stopPropagation(),n("mainClick"))},te=()=>{I.value||F()},M=ve=>{if(I.value){H(ve);return}F()},Z=ve=>{ve.preventDefault(),i.allowEnterPropagation||ve.stopPropagation(),M(ve)},L=ve=>{var yt,Ge,Be;const Ee=((Ge=(yt=i.toolbarItem)==null?void 0:yt.nestedOptions)==null?void 0:Ge.value)??[],st=ve.trim();if(!st)return"";const At=Ee.find(he=>typeof(he==null?void 0:he.label)=="string"&&he.label.toLowerCase()===st.toLowerCase());return At!=null&&At.label?At.label:((Be=Ee.find(he=>typeof(he==null?void 0:he.label)=="string"&&he.label.toLowerCase().startsWith(st.toLowerCase())))==null?void 0:Be.label)??st},W=()=>{const ve=String(P.value??"").trim();let Ee=ve;if(D.value==="fontSize"){const st=Number.parseFloat(ve);Ee=ve.match(/^\d+(\.5)?$/)?ve:Number.isFinite(st)?Math.floor(st).toString():""}else D.value==="fontFamily"&&(Ee=L(ve));return Ee?(n("textSubmit",Ee),P.value=Ee,!0):!1},U=ve=>{const Ee=ve==null?void 0:ve.currentTarget;Ee instanceof HTMLInputElement&&(Ee.focus({preventScroll:!0}),Ee.select())},q=ve=>{requestAnimationFrame(()=>{const Ee=document.getElementById(`inlineTextInput-${ve}`);Ee instanceof HTMLInputElement&&(Ee.focus({preventScroll:!0}),Ee.select())})},Q=()=>{const ve=document.querySelector('[role="textbox"][aria-label*="SuperDoc body"], .ProseMirror');return ve instanceof HTMLElement?(ve.focus({preventScroll:!0}),!0):!1},re=()=>{var st,At,yt;const ve=(st=r==null?void 0:r.$toolbar)==null?void 0:st.pendingSelectionCapture,Ee=()=>{var Ge,Be,he;ve&&typeof((he=(Be=(Ge=r==null?void 0:r.$toolbar)==null?void 0:Ge.ui)==null?void 0:Be.selection)==null?void 0:he.restore)=="function"&&r.$toolbar.ui.selection.restore(ve)};if(Q()){Ee();return}typeof((yt=(At=r==null?void 0:r.$toolbar)==null?void 0:At.superdoc)==null?void 0:yt.focus)=="function"&&(r.$toolbar.superdoc.focus(),Ee())},ne=()=>{W()&&re()},J=ve=>{if(W(),ve.shiftKey){D.value==="fontSize"&&(ve.preventDefault(),Sn(()=>q("fontFamily")));return}if(ve.preventDefault(),D.value==="fontFamily"){Sn(()=>q("fontSize"));return}D.value==="fontSize"&&Sn(re)},ge=dt(()=>T.value?T.value:{minWidth:i.minWidth}),le=dt(()=>b!=null&&b.value?bo.dropdownCaretUp:bo.dropdownCaretDown);return(ve,Ee)=>(Ze(),ut("div",{class:Wr(["sd-toolbar-item",Yt(C).className]),style:Ai(ge.value),role:e.isOverflowItem?"menuitem":"button","aria-label":Yt(C).ariaLabel,"aria-disabled":Yt(y)?"true":void 0,"data-sd-part":"toolbar-item",onClick:te,onKeydown:Ee[9]||(Ee[9]=Nd(st=>Z(st),["enter"])),tabindex:"0"},[et("div",{class:Wr(["sd-toolbar-button",{"sd-active":Yt(s),"sd-disabled":Yt(y),narrow:e.isNarrow,wide:e.isWide,split:I.value,"has-inline-text-input"
622:Yt(S),"high-contrast":Yt(ee)}]),"data-item":`btn-${Yt(o)||""}`},[I.value?(Ze(),ut("div",{key:0,class:"sd-toolbar-button__main","data-item":`btn-${Yt(o)||""}-main`,onClick:Ee[0]||(Ee[0]=st=>H(st))},[Yt(l)?(Ze(),ei(sN,{key:0,color:Yt(f),class:"sd-toolbar-icon",icon:Yt(l),name:Yt(o)},null,8,["color","icon","name"])):gn("",!0),Yt(u)&&!Yt(d)&&!Yt(k)?(Ze(),ut("div",yye,Un(Yt(u)),1)):gn("",!0)],8,gye)):gn("",!0),I.value?(Ze(),ut("div",{key:1,class:"sd-toolbar-button__caret","data-item":`btn-${Yt(o)||""}-caret`,"aria-label":`${Yt(C).ariaLabel} options`,role:"button"},[et("div",{class:"sd-dropdown-caret",innerHTML:le.value,style:Ai({opacity:Yt(y)?.6:1})},null,12,bye)],8,vye)):(Ze(),ut(Dr,{key:2},[Yt(l)?(Ze(),ei(sN,{key:0,color:Yt(f),class:"sd-toolbar-icon",icon:Yt(l),name:Yt(o)},null,8,["color","icon","name"])):gn("",!0),Yt(u)&&!Yt(d)&&(!Yt(k)||D.value==="fontFamily")?(Ze(),ut("div",{key:1,class:Wr(["sd-button-label",{"sd-visually-hidden":Yt(k)&&D.value==="fontFamily"}])},Un(Yt(u)),3)):gn("",!0),Yt(k)?(Ze(),ut("span",wye,[Yt(o)==="fontSize"?Lu((Ze(),ut("input",{key:0,"onUpdate:modelValue":Ee[1]||(Ee[1]=st=>P.value=st),onKeydown:[Nd(Gr(ne,["stop","prevent"]),["enter"]),Ee[2]||(Ee[2]=Nd(st=>J(st),["tab"]))],onClick:Ee[3]||(Ee[3]=Gr(st=>U(st),["stop"])),onFocus:Ee[4]||(Ee[4]=st=>U(st)),type:"text",class:Wr(["button-text-input button-text-input--font-size",{"high-contrast":Yt(ee)}]),id:"inlineTextInput-"+Yt(o),autocomplete:"off",ref_key:"inlineInput",ref:V},null,42,xye)),[[yg,P.value]]):Lu((Ze(),ut("input",{key:1,"onUpdate:modelValue":Ee[5]||(Ee[5]=st=>P.value=st),placeholder:Yt(u),onKeydown:[Nd(Gr(ne,["stop","prevent"]),["enter"]),Ee[6]||(Ee[6]=Nd(st=>J(st),["tab"]))],onClick:Ee[7]||(Ee[7]=Gr(st=>U(st),["stop"])),onFocus:Ee[8]||(Ee[8]=st=>U(st)),type:"text",class:Wr(["button-text-input",{"button-text-input--font-family":D.value==="fontFamily","high-contrast":Yt(ee)}]),id:"inlineTextInput-"+Yt(o),"data-item":D.value==="fontFamily"?`btn-${Yt(o)}-input`:void 0,autocomplete:"off",ref_key:"inlineInput",ref:V},null,42,kye)),[[yg,P.value]])])):gn("",!0),Yt(p)?(Ze(),ut("div",{key:3,class:"sd-dropdown-caret","data-item":`btn-${Yt(o)||""}-toggle`,innerHTML:le.value,style:Ai({opacity:Yt(y)?.6:1})},null,12,_ye)):gn("",!0)],64)),et("div",Cye,Un(`${Yt(C).ariaLabel} ${Yt(s)?"selected":"unset"}`),1)],10,mye)],46,pye))}},[["__scopeId","data-v-96796456"]]),Sye={class:"toolbar-separator",role:"separator","aria-label":"Toolbar separator"},Eye=li({__name:"ToolbarSeparator",props:{active:{type:Boolean,default:!1}},emits:["command"],setup(e,{emit:t}){const{isHighContrastMode:n}=cu(),r=()=>n.value?"#000":"var(--sd-ui-border, #dbdbdb)";return(i,o)=>(Ze(),ut("div",Sye,[et("div",{class:"separator-inner",style:Ai({backgroundColor:r()})},null,4)]))}},[["__scopeId","data-v-cb82253a"]]),Aye={class:"toolbar-dropdown"},Tye=["onClick"],Iye={key:0,class:"toolbar-dropdown-option__icon"},Rye={class:"toolbar-dropdown-option__label"},yx='button, [href], input, select, textarea, [role="button"], [tabindex]:not([tabindex="-1"])',sz=li({__name:"ToolbarDropdown",props:{options:{type:Array,default:()=>[]},show:{type:Boolean,required:!0},placement:{type:String,default:"bottom-start"},disabled:{type:Boolean,default:!1},contentStyle:{type:Object,default:()=>({})},menuProps:{type:Function,default:null},nodeProps:{type:Function,default:null},closeOnEscape:{type:Boolean,default:!0},hasOpenChild:{type:Boolean,default:!1}},emits:["update:show","select"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=vK(),s=Ne(null),l=Ne(null),u=Ne({top:"0px",left:"0px",maxHeight:"none"}),d=Ne([]),f=Ne(-1),p=dt(()=>!!r.show),m=Ne(document.fullscreenElement),y=dt(()=>p.value&&m.value?m.value:document.body),b=dt(()=>r.options.some(he=>(he==null?void 0:he.type)==="render")),k=dt(()=>!!o.menu),S=dt(()=>typeof r.menuProps!="function"?{}:r.menuProps()||{}),x=dt(()=>{const{class:he,style:Oe,...ye}=S.value;return ye}),T=dt(()=>["toolbar-dropdown-menu",S.value.class,{"toolbar-dropdown-menu--render-only":k.value||r.options.length>0&&r.options.every(he=>he&&he.type==="render")}]),C=dt(()=>{const he=S.value.style||{};return{...r.contentStyle,...he}}),I=dt(()=>
622({...C.value,position:"fixed",top:u.value.top,left:u.value.left,maxHeight:u.value.maxHeight,zIndex:2e3})),D=he=>{i("update:show",he)},P=()=>{p.value&&D(!1)},V=()=>{if(!s.value)return;const he=s.value.getBoundingClientRect(),Oe=l.value,ye=(Oe==null?void 0:Oe.offsetWidth)??0,B=(Oe==null?void 0:Oe.scrollHeight)??(Oe==null?void 0:Oe.offsetHeight)??0,be=window.innerWidth||document.documentElement.clientWidth||0,ie=window.innerHeight||document.documentElement.clientHeight||0,fe=8,ue=4,Ce=he.bottom+ue,Ue=he.top-ue,K=Math.max(0,ie-Ce-fe),oe=Math.max(0,Ue-fe),Fe=K<B&&oe>K,Le=Fe?oe:K,tt=Fe?Math.max(fe,Ue-(B?Math.min(B,Le):Le)):Ce;let De=he.left;r.placement==="bottom-end"&&(De=he.right-ye);const Pe=Math.max(fe,be-ye-fe);De=Math.min(Math.max(fe,De),Pe),u.value={top:`${tt}px`,left:`${De}px`,maxHeight:`${Le}px`}},ee=async()=>{m.value=document.fullscreenElement,p.value&&(await Sn(),V())},F=()=>{r.disabled||D(!p.value)},H=he=>typeof r.nodeProps!="function"?{}:r.nodeProps(he)||{},te=he=>{he!=null&&he.disabled||(he==null?void 0:he.type)!=="render"&&(i("select",he==null?void 0:he.key,he),P())},M=he=>(he==null?void 0:he.type)==="render",Z=he=>!(he!=null&&he.disabled)&&(he==null?void 0:he.type)!=="render",L=he=>typeof(he==null?void 0:he.icon)=="function"||!!(he!=null&&he.icon),W=he=>typeof(he==null?void 0:he.icon)=="function"?he.icon(he):(he==null?void 0:he.icon)||null,U=he=>he?typeof he=="string"?he.split(/\s+/).includes("sd-selected"):Array.isArray(he)?he.some(U):typeof he=="object"?!!he["sd-selected"]:!1:!1,q=he=>{var Oe;return U((Oe=he==null?void 0:he.props)==null?void 0:Oe.class)||U(he==null?void 0:he.class)},Q=()=>r.options.map((he,Oe)=>Z(he)?Oe:-1).filter(he=>he>=0),re=()=>{const he=r.options.findIndex(Oe=>Z(Oe)&&q(Oe));return he>=0?he:Q()[0]??-1},ne=(he,Oe)=>{if(!he){delete d.value[Oe];return}d.value[Oe]=he},J=()=>{var Oe;d.value.forEach((ye,B)=>{ye&&ye.setAttribute("tabindex",B===f.value?"0":"-1")});const he=d.value[f.value];he&&typeof he.focus=="function"&&(he.focus(),(Oe=he.scrollIntoView)==null||Oe.call(he,{block:"nearest",inline:"nearest"}))},ge=he=>{const Oe=Q();if(!Oe.length){f.value=-1;return}const ye=Oe.indexOf(f.value);if(ye<0){f.value=he>0?Oe[0]:Oe[Oe.length-1];return}const B=(ye+he+Oe.length)%Oe.length;f.value=Oe[B]},le=()=>{let he=r.options[f.value];if(!Z(he)){const Oe=Q()[0];he=Oe===void 0?null:r.options[Oe]}he&&te(he)},ve=m1({name:"ToolbarDropdownRenderOption",props:{option:{type:Object,required:!0}},setup(he){return()=>typeof he.option.render!="function"?null:he.option.render()}}),Ee=m1({name:"ToolbarDropdownOptionIcon",props:{option:{type:Object,required:!0}},setup(he){return()=>{const Oe=W(he.option);return typeof Oe=="string"?Ps("span",{innerHTML:Oe}):Oe}}}),st=he=>{var be,ie;if(!p.value)return;const Oe=he.target;if(!(Oe instanceof Element))return;const ye=(be=s.value)==null?void 0:be.contains(Oe),B=(ie=l.value)==null?void 0:ie.contains(Oe);ye||B||r.hasOpenChild&&Oe.closest('[data-sd-part="dropdown-menu"]')||P()},At=Ne(null),yt=()=>{var ye;const he=s.value,Oe=document.activeElement;if(he&&Oe instanceof HTMLElement&&he.contains(Oe)){At.value=Oe;return}At.value=(ye=he==null?void 0:he.matches)!=null&&ye.call(he,yx)?he:he==null?void 0:he.querySelector(yx)},Ge=()=>{var B;const he=At.value;if(he instanceof HTMLElement&&document.contains(he)){he.focus();return}const Oe=s.value;if(!Oe)return;const ye=(B=Oe.matches)!=null&&B.call(Oe,yx)?Oe:Oe.querySelector(yx);if(ye instanceof HTMLElement){ye.focus();return}Oe.setAttribute("tabindex","-1"),Oe.focus()};t({focusTrigger:Ge});const Be=he=>{if(!p.value)return;const{key:Oe}=he;if(["Escape","ArrowDown","ArrowUp","Enter"].includes(Oe)){if(Oe==="Escape"){if(!r.closeOnEscape)return;he.preventDefault(),P(),Sn(()=>{requestAnimationFrame(Ge)});return}if(!(b.value||k.value)){if(he.preventDefault(),Oe==="ArrowDown"){ge(1),J();return}if(Oe==="ArrowUp"){ge(-1),J();return}Oe==="Enter"&&le()}}};return pr(p,async he=>{if(!he){f.value=-1,d.value=[];return}yt(),await Sn(),V(),!(b.value||k.value)&&(f.value=re(),await Sn(),J())},{immediate:!0}),pr(p,he=>{he?(document.addEventListener("pointerdown",st,!0),document.addEventListener("keydown",Be,!0),window.addEventListener("resize",V),window.addEventListener("scroll",V,!0)):(document.removeEventListener("pointerdown",st,!0),document.removeEventListener("keydown",Be,!0),window.removeEventListener("resize",V),window.removeEventListener("scroll",V,!0))},{immediate:!0}),po(()=>{document.addEventListener("fullscreenchange",ee)}),Hs(()=>{document.removeEventListener("fullscreenchange",ee),document.removeEventListener("pointerdown",st,!0),document.removeEventListener("keydown",Be,!0),window.removeEventListener("resize",V),window.removeEventListener("scroll",V,!0)}),(he,Oe)=>(Ze(),ut("div",Aye,[et("div",{ref_key:"triggerRef",ref:s,class:"toolbar-dropdown-trigger","data-sd-part":"dropdown-trigger",onClick:F},[y1(he.$slots,"trigger",{},void 0,!0)],512),(Ze(),ei(Hy,{to:y.value},[wo(ND,{name:"fade-in-scale-up-transition"},{default:vl(()=>[p.value?(Ze(),ut("div",g1({key:0,ref_key:"menuRef",ref:l,"data-sd-part":"dropdown-menu",class:T.value,style:I.value},x.value),[k.value?y1(he.$slots,"menu",{key:0},void 0,!0):gn("",!0),(Ze(!0),ut(Dr,null,ki(k.value?[]:e.options,
622(ye,B)=>{var be;return Ze(),ut("div",g1({key:ye.key,ref_for:!0,ref:ie=>ne(ie,B),class:["toolbar-dropdown-option",[ye.class,(be=ye.props)==null?void 0:be.class,{"sd-disabled":ye.disabled,"sd-render":M(ye)}]],tabindex:"-1",onClick:ie=>te(ye)},{ref_for:!0},{...ye.props,...H(ye)}),[M(ye)?(Ze(),ei(Yt(ve),{key:0,option:ye},null,8,["option"])):(Ze(),ut(Dr,{key:1},[L(ye)?(Ze(),ut("span",Iye,[wo(Yt(Ee),{option:ye},null,8,["option"])])):gn("",!0),et("span",Rye,Un(ye.label),1)],64))],16,Tye)}),128))],16)):gn("",!0)]),_:3})],8,["to"]))]))}},[["__scopeId","data-v-fa3f6b69"]]),az=e=>{const t=e==null?void 0:e.target;t instanceof Element&&(t.closest('input, textarea, [contenteditable="true"]')||e.preventDefault())},Cp=(e,t=null)=>{var i,o;if(typeof(t==null?void 0:t.focus)=="function"){t.focus();return}const n=((i=e==null?void 0:e.superdoc)==null?void 0:i.focus)??((o=e==null?void 0:e.activeEditor)==null?void 0:o.focus);if(typeof n=="function"){n.call((e==null?void 0:e.superdoc)??(e==null?void 0:e.activeEditor),{preventScroll:!0});return}const r=document.querySelector('[role="textbox"][aria-label*="SuperDoc body"], .ProseMirror');r instanceof HTMLElement&&r.focus({preventScroll:!0})},Oye=li({__name:"OverflowMenu",props:{toolbarItem:{type:Object,required:!0},overflowItems:{type:Array,required:!0},uiFontFamily:{type:String,default:"Arial, Helvetica, sans-serif"}},emits:["buttonClick","close","command"],setup(e,{emit:t}){const n=t,r=e,i=Ne(null),o=dt(()=>r.toolbarItem.expand.value),s=dt(()=>r.overflowItems.some(f=>f.type==="dropdown"&&Yt(f.expand))),l=dt(()=>({...r.toolbarItem,active:o.value})),u=f=>{if(f!==o.value){if(f){n("buttonClick",r.toolbarItem);return}n("close")}},d=({item:f,argument:p,option:m})=>{var y;f.name.value==="watermark"&&(n("close"),(y=i.value)==null||y.focusTrigger()),n("command",{item:f,argument:p,option:m})};return(f,p)=>(Ze(),ei(sz,{ref_key:"dropdown",ref:i,class:"overflow-menu","close-on-escape":!s.value,"has-open-child":s.value,"content-style":{width:"200px",padding:"4px 8px",fontFamily:r.uiFontFamily},options:[],placement:"bottom-end",show:o.value,"onUpdate:show":u,"menu-props":()=>({role:"group",class:["overflow-menu_items","sd-toolbar-overflow-menu"]})},{trigger:vl(()=>[wo(YE,{"toolbar-item":l.value,"allow-enter-propagation":!0},null,8,["toolbar-item"])]),menu:vl(()=>[wo(Jx,{class:"superdoc-toolbar-overflow","toolbar-items":e.overflowItems,"ui-font-family":r.uiFontFamily,"from-overflow":"",onMousedown:Yt(az),onCommand:d},null,8,["toolbar-items","ui-font-family","onMousedown"])]),_:1},8,["close-on-escape","has-open-child","content-style","show"]))}},[["__scopeId","data-v-1227fcf9"]]),aN=e=>String(e??"").trim().toLowerCase(),Qx=(e,t)=>{const n=aN(e);if(!n)return-1;for(let r=0;r<t.length;r+=1)if(aN(t[r]).startsWith(n))return r;return-1},Nye=(e,t,{autocomplete:n=!0}={})=>{const r=String(e??""),i=Qx(r,t),o=i>=0?String(t[i]??""):"";return n&&i>=0&&o.length>r.length?{matchIndex:i,display:o,selectionStart:r.length,selectionEnd:o.length}:{matchIndex:i,display:r,selectionStart:r.length,selectionEnd:r.length}},Mye=e=>{let t=String(e??"").trim();for(;t.length>=2&&(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"));)t=t.slice(1,-1).trim();return t},Dye=e=>e<=31||e===127,Lye=e=>e===32||e===160||e===65279,Pye=e=>Array.from(String(e)).filter(t=>!Dye(t.charCodeAt(0))).join(""),Bye=e=>{let t="",n=!1;for(const r of String(e)){if(Lye(r.charCodeAt(0))){n=t.length>0;continue}n&&(t+=" "),n=!1,t+=r}return t},jye=e=>Bye(Mye(Pye(String(e??"").split(",")[0]??""))).trim(),Fye=1,zye=1638,Uye=e=>{const t=String(e??"").replace(/[^0-9.-]/g,""),n=Number.parseFloat(t);if(!Number.isFinite(n))return"";const r=Math.round(n*2)/2;return r<Fye?"":String(Math.min(r,zye))},Vye=["data-item"],Hye=["id","value","disabled","aria-label","aria-expanded","aria-controls","aria-activedescendant","data-item"],$ye=["data-item","aria-label","disabled"],Gye=["innerHTML"],qye=["id","aria-label"],Wye=["id","aria-selected","aria-label","onMousedown","onMouseenter"],Kye={class:"toolbar-dropdown-option__label"},Yye={class:"sd-button-label sd-font-combobox__legacy-label","aria-hidden":"true"},lz=li({__name:"ToolbarComboBox",props:{item:{type:Object,required:!0},uiFontFamily:{type:String,default:"Arial, Helvetica, sans-serif"},showPreview:{type:Boolean,default:!1},normalizeValue:{type:Function,default:e=>String(e??"").trim()}},emits:["command","item-clicked","tab-out","editor-handoff"],setup(e,{emit:t}){const n=e,r=t,{isHighContrastMode:i}=cu(),o=Ne(null),s=Ne(null),l=Ne(null),u=Ne([]),d=Ne(!1),f=Ne(!1),p=Ne(-1),m=Ne(""),y=Ne(""),b=Ne(!1),k=Ne({top:"0px",left:"0px",minWidth:"0px",maxHeight:"none"}),S=dt(()=>{var K;return((K=n.item.nestedOptions)==null?void 0:K.value)??[]}),x=dt(()=>S.value.map(K=>String((K==null?void 0:K.label)??""))),T=dt(()=>{var K;return String(((K=n.item.label)==null?void 0:K.value)??"")}),C=dt(()=>{var K;return!!((K=n.item.disabled)!=null&&K.value)}),I=dt(()=>{var K;return String(((K=n.item.name)==null?void 0:K.value)??"")}),D=dt(()=>{var K,oe;return((oe=(K=n.item.attributes)==null?void 0:K.value)==null?void 0:oe.ariaLabel)??"Font family"}),P=dt(()=>d.value?y.value:T.value),V=dt(()=>{var K;return`sd-${I.value||"combobox"}-listbox-${((K=n.item.id)==null?void 0:K.value)??"default"}`}),ee=K=>`${V.value}-option-${K}`,F=dt(()=>f.value&&p.value>=0?ee(p.value):void 0),H=dt(()=>f.value?bo.dropdownCaretUp:bo.dropdownCaretDown),te=K=>{var Fe,Le,tt;const oe=String(K??"").trim().toLowerCase();return((tt=(Le=(Fe=S.value.find(De=>String((De==null?void 0:De.label)??"").trim().toLowerCase()===oe))==null?void 0:Fe.props)==null?void 0:Le.style)==null?void 0:tt.fontFamily)||K||n.uiFontFamily},M=dt(()=>n.showPreview?{fontFamily:te(d.value?y.value:T.value)}:{fontFamily:n.uiFontFamily}),Z=()=>{var oe;const K=(oe=n.item.selectedValue)==null?void 0:oe.value;if(K){const Fe=S.value.findIndex(Le=>(Le==null?void 0:Le.key)===K);if(Fe>=0)return Fe}return x.value.findIndex(Fe=>Fe.toLowerCase()===T.value.toLowerCase())},L=(K,oe)=>{const Fe=o.value;if(!(!Fe||typeof Fe.setSelectionRange!="function"))try{Fe.setSelectionRange(K,oe)}catch{}},W=()=>{var K,oe;(oe=(K=u.value[p.value])==null?void 0:K.scrollIntoView)==null||oe.call(K,{block:"nearest",inline:"nearest"})},U=()=>{var K,oe;(oe=(K=u.value[p.value])==null?void 0:K.focus)==null||oe.call(K)},q=()=>{const K=s.value;if(!K)return;const oe=K.getBoundingClientRect(),Fe=l.value,Le=(Fe==null?void 0:Fe.scrollHeight)??(Fe==null?void 0:Fe.offsetHeight)??0,tt=window.innerHeight||document.documentElement.clientHeight||0,De=window.innerWidth||document.documentElement.clientWidth||0,Pe=8,mt=4,xt=oe.bottom+mt,de=oe.top-mt,z=Math.max(0,tt-xt-Pe),Y=Math.max(0,de-Pe),me=z<Le&&Y>z,Ve=me?Y:z,lt=me?Math.max(Pe,de-(Le?Math.min(Le,Ve):Ve)):xt,gt=Math.min(Math.max(Pe,oe.left),Math.max(Pe,De-oe.width-Pe));k.value={top:`${lt}px`,left:`${gt}px`,minWidth:`${oe.width}px`,maxHeight:`${Ve}px`}},Q=dt(()=>
622({position:"fixed",top:k.value.top,left:k.value.left,minWidth:k.value.minWidth,maxHeight:k.value.maxHeight,fontFamily:n.uiFontFamily,zIndex:2e3})),re=K=>{n.item.expand&&typeof n.item.expand=="object"&&"value"in n.item.expand&&(n.item.expand.value=K)},ne=(K,{focusInput:oe=!1,focusOption:Fe=!1}={})=>{var Le;if(C.value||!S.value.length){re(!1);return}f.value=!0,re(!0),p.value=K??-1,oe&&(d.value=!0,y.value=T.value,(Le=o.value)==null||Le.focus()),Sn(()=>{q(),W(),Fe&&U()})},J=({syncItem:K=!0}={})=>{f.value=!1,p.value=-1,K&&re(!1)},ge=()=>{J(),d.value=!1,m.value="",y.value=T.value},le=()=>{C.value||(f.value||r("item-clicked"),d.value=!0,m.value="",y.value=T.value,Sn(()=>L(0,y.value.length)))},ve=K=>{var Fe;if(C.value)return;const oe=document.activeElement===o.value;if(r("item-clicked"),d.value=!0,oe||(m.value="",y.value=T.value,K.preventDefault(),(Fe=o.value)==null||Fe.focus({preventScroll:!0}),L(0,T.value.length)),!f.value){const Le=Z();ne(Le>=0?Le:0)}},Ee=K=>{var Fe,Le;const oe=K.relatedTarget;oe instanceof Node&&((Fe=s.value)!=null&&Fe.contains(oe))||oe instanceof Node&&((Le=l.value)!=null&&Le.contains(oe))||ge()},st=K=>{if(b.value)return;const oe=K.target,Fe=oe.value,Le=typeof oe.selectionStart=="number"?oe.selectionStart:Fe.length,tt=typeof oe.selectionEnd=="number"?oe.selectionEnd:Le,De=typeof K.inputType=="string"&&K.inputType.startsWith("delete"),Pe=Le===Fe.length&&tt===Fe.length;m.value=Fe;const mt=Nye(Fe,x.value,{autocomplete:!De&&Pe});y.value=mt.display,oe.value=mt.display,mt.display===Fe&&!Pe?L(Le,tt):L(mt.selectionStart,mt.selectionEnd),f.value&&(p.value=mt.matchIndex,Sn(W))},At=K=>{b.value=!1,st(K)},yt=K=>{if(!S.value.length)return;const oe=S.value.length,Fe=p.value<0?K>0?-1:0:p.value;p.value=(Fe+K+oe)%oe,Sn(W)},Ge=(K,oe)=>{r("item-clicked"),r("command",{item:n.item,argument:K,option:oe}),oe&&(n.item.selectedValue.value=oe.key)},Be=K=>{K&&(Ge(K.value??K.label,K),d.value=!1,m.value="",y.value=K.label,J())},he=()=>{if(f.value&&p.value>=0)return Be(S.value[p.value]),!0;const K=Qx(m.value,x.value);if(K>=0)return Be(S.value[K]),!0;const oe=n.normalizeValue(m.value);return oe?(Ge(oe,null),d.value=!1,m.value="",y.value=oe,J(),!0):!1},Oe=K=>{var oe,Fe;if(!(K.isComposing||b.value||K.keyCode===229)&&!(K.ctrlKey||K.metaKey||K.altKey))switch(K.key){case"ArrowDown":if(K.preventDefault(),f.value)U();else{const Le=Qx(m.value,x.value),tt=Le>=0?Le:Z();ne(tt>=0?tt:0,{focusOption:!0})}break;case"ArrowUp":if(K.preventDefault(),f.value)U();else{const Le=Qx(m.value,x.value),tt=Le>=0?Le:Z();ne(tt>=0?tt:S.value.length-1,{focusOption:!0})}break;case"Enter":K.preventDefault(),he()&&r("editor-handoff"),(oe=o.value)==null||oe.blur();break;case"Tab":K.preventDefault(),he(),J(),(Fe=o.value)==null||Fe.blur(),r("tab-out",K);break;case"Escape":K.preventDefault(),ge(),Sn(()=>{var Le;return(Le=o.value)==null?void 0:Le.focus()});break}},ye=K=>{var oe;if(K.preventDefault(),!C.value)if(r("item-clicked"),f.value)J(),(oe=o.value)==null||oe.focus();else{const Fe=Z();ne(Fe>=0?Fe:0,{focusOption:!0})}},B=(K,oe)=>{var Fe;K.preventDefault(),Be(oe),r("editor-handoff"),(Fe=o.value)==null||Fe.blur()},be=K=>{p.value=K},ie=K=>{if(!(K.ctrlKey||K.metaKey||K.altKey))switch(K.key){case"ArrowDown":K.preventDefault(),yt(1),U();break;case"ArrowUp":K.preventDefault(),yt(-1),U();break;case"Enter":K.preventDefault(),p.value>=0&&(Be(S.value[p.value]),r("editor-handoff"));break;case"Escape":K.preventDefault(),ge(),Sn(()=>{var oe;return(oe=o.value)==null?void 0:oe.focus()});break;case"Tab":K.preventDefault(),p.value>=0?Be(S.value[p.value]):J(),r("tab-out",{shiftKey:K.shiftKey,target:o.value});break}},fe=K=>{var Fe,Le;if(!f.value)return;const oe=K.target;oe instanceof Element&&((Fe=s.value)!=null&&Fe.contains(oe)||(Le=l.value)!=null&&Le.contains(oe)||ge())};pr(f,K=>{K?(document.addEventListener("pointerdown",fe,!0),window.addEventListener("resize",q),window.addEventListener("scroll",q,!0)):(document.removeEventListener("pointerdown",fe,!0),window.removeEventListener("resize",q),window.removeEventListener("scroll",q,!0),u.value=[])},{immediate:!0}),Hs(()=>{document.removeEventListener("pointerdown",fe,!0),window.removeEventListener("resize",q),window.removeEventListener("scroll",q,!0)});const ue=(K,oe)=>{if(!K){delete u.value[oe];return}u.value[oe]=K},Ce=K=>K===p.value,Ue=K=>{var oe;return(K==null?void 0:K.key)&&K.key===((oe=n.item.selectedValue)==null?void 0:oe.value)};return pr(T,K=>{d.value||(y.value=K)}),pr(()=>{var K;return!!((K=n.item.expand)!=null&&K.value)},K=>
622{if(K&&!f.value){const oe=Z();ne(oe>=0?oe:0,{focusInput:!0});return}!K&&f.value&&J({syncItem:!1})}),(K,oe)=>{var Fe;return Ze(),ut("div",{ref_key:"rootRef",ref:s,class:Wr(["sd-font-combobox sd-toolbar-split-field",{"sd-disabled":C.value,"high-contrast":Yt(i)}]),style:Ai((Fe=n.item.style)==null?void 0:Fe.value),"data-item":`btn-${I.value}`},[et("span",{class:"sd-font-combobox__field sd-toolbar-split-field__main",onMousedown:ve},[et("input",{ref_key:"inputRef",ref:o,id:`inlineTextInput-${I.value}`,class:"button-text-input sd-font-combobox__input",type:"text",role:"combobox",autocomplete:"off",spellcheck:"false",value:P.value,style:Ai(M.value),disabled:C.value,"aria-label":D.value,"aria-expanded":f.value?"true":"false","aria-controls":V.value,"aria-activedescendant":F.value,"aria-haspopup":"listbox","aria-autocomplete":"both","data-item":`btn-${I.value}-input`,onFocus:le,onBlur:Ee,onInput:st,onKeydown:Oe,onCompositionstart:oe[0]||(oe[0]=Le=>b.value=!0),onCompositionend:At},null,44,Hye)],32),et("button",{type:"button",class:"sd-font-combobox__caret sd-toolbar-split-field__caret","data-item":`btn-${I.value}-toggle`,tabindex:"-1","aria-label":`${D.value} options`,disabled:C.value,onMousedown:ye},[et("span",{class:"sd-dropdown-caret",innerHTML:H.value},null,8,Gye)],40,$ye),(Ze(),ei(Hy,{to:"body"},[f.value?(Ze(),ut("div",{key:0,ref_key:"popupRef",ref:l,role:"listbox",id:V.value,"aria-label":D.value,class:Wr(["sd-font-combobox__listbox",{"high-contrast":Yt(i)}]),style:Ai(Q.value)},[(Ze(!0),ut(Dr,null,ki(S.value,(Le,tt)=>(Ze(),ut("div",g1({key:Le.key,ref_for:!0,ref:De=>ue(De,tt),id:ee(tt),role:"option",tabindex:"-1",class:["toolbar-dropdown-option sd-font-combobox__option",{"sd-active":Ce(tt),"sd-selected":Ue(Le)}],"aria-selected":Ue(Le)?"true":"false","aria-label":`${D.value} - ${Le.label}`},{ref_for:!0},Le.props,{onMousedown:De=>B(De,Le),onMouseenter:De=>be(tt),onKeydown:ie}),[et("span",Kye,Un(Le.label),1)],16,Wye))),128))],14,qye)):gn("",!0)])),et("span",Yye,Un(T.value),1)],14,Vye)}}},[["__scopeId","data-v-53e0af20"]]),Xye={__name:"FontFamilyCombobox",props:{item:{type:Object,required:!0},uiFontFamily:{type:String,default:"Arial, Helvetica, sans-serif"}},emits:["command","item-clicked","tab-out","editor-handoff"],setup(e,{emit:t}){const n=e,r=t;return(i,o)=>(Ze(),ei(lz,{item:n.item,"ui-font-family":n.uiFontFamily,"show-preview":!0,"normalize-value":Yt(jye),onCommand:o[0]||(o[0]=s=>r("command",s)),onItemClicked:o[1]||(o[1]=s=>r("item-clicked")),onTabOut:o[2]||(o[2]=s=>r("tab-out",s)),onEditorHandoff:o[3]||(o[3]=s=>r("editor-handoff"))},null,8,["item","ui-font-family","normalize-value"]))}},Zye={__name:"FontSizeCombobox",props:{item:{type:Object,required:!0},uiFontFamily:{type:String,default:"Arial, Helvetica, sans-serif"}},emits:["command","item-clicked","tab-out","editor-handoff"],setup(e,{emit:t}){const n=e,r=t;return(i,o)=>(Ze(),ei(lz,{item:n.item,"ui-font-family":n.uiFontFamily,"show-preview":!1,"normalize-value":Yt(Uye),onCommand:o[0]||(o[0]=s=>r("command",s)),onItemClicked:o[1]||(o[1]=s=>r("item-clicked")),onTabOut:o[2]||(o[2]=s=>r("tab-out",s)),onEditorHandoff:o[3]||(o[3]=s=>r("editor-handoff"))},null,8,["item","ui-font-family","normalize-value"]))}},Qye=["data-placement"],Jye=2500,vx=li(Object.assign({inheritAttrs:!1},{__name:"SdTooltip",props:{trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},disabled:{type:Boolean,default:!1},contentStyle:{type:Object,default:()=>({})}},setup(e){const t=e,n=yK(),r=Ne(!1),i=Ne(null),o=Ne(null),s=Ne({top:"0px",left:"0px"}),l=Ne("top");let u=null,d=null,f=null;const p=dt(()=>["sd-tooltip-content",n.class]),m=dt(()=>({...t.contentStyle,...n.style||{},position:"fixed",top:s.value.top,left:s.value.left,zIndex:2100})),y=()=>{u&&(window.clearTimeout(u),u=null)},b=()=>{d&&(window.clearTimeout(d),d=null)},k=()=>{f&&(window.clearTimeout(f),f=null)},S=()=>{k(),f=window.setTimeout(()=>{f=null,I()},Jye)},x=(M,Z)=>{const L=window.getComputedStyle(M),W=parseFloat(L[Z]);return Number.isFinite(W)?L.boxSizing==="border-box"?W:(Z==="width"?["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"]:["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"]).reduce((U,q)=>U+(parseFloat(L[q])||0),W):Z==="width"?M.offsetWidth:M.offsetHeight},T=()=>{if(!i.value||!o.value)return;const M=i.value.getBoundingClientRect(),Z=x(o.value,"width"),L=x(o.value,"height"),W=window.innerWidth||document.documentElement.clientWidth||0,U=document.documentElement.clientHeight||window.innerHeight||0,q=8,Q=10;let re=M.left+M.width/2-Z/2;re=Math.max(q,Math.min(re,W-Z-q));
622const ne=M.top-L-Q,J=M.bottom+Q,ge=ne>=q,le=J+L<=U-q,ve=M.top-Q,Ee=U-M.bottom-Q;ge?l.value="top":le?l.value="bottom":l.value=ve>=Ee?"top":"bottom";const st=l.value==="top"?ne:J,At=Math.min(q,Math.max(0,U-L)),yt=Math.max(At,U-L-q);s.value={top:`${Math.max(At,Math.min(st,yt))}px`,left:`${re}px`}},C=async()=>{t.disabled||(y(),b(),!r.value&&(r.value=!0,S(),await Sn(),T()))},I=()=>{b(),y(),k(),r.value&&(r.value=!1)},D=()=>{if(y(),b(),!r.value){if(t.delay===0){C();return}d=window.setTimeout(()=>{d=null,C()},t.delay)}},P=()=>{if(b(),y(),!!r.value){if(t.duration===0){I();return}u=window.setTimeout(()=>{u=null,I()},t.duration)}},V=()=>{t.trigger==="hover"&&D()},ee=()=>{t.trigger==="hover"&&P()},F=()=>{b(),y()},H=()=>{P()},te=M=>{M.key==="Escape"&&I()};return pr(()=>t.disabled,M=>{M&&I()}),pr(r,M=>{M?(window.addEventListener("resize",T),window.addEventListener("scroll",T,!0),document.addEventListener("keydown",te,!0)):(window.removeEventListener("resize",T),window.removeEventListener("scroll",T,!0),document.removeEventListener("keydown",te,!0))}),Hs(()=>{b(),y(),k(),window.removeEventListener("resize",T),window.removeEventListener("scroll",T,!0),document.removeEventListener("keydown",te,!0)}),(M,Z)=>(Ze(),ut(Dr,null,[et("span",{ref_key:"triggerRef",ref:i,class:"sd-tooltip-trigger",onMouseenter:V,onMouseleave:ee,onFocusin:V,onFocusout:ee},[y1(M.$slots,"trigger",{},void 0,!0)],544),(Ze(),ei(Hy,{to:"body"},[wo(ND,{name:"fade-in-scale-up-transition"},{default:vl(()=>[r.value&&!e.disabled?(Ze(),ut("div",{key:0,ref_key:"contentRef",ref:o,class:Wr(p.value),style:Ai(m.value),"data-placement":l.value,onMouseenter:F,onMouseleave:H},[Z[0]||(Z[0]=et("span",{class:"sd-tooltip-arrow","aria-hidden":"true"},null,-1)),y1(M.$slots,"default",{},void 0,!0)],46,Qye)):gn("",!0)]),_:3})]))],64))}}),[["__scopeId","data-v-88d296cd"]]),eve=["onKeydown","tabindex","data-item-id"],tve={key:0},nve={key:0},rve={key:0},ive={key:0},ove={key:0},Jx=li({__name:"ButtonGroup",props:{toolbarItems:{type:Array,required:!0},overflowItems:{type:Array,default:()=>[]},uiFontFamily:{type:String,default:"Arial, Helvetica, sans-serif"},position:{type:String,default:"left"},fromOverflow:{type:Boolean,default:!1},compactSideGroups:{type:Boolean,default:!1}},emits:["command","item-clicked","dropdown-update-show"],setup(e,{emit:t}){const n=t,{proxy:r}=fh(),i=Ne([]),o=Ne(null),s=e,l=Ne(null),{isHighContrastMode:u}=cu(),d=window.matchMedia("(max-width: 768px)").matches,f=dt(()=>s.position==="left"?{minWidth:s.compactSideGroups?"auto":"120px",justifyContent:"flex-start"}:s.position==="right"?{minWidth:s.compactSideGroups?"auto":"120px",justifyContent:"flex-end"}:{flexGrow:d?0:1,justifyContent:"center"}),p=Be=>Be.type==="button",m=Be=>Be.type==="dropdown",y=Be=>{var he;return Be.type==="dropdown"&&((he=Be.name)==null?void 0:he.value)==="fontFamily"},b=Be=>{var he;return Be.type==="dropdown"&&((he=Be.name)==null?void 0:he.value)==="fontSize"},k=Be=>Be.type==="separator",S=Be=>Be.type==="overflow",x=Be=>{var he,Oe;return!!((Oe=(he=Be.nestedOptions)==null?void 0:he.value)!=null&&Oe.length)},T=Be=>{if(!Be)return!1;const he=Be.expand;return typeof he=="object"&&he!==null&&"value"in he?!!he.value:!!he},C=(Be,he)=>{Be!=null&&Be.expand&&(Be.expand.value=he)},I=(Be,he=void 0)=>{var ye;if(Be.disabled.value)return;if(S(Be)){const B=!T(Be);B&&V(),C(Be,B),l.value=B?Be:null,n("item-clicked");return}if(m(Be))return;l.value&&m(l.value)&&T(l.value)&&V(),n("item-clicked");const Oe=he!==void 0?he:(ye=Be.argument)==null?void 0:ye.value;n("command",Oe===void 0?{item:Be}:{item:Be,argument:Oe})},D=(Be,he)=>{Be.disabled.value||(l.value=null,n("command",{item:Be,argument:he}))},P=Be=>{if(Be.disabled.value)return;V();const he=Be.splitButtonCommand,Oe=Be.command,ye=he||Oe;if(!ye)return;const B={...Be,command:ye};n("item-clicked"),n("command",{item:B})},V=()=>{var ye,B;const Be=((ye=r==null?void 0:r.$toolbar)==null?void 0:ye.toolbarItems)||[],he=((B=r==null?void 0:r.$toolbar)==null?void 0:B.overflowItems)||[],Oe=[...Be,...he];(Oe.length?Oe:s.toolbarItems).forEach(be=>{const ie=S(be)&&!s.fromOverflow;(m(be)||ie)&&C(be,!1)}),l.value=null},ee=(Be,he)=>{V();const Oe=Be.dropdownValueKey.value?he[Be.dropdownValueKey.value]:he.label;n("command",{item:Be,argument:Oe,option:he}),Be.selectedValue.value=he.key,Be.restoreEditorFocus&&Cp(r==null?void 0:r.$toolbar)},F=Be=>{n("command",Be)},H=()=>{V(),n("item-clicked")},te=()=>{const Be=document.querySelector('[role="textbox"][aria-label*="SuperDoc body"], .ProseMirror');return Be instanceof HTMLElement?(Be.focus({preventScroll:!0}),!0):!1},M=()=>{var Oe,ye,B;const Be=(Oe=r==null?void 0:r.$toolbar)==null?void 0:Oe.pendingSelectionCapture,he=()=>{var be,ie,fe;
622Be&&typeof((fe=(ie=(be=r==null?void 0:r.$toolbar)==null?void 0:be.ui)==null?void 0:ie.selection)==null?void 0:fe.restore)=="function"&&r.$toolbar.ui.selection.restore(Be)};if(te()){he();return}typeof((B=(ye=r==null?void 0:r.$toolbar)==null?void 0:ye.superdoc)==null?void 0:B.focus)=="function"&&(r.$toolbar.superdoc.focus(),he())},Z=Be=>!(Be instanceof HTMLElement)||Be.classList.contains("sd-disabled")?null:Be.querySelector("input:not([disabled]), textarea:not([disabled]), select:not([disabled])")||Be.querySelector('button:not([disabled]), [role="button"]:not(.sd-disabled), [tabindex]:not([tabindex="-1"])'),L=(Be,he)=>{var B,be;const Oe=(be=(B=Be==null?void 0:Be.target)==null?void 0:B.closest)==null?void 0:be.call(B,".sd-toolbar-item-ctn");if(!(Oe instanceof HTMLElement))return!1;let ye=he>0?Oe.nextElementSibling:Oe.previousElementSibling;for(;ye;){const ie=Z(ye);if(ie instanceof HTMLElement)return Oe.setAttribute("tabindex","-1"),ye.setAttribute("tabindex","0"),ie.focus(),!0;ye=he>0?ye.nextElementSibling:ye.previousElementSibling}return!1},W=Be=>{V();const he=Be!=null&&Be.shiftKey?-1:1;L(Be,he)||M()},U=Be=>{if(V(),Be!=null&&Be.shiftKey){L(Be,-1)||M();return}M()},q=()=>{M()},Q=Be=>{var he,Oe;return(Oe=(he=Be.nestedOptions)==null?void 0:he.value)!=null&&Oe.length?Be.nestedOptions.value.map(ye=>{const B=(ye==null?void 0:ye.type)!=="render"&&Be.selectedValue.value===ye.key;return{...ye,props:{...ye.props,class:B?"sd-selected":""}}}):[]},re=(Be,he)=>({role:"menuitem","aria-label":`${he.attributes.value.ariaLabel} - ${Be.label}`}),ne=Be=>{const he=Be.target,Oe=Be.target.closest(".sd-toolbar-item-ctn").nextElementSibling;Oe&&(he.setAttribute("tabindex","-1"),Oe.setAttribute("tabindex","0"),Oe.focus())},J=Be=>{const he=Be.target,Oe=Be.target.closest(".sd-toolbar-item-ctn").previousElementSibling;Oe&&(he.setAttribute("tabindex","-1"),Oe.setAttribute("tabindex","0"),Oe.focus())},ge=Be=>{const he=Be.target.closest(".button-group").nextElementSibling;if(he)he.setAttribute("tabindex","0"),he.focus();else{const Oe=document.querySelector(".ProseMirror");Oe&&Oe.focus()}},le=Be=>{const he=Be.target.closest(".button-group").previousElementSibling;he&&(he.setAttribute("tabindex","0"),he.focus())},ve=Be=>{if(!Be.disabled.value){if(m(Be)){At(!T(Be),Be);return}I(Be)}},Ee=(Be,he)=>{const Oe=Be.target.nodeName==="INPUT"||Be.target.nodeName==="TEXTAREA",ye=he.name.value==="fontSize"||he.name.value==="fontFamily";if(!(Oe&&ye)&&["Enter"," ","Spacebar","Escape","ArrowRight","ArrowLeft","Tab"].includes(Be.key))switch(Be.preventDefault(),Be.key){case"Enter":case" ":case"Spacebar":ve(he);break;case"Escape":V();break;case"ArrowRight":V(),ne(Be);break;case"ArrowLeft":V(),J(Be);break;case"Tab":Be.shiftKey?le(Be):ge(Be);break}},st=Be=>{const he=i.value.find(Oe=>!Oe.classList.contains("sd-disabled"));he&&(he.setAttribute("tabindex","0"),he.focus())},At=(Be,he)=>{if(n("item-clicked"),!Be){V(),n("dropdown-update-show",!1);return}V(),l.value=he,C(he,!0),n("dropdown-update-show",!0)},yt=Be=>{var Oe;if(!l.value)return;const he=Be.target;he instanceof Element&&(he.closest('[data-sd-part="dropdown-menu"]')||(Oe=o.value)!=null&&Oe.contains(he)||V())};return pr(()=>T(l.value),Be=>{Be?document.addEventListener("pointerdown",yt,!0):document.removeEventListener("pointerdown",yt,!0)},{immediate:!0}),Hs(()=>{document.removeEventListener("pointerdown",yt,!0)}),(Be,he)=>(Ze(),ut("div",{style:Ai(f.value),class:"button-group",role:"group",onFocus:st,ref_key:"buttonGroupRef",ref:o},[(Ze(!0),ut(Dr,null,ki(e.toolbarItems,(Oe,ye)=>{var B,be,ie,fe;return Ze(),ut("div",{key:Oe.id.value,class:Wr([{narrow:Oe.isNarrow.value,wide:Oe.isWide.value,"sd-disabled":Oe.disabled.value},"sd-toolbar-item-ctn"]),onKeydown:ue=>Ee(ue,Oe),ref_for:!0,ref_key:"toolbarItemRefs",ref:i,tabindex:ye===0?0:-1,"data-item-id":Oe.id.value},[k(Oe)?(Ze(),ei(Eye,{key:0,style:{width:"20px"}})):gn("",!0),y(Oe)&&x(Oe)?(Ze(),ei(vx,{key:1,trigger:"hover",disabled:!((B=Oe.tooltip)!=null&&B.value),"content-style":{fontFamily:s.uiFontFamily}},{trigger:vl(()=>[wo(Xye,{item:Oe,"ui-font-family":s.uiFontFamily,class:"sd-toolbar-button sd-editor-toolbar-dropdown",onCommand:F,onItemClicked:H,onTabOut:he[0]||(he[0]=ue=>W(ue)),onEditorHandoff:q},null,8,["item","ui-font-family"])]),default:vl(()=>[et("div",null,[Md(Un(Oe.tooltip)+" ",1),Oe.disabled.value?(Ze(),ut("span",tve,"(disabled)")):gn("",!0)])]),_:2},1032,["disabled","content-style"])):b(Oe)&&x(Oe)?(Ze(),ei(vx,{key:2,trigger:"hover",disabled:!((be=Oe.tooltip)!=null&&be.value),"content-style":{fontFamily:s.uiFontFamily}},{trigger:vl(()=>[wo(Zye,{item:Oe,"ui-font-family":s.uiFontFamily,class:"sd-toolbar-button sd-editor-toolbar-dropdown",onCommand:F,onItemClicked:H,onTabOut:he[1]||(he[1]=ue=>U(ue)),onEditorHandoff:q},null,8,["item","ui-font-family"])]),default:vl(()=>[et("div",null,[Md(Un(Oe.tooltip)+" ",1),Oe.disabled.value?(Ze(),ut("span",nve,"(disabled)")):gn("",!0)])]),_:2}
622,1032,["disabled","content-style"])):m(Oe)&&((fe=(ie=Oe.nestedOptions)==null?void 0:ie.value)!=null&&fe.length)?(Ze(),ei(sz,{key:3,options:Q(Oe),disabled:Oe.disabled.value,show:T(Oe),"content-style":{fontFamily:s.uiFontFamily},placement:"bottom-start",class:"sd-toolbar-button sd-editor-toolbar-dropdown",onSelect:(ue,Ce)=>ee(Oe,Ce),"onUpdate:show":ue=>At(ue,Oe),style:Ai(Oe.dropdownStyles.value),"menu-props":()=>({role:"menu",style:{fontFamily:s.uiFontFamily},class:["sd-toolbar-dropdown-menu",{"high-contrast":Yt(u)}]}),"node-props":ue=>re(ue,Oe)},{trigger:vl(()=>{var ue;return[wo(vx,{trigger:"hover",disabled:!((ue=Oe.tooltip)!=null&&ue.value),"content-style":{fontFamily:s.uiFontFamily}},{trigger:vl(()=>[wo(YE,{"toolbar-item":Oe,disabled:Oe.disabled.value,"allow-enter-propagation":!0,onTextSubmit:Ce=>D(Oe,Ce),onMainClick:Ce=>P(Oe)},null,8,["toolbar-item","disabled","onTextSubmit","onMainClick"])]),default:vl(()=>[et("div",null,[Md(Un(Oe.tooltip)+" ",1),Oe.disabled.value?(Ze(),ut("span",rve,"(disabled)")):gn("",!0)])]),_:2},1032,["disabled","content-style"])]}),_:2},1032,["options","disabled","show","content-style","onSelect","onUpdate:show","style","menu-props","node-props"])):p(Oe)?(Ze(),ei(vx,{key:4,trigger:"hover",class:"sd-editor-toolbar-tooltip","content-style":{fontFamily:s.uiFontFamily}},{trigger:vl(()=>[wo(YE,{"toolbar-item":Oe,"is-overflow-item":e.fromOverflow,onTextSubmit:ue=>D(Oe,ue),onButtonClick:ue=>I(Oe)},null,8,["toolbar-item","is-overflow-item","onTextSubmit","onButtonClick"])]),default:vl(()=>[Oe.tooltip?(Ze(),ut("div",ive,[Md(Un(Oe.tooltip)+" ",1),Oe.disabled.value?(Ze(),ut("span",ove,"(disabled)")):gn("",!0)])):gn("",!0)]),_:2},1032,["content-style"])):gn("",!0),S(Oe)&&e.overflowItems.length?(Ze(),ei(Oye,{key:5,"toolbar-item":Oe,"ui-font-family":s.uiFontFamily,onButtonClick:ue=>I(Oe),"overflow-items":e.overflowItems,onClose:V,onCommand:he[2]||(he[2]=ue=>n("command",ue))},null,8,["toolbar-item","ui-font-family","onButtonClick","overflow-items"])):gn("",!0)],42,eve)}),128))],36))}},[["__scopeId","data-v-8d7a9de1"]]),sve=[["Arial","sans-serif"],["Arial Black","sans-serif"],["Arial Narrow","sans-serif"],["Baskerville Old Face","serif"],["Bookman Old Style","serif"],["Brush Script MT","cursive"],["Calibri","sans-serif"],["Century","serif"],["Century Gothic","sans-serif"],["Comic Sans MS","sans-serif"],["Cooper Black","serif"],["Courier New","monospace"],["Garamond","serif"],["Georgia","serif"],["Gill Sans MT Condensed","sans-serif"],["Helvetica","sans-serif"],["Lucida Console","monospace"],["Segoe UI","sans-serif"],["Tahoma","sans-serif"],["Times New Roman","serif"],["Trebuchet MS","sans-serif"],["Verdana","sans-serif"]].map(([e,t])=>({label:e,key:e,props:{style:{fontFamily:`${e}, ${t}`},"data-item":"btn-fontFamily-option"}}));function ave(e){if(e!=null&&e.length)return e.map(t=>({label:t.label,key:t.value,props:{style:{fontFamily:t.previewFamily||t.label},"data-item":"btn-fontFamily-option"}}))}var lve=[{label:"8",key:"8pt",props:{"data-item":"btn-fontSize-option"}},{label:"9",key:"9pt",props:{"data-item":"btn-fontSize-option"}},{label:"10",key:"10pt",props:{"data-item":"btn-fontSize-option"}},{label:"11",key:"11pt",props:{"data-item":"btn-fontSize-option"}},{label:"12",key:"12pt",props:{"data-item":"btn-fontSize-option"}},{label:"14",key:"14pt",props:{"data-item":"btn-fontSize-option"}},{label:"18",key:"18pt",props:{"data-item":"btn-fontSize-option"}},{label:"24",key:"24pt",props:{"data-item":"btn-fontSize-option"}},{label:"30",key:"30pt",props:{"data-item":"btn-fontSize-option"}},{label:"36",key:"36pt",props:{"data-item":"btn-fontSize-option"}},{label:"48",key:"48pt",props:{"data-item":"btn-fontSize-option"}},{label:"60",key:"60pt",props:{"data-item":"btn-fontSize-option"}},{label:"72",key:"72pt",props:{"data-item":"btn-fontSize-option"}},{label:"96",key:"96pt",props:{"data-item":"btn-fontSize-option"}}],Pb={sm:768,md:1024,lg:1280,xl:1410},hT={undo:"undo",redo:"redo",bold:"bold",italic:"italic",underline:"underline",strike:"strikethrough",acceptTrackedChangeBySelection:"track-changes-accept-selection",rejectTrackedChangeO
622nSelection:"track-changes-reject-selection",ruler:"ruler",formattingMarks:"formatting-marks",zoom:"zoom",measurementUnit:"measurement-unit",documentMode:"document-mode",link:"link",fontFamily:"font-family",fontSize:"font-size",list:"bullet-list",numberedlist:"numbered-list",table:"table-insert",image:"image",tableOfContents:"table-of-contents-insert",color:"text-color",highlight:"highlight-color",textAlign:"text-align",lineHeight:"line-height",linkedStyles:"linked-style",indentleft:"indent-decrease",indentright:"indent-increase",directionLtr:"direction-ltr",directionRtl:"direction-rtl",clearFormatting:"clear-formatting",copyFormat:"copy-format"},cz={addRowBefore:"table-add-row-before",addRowAfter:"table-add-row-after",deleteRow:"table-delete-row",addColumnBefore:"table-add-column-before",addColumnAfter:"table-add-column-after",deleteColumn:"table-delete-column",deleteTable:"table-delete",deleteCellAndTableBorders:"table-remove-borders",mergeCells:"table-merge-cells",splitCell:"table-split-cell",fixTables:"table-fix"},uz=Object.values(cz);[...new Set([...Object.values(hT),...uz])];var cve=new Set(["link"]);new Set(Object.keys(hT).filter(e=>!cve.has(e)));var uve="Arial, Helvetica, sans-serif",dve=li({__name:"Toolbar",emits:["command","toggle","select"],setup(e,{emit:t}){var M,Z,L,W,U;const{proxy:n}=fh();let r=Ne(1);const i=Ne(null),o=Ne(0),s=Ne(!1);let l=null,u=null,d=n.$toolbar.getAvailableWidth();const f=dt(()=>{var Q,re;const q=(re=(Q=n==null?void 0:n.$toolbar)==null?void 0:Q.config)==null?void 0:re.uiDisplayFallbackFont;return typeof q=="string"&&q.trim()?q.trim():uve}),p=(Z=(M=n.$toolbar.config)==null?void 0:M.toolbarGroups)==null?void 0:Z.includes("left"),m=(W=(L=n.$toolbar.config)==null?void 0:L.toolbarGroups)==null?void 0:W.includes("right"),y=((U=n.$toolbar.config)==null?void 0:U.toolbarButtonsExclude)||[],b=q=>(o.value,n.$toolbar.getToolbarItemByGroup(q).filter(Q=>!y.includes(Q.name.value))),k=()=>{s.value=n.$toolbar.getAvailableWidth()<=Pb.lg},S=()=>{var ge;const q=i.value,Q=q==null?void 0:q.ownerDocument,re=Q==null?void 0:Q.activeElement;if(!(q!=null&&q.contains(re)))return null;const ne=re.closest('[data-sd-part="toolbar-item"]')??re.querySelector('[data-sd-part="toolbar-item"]');if(!ne||re!==ne&&!re.contains(ne))return null;const J=(ge=ne.querySelector("[data-item]"))==null?void 0:ge.getAttribute("data-item");return J?()=>{var Ee;const le=i.value;if(!(le!=null&&le.isConnected)||re.isConnected||Q.activeElement!==Q.body)return;const ve=[...le.querySelectorAll("[data-item]")];for(const st of[J,"btn-overflow"]){const At=(Ee=ve.find(yt=>yt.getAttribute("data-item")===st))==null?void 0:Ee.closest('[data-sd-part="toolbar-item"]');if(At&&At.getAttribute("aria-disabled")!=="true"){At.focus({preventScroll:!0});return}}}:null},x=async q=>{r.value+=1,await Sn(),q==null||q()},C=dye(async()=>{const q=n.$toolbar.getAvailableWidth();if(q===d)return;d=q;const Q=S();await n.$toolbar.onToolbarResize(),k(),await x(Q)},300),I=()=>{const q=S();d=n.$toolbar.getAvailableWidth(),k(),x(q)},D=()=>{o.value+=1};function P(){var q,Q,re,ne;C.cancel(),window.removeEventListener("resize",C),(Q=(q=n.$toolbar).off)==null||Q.call(q,"toolbar-items-changed",I),(ne=(re=n.$toolbar).off)==null||ne.call(re,"toolbar-state-change",D),l==null||l.disconnect(),l=null}function V(){var q,Q,re,ne,J;P(),window.addEventListener("resize",C),(Q=(q=n.$toolbar).on)==null||Q.call(q,"toolbar-items-changed",I),(ne=(re=n.$toolbar).on)==null||ne.call(re,"toolbar-state-change",D),typeof ResizeObserver<"u"&&((J=n.$toolbar.config)!=null&&J.responsiveToContainer)&&n.$toolbar.toolbarContainer&&(l=new ResizeObserver(()=>{C()}),l.observe(n.$toolbar.toolbarContainer)),k()}po(V),hK(V),pK(P),Hs(P);const ee=()=>{var q,Q,re;if(!n.$toolbar.activeEditor){u=null,n.$toolbar.pendingSelectionCapture=null;return}u=((re=(Q=(q=n.$toolbar.ui)==null?void 0:q.selection)==null?void 0:Q.capture)==null?void 0:re.call(Q))??null,n.$toolbar.pendingSelectionCapture=u},F=({item:q,argument:Q,option:re})=>{H(),n.$toolbar.emitCommand({item:q,argument:Q,option:re})},H=()=>{var re,ne,J,ge;const q=n.$toolbar.activeEditor;if(!q)return;const Q=n.$toolbar.pendingSelectionCapture??u;if(Q&&typeof((ne=(re=n.$toolbar.ui)==null?void 0:re.selection)==null?void 0:ne.restore)=="function"){n.$toolbar.ui.selection.restore(Q);return}(ge=(J=q.commands)==null?void 0:J.restoreSelection)==null||ge.call(J)},te=q=>{ee(),az(q)};return(q,Q)=>(Ze(),ut("div",{class:"superdoc-toolbar",ref_key:"toolbarRoot",ref:i,key:Yt(r),role:"toolbar","aria-label":"Toolbar","data-sd-part":"toolbar","data-editor-ui-surface":"",onMousedown:te},[Yt(p)?(Ze(),ei(Jx,{key:0,tabindex:"0","toolbar-items":b("left"),"overflow-items":Yt(n).$toolbar.overflowItems,"compact-side-groups":s.value,"ui-font-family":f.value,position:"left",onCommand:F,class:"superdoc-toolbar-group-side"},null,8,["toolbar-items","overflow-items","compact-side-groups","ui-font-family"])):gn("",!0),wo(Jx,{tabindex:"0","toolbar-items":b("center"),"overflow-items":Yt(n).$toolbar.overflowItems,"compact-side-groups":s.value,"ui-font-family":f.value,position:"center",onCommand:F},null,8,["toolbar-items","overflow-items","compact-side-groups","ui-font-family"]),Yt(m)?(Ze(),ei(Jx,{key:1,tabindex:"0","toolbar-items":b("right"),"overflow-items":Yt(n).$toolbar.overflowItems,"compact-side-groups":s.value,"ui-font-family":f.value,position:"right",onCommand:F,class:"superdoc-toolbar-group-side"},null,8,["toolbar-items","overflow-items","compact-side-groups","ui-font-family"])):gn("",!0)],32))}},[["__scopeId","data-v-9418cc7d"]]),fve=e=>{var n,r,i,o;if(!e)return e;const t=((r=(n=e.props)==null?void 0:n.style)==null?void 0:r.fontFamily)??e.label??e.key;return{...e,props:{...e.props,style:{...(i=e.props)==null?void 0:i.style,fontFamily:t},"data-item":((o=e.props)==null?void 0:o["data-item"])??"btn-fontFamily-option"}}},ai=e=>{var be;if(!["button","options","separator","dropdown","overflow"].includes(e.type))throw new Error("Invalid toolbar item type - "+e.type);if(e.type==="button"&&!e.defaultLabel&&!e.icon)throw new Error(`Toolbar button item needs either "icon" or "defaultLabel" - ${e.name}. "label" is the live label and is not a substitute for "defaultLabel".`);if(!e.name)throw new Error("Invalid toolbar item name - "+e.name);const t=Ne(Sp()),n=e.type,r=Ne(e.name),i=e.command,o=e.noArgumentCommand,s=Ne(e.icon),l=Ne(e.group||"center"),u=Ne(e.allowWithoutEditor),d=Ne(e.attributes||{}),f=!!e.disabled,p=Ne(e.disabled),m=Ne(!1),y=Ne(!1),b=Ne(e.style),k=Ne(e.isNarrow),S=Ne(e.isWide),x=Ne(e.minWidth),T=Ne(e.layoutWidth),C=Ne(e.suppressActiveHighlight||!1),I=Ne(e.argument),D=Ne(null),P=Ne(null),V=Ne(e.iconColor),ee=Ne(e.hasCaret),F=Ne(!!e.splitButton),H=e.splitButtonCommand,te=!!e.restoreEditorFocus,M=Ne(e.dropdownStyles),Z=Ne(e.tooltip),L=Ne(e.tooltipVisible),W=Ne(e.tooltipTimeout),U=Ne(e.defaultLabel),q=Ne(e.label),Q=Ne(e.hideLabel),re=Ne(e.inlineTextInputVisible),ne=Ne(e.hasInlineTextInput),J=Ne(e.markName),ge=Ne(e.labelAttr),le=Ne(e.selectedValue),ve=Ne(e.dropdownValueKey),Ee=Ne(e.inputRef||null),st=Ne([]);if(e.options){if(!Array.isArray(e.options))throw new Error("Invalid toolbar item options - "+e.options);let ie=0;for(let fe=0;fe<e.options.length;fe+=1){const ue=e.options[fe];(!ue||typeof ue!="object")&&(ie+=1)}if(ie)throw new Error(`Toolbar item options must all be objects - ${e.name}. ${ie} row(s) are not, so this item is skipped.`);(be=st.value)==null||be.push(...e.options)}const At=(ie={},...fe)=>{he(ie,...fe),!C.value&&(m.value=!0)},yt=()=>{Oe(),m.value=!1},Ge=ie=>{p.value=ie},Be=()=>{p.value=f},he=e.onActivate||(()=>null),Oe=e.onDeactivate||(()=>null),ye=()=>{const ie={};
622return Object.keys(B).forEach(fe=>{B[fe].value!==void 0&&(ie[fe]=B[fe].value)}),ie},B={id:t,name:r,type:n,command:i,noArgumentCommand:o,icon:s,tooltip:Z,group:l,attributes:d,disabled:p,active:m,expand:y,nestedOptions:st,style:b,isNarrow:k,isWide:S,minWidth:x,layoutWidth:T,argument:I,parentItem:P,iconColor:V,hasCaret:ee,splitButton:F,splitButtonCommand:H,dropdownStyles:M,tooltipVisible:L,tooltipTimeout:W,defaultLabel:U,label:q,hideLabel:Q,inlineTextInputVisible:re,hasInlineTextInput:ne,restoreEditorFocus:te,markName:J,labelAttr:ge,childItem:D,allowWithoutEditor:u,dropdownValueKey:ve,selectedValue:le,inputRef:Ee};return{...B,initiallyDisabled:f,unref:ye,activate:At,deactivate:yt,setDisabled:Ge,resetDisabled:Be,onActivate:he,onDeactivate:Oe}},hve=["onClick","innerHTML","aria-label","onKeydown"],pve=li({__name:"AlignmentButtons",emits:["select"],setup(e,{emit:t}){const{isHighContrastMode:n}=cu(),r=t,i=Ne([]),o=[{key:"left",ariaLabel:"Align left",icon:bo.alignLeft},{key:"center",ariaLabel:"Align center",icon:bo.alignCenter},{key:"right",ariaLabel:"Align right",icon:bo.alignRight},{key:"justify",ariaLabel:"Justify",icon:bo.alignJustify}],s=f=>{r("select",f)},l=f=>{if(f===i.value.length-1)return;const p=i.value[f+1];p&&(p.setAttribute("tabindex","0"),p.focus())},u=f=>{if(f===0)return;const p=i.value[f-1];p&&(p.setAttribute("tabindex","0"),p.focus())},d=(f,p)=>{switch(f.key){case"ArrowLeft":u(p);break;case"ArrowRight":l(p);break;case"Enter":s(o[p].key);break}};return po(()=>{const f=i.value[0];f&&(f.setAttribute("tabindex","0"),f.focus())}),(f,p)=>(Ze(),ut("div",{class:Wr(["alignment-buttons",{"high-contrast":Yt(n)}])},[(Ze(),ut(Dr,null,ki(o,(m,y)=>et("div",{key:m.key,class:"sd-button-icon",onClick:b=>s(m.key),innerHTML:m.icon,"data-item":"btn-textAlign-option",role:"menuitem","aria-label":m.ariaLabel,ref_for:!0,ref_key:"alignmentButtonsRefs",ref:i,onKeydown:Gr(b=>d(b,y),["prevent"])},null,40,hve)),64))],2))}},[["__scopeId","data-v-13e5f7a4"]]),mve=["onClick","innerHTML","aria-label","onKeydown"],lN=l
622i({__name:"StyleButtonsList",props:{buttons:{type:Array,required:!0},selectedStyle:{type:String,default:null},iconSize:{type:Number,default:25}},emits:["select"],setup(e,{emit:t}){const{isHighContrastMode:n}=cu(),r=t,i=e,o=Ne([]),s=dt(()=>({width:`${i.iconSize}px`,height:`${i.iconSize}px`})),l=p=>{r("select",p)},u=p=>{if(p===o.value.length-1)return;const m=o.value[p+1];m&&(m.setAttribute("tabindex","0"),m.focus())},d=p=>{if(p===0)return;const m=o.value[p-1];m&&(m.setAttribute("tabindex","0"),m.focus())},f=(p,m)=>{switch(p.key){case"ArrowLeft":d(m);break;case"ArrowRight":u(m);break;case"Enter":l(i.buttons[m].key);break}};return po(()=>{const p=o.value[0];p&&(p.setAttribute("tabindex","0"),p.focus())}),(p,m)=>(Ze(),ut("div",{class:Wr(["style-buttons-list",{"high-contrast":Yt(n)}])},[(Ze(!0),ut(Dr,null,ki(i.buttons,(y,b)=>(Ze(),ut("div",{key:y.key,class:Wr(["sd-button-icon",{"sd-selected":i.selectedStyle===y.key}]),style:Ai(s.value),onClick:k=>l(y.key),innerHTML:y.icon,role:"menuitem","aria-label":y.ariaLabel,ref_for:!0,ref_key:"buttonRefs",ref:o,onKeydown:Gr(k=>f(k,b),["prevent"])},null,46,mve))),128))],2))}},[["__scopeId","data-v-44f37ff6"]]),gve=[{key:"disc",icon:bo.bulletListDisc,ariaLabel:"Opaque circle"},{key:"circle",icon:bo.bulletListCircle,ariaLabel:"Outline circle"},{key:"square",icon:bo.bulletListSquare,ariaLabel:"Opaque square"}],yve=[{key:"decimal",icon:bo.numberedListDecimal,ariaLabel:"1. 2. 3."},{key:"decimal-paren",icon:bo.numberedListDecimalParen,ariaLabel:"1) 2) 3)"},{key:"upper-roman",icon:bo.numberedListUpperRoman,ariaLabel:"I. II. III."},{key:"lower-roman",icon:bo.numberedListLowerRoman,ariaLabel:"i. ii. iii."},{key:"upper-alpha",icon:bo.numberedListUpperAlpha,ariaLabel:"A. B. C."},{key:"upper-alpha-paren",icon:bo.numberedListUpperAlphaParen,ariaLabel:"A) B) C)"},{key:"lower-alpha",icon:bo.numberedListLowerAlpha,ariaLabel:"a. b. c."},{key:"lower-alpha-paren",icon:bo.numberedListLowerAlphaParen,ariaLabel:"a) b) c)"}],vve=["onClick","onKeydown"],bve={class:"document-mode-column icon-column"},wve=["innerHTML"],xve={class:"document-mode-column text-column"},kve={class:"document-mode-type"},_ve={class:"document-mode-description"},Cve=li({__name:"DocumentMode",props:{options:{type:Array}},emits:["select"],setup(e,{emit:t}){const n=t,r=Ne([]),{isHighContrastMode:i}=cu(),o=e,s=f=>{n("select",f)},l=f=>{if(f===r.value.length-1)return;const p=r.value[f+1];p&&(p.setAttribute("tabindex","0"),p.focus())},u=f=>{if(f===0)return;const p=r.value[f-1];p&&(p.setAttribute("tabindex","0"),p.focus())},d=(f,p)=>{switch(f.key){case"ArrowDown":l(p);break;case"ArrowUp":u(p);break;case"Enter":s(o.options[p]);break}};return po(()=>{r.value[0].setAttribute("tabindex","0"),r.value[0].focus()}),(f,p)=>(Ze(),ut("div",{class:Wr(["document-mode",{"high-contrast":Yt(i)}])},[(Ze(!0),ut(Dr,null,ki(e.options,(m,y)=>(Ze(),ut("div",{class:Wr(["sd-option-item",{"sd-disabled":m.disabled}]),onClick:b=>s(m),"data-item":"btn-documentMode-option",role:"menuitem",ref_for:!0,ref_key:"documentModeRef
622s",ref:r,onKeydown:Gr(b=>d(b,y),["prevent"])},[et("div",bve,[et("div",{class:"icon-column__icon",innerHTML:m.icon},null,8,wve)]),et("div",xve,[et("div",kve,Un(m.label),1),et("div",_ve,Un(m.description),1)])],42,vve))),256))],2))}},[["__scopeId","data-v-bee14d7a"]]),Sve={class:"linked-style-buttons","data-editor-ui-surface":""},Eve=["onClick","onKeydown","aria-label"],Ave=li({__name:"LinkedStyle",props:{styles:{type:Array,default:()=>[]},selectedOption:{type:String,default:null}},emits:["select"],setup(e,{emit:t}){const n=t,r=Ne([]),i=e,o=m=>{n("select",m)},s=m=>{if(m===r.value.length-1)return;const y=r.value[m+1];y.setAttribute("tabindex","0"),y.focus()},l=m=>{if(m===0)return;const y=r.value[m-1];y.setAttribute("tabindex","0"),y.focus()},u=(m,y,b)=>{switch(m.key){case"ArrowDown":s(y);break;case"ArrowUp":l(y);break;case"Enter":m.preventDefault(),o(b);break}},d=m=>(m==null?void 0:m.name)??(m==null?void 0:m.id)??"",f=m=>{var b;const y=(b=m==null?void 0:m.preview)==null?void 0:b.css;return y&&typeof y=="object"?y:void 0},p=()=>{r.value[0]&&(r.value[0].setAttribute("tabindex","0"),r.value[0].focus())};return po(p),pr(()=>i.styles.length,async(m,y)=>{m===0||y!==0||(await Sn(),p())}),(m,y)=>(Ze(),ut("div",Sve,[(Ze(!0),ut(Dr,null,ki(i.styles,(b,k)=>(Ze(),ut("div",{key:b.id??k,class:Wr(["style-item",{selected:e.selectedOption===b.id}]),onClick:S=>o(b),onKeydown:S=>u(S,k,b),"aria-label":`Linked style - ${b.id??d(b)}`,ref_for:!0,ref_key:"styleRefs",ref:r},[et("div",{class:"style-name","data-item":"btn-linkedStyles-option",style:Ai(f(b))},Un(d(b)),5)],42,Eve))),128))]))}},[["__scopeId","data-v-74c8924b"]]),Tve=["placeholder"],Ive={class:"sd-ai-writer__footer"},Rve={key:0,class:"sd-ai-writer__error",role:"alert"},Ove=["disabled"],Nve="https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights",Mve="You are an expert copywriter and you are immersed in a document editor. Only write what is asked for.",Dve=li({__name:"AIWriter",props:{selectedText:{type:String,default:""},target:{type:Object,default:null},doc:{type:Object,default:null},apiKey:{type:String,default:""},endpoint:{type:String,default:""},restoreSelection:{type:Function,default:null},handleClose:{type:Function,required:!0}},setup(e){const t=e,n=Ne(""),r=Ne(!1),i=Ne(""),o=Ne(null),s=dt(()=>t.selectedText?"Insert prompt to update text":"Insert prompt to generate text"),l=dt(()=>n.value.trim().length>0&&!r.value);po(()=>{Sn(()=>{var b;(b=o.value)==null||b.focus()})});function u(b){if(typeof b=="string")return b;if(!b||typeof b!="object")return"";const k=b.custom_prompt;if(Array.isArray(k)){const S=k[0];if(S&&typeof S.value=="string")return S.value}return k&&typeof k=="object"&&typeof k.value=="string"?k.value:typeof b.value=="string"?b.value:typeof b.text=="string"?b.text:""}async function d(b){const k={"Content-Type":"application/json"};t.apiKey&&(k["x-api-key"]=t.apiKey);const S=t.selectedText.trim(),x=S?`Rewrite the following text: "${S}" using these instructions: ${b}`:`Generate text based on the following prompt: ${b}`,T=await fetch(t.endpoint||Nve,{method:"POST",headers:k,body:JSON.stringify({stream:!1,context:Mve,insights:[{type:"custom_prompt",name:S?"text_rewrite":"text_generation",message:x,format:[{value:""}]}]})});if(!T.ok){const I=await T.text().catch(()=>"");throw new Error(I||`AI request failed with ${T.status}`)}const C=u((T.headers.get("content-type")||"").includes("application/json")?await T.json():await T.text()).trim();if(!C)throw new Error("AI returned no text.");return C}function f(b){return!b||typeof b!="object"?!0:!(b.success===!1||b.ok===!1)}function p(b){var T;const k=t.doc;if(!k)throw new Error("Document API is unavailable.");(T=t.restoreSelection)==null||T.call(t);let S=null,x=!1;if(t.selectedText&&t.target&&typeof k.replace=="function"?(S=k.replace({target:t.target,text:b}),x=!0):t.target&&typeof k.insert=="function"?(S=k.insert({target:t.target,value:b,type:"text"}),x=!0):typeof k.insert=="function"&&(S=k.insert({value:b,type:"text"}),x=!0),!x)throw new Error("Document text insertion is unavailable.");if(!f(S))throw new Error("Unable to insert generated text.")}async function m(){if(l.value){i.value="",r.value=!0;try{p(await d(n.value.trim())),t.handleClose()}catch(b){i.value=b instanceof Error?b.message:String(b)}finally{r.value=!1}}}function y(b){b.key!=="Enter"||b.shiftKey||(b.preventDefault(),m())}return(b,k)=>(Ze(),ut("form",{class:"sd-ai-writer","data-item":"ai-writer",onSubmit:Gr(m,["prevent"])},[Lu(et("textarea",{ref_key:"textareaRef",ref:o,"onUpdate:modelValue":k[0]||(k[0]=S=>n.value=S),class:"sd-ai-writer__input",placeholder:s.value,rows:"4",onKeydown:y},null,40,Tve),[[yg,n.value]]),et("div",Ive,[i.value?(Ze(),ut("p",Rve,Un(i.value),1)):gn("",!0),et("button",{class:"sd-ai-writer__submit",type:"submit",disabled:!l.value},Un(r.value?"Generating":"Generate"),9,Ove)])],32))}},[["__scopeId","data-v-67f6c6f7"]]),Lve=["aria-label","onClick","onKeydown"],Pve=["innerHTML"],Bve=["innerHTML"],bx=7,cN=li({__name:"IconGridRow",props:{icons:{type:Array,required:!0},activeColor:{type:Object,required:!1}},emits:["select","clickoutside"],setup(e,{emit:t}){const n=t,r=e,i=dt(()=>b=>r.activeColor.value?r.activeColor.value.toUpperCase()===b.value:!1),o=(b,k)=>k===5||["#FFFFFF","#FAFF09"].includes(b)?{color:"#000"}:{color:"#FFF"},s=b=>{n("select",b.value)},l=Ne([]),u=Ne([]);po(()=>
622{if(!r.icons.every(k=>Array.isArray(k)))throw new Error("icon props must be 2d array");const b=u.value[0];b&&(b.setAttribute("tabindex","0"),b.focus({preventScroll:!0}))});const d=(b,k)=>{const S=bx*b+k+1,x=u.value[S];x&&(x.setAttribute("tabindex","0"),x.focus({preventScroll:!0}))},f=(b,k)=>{const S=bx*b+k-1,x=u.value[S];x&&(x.setAttribute("tabindex","0"),x.focus({preventScroll:!0}))},p=(b,k)=>{const S=k+bx*(b+1),x=u.value[S];x&&(x.setAttribute("tabindex","0"),x.focus({preventScroll:!0}))},m=(b,k)=>{const S=k+bx*(b-1),x=u.value[S];x&&(x.setAttribute("tabindex","0"),x.focus({preventScroll:!0}))},y=(b,k,S,x)=>{switch(b.key){case"ArrowRight":d(k,S);break;case"ArrowLeft":f(k,S);break;case"ArrowDown":p(k,S);break;case"ArrowUp":m(k,S);break;case"Enter":s(x);break;case"Escape":n("clickoutside");break}};return(b,k)=>(Ze(!0),ut(Dr,null,ki(e.icons,(S,x)=>(Ze(),ut("div",{class:"sd-option-row",key:x,role:"group",ref_for:!0,ref_key:"rowRefs",ref:l},[(Ze(!0),ut(Dr,null,ki(S,(T,C)=>(Ze(),ut("div",{class:"sd-option",key:C,"aria-label":T.label,role:"menuitem",ref_for:!0,ref_key:"iconRefs",ref:u,onClick:Gr(I=>s(T),["stop","prevent"]),onKeydown:Gr(I=>y(I,x,C,T),["prevent"])},[et("div",{class:"sd-option__icon",innerHTML:T.icon,style:Ai(T.style)},null,12,Pve),i.value(T)?(Ze(),ut("div",{key:0,class:"sd-option__check",innerHTML:Yt(bo).colorOptionCheck,style:Ai(o(T.value,C))},null,12,Bve)):gn("",!0)],40,Lve))),128))]))),128))}},[["__scopeId","data-v-05eb02fc"]]),jve=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M320 512c53.2 0 101.4-21.6 136.1-56.6l-298.3-235C140 257.1 128 292.3 128 320c0 106 86 192 192 192zM505.2 370.7c4.4-16.2 6.8-33.1 6.8-50.7c0-91.2-130.2-262.3-166.6-308.3C339.4 4.2 330.5 0 320.9 0l-1.8 0c-9.6 0-18.5 4.2-24.5 11.7C277.8 33 240.7 81.3 205.8 136L38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L505.2 370.7zM224 336c0 44.2 35.8 80 80 80c8.8 0 16 7.2 16 16s-7.2 16-16 16c-61.9 0-112-50.1-112-112c0-8.8 7.2-16 16-16s16 7.2 16 16z"/></svg>
623`,Fve={class:"options-grid-wrap"},zve=["innerHTML"],Uve={class:"option-grid-ctn"},Vve=li({__name:"IconGrid",props:{icons:{type:Array,required:!0},customIcons:{type:Array,required:!1},activeColor:{type:Object,required:!1},hasNoneIcon:{type:Boolean,required:!1}},emits:["select","clickoutside"],setup(e,{emit:t}){const n=t,r=i=>{n("select",i)};return(i,o)=>(Ze(),ut("div",Fve,[e.hasNoneIcon?(Ze(),ut("div",{key:0,class:"none-option",role:"menuitem","aria-label":"Clear color selection",onClick:o[0]||(o[0]=s=>r("none"))},[et("span",{innerHTML:Yt(jve),class:"none-icon"},null,8,zve),o[1]||(o[1]=Md(" None ",-1))])):gn("",!0),et("div",Uve,[wo(cN,{icons:e.icons,"active-color":e.activeColor,onSelect:r},null,8,["icons","active-color"]),e.customIcons.flat().length?(Ze(),ut(Dr,{key:0},[o[2]||(o[2]=et("span",{class:"option-grid-ctn__subtitle"},"Custom colors",-1)),wo(cN,{icons:e.customIcons,"active-color":e.activeColor,onSelect:r},null,8,["icons","active-color"])],64)):gn("",!0)])]))}},[["__scopeId","data-v-52b0283a"]]),Hve=e=>{e.expand.value=!1},vr=(e,t=null)=>({label:t,icon:bo.colorOption,value:e,style:{color:e,boxShadow:"0 0 5px 1px rgba(0, 0, 0, 0.1)",borderRadius:"50%"}}),XE=(e,t,n=[],r=!1)=>{const i=o=>{t.iconColor.value=o,e.emitCommand({item:t,argument:o}),Hve(t),Cp(e)};return Ps("div",{},[Ps(Vve,{icons:$ve,customIcons:n,activeColor:t.iconColor,hasNoneIcon:r,onSelect:i})])},$ve=[[vr("#111111","black"),vr("#333333","dark gray"),vr("#5C5C5C","medium gray"),vr("#858585","light gray"),vr("#ADADAD","very light gray"),vr("#D6D6D6","transparent gray"),vr("#FFFFFF","white")],[vr("#860028","dark red"),vr("#D2003F","red"),vr("#DB3365","coral red"),vr("#E4668C","light red"),vr("#ED99B2","pale pink"),vr("#F6CCD9","transparent pink"),vr("#FF004D","bright pink")],[vr("#83015E","dark purple"),vr("#CD0194","purple"),vr("#D734A9","orchid"),vr("#
623E167BF","light purple"),vr("#EB99D4","lavender"),vr("#F5CCEA","transparent pink"),vr("#FF00A8","neon pink")],[vr("#8E220A","maroon"),vr("#DD340F","red-orange"),vr("#E45C3F","burnt orange"),vr("#EB856F","peach"),vr("#F1AE9F","pale peach"),vr("#F8D6CF","transparent peach"),vr("#FF7A00","orange")],[vr("#947D02","olive"),vr("#E7C302","mustard yellow"),vr("#ECCF35","yellow"),vr("#F1DB67","light yellow"),vr("#F5E79A","very pale yellow"),vr("#FAF3CC","transparent yellow"),vr("#FAFF09","neon yellow")],[vr("#055432","forest green"),vr("#07834F","green"),vr("#399C72","medium green"),vr("#6AB595","light green"),vr("#9CCDB9","mint"),vr("#CDE6DC","transparent mint"),vr("#05F38F","bright teal")],[vr("#063E7E","navy blue"),vr("#0A60C5","blue"),vr("#3B80D1","sky blue"),vr("#6CA0DC","cornflower blue"),vr("#9DBFE8","light blue"),vr("#CEDFF3","very light blue"),vr("#21c8ce","cyan")],[vr("#3E027A","deep purple"),vr("#6103BF","indigo"),vr("#8136CC","violet"),vr("#A068D9","lavender pink"),vr("#C09AE6","light lilac"),vr("#DFCDF2","transparent lilac"),vr("#A91DFF","neon purple")]],Gve=["data-cols","data-rows","onKeydown","onClick"],qve=["aria-valuetext"],wx=5,Wve=li({__name:"TableGrid",emits:["select","clickoutside"],setup(e,{emit:t}){const n=t,r=Ne(0),i=Ne(0),{isHighContrastMode:o}=cu(),s=Ne([]),l=p=>{let m=p.target;if(m.dataset.grid)return;let y=[...m.parentElement.querySelectorAll("[data-item]")],b=parseInt(m.dataset.cols,10),k=parseInt(m.dataset.rows,10);u(y,b,k)},u=(p,m,y)=>{i.value=m,r.value=y;for(let b=0;b<p.length;b++){let k=p[b],S=parseInt(k.dataset.cols,10),x=parseInt(k.dataset.rows,10);S<=m&&x<=y?k.classList.add("sd-selected"):k.classList.remove("sd-selected")}},d=({cols:p,rows:m})=>{n("select",{cols:p,rows:m})},f=(p,m,y)=>{let b=m-1,k=y-1;switch(p.key){case"ArrowRight":{if(b>=4)return;const S=k*wx;s.value[S+b+1].setAttribute("tabindex","0"),s.value[S+b+1].focus(),u(s.value,m+1,y);break}case"ArrowLeft":{if(b<=0)return;const S=k*wx;s.value[S+b-1].setAttribute("tabindex","0"),s.value[S+b-1].focus(),u(s.value,m-1,y);break}case"ArrowDown":{if(k>=4)return;const S=(k+1)*wx;s.value[S+b].setAttribute("tabindex","0"),s.value[S+b].focus(),u(s.value,m,y+1);break}case"ArrowUp":{if(k<=0)return;const S=(k-1)*wx;s.value[S+b].setAttribute("tabindex","0"),s.value[S+b].focus(),u(s.value,m,y-1);break}case"Enter":d({cols:m,rows:y});break}};return po(()=>{s.value[0].setAttribute("tabindex","0"),s.value[0].focus(),u(s.value,1,1)}),(p,m)=>(Ze(),ut("div",{class:Wr(["toolbar-table-grid-wrapper",{"high-contrast":Yt(o)}])},[et("div",{class:"toolbar-table-grid",onMouseover:l,"data-grid":"true"},[(Ze(),ut(Dr,null,ki(5,y=>(Ze(),ut(Dr,{key:y},[(Ze(),ut(Dr,null,ki(5,b=>et("div",{class:"toolbar-table-grid__item",key:`${y}_${b}`,"data-cols":b,"data-rows":y,"data-item":"true",ref_for:!0,ref_key:"tableGridItems",ref:s,onKeydown:Gr(k=>f(k,b,y),["prevent"]),onClick:Gr(k=>d({cols:b,rows:y}),["stop","prevent"])},null,40,Gve)),64))],64))),64))],32),et("div",{class:"toolbar-table-grid-value","aria-valuetext":`${r.value} x ${i.value}`},Un(r.value)+" x "+Un(i.value),9,qve)],2))}},[["__scopeId","data-v-b87d6ca2"]]),Kve={class:"toolbar-table-actions"},Yve=["onClick","data-item","ariaLabel"],Xve={class:"toolbar-table-actions__icon"},Zve=["innerHTML"],Qve={class:"toolbar-table-actions__label"},Jve=li({__name:"TableActions",props:{options:{type:Array}},emits:["select"],setup(e,{emit:t}){const n=t,r=i=>{n("select",{command:i.command})};return(i,o)=>(Ze(),ut("div",Kve,[(Ze(!0),ut(Dr,null,ki(e.options,s=>{var l,u;return Ze(),ut("div",{class:Wr(["toolbar-table-actions__item",{"toolbar-table-actions__item--border":s.bottomBorder}]),onClick:d=>r(s),"data-item":((l=s.props)==null?void 0:l["data-item"])||"",ariaLabel:(u=s.props)==null?void 0:u.ariaLabel,role:"menuitem"},[et("div",Xve,[et("div",{class:"toolbar-table-actions__icon-wrapper",innerHTML:s.icon},null,8,Zve)]),et("div",Qve,Un(s.label),1)],10,Yve)}),256))]))}},[["__scopeId","data-v-0cdad084"]]),ebe=["aria-busy"],tbe=["aria-disabled"],nbe={class:"sd-page-number-menu__row-label","aria-hidden":"true"}
623,rbe=["aria-checked","aria-label","title","tabindex","data-position","data-alignment","onClick"],ibe={class:"sd-page-number-menu__page",viewBox:"0 0 36 46","aria-hidden":"true",focusable:"false"},obe=["x","y"],sbe={class:"sd-page-number-menu__check"},abe=["disabled"],lbe={class:"sd-page-number-menu__format"},cbe={class:"sd-page-number-menu__field"},ube=["disabled"],dbe=["value"],fbe={class:"sd-page-number-menu__start"},hbe={class:"sd-page-number-menu__check"},pbe=["disabled"],mbe=["disabled","onKeydown"],gbe={key:0,class:"sd-page-number-menu__error",role:"alert"},ybe={key:1,class:"sd-page-number-menu__note",role:"status"},vbe={class:"sd-page-number-menu__actions"},bbe=["disabled"],wbe=["disabled"],xbe=["disabled"],kbe={class:"sd-page-number-menu__cursor-text"},_be=li({__name:"PageNumberMenu",props:{pageNumbersState:{type:Object,default:null},atCursorState:{type:Object,default:null},suggesting:{type:Boolean,default:!1},inHeaderFooter:{type:Boolean,default:!1},loadCurrent:{type:Function,default:null},applyPageNumbers:{type:Function,required:!0},removePageNumbers:{type:Function,required:!0},insertAtCursor:{type:Function,required:!0},close:{type:Function,required:!0},initialChoice:{type:Object,default:null}},setup(e){const t=e,n=[{value:"top",label:"Top of page",kind:"header"},{value:"bottom",label:"Bottom of page",kind:"footer"}],r=[{value:"left",label:"left"},{value:"center",label:"center"},{value:"right",label:"right"}],i=n.flatMap(he=>r.map(Oe=>({position:he.value,alignment:Oe.value,label:`${he.label}, ${Oe.label}`}))),o=[{value:"decimal",label:"1, 2, 3"},{value:"lowerLetter",label:"a, b, c"},{value:"upperLetter",label:"A, B, C"},{value:"lowerRoman",label:"i, ii, iii"},{value:"upperRoman",label:"I, II, III"},{value:"numberInDash",label:"- 1 -, - 2 -"}],s=[{value:"hebrew1",label:"א, ב, ג"},{value:"hebrew2",label:"א, ב, ג (alphabet)"}],l={left:6,center:14,right:22},u={top:4,bottom:37},{isHighContrastMode:d}=cu(),f=t.initialChoice??{},p=Ne(f.position==="top"?"top":"bottom"),m=Ne(r.some(he=>he.value===f.alignment)?f.alignment:"right"),y=Ne(f.showOnFirstPage!==!1),b=Ne("decimal"),k=Ne(!1),S=Ne(1),x=Ne(null),T=Ne(typeof t.loadCurrent=="function");let C=Promise.resolve();const I=Ne(!1),D=Ne(!1),P=Ne(""),V=Ne([]),ee=dt(()=>{var he;return((he=t.pageNumbersState)==null?void 0:he.enabled)===!0}),F=dt(()=>{var he;return((he=t.atCursorState)==null?void 0:he.enabled)===!0}),H=dt(()=>{var he,Oe;return(((Oe=(he=x.value)==null?void 0:he.placements)==null?void 0:Oe.length)??0)>0}),te=dt(()=>s.some(he=>he.value===b.value)?[...o,...s]:o),M=dt(()=>i.findIndex(he=>he.position===p.value&&he.alignment===m.value)),Z=dt(()=>{if(M.value>=0)return M.value;const he=n.findIndex(Oe=>Oe.value===p.value);return Math.max(0,he)*r.length}),L=dt(()=>H.value?"Apply":"Add page numbers"),W=dt(()=>ee.value?"":t.suggesting?"Page numbers can’t be changed as a suggestion. Switch to Editing to change them.":"Page numbers can’t be changed right now."),U=dt(()=>F.value?"In the header or footer you’re editing":t.inHeaderFooter?"Place the cursor without selecting text":"Click into a header or footer first"),q=dt(()=>{const he=typeof navigator>"u"?"":navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad/i.test(he)?"⌥⇧⌘P":"Ctrl+Alt+Shift+P"});function Q(he){return he.position===p.value&&he.alignment===m.value}function re(){I.value=!0,P.value=""}function ne(he,{focus:Oe=!1}={}){p.value=he.position,m.value=he.alignment,re(),Oe&&Sn(()=>{var ye;return(ye=V.value[i.indexOf(he)])==null?void 0:ye.focus()})}function J(he){const Oe=Z.value,ye=Math.floor(Oe/r.length),B=Oe%r.length,be={ArrowLeft:[ye,Math.max(0,B-1)],ArrowRight:[ye,Math.min(r.length-1,B+1)],ArrowUp:[Math.max(0,ye-1),B],ArrowDown:[Math.min(n.length-1,ye+1),B],Home:[ye,0],End:[ye,r.length-1]}[he.key];return be?(he.preventDefault(),ne(i[be[0]*r.length+be[1]],{focus:!0}),!0):!1}function ge(he){J(he)||(he.key==="Enter"?(he.preventDefault(),yt()):he.key===" "&&he.preventDefault())}function le(he){if(x.value=he&&Array.isArray(he.placements)?he:null,!x.value||I.value)return;const Oe=x.value.placements.find(ye=>ye.kind==="footer"&&ye.alignment)??x.value.placements.find(ye=>ye.alignment)??x.value.placements[0];Oe&&(p.value=Oe.kind==="header"?"top":"bottom",m.value=Oe.alignment??null,y.value=x.value.showOnFirstPage!==!1),b.value=x.value.format??"decimal",k.value=typeof x.value.start=="number",S.value=typeof x.value.start=="number"?x.value.start:1,Sn(()=>{var ye;return(ye=V.value[Z.value])==null?void 0:ye.focus({preventScroll:!0})})}function ve(){var ie;const he=x.value,Oe=p.value==="top"?"header":"footer",ye=((ie=he==null?void 0:he.placements)==null?void 0:ie.find(fe=>fe.kind===Oe))??null,B={position:p.value};m.value&&(!ye||ye.alignment!==m.value)&&(B.alignment=m.value),(!H.value||y.value!==((he==null?void 0:he.showOnFirstPage)!==!1))&&(B.showOnFirstPage=y.value),b.value!==((he==null?void 0:he.format)??"decimal")&&(B.format=b.value);const be=k.value?Ee():null;
623return be!==((he==null?void 0:he.start)??null)&&(B.start=be),B}function Ee(){const he=Math.floor(Number(S.value));return Number.isFinite(he)&&he>=0?he:1}function st(he,Oe){var B;const ye=(B=he==null?void 0:he.failure)==null?void 0:B.details;return(ye==null?void 0:ye.reason)==="page-number-has-content"?`A page number shares its line with other text. Edit the ${ye.kind==="header"?"header":"footer"} directly to change it.`:(ye==null?void 0:ye.reason)==="page-number-exists"?"This section already has page numbers.":Oe==="remove"?"Page numbers couldn’t be removed. Try again.":H.value?"Page numbers couldn’t be changed. Try again.":"Page numbers couldn’t be added. Try again."}async function At(he,Oe){if(!(!ee.value||D.value)){D.value=!0,P.value="";try{await C;const{execute:ye,outcome:B}=Oe(),be=await ye();if(be===!0||(be==null?void 0:be.success)===!0){t.close(B);return}P.value=st(be,he)}catch{P.value=st(null,he)}finally{D.value=!1}}}function yt(){return At("apply",()=>{const he=ve();return{execute:()=>t.applyPageNumbers(he),outcome:{action:"apply",choice:{position:p.value,alignment:m.value,showOnFirstPage:y.value}}}})}function Ge(){return At("remove",()=>{var he;return{execute:()=>t.removePageNumbers(),outcome:{action:"remove",kinds:(((he=x.value)==null?void 0:he.placements)??[]).map(Oe=>Oe.kind)}}})}function Be(){if(!F.value||D.value)return;D.value=!0;let he;try{he=t.insertAtCursor()}catch{he=void 0}t.close({action:"cursor"}),Promise.resolve(he).catch(()=>{})}return po(()=>{Sn(()=>{var he;return(he=V.value[Z.value])==null?void 0:he.focus({preventScroll:!0})}),typeof t.loadCurrent=="function"&&(C=Promise.resolve().then(()=>t.loadCurrent()).then(le,()=>le(null)).finally(()=>{T.value=!1}))}),(he,Oe)=>(Ze(),ut("div",{class:Wr(["sd-page-number-menu",{"high-contrast":Yt(d)}]),role:"group","aria-labelledby":"sd-page-number-menu-title","aria-busy":T.value||void 0,"data-sd-page-number-menu":""},[Oe[9]||(Oe[9]=et("div",{id:"sd-page-number-menu-title",class:"sd-page-number-menu__title"},"Page numbers",-1)),et("div",{class:"sd-page-number-menu__grid",role:"radiogroup","aria-label":"Position","aria-disabled":!ee.value||void 0},[(Ze(),ut(Dr,null,ki(n,(ye,B)=>(Ze(),ut(Dr,{key:ye.value},[et("div",nbe,Un(ye.label),1),(Ze(!0),ut(Dr,null,ki(Yt(i).slice(B*3,B*3+3),be=>(Ze(),ut("button",{key:`${be.position}-${be.alignment}`,ref_for:!0,ref:ie=>V.value[Yt(i).indexOf(be)]=ie,type:"button",role:"radio",class:Wr(["sd-page-number-menu__tile",{"is-selected":Q(be)}]),"aria-checked":Q(be),"aria-label":be.label,title:be.label,tabindex:Yt(i).indexOf(be)===Z.value?0:-1,"data-position":be.position,"data-alignment":be.alignment,onClick:ie=>ne(be),onDblclick:yt,onKeydown:ge},[(Ze(),ut("svg",ibe,[Oe[4]||(Oe[4]=cK('<rect class="sd-page-number-menu__sheet" x="0.75" y="0.75" width="34.5" height="44.5" rx="2.5" data-v-30327fd0></rect><rect class="sd-page-number-menu__line" x="7" y="14" width="22" height="2" rx="1" data-v-30327fd0></rect><rect class="sd-page-number-menu__line" x="7" y="19" width="18" height="2" rx="1" data-v-30327fd0></rect><rect class="sd-page-number-menu__line" x="7" y="24" width="22" height="2" rx="1" data-v-30327fd0></rect><rect class="sd-page-number-menu__line" x="7" y="29" width="14" height="2" rx="1" data-v-30327fd0></rect>',5)),et("rect",{class:"sd-page-number-menu__chip",x:l[be.alignment],y:u[be.position],width:"8",height:"5",rx:"1.5"},null,8,obe)]))],42,rbe))),128))],64))),64))],8,tbe),et("label",sbe,[Lu(et("input",{"onUpdate:modelValue":Oe[0]||(Oe[0]=ye=>y.value=ye),type:"checkbox",disabled:!ee.value,"data-sd-page-number-first-page":"",onChange:re},null,40,abe),[[N6,y.value]]),Oe[5]||(Oe[5]=et("span",null,"Show on first page",-1))]),et("div",lbe,[et("label",cbe,[Oe[6]||(Oe[6]=et("span",null,"Format",-1)),Lu(et("select",{"onUpdate:modelValue":Oe[1]||(Oe[1]=ye
623=>b.value=ye),disabled:!ee.value,"data-sd-page-number-format":"",onChange:re},[(Ze(!0),ut(Dr,null,ki(te.value,ye=>(Ze(),ut("option",{key:ye.value,value:ye.value},Un(ye.label),9,dbe))),128))],40,ube),[[bK,b.value]])]),et("div",fbe,[et("label",hbe,[Lu(et("input",{"onUpdate:modelValue":Oe[2]||(Oe[2]=ye=>k.value=ye),type:"checkbox",disabled:!ee.value,"data-sd-page-number-restart":"",onChange:re},null,40,pbe),[[N6,k.value]]),Oe[7]||(Oe[7]=et("span",null,"Start at",-1))]),Lu(et("input",{"onUpdate:modelValue":Oe[3]||(Oe[3]=ye=>S.value=ye),type:"number",min:"0",step:"1",inputmode:"numeric","aria-label":"First page number",disabled:!ee.value||!k.value,"data-sd-page-number-start":"",onInput:re,onKeydown:Nd(Gr(yt,["prevent"]),["enter"])},null,40,mbe),[[yg,S.value,void 0,{number:!0}]])])]),P.value?(Ze(),ut("p",gbe,Un(P.value),1)):W.value?(Ze(),ut("p",ybe,Un(W.value),1)):gn("",!0),et("div",vbe,[H.value?(Ze(),ut("button",{key:0,type:"button",class:"sd-page-number-menu__remove",disabled:!ee.value||D.value,"aria-label":"Remove page numbers","data-sd-page-number-remove":"",onClick:Ge}," Remove ",8,bbe)):gn("",!0),et("button",{type:"button",class:"sd-page-number-menu__add",disabled:!ee.value||D.value,"data-sd-page-number-add":"",onClick:yt},Un(L.value),9,wbe)]),Oe[10]||(Oe[10]=et("div",{class:"sd-page-number-menu__divider",role:"separator"},null,-1)),et("button",{type:"button",class:"sd-page-number-menu__cursor",disabled:!F.value||D.value,"data-sd-page-number-at-cursor":"",onClick:Be},[et("span",kbe,[Oe[8]||(Oe[8]=et("span",null,"Insert at cursor",-1)),et("small",null,Un(U.value),1)]),et("kbd",null,Un(q.value),1)],8,xbe)],10,ebe))}},[["__scopeId","data-v-30327fd0"]]),Z3="sd-page-number-flash",Cbe=1400,uN=e=>new Promise(t=>{typeof(e==null?void 0:e.requestAnimationFrame)=="function"?e.requestAnimationFrame(()=>t()):setTimeout(t,16)});async function dN(e,t){var o;const n=(o=e==null?void 0:e.ownerDocument)==null?void 0:o.defaultView;if(!e||!n)return;await uN(n),await uN(n);const r=n.innerHeight,i=[...e.querySelectorAll(`[data-sd-headerfooter-kind="${t}"]`)].filter(s=>{const l=s.getBoundingClientRect();return l.height>0&&l.bottom>0&&l.top<r});for(const s of i)s.classList.remove(Z3),s.classList.add(Z3),n.setTimeout(()=>s.classList.remove(Z3),Cbe)}var Sbe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>
624`,Wc=e=>{e.expand.value=!1},Q3=(e,t)=>{var r;const n=(r=e.layoutWidth)==null?void 0:r.value;return Number.isFinite(n)&&n>0?n:e.type==="separator"?t.get("separator"):t.get(e.name.value)||t.get("default")};function ZE(e,t){const n={...e};return t?n.href=t:delete n.href,n}function fN(e){const t=Array.isArray(e==null?void 0:e.segments)?e.segments:[];if((e==null?void 0:e.kind)!=="text"||!t.length)return null;const n=t[0],r=t[t.length-1];if(!(n!=null&&n.blockId)||!(r!=null&&r.blockId)||!n.range||!r.range)return null;const i=e.story;return{kind:"selection",start:{kind:"text",blockId:n.blockId,offset:n.range.start??0,...i?{story:i}:{}},end:{kind:"text",blockId:r.blockId,offset:r.range.end??0,...i?{story:i}:{}},...i?{story:i}:{}}}function Ebe(e){return typeof(e==null?void 0:e.quotedText)=="string"?e.quotedText:typeof(e==null?void 0:e.text)=="string"?e.text:""}function J3(e){var t,n,r,i,o,s;return((r=(n=(t=e.ui)==null?void 0:t.selection)==null?void 0:n.get)==null?void 0:r.call(n))??((s=(o=(i=e.ui)==null?void 0:i.selection)==null?void 0:o.current)==null?void 0:s.call(o))??null}function Abe(e){var t,n,r,i,o,s,l;return!!((i=(r=(n=(t=e.config)==null?void 0:t.superdoc)==null?void 0:n.config)==null?void 0:r.modules)!=null&&i.ai||(l=(s=(o=e.superdoc)==null?void 0:o.config)==null?void 0:s.modules)!=null&&l.ai)}function Tbe(e){var t,n,r,i,o,s,l;return((i=(r=(n=(t=e.config)==null?void 0:t.superdoc)==null?void 0:n.config)==null?void 0:r.modules)==null?void 0:i.ai)??((l=(s=(o=e.superdoc)==null?void 0:o.config)==null?void 0:s.modules)==null?void 0:l.ai)??{}}var Ibe=({superToolbar:e,toolbarIcons:t,toolbarTexts:n,toolbarFonts:r,hideButtons:i,availableWidth:o,role:s,isDev:l=!1,configuredItemNames:u,excludedItemNames:d,additionalItems:f=[]}={})=>{var Bt,hn,Pn,jn;const p=ai({type:"button",name:"bold",command:"toggleBold",icon:t.bold,tooltip:n.bold,attributes:{ariaLabel:"Bold"}}
624),m=(r??sve).map(fve),y=ai({type:"dropdown",name:"fontFamily",tooltip:n.fontFamily,command:"setFontFamily",defaultLabel:"Arial",label:"Arial",markName:"textStyle",labelAttr:"fontFamily",hasCaret:!0,hasInlineTextInput:!0,inlineTextInputVisible:!0,isWide:!0,style:{width:"116px"},suppressActiveHighlight:!0,attributes:{ariaLabel:"Font family"},options:m,onActivate:({fontFamily:Lt}={},St=!1)=>{if(St){y.label.value="",y.selectedValue.value="";return}if(!Lt)return;Lt=Lt.split(",")[0];const Te=Et=>Et.value??Et.label,qe=m.find(Et=>Te(Et)===y.defaultLabel.value),it=m.find(Et=>Te(Et)===Lt);it?(y.label.value=it.label,y.selectedValue.value=it.key):qe?(y.label.value=Lt,y.selectedValue.value=qe.key):(y.label.value=Lt,y.selectedValue.value="")},onDeactivate:()=>{const Lt=m.find(St=>(St.value??St.label)===y.defaultLabel.value);y.label.value=(Lt==null?void 0:Lt.label)??y.defaultLabel.value,y.selectedValue.value=(Lt==null?void 0:Lt.key)??""}}),b=ai({type:"dropdown",name:"ai",dropdownStyles:{padding:0,outline:"none"},tooltip:n.ai,icon:t.ai,hideLabel:!0,hasCaret:!1,isWide:!0,suppressActiveHighlight:!0,attributes:{ariaLabel:"AI"},options:[{type:"render",key:"ai",render:()=>k(b)}]});function k(Lt){var sn,Tn,kn,rn;const St=J3(e),Te=(St==null?void 0:St.selectionTarget)??fN(St==null?void 0:St.target),qe=St!=null&&St.empty?"":Ebe(St),it=Tbe(e),Et=()=>Wc(Lt),$t=()=>{var qr,Yr;const Wn=e.pendingSelectionCapture;Wn&&typeof((Yr=(qr=e.ui)==null?void 0:qr.selection)==null?void 0:Yr.restore)=="function"&&e.ui.selection.restore(Wn)};return Ps("div",{},[Ps(Dve,{handleClose:Et,selectedText:qe,target:Te,doc:((Tn=(sn=e.superdoc)==null?void 0:sn.activeEditor)==null?void 0:Tn.doc)??null,apiKey:(it==null?void 0:it.apiKey)||((kn=e.config)==null?void 0:kn.aiApiKey)||"",endpoint:(it==null?void 0:it.endpoint)||((rn=e.config)==null?void 0:rn.aiEndpoint)||"",restoreSelection:$t})])}const S=lve,x=ai({type:"dropdown",name:"fontSize",defaultLabel:"12",label:"12",style:{width:"56px"},markName:"textStyle",labelAttr:"fontSize",tooltip:n.fontSize,hasCaret:!0,hasInlineTextInput:!0,inlineTextInputVisible:!0,suppressActiveHighlight:!0,isWide:!0,command:"setFontSize",attributes:{ariaLabel:"Font size"},options:S,onActivate:({fontSize:Lt},St=!1)=>{if(St){x.label.value="",x.selectedValue.value="";return}const Te=S.find($t=>$t.label===String(x.defaultLabel.value));if(!Lt){x.label.value=x.defaultLabel.value,Te?x.selectedValue.value=Te.key:x.selectedValue.value="";return}let qe=uye(Lt,12);qe<8&&(qe=8),qe>96&&(qe=96);let it=String(qe);const Et=S.find($t=>$t.label===it||$t.key===it);Et?x.selectedValue.value=Et.key:x.selectedValue.value="",x.label.value=it},onDeactivate:()=>{x.label.value=x.defaultLabel.value;const Lt=S.find(St=>St.label===String(x.defaultLabel.value));Lt?x.selectedValue.value=Lt.key:x.selectedValue.value=""}}),T=()=>ai({type:"separator",name:"separator",isNarrow:!0}),C=ai({type:"button",name:"italic",command:"toggleItalic",icon:t.italic,tooltip:n.italic,attributes:{ariaLabel:"Italic"}}),I=ai({type:"button",name:"underline",command:"toggleUnderline",icon:t.underline,tooltip:n.underline,attributes:{ariaLabel:"Underline"}}),D=ai({type:"button",name:"strike",command:"toggleStrike",icon:t.strikethrough,tooltip:n.strikethrough,attributes:{ariaLabel:"Strikethrough"}}),P=ai({type:"dropdown",name:"highlight",icon:t.highlight,hideLabel:!0,markName:"highlight",labelAttr:"color",tooltip:n.highlight,command:"setHighlight",noArgumentCommand:"unsetHighlight",suppressActiveHighlight:!0,attributes:{ariaLabel:"Highlight"},options:[{key:"color",type:"render",render:()=>XE(e,P,[],!0)}],onActivate:({color:Lt})=>{P.iconColor.value=Lt||""},onDeactivate:()=>P.iconColor.value=""}),V=ai({type:"dropdown",name:"color",icon:t.color,hideLabel:!0,markName:"textStyle",labelAttr:"color",tooltip:n.color,command:"setColor",suppressActiveHighlight:!0,attributes:{ariaLabel:"Color"},options:[{key:"color",type:"render",render:()=>XE(e,V)}],onActivate:({color:Lt})=>{V.iconColor.value=Lt},onDeactivate:()=>V.iconColor.value="#000"}),ee=ai({type:"button",name:"search",allowWithoutEditor:!0,icon:t.search,tooltip:n.search,group:"right",attributes:{ariaLabel:"Search"}}),F=ai({type:"dropdown",name:"link",markName:"link",icon:t.link,tooltip:n.link,attributes:{ariaLabel:"Link dropdown"},options:[{type:"render",key:"linkDropdown",render:()=>H(F)}],onActivate:({href:Lt})=>{F.attributes.value=ZE(F.attributes.value,Lt)},onDeactivate:()=>{F.attributes.value=ZE(F.attributes.value,null),F.expand.value=!1}});function H(Lt){const St=J3(e),Te=(St==null?void 0:St.selectionTarget)??fN(St==null?void 0:St.target),qe=()=>{var Et,$t;const it=e.pendingSelectionCapture;it&&typeof(($t=(Et=e.ui)==null?void 0:Et.selection)==null?void 0:$t.restore)=="function"&&e.ui.selection.restore(it)};return Ps("div",{},[Ps(zj,{ui:e.ui,linkItem:Lt,textTarget:Te,restoreSelection:qe,closePopover:()=>{Wc(Lt),Cp(e)},goToAnchor:()=>{var sn,Tn,kn,rn,Wn,qr;Wc(Lt);const it=(sn=Lt.attributes.value)==null?void 0:sn.href;if(!it)return;const Et=it.slice(1),$t=(qr=(Wn=((rn=(kn=(Tn=e.ui)==null?void 0:Tn.viewport)==null?void 0:kn.getHost)==null?void 0:rn.call(kn))??null)==null?void 0:Wn.querySelector)==null?void 0:qr.call(Wn,`a[name='${Et}']`);$t&&Uj($t)}})])}const te=ai({type:"options",name:"linkInput",command:"toggleLink"});F.childItem=te,te.parentItem=F;const M=ai({type:"button",name:"image",command:"startImageUpload",icon:t.image,tooltip:n.image,disabled:!1,attributes:{ariaLabel:"Image"}}),Z=ai({type:"button",name:"tableOfContents",command:"insertTableOfContents",icon:t.tableOfContents,tooltip:n.tableOfContents,disabled:!1,attributes:{ariaLabel:"Table of contents"}}),L=ai({type:"button",name:"watermark",icon:t.watermark,tooltip:n.watermark,allowWithoutEditor:!0,disabled:!0,attributes:{ariaLabel:n.watermark}}),W=ai({type:"dropdown",name:"pageNumber",icon:t.pageNumber,hideLabel:!0,tooltip:n.pageNumber,disabled:!0,suppressActiveHighlight:!0,attributes:{ariaLabel:n.pageNumber},options:[{key:"pageNumber",type:"render",label:"Page number options",render:()=>q(W)}]});let U=null;function q(Lt){var $t,sn,Tn,kn,rn,Wn,qr;const St=e.ui,Te=Yr=>{var gi,Jn,Tr,zr;return((zr=(Tr=(Jn=(gi=St==null?void 0:St.commands)==null?void 0:gi.get)==null?void 0:Jn.call(gi,Yr))==null?void 0:Tr.getState)==null?void 0:zr.call(Tr))??null},qe=()=>{Wc(Lt),Ge.expand.value&&Wc(Ge),Cp(e)},it=J3(e),Et=(($t=it==null?void 0:it.selectionTarget)==null?void 0:$t.story)??((Tn=(sn=it==null?void 0:it.selectionTarget)==null?void 0:sn.start)==null?void 0:Tn.story)??((kn=it==null?void 0:it.target)==null?void 0:kn.story)??null;return Ps(_be,{pageNumbersState:Te("page-numbers-apply"),atCursorState:Te("page-number-insert"),inHeaderFooter:(Et==null?void 0:Et.storyType)==="headerFooterPart"||(Et==null?void 0:Et.storyType)==="headerFooterSlot",suggesting:((qr=(Wn=(rn=St==null?void 0:St.document)==null?void 0:rn.getSnapshot)==null?void 0:Wn.call(rn))==null?void 0:qr.mode)==="suggesting",initialChoice:U,loadCurrent:()=>St?DX(St):Promise.resolve(null),applyPageNumbers:Yr=>G0(St,"page-numbers-apply",Yr),removePageNumbers:()=>G0(St,"page-numbers-remove"),insertAtCursor:()=>G0(St,"page-number-insert"),close:Yr=>{var Jn,Tr;qe();const gi=(Tr=(Jn=St==null?void 0:St.viewport)==null?void 0:Jn.getHost)==null?void 0:Tr.call(Jn);if((Yr==null?void 0:Yr.action)==="apply")U=Yr.choice,dN(gi,Yr.choice.position==="top"?"header":"footer");else if((Yr==null?void 0:Yr.action)==="remove")for(const zr of new Set(Yr.kinds))dN(gi,zr)}})}const Q=ai({type:"dropdown",name:"table",icon:t.table,hideLabel:!0,labelAttr:"table",tooltip:n.table,command:"insertTable",suppressActiveHighlight:!0,attributes:{ariaLabel:"Table"},options:[{key:"table",type:"render",render:()=>re(Q)}]});function re(Lt){return Ps("div",{},[Ps(Wve,{onSelect:Te=>{e.emitCommand({item:Lt,argument:Te}),Wc(Lt),Cp(e)}})])}const ne=ai({type:"dropdown",name:"tableActions",command:"executeTableCommand",tooltip:n.tableActions,icon:t.tableActions,hideLabel:!0,disabled:!0,attributes:{ariaLabel:"Table actions"},options:[{type:"render",render:()=>ge(ne)}]}),J=[{label:n.addRowBefore,command:"addRowBefore",icon:t.addRowBefore,props:{"data-item":"btn-tableActions-option",ariaLabel:"Add row before"}},{label:n.addRowAfter,command:"addRowAfter",icon:t.addRowAfter,props:{"data-item":"btn-tableActions-option",ariaLabel:"Add row after"}},{label:n.addColumnBefore,command:"addColumnBefore",icon:t.addColumnBefore,props:{"data-item":"btn-tableActions-option",ariaLabel:"Add column before"}},{label:n.addColumnAfter,command:"addColumnAfter",icon:t.addColumnAfter,bottomBorder:!0,props:{"data-item":"btn-tableActions-option",ariaLabel:"Add column after"}},{label:n.deleteRow,command:"deleteRow",icon:t.deleteRow,props:{"data-item":"btn-tableActions-option",ariaLabel:"Delete row"}},{label:n.deleteColumn,command:"deleteColumn",icon:t.deleteColumn,props:{"data-item":"btn-tableActions-option",ariaLabel:"Delete column"}},{label:n.deleteTable,command:"deleteTable",icon:t.deleteTable,props:{"data-item":"btn-tableActions-option",ariaLabel:"Delete table"}},{label:n.removeBorders,command:"deleteCellAndTableBorders",icon:t.deleteBorders,bottomBorder:!0,props:{"data-item":"btn-tableActions-option",ariaLabel:"Delete cell and table borders"}},{label:n.mergeCells,command:"mergeCells",icon:t.mergeCells,props:{"data-item":"btn-tableActions-option",ariaLabel:"Merge cells"}},{label:n.splitCell,command:"splitCell",icon:t.splitCell,props:{"data-item":"btn-tableActions-option",ariaLabel:"Split cells"}},{label:n.fixTables,command:"fixTables",icon:t.fixTables,props:{"data-item":"btn-tableActions-option",ariaLabel:"Fix tables"}}];function ge(Lt){return Ps(Jve,{options:J,onSelect:St=>{Wc(Lt);const{command:Te}=St;e.emitCommand({item:Lt,argument:{command:Te}}),Cp(e)}})}const le=ai({type:"dropdown",name:"textAlign",tooltip:n.textAlign,icon:t.alignLeft,command:"setTextAlign",hasCaret:!0,markName:"textAlign",labelAttr:"textAlign",suppressActiveHighlight:!0,attributes:{ariaLabel:"Text align"},options:[{type:"render",render:()=>Ps("div",{},[Ps(pve,{onSelect:St=>{Wc(le);const Te={...le,command:"setTextAlign"};Te.command="setTextAlign",e.emitCommand({item:Te,argument:St}),ve(le,St),Cp(e)}})]),key:"alignment"}],onActivate:({textAlign:Lt})=>{ve(le,Lt)},onDeactivate:()=>{ve(le,"left")}}),ve=(Lt,St)=>{let Te=St==="both"?"justify":St,qe={left:t.alignLeft,right:t.alignRight,center:t.alignCenter,justify:t.alignJustify},it=qe[Te]??qe.left;Lt.icon.value=it},Ee=ai({type:"dropdown",name:"list",command:"toggleBulletListStyle",splitButton:!0,splitButtonCommand:"toggleBulletList",icon:t.bulletList,hasCaret:!0,tooltip:n.bulletList,restoreEditorFocus:!0,attributes:{ariaLabel:"Bullet list"},options:[{type:"render",key:"bullet-style-buttons",render:()=>{const Lt=St=>{Wc(Ee);const Te={...Ee,command:"toggleBulletListStyle"};e.emitCommand({item:Te,argument:St})};return Ps(lN,{buttons:gve,iconSize:25,selectedStyle:Ee.selectedValue.value,onSelect:Lt})}}]}),st=ai({type:"dropdown",name:"numberedlist",command:"toggleOrderedListStyle",splitButton:!0,splitButtonCommand:"toggleOrderedList",icon:t.numberedList,hasCaret:!0,tooltip:n.numberedList,restoreEditorFocus:!0,attributes:{ariaLabel:"Numbered list"},options:[{type:"render",key:"numbered-style-buttons",render:()=>{const Lt=St=>{Wc(st);const Te={...st,command:"toggleOrderedListStyle"};e.emitCommand({item:Te,argument:St})};return Ps(lN,{buttons:yve,iconSize:30,selectedStyle:st.selectedValue.value,onSelect:Lt})}}]}),At=ai({type:"button",name:"indentleft",command:"decreaseTextIndent",icon:t.indentLeft,tooltip:n.indentLeft,disabled:!1,attributes:{ariaLabel:"Left indent"}}),yt=ai({type:"button",name:"indentright",command:"increaseTextIndent",icon:t.indentRight,tooltip:n.indentRight,disabled:!1,attributes:{ariaLabel:"Right indent"}}),Ge=ai({type:"overflow",name:"overflow",command:null,icon:t.overflow,disabled:!1,attributes:{ariaLabel:"Overflow items"}}),Be=ai({type:"dropdown",name:"zoom",allowWithoutEditor:!0,tooltip:n.zoom,defaultLabel:"100%",label:"100%",hasCaret:!0,command:"setZoom",isWide:!0,style:{width:"71px",minWidth:"71px"},inlineTextInputVisible:!1,hasInlineTextInput:!0,attributes:{ariaLabel:"Zoom"},options:[{label:"50%",key:.5,props:{"data-item":"btn-zoom-option"}},{label:"75%",key:.75,props:{"data-item":"btn-zoom-option"}},{label:"90%",key:.9,props:{"data-item":"btn-zoom-option"}},{label:"100%",key:1,props:{"data-item":"btn-zoom-option"}},{label:"125%",key:1.25,props:{"data-item":"btn-zoom-option"}},{label:"150%",key:1.5,props:{"data-item":"btn-zoom-option"}},{label:"200%",key:2,props:{"data-item":"btn-zoom-option"}}],onActivate:({zoom:Lt})=>{Lt&&(Be.label.value=Lt)}}),he=ai({type:"dropdown",name:"measurementUnit",allowWithoutEditor:!0,tooltip:n.measurementUnit,defaultLabel:"in",label:"in",hasCaret:!0,command:"setMeasurementUnit",group:"right",style:{width:"52px",minWidth:"52px"},inlineTextInputVisible:!1,hasInlineTextInput:!1,attributes:{ariaLabel:"Measurement unit"},options:[{label:"Inches",key:"in",props:{"data-item":"btn-measurement-unit-option"}},{label:"Centimeters",key:"cm",props:{"data-item":"btn-measurement-unit-option"}}],onActivate:({measurementUnit:Lt})=>{Lt&&(he.label.value=Lt)}}),Oe=ai({type:"button",name:"undo",disabled:!0,tooltip:n.undo,command:"und
624o",icon:t.undo,group:"left",attributes:{ariaLabel:"Undo"}}),ye=ai({type:"button",disabled:!0,name:"redo",tooltip:n.redo,command:"redo",icon:t.redo,group:"left",attributes:{ariaLabel:"Redo"}}),B=ai({type:"button",disabled:!1,name:"acceptTrackedChangeBySelection",tooltip:n.trackChangesAccept,command:"acceptTrackedChangeFromToolbar",icon:t.trackChangesAccept,group:"left",attributes:{ariaLabel:"Accept tracked changes"}}),be=ai({type:"button",disabled:!1,name:"rejectTrackedChangeOnSelection",tooltip:n.trackChangesReject,command:"rejectTrackedChangeFromToolbar",icon:t.trackChangesReject,group:"left",attributes:{ariaLabel:"Reject tracked changes"}}),ie=ai({type:"button",name:"clearFormatting",command:"clearFormat",tooltip:n.clearFormatting,icon:t.clearFormatting,attributes:{ariaLabel:"Clear formatting"}}),fe=ai({type:"button",name:"copyFormat",tooltip:n.copyFormat,icon:t.copyFormat,command:"copyFormat",attributes:{ariaLabel:"Copy formatting"}}),ue=(Lt,St)=>Lt==="editor"?St:Lt==="suggester"?St.filter(Te=>Te.value==="suggesting"):St.filter(Te=>Te.value==="viewing"),Ce=Lt=>Lt==="editor"?"Editing":Lt==="suggester"?"Suggesting":"Viewing",Ue=ai({type:"dropdown",name:"documentMode",command:"setDocumentMode",allowWithoutEditor:!0,icon:t.documentMode,defaultLabel:Ce(s),label:Ce(s),hasCaret:s==="editor",isWide:!0,style:{display:"flex",justifyContent:"flex-end"},inlineTextInputVisible:!1,hasInlineTextInput:!1,group:"right",disabled:s!=="editor",attributes:{dropdownPosition:"right",className:"sd-toolbar-item--doc-mode",ariaLabel:"Document mode"},options:[{type:"render",render:()=>oe(Ue)}]}),K=[{label:n.documentEditingMode,value:"editing",icon:t.documentEditingMode,description:n.documentEditingModeDescription},{label:n.documentSuggestingMode,value:"suggesting",icon:t.documentSuggestingMode,description:n.documentSuggestingModeDescription},{label:n.documentViewingMode,value:"viewing",icon:t.documentViewingMode,description:n.documentViewingModeDescription}];function oe(Lt){return Ps(Cve,{options:ue(s,K),onSelect:St=>{var $t;const Te=(($t=e.superdoc)==null?void 0:$t.activeEditor)??e.activeEditor;Wc(Lt);const{label:qe,icon:it,value:Et}=St;Ue.label.value=qe,Ue.icon.value=it,e.emitCommand({item:Ue,argument:Et}),Cp(e,Te)}})}const Fe=new Map([["separator",20],["zoom",71],["measurementUnit",52],["fontFamily",118],["fontSize",57],["textAlign",40],["linkedStyles",142],["documentMode",47],["default",32]]),Le=["search","ruler","undo","overflow","documentMode"],tt=ai({type:"button",name:"ruler",command:"toggleRuler",allowWithoutEditor:!0,icon:t.ruler,tooltip:n.ruler,attributes:{ariaLabel:"Ruler"}}),De=ai({type:"button",name:"formattingMarks",command:"toggleFormattingMarks",allowWithoutEditor:!0,icon:t.formattingMarks,tooltip:n.formattingMarks,attributes:{ariaLabel:"Formatting marks"}}),Pe=ai({type:"dropdown",name:"linkedStyles",command:"setLinkedStyle",tooltip:n.linkedStyles,icon:t.paintbrush,defaultLabel:n.formatText,label:n.formatText,hasCaret:!0,isWide:!0,style:{width:"140px"},suppressActiveHighlight:!0,disabled:!1,attributes:{className:"sd-toolbar-item--linked-styles",ariaLabel:"Linked styles"},options:[{type:"render",key:"linkedStyle",render:()=>{var Te,qe;const Lt=it=>{Wc(Pe);const Et=typeof it=="string"?it:(it==null?void 0:it.id)??null;if(!Et)return;const $t={...Pe,command:"setLinkedStyle"};e.emitCommand({item:$t,argument:Et})},St=((Te=e.getActiveLinkedStyleId)==null?void 0:Te.call(e))??null;return Ps("div",{},[Ps(Ave,{styles:((qe=e.getLinkedStyleOptions)==null?void 0:qe.call(e))??[],onSelect:Lt,selectedOption:St})])}}],onActivate:({styleId:Lt,styleName:St})=>{const Te=St||Lt;Pe.label.value=Lt&&Lt!=="Normal"?String(Te):n.formatText,Pe.disabled.value=!1},onDeactivate:()=>{Pe.disabled.value=!0,Pe.label.value=n.formatText}}),mt=(Lt,St)=>{if(St.value==Lt)return Ps("div",{innerHTML:Sbe,class:"dropdown-select-icon"})},xt=ai({type:"dropdown",name:"lineHeight",tooltip:n.lineHeight,icon:t.lineHeight,hasCaret:!1,hasInlineTextInput:!1,hideLabel:!0,inlineTextInputVisible:!1,suppressActiveHighlight:!0,restoreEditorFocus:!0,isWide:!1,command:"setLineHeight",dropdownValueKey:"key",selectedValue:"1",attributes:{ariaLabel:"Line height"},options:[1,1.15,1.5,2,2.5,3].map(Lt=>({label:Lt.toFixed(2),key:Lt,icon:()=>mt(Lt,xt.selectedValue),props:{"data-item":"btn-lineHeight-option"}}))}),de=20,z=32,Y=["linkedStyles","clearFormatting","copyFormat","formattingMarks"],me=["zoom","fontFamily","fontSize","redo"],Ve=o<=Pb.lg,lt=((Bt=e.config)==null?void 0:Bt.showFormattingMarksButton)===!0,gt=((hn=e.config)==null?void 0:hn.showTableOfContentsButton)===!0;Ve&&(Ue.attributes.value={...Ue.attributes.value,className:`${Ue.attributes.value.className} sd-toolbar-item--doc-mode-compact`}),Ve&&(Pe.attributes.value={...Pe.attributes.value,className:`${Pe.attributes.value.className} sd-toolbar-item--linked-styles-compact`});let dn=[Oe,ye,B,be,ee,Be,y,T(),x,T(),p,C,I,D,V,P,T(),F,M,...gt?[Z]:[],...(Pn=e.config)!=null&&Pn.showWatermarkButton||u!=null&&u.has("watermark")?[L]:[],...(jn=e.config)!=null&&jn.showPageNumberButton||u!=null&&u.has("pageNumber")?[W]:[],Q,ne,T(),le,Ee,st,At,yt,xt,T(),Pe,T(),tt,he,...lt?[De]:[],fe,ie,...Abe(e)?[b]:[],Ge,Ue,...f];if(o<=Pb.md&&i&&(dn=dn.filter(Lt=>Lt.type!=="separator")),e.config.mode!=="docx"){const Lt=dn.findIndex(Te=>Te.name.value==="linkedStyles");dn.splice(Lt-1,2);const St=["ruler","zoom","undo","redo"];dn=dn.filter(Te=>!St.includes(Te.name.value))}const Hn=[];l||(s==="viewer"&&Hn.push(B,be),dn=dn.filter(Lt=>!Hn.includes(Lt))),u&&(dn=dn.filter(Lt=>Lt.name.value==="overflow"||Lt.isCustomToolbarItem||u.has(Lt.name.value))),d!=null&&d.size&&(dn=dn.filter(Lt=>!d.has(Lt.name.value)));const br=Lt=>Le.includes(Lt.name.value),ur=dn.find(Lt=>Lt.name.value==="overflow"),tr=dn.filter(Lt=>Lt!==ur),Br=Lt=>{const St=[],Te=[],qe=tr.filter(br).reduce((Et,$t)=>Et+Q3($t,Fe),0);let it=z+qe+(Lt&&ur?Q3(ur,Fe):0);return tr.forEach((Et,$t)=>{var Tn;const sn=Q3(Et,Fe);if(Et.type==="separator"&&((Tn=tr[$t-1])==null?void 0:Tn.name.value)==="linkedStyles"&&St.includes(tr[$t-1])){St.push(Et);return}if(o<Pb.xl+de&&Y.includes(Et.name.value)&&i){St.push(Et);return}if(o<Pb.sm&&me.includes(Et.name.value)&&i){St.push(Et);return}if(br(Et)){Te.push(Et);return}it+sn<=o||!i?(Te.push(Et),it+=sn):St.push(Et)}),{visibleItems:Te,overflowItems:St}};let{visibleItems:Lr,overflowItems:$e}=Br(!1);if(i&&ur&&$e.some(Lt=>Lt.type!=="separator")){({visibleItems:Lr,overflowItems:$e}=Br(!0));const Lt=dn.indexOf(ur),St=Lr.findIndex(Te=>dn.indexOf(Te)>Lt);St===-1?Lr.push(ur):Lr.splice(St,0,ur)}return{defaultItems:Lr,overflowItems:$e.filter(Lt=>Lt.type!=="separator")}},hN={bold:"Bold",fontFamily:"Font family",ai:"AI text generation",fontSize:"Font size",italic:"Italic",underline:"Underline",highlight:"Highlight color",strikethrough:"Strikethrough",color:"Text color",search:"Search",link:"Link",image:"Image",tableOfContents:"Table of contents",watermark:"Watermark",pageNumber:"Page number",table:"Insert table",tableActions:"Table options",addRowBefore:"Insert row above",addRowAfter:"Insert row below",addColumnBefore:"Insert column left",addColumnAfter:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table",removeBorders:"Remove borders",mergeCells:"Merge cells",splitCell:"Split cell",fixTables:"Fix tables",textAlign:"Alignment",bulletList:"Bullet list",numberedList:"Numbered list",indentLeft:"Left indent",indentRight:"Right indent",directionLtr:"Left-to-right",directionRtl:"Right-to-left",zoom:"Zoom",measurementUnit:"Measurement unit",undo:"Undo",redo:"Redo",trackChanges:"Track Changes",trackChangesAccept:"Accept changes under selection",trackChangesReject:"Reject changes under selection",trackChangesOriginal:"Toggle Show Original",trackChangesFinal:"Toggle Show Final",clearFormatting:"Clear formatting",copyFormat:"Format painter",lineHeight:"Line height",formatText:"Format text",ruler:"Show or hide ruler",formattingMarks:"Show or hide formatting marks",pageBreak:"Insert page break",documentEditingMode:"Editing",documentSuggestingMode:"Suggesting",documentViewingMode:"Viewing",documentEditingModeDescription:"Edit document directly",documentSuggestingModeDescription:"Edits become suggestions",documentViewingModeDescription:"View clean version of document only",linkedStyles:"Linked 
624styles"},Rbe=e=>e?typeof e!="string"?e instanceof HTMLElement?e:null:e.startsWith("#")||e.startsWith(".")?document.querySelector(e):document.getElementById(e):null;function pN(e){return cye(e)??hT[e]??null}function xx(e,t,n,r={}){var l;if(!(e!=null&&e.commands)||!t||typeof e.commands.has=="function"&&!e.commands.has(t))return!1;const i=typeof e.commands.executeAsync=="function"?e.commands.executeAsync:e.commands.execute;if(typeof i!="function")return!1;const o=r.firstParty?G0(e,t,n):n===void 0?i.call(e.commands,t):i.call(e.commands,t,n),s=u=>{var d;!r.reportUnhandled||u!==!1||(d=r.onError)==null||d.call(r,new Error(`[superdoc toolbar] Command "${t}" did not run. Check that it is enabled and has the required input.`))};return o&&typeof o.then=="function"?Promise.resolve(o).then(u=>{var d;s(u),(d=r.onSettled)==null||d.call(r)},u=>{var d,f;(d=r.onError)==null||d.call(r,u),(f=r.onSettled)==null||f.call(r)}):(s(o),(l=r.onSettled)==null||l.call(r)),!0}var Obe=["page-numbers-apply","page-number-insert"],Nbe=new Set(["bold","italic","underline","strike","color","highlight","link","clearFormatting","textAlign","list","numberedlist","indentleft","indentright","lineHeight","linkedStyles"]),Mbe=new Set(["list","numberedlist"]);function Dbe(e,t){if(e==="fontFamily"||e==="fontSize"||Mbe.has(e)&&(t!=null&&t.disabled)&&(t==null?void 0:t.supported)!==!1&&(t==null?void 0:t.reason)==null)return!0;if(!Nbe.has(e))return!1;const n=t==null?void 0:t.reason;return n==="range-selection-required"||n==="selection-required"}function mN(e){var t;return!!((t=e==null?void 0:e.closest)!=null&&t.call(e,"[data-editor-ui-surface], .toolbar-dropdown-menu, .sd-toolbar-dropdown-menu, .sd-tooltip-content"))}function Lbe(e){return["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key)}var Pbe=new Set([...lye,...Object.keys(s_),"ai","overflow","tableOfContents"]),Ip,Rp,Ln,dz,fz,hz,pz,mz,gz,ek,yz,QE,tk,P0,JE,vz,eA,tA,bz,wz,xz,nA,kz,_z,Cz,Sz,Ez,nk,vd,KM,Bbe=(KM=class extends qA.default{constructor(t={}){var n,r;super();Cn(this,Ln);Ao(this,"config",{selector:null,toolbarGroups:["left","center","right"],role:"editor",icons:{...bo},texts:{...hN},fonts:null,hideButtons:!0,responsiveToContainer:!1,mode:"docx",excludeItems:[],groups:null,customButtons:[],showFormattingMarksButton:!1,showTableOfContentsButton:!1,showWatermarkButton:!1,showPageNumberButton:!1});Ao(this,"toolbarItems",[]);Ao(this,"overflowItems",[]);Cn(this,Ip,null);Cn(this,Rp,null);Ao(this,"isDev",!1);Ao(this,"role","editor");Ao(this,"superdoc");Ao(this,"toolbarContainer",null);Ao(this,"toolbar",null);Ao(this,"_detachFontsChanged",null);Ao(this,"_linkedStyleOptions",Zs([]));Ao(this,"onToolbarResize",()=>{Ye(this,Ln,ek).call(this),this.updateToolbarState()});if(this.config={...this.config,...t},this.toolbarItems=[],this.overflowItems=[],this.isDev=t.isDev||!1,this.superdoc=t.superdoc,this.role=t.role||"editor",this.toolbarContainer=null,this.config.icons={...bo,...t.icons},this.config.texts={...hN,...t.texts},this.config.hideButtons=t.hideButtons??!0,this.config.responsiveToContainer=t.responsiveToContainer??!1,this.activeEditor=t.editor??((n=this.superdoc)==null?void 0:n.activeEditor)??null,this.ui=null,this.snapshot=null,this._unsubscribeController=null,this._detachFormatPainterModeChange=null,this._customCommandRegs=new Map,this._reportedInvalidCustomItems=new Set,this._lastFontOptionsSignature="",!this.config.selector&&this.config.element&&(this.config.selector=this.config.element),this.toolbarContainer=Rbe(this.config.selector),this.toolbarContainer){const i=(((r=this.config)==null?void 0:r.uiDisplayFallbackFont)||"").toString().trim()||"Arial, Helvetica, sans-serif";this.toolbarContainer.style.setProperty("--sd-ui-font-family",i)}try{if(Ye(this,Ln,dz).call(this),Ye(this,Ln,mz).call(this),Ye(this,Ln,ek).call(this),Ye(this,Ln,hz).call(this),this._lastFontOptionsSignature=Ye(this,Ln,tk).call(this),!this.toolbarContainer){this.updateToolbarState();return}this.app=UA(dve),this.app.directive("click-outside",z5),this.app.config.globalProperties.$toolbar=this,this.toolbar=this.app.mount(this.toolbarContainer),this.updateToolbarState()}catch(i){try{this.destroy()}catch{}throw i}}getAvailableWidth(){var r;const t=document.documentElement.clientWidth,n=((r=this.toolbarContainer)==null?void 0:r.offsetWidth)??0;return this.config.responsiveToContainer?n:t}getToolbarItemByGroup(t){return this.toolbarItems.filter(n=>{var r;return(((r=n.group)==null?void 0:r.value)||"center")===t})}getToolbarItemByName(t){return Ye(this,Ln,P0).call(this).find(n=>n.name.value===t)}getLinkedStyleOptions(){return Ye(this,Ln,JE).call(this),this._linkedStyleOptions.value}getActiveLinkedStyleId(){var t,n,r,i;return((i=(r=(n=(t=this.ui)==null?void 0:t.styles)==null?void 0:n.getActiveParagraphStyle)==null?void 0:r.call(n))==null?void 0:i.styleId)??null}setActiveEditor(t){this.activeEditor=t;const n=Ye(this,Ln,tk).call(this);n!==this._lastFontOptionsSignature&&(this._lastFontOptionsSignature=n,Ye(this,Ln,QE).call(this)),this.ui&&(this.snapshot=this.ui.toolbar.getSnapshot()),this.updateToolbarState()}updateToolbarState(){var r,i,o,s,l,u;Ye(this,Ln,tA).call(this),Ye(this,Ln,bz).call(this);const t=((o=(i=(r=this.snapshot)==null?void 0:r.commands)==null?void 0:i["document-mode"])==null?void 0:o.value)||"editing";!(this.snapshot&&(((s=this.superdoc)==null?void 0:s.activeEditor)??this.activeEditor))||t==="viewing"?(Ye(this,Ln,kz).call(this),Ye(this,Ln,P0).call(this).forEac
624h(d=>{var p;const f=d.isCustomToolbarItem&&typeof d.command=="string";((p=d.allowWithoutEditor)!=null&&p.value||f)&&Ye(this,Ln,nA).call(this,d)})):Ye(this,Ln,P0).call(this).forEach(d=>{d.resetDisabled(),Ye(this,Ln,nA).call(this,d)}),(l=this.getToolbarItemByName("overflow"))==null||l.setDisabled(!this.overflowItems.some(d=>d.type!=="separator"&&!d.disabled.value));const n=this.getToolbarItemByName("copyFormat");n&&((u=this.snapshot)!=null&&u.copyFormatActive?n.activate():n.deactivate()),this.emit("toolbar-state-change")}emitCommand({item:t,argument:n,option:r}){var l,u,d,f,p,m;const i=(l=t==null?void 0:t.name)==null?void 0:l.value,{command:o}=t,s=n!=null;if(!((t==null?void 0:t.type)==="dropdown"&&!s&&(o==="setFontFamily"||o==="setFontSize"))){if(i==="search"){(d=(u=this.superdoc)==null?void 0:u.emit)==null||d.call(u,"search:open");return}try{if(((f=X3(i))==null?void 0:f.disposition)==="host-routed"){Ye(this,Ln,_z).call(this,i,n),this.updateToolbarState();return}if(typeof o=="function"){const y=`__builtin_toolbar__${i}`;if(this._customCommandRegs.has(y)&&((m=(p=this.ui)==null?void 0:p.commands)!=null&&m.execute))this.ui.commands.execute(y,{argument:n,option:r});else{const b=o({item:t,argument:n,option:r,ui:this.ui,superdoc:this.superdoc});b&&typeof b.then=="function"&&Promise.resolve(b).catch(k=>Ye(this,Ln,vd).call(this,k,i))}this.updateToolbarState();return}if(t!=null&&t.isCustomToolbarItem&&typeof o=="string"){if(!xx(this.ui,o,n,{onSettled:()=>this.updateToolbarState(),onError:y=>Ye(this,Ln,vd).call(this,y,i),reportUnhandled:!0}))throw new Error(`[superdoc toolbar] Command not handled: ${String(o)}`);this.updateToolbarState();return}if(!Ye(this,Ln,Cz).call(this,t,n)&&o)throw new Error(`[superdoc toolbar] Command not handled: ${String(o)}`);this.updateToolbarState()}catch(y){Ye(this,Ln,vd).call(this,y,i)}}}destroy(){var t,n;Ye(this,Ln,nk).call(this),(t=Ae(this,Ip))==null||t.destroy(),Ot(this,Ip,null),Ye(this,Ln,pz).call(this),Ye(this,Ln,fz).call(this),(n=this.app)==null||n.unmount(),this.app=null,this.toolbar=null}},Ip=new WeakMap,Rp=new WeakMap,Ln=new WeakSet,dz=function(){var t;this.ui=((t=this.superdoc)==null?void 0:t.ui)??null,this.ui&&(this.snapshot=this.ui.toolbar.getSnapshot(),this._unsubscribeController=this.ui.toolbar.subscribe(()=>{var n;this.snapshot=this.ui.toolbar.getSnapshot(),(n=this.getToolbarItemByName("linkedStyles"))!=null&&n.expand.value&&Ye(this,Ln,JE).call(this),this.updateToolbarState()}),this._detachFormatPainterModeChange=this.ui.formatPainter.onModeChange(n=>{n==="armed"||n==="persistent"?Ye(this,Ln,Ez).call(this):Ye(this,Ln,nk).call(this)}))},fz=function(){var t,n,r;(t=this._unsubscribeController)==null||t.call(this),this._unsubscribeController=null,(n=this._detachFormatPainterModeChange)==null||n.call(this),this._detachFormatPainterModeChange=null,Ye(this,Ln,nk).call(this);for(const i of this._customCommandRegs.values())try{(r=i.unregister)==null||r.call(i)}catch{}this._customCommandRegs.clear(),this.ui=null,this.snapshot=null},hz=function(){if(!this.superdoc||typeof this.superdoc.on!="function"||typeof this.superdoc.off!="function")return;const t=()=>{const n=Ye(this,Ln,tk).call(this);n!==this._lastFontOptionsSignature&&(this._lastFontOptionsSignature=n,Ye(this,Ln,QE).call(this)),this.updateToolbarState()};this.superdoc.on("fonts-changed",t),this._detachFontsChanged=()=>{var n,r;(r=(n=this.superdoc)==null?void 0:n.off)==null||r.call(n,"fonts-changed",t)}},pz=function(){var t;(t=this._detachFontsChanged)==null||t.call(this),this._detachFontsChanged=null},mz=function(){if(Array.isArray(this.config.groups)){this.config.toolbarGroups=this.config.groups,this.config.groups=null;return}this.config.groups&&!Array.isArray(this.config.groups)&&Object.keys(this.config.groups).length&&(this.config.toolbarGroups=Object.keys(this.config.groups))},gz=function(t){var n,r,i;return t||ave(((i=(r=(n=this.superdoc)==null?void 0:n.fonts)==null?void 0:r.getFontFamilyOptions)==null?void 0:i.call(r))??[])},ek=function(){const t=this.getAvailableWidth(),n=new Map(Ye(this,Ln,P0).call(this).filter(x=>x.isCustomToolbarItem&&x.type==="dropdown").map(x=>[x.name.value,x.selectedValue.value])),r=this.config.groups&&!Array.isArray(this.config.groups)&&Object.keys(this.config.groups).length>0,i=r?new Set(Object.values(this.config.groups).flatMap(x=>x)):null,o=new Set(this.config.excludeItems),s=this.config.customButtons||[],l=new Set(Pbe),u=s.map((x,T)=>{var C;try{if(x!=null&&x.name&&l.has(x.name))throw new Error(`Toolbar item name "${x.name}" is already taken by another item, so this entry is skipped.`);const I=Ye(this,Ln,yz).call(this,x);return n.has(I.name.value)&&(I.selectedValue.value=n.get(I.name.value)),l.add((C=I.name)==null?void 0:C.value),I}catch(I){const D=`${(x==null?void 0:x.name)??`<unnamed@${T}>`}::${(I==null?void 0:I.message)??String(I)}`;return this._reportedInvalidCustomItems.has(D)||(this._reportedInvalidCustomItems.add(D),Ye(this,Ln,vd).call(this,I,(x==null?void 0:x.name)??null)),null}}
624).filter(Boolean),d=r?new Set(Object.keys(this.config.groups)):null,f=d?u.filter(x=>{var T;return d.has(((T=x.group)==null?void 0:T.value)||"center")}):u,{defaultItems:p,overflowItems:m}=Ibe({superToolbar:this,toolbarIcons:this.config.icons,toolbarTexts:this.config.texts,toolbarFonts:Ye(this,Ln,gz).call(this,this.config.fonts),hideButtons:this.config.hideButtons,availableWidth:t,role:this.role,isDev:this.isDev,configuredItemNames:i,excludedItemNames:o,additionalItems:f});let y=[...p.map(x=>x.name.value),...m.map(x=>x.name.value)];if(r){const x=Object.values(this.config.groups).flatMap(C=>C),T=u.filter(C=>{var I;return d.has(((I=C.group)==null?void 0:I.value)||"center")}).map(C=>C.name.value);y=[...new Set([...x,...T])]}const b=m.filter(x=>y.includes(x.name.value)&&!o.has(x.name.value)),k=b.length?[...y,"overflow"]:y,S=p.filter(x=>k.includes(x.name.value)).filter(x=>!o.has(x.name.value));if(r)for(const[x,T]of Object.entries(this.config.groups))for(const C of S)T.includes(C.name.value)&&(C.group.value=x);this.toolbarItems=S,this.overflowItems=b},yz=function(t){var i,o;const n=ai({...t});n.isCustomToolbarItem=!0;const r=t.command;if(typeof r=="function"&&((o=(i=this.ui)==null?void 0:i.commands)!=null&&o.register)){const s=`__builtin_toolbar__${t.name}`;if(!this._customCommandRegs.has(s)){const l=this.ui.commands.register({id:s,execute:u=>{const d=u!=null&&u.payload&&typeof u.payload=="object"?u.payload:{};try{const f=r({...u,item:n,argument:d.argument,option:d.option});return f&&typeof f.then=="function"?Promise.resolve(f).catch(p=>(Ye(this,Ln,vd).call(this,p,t.name),!1)):f}catch(f){return Ye(this,Ln,vd).call(this,f,t.name),!1}}});this._customCommandRegs.set(s,l)}}return n},QE=function(){Ye(this,Ln,ek).call(this),this.emit("toolbar-items-changed")},tk=function(){var n,r,i;if(this.config.fonts)return"custom-fonts";const t=((i=(r=(n=this.superdoc)==null?void 0:n.fonts)==null?void 0:r.getFontFamilyOptions)==null?void 0:i.call(r))??[];return JSON.stringify(t.map(o=>[o.label,o.value,o.previewFamily]))},P0=function(){return[...this.toolbarItems,...this.overflowItems]},JE=function(){var n,r,i,o,s,l,u,d,f,p;(i=(r=(n=this.ui)==null?void 0:n.styles)==null?void 0:r.getCatalog)==null||i.call(r,{includePreview:!0});const t=((u=(l=(s=(o=this.ui)==null?void 0:o.styles)==null?void 0:s.getCatalog)==null?void 0:l.call(s,{view:"quickGallery",includePreview:!0}))==null?void 0:u.items)??((p=(f=(d=this.ui)==null?void 0:d.styles)==null?void 0:f.getQuickGallery)==null?void 0:p.call(f))??[];t!==this._linkedStyleOptions.value&&(this._linkedStyleOptions.value=t)},vz=function(t){var n,r,i,o,s;return t==="ruler"?!!((r=(n=this.superdoc)==null?void 0:n.config)!=null&&r.rulers):t==="formattingMarks"?!!((s=(o=(i=this.superdoc)==null?void 0:i.config)==null?void 0:o.layoutEngineOptions)!=null&&s.showFormattingMarks):!1},eA=function(t){var n,r,i,o,s,l,u,d;return t==="watermark"?((i=(r=(n=this.ui)==null?void 0:n.document)==null?void 0:r.getSnapshot)==null?void 0:i.call(r).ready)===!0&&typeof((s=(o=this.ui)==null?void 0:o.watermark)==null?void 0:s.open)=="function":t==="ruler"?typeof((l=this.superdoc)==null?void 0:l.toggleRuler)=="function":t==="formattingMarks"?typeof((u=this.superdoc)==null?void 0:u.toggleFormattingMarks)=="function"||typeof((d=this.superdoc)==null?void 0:d.setShowFormattingMarks)=="function":!1},tA=function(){var l,u,d,f,p,m;const t=this.getToolbarItemByName("documentMode");if(!t)return;const n=(((d=(u=(l=this.snapshot)==null?void 0:l.commands)==null?void 0:u["document-mode"])==null?void 0:d.value)||"editing").toLowerCase(),r=this.config.texts||{},i=this.config.icons||{},o={editing:{label:r.documentEditingMode||"Editing",icon:i.documentEditingMode||i.documentMode},suggesting:{label:r.documentSuggestingMode||"Suggesting",icon:i.documentSuggestingMode||i.documentMode},viewing:{label:r.documentViewingMode||"Viewing",icon:i.documentViewingMode||i.documentMode}},s=o[n]||o.editing;((f=t.label)==null?void 0:f.value)!==void 0&&(t.label.value=s.label),((p=t.defaultLabel)==null?void 0:p.value)!==void 0&&(t.defaultLabel.value=s.label),((m=t.icon)==null?void 0:m.value)!==void 0&&s.icon&&(t.icon.value=s.icon)},bz=function(){const t=this.toolbarItems.find(r=>r.name.value==="highlight");if(!t)return;const n={key:"color",type:"render",render:()=>XE(this,t,[],!0)};t.nestedOptions.value=[n]},wz=function(t){return!!(t!=null&&t.active)&&(t==null?void 0:t.value)==null},xz=function(t){return!!t&&t.disabled===!1&&t.value==null},nA=function(t){var s,l,u,d,f,p,m,y,b,k,S,x;const n=t.name.value;if(t.isCustomToolbarItem&&typeof t.command=="string"){const T=(l=(s=this.snapshot)==null?void 0:s.commands)==null?void 0:l[t.command];return t.setDisabled(t.initiallyDisabled||!T||!!T.disabled),T!=null&&T.active?t.activate():t.deactivate(),!0}if(n==="tableActions"){const T=uz.map(C=>{var I,D;return(D=(I=this.snapshot)==null?void 0:I.commands)==null?void 0:D[C]}).some(C=>C&&!C.disabled);return t.setDisabled(!T),!0}if(n==="search")return t.setDisabled(((f=(d=(u=this.superdoc)==null?void 0:u.uiConfig)==null?void 0:d.search)==null?void 0:f.enabled)!==!0),!0;if(n==="pageNumber"){const T=Obe.map(I=>{var D,P;return(P=(D=this.snapshot)==null?void 0:D.commands)==null?void 0:P[I]}
624),C=((b=(y=(m=(p=this.ui)==null?void 0:p.document)==null?void 0:m.getSnapshot)==null?void 0:y.call(m))==null?void 0:b.mode)==="suggesting";return t.setDisabled(!C&&!T.some(I=>I&&!I.disabled)),!0}if(((k=X3(n))==null?void 0:k.disposition)==="host-routed")return t.setDisabled(!Ye(this,Ln,eA).call(this,n)),Ye(this,Ln,vz).call(this,n)?t.activate():t.deactivate(),!0;const r=pN(n);if(!r)return!1;const i=(x=(S=this.snapshot)==null?void 0:S.commands)==null?void 0:x[r];Dbe(n,i)?t.setDisabled(!1):t.setDisabled(!!(i!=null&&i.disabled));const o={textAlign:()=>{i!=null&&i.value?t.activate({textAlign:i.value}):t.deactivate()},lineHeight:()=>{t.selectedValue.value=(i==null?void 0:i.value)!=null?i.value:""},zoom:()=>{if((i==null?void 0:i.value)!=null){const T=typeof i.value=="number"?`${i.value}%`:String(i.value);t.onActivate({zoom:T})}},measurementUnit:()=>{(i==null?void 0:i.value)!=null&&t.onActivate({measurementUnit:String(i.value)})},documentMode:()=>{Ye(this,Ln,tA).call(this)},link:()=>{t.active.value=!!(i!=null&&i.active),t.attributes.value=ZE(t.attributes.value,(i==null?void 0:i.value)??null)},fontFamily:()=>{if((i==null?void 0:i.value)!=null){t.activate({fontFamily:i.value});return}if(Ye(this,Ln,xz).call(this,i)){t.activate({},!0);return}t.deactivate()},fontSize:()=>{if((i==null?void 0:i.value)!=null){t.activate({fontSize:i.value});return}if(Ye(this,Ln,wz).call(this,i)){t.activate({},!0);return}t.deactivate()},color:()=>{(i==null?void 0:i.value)!=null?t.activate({color:i.value}):t.deactivate()},highlight:()=>{(i==null?void 0:i.value)!=null?t.activate({color:i.value}):t.deactivate()},linkedStyles:()=>{var D;const T=i==null?void 0:i.value,C=typeof T=="string"?T:T==null?void 0:T.styleId,I=T&&typeof T=="object"?T.styleName:null;C?t.activate({styleId:C,styleName:I}):t.label.value=((D=this.config.texts)==null?void 0:D.formatText)||"Format text"},list:()=>{i!=null&&i.active?(t.activate(),t.selectedValue.value=i.value):(t.deactivate(),t.selectedValue.value=null)},numberedlist:()=>{i!=null&&i.active?(t.activate(),t.selectedValue.value=i.value):(t.deactivate(),t.selectedValue.value=null)},default:()=>{i!=null&&i.active?t.activate():t.deactivate()}};return(o[n]??o.default)(),!0},kz=function(){Ye(this,Ln,P0).call(this).forEach(t=>{const{allowWithoutEditor:n}=t;n!=null&&n.value||t.setDisabled(!0)})},_z=function(t,n){const r=this.superdoc;if(t==="watermark"){if(!Ye(this,Ln,eA).call(this,t))return!1;const i=this.ui.watermark.open();if(!i.ok)throw new Error(`[superdoc toolbar] Watermark dialog unavailable: ${i.reason}`);return!0}if(t==="ruler")return typeof(r==null?void 0:r.toggleRuler)=="function"?(r.toggleRuler(),!0):!1;if(t==="formattingMarks"){if(typeof n=="boolean"&&typeof(r==null?void 0:r.setShowFormattingMarks)=="function")return r.setShowFormattingMarks(n),!0;if(typeof(r==null?void 0:r.toggleFormattingMarks)=="function")return r.toggleFormattingMarks(),!0}return!1},Cz=function(t,n){var s,l;const r=(s=t==null?void 0:t.name)==null?void 0:s.value;if(!r)return!1;const i={firstParty:!0,onSettled:()=>this.updateToolbarState(),onError:u=>Ye(this,Ln,vd).call(this,u,r)};if(r==="image"&&n==null)return Ye(this,Ln,Sz).call(this);if(r==="tableActions"){const u=cz[n==null?void 0:n.command];return u?xx(this.ui,u,void 0,i):!1}if(((l=X3(r))==null?void 0:l.disposition)==="unsupported")return!0;const o=pN(r);return o?xx(this.ui,o,n,i):!1},Sz=function(){var t,n,r,i;return(r=(n=(t=this.snapshot)==null?void 0:t.commands)==null?void 0:n.image)!=null&&r.disabled||(Ae(this,Ip)||Ot(this,Ip,DK({ownerDocument:((i=this.toolbarContainer)==null?void 0:i.ownerDocument)??document,onPick:async o=>{var l,u;const s=await NK(o,(u=(l=this.superdoc)==null?void 0:l.config)==null?void 0:u.handleImageUpload);xx(this.ui,"image",{src:s},{firstParty:!0,onSettled:()=>this.updateToolbarState(),onError:d=>Ye(this,Ln,vd).call(this,d,"image")})},onError:o=>Ye(this,Ln,vd).call(this,o,"image")})),Ae(this,Ip).open()),!0},Ez=function(){var s,l;if(Ae(this,Rp))return;const t=((l=(s=this.superdoc)==null?void 0:s.activeEditor)==null?void 0:l.container)??document,n=u=>{mN(u.target)||this.ui.formatPainter.setPointerSelecting(!0)},r=u=>{this.ui.formatPainter.setPointerSelecting(!1),!mN(u.target)&&this.ui.formatPainter.notifyPointerUp()},i=u=>{if(u.key==="Escape"){this.ui.formatPainter.cancel();return}Lbe(u)&&this.ui.formatPainter.setKeyboardSelecting(!0)},o=()=>{this.ui.formatPainter.setKeyboardSelecting(!1),this.ui.formatPainter.notifyKeyUp()};t.addEventListener("pointerdown",n),t.addEventListener("pointerup",r),t.addEventListener("keydown",i),t.addEventListener("keyup",o),Ot(this,Rp,()=>{t.removeEventListener("pointerdown",n),t.removeEventListener("pointerup",r),t.removeEventListener("keydown",i),t.removeEventListener("keyup",o)})},nk=function(){Ae(this,Rp)&&(Ae(this,Rp).call(this),Ot(this,Rp,null))},vd=function(t,n){var o,s,l;const r={error:t instanceof Error?t:new Error(String(t)),originalError:t,itemName:n??null,editor:((o=this.superdoc)==null?void 0:o.activeEditor)??this.activeEditor??null},i={...r};
624this.emit("exception",r),(l=(s=this.superdoc)==null?void 0:s.emit)==null||l.call(s,"exception",i)},KM);function jbe(e){return new Bbe(e)}var Fbe=['[data-sdt-type="structuredContent"][data-sdt-id]','[data-sdt-type="structuredContent"][data-sdt-container-id]','[data-sdt-container-type="structuredContent"][data-sdt-container-id]'].join(", "),zbe=800,YM,gN=typeof Blob=="function"?(YM=Object.getOwnPropertyDescriptor(Blob.prototype,"size"))==null?void 0:YM.get:void 0,yN=e=>{if(!gN)return!1;try{return gN.call(e),!0}catch{return!1}};function Ube(e){return e.key==="Alt"||e.key==="Control"||e.key==="Meta"||e.key==="Shift"||(e.ctrlKey||e.metaKey)&&e.shiftKey&&!e.altKey&&(e.code==="Digit8"||e.key==="8"||e.key==="*")?!0:(e.ctrlKey||e.metaKey)&&["b","c","f","i","s","u"].includes(e.key.toLowerCase())}var Vbe=Object.freeze(["#FF6B6B","#4ECDC4","#45B7D1","#FFA07A","#98D8C8","#F7DC6F","#BB8FCE","#85C1E2","#F1948A","#82E0AA","#F8C471","#AED6F1","#D7BDE2","#A3E4D7","#F0B27A","#AEB6BF","#E74C3C","#2ECC71","#3498DB","#E67E22","#1ABC9C","#9B59B6","#34495E","#F39C12"]),Hbe=["original","markup","final"],$be=["review","original","final","off"];function Az(e){return Hbe.includes(e)}function Gbe(e){return e==="markup"?"review":e}function vN(e){return $be.includes(e)}function qbe(e){var r,i,o,s;const t=(i=(r=e.modules)==null?void 0:r.trackChanges)==null?void 0:i.mode;if(vN(t))return t;const n=(s=(o=e.layoutEngineOptions)==null?void 0:o.trackedChanges)==null?void 0:s.mode;return vN(n)?n:null}function kx(e,t){var o,s,l;const n=e.viewing,r=Az(n==null?void 0:n.trackedChanges)?n.trackedChanges:null,i=r?Gbe(r):t||(((o=e.trackChanges)==null?void 0:o.visible)===!0?"review":"original");return{comments:typeof(n==null?void 0:n.comments)=="boolean"?n.comments:((s=e.comments)==null?void 0:s.visible)===!0,renderMode:i,trackChangesVisible:r?r==="markup":((l=e.trackChanges)==null?void 0:l.visible)===!0}}async function Wbe(e,t){const n=new Cae.default;return e.forEach((r,i)=>{n.file(t[i],r)}),n.generateAsync({type:"blob",compression:"DEFLATE"})}function e4(e){return!!(e&&(e.synced===!0||e.isSynced===!0))}function bN(e){try{e.synced=!0}catch{}try{e.isSynced=!0}catch{}}function Kbe(e,t){if(!e)return()=>{};if(e4(e))return t(),()=>{};const n=typeof e.on=="function"?e.on.bind(e):null,r=typeof e.off=="function"?e.off.bind(e):null;if(!n)return t(),()=>{};let i=!1;const o=()=>{i||(i=!0,r==null||r("synced",l),r==null||r("sync",u))},s=()=>{i||(o(),t())},l=()=>{bN(e),s()},u=d=>{d!==!1&&(d===!0||e4(e))&&(bN(e),s())};return n("synced",l),n("sync",u),e4(e)&&s(),o}function Ybe(e,t){var l,u;const n=e.composedPath();if(!n.includes(t))return null;const r=n.find(d=>d instanceof HTMLElement&&d.matches(Fbe));if(!r)return null;const i=n.some(d=>d instanceof HTMLElement&&d.classList.contains(AK.BLOCK_SDT_LABEL)),o=((l=r.getAttribute("data-sdt-container-id"))==null?void 0:l.trim())||null,s=((u=r.getAttribute("data-sdt-id"))==null?void 0:u.trim())||null;return i?o??s:s??o}function Xbe(e){if(!e||typeof e!="object")return[];const t=e.items;return Array.isArray(t)?t:[]}function wN(e){var r,i;if(!e||typeof e.id!="string"||e.kind!=="inline"&&e.kind!=="block"||typeof e.controlType!="string")return null;const t=(r=e.properties)==null?void 0:r.tag,n=(i=e.properties)==null?void 0:i.alias;return{id:e.id,controlType:e.controlType,scope:e.kind,...typeof t=="string"&&t?{tag:t}:{},...typeof n=="string"&&n?{alias:n}:{}}}function xN(e){const t=e.selectionTarget??e.target;if(!t)return null;try{return JSON.stringify(t)}catch{return null}}function Zbe(e,t){switch(e.state){case"failed":return"failed";case"degraded":return e.detail==="reconnecting"?"reconnecting":"lost";case"synced":return t?"recovered":"initial";default:return t?"reconnecting":"initial"}}function ml(e){return!!(e&&typeof e=="object"&&e.editorVersion===2)}function kN(e){return typeof e=="string"&&e.length>0?e:null}function _N(e){var t,n;return e?ml(e)?kN(e.documentId??((t=e.options)==null?void 0:t.documentId)??null):kN(typeof e.getDocumentId=="function"?e.getDocumentId():(n=e.options)==null?void 0:n.documentId):null}function Qbe(e){if(!e||ml(e))return null;const t=e;
624return t.documentRenderer??t.presentationEditor??null}function Su(e){if(!e)return null;if(ml(e))return e.fonts??null;const t=Qbe(e);return t?{getReport:()=>{var n;return((n=t.getFontReport)==null?void 0:n.call(t))??[]},getMissingFonts:()=>{var n;return((n=t.getMissingFonts)==null?void 0:n.call(t))??[]},getDocumentFonts:()=>{var n;return[...new Set((((n=t.getFontReport)==null?void 0:n.call(t))??[]).map(r=>r.logicalFamily))]},getDocumentFontOptions:()=>{var n;return((n=t.getDocumentFontOptions)==null?void 0:n.call(t))??[]},getFontFamilyOptions:()=>{var n;return((n=t.getFontFamilyOptions)==null?void 0:n.call(t))??[]},getLastFontsChangedPayload:()=>{var n;return((n=t.getLastFontsChangedPayload)==null?void 0:n.call(t))??null},map:n=>t.mapFonts(n),unmap:n=>t.unmapFonts(n),add:n=>t.addFonts(Array.isArray(n)?n:[n]),preload:n=>t.preloadFonts(n)}:null}var Ga,s2,eg,Uf,Ad,Op,Np,Mp,Vf,tg,eu,Hf,tu,Td,ng,Dp,kc,nu,$f,Lp,Gf,my,Pp,gy,yy,_c,ru,Bp,rg,qf,Ls,jp,ig,Wf,at,Tz,Iz,Rz,Oz,rk,Nz,Mz,Dz,yo,Lz,Pz,e1e,Bz,ik,jz,Fz,zz,Uz,rA,Vz,Bb,Hz,$z,Gz,qz,Wz,Kz,pl,t1e,jb,Yz,Xz,Fb,iA,Zz,Qz,Jz,B0,oA,n1e,r1e,i1e,o1e,eU,sA,tU,nU,vy,by,rU,aA,wy,zb,iU,ok,og,Ub,Fp,lA,oU,sU,cA,aU,sk,uA,Vb,lU,dA,ak,lk,fA,hA,xy,Jbe=(xy=class extends qA.default{constructor(n){super();Cn(this,at);Cn(this,Ga);Cn(this,s2);Cn(this,eg);Cn(this,Uf);Cn(this,Ad);Cn(this,Op);Cn(this,Np);Cn(this,Mp);Cn(this,Vf);Cn(this,tg);Cn(this,eu);Cn(this,Hf);Cn(this,tu);Cn(this,Td);Cn(this,ng);Cn(this,Dp);Cn(this,kc);Cn(this,nu);Cn(this,$f);Cn(this,Lp);Cn(this,Gf);Cn(this,my);Cn(this,Pp);Cn(this,gy);Cn(this,yy);Cn(this,_c);Cn(this,ru);Cn(this,Bp);Cn(this,rg);Cn(this,qf);Cn(this,Ls);Cn(this,jp);Cn(this,ig);Cn(this,Wf);Cn(this,vy);Cn(this,by);Cn(this,wy);Cn(this,og);Cn(this,Fp);if(Ot(this,Ga,!1),Ot(this,eg,!1),Ot(this,Uf,null),Ot(this,Ad,null),Ot(this,Op,null),Ot(this,Np,null),Ot(this,Mp,null),Ot(this,Vf,null),Ot(this,tg,!1),Ot(this,eu,null),Ot(this,Hf,null),Ot(this,tu,null),Ot(this,Td,null),Ot(this,ng,!1),Ot(this,Dp,!1),Ot(this,kc,null),Ot(this,nu,null),Ot(this,$f,!1),Ot(this,Lp,null),Ot(this,Gf,null),Ot(this,my,i=>{this.listenerCount("content-control:active-change")>0&&(Ae(this,$f)||Ot(this,Lp,i.pointerId),Ot(this,$f,!0),Ot(this,kc,"pointer"),Ot(this,nu,null))}),Ot(this,Pp,i=>{i.pointerId===Ae(this,Lp)&&(Ot(this,$f,!1),Ot(this,Lp,null),Ae(this,kc)??Ot(this,kc,"pointer"),Ae(this,kc)==="pointer"&&Ot(this,nu,Date.now()+zbe))}),Ot(this,gy,i=>{this.listenerCount("content-control:active-change")>0&&!Ube(i)&&(Ot(this,kc,"keyboard"),Ot(this,nu,null))}),Ot(this,yy,i=>{Ye(this,at,Tz).call(this,i)}),Ot(this,_c,null),Ot(this,ru,nN({})),Ot(this,Bp,rN({})),Ot(this,rg,oN({})),this.version="0.0.0",this.users=[],this.whiteboard=null,this.colors=[],this.readyEditors=0,Ot(this,Ls,new aye),Ot(this,jp,null),Ot(this,ig,!1),Ot(this,Wf,null),this.config={selector:"#superdoc",documentMode:"editing",allowSelectionInViewMode:!1,role:"editor",documents:[],editorExtensions:[],colors:[],users:[],user:{...WE},layoutEngineOptions:{},modules:{},licenseKey:void 0,telemetry:{enabled:!0},title:"SuperDoc",conversations:[],isInternal:!1,comments:{visible:!1},toolbarGroups:["left","center","right"],toolbarIcons:{},toolbarTexts:{},uiDisplayFallbackFont:"Arial, Helvetica, sans-serif",isDev:!1,disablePiniaDevtools:!1,onEditorBeforeCreate:()=>null,onEditorCreate:()=>null,onEditorDestroy:()=>null,onSourceComplete:()=>null,onSourceSignalsComplete:()=>null,onContentError:()=>null,onReady:()=>null,onCommentsUpdate:()=>null,onContentControlActiveChange:()=>null,onContentControlClick:()=>null,onAwarenessUpdate:()=>null,onLocked:()=>null,onPdfDocumentReady:()=>null,onSidebarToggle:()=>null,onCollaborationReady:()=>null,onEditorUpdate:()=>null,onCommentsListChange:()=>null,onException:()=>null,onListDefinitionsChange:()=>null,onPaginationUpdate:()=>null,onTransaction:()=>null,disableContextMenu:!1,viewOptions:{layout:"print"},useLayoutEngine:!0},Ot(this,vy,new WeakSet),Ot(this,by,new WeakMap),Ot(this,wy,null),Ot(this,og,null),Ot(this,Fp,null),!n.selector)throw new Error("SuperDoc: selector is required");const r=typeof n.selector=="string"?document.querySelector(n.selector):n.selector;if(!(r instanceof HTMLElement))throw new Error("SuperDoc: selector must be a valid CSS selector string or DOM element");Ot(this,s2,CK(this,n,()=>this.version,r)),Ot(this,qf,new O0e({getModuleConfig:()=>Ae(this,rg)})),Ot(this,tu,r),r.addEventListener("pointerdown",Ae(this,my),!0),r.ownerDocument.addEventListener("pointerup",Ae(this,Pp),!0),r.ownerDocument.addEventListener("pointercancel",Ae(this,Pp),!0),r.addEventListener("keydown",Ae(this,gy),!0),r.addEventListener("click",Ae(this,yy),!0),Ye(this,at,yo).call(this,"content-control:active-change",n.onContentControlActiveChange),Ye(this,at,Iz).call(this,n,r),Ot(this,Dp,!0),this.listenerCount("content-control:active-change")>0&&this.ui}get uiConfig(){return Ae(this,ru)}get interactionConfig(){return Ae(this,Bp)}get surfacesConfig(){return Ae(this,rg)}get requiredNumberOfEditors(){return Ye(this,at,pl).call(this,"requiredNumberOfEditors").documents.filter(n=>n.type===Ho).length}get ui(){return Ae(this,_c)||(Ot(this,_c,kZ({superdoc:this})),Ae(this,Ga)&&Ae(this,_c).destroy()),Ye(this,at,Nz).call(this),Ae(this,_c)}get diagnostics(){return Ae(this,s2)}emit(n,...r){return(n==="exception"||n==="document-replaced"||n==="ready"||n==="active-editor-change"||n==="collaboration-ready"||n==="collaboration-connection-change"||n==="locked")&&b1(this,n,()=>r[0]),super.emit(n,...r)}on(n,r,i){return super.on(n,r,i),n==="content-control:active-change"&&Ae(this,Dp)&&this.ui,this}addListener(n,r,i){return super.addListener(n,r,i),n==="content-control:active-change"&&Ae(this,Dp)&&this.ui,this}once(n,r,i){return super.once(n,r,i),n==="content-control:active-change"&&Ae(this,Dp)&&this.ui,this}removeListener(n,r,i,o){return super.removeListener(n,r,i,o),Ye(this,at,rk).call(this),this}off(n,r,i,o){return super.off(n,r,i,o),Ye(this,at,rk).call(this),this}removeAllListeners(n){return super.removeAllListeners(n),Ye(this,at,rk).call(this),this}get state(){return{documents:Ye(this,at,pl).call(this,"state").documents.map(n=>_p(n.data)?{...n,data:kE(n.data,n.type||"application/vnd.openxmlformats-officedocument.wordprocessingml.document")}:n),users:this.users}}getDocumentRuntimeForDocument(n){var r,i,o;
624return typeof n!="string"||n.length===0?null:((o=(i=(((r=this.superdocStore)==null?void 0:r.documents)??[]).find(s=>{var l,u,d;return((d=(u=(l=s==null?void 0:s.getEditor)==null?void 0:l.call(s))==null?void 0:u.options)==null?void 0:d.documentId)===n}))==null?void 0:i.getDocumentRuntime)==null?void 0:o.call(i))??null}getComment(n){var r,i;return typeof n!="string"||n.length===0?null:((i=(r=this.commentsStore)==null?void 0:r.getComment)==null?void 0:i.call(r,n))??null}get element(){return typeof this.config.selector=="string"?document.querySelector(this.config.selector):this.config.selector}getCollaborationConnectionState(){return Ae(this,Vf)}async upgradeToCollaboration(n){if(Ae(this,Uf)){const{target:o}=Ye(this,at,sA).call(this,n);if(Ye(this,at,$z).call(this,o,Ae(this,Uf).target))return Ae(this,Uf).promise;throw Object.assign(new Error("SuperDoc: a different collaboration target is already upgrading"),{code:"collaboration-upgrade-target-conflict"})}const{target:r}=Ye(this,at,eU).call(this,n);Ot(this,eg,!0);const i=(async()=>{var o,s,l;try{const u=await Ye(this,at,Jz).call(this),d=Ye(this,at,qz).call(this),f=Ye(this,at,Gz).call(this);Ye(this,at,Kz).call(this);try{Ot(this,eu,f);const p=await Ye(this,at,Zz).call(this,r,u);Ye(this,at,Qz).call(this,p,r),Ot(this,eu,null);const m=(s=(o=this.activeEditor)==null?void 0:o.options)==null?void 0:s.documentId,y=(l=p.configDoc.v2Collaboration)==null?void 0:l.documentId;if(typeof m!="string"||m!==p.configDoc.id||typeof y!="string"||y!==r.documentId)throw new Error("SuperDoc: collaboration upgrade did not attach the expected room and document");return{roomId:y,documentId:m}}catch(p){throw Ye(this,at,Wz).call(this,d),p}}finally{Ot(this,Ad,null),Ot(this,eg,!1),Ot(this,Uf,null)}})();return Ot(this,Uf,{target:r,promise:i}),i}addSharedUser(n){Ye(this,at,jb).call(this,"addSharedUser");const r=F0({actor:n});r&&this.users.some(i=>F0({actor:i})===r)||this.users.push(n)}removeSharedUser(n){Ye(this,at,jb).call(this,"removeSharedUser");const r=typeof n=="string"?lE(n):"",i=typeof n=="string"?`email:${r}`:F0({actor:n});this.users=this.users.filter(o=>{const s=F0({actor:o});return i?s!==i:r?lE(o.email)!==r:!0})}onContentError({error:n,editor:r}){var d,f,p;const i=(d=r.options)==null?void 0:d.documentId,o=Ye(this,at,pl).call(this,"onContentError").documents.find(m=>m.id===i),s=typeof(o==null?void 0:o.id)=="string"?o.id:typeof i=="string"?i:"",l=o==null?void 0:o.data,u=yN(l)?l:_p(l)?Ye(this,at,B0).call(this,l):l==null?l:void 0;(p=(f=this.config).onContentError)==null||p.call(f,{error:n,editor:r,documentId:s,file:u})}broadcastPdfDocumentReady(){this.emit("pdf:document-ready")}broadcastReady(){this.readyEditors===this.requiredNumberOfEditors&&this.emit("ready",{superdoc:this})}broadcastEditorBeforeCreate(n){this.emit("editorBeforeCreate",{editor:q7(n)})}broadcastEditorCreate(n){this.readyEditors++,this.broadcastReady(),Ye(this,at,rU).call(this,n),this.emit("editorCreate",{editor:q7(n)})}broadcastSourceComplete(){this.emit("source:complete")}broadcastSourceSignalsComplete(){this.emit("source:signals-complete")}broadcastEditorDestroy(){this.emit("editorDestroy")}broadcastSidebarToggle(n){this.emit("sidebar-toggle",n)}get fonts(){return Ae(this,og)||Ot(this,og,{getReport:()=>{var n;return((n=Su(this.activeEditor))==null?void 0:n.getReport())??[]},getMissingFonts:()=>{var n;return((n=Su(this.activeEditor))==null?void 0:n.getMissingFonts())??[]},getDocumentFontOptions:()=>{var n;return((n=Su(this.activeEditor))==null?void 0:n.getDocumentFontOptions())??[]},getFontFamilyOptions:()=>{var n;return((n=Su(this.activeEditor))==null?void 0:n.getFontFamilyOptions())??[]},getDocumentFonts:()=>{var n;return((n=Su(this.activeEditor))==null?void 0:n.getDocumentFonts())??[]},onReport:n=>{var o,s;const r=this.activeEditor,i=r?((s=(o=Su(r))==null?void 0:o.getLastFontsChangedPayload)==null?void 0:s.call(o))??null:Ae(this,wy)??null;return i&&n(i),this.on("fonts-changed",n),()=>this.off("fonts-changed",n)},map:n=>{if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("superdoc.fonts.map requires a mapping object, for example { Aptos: 'Carlito' }");const r=Su(this.activeEditor);if(!r)throw new Error("superdoc.fonts.map requires an active editor");r.map(n)},unmap:n=>{const r=Su(this.activeEditor);if(!r)throw new Error("superdoc.fonts.unmap requires an active editor");r.unmap(n)},add:n=>{const r=Su(this.activeEditor);if(!r)throw new Error("superdoc.fonts.add requires an active editor");r.add(n)},preload:n=>{const r=Su(this.activeEditor);if(!r)throw new Error("superdoc.fonts.preload requires an active editor");return r.preload(n)}}),Ae(this,og)}setActiveEditor(n){Ye(this,at,cA).call(this,n)}getV2FeatureMatrix(){return[{feature:"source.docx-bytes",status:"supported",reason:"SuperDoc normalizes File/Blob/ArrayBuffer/Uint8Array DOCX inputs for the separate DOCX Engine dependency"},{feature:"source.url",status:"supported",reason:"shell-owned source normalization resolves URL-backed DOCX inputs before opening the injected v2 editor"},{feature:"source.blank",status:"supported",reason:"shell-owned blank-document seeding resolves to DOCX bytes before mounting the injected v2 editor"},{feature:"execution.browser-worker",status:"supported",reason:"the shipped public v2 shell opens DOCX documents through the browser-worker path by default when collaboration is not active"},{feature:"distribution.cdn-iife",status:"supported",reason:"the CDN/IIFE distribution ships the public bundle plus the emitted v2 browser-worker asset and opens DOCX documents through the worker-backed v2 runtime"},{feature:"docx.open-render",status:"supported",reason:"superdoc@2 opens and renders DOCX documents through its DOCX Engine dependency"},{feature:"docx.review-handles",status:"supported",reason:"Comment/tracked-change list + decide via v2 host handles"},{feature:"shell.toolbar",status:"supported",reason:"new SuperDoc({ toolbar }) mounts the rendered built-in toolbar shell and the superdoc.toolbar handle, both backed by the V2 command controller and the internal 
624compatibility catalog. Explicit item-level limits stay fail-closed in the shared command matrix (for example search replace and copyFormat)."},{feature:"shell.rich-formatting",status:"supported",reason:"Rich inline, paragraph, and list formatting route through the V2 command controller and public Document API (format.* / styles.* / lists.*): bold, italic, underline, strikethrough, font family/size, text/highlight color, alignment, line spacing, linked styles, bullet/numbered lists, indent, and clear formatting."},{feature:"shell.comments-sidebar",status:"supported",reason:"ui-phase3-002: v2 comments adapter routes create/reply/edit/resolve/delete through V2EditorHost.dispatch"},{feature:"shell.comments-sidebar.reopen",status:"supported",reason:'ui-phase3-002: v2 comments sidebar reopens resolved threads through the v2 comments adapter (activeEditor.doc.comments.patch({ status: "active" }))'},{feature:"shell.tracked-change-sidebar",status:"supported",reason:"SD-3722: v2 tracked-change adapter lists and decides exact body, header/footer-part, and note targets"},{feature:"shell.tracked-change-sidebar.bulk",status:"supported",reason:"SD-4039/SD-4040: the shipped v2 command posture exposes all-story Accept All and Reject All through the canonical doc.trackChanges.decide({ target: { kind: 'all' } }) mutation"},{feature:"shell.tracked-change-sidebar.non-body",status:"supported",reason:"SD-3722: public v2 shell hydrates and targets header/footer-part and note tracked changes"},{feature:"shell.comments-sidebar.persistence",status:"supported",reason:"ui-phase3-004: comment create/reply/edit/resolve/delete persist through SuperDoc.export() → re-mount via the v2 host save bridge"},{feature:"shell.tracked-change-sidebar.persistence",status:"supported",reason:"ui-phase3-004: tracked-change accept/reject persist through SuperDoc.export() → re-mount via the v2 host save bridge"},{feature:"shell.comments-sidebar.author-required",status:"supported",reason:"ui-phase3-004: v2 comments adapter surfaces commentCommandsReason=author-required from the host capability matrix; write controls disable and forced dispatch reports ok:false"},{feature:"shell.find-replace",status:"supported",reason:"Ctrl/Cmd+F opens the SuperDoc find/replace surface in v2; find/navigation/replace/replaceAll route through the single host search session (host.search) via ui.search, with replace failing closed in viewing/read-only mode"},{feature:"shell.ai-writer",status:"supported",reason:"built-in toolbar renders the modules.ai-gated AI writer and applies generated text through the public Document API facade"},{feature:"shell.collaboration",status:"supported",reason:"v2 single-doc collaboration (hocuspocus, y-websocket, liveblocks, and registered provider extensions) is wired through document.collaboration, including collaboration-ready, awareness-update, and locked event bridges; external { ydoc, provider } instances remain unsupported"},{feature:"shell.context-menu",status:"supported",reason:"v2 renders the built-in right-click and slash context menu, forwards ui.contextMenu custom items, and honors ui.contextMenu: false for application-owned replacements"},{feature:"shell.page-metrics",status:"supported",reason:"ui-phase4-001: v2 page metrics snapshot (editorVersion: 2, documentId, renderEpoch, layoutGeneration, zoom, pages[], capabilities) available via superdoc.activeEditor.pageMetrics.{ getSnapshot, subscribe, setZoom, scrollToPage, revealBodyTarget, pageIndexForBodyTarget }"},{feature:"shell.zoom",status:"supported",reason:"ui-phase4-001: SuperDoc.setZoom routes to V2EditorHost.setZoom in v2 mode; single CSS-transform wrapper applies scale to the painted document, page metrics viewport coords scale with the same zoom value"},{feature:"shell.ruler-page-margins",status:"supported",reason:"ui-phase4-002: v2 ruler renders against the V2PageMetricsSnapshot and dispatches margin drags through a narrow v2 page-layout bridge (`activeEditor.pageLayout.setMargins(...)`) backed by `doc.sections.setPageMargins(...)`. The v2 page metrics snapshot now reports `capabilities.marginEdit = { supported: true }`"},{feature:"shell.custom-extensions",status:"supported",reason:"superdoc@2 supports customer extensions through `extensions` + `defineSuperDocExtension`; command execution and diagnostics are exposed through the narrow `activeEditor.extensions` facet. Legacy ProseMirror `editorExtensions` are ignored in v2."},{feature:"pdf.viewer",status:"supported",reason:"editorVersion ignored for PDF documents"},{feature:"html.viewer",status:"supported",reason:"editorVersion ignored for HTML documents"}]}get v2(){return this.editorVersion!==2?null:{version:2,featureMatrix:this.getV2FeatureMatrix()}}
624registerEditorRuntime(n){Ae(this,Ls).register(n)}unregisterEditorRuntime(n){return Ae(this,Ls).unregister(n)}getActiveRuntime(){return Ae(this,Ls).getActive()}setActiveRuntime(n,r){Ae(this,Ls).setActive(n,r)}resolveRuntimeFromEventTarget(n){return Ae(this,Ls).resolveFromEventTarget(n)}activateRuntimeFromEventTarget(n,r){const i=Ae(this,Ls).resolveFromEventTarget(n);return i?(Ae(this,Ls).setActive(i.id,r),!0):!1}toggleRuler(){var r,i;const n=Ye(this,at,pl).call(this,"toggleRuler");this.config.rulers=!this.config.rulers,n.documents.forEach(o=>{o.rulers=this.config.rulers}),(i=(r=this.toolbar)==null?void 0:r.updateToolbarState)==null||i.call(r)}canPerformPermission({permission:n,role:r=this.config.role,isInternal:i=this.config.isInternal,comment:o=null,trackedChange:s=null}={}){var d;if(!n)return!1;let l=o??(s==null?void 0:s.comment)??null;const u=(s==null?void 0:s.commentId)||(s==null?void 0:s.id);if(!l&&u&&((d=this.commentsStore)!=null&&d.getComment)){const f=this.commentsStore.getComment(u),p=f==null?void 0:f.getValues;l=typeof p=="function"?p.call(f):f}return Lf(n,r,i,{superdoc:this,currentUser:this.config.user,comment:l??null,trackedChange:s??null})}addCommentsList(n){var r,i,o,s;!((i=(r=this.config)==null?void 0:r.modules)!=null&&i.comments)||this.config.role==="viewer"||((o=this.commentsList)==null||o.close(),n&&(this.config.modules.comments.element=n),this.commentsList=new Wue((s=this.config.modules)==null?void 0:s.comments,this),this.config.onCommentsListChange&&this.config.onCommentsListChange({isRendered:!0}),this.emit("comments-list-change",{isRendered:!0}))}removeCommentsList(){this.commentsList&&(this.commentsList.close(),this.commentsList=null,this.config.onCommentsListChange&&this.config.onCommentsListChange({isRendered:!1}),this.emit("comments-list-change",{isRendered:!1}))}scrollToComment(n,r={}){var d,f,p,m,y;if(!((f=(d=this.config)==null?void 0:d.modules)!=null&&f.comments)||!n||typeof n!="string")return!1;const i=this.element||document,o=(p=globalThis.CSS)!=null&&p.escape?globalThis.CSS.escape(n):n.replace(/"/g,'\\"'),s=i.querySelector(`[data-comment-ids*="${o}"]`);if(!s)return!1;const{behavior:l="smooth",block:u="start"}=r??{};return s.scrollIntoView({behavior:l,block:u}),(y=(m=this.commentsStore)==null?void 0:m.setActiveComment)==null||y.call(m,this,n),!0}async navigateTo(n){var o,s,l;const r=(o=this.superdocStore)==null?void 0:o.documents;if(!(r!=null&&r.length))return!1;const i=(l=(s=r[0]).getDocumentRuntime)==null?void 0:l.call(s);return i!=null&&i.navigateTo?i.navigateTo(n):!1}async scrollToElement(n){var o,s,l;const r=(o=this.superdocStore)==null?void 0:o.documents;if(!(r!=null&&r.length))return!1;const i=(l=(s=r[0]).getDocumentRuntime)==null?void 0:l.call(s);return i!=null&&i.scrollToElement?i.scrollToElement(n):!1}setDisableContextMenu(n=!0){var i,o;if(!n&&Ae(this,ru).contextMenu.suppressed)return;const r=!!n;this.config.disableContextMenu!==r&&(this.config.disableContextMenu=r,(o=(i=this.superdocStore)==null?void 0:i.documents)==null||o.forEach(s=>{var d,f;const l=(d=s.getDocumentRuntime)==null?void 0:d.call(s);l!=null&&l.setContextMenuDisabled&&l.setContextMenuDisabled(r);const u=(f=s.getEditor)==null?void 0:f.call(s);u!=null&&u.setOptions&&u.setOptions({disableContextMenu:r})}))}setShowBookmarks(n=!0){var o,s;const r=!!n,i=this.config.layoutEngineOptions=this.config.layoutEngineOptions||{};i.showBookmarks!==r&&(i.showBookmarks=r,(s=(o=this.superdocStore)==null?void 0:o.documents)==null||s.forEach(l=>{var u,d,f;(f=(d=(u=l.getDocumentRuntime)==null?void 0:u.call(l))==null?void 0:d.setShowBookmarks)==null||f.call(d,r)}))}setShowFormattingMarks(n=!0){var o,s,l,u;const r=!!n,i=this.config.layoutEngineOptions=this.config.layoutEngineOptions||{};i.showFormattingMarks!==r&&(i.showFormattingMarks=r,(s=(o=this.superdocStore)==null?void 0:o.documents)==null||s.forEach(d=>{var f,p,m;(m=(p=(f=d.getDocumentRuntime)==null?void 0:f.call(d))==null?void 0:p.setShowFormattingMarks)==null||m.call(p,r)}),this.emit("formatting-marks-change",{showFormattingMarks:r,superdoc:this}),(u=(l=this.toolbar)==null?void 0:l.updateToolbarState)==null||u.call(l))}toggleFormattingMarks(){var r;const n=!!((r=this.config.layoutEngineOptions)!=null&&r.showFormattingMarks);this.setShowFormattingMarks(!n)}setDocumentMode(n){if(!n)return;Ye(this,at,jb).call(this,"setDocumentMode");const r=n.toLowerCase(),i=this.config.role==="viewer"?"viewing":this.config.role==="suggester"&&r==="editing"?"suggesting":r;
624this.config.documentMode=i,K3(this.config),Ye(this,at,lk).call(this);const o={viewing:()=>Ye(this,at,ak).call(this),editing:()=>Ye(this,at,lU).call(this),suggesting:()=>Ye(this,at,dA).call(this)};o[i]&&(o[i](),this.emit("document-mode-change",{documentMode:i}))}setTrackedChangesPreferences(n){typeof(n==null?void 0:n.enabled)=="boolean"&&(this.config.trackChanges={...this.config.trackChanges,enabled:n.enabled},this.config.modules.trackChanges={...this.config.modules.trackChanges,enabled:n.enabled}),Ye(this,at,Vb).call(this,n)}setViewingOptions(n){if(!n||typeof n!="object")return;Ye(this,at,jb).call(this,"setViewingOptions");const r=kx(this.config,Ae(this,Wf)),i={...this.config.viewing},o=typeof n.comments=="boolean",s=Az(n.trackedChanges);if(!(!o&&!s)&&(o&&(i.comments=n.comments),s&&(i.trackedChanges=n.trackedChanges),this.config.viewing=i,typeof i.comments=="boolean"&&(this.config.comments={...this.config.comments,visible:i.comments}),s&&K3(this.config),Ye(this,at,lk).call(this),this.config.documentMode==="viewing")){const l=kx(this.config,Ae(this,Wf)),u=r.comments||r.trackChangesVisible,d=l.comments||l.trackChangesVisible;Ye(this,at,ak).call(this,{updateTrackedChangesProjection:s,updateCommentVisibility:u!==d})}}search(n){var o;const r=(o=this.activeEditor)==null?void 0:o.commands,i=r==null?void 0:r.search;if(typeof i=="function")return i.call(r,n,{searchModel:"visible"})}goToSearchResult(n){var o;const r=(o=this.activeEditor)==null?void 0:o.commands,i=r==null?void 0:r.goToSearchResult;if(typeof i=="function")return!!i.call(r,n)}getZoom(){var n;return((n=this.superdocStore)==null?void 0:n.activeZoom)??100}setZoom(n){if(typeof n!="number"||!Number.isFinite(n)||n<=0){console.warn("[SuperDoc] setZoom expects a positive number representing percentage");return}if(!this.superdocStore){console.warn("[SuperDoc] setZoom called before initialization; use config.zoom.initial for the starting zoom");return}this.superdocStore.activeZoom=n,this.superdocStore.zoomMode="manual",this.emit("zoomChange",{zoom:n,mode:"manual"})}setZoomMode(n){var r;if(n!=="manual"&&n!=="fit-width"){console.warn("[SuperDoc] setZoomMode expects 'manual' or 'fit-width'");return}if(!this.superdocStore){console.warn("[SuperDoc] setZoomMode called before initialization; use config.zoom.mode for the starting mode");return}if(this.superdocStore.zoomMode!==n){if(this.superdocStore.zoomMode=n,n==="fit-width"){const i=this.superdocStore.viewportMetrics;if(i){const o=Lj(i.availableWidth,i.documentWidth,AE((r=this.config.zoom)==null?void 0:r.fitWidth));o!==null&&(this.superdocStore.activeZoom=o)}}this.emit("zoomChange",{zoom:this.getZoom(),mode:n})}}getZoomState(){var r,i,o,s,l;const n=AE((r=this.config.zoom)==null?void 0:r.fitWidth);return{mode:((i=this.superdocStore)==null?void 0:i.zoomMode)??"manual",value:((o=this.superdocStore)==null?void 0:o.activeZoom)??100,fitZoom:((l=(s=this.superdocStore)==null?void 0:s.viewportMetrics)==null?void 0:l.fitZoom)??null,min:n.min,max:n.max}}getViewportMetrics(){var n;return((n=this.superdocStore)==null?void 0:n.viewportMetrics)??null}getMeasurementUnit(){var n;return((n=this.superdocStore)==null?void 0:n.measurementUnit)??"in"}setMeasurementUnit(n){if(n!=="in"&&n!=="cm"){console.warn("[SuperDoc] setMeasurementUnit expects 'in' or 'cm'");return}if(!this.superdocStore){console.warn("[SuperDoc] setMeasurementUnit called before initialization; use config.measurementUnit for the starting unit");return}this.superdocStore.measurementUnit!==n&&(this.superdocStore.measurementUnit=n,this.emit("measurement-unit-change",{unit:n}))}setLocked(n=!0){var i,o,s;const r=this.activeEditor;if(ml(r)&&typeof((i=r.lock)==null?void 0:i.setLocked)=="function"){r.lock.setLocked(n,n?{...this.user}:null);const l=(s=(o=r.lock).getSnapshot)==null?void 0:s.call(o);l&&Ye(this,at,Bb).call(this,!!l.isLocked,Ye(this,at,rA).call(this,l.lockedBy??null));return}this.config.documents.forEach(l=>{const u=l.ydoc;if(!u)return;const d=u.getMap("meta");u.transact(()=>{d.set("locked",n),n?d.set("lockedBy",this.user):d.delete("lockedBy")})}),Ye(this,at,Bb).call(this,n,n?this.user:null)}getHTML(n={}){const r=[];
624return Ye(this,at,pl).call(this,"getHTML").documents.forEach(i=>{var s;const o=(s=i.getEditor)==null?void 0:s.call(i);o&&r.push(o)}),r.map(i=>i.getHTML(n))}lockSuperdoc(n=!1,r=null){Ye(this,at,Bb).call(this,n,r)}async export({exportType:n=["docx"],commentsType:r="external",exportedName:i,additionalFiles:o=[],additionalFileNames:s=[],isFinalDoc:l=!1,triggerDownload:u=!0,fieldsHighlightColor:d=null}={}){if(!Array.isArray(n)||n.length!==1||n[0]!=="docx")throw new TypeError('SuperDoc.export() only supports exportType: ["docx"].');const f=f7(i||this.config.title),p=await this.exportEditorsToDOCX({commentsType:r,isFinalDoc:l,fieldsHighlightColor:d}),m=[...o],y=[...s];if(n.includes("docx")&&p.forEach(k=>{m.push(k),y.push(`${f}.docx`)}),m.length===1)return u?d7(m[0],f,n[0]):m[0];const b=await Wbe(m,y);return u?d7(b,f,"zip"):b}async replaceFile(n){return(await Ye(this,at,fA).call(this,n)).raw}async replaceDocument(n){const{raw:r,confirmed:i}=await Ye(this,at,fA).call(this,n);if(i)return{ok:!0};const o={ok:!1};return r&&typeof r=="object"&&("reason"in r&&typeof r.reason=="string"&&(o.reason=r.reason),"detail"in r&&typeof r.detail=="string"&&(o.detail=r.detail)),o}async exportEditorsToDOCX({commentsType:n,isFinalDoc:r,fieldsHighlightColor:i}={}){var p,m;const o=((m=(p=this.config)==null?void 0:p.modules)==null?void 0:m.comments)!==!1;let s,l=!1;const u=()=>(l||(l=!0,n==="clean"?s=[]:o&&this.commentsStore&&typeof this.commentsStore.translateCommentsForExport=="function"&&(s=this.commentsStore.translateCommentsForExport(),Array.isArray(s)||(s=[]))),s),d=new WeakSet,f=y=>{"editor"in y&&y.error&&typeof y.error=="object"&&d.add(y.error)};this.on("exception",f);try{const y=Ye(this,at,pl).call(this,"exportEditorsToDOCX").documents.map(async b=>{if(!b||b.type!=="application/vnd.openxmlformats-officedocument.wordprocessingml.document")return null;const k=typeof b.getEditor=="function"?b.getEditor():null,S=()=>yN(b.data)?b.data.type&&b.data.type!=="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?null:b.data:_p(b.data)?Ye(this,at,B0).call(this,b.data):null;if(!k||typeof k.exportDocx!="function")return S();const x=k.editorVersion===2;try{const T=await k.exportDocx(x?{isFinalDoc:r,commentsType:n,fieldsHighlightColor:i}:{isFinalDoc:r,comments:u(),commentsType:n,fieldsHighlightColor:i});if(T)return T}catch(T){if((!T||typeof T!="object"||!d.has(T))&&(this.emit("exception",{error:T,document:b}),this.emit("exception",mpe(T,{documentId:b.id,editor:null}))),x)throw T}return S()});return(await Promise.all(y)).filter(b=>b!=null)}finally{this.off("exception",f)}}async save(){const n=Ye(this,at,pl).call(this,"save").documents;await Promise.all(n.map(async r=>{var o;if(r.type!=="application/vnd.openxmlformats-officedocument.wordprocessingml.document")return;const i=(o=r.getEditor)==null?void 0:o.call(r);if(!ml(i)||typeof i.save!="function")throw new Error(`SuperDoc: save is unavailable for document "${r.id}"`);await i.save()}))}openSurface(n){return Ae(this,qf).open(n)}closeSurface(n){Ae(this,qf).close(n)}async removeDocument(n){const r=typeof n=="string"?n:String(n??"");if(!r)return!1;const i=Ye(this,at,pl).call(this,"removeDocument"),o=this.activeEditor,s=_N(o);for(const l of Ae(this,Ls).getAllByDocumentId(r))Ae(this,Ls).unregister(l.id);return s===r&&o!==null&&Ye(this,at,Ub).call(this),i.removeDocument(r)?(await Sn(),!0):!1}destroy(){var n,r,i,o,s,l,u,d,f,p,m,y;EK(this),Ot(this,Ga,!0),(n=Ae(this,tu))==null||n.removeEventListener("click",Ae(this,yy),!0),(r=Ae(this,tu))==null||r.removeEventListener("pointerdown",Ae(this,my),!0),(i=Ae(this,tu))==null||i.ownerDocument.removeEventListener("pointerup",Ae(this,Pp),!0),(o=Ae(this,tu))==null||o.ownerDocument.removeEventListener("pointercancel",Ae(this,Pp),!0),(s=Ae(this,tu))==null||s.removeEventListener("keydown",Ae(this,gy),!0),Ot(this,tu,null),(l=Ae(this,Td))==null||l.call(this),Ot(this,Td,null),Ae(this,Ad)&&(Ae(this,Ad).call(this),Ot(this,Ad,null)),Ae(this,qf)&&Ae(this,qf).destroy(),(d=(u=this.toolbar)==null?void 0:u.destroy)==null||d.call(u),(f=this.commentsList)==null||f.close(),this.commentsList=null,this.app&&(Ye(this,at,ok).call(this,"[superdoc] Unmounting app"),(p=this.superdocStore)==null||p.reset(),this.app.unmount(),this.removeAllListeners(),delete this.app.config.globalProperties.$config,delete this.app.config.globalProperties.$superdoc),(m=Ae(this,_c))==null||m.destroy(),Ye(this,at,hA).call(this),(y=Ae(this,jp))==null||y.call(this),Ot(this,jp,null),Ae(this,Ls).clear(),Ae(this,Hf)&&(Ae(this,Hf).remove(),Ot(this,Hf,null))}focus(n={}){var i,o,s,l;const r=this.getActiveRuntime();if(r!=null&&r.getCapabilities().lifecycle.canFocus){r.focus(n).catch(u=>{console.warn("[SuperDoc] active editor runtime focus failed",u)});return}this.activeEditor?ml(this.activeEditor)?(o=(i=this.activeEditor).focus)==null||o.call(i,n):(l=(s=this.activeEditor).focus)==null||l.call(s):Ye(this,at,pl).call(this,"focus").documents.find(u=>{var f,p,m;const d=(f=u.getEditor)==null?void 0:f.call(u);return d?(ml(d)?(p=d.focus)==null||p.call(d,n):(m=d.focus)==null||m.call(d),!0):!1})}setHighContrastMode(n){var r,i,o;this.activeEditor&&((i=(r=this.activeEditor).setHighContrastMode)==null||i.call(r,n),(o=this.highContrastModeStore)==null||o.setHighContrastMode(n))}},Ga=new WeakMap,s2=new WeakMap,eg=new WeakMap,Uf=new WeakMap,Ad=new WeakMap,Op=new WeakMap,Np=new WeakMap,Mp=new WeakMap,Vf=new WeakMap,tg=new WeakMap,eu=new WeakMap,Hf=new WeakMap,tu=ne
624w WeakMap,Td=new WeakMap,ng=new WeakMap,Dp=new WeakMap,kc=new WeakMap,nu=new WeakMap,$f=new WeakMap,Lp=new WeakMap,Gf=new WeakMap,my=new WeakMap,Pp=new WeakMap,gy=new WeakMap,yy=new WeakMap,_c=new WeakMap,ru=new WeakMap,Bp=new WeakMap,rg=new WeakMap,qf=new WeakMap,Ls=new WeakMap,jp=new WeakMap,ig=new WeakMap,Wf=new WeakMap,at=new WeakSet,Tz=async function(n){var s,l,u;const r=Ae(this,tu);if(!r)return;const i=Ybe(n,r),o=(u=(l=(s=this.activeEditor)==null?void 0:s.doc)==null?void 0:l.contentControls)==null?void 0:u.list;if(!(!i||typeof o!="function"))try{const d=await o();if(Ae(this,Ga))return;const f=wN(Xbe(d).find(p=>p.id===i));f&&this.emit("content-control:click",{target:f,source:"pointer"})}catch{return}},Iz=async function(n,r){var l,u,d;Ot(this,Wf,qbe(n)),this.config={...this.config,...n,modules:{...this.config.modules,...n.modules},layoutEngineOptions:{...this.config.layoutEngineOptions,...n.layoutEngineOptions}},typeof((l=this.config.viewing)==null?void 0:l.comments)=="boolean"&&(this.config.comments={...this.config.comments,visible:this.config.viewing.comments}),!this.config.comments||typeof this.config.comments!="object"?this.config.comments={visible:!1}:typeof this.config.comments.visible!="boolean"&&(this.config.comments.visible=!1),K3(this.config),this.config.documents=this.config.documents||[],this.config.layoutEngineOptions=this.config.layoutEngineOptions||{};const i=((u=this.config.viewOptions)==null?void 0:u.layout)==="web",o=((d=this.config.layoutEngineOptions)==null?void 0:d.flowMode)==="semantic";if(!i&&o&&(console.warn("[SuperDoc] flowMode 'semantic' is only valid with web layout. Coercing to 'paginated'."),this.config.layoutEngineOptions.flowMode="paginated"),this.editorVersion=2,Ye(this,at,iU).call(this),this.config.user=H0e(this.config.user),this.config.layoutEngineOptions.virtualization||(this.config.layoutEngineOptions.virtualization={enabled:!0,window:5,overscan:1}),this.config.modules=this.config.modules||{},Object.prototype.hasOwnProperty.call(this.config.modules,"comments")||(this.config.modules.comments={}),this.config.modules.comments=Pj(this.config.modules.comments),Ot(this,ru,nN(this.config)),Ot(this,Bp,rN(this.config)),Ot(this,rg,oN(this.config)),this.config.disableContextMenu=!Ae(this,ru).contextMenu.enabled,this.config.rulers=Ae(this,ru).ruler.enabled,Ae(this,ru).comments.enabled?this.config.modules.comments===!1&&(this.config.modules.comments={}):this.config.modules.comments=!1,Ae(this,ru).comments.enabled){this.config.modules.comments===!0&&(this.config.modules.comments={});const f=this.config.modules.comments;f&&(f.readOnly=Ae(this,Bp).comments.readOnly,f.allowResolve=Ae(this,Bp).comments.allowResolve)}if(this.config.colors=voe(this.config.colors),this.userColorMap=new Map,this.colorIndex=0,this.version="2.20.0",Ye(this,at,ok).call(this,"🦋 [superdoc] Using SuperDoc version:",this.version),this.superdocId=n.superdocId||Sp(),this.colors=this.config.colors??[],Ye(this,at,Mz).call(this),await Tle(),Ae(this,Ga))return;if(await Ye(this,at,Pz).call(this,this.config.modules),Ae(this,Ga)){Ye(this,at,hA).call(this);return}this.user=this.config.user,this.users=this.config.users||[],this.socket=null,this.isDev=this.config.isDev||!1,this.activeEditor=null,this.comments=[],Ae(this,jp)||Ot(this,jp,Ae(this,Ls).subscribe(f=>{Ye(this,at,sU).call(this,f.nextRuntimeId,f.legacyEditorProjection)})),this.isLocked=this.config.isLocked||!1,this.lockedBy=this.config.lockedBy||null;const s=document.createElement("div");s.style.display="contents",r.appendChild(s),Ot(this,Hf,s),Ye(this,at,Lz).call(this),Ye(this,at,Oz).call(this),Ye(this,at,aU).call(this),Ye(this,at,Rz).call(this)},Rz=function(){if(Ye(this,at,Dz).call(this),this.readyEditors=0,!this.app)throw new Error("SuperDoc: #startRuntime called before #initVueApp populated this.app");this.app.mount(Ae(this,Hf))},Oz=function(){var i;const n=(i=this.config.modules)==null?void 0:i.whiteboard,r=n!==!1&&((n==null?void 0:n.enabled)??!1);this.whiteboard=new ime({Renderer:T0e,superdoc:this,enabled:r}),this.emit("whiteboard:init",{whiteboard:this.whiteboard})},rk=function(){var n;this.listenerCount("content-control:active-change")>0||((n=Ae(this,Td))==null||n.call(this),Ot(this,Td,null),Ot(this,Gf,null),Ot(this,kc,null),Ot(this,nu,null),Ot(this,$f,!1),Ot(this,Lp,null))},Nz=function(){if(Ae(this,Td)||Ae(this,ng)||!Ae(this,_c)||Ae(this,Ga)||this.listenerCount("content-control:active-change")===0)return;let n=null,r=[],i=null,o=null,s=!0;Ot(this,ng,!0);try{i=Ae(this,_c).selection.observe(u=>{var m;if(s){s=!1;return}if(u.status!=="ready")return;const d=xN(u);if(!d)return;Ae(this,kc)==="pointer"&&Ae(this,nu)!==null&&Date.now()>Ae(this,nu)&&(Ot(this,kc,null),Ot(this,nu,null));const f=Ae(this,kc)??(Ae(this,$f)?"pointer":null),p=this.activeEditor;(f||((m=Ae(this,Gf))==null?void 0:m.editor)!==p||Ae(this,Gf).key!==d)&&Ot(this,Gf,{editor:p,key:d,source:f??"ke
624yboard"}),Ot(this,kc,null),Ot(this,nu,null)}),o=Ae(this,_c).contentControls.observeActivePath(u=>{const d=this.activeEditor,f=u.activeIds.map(x=>wN(u.items.find(T=>T.id===x)));if(f.some(x=>x===null))return;const p=f,m=d===n,y=p.length===r.length&&p.every((x,T)=>{var C;return x.id===((C=r[T])==null?void 0:C.id)});if(m&&y)return;if(p.length===0&&r.length===0){n=d;return}const b=m?r[0]??null:null;n=d,r=p;const k=xN(Ae(this,_c).selection.getSnapshot()),S=Ae(this,Gf);this.emit("content-control:active-change",{active:p[0]??null,previous:b,activePath:p,source:k&&(S==null?void 0:S.editor)===d&&S.key===k?S.source:"keyboard"})});const l=()=>{i==null||i(),o==null||o()};Ae(this,Ga)||this.listenerCount("content-control:active-change")===0?l():Ot(this,Td,l)}catch(l){throw i==null||i(),o==null||o(),l}finally{Ot(this,ng,!1)}},Mz=function(){var s;const n=this.config.document,r=!!n&&typeof n=="object"&&(_p(n)||typeof Blob=="function"&&n instanceof Blob||Object.keys(n).length>0),i=typeof n=="string"&&n.length>0,o=this.config.documents&&((s=this.config.documents)==null?void 0:s.length);if((r||i)&&o&&console.warn("🦋 [superdoc] You can only provide one of document or documents"),r){const l=_E(n);this.config.documents=[{id:Sp(),...l}]}else i&&(this.config.documents=[{id:Sp(),type:Ho,url:this.config.document,name:"document.docx"}]);Array.isArray(this.config.documents)&&this.config.documents.length>0&&(this.config.documents=this.config.documents.map(l=>{const u=_E(l);if(!u||typeof u!="object")return u;const d=typeof u=="object"&&"id"in u&&u.id||l&&typeof l=="object"&&"id"in l&&l.id;return{...u,id:d||Sp()}}))},Dz=function(){const{app:n,pinia:r,superdocStore:i,commentsStore:o,highContrastModeStore:s}=Upe({disablePiniaDevtools:!!this.config.disablePiniaDevtools});this.app=n,this.pinia=r,this.app.config.globalProperties.$config=this.config,this.app.config.globalProperties.$documentMode=this.config.documentMode,this.app.config.globalProperties.$superdoc=this,this.app.provide("surfaceManager",Ae(this,qf)),this.superdocStore=i,this.commentsStore=o,this.highContrastModeStore=s,typeof this.superdocStore.setExceptionHandler=="function"&&this.superdocStore.setExceptionHandler(u=>this.emit("exception",u)),this.superdocStore.init(this.config);const l=this.config.modules.comments;this.commentsStore.init(l||{}),this.isCollaborative&&hle(this),Ye(this,at,lk).call(this)},yo=function(n,r){r&&this.on(n,r)},Lz=function(){Ye(this,at,yo).call(this,"editorBeforeCreate",this.config.onEditorBeforeCreate),Ye(this,at,yo).call(this,"editorCreate",this.config.onEditorCreate),Ye(this,at,yo).call(this,"editorDestroy",this.config.onEditorDestroy),Ye(this,at,yo).call(this,"source:complete",this.config.onSourceComplete),Ye(this,at,yo).call(this,"source:signals-complete",this.config.onSourceSignalsComplete),Ye(this,at,yo).call(this,"ready",this.config.onReady),Ye(this,at,yo).call(this,"comments-update",this.config.onCommentsUpdate),Ye(this,at,yo).call(this,"content-control:click",this.config.onContentControlClick),Ye(this,at,yo).call(this,"awareness-update",this.config.onAwarenessUpdate),Ye(this,at,yo).call(this,"locked",this.config.onLocked),Ye(this,at,yo).call(this,"pdf:document-ready",this.config.onPdfDocumentReady),Ye(this,at,yo).call(this,"sidebar-toggle",this.config.onSidebarToggle),Ye(this,at,yo).call(this,"collaboration-ready",this.config.onCollaborationReady),Ye(this,at,yo).call(this,"collaboration-connection-change",this.config.onCollaborationConnectionChange),this.on("collaboration-ready",n=>Ye(this,at,jz).call(this,(n==null?void 0:n.editor)??null)),Ye(this,at,yo).call(this,"editor-update",this.config.onEditorUpdate),Ye(this,at,yo).call(this,"tracked-changes:bulk-decision",this.config.onTrackedChangesBulkDecision),this.on("content-error",this.onContentError),Ye(this,at,yo).call(this,"exception",this.config.onException),Ye(this,at,yo).call(this,"list-definitions-change",this.config.onListDefinitionsChange),Ye(this,at,yo).call(this,"pagination-update",this.config.onPaginationUpdate),Ye(this,at,yo).call(this,"fonts-resolved",this.config.onFontsResolved),Ye(this,at,yo).call(this,"fonts-changed",this.config.onFontsChanged),Ye(this,at,yo).call(this,"zoomChange",this.config.onZoomChange),Ye(this,at,yo).call(this,"viewport-change",this.config.onViewportChange),Ye(this,at,yo).call(this,"page-margins-change",this.config.onPageMarginsChange)},Pz=async function({collaboration:n}={}){return n?(this.isCollaborative=!1,this.config.documents.length===0&&(this.config.documents=[{id:Sp(),type:Ho,name:"document.docx"}]),this.config.v2CollaborationPreflightFailure={code:"collaboration-v1-config-unsupported",message:"SuperDoc v2 cannot use modules.collaboration because it is the SuperDoc v1 collaboration API. SuperDoc did not attach the provider or change the document. Configure Document.v2Collaboration with a v2 room instead."},this.config.documents):this.config.documents},e1e=function(n,r){this.isCollaborative=!0,this._commentsCollabInitialized=!1,this.ydoc=Us(n),this.provider=Us(r),Ye(this,at,Hz).call(this);const i=this.config;
624this._cleanupAwareness=lle(r,this,i.user),i.documents.forEach(o=>{o.ydoc=n,o.provider=r,o.role=this.config.role})},Bz=function(){Ot(this,eu,null),Ye(this,at,ik).call(this),typeof this._cleanupAwareness=="function"&&(this._cleanupAwareness(),this._cleanupAwareness=null),this.isCollaborative=!1,this._commentsCollabInitialized=!1,this.ydoc=void 0,this.provider=void 0;const n=this.config;delete n.modules.collaboration,n.documents.forEach(r=>{delete r.ydoc,delete r.provider})},ik=function(){if(Ae(this,Op)){try{Ae(this,Op).call(this)}catch{}Ot(this,Op,null)}if(Ae(this,Np)){try{Ae(this,Np).call(this)}catch{}Ot(this,Np,null)}if(Ae(this,Mp)){try{Ae(this,Mp).call(this)}catch{}Ot(this,Mp,null)}},jz=function(n){Ye(this,at,ik).call(this),ml(n)&&(Ye(this,at,zz).call(this,n),Ye(this,at,Uz).call(this,n),Ye(this,at,Fz).call(this,n))},Fz=function(n){var s,l;const r=n.connection;if(!r||typeof r.subscribe!="function")return;const{documentId:i}=r;((s=Ae(this,Vf))==null?void 0:s.documentId)!==i&&(Ot(this,Vf,null),Ot(this,tg,!1));const o=u=>{if(Ae(this,Ga))return;const d=Ae(this,Vf);if(d&&d.state===u.state&&d.detail===(u.detail??null))return;const f={documentId:i,state:u.state,previousState:(d==null?void 0:d.state)??null,kind:Zbe(u,Ae(this,tg)),detail:u.detail??null,superdoc:this};Ot(this,Vf,f),u.state==="synced"&&Ot(this,tg,!0),this.emit("collaboration-connection-change",f)};try{const u=(l=r.getSnapshot)==null?void 0:l.call(r);u&&o(u),Ot(this,Mp,r.subscribe(o))}catch(u){console.warn("[SuperDoc] v2 connection bridge failed to subscribe",u)}},zz=function(n){var s;const r=n.presence;if(!r||typeof r.subscribe!="function")return;const i=Xpe(()=>this.user),o=l=>{if(Ae(this,Ga))return;const u=i.next(l);this.emit("awareness-update",{...u,superdoc:this})};try{const l=(s=r.getSnapshot)==null?void 0:s.call(r);l&&o(l),Ot(this,Op,r.subscribe(o))}catch(l){console.warn("[SuperDoc] v2 awareness bridge failed to subscribe",l)}},Uz=function(n){var o;const r=n.lock;if(!r||typeof r.subscribe!="function")return;const i=s=>{Ae(this,Ga)||Ye(this,at,Bb).call(this,!!s.isLocked,Ye(this,at,rA).call(this,s.lockedBy??null))};try{if(Ae(this,eu)&&typeof r.setLocked=="function"){const l=Ae(this,eu);r.setLocked(l.isLocked,l.isLocked?l.lockedBy:null),Ot(this,eu,null)}const s=(o=r.getSnapshot)==null?void 0:o.call(r);s&&i(s),Ot(this,Np,r.subscribe(i))}catch(s){console.warn("[SuperDoc] v2 lock bridge failed to subscribe",s)}},rA=function(n){return!n||typeof n!="object"||Array.isArray(n)?null:{...n}},Vz=function(n,r){return JSON.stringify(n??null)===JSON.stringify(r??null)},Bb=function(n,r){this.isLocked===n&&Ye(this,at,Vz).call(this,this.lockedBy,r)||(this.isLocked=n,this.lockedBy=r,Ye(this,at,ok).call(this,"🦋 [superdoc] Locking superdoc:",n,r,`
625
626
627`),this.emit("locked",{isLocked:n,lockedBy:r}))},Hz=function(){const n=this.config.user;if(!n||n.color)return;const r=this.colors.length>0?this.colors:Vbe,i=n.id||n.email||n.name||"";let o=5381;for(let s=0;s<i.length;s++)o=(o<<5)+o^i.charCodeAt(s);n.color=r[Math.abs(o)%r.length]},$z=function(n,r){if(n.token!==r.token)return!1;const i=new WeakMap,o=(s,l)=>{if(Object.is(s,l))return!0;if(!s||!l||typeof s!="object"||typeof l!="object"||Object.getPrototypeOf(s)!==Object.getPrototypeOf(l))return!1;if(i.has(s))return i.get(s)===l;if(i.set(s,l),s instanceof Date&&l instanceof Date)return s.getTime()===l.getTime();if(s instanceof RegExp&&l instanceof RegExp)return s.source===l.source&&s.flags===l.flags;if(s instanceof ArrayBuffer&&l instanceof ArrayBuffer)return o(Array.from(new Uint8Array(s)),Array.from(new Uint8Array(l)));if(ArrayBuffer.isView(s)&&ArrayBuffer.isView(l))return s.constructor===l.constructor&&o(Array.from(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)),Array.from(new Uint8Array(l.buffer,l.byteOffset,l.byteLength)));if(s instanceof Map&&l instanceof Map)return s.size===l.size&&o(Array.from(s.entries()),Array.from(l.entries()));if(s instanceof Set&&l instanceof Set)return s.size===l.size&&o(Array.from(s.values()),Array.from(l.values()));if(Array.isArray(s)&&Array.isArray(l))return s.length===l.length&&s.every((f,p)=>o(f,l[p]));if(Object.getPrototypeOf(s)!==Object.prototype&&Object.getPrototypeOf(s)!==null)return!1;const u=Object.keys(s).sort(),d=Object.keys(l).sort();return u.length===d.length&&u.every((f,p)=>f===d[p]&&o(s[f],l[f]))};return o({...n,token:void 0},{...r,token:void 0})},Gz=function(){return{isLocked:this.isLocked,lockedBy:this.lockedBy?{...this.lockedBy}:null}},qz=function(){var o;const n=this.config.documents.find(s=>s.type===Ho),r=((o=this.superdocStore)==null?void 0:o.documents.find(s=>s.id===n.id))??null,i=r?au(r):null;return{isCollaborative:this.isCollaborative,configV2Collaboration:n.v2Collaboration??null,configData:n.data,storeDoc:r,storeV2Collaboration:Ye(this,at,Xz).call(this,i),storeData:r==null?void 0:r.data}},Wz=function(n){Ot(this,eu,null);const r=this.config.documents.find(i=>i.type===Ho);r.v2Collaboration=n.configV2Collaboration,r.data=n.configData,this.isCollaborative=n.isCollaborative,n.storeDoc&&(n.storeDoc.data=n.storeData,Ye(this,at,Fb).call(this,n.storeDoc,n.storeV2Collaboration))},Kz=function(){if(Ae(this,Ga))throw new Error("SuperDoc: instance was destroyed during upgrade")},pl=function(n){if(!this.superdocStore)throw new Error(`SuperDoc: ${n} requires the instance to be ready; wait for the "ready" event before calling.`);return this.superdocStore},t1e=function(n){if(!this.commentsStore)throw new Error(`SuperDoc: ${n} requires the instance to be ready; wait for the "ready" event before calling.`);return this.commentsStore},jb=function(n){if(!this.superdocStore)throw new Error(`SuperDoc: ${n} requires the instance to be ready; wait for the "ready" event before calling.`)},Yz=function(n,r){var o;const i=(o=this.superdocStore)==null?void 0:o.documents;if(Array.isArray(i))for(const s of i){const l=au(s);
627l.ydoc&&typeof l.ydoc=="object"&&"value"in l.ydoc&&(l.ydoc.value=n),l.provider&&typeof l.provider=="object"&&"value"in l.provider&&(l.provider.value=r)}},Xz=function(n){if(!n)return null;const r=n.v2Collaboration;return r&&typeof r=="object"&&"value"in r?r.value:r??null},Fb=function(n,r){const i=au(n).v2Collaboration;if(i&&typeof i=="object"&&"value"in i){i.value=r;return}n.v2Collaboration=r},iA=function(n){const r=n.syncTimeoutMs===void 0?{}:{syncTimeoutMs:n.syncTimeoutMs};return n.providerFamily==="extension"?{providerType:"extension",adapterId:n.adapterId,documentId:n.documentId,roomMode:n.roomMode,...r,...n.providerOptions!==void 0?{providerOptions:n.providerOptions}:{},...n.token?{token:n.token}:{}}:n.providerFamily==="liveblocks"?{providerType:"liveblocks",documentId:n.documentId,roomMode:n.roomMode,...r,...n.publicApiKey?{publicApiKey:n.publicApiKey}:{},...n.authEndpoint?{authEndpoint:n.authEndpoint}:{}}:n.providerFamily==="hocuspocus"?{providerType:"hocuspocus",documentId:n.documentId,roomMode:n.roomMode,...r,...n.serverUrl?{serverUrl:n.serverUrl}:{},...n.params?{params:n.params}:{},...n.token?{token:n.token}:{}}:{providerType:"y-websocket",documentId:n.documentId,roomMode:n.roomMode,...r,...n.serverUrl?{serverUrl:n.serverUrl}:{},...n.params?{params:n.params}:{}}},Zz=async function(n,r){var u;const i=this.config.documents.find(d=>d.type===Ho),o=Ye(this,at,pl).call(this,"upgradeToCollaboration").documents.find(d=>d.id===i.id);if(!o)throw new Error("SuperDoc: source document store entry is not available for upgrade");const s=(u=o.getEditor)==null?void 0:u.call(o);if(!ml(s)||typeof s.upgradeToCollaboration!="function")throw new Error("SuperDoc: live v2 editor cannot attach collaboration in place");const l=Ye(this,at,iA).call(this,{...n,roomMode:"create"});return i.v2Collaboration=l,Ye(this,at,Fb).call(this,o,l),this.isCollaborative=!0,await s.upgradeToCollaboration(r,l),i.data=r,o.data=r,{configDoc:i,storeDoc:o}},Qz=function(n,r){const i=Ye(this,at,iA).call(this,{...r,roomMode:"join"});n.configDoc.v2Collaboration=i,Ye(this,at,Fb).call(this,n.storeDoc,i)},Jz=async function(){var o,s;const n=this.activeEditor;if(ml(n)&&typeof n.save=="function"){const l=await n.save();return Ye(this,at,B0).call(this,l)}const r=this.config.documents.find(l=>l.type===Ho),i=((s=((o=this.superdocStore)==null?void 0:o.documents.find(l=>l.id===r.id))??null)==null?void 0:s.data)??r.data;if(i instanceof Blob)return i;if(_p(i))return Ye(this,at,B0).call(this,i);throw new Error("SuperDoc: upgradeToCollaboration() requires a live v2 editor save or DOCX Blob source")},B0=function(n){if(n instanceof Blob)return n;if(_p(n))return kE(n,Ho);throw new Error("SuperDoc: active v2 editor returned an unsupported DOCX save payload")},oA=function(n,r){var d;const i=_N(n),o=(i?this.config.documents.find(f=>f.id===i):null)??this.config.documents.find(f=>f.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document");if(!o)return;const s=Ye(this,at,B0).call(this,r),l=o.v2Collaboration&&typeof o.v2Collaboration=="object"&&o.v2Collaboration.roomMode==="create"?{...o.v2Collaboration,roomMode:"join"}:null;o.data=s,o.fieldContext={},l&&(o.v2Collaboration=l);const u=((d=this.superdocStore)==null?void 0:d.documents.find(f=>f.id===o.id))??null;u&&(u.data=s,u.fieldContext={},l&&Ye(this,at,Fb).call(this,u,l))},n1e=function(){var i,o,s,l,u;const n=(i=this.superdocStore)==null?void 0:i.documents;if(!(n!=null&&n.length))throw new Error("SuperDoc: no store documents available for upgrade");const r=((s=(o=n[0]).getDocumentRuntime)==null?void 0:s.call(o))||((u=(l=n[0]).getEditor)==null?void 0:u.call(l));if(!(r!=null&&r.attachCollaboration))throw new Error("SuperDoc: editor does not support attachCollaboration");return r},r1e=function(){Ye(this,at,Bz).call(this),Ye(this,at,Yz).call(this,null,null)},i1e=function(n){var o;const i=n.editor??n;return(o=i.options)!=null&&o.collaborationIsReady?Promise.resolve():new Promise(s=>{let l=!1;const u=()=>{l||(l=!0,clearTimeout(d),typeof i.off=="function"&&i.off("collaborationReady",f))},d=setTimeout(()=>{u(),console.warn("[SuperDoc] collaborationReady did not fire within 10 s after collaboration attach. Continuing — collaboration is active but cursor/presence setup may be delayed."),s(void 0)},1e4),f=()=>{u(),s(void 0)};Ot(this,Ad,()=>{u(),s(void 0)}),typeof i.on=="function"?i.on("collaborationReady",f):(u(),s(void 0))})},o1e=function(n){return new Promise((i,o)=>{let s,l=!1,u=()=>{};const d=()=>{l=!0,clearTimeout(s),u()};u=Kbe(n,()=>{l||(d(),i())}),l||(s=setTimeout(()=>{d(),o(new Error("SuperDoc: collaboration provider did not sync 
627within 10000 ms. The provider exposes on/off but never emitted sync(true) or synced."))},1e4)),Ot(this,Ad,()=>{l||(d(),o(new Error("SuperDoc: instance was destroyed during upgrade")))})})},eU=function(n){if(Ae(this,Ga))throw new Error("SuperDoc: cannot upgrade a destroyed instance");if(Ae(this,eg))throw new Error("SuperDoc: upgrade already in progress");if(this.isCollaborative)throw new Error("SuperDoc: instance is already collaborative");const r=this.config,i=r.documents.filter(s=>s.type===Ho);if(i.length===0)throw new Error("SuperDoc: no DOCX document found for upgrade");if(i.length>1)throw new Error("SuperDoc: upgradeToCollaboration() only supports a single DOCX document");if(r.documents.length!==i.length)throw new Error("SuperDoc: upgradeToCollaboration() only supports single-DOCX instances");if(!ml(Ye(this,at,nU).call(this)))throw new Error("SuperDoc: upgradeToCollaboration() requires a ready v2 DOCX editor");const o=i[0].id;if(typeof o!="string"||o.length===0)throw new Error("SuperDoc: source document is missing its mounted document identity");return Ye(this,at,sA).call(this,n)},sA=function(n){var d;const r=this.config,i=r.documents.find(f=>
627f.type===Ho),o=(d=r.modules)==null?void 0:d.collaboration,s=n.ydoc||n.provider?{ydoc:n.ydoc,provider:n.provider}:o?{...o}:null,l=n.v2Collaboration??Ye(this,at,tU).call(this,i.v2Collaboration)??(o==null?void 0:o.v2Collaboration)??(o==null?void 0:o.v2)??null,u=xj({collaboration:n.collaboration,v2Collaboration:l,legacyCollaboration:s,documentType:Ho,documentCount:r.documents.length,...typeof window<"u"?{authEndpointBaseUrl:window.location.href}:{}});if(!u.ok)throw new Error(`SuperDoc: upgradeToCollaboration() ${u.reason}: ${u.message}`);return{target:{...u.target,roomMode:"create"}}},tU=function(n){return n&&typeof n=="object"&&"value"in n?n.value:n},nU=function(){var i,o;const n=this.config.documents.find(s=>s.type===Ho),r=(o=(i=Ye(this,at,pl).call(this,"upgradeToCollaboration").documents.find(s=>s.id===n.id))==null?void 0:i.getEditor)==null?void 0:o.call(i);if(!r)throw new Error("SuperDoc: source editor not yet created — wait for the ready event before upgrading");return r},vy=new WeakMap,by=new WeakMap,rU=function(n){var i,o;if(!n||typeof n.on!="function"||Ae(this,vy).has(n))return;Ae(this,vy).add(n),n.on("fonts-changed",s=>{Ye(this,at,aA).call(this,n)&&Ye(this,at,zb).call(this,n,s)});const r=(o=(i=n.documentRenderer??n.presentationEditor)==null?void 0:i.getLastFontsChangedPayload)==null?void 0:o.call(i);r&&Ye(this,at,aA).call(this,n)&&Ye(this,at,zb).call(this,n,r)},aA=function(n){return!this.activeEditor||n===this.activeEditor},wy=new WeakMap,zb=function(n,r){if(Ot(this,wy,r),n.editorVersion===2){let i=Ae(this,by).get(n);i||(i=new Set,Ae(this,by).set(n,i)),sye(r.missingFonts,i)}this.emit("fonts-changed",r)},iU=function(){Array.isArray(this.config.editorExtensions)&&this.config.editorExtensions.length>0&&console.warn("[SuperDoc] `editorExtensions` is ignored by superdoc@2. Use `extensions` with `defineSuperDocExtension`. ProseMirror APIs such as `Node.create`, `Mark.create`, `addPmPlugins`, and custom schemas do not run in v2."),this.config.modules.ai&&console.warn("[SuperDoc] `modules.ai` is deprecated and will be removed in v3. Use `ui.toolbar.customItems` for the action, make the model request in your application, and apply the result with `doc.insert()` or `doc.replace()`.")},ok=function(...n){(console.debug?console.debug:console.log)("🦋 🦸‍♀️ [superdoc]",...n)},og=new WeakMap,Ub=function(){var r;const n=this.activeEditor!==null;Ye(this,at,lA).call(this),this.activeEditor=null,(r=this.toolbar)!=null&&r.setActiveEditor?this.toolbar.setActiveEditor(null):this.toolbar&&(this.toolbar.activeEditor=null),n&&this.emit("active-editor-change")},Fp=new WeakMap,lA=function(){if(Ae(this,Fp)){try{Ae(this,Fp).call(this)}catch{}Ot(this,Fp,null)}},oU=function(n){var o;Ye(this,at,lA).call(this);const r=Su(n);if(!n||!(r!=null&&r.onChanged))return;const i=(o=r.getLastFontsChangedPayload)==null?void 0:o.call(r);i&&Ye(this,at,zb).call(this,n,i),Ot(this,Fp,r.onChanged(s=>Ye(this,at,zb).call(this,n,s)))},sU=function(n,r){var i;Ot(this,ig,!0);try{if(n===null){Ye(this,at,Ub).call(this);return}((i=Ae(this,Ls).get(n))==null?void 0:i.kind)==="v2"&&ml(r)?Ye(this,at,cA).call(this,r):Ye(this,at,Ub).call(this)}finally{Ot(this,ig,!1)}},cA=function(n){var r,i;if(ml(n)){!Ae(this,ig)&&Ae(this,Ls).getActive()&&Ae(this,Ls).setActive(null,"set-active-v2-facade");const o=this.activeEditor;this.activeEditor=n,Ye(this,at,oU).call(this,n),(i=(r=this.toolbar)==null?void 0:r.setActiveEditor)==null||i.call(r,n),o!==this.activeEditor&&this.emit("active-editor-change");return}Ye(this,at,Ub).call(this)},aU=function(){var l;const n=(l=this.config.modules)==null?void 0:l.toolbar,r=n&&typeof n=="object"?n:{},i=Ae(this,ru).toolbar;this.toolbarElement=i.container??void 0;const o=this.config.ui,s=typeof o=="object"&&o!==null&&o.toolbar!==void 0;if(!(i.enabled&&(i.container||n===!0||n!=null&&typeof n=="object"||s))){this.toolbar=null;return}try{this.toolbar=jbe({...r,...i.options,selector:this.toolbarElement,superdoc:this,editor:this.activeEditor,role:this.config.role,isDev:this.isDev,documentMode:this.config.documentMode,groups:i.options.groups,toolbarGroups:i.options.toolbarGroups,icons:i.options.icons,texts:i.options.texts,uiDisplayFallbackFont:this.config.uiDisplayFallbackFont})}catch(u){console.warn("[SuperDoc] built-in toolbar mount failed",u),this.toolbar=null}},sk=function(n,r){const i=typeof n.id=="string"&&n.id.length>0?n.id:null;if(i){const l=Ae(this,Ls).getAllByDocumentId(i);if(l.length>0){for(const u of l)u.setDocumentMode(r);return}}const o=typeof n.getDocumentRuntime=="function"?n.getDocumentRuntime():null;if(typeof(o==null?void 0:o.setDocumentMode)=="function"){o.setDocumentMode(r);return}const s=typeof n.getEditor=="function"?n.getEditor():null;s&&typeof s.setDocumentMode=="function"&&s.setDocumentMode(r)},uA=function(){var n,r,i;return typeof((n=this.config.trackChanges)==null?void 0:n.enabled)=="boolean"?this.config.trackChanges.enabled:typeof((i=(r=this.config.modules)==null?void 0:r.trackChanges)==null?void 0:i.enabled)=="boolean"?this.config.modules.trackChanges.enabled:!0},Vb=function(n){var i,o;const r=n&&Object.keys(n).length?{...n}:void 0;this.config.layoutEngineOptions||(this.config.layoutEngineOptions={}),this.config.layoutEngineOptions.trackedChanges=r,(o=(i=this.superdocStore)==null?void 0:i.documents)==null||o.forEach(s=>{let l=!1;const u=typeof s.id=="string"&&s.id.length>0?s.id:null;if(u)for(const f of Ae(this,Ls).getAllByDocumentId(u))f.setTrackedChangesRenderOptions(r),l=!0;if(l)return;const d=typeof s.getDocumentRuntime=="function"?s.getDocumentRuntime():null;d!=null&&d.setTrackedChangesOverrides&&d.setTrackedChangesOverrides(r)})},lU=function(){var r;if(this.config.role!=="editor")return Ye(this,at,dA).call(this);const n=Ye(this,at,pl).call(this,"setDocumentMode");if(n.documents.length>0){const i=(r=n.documents[0])==null?void 0:r.getEditor();i&&this.setActiveEditor(i)}Ye(this,at,Vb).call(this,{mode:"review",enabled:Ye(this,at,uA).call(this)}
627),n.documents.forEach(i=>{var o;(o=i.restoreComments)==null||o.call(i),Ye(this,at,sk).call(this,i,"editing")})},dA=function(){var r;if(!["editor","suggester"].includes(this.config.role??""))return Ye(this,at,ak).call(this);const n=Ye(this,at,pl).call(this,"setDocumentMode");if(n.documents.length>0){const i=(r=n.documents[0])==null?void 0:r.getEditor();i&&this.setActiveEditor(i)}Ye(this,at,Vb).call(this,{mode:"review",enabled:Ye(this,at,uA).call(this)}),n.documents.forEach(i=>{var o;(o=i.restoreComments)==null||o.call(i),Ye(this,at,sk).call(this,i,"suggesting")})},ak=function(n={}){var l,u,d,f;const r=Ye(this,at,pl).call(this,"setDocumentMode");(l=this.toolbar)!=null&&l.setActiveEditor?this.toolbar.setActiveEditor(null):this.toolbar&&(this.toolbar.activeEditor=null);const i=kx(this.config,Ae(this,Wf)),o=i.comments,s=i.trackChangesVisible;n.updateTrackedChangesProjection!==!1&&Ye(this,at,Vb).call(this,{mode:i.renderMode,enabled:((u=this.config.modules.trackChanges)==null?void 0:u.enabled)??!0}),n.updateCommentVisibility!==!1&&!o&&!s&&((f=(d=this.commentsStore)==null?void 0:d.clearEditorCommentPositions)==null||f.call(d)),r.documents.forEach(p=>{var m,y;n.updateCommentVisibility!==!1&&(o||s?(m=p.restoreComments)==null||m.call(p):(y=p.removeComments)==null||y.call(p)),Ye(this,at,sk).call(this,p,"viewing")})},lk=function(){var u,d;const n=kx(this.config,Ae(this,Wf)),r=n.comments,i=n.trackChangesVisible,o=this.config.documentMode==="viewing",s=r||i;(u=this.commentsStore)!=null&&u.setViewingVisibility&&this.commentsStore.setViewingVisibility({documentMode:this.config.documentMode,commentsVisible:r,trackChangesVisible:i});const l=(d=this.superdocStore)==null?void 0:d.documents;Array.isArray(l)&&l.length>0&&l.forEach(f=>{const p=typeof f.getDocumentRuntime=="function"?f.getDocumentRuntime():null;p!=null&&p.setViewingCommentOptions&&p.setViewingCommentOptions({emitCommentPositionsInViewing:o&&s,enableCommentsInViewing:o&&r})})},fA=async function(n){const r=this.activeEditor;if(ml(r)&&typeof r.replaceFile=="function"){const o=await r.replaceFile(n),s=o&&typeof o=="object"?o.state:null,l=s===null||s==="review-ready"||s==="editing-ready";return l&&(Ye(this,at,oA).call(this,r,n),this.emit("document-replaced",{editor:r,host:r==null?void 0:r.host})),{raw:o,confirmed:l}}const i=r&&!ml(r)?r.replaceFile:null;if(typeof i=="function"){const o=await i.call(r,n),s=o&&typeof o=="object"?o.state:void 0,l=s==null||s==="review-ready"||s==="editing-ready";return l&&(Ye(this,at,oA).call(this,r,n),this.emit("document-replaced",{editor:r,host:r==null?void 0:r.host})),{raw:o,confirmed:l}}throw new Error("SuperDoc: replaceFile is unavailable for the active editor")},hA=function(){var r,i,o,s,l,u,d,f,p;Ot(this,eu,null),Ye(this,at,ik).call(this),typeof this._cleanupAwareness=="function"&&(this._cleanupAwareness(),this._cleanupAwareness=null);const n=this.config;(i=(r=n.socket)==null?void 0:r.cancelWebsocketRetry)==null||i.call(r),(o=n.socket)==null||o.disconnect(),(s=n.socket)==null||s.destroy(),(l=this.ydoc)==null||l.destroy(),(d=(u=this.provider)==null?void 0:u.disconnect)==null||d.call(u),(p=(f=this.provider)==null?void 0:f.destroy)==null||p.call(f)},xy.allowedTypes=[Ho,Qp,V1],xy);const Ra={width:14,height:14,viewBox:"0 0 24 24",fill:"currentColor",className:"shrink-0"},s1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm0 4a6 6 0 100 12 6 6 0 000-12zm-2 5a1 1 0 112 0 1 1 0 01-2 0zm5 0a1 1 0 11-2 0 1 1 0 012 0z"})}),a1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4c-4.418 0-8 3.582-8 8 0 2.915 1.558 5.466 3.873 6.866L6 22l6-2 6 2-1.873-3.134C18.442 17.466 20 14.915 20 12c0-4.418-3.582-8-8-8zM8 10a1 1 0 112 0 1 1 0 01-2 0zm6 0a1 1 0 112 0 1 1 0 01-2 0zM8 4L5 1l1 4M16 4l3-3-1 4"})}),l1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 6a8 8 0 100 16 8 8 0 000-16zM6 9a3 3 0 110-6 3 3 0 010 6zm12 0a3 3 0 110-6 3 3 0 010 6zm-3 5a1 1 0 112 0 1 1 0 01-2 0zm-4 0a1 1 0 112 0 1 1 0 01-2 0z"})}),c1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{d:"M12 5a6 6 0 00-6 6v1a1 1 0 001 1h10a1 1 0 001-1v-1a6 6 0 00-6-6zM4 10c-2 0-3 2-3 5s1 4 3 4 1-1 1-2-1-2-1-3 1-2 1-2M20 10c2 0 3 2 3 5s-1 4-3 4-1-1-1-2 1-2 1-3-1-2-1-2M11 13v6c0 1 2 1 2 0v-6h-2z"})}),u1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 7a7 7 0 100 14 7 7 0 000-14zM8 5L5 2l2 4M16 5l3-3-2 4zM9 13a1 1 0 112 0 1 1 0 01-2 0zm5 0a1 1 0 112 0 1 1 0 01-2 0z"})}),d1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{d:"M22 12c-4-2-8-3-13-3-4 0-7 2-7 3s3 3 7 3c5 0 9-1 13-3zM5 9c0-1 1-2 2
627-2M10 8c0-1 1-2 2-2M15 8c0-1 1-1.5 2-1.5"})}),f1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5a6 6 0 100 12 6 6 0 000-12zm-2 5a1 1 0 112 0 1 1 0 01-2 0zm5 0a1 1 0 11-2 0 1 1 0 012 0zM5 9a3 3 0 100 6 3 3 0 000-6zm14 0a3 3 0 100 6 3 3 0 000-6z"})}),h1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5a8 8 0 100 16 8 8 0 000-16zM7 6L4 3l2 4M17 6l3-3-2 4zM6 11h4v2H6v-2zm8 0h4v2h-4v-2z"})}),p1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{d:"M2 16c3-1 7-7 12-8 4-1 7 1 8 3 0-2-3-6-8-6s-10 7-12 11zm18-3c2 0 2 2 2 4s-1 2-2 1-1-2-1-3 1-2 1-2zM12 8c1-2 3-3 5-2"})}),m1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5a7 7 0 100 14 7 7 0 000-14zM6 7L3 4l3 4M18 7l3-3-3 4M10 18l2-2 2 2-2-1-2 1z"})}),g1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5a8 8 0 100 16 8 8 0 000-16zM7 6L4 3l3 4M17 6l3-3-3 4zm-2 9a2 2 0 11-4 0 2 2 0 014 0z"})}),y1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{d:"M12 10a8 5 0 00-8 5v1a8 5 0 0016 0v-1a8 5 0 00-8-5zM7 5a4 4 0 100 8 4 4 0 000-8zm10 0a4 4 0 100 8 4 4 0 000-8z"})}),v1e=e=>_.jsxs("svg",{...Ra,...e,children:[_.jsx("ellipse",{cx:"12",cy:"16",rx:"2",ry:"5"}),_.jsx("circle",{cx:"12",cy:"8",r:"3"}),_.jsx("path",{d:"M10 7L6 3M14 7l4-4M10 14L5 11M14 14l5-3"})]}),b1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 3a5 5 0 100 10 5 5 0 000-10zm0 3a1 1 0 110 2 1 1 0 010-2zM14 8c2 0 4 2 4 6 0 5-3 8-7 8s-1-2-1-4 2-3 4-10zM6 8c-2 0-3 2-3 5s2 4 3 4h1V8H6z"})}),w1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{d:"M4 18c6 2 12 2 16 0 2-1 2-4 0-5-5-2-10-1-16 5zm13-5c0-2 1-4 2-5M15 13c0-2 0-4 1-5"})}),x1e=e=>_.jsxs("svg",{...Ra,...e,children:[_.jsx("ellipse",{cx:"10",cy:"17",rx:"6",ry:"4"}),_.jsx("path",{d:"M12 14c0-3 1-8 3-10 1 0 2 1 1 2s-2 3-2 8zM15 4c2 0 4 1 5 2-1 1-3 1-5-2z"})]}),k1e=e=>_.jsx("svg",{...Ra,...e,children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 6c-3.314 0-6 2.686-6 6s2.686 6 6 6 6-2.686 6-6-2.686-6-6-6zm0 3a3 3 0 100 6 3 3 0 000-6z"})}),Ea={Lion:s1e,Tiger:a1e,Bear:l1e,Elephant:c1e,Panther:u1e,Alligator:d1e,Orangutan:f1e,Raccoon:h1e,Dolphin:p1e,RedPanda:m1e,Pig:g1e,Frog:y1e,OrchidMantis:v1e,ScarletMacaw:b1e,BananaSlug:w1e,BigBird:x1e,Anaconda:k1e},pA=[{name:"Lion",color:"#ffd447",icon:Ea.Lion},{name:"Tiger",color:"#ff9747",icon:Ea.Tiger},{name:"Bear",color:"#874a26",icon:Ea.Bear},{name:"Elephant",color:"#97bec4",icon:Ea.Elephant},{name:"Panther",color:"#2c0e42",icon:Ea.Panther},{name:"Alligator",color:"#18a856",icon:Ea.Alligator},{name:"Orangutan",color:"#a87818",icon:Ea.Orangutan},{name:"Raccoon",color:"#4A4A4A",icon:Ea.Raccoon},{name:"Dolphin",color:"#3e4fbd",icon:Ea.Dolphin},{name:"RedPanda",color:"#cc2355",icon:Ea.RedPanda},{name:"Frog",color:"#3cb56e",icon:Ea.Frog},{name:"OrchidMantis",color:"#ffc9fb",icon:Ea.OrchidMantis},{name:"ScarletMacaw",color:"#0066CC",icon:Ea.ScarletMacaw},{name:"BananaSlug",color:"#eddd4a",icon:Ea.BananaSlug},{name:"BigBird",color:"#f7df05",icon:Ea.BigBird},{name:"Anaconda",color:"#2e8013",icon:Ea.Anaconda}],_1e=[{family:"Cambria",label:"Cambria",key:"Cambria, serif",fontWeight:400,props:{style:{fontFamily:"Cambria, serif"},"data-item":"btn-fontFamily-option"}},{family:"Calibri",label:"Calibri",key:"Calibri, sans-serif",fontWeight:400,props:{style:{fontFamily:"Calibri, sans-serif"},"data-item":"btn-fontFamily-option"}},{family:"Aptos",label:"Aptos",key:"Aptos, sans-serif",fontWeight:400,props:{style:{fontFamily:"Aptos, sans-serif"},"data-item":"btn-fontFamily-option"}},{family:"Arial",label:"Arial",key:"Arial, sans-serif",fontWeight:400,props:{style:{fontFamily:"Arial, sans-serif"},"data-item":"btn-fontFamily-option"}},{family:"Georgia",label:"Georgia",key:"Georgia, serif",fontWeight:400,props:{style:{fontFamily:"Georgia, serif"},"data-item":"btn-fontFamily-option"}},{family:"Times New Roman",label:"Times New Roman",key:"Times New Roman, serif",fontWeight:400,props:{style:{fontFamily:"Times New Roman, serif"},"data-item":"btn-fontFamily-option"}},{family:"Courier New",label:"Courier New",key:"Courier New, monospace",fontWeight:400,props:{style:{fontFamily:"Courier New, monospace"},"data-item":"btn-fontFamily-option"}},{family:"Verdana",label:"Verdana",key:"Verdana, sans-serif",fontWeight:400,props:{style:{fontFamily:"Verdana, sans-serif"},"data-item":"btn-fontFamily-option"}}];let l_=!1;const cU="pk_prod_s5rfE39-JLZB9UTO08MNu5ZaXkzNF1jKaFz8V-7ab32QgePmL69A2x8apTRnMsJS",c_=new URLSearchParams(window.location.search).get("room"),CN=Object.keys(Ea),C1e=CN[Math.floor(Math.random()*CN.length)].toLowerCase(),S1e=String(Math.floor(100+Math.random()*900)),uU=`${C1e}${S1e}`,u_=c_||uU;`${window.location.href.split("?")[0]}${u_}`;const E1e=c_?{providerType:"liveblocks",documentId:c_,publicApiKey:cU,roomMode:"join"}:null;let CC=!1;function A1e(){return CC?null:E1e}function Y1(){return CC?uU:u_}function T1e(){CC=!0;const e=new URL(window.location.href);e.searchParams.delete("room"),window.history.replaceState(null,"",e.toString())}function I1e(){l_=!0}let _x=null,mA=!1;const gA=new Set;function R1e(e){return gA.add(e),e(mA),()=>{gA.delete(e)}}function SN(e){mA!==e&&(mA=e,gA.forEach(t=>t(e)))}const O1e=50,N1e=5e3;function M1e(e,t,n){if(!e)return;const r=Date.now(),i=()=>{var u;const o=(u=document.getElementById(t))==null?void 0:u.querySelector(".superdoc-page"),s=(o==null?void 0:o.clientWidth)??0;if(!s){Date.now()-r<N1e&&window.setTimeout(i,O1e);return}const l=n(document.documentElement.clientWidth,s);l!==100&&(console.log("🦋️ 🤝️ Collaboration - restoring document zoom after the upgrade remount...",l),e.setZoom(100),window.setTimeout(()=>e.setZoom(l),0))};i()}async function D1e(e,t=CC||!c_,n=Y1()){if(l_)return!0;
627if(!e)throw new Error("The document is still loading — try sharing again in a moment.");return _x||(console.log(`🦋️ 🤝️ Collaboration - ${t?"creating":"joining"} Liveblocks room:`,n),SN(!0),_x=e.upgradeToCollaboration({v2Collaboration:{providerType:"liveblocks",documentId:n,publicApiKey:cU,roomMode:t?"create":"join"}}).then(()=>(l_=!0,!0)).catch(r=>{throw _x=null,r instanceof Error?r:new Error(String(r))}).finally(()=>{SN(!1)})),_x}const EN="-collab-upgrade-overlay",L1e=16,P1e=3e3,B1e=100;function j1e(e){var t;try{const n=document.getElementById(e),r=n==null?void 0:n.parentElement;if(!n||!r||!n.querySelector(".v2-super-editor"))return null;(t=document.getElementById(`${e}${EN}`))==null||t.remove();const i=n.cloneNode(!0);i.id=`${e}${EN}`,i.querySelectorAll("[id]").forEach(u=>u.removeAttribute("id")),i.setAttribute("aria-hidden","true"),i.setAttribute("inert",""),Object.assign(i.style,{position:"absolute",top:`${n.offsetTop}px`,left:`${n.offsetLeft}px`,width:`${n.offsetWidth}px`,height:`${n.offsetHeight}px`,margin:"0",zIndex:"30"}),r.insertBefore(i,n.nextSibling);const o=[n,...n.querySelectorAll("*")],s=[i,...i.querySelectorAll("*")],l=[];return o.forEach((u,d)=>{if(!u.scrollTop&&!u.scrollLeft)return;const f=s[d];f&&(f.scrollTop=u.scrollTop,f.scrollLeft=u.scrollLeft),u.id&&l.push({el:u,top:u.scrollTop,left:u.scrollLeft})}),F1e(i,e,l)}catch(n){return console.error("🦋️ 🤝️ Collaboration - could not freeze the editor surface:",n),null}}function F1e(e,t,n){let r=0,i=0,o=0,s=0,l=!1;const u=m=>{l||(l=!0,cancelAnimationFrame(r),window.clearTimeout(i),window.clearTimeout(o),window.clearTimeout(s),m&&n.forEach(({el:y,top:b,left:k})=>{b&&(y.scrollTop=b),k&&(y.scrollLeft=k)}),e.remove())},d=()=>{var b;const m=(b=document.getElementById(t))==null?void 0:b.querySelector(".v2-super-editor");if(!m||!m.offsetHeight)return!1;const y=m.querySelector(".v2-super-editor__visuals");return!(y!=null&&y.classList.contains("v2-super-editor__visuals--hidden"))},f=m=>{r=requestAnimationFrame(()=>{window.clearTimeout(o),m()}),o=window.setTimeout(()=>{cancelAnimationFrame(r),m()},B1e)},p=()=>{if(!l){if(!d()){i=window.setTimeout(p,L1e);return}f(()=>f(()=>u(!0)))}};return{release:()=>{l||s||(s=window.setTimeout(()=>u(!0),P1e),p())},cancel:()=>u(!1)}}const AN="data-collab-upgrading",t4="data-collab-dim";function z1e(e){const t=document.getElementById(e);return t?(t.querySelectorAll(".sd-disabled").forEach(n=>n.setAttribute(t4,"")),t.setAttribute(AN,"true"),()=>{t.removeAttribute(AN),t.querySelectorAll(`[${t4}]`).forEach(n=>n.removeAttribute(t4))}):()=>{}}const U1e="/SuperDoc.docx",dU=pA[Math.floor(Math.random()*pA.length)],V1e=`${dU.name}`,H1e=Math.floor(Math.random()*1e3+1),Wp=`SuperDocFan_${V1e}${H1e}`,TN=`${Wp}@superdoc.dev`;function $1e(e,t){if(e==null||e==0||t==null||t==0)return 100;let n=null;if(e==null||e==0||e==0||e>1300?n=100:e>1200?n=80:e>1100?n=70:e>600?n=55:e>400?n=35:e>350?n=30:n=25,t>1e3){let r=Math.round(e/t*.45*100);r=Math.max(10,r),n=r}return n}function yA(e,t){const n=document.getElementById(t);if(!n)return!1;const r=fU(e);return n.setAttribute("data-has-comments",r?"true":"false"),r}function fU(e){var n;const t=(n=e==null?void 0:e.commentsStore)==null?void 0:n.commentsList;return Array.isArray(t)&&t.length>0}const G1e=100,q1e=750,W1e=3e3;function K1e(e,t,n,r){const i=Date.now();let o=!1;const s=()=>{o||(o=!0,n())},l=()=>{if(r())return;const u=Date.now()-i;if(fU(e)){yA(e,t),s();return}u>=q1e&&(yA(e,t),s()),u<W1e&&setTimeout(l,G1e)};l()}function Y1e(e){let t=0;return e==null||e.querySelectorAll(".superdoc-page").forEach(n=>{t=Math.max(t,n.clientWidth)}),t}const X1e=320,Z1e=820,Q1e=28,J1e=8;function e2e(e,t){const n=document.getElementById(t),r=n==null?void 0:n.closest('[id$="-surface"]'),i=Y1e(n);if(!n||!r||!i)return e;const o=getComputedStyle(n),s=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),l=r.clientWidth-s,d=(n.getAttribute("data-has-comments")==="true"||!!n.querySelector(".superdoc--with-sidebar"))&&l>=Z1e?X1e:0,f=l-d-Q1e-J1e,p=Math.max(10,Math.floor(f/i*100));return Math.min(e,p)}function hU(e,t,n){return e2e($1e(t,n),e)}function pU(e,t){var s;const n=document.getElementById(t),r=document.documentElement.clientWidth,i=((s=n==null?void 0:n.querySelector(".superdoc-page"))==null?void 0:s.clientWidth)??500,o=hU(t,r,i);return e.setZoom(o),o}let IN;function t2e(e,t){clearTimeout(IN),IN=setTimeout(()=>pU(e,t),100)}const n2e=50,r2e=3e3,i2e=150;function o2e(e,t,n,r){const i=Date.now(),o=()=>{var f,p;
627if(r())return;if(!(((p=(f=document.getElementById(t))==null?void 0:f.querySelector(".superdoc-page"))==null?void 0:p.clientWidth)??0)){Date.now()-i<r2e?window.setTimeout(o,n2e):n();return}const l=pU(e,t);console.log("🦋️ Applied onready document zoom...",l);let u=!1;const d=()=>{u||r()||(u=!0,n())};requestAnimationFrame(()=>requestAnimationFrame(d)),window.setTimeout(d,i2e)};o()}const s2e=Se.forwardRef(function({idPrefix:t,className:n="",height:r="500px",document:i=null,onVersion:o,onReady:s,onAwarenessUpdate:l,onCollaborationReady:u,onCollaborationError:d,onNewCollabDocReady:f,onPaginationUpdate:p,onPagesVisible:m,onLoadError:y,aiSidepanelOpen:b=!1},k){const S=Se.useRef(null),x=Se.useRef(null),[T,C]=Se.useState(null),[I,D]=Se.useState(!1),[P,V]=Se.useState(!1),ee=I&&P,[F,H]=Se.useState(!1),[te,M]=Se.useState(!1),Z=Se.useRef(null),L=Se.useRef(null),W=Se.useRef(!1),U=Se.useRef(o);U.current=o;const q=Se.useRef(s);q.current=s;const Q=Se.useRef(l);Q.current=l;const re=Se.useRef(u);re.current=u;const ne=Se.useRef(d);ne.current=d;const J=Se.useRef(f);J.current=f;const ge=Se.useRef(p);ge.current=p;const le=Se.useRef(m);le.current=m;const ve=Se.useRef(y);return ve.current=y,Se.useEffect(()=>{var Ee;ee&&((Ee=le.current)==null||Ee.call(le))},[ee]),Se.useEffect(()=>{const Ee=`${t}-surface`,st=`${t}-toolbar`,At=`${t}-editor`,yt=R1e(Ge=>{var Be,he,Oe,ye;H(Ge),Ge&&!W.current?((Be=Z.current)==null||Be.cancel(),(he=L.current)==null||he.call(L),L.current=z1e(st),Z.current=j1e(Ee),M(!!Z.current)):!Ge&&W.current&&(M1e(x.current,At,(B,be)=>hU(At,B,be)),(Oe=L.current)==null||Oe.call(L),L.current=null,(ye=Z.current)==null||ye.release(),Z.current=null,M(!1)),W.current=Ge});return()=>{var Ge,Be;yt(),(Ge=Z.current)==null||Ge.cancel(),Z.current=null,(Be=L.current)==null||Be.call(L),L.current=null}},[t]),Se.useImperativeHandle(k,()=>({exportDocx:Ee=>{var st;return((st=x.current)==null?void 0:st.export({exportType:["docx"],commentsType:"external",triggerDownload:!0,...Ee?{exportedName:Ee}:{}}))??Promise.resolve()},exportPDF:async()=>{var st;const Ee=await(((st=x.current)==null?void 0:st.export({exportType:["docx"],commentsType:"external",triggerDownload:!1}))??Promise.resolve(null));return Ee instanceof Blob?Ee:null},getSuperDoc:()=>x.current,enableCollaboration:()=>D1e(x.current),scrollToTop:()=>{S.current&&S.current.querySelectorAll("*").forEach(Ee=>{Ee.scrollTop>0&&(Ee.scrollTop=0)})},openFindReplace:()=>{var Ge,Be;const Ee=x.current;if(!Ee)return;const st=(Be=(Ge=Ee.activeEditor)==null?void 0:Ge.view)==null?void 0:Be.dom;try{st?st.focus():Ee.focus()}catch{}const At=/Mac|iPhone|iPad|iPod/.test(navigator.platform)||/Mac/.test(navigator.userAgent),yt=new KeyboardEvent("keydown",{key:"f",code:"KeyF",metaKey:At,ctrlKey:!At,bubbles:!0,cancelable:!0});document.dispatchEvent(yt)}}),[]),Se.useEffect(()=>{const Ee=`${t}-editor`,st=`${t}-toolbar`,At=`${t}-comments`,yt=`${t}-surface`,Ge=`${t}-ruler`;let Be=!1,he=null;return(async()=>{var ie;if(Be)return;const ye=A1e(),B=Y1(),be={id:B,type:Ho,url:i??U1e,...ye?{v2Collaboration:ye}:{}};he=null;try{he=new Jbe({document:be,selector:`#${Ee}`,toolbar:`#${st}`,rulerContainer:`#${Ge}`,modules:{comments:{allowResolve:!0,element:`#${At}`,displayMode:"auto",compactBreakpointPx:820,compactMeasurementSelector:`#${yt}`},surfaces:{findReplace:!0},toolbar:{responsiveToContainer:!0,excludeItems:["acceptTrackedChangeBySelection","rejectTrackedChangeOnSelection","measurementUnit"],fonts:_1e},contextMenu:{includeDefaultItems:!0,customItems:[]}},user:{name:Wp,email:TN,color:dU.color},colors:["#f542b3","#007ab8","#0b8700","#e88205","#e33724","#0066CC","#ffc9fb","#f7df05","#2e8013"],telemetry:{enabled:!0,metadata:{source:"superdoc-homepage"}},documentMode:"editing",onAwarenessUpdate:fe=>{const ue=Q.current;if(!ue)return;const Ce=(fe.states??[]).map(Ue=>{const K=String(Ue.name??""),oe=typeof Ue.email=="string"?Ue.email:void 0;return{name:K,email:oe,color:typeof Ue.color=="string"?Ue.color:void 0,clientId:Ue.clientId,isSelf:oe===TN||K===Wp}}).filter(Ue=>Ue.name);ue({states:Ce,added:fe.added,removed:fe.removed,superdoc:x.current})},onCommentsUpdate:()=>yA(he,Ee),onPaginationUpdate:({totalPages:fe})=>{var ue;return(ue=ge.current)==null?void 0:ue.call(ge,fe)},onCollaborationReady:()=>{var fe;console.log("🦋️ 🤝️ Collaboration ready - room:",B,"- user:",Wp),I1e(),(fe=re.current)==null||fe.call(re,B,!!ye)},onException:fe=>{var Ue,K;if("diagnosticCode"in fe){fetch("/log-diagnostic",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({diagnosticCode:fe.diagnosticCode,diagnosticStage:fe.diagnosticStage,severity:fe.severity,internalCode:fe.internalCode,documentId:fe.documentId??null,message:typeof fe.message=="string"?fe.message.slice(0,500):null,superdocVersion:((Ue=x.current)==null?void 0:Ue.version)??null,pageUrl:window.location.href})}).catch(()=>{}),console.error("🦋️ Diagnostic:",fe.diagnosticCode,fe.message);return}const ue="code"in fe?fe.code:void 0,Ce=fe.error instanceof Error?fe.error.message:`SuperDoc failed to initialize: (${ue})`;if(ue!=null&&ue.startsWith("collaboration")){console.error("🦋️ 🤝️ Collaboration failed:",ue,Ce),T1e(),(K=ne.current)==null||K.call(ne,Ce,ue);return}console.error("🦋️ Exception:",ue,Ce)},onReady:async()=>{var fe,ue;he&&(console.log("🦋️ SuperDoc is ready~!"),(fe=q.current)==null||fe.call(q),(ue=U.current)==null||ue.call(U,he.version),K1e(he,Ee,()=>V(!0),()=>Be),window.addEventListener("resize",()=>t2e(he,Ee)),o2e(he,Ee,()=>D(!0),()=>Be))}}),x.current=he}catch(fe){console.error("SuperDoc init error:",fe);const ue=fe instanceof Error?fe.message:"Failed to load document in SuperDoc editor";C(ue),(ie=ve.current)==null||ie.call(ve,ue)}})(),()=>{Be=!0,x.current=null;try{he==null||he.destroy()}catch{}}},[t,i]),T?_.jsx("div",{className:`flex items-center justify-center ${n}`,style:{minHeight:r},children:_.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:T})}):_.jsxs("div",{ref:S,className:`relative flex flex-col min-h-0 ${n}`,"data-doc-loading":ee?"false":"true",children:[_.jsx("div",{id:`${t}-toolbar`,className:"flex-shrink-0 w-full min-w-0 border-b border-slate-200/70 dark:border-white/10 bg-white dark:bg-dark-800 min-h-[36px] mx-auto pr-1"}),_.jsx("div",{id:`${t}-ruler`,className:"flex-shrink-0 w-full min-w-0 overflow-hidden bg-white dark:bg-dark-800"}),_.jsxs("div",{id:`${t}-surface`,className:"flex flex-1 min-h-0 min-w-0 justify-center relative",children:[!ee&&_.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white dark:bg-dark-800",children:_.jsxs("div",{"data-doc-loader":!0,className:"flex flex-col items-center gap-3",children:[_.jsx("div",{className:"w-8 h-8 border-2 border-slate-200 dark:border-white/20 border-t-brand-500 rounded-full animate-spin"}),_.jsx("span",{className:"text-xs text-slate-400 dark:text-slate-500",children:"Loading document..."})]})}),F&&!te&&_.jsx("div",{"data-collab-skeleton":"true",className:"absolute inset-0 z-20 flex justify-center overflow-hidden bg-white dark:bg-dark-800",children:_.jsxs("div",{className:"w-full max-w-[816px] px-10 pt-10 sm:px-14","aria-hidden":"true",children:[_.jsxs("div",{className:"animate-pulse",children:[_.jsx("div",{className:"h-6 w-1/2 roun
627ded bg-slate-200 dark:bg-white/10"}),_.jsx("div",{className:"mt-3 h-3 w-1/3 rounded bg-slate-100 dark:bg-white/[0.06]"}),[["11/12","10/12","9/12"],["full","11/12","7/12"]].map((Ee,st)=>_.jsx("div",{className:"mt-8 space-y-3",children:Ee.map((At,yt)=>_.jsx("div",{className:"h-3 rounded bg-slate-100 dark:bg-white/[0.06]",style:{width:At==="full"?"100%":`${Number(At.split("/")[0])/12*100}%`}},yt))},st)),_.jsx("div",{className:"mt-8 grid grid-cols-3 gap-2",children:Array.from({length:6}).map((Ee,st)=>_.jsx("div",{className:"h-8 rounded bg-slate-100 dark:bg-white/[0.06]"},st))})]}),_.jsxs("div",{className:"mt-8 flex items-center justify-center gap-2",children:[_.jsx("div",{className:"w-3.5 h-3.5 border-2 border-slate-200 dark:border-white/20 border-t-brand-500 rounded-full animate-spin"}),_.jsx("span",{className:"text-xs text-slate-400 dark:text-slate-500",children:"Starting collaboration..."})]})]})}),_.jsxs("div",{className:"flex flex-shrink-0 min-h-0 min-w-0 max-w-full","data-ai-open":b?"true":"false",children:[_.jsx("div",{id:`${t}-editor`,className:`min-h-0 min-w-0 overflow-y-auto overflow-x-hidden scroll-smooth bg-white dark:bg-dark-800 pr-0 ${ee?"":"opacity-0"}`,"data-has-comments":"true"}),_.jsx("div",{id:`${t}-comments`,className:"flex-shrink-0"})]})]})]})}),Fy=[{id:"gpt-5.6-terra",name:"GPT-5.6",provider:"openai",enabled:!0},{id:"gpt-5.5",name:"GPT-5.5",provider:"openai",enabled:!0},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",provider:"openai",enabled:!0},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",provider:"anthropic",enabled:!0},{id:"claude-haiku-4-5",name:"Claude Haiku 4.5",provider:"anthropic",enabled:!0}],X1="gpt-5.6-terra";async function pT(e,t={}){const n=await fetch("/document-api",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(await c2e(n));return(n.headers.get("content-type")||"").includes("application/json")?a2e(n,t.onEvent):l2e(n,t.onEvent,t.onStatus)}async function a2e(e,t){const n=await e.json(),r=typeof n.output=="string"?n.output:null,i=r?[{type:"final",output:r}]:[];for(const o of i)t==null||t(o);return{events:i,finalOutput:r}}async function l2e(e,t,n){if(!e.body)throw new Error("Response stream not available");const r=e.body.getReader(),i=new TextDecoder,o=[];let s=null,l="",u=[],d=!1;for(;!d;){const f=await r.read();d=f.done,l+=i.decode(f.value||new Uint8Array,{stream:!d});const p=l.split(/\r?\n/);l=p.pop()??"";for(const m of p){if(m.startsWith("data:")){u.push(m.slice(5).trimStart());continue}m.trim()===""&&(RN(u,o,t,y=>{s=y},n),u=[])}}return l.startsWith("data:")&&(u.push(l.slice(5).trimStart()),l=""),RN(u,o,t,f=>{s=f},n),{events:o,finalOutput:s}}function RN(e,t,n,r,i){if(e.length===0)return;const o=e.join(`
628`).trim();if(!o)return;let s;try{s=JSON.parse(o)}catch{return}if(t.push(s),n==null||n(s),s.type==="status"&&typeof s.content=="string"&&(i==null||i(s.content)),typeof s.output=="string"&&s.type==="final"&&r(s.output),s.type==="error")throw new Error(typeof s.error=="string"?s.error:typeof s.content=="string"?s.content:"Document API request failed")}async function c2e(e){const t=`Request failed (${e.status})`;try{const n=await e.text();try{const r=JSON.parse(n);return r.error||r.details||t}catch{return n||t}}catch{return t}}const u2e=2e4,d_=250,d2e=15e3,ON=2e3,Kd=e=>e??null,Z1=e=>new Promise(t=>setTimeout(t,e));function mU(e){var n,r;const t=(r=(n=Kd(e))==null?void 0:n.commentsStore)==null?void 0:r.commentsList;return Array.isArray(t)?t:[]}function gU(e){const t=(e==null?void 0:e.commentId)??(e==null?void 0:e.id);return typeof t=="string"&&t?t:null}function yU(e,t){return mU(e).find(n=>gU(n)===t)}async function mT(e){var n,r;const t=(r=(n=Kd(e))==null?void 0:n.activeEditor)==null?void 0:r.v2TrackedChanges;if(!(t!=null&&t.listTrackedChanges))return[];try{const i=await t.listTrackedChanges(),o=i==null?void 0:i.items;return Array.isArray(o)?o.filter(s=>typeof(s==null?void 0:s.id)=="string"&&s.id):[]}catch{return[]}}function vU(e){const t=[];for(const n of mU(e)){const r=gU(n);r&&(n.trackedChange||n.trackedChangeType)&&t.push(r)}return t}async function f2e(e){const t=new Set;for(const n of await mT(e))t.add(n.id);for(const n of vU(e))t.add(n);return t}function h2e(e,t){const n=yU(e,t),r=new Set([t,encodeURIComponent(t)]);n&&(n.trackedChangeCanonicalId&&r.add(String(n.trackedChangeCanonicalId)),n.uid&&r.add(String(n.uid)),n.importedId!==null&&n.importedId!==void 0&&n.importedId!==""&&r.add(`imported:${n.importedId}`));for(const i of t.split("|"))if(!(i.length<12)){try{r.add(decodeURIComponent(i))}catch{}r.add(i)}
628return[...r].filter(Boolean)}function p2e(e,t,n){if(!e)return null;const r=h2e(t,n),i=e.querySelectorAll("[data-track-change-id], [data-comment-ids]");for(const o of[!0,!1])for(const s of i){const l=[s.getAttribute("data-track-change-id")??"",s.getAttribute("data-comment-ids")??""];for(const u of l)if(u&&r.some(d=>o?u===d:u.includes(d)))return s}return null}async function m2e(e,t){const n=[];for(const r of await mT(e))t.has(r.id)||n.push(r.id);for(const r of vU(e))!t.has(r)&&!n.includes(r)&&n.push(r);return n}async function NN(e,t){var i,o;const n=yU(e,t),r=(o=(i=Kd(e))==null?void 0:i.activeEditor)==null?void 0:o.v2TrackedChanges;if(!n||!(r!=null&&r.focusTrackedChange))return!1;try{const s=await r.focusTrackedChange(n);return!!(s!=null&&s.ok)}catch{return!1}}function g2e(e){var r,i;const t=[],n=[];for(const o of e.cells??[])for(const s of o.content??[]){const l=(r=s==null?void 0:s.paragraphIds)==null?void 0:r.paraId;typeof l=="string"&&l&&t.push(l);const u=(((i=s==null?void 0:s.paragraph)==null?void 0:i.inlines)??[]).map(d=>{var f;return((f=d==null?void 0:d.run)==null?void 0:f.text)??""}).join("");u&&n.push(u)}return{paraIds:t,text:n.join(" | ")}}async function bU(e){var n,r,i,o,s;const t=(r=(n=Kd(e))==null?void 0:n.activeEditor)==null?void 0:r.doc;if(!((i=t==null?void 0:t.blocks)!=null&&i.list)||!t.getNode)return[];try{const l=await t.blocks.list(),u=Array.isArray(l==null?void 0:l.blocks)?l.blocks:[],d=[];for(const f of u)if(!((f==null?void 0:f.nodeType)!=="table"||typeof f.nodeId!="string"))try{const p=await t.getNode({kind:"block",nodeId:f.nodeId}),m=(s=(o=p==null?void 0:p.node)==null?void 0:o.table)==null?void 0:s.rows;d.push({nodeId:f.nodeId,ordinal:f.ordinal,rows:Array.isArray(m)?m.map(g2e):[]})}catch{}return d}catch{return[]}}const MN=e=>e.paraIds.length?e.paraIds.join("|"):`text:${e.text}`;function y2e(e,t){const n=new Map(e.map(r=>[r.nodeId,r]));for(const r of t){const i=n.get(r.nodeId);if(!i){if(r.rows.length)return{table:r,row:r.rows[0],kind:"new-table"};continue}const o=new Map(i.rows.map(s=>[MN(s),s]));for(const s of r.rows){const l=o.get(MN(s));if(!l)return{table:r,row:s,kind:"new-row"};if(l.text!==s.text)return{table:r,row:s,kind:"updated-row"}}}return null}function gT(e,t){if(!e)return null;const n=`"sourceNodeId":"${t}"`;for(const r of e.querySelectorAll("[data-source-anchor]"))if((r.getAttribute("data-source-anchor")??"").includes(n))return r;return null}const DN=e=>e.replace(/\s+/g," ").trim();function v2e(e,t){if(!e)return null;for(const r of t.paraIds){const i=gT(e,r);if(i)return i}const n=DN(t.text.replace(/ \| /g," "));if(!n)return null;for(const r of e.querySelectorAll("[data-superdoc-table-row-role], [role=row]"))if(DN(r.textContent??"")===n)return r;return null}async function wU(e){var r,i,o;const t=new Map,n=(i=(r=Kd(e))==null?void 0:r.activeEditor)==null?void 0:i.doc;if(!((o=n==null?void 0:n.comments)!=null&&o.list))return t;try{const s=await n.comments.list({includeResolved:!0});(Array.isArray(s==null?void 0:s.items)?s.items:[]).forEach((u,d)=>{var m,y,b;const f=(u==null?void 0:u.commentId)??(u==null?void 0:u.id);if(typeof f!="string"||!f)return;const p=(y=(m=u.target)==null?void 0:m.segments)==null?void 0:y[0];t.set(f,{commentId:f,parentCommentId:u.parentCommentId??null,text:u.text??"",blockId:typeof(p==null?void 0:p.blockId)=="string"?p.blockId:null,rangeStart:typeof((b=p==null?void 0:p.range)==null?void 0:b.start)=="number"?p.range.start:0,index:d})});for(const u of t.values()){let d=u;for(let f=0;!u.blockId&&(d!=null&&d.parentCommentId)&&f<10;f++)d=t.get(d.parentCommentId),d!=null&&d.blockId&&(u.blockId=d.blockId,u.rangeStart=d.rangeStart)}}catch{}return t}async function b2e(e){var r,i,o;const t=new Map,n=(i=(r=Kd(e))==null?void 0:r.activeEditor)==null?void 0:i.doc;if(!((o=n==null?void 0:n.blocks)!=null&&o.list))return t;try{const s=await n.blocks.list();for(const l of(s==null?void 0:s.blocks)??[])typeof(l==null?void 0:l.nodeId)=="string"&&t.set(l.nodeId,l.ordinal)}catch{}return t}function w2e(e,t,n){const r=[];for(const o of t.values()){const s=e.get(o.commentId);(!s||s.text!==o.text)&&r.push(o)}if(!r.length)return null;const i=o=>o.blockId&&n.has(o.blockId)?n.get(o.blockId):Number.MAX_SAFE_INTEGER;return r.sort((o,s)=>i(o)-i(s)||o.rangeStart-s.rangeStart||o.index-s.index),r[0]}function LN(e,t){if(!e)return null;for(const n of e.querySelectorAll("[data-comment-ids]"))if((n.getAttribute("data-comment-ids")??"").split(",").map(i=>i.trim()).includes(t))return n;return null}async function PN(e,t){var r,i;const n=(i=(r=Kd(e))==null?void 0:r.activeEditor)==null?void 0:i.v2Comments;if(!(n!=null&&n.focusComment))return!1;try{const o=await n.focusComment(t);return!!(o!=null&&o.ok)}catch{return!1}}async function xU(e){var n,r,i;const t=(r=(n=Kd(e))==null?void 0:n.activeEditor)==null?void 0:r.doc;if(!((i=t==null?void 0:t.blocks)!=null&&i.list))return[];try{const o=await t.blocks.list();return(Array.isArray(o==null?void 0:o.blocks)?o.blocks:[]).filter(l=>typeof(l==null?void 0:l.nodeId)=="string"&&l.nodeId&&l.nodeType!=="table").map(l=>({nodeId:l.nodeId,ordinal:l.ordinal,nodeType:l.nodeType,textPreview:l.textPreview??""}))}catch{return[]}}function x2e(e,t){const n=new Map(e.map(r=>[r.nodeId,r]));for(const r of t){const i=n.get(r.nodeId);if(!i)return{block:r,kind:"new-block"};if(i.textPreview!==r.textPreview)return{block:r,kind:"updated-block"}}return null}const k2e=8e3,_2e=700;async function C2e(e,t){const n=e??t.closest('[id$="-editor"]'),r=()=>{if(!t.isConnected)return!1;const s=n==null?void 0:n.getBoundingClientRect(),l=t.getBoundingClientRect();return!!(s&&l.height>0&&l.top>=s.top&&l.bottom<=s.bottom)},i=()=>
628{if(n){const s=n.getBoundingClientRect(),l=t.getBoundingClientRect();n.scrollTop=n.scrollTop+(l.top-s.top)-s.height/2+l.height/2}else t.scrollIntoView({behavior:"auto",block:"center"})},o=Date.now()+k2e;for(let s=0;s<2;s++){for(;Date.now()<o;){if(!t.isConnected)return!1;if(i(),await Z1(d_),r())break}if(!r())return!1;if(await Z1(_2e),r())return!0}return r()}async function BN(e,t){var r,i;const n=(i=(r=Kd(e))==null?void 0:r.activeEditor)==null?void 0:i.host;if(!n)return!1;try{if(n.pageIndexForBodyTarget&&n.scrollToPage){const o=await n.pageIndexForBodyTarget(t);if(typeof o=="number"&&o>=0&&await n.scrollToPage(o))return!0}if(typeof t.bodyChildOrdinal=="number"&&n.revealBodyTarget){const o=await n.revealBodyTarget(t);return(o==null?void 0:o.status)==="revealed"}}catch{}return!1}async function SC(e,t,n,r,i){const o=await BN(e(),n),s=Date.now()+(o?d2e:3e3);let l=Date.now()+ON;for(;Date.now()<s;){const u=r();if(u)return await C2e(t(),u),i&&await i(),!0;o&&Date.now()>=l&&(await BN(e(),n),l=Date.now()+ON),await Z1(d_)}return!1}async function S2e(e,t,n){var l;if(await NN(e(),n))return!0;const r=(await mT(e())).find(u=>u.id===n),i=((l=r==null?void 0:r.navigationTarget)==null?void 0:l.blockId)??null;if(await SC(e,t,{paraId:i},()=>p2e(t(),e(),n),()=>NN(e(),n)))return!0;const s=Kd(e());try{if(s!=null&&s.scrollToElement&&await s.scrollToElement(n))return!0}catch{}return!1}async function E2e(e,t,n){return SC(e,t,{bodyChildOrdinal:n.table.ordinal,paraId:n.row.paraIds[0]??null},()=>v2e(t(),n.row))}async function A2e(e,t,n){const{nodeId:r,ordinal:i}=n.block;return SC(e,t,{paraId:r,bodyChildOrdinal:i},()=>{var o;return gT(t(),r)??((o=t())==null?void 0:o.querySelector(`[data-block-id$="/${r}/o${i}"]`))??null})}async function T2e(e,t,n){return LN(t(),n.commentId)&&await PN(e(),n.commentId)?!0:await SC(e,t,{paraId:n.blockId},()=>LN(t(),n.commentId)??(n.blockId?gT(t(),n.blockId):null),()=>PN(e(),n.commentId))}async function yT(e){const[t,n,r,i]=await Promise.all([f2e(e),wU(e),bU(e),xU(e)]);return{trackedChangeIds:t,comments:n,tables:r,blocks:i}}async function jN(e,t){const n=await m2e(e,t.trackedChangeIds);if(n.length)return{kind:"tracked-change",id:n[0]};const r=w2e(t.comments,await wU(e),await b2e(e));if(r)return{kind:"comment",comment:r};const i=y2e(t.tables,await bU(e)),o=x2e(t.blocks,await xU(e));return i&&o?o.block.ordinal<i.table.ordinal?{kind:"block",target:o}:{kind:"table-row",target:i}:i?{kind:"table-row",target:i}:o?{kind:"block",target:o}:null}async function I2e({getSuperDoc:e,before:t,timeoutMs:n=u2e}){const r=Date.now()+n;for(;Date.now()<r;){const i=await jN(e(),t);if(i)return await Z1(d_*2),await jN(e(),t)??i;await Z1(d_)}return null}function R2e(e,t,n){switch(n.kind){case"tracked-change":return S2e(e,t,n.id);case"comment":return T2e(e,t,n.comment);case"table-row":return E2e(e,t,n.target);default:return A2e(e,t,n.target)}}async function vT(e){try{const t=await I2e(e);return t?await R2e(e.getSuperDoc,e.getEditorEl,t):!1}catch{return!1}}const O2e="https://docs.superdoc.dev/agents/build/build-an-agent/",N2e=e=>_.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:_.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.911 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855-5.815-3.356 2.014-1.168a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.104v-5.677a.79.79 0 0 0-.424-.694zm2.01-3.023-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365 2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5Z"})}),M2e=e=>
628_.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:_.jsx("path",{d:"M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-3.654 0H6.57L0 20h3.603l1.498-3.818h6.357l1.497 3.818h3.604L10.173 3.52zm-3.46 9.673 2.11-5.525 2.108 5.525H6.713z"})}),kU=({model:e,onSelect:t,className:n})=>_.jsxs("div",{role:"listbox",className:`bg-white dark:bg-dark-800 border border-slate-200 dark:border-white/10 rounded-lg shadow-lg z-50 flex flex-col ${n??""}`,children:[_.jsx("div",{className:"overflow-y-auto max-h-[240px] py-1",children:Fy.map(r=>_.jsxs("button",{type:"button",role:"option","aria-selected":r.id===e,"aria-disabled":!r.enabled,disabled:!r.enabled,onClick:()=>{r.enabled&&t(r.id)},className:`w-full px-3 py-2 text-left text-xs transition-colors flex items-center gap-2 ${r.enabled?r.id===e?"text-purple-600 dark:text-purple-400 font-medium hover:bg-slate-100 dark:hover:bg-white/5":"text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5":"text-slate-400 dark:text-slate-500 cursor-not-allowed"}`,children:[r.provider==="openai"&&_.jsx(N2e,{className:"w-3.5 h-3.5 flex-shrink-0 text-slate-500 dark:text-slate-400"}),r.provider==="anthropic"&&_.jsx(M2e,{className:"w-3.5 h-3.5 flex-shrink-0 text-slate-500 dark:text-slate-400"}),r.name]},r.id))}),_.jsx("div",{className:"border-t border-slate-200 dark:border-white/10",children:_.jsxs("a",{href:O2e,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 w-full px-3 py-2 text-xs text-slate-600 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-white/5 transition-colors",children:[_.jsx(hk,{className:"w-3 h-3 flex-shrink-0"}),"Add a custom model"]})})]}),D2e=5e3,_U=({visible:e=!1,onSubmitToChat:t,roomId:n=null,onEnsureRoomId:r,value:i,onValueChange:o,isSubmitting:s,onSubmittingChange:l,model:u,onModelChange:d,isCustomDoc:f,getSuperDoc:p,editorId:m})=>{var ne;const y=Se.useRef(null),b=Se.useRef(null),[k,S]=Se.useState(""),[x,T]=Se.useState(!1),[C,I]=Se.useState(X1),[D,P]=Se.useState(!1),[V,ee]=Se.useState(!1),[F,H]=Se.useState(!1),te=Se.useRef(null),M=l?s??!1:x,Z=l??T,L=i!==void 0?i:k,W=u??C,U=d??I,q=J=>o?o(J):S(J);(V||F)&&!M&&L.trim(),sg.useEffect(()=>{const J=ge=>{te.current&&!te.current.contains(ge.target)&&P(!1),b.current&&!b.current.contains(ge.target)&&ee(!1)};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[]);const Q=async J=>{var Ee;J.preventDefault();const ge=L.trim().slice(0,D2e);if(!ge||M)return;if(t){q(""),t(ge);return}const le=n??(r?await r():null);if(!le)return;Z(!0);const ve=await yT((p==null?void 0:p())??null);try{const st=(Ee=Fy.find(yt=>
628yt.id===W))==null?void 0:Ee.provider,{finalOutput:At}=await pT({roomId:le,prompt:ge,model:W,provider:st,userName:Wp,isCustomDoc:f});if(typeof At=="string"&&At.length>0)q(""),p&&vT({getSuperDoc:p,getEditorEl:()=>m?document.getElementById(m):null,before:ve});else throw new Error("The document API completed without returning a final answer.")}catch(st){console.error("AI prompt error:",st)}finally{Z(!1)}};return e?_.jsx("div",{className:"flex flex-col items-center mx-auto z-20 w-full min-w-[510px] max-w-[510px] px-4 pointer-events-none max-[800px]:hidden",children:_.jsx("form",{ref:b,onSubmit:Q,onMouseEnter:()=>H(!0),onMouseLeave:()=>H(!1),onClick:J=>{var le,ve;const ge=J.target;ge.closest('button[type="submit"]')||(le=te.current)!=null&&le.contains(ge)||document.activeElement!==y.current&&((ve=y.current)==null||ve.focus())},className:"pointer-events-auto flex items-center gap-2 p-[1px] w-full rounded-full bg-gradient-to-r from-purple-400 via-violet-500 to-purple-600 shadow-md shadow-slate-300/40 dark:shadow-black/30 hover:ring-1 hover:ring-purple-600/70 active:ring-1 active:ring-purple-700/90 transition-all",children:_.jsxs("div",{className:"flex flex-1 items-center gap-2 bg-white dark:bg-dark-800 rounded-full py-1.5 pl-4 pr-1.5",children:[_.jsx("button",{type:"button",onClick:()=>{var J;return(J=y.current)==null?void 0:J.focus()},className:"flex-shrink-0 p-0 border-0 bg-transparent cursor-pointer text-purple-500 dark:text-purple-400 hover:text-purple-600 dark:hover:text-purple-300 focus:outline-none","aria-label":"Focus AI prompt",children:_.jsx(h2,{className:"w-4 h-4"})}),_.jsx("input",{ref:y,type:"text",value:L,onChange:J=>q(J.target.value),onFocus:()=>ee(!0),onBlur:()=>{setTimeout(()=>ee(!1),150)},spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",placeholder:"What can I change?",className:"flex-1 min-w-0 bg-transparent text-sm text-slate-900 dark:text-white placeholder:text-slate-400 dark:placeholder:text-slate-500 focus:outline-none"}),_.jsxs("div",{ref:te,className:"relative flex-shrink-0",children:[_.jsxs("button",{type:"button",onClick:()=>P(J=>!J),className:"flex items-center gap-1 px-2 py-1 text-xs text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300 rounded transition-colors","aria-label":"Select AI model","aria-expanded":D,"aria-haspopup":"listbox",children:[_.jsx("span",{className:"max-w-[100px] truncate",children:(ne=Fy.find(J=>J.id===W))==null?void 0:ne.name}),_.jsx(A_,{className:`w-3 h-3 transition-transform ${D?"rotate-180":""}`})]}),D&&_.jsx(kU,{model:W,onSelect:J=>{U(J),P(!1)},className:"absolute right-0 bottom-full mb-1 min-w-[180px]"})]}),_.jsx("button",{type:"submit",disabled:!L.trim()||M,className:"flex-shrink-0 w-8 h-8 rounded-full bg-gradient-to-r from-purple-500 to-violet-600 text-white hover:from-purple-600 hover:to-violet-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center transition-all","aria-label":"Submit",children:M?_.jsx("span",{className:"flex items-center gap-0.5","aria-hidden":"true",children:[1,2,3].map(J=>_.jsx("span",{className:"ai-loading-dot w-1.5 h-1.5 rounded-full bg-white"},J))}):_.jsx(vD,{className:"w-4 h-4",strokeWidth:2.5})})]})})}):null},L2e="",P2e=5e3,vA=143,B2e=e=>e.length>vA?`${e.slice(0,vA).trimEnd()}…`:e,j2e="^2.17.0".replace(/^[~^]/,"");function f_(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function F2e(e){const t=[`${e.promptTokens} in + ${e.completionTokens} out = ${e.totalTokens} total`];return e.cachedPromptTokens&&t.push(`cached ${e.cachedPromptTokens}`),e.reasoningTokens&&t.push(`reasoning ${e.reasoningTokens}`),t.join(", ")}function z2e(e){const{toolCalls:t,modelTurns:n}=e,r=t.reduce((u,d)=>u+(d.durationMs??0),0),i=n.reduce((u,d)=>u+(d.durationMs??0),0),o=n.reduce((u,d)=>u+d.totalTokens,0),s=[`Execution Trace (${n.length} turns, ${t.length} tool calls, ${f_(i)} inference, ${r}ms tools, ${o} tokens)`,"─".repeat(60)];let l=0;for(const u of n){const d=u.toolCallCount>0?`${u.toolCallCount} tool call${u.toolCallCount!==1?"s":""}`:"final response",f=u.durationMs?` (${f_(u.durationMs)})`:"";s.push(`
629🧠 Turn ${u.turn}${f}: ${F2e(u)} → ${d}`);for(let p=0;p<u.toolCallCount&&l<t.length;p++,l++){const m=t[l],y=m.ok!==!1?"✓":"✗";s.push(`  ${y} ${m.toolName}(${m.argsSummary||""})`),m.durationMs!=null&&s.push(`    Duration: ${m.durationMs}ms`),m.resultSummary&&s.push(`    Result: ${m.resultSummary}`)}}for(;l<t.length;l++){const u=t[l],d=u.ok!==!1?"✓":"✗";s.push(`
630  ${d} ${u.toolName}(${u.argsSummary||""})`),u.durationMs!=null&&s.push(`    Duration: ${u.durationMs}ms`),u.resultSummary&&s.push(`    Result: ${u.resultSummary}`)}return s.join(`
631`)}function U2e({trace:e}){const[t,n]=Se.useState(!1),[r,i]=Se.useState(!1),{toolCalls:o,modelTurns:s}=e,l=o.reduce((p,m)=>p+(m.durationMs??0),0),u=s.reduce((p,m)=>p+(m.durationMs??0),0),d=s.reduce((p,m)=>p+m.totalTokens,0);o.filter(p=>p.ok===!1).length;const f=p=>{p.stopPropagation(),navigator.clipboard.writeText(z2e(e)).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)}
631).catch(()=>{})};return _.jsxs("div",{className:"mt-2.5",children:[_.jsx("div",{className:"fixed top-14 right-0 w-72 flex justify-center z-[9999] pointer-events-none",children:_.jsx("div",{className:`px-3 py-1.5 rounded-full bg-green-700 text-white text-xs font-medium shadow-lg transition-all duration-300 ${r?"opacity-100 -translate-y-0":"opacity-0 -translate-y-2"}`,children:"Full LLM tools trace copied"})}),_.jsxs("button",{type:"button",onClick:()=>n(p=>!p),className:"group flex items-center gap-1.5 text-[11px] text-slate-400 dark:text-slate-500 hover:text-purple-500 dark:hover:text-purple-400 transition-colors duration-200 select-none",children:[_.jsx(fq,{className:`w-3 h-3 transition-transform duration-200 ease-out ${t?"rotate-90":""}`,strokeWidth:2}),_.jsx("span",{className:"font-medium",children:"View trace"}),_.jsx("span",{className:"text-slate-300 dark:text-slate-600",children:"·"}),_.jsx("span",{children:f_(u)})]}),_.jsx("div",{className:"overflow-hidden transition-all duration-300 ease-out",style:{maxHeight:t?`${o.length*22+60}px`:"0px",opacity:t?1:0},children:_.jsxs("div",{className:"mt-1.5 ml-1.5 pl-2.5 border-l-[1.5px] border-gray-200 dark:border-gray-800/40",children:[o.map((p,m)=>_.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-slate-500 dark:text-slate-400 py-[1.5px]",style:{animation:t?`fadeSlideIn 200ms ${m*30}ms ease-out both`:"none"},children:[_.jsx("span",{className:`flex-shrink-0 w-3 h-3 rounded-full flex items-center justify-center text-[8px] ${p.ok!==!1?"bg-green-50 dark:bg-green-900/20 text-green-500":"bg-gray-50 dark:bg-gray-900/20 text-gray-400"}`,children:p.ok!==!1?"✓":"-"}),_.jsx("span",{className:"truncate",children:p.toolDisplayName||p.toolName.replace("superdoc_","")}),p.durationMs!=null&&_.jsxs("span",{className:"text-slate-300 dark:text-slate-600 flex-shrink-0 tabular-nums text-[9px]",children:[p.durationMs,"ms"]})]},m)),_.jsxs("div",{className:"mt-1.5 pt-1.5 border-t border-slate-100 dark:border-white/5 flex items-center gap-1.5 text-[9px] text-slate-500 dark:text-slate-500",style:{animation:t?`fadeSlideIn 200ms ${o.length*30}ms ease-out both`:"none"},children:[_.jsx(sq,{className:"w-3 h-3 flex-shrink-0"}),_.jsxs("span",{children:[s.length," turns · ",f_(u)," thinking · ",l,"ms actions · ",(d/1e3).toFixed(1),"k tokens · v",j2e]}),_.jsx("button",{type:"button",onClick:f,className:"inline-flex items-center justify-center w-5 h-5 rounded-md hover:bg-slate-100 dark:hover:bg-white/10 hover:text-slate-600 dark:hover:text-slate-300 transition-all duration-150 active:scale-90",title:"Copy detailed trace",children:_.jsx("span",{className:`transition-all duration-200 ${r?"scale-110":"scale-100"}`,children:r?_.jsx(E_,{className:"w-3 h-3 text-green-500"}):_.jsx(vq,{className:"w-3 h-3"})})})]})]})})]})}const V2e=Se.forwardRef(function({isOpen:t,onClose:n,roomId:r=null,onEnsureRoomId:i,value:o,onValueChange:s,isSubmitting:l,onSubmittingChange:u,model:d,onModelChange:f,isCustomDoc:p,getSuperDoc:m,editorId:y},b){var yt;const k=Se.useRef(null),S=Se.useRef(null),[x,T]=Se.useState(""),[C,I]=Se.useState(!1),[D,P]=Se.useState(X1),[V,ee]=Se.useState([]),F=Se.useRef(null),H=Se.useRef(null),[te,M]=Se.useState(!1),[Z,L]=Se.useState(null),[W,U]=Se.useState([]),[q,Q]=Se.useState(new Map),re=Se.useRef(null),ne=u?l??!1:C,J=u??I,ge=o!==void 0?o:x,le=d!==void 0?d:D,ve=f??P,Ee=Ge=>s?s(Ge):T(Ge),st=async(Ge,Be)=>{var B;J(!0),L(null),ee([]),U(be=>[...be,{id:`user-${Date.now()}`,role:"user",content:Be||Ge,timestamp:new Date}]),Ee("");const he="AI Chat",Oe=[],ye=[];try{ee(["🟣️ Joining room..."]);const be=r??(i?await i():null);if(!be){J(!1),ee([]);return}ee([]);
631const ie=await yT((m==null?void 0:m())??null),fe=(B=Fy.find(Ce=>Ce.id===le))==null?void 0:B.provider,{finalOutput:ue}=await pT({roomId:be,prompt:Ge+L2e,modelId:le,provider:fe,userName:Wp,isCustomDoc:p},{onStatus:Ce=>{ee(Ue=>Ue[Ue.length-1]===Ce?Ue:[...Ue,Ce])},onEvent:Ce=>{Ce.type==="tool_call_end"&&Oe.push({toolName:Ce.toolName,toolDisplayName:Ce.toolDisplayName,durationMs:Ce.durationMs,ok:Ce.ok,argsSummary:Ce.argsSummary||void 0,resultSummary:Ce.resultSummary||void 0,turn:Ce.turn||void 0}),Ce.type==="model_turn"&&ye.push({turn:Ce.turn,toolCallCount:Ce.toolCallCount,promptTokens:Ce.promptTokens,completionTokens:Ce.completionTokens,totalTokens:Ce.totalTokens,cachedPromptTokens:Ce.cachedPromptTokens||0,reasoningTokens:Ce.reasoningTokens||0,durationMs:Ce.durationMs??void 0})}});if(typeof ue=="string"&&ue.length>0){const Ce=Oe.length>0||ye.length>0?{toolCalls:Oe,modelTurns:ye}:void 0;U(Ue=>[...Ue,{id:`agent-${Date.now()}`,role:"agent",content:ue,agentName:he,timestamp:new Date,trace:Ce}]),m&&vT({getSuperDoc:m,getEditorEl:()=>y?document.getElementById(y):null,before:ie})}else throw new Error("The document API completed without returning a final answer.")}catch(be){console.error("AI chat error:",be);const ie=be instanceof Error?be.message:"Request failed",fe=ie.includes("did not sync")||ie.includes("sync within")||ie.includes("Timed out")||ie.includes("room is empty")||ie.includes("onMissing");fe&&(H.current=Ge),L(fe?"CONNECTION_TIMEOUT":ie)}finally{J(!1),ee([])}};Se.useImperativeHandle(b,()=>({addAgentMessage:(Ge,Be,he,Oe)=>{Q(ye=>{const B=new Map(ye);return B.delete(Ge),B}),U(ye=>[...ye,{id:`agent-${Date.now()}-${Math.random()}`,role:"agent",content:Be,agentName:Ge,agentIcon:he,agentIconColor:Oe,timestamp:new Date}])},submitPrompt:(Ge,Be)=>{st(Ge,Be)},setAgentLoading:(Ge,Be,he,Oe,ye)=>{Q(B=>{const be=new Map(B);return Be?be.set(Ge,{icon:he,iconColor:Oe,prompt:ye}):be.delete(Ge),be})},setAgentStatus:(Ge,Be)=>{Q(he=>{const Oe=he.get(Ge);if(!Oe)return he;const ye=new Map(he);return ye.set(Ge,{...Oe,status:Be}),ye})}})),Se.useEffect(()=>{const Ge=F.current;Ge&&Ge.scrollTo({top:Ge.scrollHeight,behavior:"smooth"})},[V]),Se.useEffect(()=>{const Ge=S.current;Ge&&Ge.scrollTo({top:Ge.scrollHeight,behavior:"smooth"})},[W,q,V]),sg.useEffect(()=>{const Ge=Be=>{re.current&&!re.current.contains(Be.target)&&M(!1)};return document.addEventListener("mousedown",Ge),()=>document.removeEventListener("mousedown",Ge)},[]);const At=async Ge=>{Ge.preventDefault();const Be=ge.trim().slice(0,P2e);!Be||ne||st(Be)};return _.jsx("div",{className:`absolute top-0 right-0 z-[190] flex flex-col bg-white dark:bg-dark-800 border-l border-b border-slate-200/70 dark:border-white/10 shadow-xl transition-all duration-300 overflow-hidden min-h-[500px] max-h-[600px] rounded-bl-2xl rounded-br-2xl ${t?"w-72":"w-0"}`,children:_.jsxs("div",{className:"w-72 flex flex-col h-[500px] text-left",children:[_.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-b border-slate-200/70 dark:border-white/10 flex-shrink-0",children:[_.jsxs("div",{className:"flex items-center gap-1.5 text-sm font-semibold text-slate-700 dark:text-slate-200",children:[_.jsx(h2,{className:"w-4 h-4 text-purple-500"}),"AI"]}),_.jsx("button",{type:"button",onClick:n,className:"p-1 rounded-md text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-white/10 transition-colors","aria-label":"Close AI chat",children:_.jsx(gg,{className:"w-4 h-4"})})]}),_.jsxs("div",{ref:S,className:"flex-1 min-h-0 overflow-y-auto px-4 py-4 flex flex-col gap-3.5",children:[W.length===0&&q.size===0&&_.jsxs("div",{className:"flex flex-col items-center gap-3 mt-[10px]",children:[_.jsxs("div",{className:"text-xs text-slate-500 dark:text-slate-400 text-center leading-relaxed mb-2",children:[_.jsx("div",{children:"Ask anything about the document"}),_.jsx("div",{children:"or prompt an update"})]}),_.jsx("div",{className:"flex flex-wrap gap-1.5 justify-center",children:[{label:"Add a GDPR clause",prompt:"Add a GDPR compliance clause as a tracked change at the end of the document. Match the formatting style of existing clauses."},{label:"Add executive summary",prompt:'Add an "EXECUTIVE SUMMARY" section. PLACEMENT: insert BEFORE the very first block in the document (before the title). Include a heading and 2-3 paragraphs summarizing the key points. Match the document heading and body formatting exactly.'},{label:"Build a table of contents",prompt:'Add a TABLE OF CONTENTS. PLACEMENT: insert BEFORE the very first block (before the title). Steps: 1) Read blocks to find all section headings. 2) Create one heading paragraph "TABLE OF CONTENTS" with heading style. 3) For EACH section heading found, create a SEPARATE body-text paragraph like "1. PREAMBLE", "2. SCHEDULE A: What makes SuperDoc different", etc. Do NOT use superdoc_list — just create plain 
631numbered text paragraphs. Format each paragraph with body text style.'},{label:"Review the risks",prompt:"Add comments to 3-5 clauses in the document that carry legal or business risk. Each comment should state the risk level (Low/Medium/High) and suggest a lower-commitment alternative."}].map(Ge=>_.jsx("button",{type:"button",onClick:()=>st(Ge.prompt,Ge.label),disabled:ne,className:"px-2.5 py-1.5 min-w-[180px] text-[11px] font-medium text-slate-600 dark:text-slate-300 bg-slate-50 dark:bg-white/5 border border-slate-200 dark:border-white/10 rounded-lg hover:bg-slate-100 dark:hover:bg-white/10 hover:border-slate-300 dark:hover:border-white/20 transition-colors disabled:opacity-50",children:Ge.label},Ge.label))})]}),W.map(Ge=>Ge.role==="user"?_.jsx("div",{className:"flex justify-end",children:_.jsx("div",{className:"max-w-[85%] rounded-2xl rounded-tr-sm px-3.5 py-2 bg-gradient-to-r from-purple-500 to-violet-500 text-white text-[13px] leading-relaxed shadow-sm selection:bg-white/30 selection:text-white",title:Ge.content.length>vA?Ge.content:void 0,children:B2e(Ge.content)})},Ge.id):_.jsxs("div",{className:"flex justify-start gap-2",children:[_.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-slate-100 dark:bg-white/10 flex items-center justify-center mt-0.5",children:_.jsx(Jf,{className:"w-3.5 h-3.5 text-slate-500 dark:text-slate-400"})}),_.jsxs("div",{className:"max-w-[85%] flex flex-col gap-1",children:[_.jsxs("div",{className:"flex items-baseline gap-2 text-left",children:[_.jsx("span",{className:"text-xs font-semibold text-slate-600 dark:text-slate-300",children:"AI"}),_.jsx("span",{className:"text-[11px] text-slate-400 dark:text-slate-500",children:Ge.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),_.jsxs("div",{className:"rounded-2xl rounded-tl-sm px-3.5 py-2.5 bg-slate-50 dark:bg-white/5 text-[13px] text-slate-700 dark:text-slate-200 leading-relaxed shadow-sm text-left",children:[Ge.agentName&&Ge.agentName!=="AI Chat"&&Ge.agentIcon&&(()=>{var B;const Be=(B=Ge.agentIconColor)==null?void 0:B.match(/text-(\w+)-\d+/),he=(Be==null?void 0:Be[1])??"slate",ye={amber:"bg-amber-50 dark:bg-amber-900/20",rose:"bg-rose-50 dark:bg-rose-900/20",emerald:"bg-emerald-50 dark:bg-emerald-900/20",violet:"bg-violet-50 dark:bg-violet-900/20",blue:"bg-blue-50 dark:bg-blue-900/20"}[he]??"bg-slate-100 dark:bg-white/10";return _.jsxs("span",{className:`inline-flex items-center gap-1 mr-1.5 px-1.5 py-0.5 rounded-md ${ye} text-[10px] font-semibold text-slate-600 dark:text-slate-300 align-middle`,children:[sg.createElement(Ge.agentIcon,{className:`w-3 h-3 ${Ge.agentIconColor??""}`,strokeWidth:1.75}),Ge.agentName]})})(),Ge.content,Ge.trace&&_.jsx(U2e,{trace:Ge.trace})]})]})]},Ge.id)),Array.from(q.entries()).map(([Ge,{icon:Be,iconColor:he,prompt:Oe}])=>{const ye=he==null?void 0:he.match(/text-(\w+)-\d+/),B=(ye==null?void 0:ye[1])??"slate",ie={amber:"bg-amber-50 dark:bg-amber-900/20",rose:"bg-rose-50 dark:bg-rose-900/20",emerald:"bg-emerald-50 dark:bg-emerald-900/20",violet:"bg-violet-50 dark:bg-violet-900/20",blue:"bg-blue-50 dark:bg-blue-900/20"}[B]??"bg-slate-100 dark:bg-white/10";return _.jsxs("div",{className:"flex justify-start gap-2",children:[_.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-slate-100 dark:bg-white/10 flex items-center justify-center mt-0.5",children:_.jsx(Jf,{className:"w-3.5 h-3.5 text-slate-500 dark:text-slate-400"})}),_.jsxs("div",{className:"max-w-[85%] flex flex-col gap-1",children:[_.jsx("span",{className:"text-[11px] font-semibold text-slate-600 dark:text-slate-300 text-left",children:"AI"}),_.jsxs("div",{className:"rounded-2xl rounded-tl-sm px-3.5 py-2.5 bg-slate-50 dark:bg-white/5 text-[13px] text-slate-700 dark:text-slate-200 leading-relaxed shadow-sm text-left",children:[Be&&_.jsxs("span",{className:`inline-flex items-center gap-1 mr-1.5 px-1.5 py-0.5 rounded-md ${ie} text-[12px] font-semibold text-slate-600 dark:text-slate-300 align-middle`,children:[sg.createElement(Be,{className:`w-3 h-3 ${he??""}`,strokeWidth:1.75}),Ge]}),Oe&&_.jsxs("span",{className:"align-middle",children:['Prompt: "',Oe,'"']}),(()=>{const fe=q.get(Ge),ue=fe==null?void 0:fe.status;return ue?_.jsx("div",{className:"mt-1.5 text-[11px] text-slate-500 dark:text-slate-400 flex items-center gap-1.5 animate-pulse",children:_.jsx("span",{children:ue})}):null})(),_.jsx("div",{className:"mt-2 flex items-center gap-1 pt-1",children:[0,150,300].map(fe=>_.jsx("span",{className:"ai-loading-dot w-1.5 h-1.5 rounded-full bg-slate-400",style:{animationDelay:`${fe}ms`}},fe))})]})]})]},`loading-${Ge}`)}),ne&&_.jsxs("div",{className:"flex justify-start gap-2",children:[_.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-gradient-to-br from-purple-400 to-violet-500 flex items-center justify-center mt-0.5 shadow-sm",children:_.jsx(Jf,{className:"w-3 h-3 text-white"})}),_.jsxs("div",{className:"max-w-[85%] flex flex-col gap-0.5",children:[_.jsx("div",{className:"flex items-center gap-2",children:_.jsx("span",{className:"text-xs font-semibold text-slate-600 dar
631k:text-slate-300 text-left",children:"AI"})}),_.jsxs("div",{className:"rounded-2xl rounded-tl-sm bg-slate-50 dark:bg-white/5 border border-slate-100 dark:border-white/5 shadow-sm overflow-hidden",children:[_.jsxs("div",{className:"relative",children:[_.jsxs("div",{ref:F,className:"max-h-[80px] overflow-y-auto px-3 pt-2.5 scrollbar-hide",style:{scrollbarWidth:"none"},children:[V.length===0&&_.jsxs("div",{className:"flex text-[11px] items-center gap-1.5 text-xs text-slate-500 dark:text-slate-400",children:[_.jsx("span",{className:"flex-shrink-0 w-3 h-3 border-[1.5px] border-slate-300 dark:border-slate-500 border-t-transparent rounded-full animate-spin"}),_.jsx("span",{children:"Connecting..."})]}),V.map((Ge,Be)=>{const he=Be===V.length-1,Oe=Ge.replace(/^[\p{Emoji}\uFE0F\u200D]+\s*/u,"");return _.jsx("div",{className:`flex items-center gap-1.5 ${he?"text-[11px] font-medium pb-2":"text-[11px]"}`,style:{animation:"fadeSlideIn 200ms ease-out",minHeight:"18px"},children:he?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"flex-shrink-0 w-2.5 h-2.5 border-[1.5px] border-green-400 border-t-transparent rounded-full animate-spin"}),_.jsx("span",{className:"text-purple-600 dark:text-purple-300",children:Oe})]}):_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-green-500 dark:text-green-400 flex-shrink-0 text-[10px]",children:"✓"}),_.jsx("span",{className:"text-slate-400 dark:text-slate-500",children:Oe})]})},Be)})]}),V.length>4&&_.jsx("div",{className:"pointer-events-none absolute top-0 left-0 right-0 h-4 bg-gradient-to-b from-slate-50 dark:from-[#1a1a2e] to-transparent rounded-t-2xl"})]}),V.length===0&&_.jsx("div",{className:"px-3 pb-2 pt-1",children:_.jsx("span",{className:"flex items-center gap-1",children:[0,150,300].map(Ge=>_.jsx("span",{className:"ai-loading-dot w-1 h-1 rounded-full bg-purple-400/60",style:{animationDelay:`${Ge}ms`}},Ge))})})]})]})]}),Z&&(Z==="CONNECTION_TIMEOUT"?_.jsxs("div",{className:"text-xs bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800/40 rounded-lg px-3 py-2.5 flex flex-col gap-2",children:[_.jsx("span",{className:"text-amber-700 dark:text-amber-300 font-medium",children:"Could not connect to the collaboration room"}),_.jsx("span",{className:"text-amber-600/80 dark:text-amber-400/80",children:"The real-time connection is temporarily unavailable. This usually resolves on its own."}),_.jsx("button",{type:"button",onClick:()=>{L(null);const Ge=H.current;H.current=null,Ge&&st(Ge)},className:"self-start px-3 py-1 text-[11px] font-semibold text-amber-700 dark:text-amber-200 bg-amber-100 dark:bg-amber-800/30 border border-amber-300 dark:border-amber-600/30 rounded-md hover:bg-amber-200 dark:hover:bg-amber-800/50 transition-colors",children:"Retry"})]}):_.jsxs("div",{className:"text-xs text-gray-600 dark:text-gray-400 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800/40 rounded-lg px-3 py-2 break-words overflow-hidden min-w-0",children:["🔌️ ",Z,". Try refreshing."]}))]}),_.jsxs("div",{className:"flex-shrink-0 px-3 pb-3 pt-2 border-t border-slate-200/70 dark:border-white/10",children:[!ne&&_.jsx("div",{className:"flex gap-1.5 overflow-x-auto pb-2 -mx-0.5 px-0.5 scrollbar-hide pt-1",children:[{label:"Add executive summary",prompt:'Add an "EXECUTIVE SUMMARY" section. PLACEMENT: insert BEFORE the very first block (before the title). Include heading + 2-3 paragraphs. Match formatting.'},{label:"Add a clause",prompt:"Add a GDPR compliance clause as a tracked change at the end of the document. Match the existing clause formatting."},{label:"Build table of contents",prompt:'Add a TABLE OF CONTENTS. PLACEMENT: insert BEFORE the first block. Read blocks, find all section headings. Create heading "TABLE OF CONTENTS", then a SEPARATE paragraph for each section: "1. PREAMBLE", "2. SCHEDULE A: ...", etc. Do NOT use superdoc_list — plain numbered paragraphs with body text style.'},{label:"Review the risks",prompt:"Add comments to 3-5 risky clauses. Each comment: risk level (Low/Medium/High) and a suggested alternative."}].map(Ge=>_.jsx("button",{type:"button",onClick:()=>st(Ge.prompt,Ge.label),className:"flex-shrink-0 px-2 py-1 text-[10px] font-medium text-purple-600 dar
631k:text-purple-300 bg-purple-50 dark:bg-purple-500/10 border border-purple-200/60 dark:border-purple-500/20 rounded-full hover:bg-purple-100 dark:hover:bg-purple-500/20 transition-colors",children:Ge.label},Ge.label))}),_.jsx("form",{onSubmit:At,className:"flex flex-col gap-2",children:_.jsx("div",{className:"flex p-[1px] rounded-xl bg-gradient-to-r from-purple-400 via-violet-500 to-purple-600 shadow-sm mt-1",children:_.jsxs("div",{className:"flex-1 bg-white dark:bg-dark-800 rounded-[10px] flex flex-col",children:[_.jsx("textarea",{ref:k,value:ge,onChange:Ge=>Ee(Ge.target.value),onKeyDown:Ge=>{Ge.key==="Enter"&&!Ge.shiftKey&&(Ge.preventDefault(),At(Ge))},placeholder:"What can I change?",rows:3,className:"flex-1 w-full bg-transparent text-sm text-slate-900 dark:text-white placeholder:text-slate-400 dark:placeholder:text-slate-500 focus:outline-none resize-none px-3 pt-2.5 pb-1"}),_.jsxs("div",{className:"flex items-center justify-end gap-1 px-2 pb-2",children:[_.jsxs("div",{ref:re,className:"relative flex-shrink-0",children:[_.jsxs("button",{type:"button",onClick:()=>M(Ge=>!Ge),className:"flex items-center gap-1 px-2 py-1 text-xs text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300 rounded transition-colors","aria-label":"Select AI model","aria-expanded":te,"aria-haspopup":"listbox",children:[_.jsx("span",{className:"max-w-[110px] truncate",children:(yt=Fy.find(Ge=>Ge.id===le))==null?void 0:yt.name}),_.jsx(A_,{className:`w-3 h-3 transition-transform ${te?"rotate-180":""}`})]}),te&&_.jsx(kU,{model:le,onSelect:Ge=>{ve(Ge),M(!1)},className:"absolute bottom-full mb-1 right-0 min-w-[180px]"})]}),_.jsx("button",{type:"submit",disabled:!ge.trim()||ne,className:"w-7 h-7 rounded-full bg-gradient-to-r from-purple-500 to-violet-600 text-white hover:from-purple-600 hover:to-violet-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center transition-all flex-shrink-0","aria-label":"Submit",children:ne?_.jsx("span",{className:"flex items-center gap-0.5","aria-hidden":"true",children:[1,2,3].map(Ge=>_.jsx("span",{className:"ai-loading-dot w-1 h-1 rounded-full bg-white"},Ge))}):_.jsx(vD,{className:"w-3.5 h-3.5",strokeWidth:2.5})})]})]})})})]})]})})}),ny=[{id:"redline",title:"Redline Agent",description:"Expand technical details in a tracked change",icon:_D,iconColorHex:"#d97706",gradient:"from-amber-500/20 to-orange-500/20",gradientColors:["#fde68a","#fed7aa"],iconColor:"text-amber-600 dark:text-amber-400",prompt:"You are a lawyer. In the most technical part of the document, add a GDPR clause in a tracked change.",tools:["*"],agentName:"Redline Agent",agentEmail:"[email protected]",agentAction:"Redlining"},{id:"risk-rater",title:"Risk Rater",description:"For each clause, rate the risk and why in a comment",icon:Hb,iconColorHex:"#e11d48",gradient:"from-rose-500/20 to-pink-500/20",gradientColors:["#fecdd3","#fbcfe8"],iconColor:"text-rose-600 dar
631k:text-rose-400",prompt:"You are a lawyer. Add a comment to a few clauses in the document. State its risk level and why. Also suggest in the comment a lower commitment version.",tools:["*"],agentName:"Risk Rater",agentEmail:"[email protected]",agentAction:"Rating risks"},{id:"playbook",title:"Playbook Pal",description:"From a guide, suggest alternative versions",icon:f2,iconColorHex:"#059669",gradient:"from-emerald-500/20 to-teal-500/20",gradientColors:["#a7f3d0","#99f6e4"],iconColor:"text-emerald-600 dark:text-emerald-400",prompt:"You are a lawyer. Find a people related phrase and make it flowerly about human creativity in a tracked change.",tools:["*"],agentName:"Playbook",agentEmail:"[email protected]",agentAction:"Run playbook"},{id:"clarity-bot",title:"Clarity Bot",description:"Make ambiguous text more specific in tracked changes",icon:h2,iconColorHex:"#7c3aed",gradient:"from-violet-500/20 to-purple-500/20",gradientColors:["#ddd6fe","#e9d5ff"],iconColor:"text-violet-600 dark:text-violet-400",prompt:"You are a lawyer. Find the first ambiguous phrase and make it more specific in a tracked change.",tools:["*"],agentName:"Clarity Bot",agentEmail:"[email protected]",agentAction:"Clarifying"},{id:"bulk-updater",title:"Bulk Updater",description:"Perform targeted replacements across the document",icon:Kq,iconColorHex:"#2563eb",gradient:"from-blue-500/20 to-cyan-500/20",gradientColors:["#bfdbfe","#a5f3fc"],iconColor:"text-blue-600 dark:text-blue-400",prompt:'You are a lawyer. Change all company names to "SuperDoc" and all party names to "SuperDoc Party" in a tracked change.',tools:["*"],agentName:"Bulk Update",agentEmail:"bulkupdater@
631superdoc.com",agentAction:"Bulk updating"}];function H2e(){return ny.map(e=>({label:e.title,icon:e.icon,iconColor:e.iconColor,gradientColors:e.gradientColors,prompt:e.prompt}))}const $2e="https://docs.superdoc.dev/agents/build/build-an-agent/",n4="Expand technical details in a tracked change",r4=ny.find(e=>e.id==="redline")??ny[0],G2e=12,FN=12,zN=2,i4=300,q2e="(min-width: 948px)",W2e=".superdoc",K2e=".superdoc__right-sidebar",Y2e=".superdoc__right-sidebar .sidebar-container",X2e=".superdoc__right-sidebar .comment-placeholder",Z2e=({containerRef:e,editorId:t,instanceKey:n=0,hidden:r=!1,documentName:i,onRun:o})=>{const s=Se.useRef(null),l=Se.useRef(null),u=Se.useRef(n4),d=Se.useRef(r4.agentName),[f,p]=Se.useState(!1),[m,y]=Se.useState(null),[b,k]=Se.useState(!1),[S,x]=Se.useState(null),[T,C]=Se.useState(!1),I=f&&!T&&!r,D=Se.useCallback(()=>document.getElementById(t),[t,n]),P=Se.useCallback(U=>{l.current=U,U&&!U.textContent&&(U.textContent=u.current||n4)},[]),V=Se.useCallback(U=>{U&&!U.textContent&&(U.textContent=d.current||r4.agentName)},[]);Se.useEffect(()=>{const U=D();if(!U)return;const q=window.matchMedia(q2e);let Q=0;const re=()=>{Q=0,p(U.getAttribute("data-has-comments")==="true"&&q.matches)},ne=()=>{Q||(Q=requestAnimationFrame(re))};re();const J=new MutationObserver(ne);return J.observe(U,{attributes:!0,attributeFilter:["data-has-comments"]}),q.addEventListener("change",ne),()=>{J.disconnect(),q.removeEventListener("change",ne),Q&&cancelAnimationFrame(Q)}},[D]);const ee=Se.useCallback(()=>{const U=e.current,q=D(),Q=q==null?void 0:q.querySelector(W2e);if(!U||!q||!Q){y(null);return}const re=U.getBoundingClientRect(),ne=q.getBoundingClientRect(),J=Q.querySelector(K2e),ge=J==null?void 0:J.querySelector(".comment-placeholder");let le,ve;if(ge){const yt=ge.getBoundingClientRect();le=yt.left,ve=yt.width}else if(J){const yt=J.getBoundingClientRect(),Ge=window.getComputedStyle(J),Be=parseFloat(Ge.paddingLeft)||0,he=parseFloat(Ge.paddingRight)||0;le=yt.left+Be,ve=yt.width-Be-he}else{const yt=Q.getBoundingClientRect(),Ge=parseFloat(window.getComputedStyle(Q).paddingRight)||0;if(Ge<i4){y(null);return}le=yt.right-Ge+(Ge-i4)/2,ve=i4}const Ee=Math.round(le-re.left),st=Math.round(ve),At={top:Math.round(ne.top-re.top+FN),left:Ee-zN/2,width:st+zN};y(yt=>yt&&yt.top===At.top&&yt.left===At.left&&yt.width===At.width?yt:At)},[e,D]);Se.useLayoutEffect(()=>{if(!I){y(null);return}ee();const U=D(),q=e.current,Q=new ResizeObserver(ee);U&&Q.observe(U),q&&Q.observe(q),window.addEventListener("resize",ee);let re=0;const ne=()=>{re||(re=requestAnimationFrame(()=>{re=0,ee()}))},J=new MutationObserver(ne);return U&&J.observe(U,{childList:!0,subtree:!0}),()=>{Q.disconnect(),J.disconnect(),re&&cancelAnimationFrame(re),window.removeEventListener("resize",ee)}},[I,ee,e,D]),Se.useEffect(()=>{const U=D();if(!U)return;if(!I){U.removeAttribute("data-agent-card-shift"),U.style.removeProperty("--agent-card-shift");return}let q=0;const Q=()=>{q=0;const ge=s.current,le=U.querySelector(Y2e);if(!ge||!le)return;const ve=U.querySelectorAll(X2e);let Ee=1/0;if(ve.forEach(he=>{const Oe=parseFloat(he.style.top);Number.isFinite(Oe)&&(Ee=Math.min(Ee,Oe))}),!Number.isFinite(Ee)){U.style.setProperty("--agent-card-shift","0px");return}const st=parseFloat(U.style.getPropertyValue("--agent-card-shift"))||0,At=U.getBoundingClientRect().top,yt=le.getBoundingClientRect().top-st-At+U.scrollTop,Ge=FN+ge.getBoundingClientRect().height+G2e,Be=Math.max(0,Math.round(Ge-(yt+Ee)));U.setAttribute("data-agent-card-shift","true"),U.style.setProperty("--agent-card-shift",`${Be}px`)},re=()=>{q||(q=requestAnimationFrame(Q))};re();const ne=new MutationObserver(re);ne.observe(U,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]});const J=new ResizeObserver(re);return s.current&&J.observe(s.current),()=>{ne.disconnect(),J.disconnect(),q&&cancelAnimationFrame(q),U.removeAttribute("data-agent-card-shift"),U.style.removeProperty("--agent-card-shift")}},[I,m,D]);const F=async()=>{if(b)return;const U=u.current.trim()||n4,q=d.current.trim()||r4.agentName;k(!0),x(null);try{if(await Promise.resolve(o(U,q))===!1){x(null);return}x("Done.")}catch{x(null)}finally{k(!1)}};if(!I||!m)return null;
631const H="text-violet-600 dark:text-violet-300",te="text-blue-600 dark:text-sky-300",M="text-teal-700 dark:text-teal-200",Z="text-amber-700 dark:text-amber-200",L="text-slate-500 dark:text-slate-400",W="outline-none rounded-sm px-0.5 -mx-0.5 border-b border-dashed border-amber-500/50 dark:border-amber-300/60 hover:bg-amber-100/70 dark:hover:bg-white/5 focus:bg-amber-100 dark:focus:bg-white/10 focus:border-solid focus:border-amber-500 dark:focus:border-amber-300 cursor-text";return _.jsxs("div",{ref:s,className:"absolute z-20 rounded-xl border border-slate-200/90 dark:border-white/10 bg-white/95 dark:bg-dark-800/95 backdrop-blur px-3 pt-2 pb-2 text-left shadow-[0_10px_28px_rgba(15,23,42,0.12)] dark:shadow-[0_12px_32px_rgba(2,6,23,0.5)] select-text",style:{top:m.top,left:m.left,width:m.width},"data-agent-sidebar-card":!0,children:[_.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5 min-w-0",children:[_.jsx("span",{className:"flex-shrink-0 inline-flex items-center justify-center w-6 h-6 rounded-md bg-brand-500/10 dark:bg-brand-400/15 text-brand-600 dark:text-brand-400",children:_.jsx(Jf,{className:"w-3.5 h-3.5",strokeWidth:2.25})}),_.jsx("span",{className:"text-[13px] font-semibold tracking-tight text-slate-900 dark:text-white whitespace-nowrap",children:"DOCX Agent"}),_.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[_.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded-full bg-violet-100 text-violet-700 dark:bg-violet-500/20 dark:text-violet-200 whitespace-nowrap",children:"Self-hosted"}),_.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded-full bg-brand-50 text-brand-700 dark:bg-brand-400/15 dark:text-brand-200 whitespace-nowrap",children:"Your model"})]}),_.jsx("button",{type:"button",onClick:()=>C(!0),"aria-label":"Dismiss agent card",title:"Dismiss",className:"flex-shrink-0 -mr-1.5 inline-flex items-center justify-center w-5 h-5 rounded-md text-slate-400 hover:text-slate-700 hover:bg-slate-100 dark:hover:text-white dark:hover:bg-white/10 transition-colors select-none",children:_.jsx(gg,{className:"w-3.5 h-3.5",strokeWidth:2.25})})]}),_.jsx("div",{className:"rounded-lg bg-slate-100 dark:bg-white/5 ring-1 ring-slate-200/80 dark:ring-white/10 overflow-hidden",children:_.jsxs("pre",{className:"m-0 px-2.5 py-1.5 font-mono text-[10px] leading-[1.4] text-slate-700 dark:text-slate-200 whitespace-pre-wrap break-words",children:[_.jsx("span",{className:H,children:"await"})," ",_.jsx("span",{className:te,children:"runAgent"}),_.jsx("span",{className:L,children:"({"}),`
632`,"  ",_.jsx("span",{className:M,children:"input"}),_.jsx("span",{className:L,children:":"})," ",_.jsx("span",{className:Z,children:`'${i}'`}),_.jsx("span",{className:L,children:","}),`
633`,"  ",_.jsx("span",{className:M,children:"instruction"}),_.jsx("span",{className:L,children:":"})," ",_.jsx("span",{className:Z,children:"'"}),_.jsx("span",{ref:P,contentEditable:!b,suppressContentEditableWarning:!0,spellCheck:!1,role:"textbox","aria-label":"Agent instruction (editable)",title:"Click to edit the instruction",onInput:U=>{u.current=U.currentTarget.textContent??""},onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),F())},onPaste:U=>{U.preventDefault();const q=U.clipboardData.getData("text/plain").replace(/\s+/g," ");document.execCommand("insertText",!1,q)},className:`${Z} ${W}`}),_.jsx("span",{className:Z,children:"'"}),_.jsx("span",{className:L,children:","}),`
634`,"  ",_.jsx("span",{className:M,children:"author"}),_.jsx("span",{className:L,children:":"})," ",_.jsx("span",{className:L,children:"{"})," ",_.jsx("span",{className:M,children:"name"}),_.jsx("span",{className:L,children:":"})," ",_.jsx("span",{className:Z,children:"'"}),_.jsx("span",{ref:V,contentEditable:!b,suppressContentEditableWarning:!0,spellCheck:!1,role:"textbox","aria-label":"Tracked change author name (editable)",title:"Click to edit the author name",onInput:U=>{d.current=U.currentTarget.textContent??""},onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),F())},onPaste:U=>{U.preventDefault();const q=U.clipboardData.getData("text/plain").replace(/\s+/g," ");document.execCommand("insertText",!1,q)},className:`${Z} ${W}`}),_.jsx("span",{className:Z,children:"'"})," ",_.jsx("span",{className:L,children:"}"}),_.jsx("span",{className:L,children:","}),`
635`,"  ",_.jsx("span",{className:L,children:"// ..."}),`
636`,_.jsx("span",{className:L,children:"});"})]})}),_.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[S&&_.jsx("span",{className:"mr-auto min-w-0 text-[10px] leading-tight text-slate-500 dark:text-slate-400 truncate",title:S,children:S}),_.jsxs("button",{type:"button",onClick:()=>void F(),disabled:b,className:"ml-auto inline-flex items-center gap-1.5 h-6 px-2.5 rounded-md bg-brand-500 text-white text-[11px] font-semibold hover:bg-brand-600 shadow-sm shadow-brand-500/20 transition-colors disabled:opacity-70 disabled:cursor-wait select-none",children:[b?_.jsx(fk,{className:"w-3.5 h-3.5 animate-spin"}):_.jsx(yW,{className:"w-3 h-3 fill-current",strokeWidth:2.5}),b?"Running…":"Run"]}),_.jsxs("a",{href:$2e,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 h-6 px-2.5 rounded-md border border-slate-200 dark:border-white/15 bg-white dark:bg-white/5 text-slate-700 dark:text-slate-200 text-[11px] font-semibold hover:bg-slate-50 dark:hover:bg-white/10 no-underline hover:no-underline transition-colors select-none",children:[_.jsx(f2,{className:"w-3.5 h-3.5",strokeWidth:2.25}),"Docs"]})]})]})},Q2e=({className:e})=>_.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[_.jsx("path",{d:"M12 16V4"}),_.jsx("path",{d:"m6.5 9.5 5.5-5.5 5.5 5.5"}),_.jsx("path",{d:"M5 20h14"})]}),J2e=({className:e})=>_.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[_.jsx("path",{d:"M8 17v-3"}),_.jsx("path",{d:"M13 17V9"}),_.jsx("path",{d:"M18 17V5"})]}),ewe=1200,twe=Se.forwardRef(function({showFloatingPrompt:t=!1,promptContainerRef:n,insertAtTopRef:r,submitToChatRef:i,openDocumentRef:o,aiPromptValue:s="",onAiPromptValueChange:l,isAiSubmitting:u,onAiSubmittingChange:d,selectedAgents:f=[],onSelectedAgentChange:p,onRunAgent:m,agentStatuses:y={},onChatOpenChange:b,onDocumentLoadedChange:k,onCollaborationRoomChange:S,onCustomDocChange:x,agentPrompts:T={},onAgentPromptChange:C},I){const D=["sd-theme-docs","sd-theme-word","sd-theme-blueprint"],[P,V]=Se.useState(null),[ee,F]=Se.useState(!1),[H,te]=Se.useState(null),[M,Z]=Se.useState(!1),[L,W]=Se.useState(null),[U,q]=Se.useState(0),[Q,re]=Se.useState(u_),[ne,J]=Se.useState(null),[ge,le]=Se.useState(null),[ve,Ee]=Se.useState(null),[st,At]=Se.useState(null),[yt,Ge]=Se.useState(!1);Se.useEffect(()=>{fetch("https://registry.npmjs.org/superdoc/latest").then(ot=>ot.json()).then(ot=>{typeof(ot==null?void 0:ot.version)=="string"&&le(ot.version)}).catch(()=>{})},[]),Se.useEffect(()=>{fetch("https://api.npmjs.org/downloads/point/last-month/superdoc").then(ot=>ot.json()).then(ot=>{typeof(ot==null?void 0:ot.downloads)=="number"&&Ee(ot.downloads)}).catch(()=>{})},[]),Se.useEffect(()=>{fetch("https://api.github.com/repos/superdoc/docx-editor").then(ot=>ot.json()).then(ot=>{typeof(ot==null?void 0:ot.stargazers_count)=="number"&&At(ot.stargazers_count)}).catch(()=>{})},[]);const Be=Se.useRef(null),he=Se.useRef(null),Oe=Se.useRef(null),ye=Se.useRef(null),B=Se.useRef(null),[be,ie]=Se.useState(!1),[fe,ue]=Se.useState(!1),[Ce,Ue]=Se.useState(!1),K=ot=>{ue(ot)},oe=Se.useRef(b);oe.current=b,Se.useEffect(()=>{var ot;(ot=oe.current)==null||ot.call(oe,fe)},[fe]);const[Fe,Le]=Se.useState(!1),tt=Se.useRef(k);tt.current=k,Se.useEffect(()=>{var ot;(ot=tt.current)==null||ot.call(tt,Fe)},[Fe]);const De=Se.useRef(x);De.current=x,Se.useEffect(()=>{var ot;(ot=De.current)==null||ot.call(De,M)},[M]);const[Pe,mt]=Se.useState(X1),[xt,de]=Se.useState(!1),[z,Y]=Se.useState("share"),[me,Ve]=Se.useState(null),[lt,gt]=Se.useState(!1),[dn,Hn]=Se.useState(!1),[br,ur]=Se.useState(null),[tr,Br]=Se.useState(null),[Lr,$e]=Se.useState(!1),Bt=Se.useRef(null),[hn,Pn]=Se.useState([]),[jn,Lt]=Se.useState(null),[St,Te]=Se.useState(u_),[qe,it]=Se.useState(!1),[Et,$t]=Se.useState(!1),[sn,Tn]=Se.useState(l_),kn=!!St&&sn&&Ce;u||Object.values(y).some(ot=>ot&&ot!=="done");const rn=Se.useRef(sn);rn.current=sn;const Wn=Se.useRef(Et);Wn.current=Et,Se.useEffect(()=>{var ot;!fe||rn.current||Wn.current||($t(!0),(ot=he.current)==null||ot.enableCollaboration().then(jt=>{$t(!1),jt===!0&&Tn(!0)}).catch(()=>$t(!1)))},[fe]),Se.useImperativeHandle(I,()=>({enableCollaboration:async()=>{var jt;return await((jt=he.current)==null?void 0:jt.enableCollaboration())===!0},addAgentMessage:(ot,jt,gr,$n)=>{var Pr;(Pr=Oe.current)==null||Pr.addAgentMessage(ot,jt,gr,$n),K(!0)},submitChatPrompt:ot=>{var jt;K(!0),(jt=Oe.current)==null||jt.submitPrompt(ot)},setAgentLoading:(ot,jt,gr,$n,Pr)=>{var ui;(ui=Oe.current)==null||ui.setAgentLoading(ot,jt,gr,$n,Pr),jt&&K(!0)},setAgentStatus:(ot,jt)=>{var gr;(gr=Oe.current)==null||gr.setAgentStatus(ot,jt)},scrollEditorToTop:()=>{var ot;(ot=he.current)==null||ot.scrollToTop()},getSuperDoc:()=>{var ot;return((ot=he.current)==null?void 0:ot.getSuperDoc())??null}}));const[qr,Yr]=Se.useState("default"),gi=Se.useRef([]),Jn=sg.useCallback(ot=>{const jt=ot.states??[],gr=jt.find(jr=>jr.isSelf)??null,$n=jt.filter(jr=>!jr.isSelf);Lt(gr);const Pr=new Set(gi.current.map(jr=>jr.clientId!=null?`id:${jr.clientId}`:jr.email??jr.name)),ui=$n.filter(jr=>jr.clientId!=null?!Pr.has(`id:${jr.clientId}`):!Pr.has(jr.email??jr.name));ui.length>0&&gi.current.length>
6360&&ui.forEach(jr=>console.log("[SuperDoc] New user joined collaborative session:",jr.name,jr.email??"")),gi.current=$n,Pn($n)},[]),Tr=sg.useCallback(async(ot,jt=!1)=>{Gs(ot,jt);try{const gr=new URL(window.location.href);gr.searchParams.set("room",ot);const $n=gr.toString();jt==!1&&await navigator.clipboard.writeText($n)}catch(gr){console.error("Failed to copy share link to clipboard",gr)}},[]),zr=ot=>{const jt=ot||"",gr=[...pA].sort(($n,Pr)=>Pr.name.length-$n.name.length);for(const{name:$n,color:Pr,icon:ui}of gr)if(jt.toLowerCase().includes($n.toLowerCase()))return{animal:$n,color:Pr,icon:ui};return null};Se.useEffect(()=>{if(i)return i.current=ot=>{var jt;K(!0),(jt=Oe.current)==null||jt.submitPrompt(ot)},()=>{i.current=null}},[i]);const Kn=[{label:"Export DOCX",icon:Kp},{label:"Export PDF",icon:Tq}],Gn=H2e(),ni=[{value:"default",label:"Modern",gradientFrom:"#ffffff",gradientTo:"#cbd5e1",borderColor:"#cbd5e1"},{value:"docs",label:"Docs",gradientFrom:"#F0F4F9",gradientTo:"#c9d9ed",borderColor:"#b3ceef"},{value:"word",label:"Word",gradientFrom:"rgb(226 232 240 / 0.7)",gradientTo:"#d2d0cd",borderColor:"#d1c6c6"},{value:"blueprint",label:"Blueprint",gradientFrom:"#c9dcec",gradientTo:"#65abe5",borderColor:"#91c3ed"}],Di=ot=>{V(jt=>jt===ot?null:ot)},Ro=ot=>{const jt=document.documentElement;ot!=="default"&&jt.classList.contains("dark")&&(jt.classList.remove("dark"),localStorage.removeItem("superdoc-theme")),D.forEach($n=>jt.classList.remove($n)),ot==="docs"&&jt.classList.add("sd-theme-docs"),ot==="word"&&jt.classList.add("sd-theme-word"),ot==="blueprint"&&jt.classList.add("sd-theme-blueprint");const gr=document.querySelector('[data-item="btn-documentMode"]');gr&&ot==="docs"&&gr.style.setProperty("margin-right","6px","important"),gr&&ot==="word"&&gr.style.setProperty("margin-right","6px","important"),gr&&ot==="blueprint"&&gr.style.setProperty("margin-right","9px","important")},Si=(ot,jt=3500)=>
636{if(Y(ot),gt(!1),Hn(!1),de(!0),Bt.current&&clearTimeout(Bt.current),jt<=0){Bt.current=null;return}Bt.current=setTimeout(()=>{gt(!0),Bt.current=setTimeout(()=>{de(!1),gt(!1),Hn(!1),Bt.current=null},500)},jt)},Gs=(ot,jt=!1)=>{ot&&ur(ot),$e(jt),Si("share")},Oo=(ot,jt)=>{Tn(!1),Ue(!1),Te(Y1()),it(!1),Le(!1),q(gr=>gr+1),Br(jt||ot?{code:jt,message:ot}:null),Si("collabError",5e3)},Hi=async()=>{var ot;if(!Et){Ue(!0),$t(!0);try{if(await((ot=he.current)==null?void 0:ot.enableCollaboration())!==!0)return;const gr=Y1();Tn(!0),Te(gr),await Tr(gr)}catch(jt){console.error("🦋️ 🤝️ Share failed:",jt),Ue(!1)}finally{$t(!1)}}},cn=async()=>{var ot,jt,gr;ie(!0);try{const $n=await((ot=he.current)==null?void 0:ot.exportPDF());if(!$n){alert("Unable to export document. Please try again.");return}const Pr=await fetch("/export-pdf",{method:"POST",headers:{"Content-Type":$n.type||"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},body:$n});if(!Pr.ok)throw new Error(`Export failed (${Pr.status})`);const ui=await Pr.blob(),jr=URL.createObjectURL(ui),Zr=document.createElement("a");Zr.href=jr,Zr.download=((gr=(jt=Pr.headers.get("Content-Disposition"))==null?void 0:jt.match(/filename="?([^";]+)"?/))==null?void 0:gr[1])||"document.pdf",Zr.click(),URL.revokeObjectURL(jr)}catch($n){alert($n instanceof Error?$n.message:"Failed to export PDF")}finally{ie(!1)}},Fn=()=>{var ot;(ot=Be.current)==null||ot.click()},dr=async ot=>{var $n,Pr;const jt=($n=ot.target.files)==null?void 0:$n[0];if(ot.target.value="",!jt)return;const gr="."+((Pr=jt.name.split(".").pop())==null?void 0:Pr.toLowerCase());if(![".docx"].includes(gr)){alert("Please select a .docx file.");return}te(URL.createObjectURL(jt)),W(jt.name),Z(!0),it(!1),Le(!1),q(ui=>ui+1)};Se.useEffect(()=>()=>{H&&H.startsWith("blob:")&&URL.revokeObjectURL(H)},[H]);const rr=Se.useRef(null),je=()=>{const ot=rr.current;if(!ot)return;rr.current=null,ot.settleTimer&&clearTimeout(ot.settleTimer);const jt=Math.max(1,Math.round((ot.lastActivityAt-ot.startedAt)/1e3));Ve({name:ot.name,seconds:String(jt),note:ot.note}),Si("docLoaded",ot.note?9e3:5e3)},Je=()=>{const ot=rr.current;ot&&(ot.lastActivityAt=performance.now(),ot.visible&&(ot.settleTimer&&clearTimeout(ot.settleTimer),ot.settleTimer=setTimeout(je,ewe)))},Ut=()=>{Le(!0);const ot=rr.current;ot&&(ot.visible=!0,Je())},un=ot=>{const jt=rr.current;jt&&(rr.current=null,jt.settleTimer&&clearTimeout(jt.settleTimer),Ve({name:jt.name,message:ot}),Si("docError",6e3))},Xt=ot=>{var Pr,ui,jr;(Pr=rr.current)!=null&&Pr.settleTimer&&clearTimeout(rr.current.settleTimer);const jt=performance.now();rr.current={name:ot.name,note:((ui=ot.successToastNote)==null?void 0:ui.trim())||void 0,startedAt:jt,lastActivityAt:jt,visible:!1,settleTimer:null},Ve({name:ot.name}),Si("docOpening",0);const gr=typeof ot.file=="string"?ot.file:URL.createObjectURL(ot.file),$n=typeof ot.file=="string"?ot.file.split("/").pop()??null:ot.file.name;te(gr),W($n),Z(!0),it(!1),Le(!1),q(Zr=>Zr+1),(jr=document.getElementById("editor"))==null||jr.scrollIntoView({behavior:"smooth",block:"start"})};Se.useEffect(()=>{if(o)return o.current=Xt,()=>{o.current=null}},[o]),Se.useEffect(()=>()=>{var ot;(ot=rr.current)!=null&&ot.settleTimer&&clearTimeout(rr.current.settleTimer)},[]),Se.useEffect(()=>{if(xt&&!dn){const ot=requestAnimationFrame(()=>requestAnimationFrame(()=>Hn(!0)));return()=>cancelAnimationFrame(ot)}},[xt,dn]),Se.useEffect(()=>{if(!P)return;const ot=jt=>{const gr=jt.target;gr&&(gr.closest('[data-dropdown-root="true"]')||V(null))};return document.addEventListener("mousedown",ot),()=>document.removeEventListener("mousedown",ot)},[P]),Se.useEffect(()=>(Ro(qr),()=>{const ot=document.documentElement;D.forEach(jt=>ot.classList.remove(jt))}),[qr]),Se.useEffect(()=>{const ot=document.documentElement,jt=new MutationObserver(()=>{ot.classList.contains("dark")&&Yr("default")});return jt.observe(ot,{attributes:!0,attributeFilter:["class"]}),()=>jt.disconnect()},[]);const Zn=z==="collabError"?"text-yellow-950 bg-gradient-to-r from-yellow-100 to-yellow-200":z==="docOpening"?"text-white bg-gradient-to-r from-brand-500 to-blue-600 ring-1 ring-white/20":z==="docError"?"text-white bg-gradient-to-r from-rose-600 to-red-700":"text-white bg-gradient-to-r from-green-600 to-green-700",Bi=z==="docOpening"?"text-brand-600":z==="docError"?"text-red-700":"text-green-700",ri=me?_.jsxs("span",{className:`mx-1 inline-block whitespace-nowrap rounded-md bg-white px-2.5 py-1 text-[0.92em] font-bold leading-none shadow-sm ring-1 ring-black/5 ${Bi}`,children:[_.jsx(Kp,{className:"mr-1.5 inline-block h-[1.05em] w-[1.05em] align-[-0.16em]",strokeWidth:2.4,"aria-hidden":"true"}),me.name]}):null;return _.jsxs("div",{ref:ye,className:"relative w-full max-w-none min-w-0 px-1 sm:px-0",children:[xt&&_.jsx("div",{className:`fixed left-1/2 top-4 -translate-x-1/2 z-[500] flex items-center gap-3 max-w-[min(92vw,42rem)] px-8 py-4 text-md font-medium rounded-lg shadow-lg transition-opacity duration-200 ${Zn} ${dn&&!lt?"opacity-100":"opacity-0"}`,role:"status","aria-busy":z==="docOpening"||void 0,children:z==="docOpening"?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-white/15 shadow-inner",children:_.jsx(wD,{className:"h-5 w-5",strokeWidth:2.25})}),_.jsxs("span",{className:"text-base",children:[ri," opening..."]}),_.jsx(fk,{className:"ml-1 h-4 w-4 shrink-0 animate-spin opacity-80","aria-hidden":"true"})]}):z==="docLoaded"?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-white/15 shadow-inner",children:_.jsx(wb,{className:"h-5 w-5",strokeWidth:2.25})}),_.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-left",children:[_.jsxs("span",{className:"text-base",children:[ri," doc loaded in ",me==null?void 0:me.seconds,"s~!"]}),(me==null?void 0:me.note)&&_.jsx("span",{className:"text-sm font-normal leading-snug text-white/85",children:me.note})]})]}):z==="docError"?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-white/15 shadow-inner",children:_.jsx(gg,{className:"h-5 w-5",strokeWidth:2.25})}),_.jsxs("span",{className:"flex flex-col gap-0.5 min-w-0 text-left",children:[_.jsxs("span",{className:"text-base",children:["Could not open ",ri," doc"]}),(me==null?void 0:me.message)&&_.jsx("span",{className:"text-xs font-normal text-white/80 break-words",children:me.message})]})]}):z==="collabError"?_.jsxs(_.Fragment,{children:[_.jsx(zW,{className:"w-5 h-5 flex-shrink-0"}),_.jsxs("span",{className:"flex flex-col gap-0.5 min-w-0 text-left",children:[_.jsx("span",{className:"text-base",children:"Could not join collaboration room right now - editing locally"}),tr&&_.jsxs("span",{className:"text-xs font-normal text-slate-600 break-words",children:[tr.code&&_.jsx("code",{className:"font-mono",children:tr.code}),tr.code&&tr.message?" ":"",tr.message]})]})]}):_.jsxs(_.Fragment,{children:[_.jsx(E6,{className:"w-5 h-5 flex-shrink-0"}),_.jsx("span",{className:"text-base",children:Lr?_.jsxs(_.Fragment,{children:["For new document, a new room was created: ",_.jsx("code",{className:"font-mono text-green-100 bg-green-800/40 px-1.5 py-0.5 rounded",children:br}),". Copy your new share link."]}):_.jsxs(_.Fragment,{children:[_.jsx("strong",{children:"Share link copied"}),br&&_.jsxs(_.Fragment,{children:[" - room: ",_.jsx("code",{className:"font-mono text-green-100 bg-green-800/40 px-1.5 py-0.5 rounded",children:br})]})]})})]})}),_.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-brand-500/20 to-sky-500/20 rounded-2xl blur-xl transform -rotate-1 scale-105 max-w-sm overflow-hidden"}),_.jsxs("div",{className:"relative rounded-2xl border border-white/60 dark:border-white/10 bg-white/70 dark:bg-white/5 backdrop-blur-xl shadow-2xl overflow-hidden",children:[_.jsx("div",{className:"flex flex-col gap-4 border-b border-white/60 dark:border-white/10 bg-white/70 dark:bg-white/5 px-5 py-3 select-none",children:_.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[_.jsxs(_.Fragment,{children:[_.jsx("input",{ref:Be,type:"file",accept:".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",className:"hidden",onChange:dr}),_.jsxs("button",{type:"button",onClick:Fn,className:"inline-flex items-center gap-2 px-4 py-2.5 text-sm font-semibold text-white bg-brand-500 hover:bg-brand-600 rounded-lg shadow-sm",children:[_.jsx(Q2e,{className:"w-5 h-5"}),"Upload DOCX"]})]}),_.jsxs("div",{className:"hidden min-[1100px]:flex items-center gap-2",children:[_.jsxs("a",{href:"https://www.npmjs.com/package/superdoc?activeTab=readme",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium tracking-wide text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 no-underline hover:no-underline cursor-pointer transition-colors",children:[_.jsx("img",{src:"https://cdn.simpleicons.org/npm/9ca3af",alt:"",className:"w-3.5 h-3.5"}),ne?`v${ne}`:ge?`v${ge}`:"v2"]}),ve!==null&&_.jsxs("a",{href:"https://www.npmjs.com/package/superdoc?activeTab=readme",target:"_blank",rel:"noopener noreferrer",className:"-ml-1 inline-flex items-center gap-0.5 text-xs font-medium tracking-wide text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 no-underline hover:no-underline cursor-pointer transition-colors",children:[_.jsx(J2e,{className:"w-3.5 h-3.5"}),_.jsxs("span",{children:[new Intl.NumberFormat("en",{notation:"compact"}).format(ve),"/mo"]})]}),st!==null&&_.jsxs("a",{href:"https://github.com/superdoc/docx-editor",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium tracking-wide text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 no-underline hover:no-underline cursor-pointer transition-colors",children:[_.jsx(SD,{className:"w-3.5 h-3.5"}
636),st.toLocaleString()]})]})]}),_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[(()=>{const ot=hn.filter(jt=>jt.name!==Wp).map(jt=>({...jt,isSelf:!1}));return ot.length===0?null:_.jsx("div",{className:"flex items-center -space-x-2",children:ot.map((jt,gr)=>{const $n=zr(jt.name),Pr=jt.color??($n==null?void 0:$n.color)??"#94a3b8",ui=$n==null?void 0:$n.animal,jr=$n==null?void 0:$n.icon;return _.jsxs("div",{className:"group/avatar relative flex-shrink-0 transition-transform duration-150 hover:z-10 hover:scale-125",title:jt.name,children:[_.jsx("div",{className:`flex items-center justify-center w-6 h-6 rounded-full border-2 shadow-sm text-[14px] leading-none ${jt.isSelf?"border-brand-400/60 dark:border-brand-500/60":"border-white dark:border-slate-800"}`,style:{backgroundColor:Pr},"aria-label":jt.name,children:jr?_.jsx("span",{"aria-hidden":!0,className:"inline-flex items-center justify-center text-white",children:sg.createElement(jr,{"aria-hidden":!0,className:"shrink-0 text-white"})}):ui?_.jsx("span",{className:"sr-only",children:ui}):null}),_.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 -translate-y-1/2 ml-1.5 px-2 py-1 text-xs font-medium text-white bg-slate-800 rounded shadow-lg opacity-0 transition-none group-hover/avatar:opacity-100 whitespace-nowrap z-[2001]",children:jt.isSelf?`${jt.name} (you)`:jt.name})]},jt.clientId!=null?`collab-${jt.clientId}`:jt.email??jt.name??gr)})})})(),kn&&_.jsxs("a",{onClick:async ot=>{ot.preventDefault(),ot.stopPropagation();const jt=new URL(window.location.href);St&&jt.searchParams.set("room",St),await navigator.clipboard.writeText(jt.toString()),Gs()},className:"hidden md:inline-flex relative items-center gap-1.5 px-2 py-1 text-xs font-medium text-slate-600 dark:text-slate-400 border border-slate-200/80 dark:border-white/10 rounded-md hover:border-slate-300/80 dark:hover:border-white/20 transition-colors",children:[_.jsxs("span",{className:"group/roominfo relative inline-flex items-center gap-1.5",children:[_.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gradient-to-br from-green-400 to-green-600 shrink-0","aria-hidden":!0}),_.jsx("span",{children:"Room"}),St&&_.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] font-mono text-slate-600 dark:text-slate-400 bg-slate-50 dark:bg-white/5 border border-slate-200/60 dark:border-white/10",children:St}),_.jsxs("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-2 px-4 py-3 w-64 text-xs font-normal text-[#222] text-left bg-white rounded-lg border border-slate-200 shadow-xl opacity-0 transition-opacity duration-75 group-hover/roominfo:opacity-100 z-[2000] flex flex-col gap-2 items-start",children:[_.jsxs("span",{className:"flex items-center gap-2",children:[_.jsx(qW,{className:"w-3.5 h-3.5 flex-shrink-0"}),_.jsx("strong",{children:"Real-time collaboration enabled"})]}),_.jsxs("span",{children:["Share this URL to collaborate in room ",_.jsx("code",{className:"font-mono text-[11px] bg-slate-100 dark:bg-white/10 px-1 py-0.5 rounded",children:St}),". Edits are live, private, and won't appear on the homepage. Nothing is save after room closes."]})]})]}),St&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"w-px h-3 bg-slate-300 dark:bg-white/20 mx-0.5 shrink-0","aria-hidden":!0}),_.jsxs("button",{type:"button",onClick:async ot=>{ot.preventDefault(),ot.stopPropagation();const jt=new URL(window.location.href);St&&jt.searchParams.set("room",St),await navigator.clipboard.writeText(jt.toString()),Gs()},className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] font-medium text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-white/10 transition-colors",title:"Copy link",children:[_.jsx(E6,{className:"w-3 h-3"}),_.jsx("span",{children:"Copy"})]})]})]},St),_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"hidden min-[1000px]:block",children:Et&&Ce?_.jsx("span",{className:"inline-flex items-center gap-1.5 px-3.5 py-2 select-none","aria-label":"Connecting…",children:_.jsx("span",{className:"inline-flex items-center gap-0.5",children:[0,120,240].map(ot=>_.jsx("span",{className:"block w-0.5 h-2.5 rounded-full bg-green-500 dark:bg-green-400 origin-center",style:{animation:`collab-bar 800ms ease-in-out ${ot}ms infinite`}},ot))})}):Ce?null:_.jsxs("button",{type:"button",onClick:Hi,disabled:!qe,className:"inline-flex items-center gap-2 px-4 py-2.5 text-xs font-semibold text-slate-700 dark:text-slate-200 bg-white/90 dark:bg-white/10 border border-slate-200/70 dark:border-white/10 rounded-lg hover:border-brand-400/50 disabled:opacity-40 disabled:cursor-not-allowed","aria-label":"Share collaboration link",children:[_.jsx($W,{className:"w-4 h-4 text-blue-500"}),_.jsx("span",{className:"hidden sm:inline",children:"Share"})]})}),_.jsx("div",{className:"relative hidden min-[1000px]:block",children:_.jsxs("button",{type:"button",onClick:()=>{F(ot=>!ot),ue(!1)},"aria-expanded":ee,disabled:!qe,className:"inline-flex items-center gap-2 px-4 py-2.5 text-xs font-semibold text-purple-700 dark:text-purple-300 bg-purple-50 dark:bg-purple-500/10 border border-purple-200/70 dark:border-purple-500/20 rounded-lg hover:bg-purple-100 dar
636k:hover:bg-purple-500/20 disabled:opacity-40 disabled:cursor-not-allowed","aria-label":"DOCX AI Agents",children:[_.jsx(Jf,{className:"h-4 w-4 text-purple-600 dark:text-purple-300"}),_.jsx("span",{className:"hidden sm:inline",children:"DOCX AI Agents"})]})})]}),_.jsxs("button",{type:"button",onClick:()=>{K(ot=>!ot),F(!1)},"aria-pressed":fe,disabled:!qe,className:"inline-flex items-center gap-2 px-4 py-2.5 text-xs font-semibold text-purple-700 dark:text-purple-300 bg-purple-50 dark:bg-purple-500/10 border border-purple-200/70 dark:border-purple-500/20 rounded-lg hover:bg-purple-100 dark:hover:bg-purple-500/20 disabled:opacity-40 disabled:cursor-not-allowed","aria-label":"Toggle AI chat",children:[_.jsx(h2,{className:"w-4 h-4 text-purple-600 dark:text-purple-300"}),_.jsx("span",{className:"hidden sm:inline",children:"AI Chat"})]}),_.jsxs("div",{className:"relative hidden sm:block","data-dropdown-root":"true",children:[_.jsx("button",{type:"button",onClick:()=>Di("theme"),"aria-expanded":P==="theme",disabled:!qe,className:"inline-flex items-center justify-center w-9 h-9 text-slate-600 dark:text-slate-300 bg-white/90 dark:bg-white/10 border border-slate-200/70 dark:border-white/10 rounded-lg hover:border-brand-400/50 disabled:opacity-40 disabled:cursor-not-allowed","aria-label":"Theme",children:_.jsx(kD,{className:"w-4 h-4 text-blue-500"})}),P==="theme"&&_.jsxs("div",{className:"absolute right-0 top-full mt-2 w-40 rounded-lg border border-slate-200/70 dark:border-white/10 bg-white dark:bg-dark-800 shadow-xl p-1 text-xs text-slate-700 dark:text-slate-200 z-[600]",children:[_.jsx("div",{className:"px-3 py-2 text-[11px] font-semibold text-slate-500 dark:text-slate-400 select-none text-left",children:"Themes"}),ni.map(ot=>_.jsxs("button",{type:"button",onClick:()=>{Yr(ot.value),V(null)},className:`w-full text-left px-3 py-2 rounded-md flex items-center gap-2.5 ${qr===ot.value?"bg-slate-100 dark:bg-white/10":"hover:bg-slate-100 dark:hover:bg-white/10"}`,children:[_.jsx("span",{className:"w-4 h-4 rounded-full flex-shrink-0",style:{background:`linear-gradient(135deg, ${ot.gradientFrom}, ${ot.gradientTo})`,boxShadow:`0 0 0 1.5px ${ot.borderColor}`}}),_.jsx("span",{className:"flex-1",children:ot.label}),ot.value==="default"&&_.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-slate-100 dark:bg-white/10 text-slate-500 dark:text-slate-400 border border-slate-200 dark:border-white/10",children:"Default"})]},ot.value)),_.jsx("div",{className:"my-1 border-t border-slate-200 dark:border-white/10"}),_.jsxs("a",{href:"https://docs.superdoc.dev/editor/platform/themes-and-fonts/",target:"_blank",rel:"noopener noreferrer",onClick:()=>V(null),className:"w-full text-left px-3 py-2 rounded-md flex items-center gap-2.5 hover:bg-slate-100 dark:hover:bg-white/10 text-slate-600 dark:text-slate-400 transition-colors",children:[_.jsx(hk,{className:"w-3.5 h-3.5 flex-shrink-0"}),"Customize theme"]}),_.jsxs("a",{href:"https://docs.superdoc.dev/editor/custom-ui/overview/",target:"_blank",rel:"noopener noreferrer",onClick:()=>V(null),className:"w-full text-left px-3 py-2 rounded-md flex items-center gap-2.5 hover:bg-slate-100 dark:hover:bg-white/10 text-slate-600 dark:text-slate-400 transition-colors",children:[_.jsx(Xq,{className:"w-3.5 h-3.5 flex-shrink-0"}),"Use Custom UI"]})]})]}),_.jsxs("div",{className:"relative","data-dropdown-root":"true",children:[_.jsxs("button",{type:"button",onClick:()=>Di("export"),"aria-expanded":P==="export",disabled:!qe||be,"aria-busy":be,className:"inline-flex items-center gap-2 px-4 py-2.5 text-xs font-semibold text-slate-700 dark:text-slate-200 bg-white/90 dark:bg-white/10 border border-slate-200/70 dark:border-white/10 rounded-lg hover:border-brand-400/50 disabled:opacity-40 disabled:cursor-not-allowed","aria-label":"Export",children:[be?_.jsxs(_.Fragment,{children:[_.jsx("svg",{width:"0",height:"0","aria-hidden":"true",children:_.jsx("defs",{children:_.jsxs("linearGradient",{id:"pdf-spinner-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[_.jsx("stop",{offset:"0%",stopColor:"#9333ea"}),_.jsx("stop",{offset:"100%",stopColor:"#581c87"})]})})}
636),_.jsx(fk,{className:"w-4 h-4 animate-spin",stroke:"url(#pdf-spinner-gradient)"})]}):_.jsxs("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 text-blue-500",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_.jsx("path",{d:"M6 2h8l4 4v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"}),_.jsx("path",{d:"M14 2v4h4"}),_.jsx("path",{d:"M12 10v6"}),_.jsx("path",{d:"M9 13l3 3 3-3"})]}),_.jsx(A_,{className:"w-3.5 h-3.5"})]}),P==="export"&&_.jsx("div",{className:"absolute right-0 top-full mt-2 w-44 rounded-lg border border-slate-200/70 dark:border-white/10 bg-white dark:bg-dark-800 shadow-xl p-1 text-xs text-slate-700 dark:text-slate-200 z-[200]",children:Kn.map(ot=>_.jsxs("button",{type:"button",onClick:()=>{var jt;V(null),ot.label==="Export DOCX"?(jt=he.current)==null||jt.exportDocx(L??void 0):ot.label==="Export PDF"&&cn()},className:"w-full text-left px-3 py-2 rounded-md hover:bg-slate-100 dark:hover:bg-white/10 flex items-center gap-2",children:[_.jsx(ot.icon,{className:"w-3.5 h-3.5 text-slate-400"}),ot.label]},ot.label))})]}),_.jsx("button",{type:"button",onClick:()=>{var ot;return(ot=he.current)==null?void 0:ot.openFindReplace()},disabled:!qe,className:"hidden sm:inline-flex items-center justify-center w-9 h-9 text-slate-600 dark:text-slate-300 bg-white/90 dark:bg-white/10 border border-slate-200/70 dark:border-white/10 rounded-lg hover:border-brand-400/50 disabled:opacity-40 disabled:cursor-not-allowed","aria-label":"Find and replace",title:"Find and replace",children:_.jsx(CD,{className:"w-4 h-4 text-blue-500"})})]})]})}),_.jsxs("div",{className:"p-6 sm:p-5",children:[_.jsxs("div",{ref:B,className:`relative flex flex-col bg-white/80 dark:bg-dark-800/60 border pt-1 border-slate-200/70 dark:border-white/10 rounded-xl p-4 shadow-lg overflow-hidden transition-[height] duration-300 ${yt?"h-[1250px]":"h-[500px]"}`,children:[_.jsx(s2e,{ref:he,idPrefix:"superdoc-demo-main",className:"flex-1 min-h-0",height:"1200px",document:H,onVersion:J,onReady:()=>it(!0),onPagesVisible:Ut,onPaginationUpdate:Je,onLoadError:un,onAwarenessUpdate:Jn,aiSidepanelOpen:fe||ee,onCollaborationReady:(ot,jt)=>{Te(ot),Tn(!0),jt&&Ue(!0)},onCollaborationError:Oo,onNewCollabDocReady:ot=>{Te(ot),Tn(!0),Z(!0);const jt=localStorage.getItem("newCollabDocName");jt&&(W(jt),localStorage.removeItem("newCollabDocName")),Tr(ot,!0)}},U),_.jsx(Z2e,{containerRef:B,editorId:"superdoc-demo-main-editor",instanceKey:U,hidden:fe||ee||!Fe,documentName:L||"contract.docx",onRun:(ot,jt)=>m==null?void 0:m("Redline Agent",ot,{skipScroll:!0,authorName:jt})}),_.jsx(V2e,{ref:Oe,isOpen:fe,onClose:()=>K(!1),value:s,onValueChange:l,isSubmitting:u,onSubmittingChange:d,model:Pe,onModelChange:mt,roomId:sn?St:null,isCustomDoc:M,getSuperDoc:()=>{var ot;return((ot=he.current)==null?void 0:ot.getSuperDoc())??null},editorId:"superdoc-demo-main-editor",onEnsureRoomId:async()=>{var jt;if(await((jt=he.current)==null?void 0:jt.enableCollaboration())!==!0)throw new Error("Failed to start collaboration session");return Tn(!0),St}}),_.jsx("div",{className:`absolute top-0 right-0 z-[190] flex flex-col bg-white dark:bg-dark-800 border-l border-b border-slate-200/70 dark:border-white/10 shadow-xl transition-all duration-300 overflow-hidden min-h-[500px] max-h-[600px] rounded-bl-2xl rounded-br-2xl ${ee?"w-72":"w-0"}`,children:_.jsxs("div",{className:"w-72 h-[500px] flex flex-col text-left",children:[_.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-b border-slate-200/70 dark:border-white/10 flex-shrink-0",children:[_.jsxs("div",{className:"flex items-center gap-1.5 text-sm font-semibold text-slate-700 dark:text-slate-200",children:[_.jsx(Jf,{className:"w-4 h-4 text-purple-500"}),"DOCX AI Agents"]}),_.jsx("button",{type:"button",onClick:()=>F(!1),className:"p-1 rounded-md text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-white/10 transition-colors","aria-label":"Close agents panel",children:_.jsx(gg,{className:"w-4 h-4"})})]}),_.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col p-3",children:[_.jsxs("div",{className:"text-xs text-slate-500 dark:text-slate-400 text-center leading-relaxed pt-2 pb-3",children:["Run example agents or"," ",_.jsx("a",{href:"https://docs.superdoc.dev/agents/build/build-an-agent/",target:"_blank",rel:"noopener noreferrer",className:"underline decoration-dotted underline-offset-2 hover:text-slate-700 dark:hover:text-slate-200 transition-colors",children:"build your own"})]}),_.jsx("div",{className:"flex flex-wrap gap-1.5 justify-center",children:Gn.map(ot=>_.jsx("button",{type:"button",onClick:()=>{F(!1),m==null||m(ot.label,void 0,{skipScroll:!0})},style:{background:`linear-gradient(135deg, ${ot.gradientColors[0]}20, ${ot.gradientColors[1]}20)`},className:"flex items-center justify-center pl-11 pr-2.5 py-1.5 min-w-[180px] text-[11px] font-medium text-slate-700 dark:text-slate-200 border border-slate-200/70 dark:border-white/10 rounded-lg hover:brightness-95 dark:hover:brightness-125 transition-[filter]",children:_.jsxs("span",{className:"flex items-center gap-2.5 w-[140px]",children:[_.jsx("span",{className:"w-5 h-5 rounded flex items-center justify-center shrink-0",style:{background:`linear-gradient(135deg, ${ot.gradientColors[0]}, ${ot.gradientColors[1]})`},children:_.jsx(ot.icon,{className:`w-3 h-3 ${ot.iconColor}`})}),_.jsx("span",{className:"flex-1 text-left",children:ot.label})]})},ot.label))})]}),_.jsx("div",{className:"p-3 flex-shrink-0",children:_.jsxs("button",{type:"button",onClick:()=>{F(!1),window.open("https://docs.superdoc.dev/agents/build/build-an-agent/","_blank","noopener,noreferrer")},className:"group/callout w-full text-left px-3 py-3 rounded-lg border border-dashed border-slate-300 dark:border-white/15 hover:border-brand-400/60 dark:hover:border-brand-400/40 hover:bg-brand-50/60 dark:hover:bg-brand-500/5 transition-colors",children:[_.jsxs("span",{className:"flex items-center justify-between gap-2",children:[_.jsxs("span",{className:"flex items-center gap-2 text-xs font-semibold text-slate-700 dark:text-slate-200 group-hover/callout:text-brand-600 dark:group-hover/callout:text-brand-400 transition-colors",children:[_.jsx(hk,{className:"w-3.5 h-3.5"}),"Build your own DOCX Agent"]}),_.jsx(d2,{className:"w-3.5 h-3.5 text-slate-400 dark:text-slate-500 group-hover/callout:text-brand-500 dark:group-hover/callout:text-brand-400 group-hover/callout:translate-x-0.5 transition-[color,transform]"})]}),_.jsx("span",{className:"mt-1.5 block text-xs leading-relaxed text-slate-500 dark:text-slate-400",children:"Self-host the LLM tools and DOCX commands to accurately review, edit, and style documents. It integrates with your models and workflows across its LLM tools, CLI, MCP, and Node/Python SDKs."})]})})]})})]}),_.jsx("div",{ref:n,className:"flex justify-center w-full mt-4",style:{height:"46px",bottom:"35px",position:"absolute",marginBottom:"0px",paddingRight:"36px"},children:_.jsx(_U,{visible:t&&!fe&&Fe,value:s,onValueChange:l,onSubmitToChat:ot=>{var jt;K(!0),(jt=Oe.current)==null||jt.submitPrompt(ot)},isSubmitting:u,onSubmittingChange:d,model:Pe,onModelChange:mt,roomId:St,isCustomDoc:M,getSuperDoc:()=>{var ot;return((ot=he.current)==null?void 0:ot.getSuperDoc())??null},editorId:"superdoc-demo-main-editor"})})]})]}),_.jsxs("button",{type:"button",onClick:()=>{const ot=!yt;Ge(ot),ot&&document.getElementById("editor").scrollIntoView({behavior:"smooth",block:"start"})},className:"mt-4 hidden sm:inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-slate-700 dark:text-slate-200 bg-white dark:bg-dark-800 border border-slate-200 dark:border-white/10 rounded-lg hover:border-brand-400/50 hover:bg-slate-50 dark:hover:bg-white/5 transition-colors select-none","aria-label":yt?"Collapse":"Expand",children:[_.jsx(pq,{className:"w-4 h-4"}),yt?"Collapse":"Expand"]})]})}),nwe=({open:e,onClose:t,icon:n,iconColor:r,title:i,promptValue:o,onPromptChange:s,onRun:l})=>e?_.jsx("div",{className:"fixed inset-0 z-[70] bg-slate-900/45 backdrop-blur-[1px] flex items-center justify-center p-4",onClick:u=>{u.stopPropagation(),t()},children:_.jsxs("div",{className:"w-full max-w-md rounded-xl border border-slate-200 dark:border-white/10 bg-white dark:bg-dark-800 shadow-2xl p-4",onClick:u=>u.stopPropagation(),children:[_.jsxs("div",{className:"flex items-center justify-between mb-3",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("div",{className:"h-7 w-7 inline-flex items-center justify-center rounded-md bg-slate-100 dar
636k:bg-white/5 border border-slate-200 dark:border-white/10",children:_.jsx(n,{className:`w-4 h-4 ${r}`,strokeWidth:1.75})}),_.jsx("h4",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"Provide agent prompt"})]}),_.jsx("button",{type:"button",onClick:t,className:"h-8 w-8 inline-flex items-center justify-center rounded-md text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-white/10 transition-colors","aria-label":"Close prompt modal",children:_.jsx(gg,{className:"w-4 h-4"})})]}),_.jsxs("div",{className:"relative mt-2",children:[_.jsx(Kp,{className:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-slate-400 dark:text-slate-500"}),_.jsx("textarea",{value:o,onChange:u=>s(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&l&&(u.preventDefault(),t(),l())},className:"w-full min-h-[140px] resize-y rounded-md border border-slate-200 dark:border-white/10 bg-slate-50 dark:bg-dark-900 text-xs text-slate-700 dark:text-slate-200 pl-8 pr-2 py-2 focus:outline-none focus:ring-2 focus:ring-brand-500/40"})]}),l&&_.jsx("div",{className:"mt-4 flex justify-end",children:_.jsxs("button",{type:"button",onClick:()=>{t(),l()},className:"inline-flex items-center justify-center gap-2 py-2 px-3 rounded-lg bg-brand-50 dark:bg-brand-900/20 border border-brand-200 dark:border-brand-500/20 text-xs font-bold text-brand-700 dark:text-brand-300 hover:bg-brand-100 dark:hover:bg-brand-900/30 transition-colors",children:[_.jsx(I_,{className:"w-3.5 h-3.5"}),"Run"]})})]})}):null,rwe=Se.forwardRef(function({title:t,description:n,icon:r,gradient:i,gradientColors:o,iconColor:s,iconColorHex:l,prompt:u,onRun:d,onPromptChange:f},p){const[m,y]=Se.useState(!1),[b,k]=Se.useState(u),[S,x]=Se.useState(!1),[T,C]=Se.useState(!1),I=Se.useRef(null),D=Se.useRef(null),P=()=>{const F=document.getElementById("editor");if(!F)return;const H=F.getBoundingClientRect().top+window.scrollY-60;window.scrollTo({top:H,behavior:"smooth"})},V=async()=>{if(setTimeout(()=>{P()},50),!S){x(!0),C(!1);try{if(await(d==null?void 0:d(b))===!1)return;C(!0)}finally{x(!1)}}},ee=()=>{var F;(F=D.current)==null||F.click()};return Se.useEffect(()=>{k(u)},[u]),Se.useImperativeHandle(p,()=>({run:V})),_.jsxs("div",{ref:I,className:"group flex-1 min-w-[140px] mt-4 rounded-xl border-[10px] border-white/60 dark:border-white/10 bg-slate-100 dark:bg-slate-900/30 overflow-hidden shadow-[0_8px_22px_rgba(15,23,42,0.08)] dark:shadow-[0_10px_24px_rgba(2,6,23,0.35)] transition-all hover:border-white/80 dark:hover:border-white/20 hover:bg-slate-200 dark:hover:bg-slate-900/50 cursor-pointer",onClick:ee,children:[_.jsx(nwe,{open:m,onClose:()=>y(!1),icon:r,iconColor:s,title:t,promptValue:b,onPromptChange:F=>{k(F),f==null||f(F)}}),_.jsx("div",{className:"h-10 flex items-center justify-center transition-[transform,filter] duration-300 ease-out group-hover:scale-110 group-hover:brightness-110",style:o?{background:`linear-gradient(135deg, ${o[0]}44, ${o[1]}44)`}:void 0,children:_.jsx(r,{className:`w-6 h-6 ${s}`,style:l?{color:l}:void 0,strokeWidth:1.5})}),_.jsxs("div",{className:"pl-3 pr-3 pt-2 space-y-2",children:[_.jsx("h3",{className:"text-xs font-semibold text-slate-900 dark:text-white truncate select-none -mb-1",title:t,children:t}),_.jsx("p",{className:"hidden min-[1000px]:block text-xs leading-snug text-slate-500 dark:text-slate-400 select-none line-clamp-2",style:{height:"32px"},children:n}),_.jsxs("div",{className:"flex items-center justify-center gap-2 pb-1.5 pt-0.5",children:[_.jsx("button",{ref:D,type:"button",disabled:S,onClick:F=>{F.stopPropagation(),V()},className:`basis-[115px] max-w-[115px] flex items-center justify-center gap-1.5 py-1.5 px-3 rounded-lg border text-xs font-bold transition-colors select-none ${S?"bg-brand-50 dark:bg-brand-900/20 border-brand-200 dark:border-brand-500/20 text-brand-700 dark:text-brand-300 cursor-not-allowed":T?"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-500/20 text-green-700 dark:text-green-300":"bg-brand-50 dark:bg-brand-900/20 border-brand-200 dark:border-brand-500/20 text-brand-700 dark:text-brand-300 hover:bg-brand-100 dark:hover:bg-brand-900/30"}`,children:S?_.jsxs(_.Fragment,{children:[_.jsx(fk,{className:"w-3.5 h-3.5 animate-spin"}),"Running"]}):T?_.jsxs(_.Fragment,{children:[_.jsx(E_,{className:"w-3.5 h-3.5"}),"Done"]}):_.jsxs(_.Fragment,{children:[_.jsx(I_,{className:"w-3.5 h-3.5"}),"Run"]})}),_.jsx("div",{className:"relative",children:_.jsx("button",{type:"button",onClick:F=>{F.stopPropagation(),y(H=>!H)},className:"hidden min-[1000px]:flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-white dark:bg-white/5 border border-slate-200 dark:border-white/10 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-white/10 hover:text-brand-600 dark:hover:text-brand-400 transition-colors select-none","aria-label":`Configure ${t}`,"aria-expanded":m,children:_.jsx(TW,{className:"w-3.5 h-3.5"})})})]})]})]})}),iwe=({hasAnimated:e})=>_.jsxs("div",{className:"relative flex items-center justify-center w-10 h-10 shrink-0",children:[_.jsx(Kp,{className:"w-[30px] h-[30px] text-slate-400 dark:text-slate-500",strokeWidth:1.5}),_.jsx(h2,{className:`absolute w-[15px] h-[15px] text-brand-500 dark:text-brand-400 agent-tray-llm-anim ${e?"agent-tray-llm-visible":"opacity-0"}
636`,strokeWidth:2,style:{top:"15%",left:"55%"}})]}),owe=Se.forwardRef(function({onAgentSelect:t,onAgentMessage:n,onAgentFinalOutput:r,onRunAll:i,roomId:o,onEnsureCollaboration:s,agentPrompts:l,onAgentPromptChange:u,isCustomDoc:d,onBeforeRun:f,getSuperDoc:p,editorId:m},y){const[b,k]=Se.useState(!1),S=async(V,ee)=>{var te,M,Z;ee!=null&&ee.skipBeforeRun||f==null||f();const F=((te=ee==null?void 0:ee.authorName)==null?void 0:te.trim())||V.title;if(ee!=null&&ee.skipAgentSelect||t==null||t({label:F,icon:V.icon,iconColor:V.iconColor,gradientColors:V.gradientColors,prompt:(ee==null?void 0:ee.promptOverride)??V.prompt}),!(ee!=null&&ee.skipCollaborationCheck)&&s&&await s()!==!0)return n==null||n(F,"done"),!1;const H=await yT((p==null?void 0:p())??null);try{let L=!1;const{finalOutput:W}=await pT({roomId:o??Y1(),prompt:(ee==null?void 0:ee.promptOverride)??V.prompt,agentName:((M=ee==null?void 0:ee.authorName)==null?void 0:M.trim())||V.agentName,agentEmail:V.agentEmail,agentAction:V.agentAction,userName:Wp,isCustomDoc:d,modelId:X1,provider:(Z=Fy.find(U=>U.id===X1))==null?void 0:Z.provider},{onStatus:U=>{n==null||n(F,U)},onEvent:U=>{if(U.type==="final"){L=!0;const q=typeof U.output=="string"&&U.output.length>0?U.output:"Done";r==null||r(F,q,V.icon,V.iconColor)}}});!L&&W&&typeof W=="string"&&W.length>0?r==null||r(F,W,V.icon,V.iconColor):L||r==null||r(F,"Done.",V.icon,V.iconColor),n==null||n(F,"done"),p&&!(ee!=null&&ee.skipResultScroll)&&vT({getSuperDoc:p,getEditorEl:()=>m?document.getElementById(m):null,before:H})}catch(L){const W=L instanceof Error?L.message:"";return W.includes("MATCH_NOT_FOUND")?r==null||r(F,"No matches found in document",V.icon,V.iconColor):r==null||r(F,W||"Something went wrong. Please try again.",V.icon,V.iconColor),n==null||n(F,"done"),!1}return!0};Se.useImperativeHandle(y,()=>({runAgentByLabel:(V,ee,F)=>{const H=ny.find(te=>te.title===V);return H?S(H,{...ee?{promptOverride:ee}:{},...F!=null&&F.skipBeforeRun?{skipBeforeRun:!0}:{},...F!=null&&F.authorName?{authorName:F.authorName}:{},...F!=null&&F.skipResultScroll?{skipResultScroll:!0}:{}}):Promise.resolve(!1)}}));const[x,T]=Se.useState(!1),C=Se.useRef(null),I=Se.useRef(null),D=Se.useRef(null),P=Se.useRef(new Map);return Se.useEffect(()=>{if(b)return;const V=C.current;if(!V)return;const ee=new IntersectionObserver(([F])=>{F!=null&&F.isIntersecting&&k(!0)},{threshold:.2});return ee.observe(V),()=>ee.disconnect()},[b]),Se.useEffect(()=>{const V=I.current,ee=D.current;if(!V||!ee)return;const F=()=>{T(ee.scrollWidth>V.clientWidth+1)};F();const H=new ResizeObserver(()=>{F()});return H.observe(V),H.observe(ee),window.addEventListener("resize",F),()=>{H.disconnect(),window.removeEventListener("resize",F)}},[]),_.jsxs("div",{className:"w-full overflow-x-hidden overflow-y-hidden pt-2 pb-4",children:[_.jsx("header",{ref:C,className:"text-center",children:_.jsxs("div",{className:"inline-flex items-center gap-1 justify-center",children:[_.jsx(iwe,{hasAnimated:b}),_.jsx("div",{children:_.jsx("p",{className:"text-2xl md:text-3xl font-extrabold tracking-tight bg-gradient-to-r from-brand-600 to-violet-600 dark:from-brand-400 dark:to-violet-400 bg-clip-text text-transparent",children:"Build a DOCX AI agent"})})]})}),_.jsxs("div",{className:"relative",children:[x&&_.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-10 w-10 bg-gradient-to-r from-slate-50 to-transparent dark:from-slate-900"}),x&&_.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 z-10 w-10 bg-gradient-to-l from-slate-50 to-transparent dark:from-slate-900"}),_.jsx("div",{ref:I,className:"overflow-x-auto scrollbar-hide",children:_.jsx("div",{ref:D,className:"flex flex-nowrap gap-4 px-0.5 pb-8",children:ny.map(V=>_.jsx(rwe,{ref:ee=>{ee?P.current.set(V.id,ee):P.current.delete(V.id)},title:V.title,description:V.description,icon:V.icon,gradient:V.gradient,gradientColors:V.gradientColors,iconColor:V.iconColor,iconColorHex:V.iconColorHex,prompt:(l==null?void 0:l[V.title])??V.prompt,onRun:ee=>S(V,{promptOverride:ee}),onPromptChange:ee=>u==null?void 0:u(V.title,ee)},V.id))})})]}),_.jsxs("div",{className:"-mt-5 flex justify-center gap-2 pt-4",children:[_.jsxs("button",{type:"button",onClick:()=>window.open("https://docs.superdoc.dev/agents/build/build-an-agent/","_blank"),className:"w-55 inline-flex items-center justify-center gap-2 py-2 px-3 rounded-lg bg-white dark:bg-white/5 border border-slate-200 dark:border-white/10 text-xs font-bold text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-white/10 hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:[_.jsx(Kp,{className:"w-3.5 h-3.5"}),"Start new DOCX Agent"]}),_.jsxs("button",{type:"button",onClick:async()=>
636{f==null||f(),!(s&&await s()!==!0)&&(ny.forEach(V=>{const ee=P.current.get(V.id);ee?ee.run():S(V,{skipCollaborationCheck:!0,skipBeforeRun:!0})}),i==null||i())},className:"w-55 inline-flex items-center justify-center gap-2 py-2 px-3 rounded-lg bg-white dark:bg-white/5 border border-slate-200 dark:border-white/10 text-xs font-bold text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-white/10 hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:[_.jsx(T_,{className:"w-3.5 h-3.5"}),"Run all the AI Agents"]})]})]})}),swe=({className:e})=>_.jsx("span",{className:`inline-flex items-center justify-center rounded-[4px] bg-slate-600 text-white dark:ring-1 dark:ring-white/20 ${e??""}`,children:_.jsx(PW,{className:"w-[11px] h-[11px]",strokeWidth:3})}),awe=[{name:"JavaScript",icon:"https://cdn.simpleicons.org/javascript/F7DF1E"},{name:"TypeScript",icon:"https://cdn.simpleicons.org/typescript/3278c5"},{name:"React",icon:"https://cdn.simpleicons.org/react/61DAFB"},{name:"Vue",icon:"https://cdn.simpleicons.org/vue.js/4FC08D"},{name:"CLI",Icon:swe},{name:"Node",icon:"https://cdn.simpleicons.org/nodedotjs/5FA04E"},{name:"Python",icon:"https://cdn.simpleicons.org/python/3776AB"}],lwe=[{label:"DOCX Editor",icon:Kp,href:"https://docs.superdoc.dev/editor/quickstart/"},{label:"DOCX AI Agent",icon:Jf,href:"https://docs.superdoc.dev/agents/build/build-an-agent/"}],cwe=({editorSectionRef:e,demoContainerRef:t,promptContainerRef:n,insertAtTopRef:r,submitToChatRef:i,openDocumentRef:o,showDemoFloatingPrompt:s,aiPromptValue:l,onAiPromptValueChange:u,isAiSubmitting:d,onAiSubmittingChange:f,onChatOpenChange:p,onDocumentLoadedChange:m})=>{const[y,b]=Se.useState(!1),[k,S]=Se.useState([]),[x,T]=Se.useState({}),[C,I]=Se.useState(null),[D,P]=Se.useState(!1),[V,ee]=Se.useState({}),F=(W,U)=>ee(q=>({...q,[W]:U})),H=Se.useRef(null),te=Se.useRef(null),M=W=>{var U;T(q=>({...q,[W.label]:""})),S(q=>[W,...q.filter(Q=>
636Q.label!==W.label)]),(U=H.current)==null||U.setAgentLoading(W.label,!0,W.icon,W.iconColor,W.prompt)},Z=(W,U)=>{var q,Q;T(re=>({...re,[W]:U})),U==="done"?(q=H.current)==null||q.setAgentLoading(W,!1):(Q=H.current)==null||Q.setAgentStatus(W,U)},L=()=>{var W;navigator.clipboard.writeText((W=document.getElementById("npm-command"))==null?void 0:W.textContent),b(!0),setTimeout(()=>b(!1),2e3)};return _.jsxs("section",{className:"relative pt-[30px] sm:pt-[45px] overflow-hidden super-gradient",children:[_.jsx("div",{className:"glow-blob bg-purple-500/20 w-96 h-96 rounded-full absolute left-0 top-0 -ml-48 -mt-48 blur-3xl"}),_.jsx("div",{className:"glow-blob bg-blue-500/20 w-[500px] h-[500px] rounded-full absolute blur-3xl"}),_.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:_.jsx("div",{className:"grid grid-cols-1 gap-6 sm:gap-10 lg:gap-16 items-center",children:_.jsxs("div",{className:"space-y-3 text-center",children:[_.jsxs("h1",{className:"text-[clamp(18px,3.8vw,36px)] font-bold tracking-tight text-slate-900 dark:text-white leading-[1.1]",children:[_.jsx("div",{className:"pt-12 text-brand-500 dark:text-brand-400 text-[clamp(26px,6vw,58px)] font-semibold tracking-tight",children:"SuperDoc"}),_.jsx("span",{className:"gradient-text block pt-1 pb-0.5 leading-[1.25] text-[clamp(18px,4.6vw,35px)]",children:"Build AI agents that work with DOCX"})]}),_.jsxs("div",{className:"hidden min-[1000px]:flex flex-wrap items-center justify-center gap-2.5 h-9",style:{margin:"2px"},children:[_.jsxs("button",{type:"button",onClick:L,className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-slate-50 dark:bg-white/5 border border-slate-200 dark:border-white/10 text-slate-600 dark:text-slate-300 text-[13px] font-mono cursor-pointer hover:border-brand-500/30 dark:hover:border-brand-400/30 transition-all group select-none shadow-sm dark:shadow-none",children:[_.jsx("span",{className:"text-slate-400 dark:text-slate-500 select-none",children:"$"}),_.jsx("span",{id:"npm-command",className:"text-brand-600 dark:text-brand-400 font-medium",children:"npm i superdoc"}),_.jsx("div",{className:"pl-2 border-l border-slate-200 dark:border-white/10 ml-0.5",children:y?_.jsx(E_,{className:"w-3.5 h-3.5 text-green-500"}):_.jsx(bD,{className:"w-3.5 h-3.5 text-slate-400 group-hover:text-slate-600 dark:group-hover:text-slate-200 transition-colors"})})]}),_.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2.5",children:awe.map(W=>_.jsx("a",{href:"https://docs.superdoc.dev/",target:"_blank",rel:"noopener noreferrer",title:W.name,"aria-label":`${W.name} — SuperDoc docs`,className:"flex cursor-pointer select-none items-center justify-center rounded-full border border-slate-200 bg-white px-3.5 h-[30px] shadow-sm transition-colors hover:border-slate-300 hover:bg-slate-50 dark:border-white/10 dark:bg-white/5 dark:hover:border-white/20 dark:hover:bg-white/10",children:W.Icon?_.jsx(W.Icon,{className:"w-4 h-4"}):_.jsx("img",{src:W.icon,alt:W.name,className:"w-4 h-4"})},W.name))})]}),_.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4 pb-[10px] justify-center",children:[_.jsx("div",{className:"flex w-full gap-2 sm:contents",children:lwe.map(W=>_.jsxs("button",{className:"flex-1 min-w-0 sm:flex-none sm:w-[180px] pl-2.5 pr-3 sm:px-4 py-2 bg-brand-500 text-white rounded-lg hover:bg-brand-600 transition-all flex items-center justify-center gap-2 sm:gap-3 group shadow-[0_0_20px_rgba(19,85,255,0.3)] hover:shadow-[0_0_30px_rgba(19,85,255,0.5)]",type:"button",onClick:()=>window.open(W.href,"_blank","noopener,noreferrer"),children:[_.jsx("span",{className:"flex-shrink-0 w-7 h-7 sm:w-8 sm:h-8 rounded-md bg-white/15 flex items-center justify-center",children:_.jsx(W.icon,{className:"w-4 h-4",strokeWidth:2.5})}),_.jsxs("span",{className:"flex flex-col items-start text-left select-none",children:[_.jsx("span",{className:"text-[10px] font-semibold tracking-wider text-white/70 leading-none",children:"Quick start"}),_.jsx("span",{className:"text-sm font-bold leading-tight mt-1 whitespace-nowrap",children:W.label})]})]},W.label))}),_.jsxs("button",{className:"w-full sm:w-auto px-5 py-3.5 sm:py-0 sm:self-stretch bg-white dark:bg-dark-800 text-slate-700 dark:text-white font-medium rounded-lg border border-slate-200 dark:border-white/10 hover:bg-slate-50 dark:hover:bg-dark-700 transition-all flex items-center justify-center gap-2",type:"button",onClick:()=>window.open("https://github.com/superdoc/docx-editor","_blank","noopener,noreferrer"),children:[_.jsx(ky,{className:"w-4 h-4 text-slate-500 dark:text-slate-400",strokeWidth:2.5}),_.jsx("span",{className:"select-none",children:"GitHub"})]})]}),_.jsxs("div",{className:"pb-1.5 hidden sm:flex items-center justify-center gap-4 text-slate-500 dark:text-slate-400 text-sm",children:[_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(wb,{className:"w-4 h-4 text-brand-500"}),_.jsx("span",{children:"Open Source"})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(wb,{className:"w-4 h-4 text-brand-500"}),_.jsx("span",{children:"Self-hosted"})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(wb,{className:"w-4 h-4 text-brand-500"}),_.jsx("span",{children:"Custom UI"})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(wb,{className:"w-4 h-4 text-brand-500"}),_.jsx("span",{children:"LLM Tools/CLI/SDK"})]})]}),_.jsxs("div",{ref:e,id:"editor",className:"w-full min-w-0 flex flex-col items-center pt-1.5 pb-8 scroll-m-[60px] gap-4",children:[_.jsx("div",{ref:t,className:"w-full",children:_.jsx(twe,{ref:H,showFloatingPrompt:s,promptContainerRef:n,insertAtTopRef:r,submitToChatRef:i,openDocumentRef:o,aiPromptValue:l,onAiPromptValueChange:u,isAiSubmitting:d,onAiSubmittingChange:f,selectedAgents:k,onSelectedAgentChange:M,onRunAgent:(W,U,q)=>{var Q;return(Q=te.current)==null?void 0:Q.runAgentByLabel(W,U,{skipBeforeRun:(q==null?void 0:q.skipScroll)===!0,authorName:q==null?void 0:q.authorName,skipResultScroll:q==null?void 0:q.skipResultScroll})},agentPrompts:V,onAgentPromptChange:F,agentStatuses:x,onChatOpenChange:p,onDocumentLoadedChange:m,onCollaborationRoomChange:I,onCustomDocChange:P})}),_.jsx("div",{id:"agent-tray",className:"w-full scroll-m-[90px]",children:_.jsx(owe,{ref:te,roomId:C,onAgentSelect:M,onAgentMessage:Z,onAgentFinalOutput:(W,U,q,Q)=>{var re;return(re=H.current)==null?void 0:re.addAgentMessage(W,U,q,Q)},agentPrompts:V,onAgentPromptChange:F,isCustomDoc:D,getSuperDoc:()=>{var W;return((W=H.current)==null?void 0:W.getSuperDoc())??null},editorId:"superdoc-demo-main-editor",onEnsureCollaboration:async()=>{const W=H.current;return W?W.enableCollaboration():!1},onBeforeRun:()=>{var W,U;(W=document.getElementById("editor"))==null||W.scrollIntoView({behavior:"smooth",block:"start"}),(U=H.current)==null||U.scrollEditorToTop()}})})]})]})})})]})},UN="Sorry, something went wrong. Please try again later.";function uwe(){const[e,t]=Se.useState("idle"),[n,r]=Se.useState(""),i=Se.useRef(null),o=Se.useRef(!1);async function s(l){var f;if(l.preventDefault(),o.current)return;const u=new FormData(l.currentTarget),d=String(u.get("email")??"").trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d)||d.length>254){r("Please enter a valid email address."),t("error"),(f=i.current)==null||f.focu
636s();return}o.current=!0,t("loading"),r("");try{const p=await fetch("/api/newsletter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:d,website:u.get("website")??""}),signal:AbortSignal.timeout(15e3)}),m=await p.json();if(!p.ok||m.ok!==!0)throw new Error(UN);t("success")}catch{r(UN),t("error")}finally{o.current=!1}}return _.jsx("div",{className:"mt-16 flex justify-center relative",children:_.jsx("div",{className:"relative w-full max-w-xl",children:_.jsxs("div",{"data-newsletter":!0,"data-state":e,className:"text-center",children:[_.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 mb-3",children:_.jsxs("span",{className:"inline-flex items-center gap-1.5 font-semibold text-slate-900 dark:text-white",children:[_.jsx(FA,{className:"w-4 h-4 text-slate-500 dark:text-slate-400"}),"Sign up for our SuperDoc newsletter"]})}),e!=="success"&&_.jsxs("form",{className:"flex flex-col sm:flex-row items-stretch gap-2 mx-auto",noValidate:!0,onSubmit:s,"aria-busy":e==="loading",children:[_.jsx("label",{className:"sr-only",htmlFor:"newsletter-email",children:"Email address"}),_.jsxs("div",{className:"relative flex-1",children:[_.jsxs("svg",{"aria-hidden":"true",className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400 pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"}),_.jsx("path",{d:"M2 7l10 7 10-7"})]}),_.jsx("input",{ref:i,id:"newsletter-email",type:"email",name:"email",autoComplete:"email",placeholder:"[email protected]",required:!0,maxLength:254,disabled:e==="loading","aria-invalid":e==="error","aria-describedby":e==="error"?"newsletter-error":void 0,onChange:()=>{e==="error"&&(t("idle"),r(""))},className:"w-full pl-10 pr-4 py-3 rounded-lg bg-white dark:bg-white/5 border border-slate-200 dark:border-white/10 text-slate-900 dark:text-white placeholder:text-slate-400 focus:outline-none focus:border-brand-500 focus:ring-2 focus:ring-brand-500/30 transition-colors"})]}),_.jsx("input",{type:"text",name:"website",tabIndex:-1,autoComplete:"off",className:"hidden","aria-hidden":"true"}),_.jsx("button",{type:"submit",disabled:e==="loading",className:"px-6 py-3 bg-brand-500 text-white font-semibold rounded-lg hover:bg-brand-600 transition-colors shadow-sm hover:shadow-brand-500/25 select-none whitespace-nowrap",children:_.jsxs("span",{className:"inline-flex items-center gap-2",children:[e==="loading"&&_.jsx("svg",{"aria-hidden":"true",className:"newsletter-spin w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:_.jsx("path",{d:"M21 12a9 9 0 1 1-6.2-8.6"})}),e==="loading"?"Subscribing…":"Subscribe"]})})]}),e==="error"&&_.jsx("p",{id:"newsletter-error",className:"text-sm text-red-600 dark:text-red-400 mt-2",role:"alert",children:n}),_.jsx("div",{role:"status","aria-live":"polite",children:e==="success"&&_.jsxs("div",{className:"newsletter-pop flex items-center justify-center gap-2.5 px-4 py-3 rounded-lg bg-emerald-50 dark:bg-emerald-500/10 border border-emerald-200 dark:border-emerald-500/20 text-emerald-800 dark:text-emerald-300 text-sm font-medium",children:[_.jsxs("svg",{"aria-hidden":"true",className:"w-5 h-5 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("circle",{cx:"12",cy:"12",r:"10"}),_.jsx("path",{d:"m9 12 2 2 4-4"})]}
636),"You're in. First issue hits your inbox soon."]})}),_.jsx("p",{className:"mt-3 text-xs text-slate-500 dark:text-slate-500",children:"At most one email a month. Unsubscribe anytime."})]})})})}const dwe=({className:e})=>_.jsx("svg",{className:e,viewBox:"0 0 512 512",fill:"currentColor","aria-hidden":"true",children:_.jsx("path",{d:"M8 266.44C10.3 130.64 105.4 34 221.8 18.34c138.8-18.6 255.6 75.8 278 201.1 21.3 118.8-44 230-151.6 274-9.3 3.8-14.4 1.7-18-7.7q-26.7-69.45-53.4-139c-3.1-8.1-1-13.2 7-16.8 24.2-11 39.3-29.4 43.3-55.8a71.47 71.47 0 0 0-64.5-82.2c-39-3.4-71.8 23.7-77.5 59.7-5.2 33 11.1 63.7 41.9 77.7 9.6 4.4 11.5 8.6 7.8 18.4q-26.85 69.9-53.7 139.9c-2.6 6.9-8.3 9.3-15.5 6.5-52.6-20.3-101.4-61-130.8-119-24.9-49.2-25.2-87.7-26.8-108.7zm20.9-1.9c.4 6.6.6 14.3 1.3 22.1 6.3 71.9 49.6 143.5 131 183.1 3.2 1.5 4.4.8 5.6-2.3q22.35-58.65 45-117.3c1.3-3.3.6-4.8-2.4-6.7-31.6-19.9-47.3-48.5-45.6-86 1-21.6 9.3-40.5 23.8-56.3 30-32.7 77-39.8 115.5-17.6a91.64 91.64 0 0 1 45.2 90.4c-3.6 30.6-19.3 53.9-45.7 69.8-2.7 1.6-3.5 2.9-2.3 6q22.8 58.8 45.2 117.7c1.2 3.1 2.4 3.8 5.6 2.3 35.5-16.6 65.2-40.3 88.1-72 34.8-48.2 49.1-101.9 42.3-161-13.7-117.5-119.4-214.8-255.5-198-106.1 13-195.3 102.5-197.1 225.8z"})}),fwe=[{title:"Flawless formatting",description:"Keep your exact document formatting. We preserve complex lists, pages, headers, advanced tables, tracked changes, and much more",icon:pW,href:"https://docs.superdoc.dev/start/how-superdoc-works/"},{title:"Self-hosted and fully secure",description:"You fully own your data, documents, and reliability. We provide the library and tools to build your own document editing experience.",icon:Hb,href:"https://docs.superdoc.dev/resources/security/"},{title:"Real-time collaboration",description:"Edit and review documents in real-time with multiple users. We support collaborative editing, commenting, and tracking changes.",icon:Bq,href:"https://docs.superdoc.dev/editor/migrate-from-v1/overview/#documentv2collaboration"},{title:"Agent tooling",description:"Build powerful agentic workflows with your LLM leveraging our document API and tools. Fully run SuperDoc within your own server or agent.",icon:I_,href:"https://docs.superdoc.dev/agents/build/tools/"},{title:"Customization",description:"Brand your document editor with your own UX components, styles, colors, custom toolbar items, and much more.",icon:bW,href:"https://docs.superdoc.dev/editor/custom-ui/overview/"},{title:"Open Source",description:"Designed for complete extensibility, community support, and modern agentic development workflows.",icon:dwe,href:"https://docs.superdoc.dev/start/what-superdoc-does/#licensing"}],hwe=()=>_.jsx("section",{id:"features",className:"py-24 bg-gradient-to-b from-blue-50/80 via-blue-50/40 to-transparent dark:from-dark-900 dark:via-dark-900 dark:to-dark-900 relative border-t border-slate-200 dark:border-white/5 transition-colors duration-300",children:_.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[_.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-20",children:[_.jsx("h2",{className:"text-brand-600 dark:text-brand-400 font-semibold tracking-wide uppercase text-sm mb-3",children:"Features"}),_.jsxs("h3",{className:"text-3xl md:text-4xl font-bold text-[#1f74dd] dark:text-white mb-6",children:["Native DOCX editing",_.jsx("br",{}),"in your product"]}),_.jsx("p",{className:"text-slate-600 dark:text-slate-400 text-lg",children:"Intention-built to be 100% compatible with MS Word. We handle all the complexities of complex DOCX formatting, redlining, headers/footers/pagination, tables, and much more."})]}),_.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:fwe.map((e,t)=>{const n="group p-6 rounded-2xl bg-white dark:bg-dark-900 border border-slate-200 dark:border-white/5 hover:border-brand-500/30 transition-all hover:shadow-[0_0_30px_-10px_rgba(19,85,255,0.15)] relative overflow-hidden shadow-sm dark:shadow-none",r=_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"absolute top-0 right-0 p-6 opacity-5 group-hover:opacity-10 transition-opacity transform group-hover:scale-110 duration-500 text-slate-900 dark:text-white",children:_.jsx(e.icon,{className:"w-24 h-24"})}),_.jsx("div",{className:"w-12 h-12 bg-brand-100 dark:bg-brand-900/30 rounded-lg border border-brand-200 dark:border-brand-500/20 flex items-center justify-center text-brand-600 dark:text-brand-400 mb-6 group-hover:bg-brand-500 group-hover:text-white dark:group-hover:text-white transition-colors",children:_.jsx(e.icon,{className:"w-6 h-6"})}),_.jsx("h4",{className:"text-xl font-bold text-slate-900 dark:text-white mb-3",children:e.title}
636),_.jsx("p",{className:"text-slate-600 dark:text-slate-400 leading-relaxed text-sm",children:e.description})]});return e.href?_.jsx("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:`${n} block cursor-pointer no-underline`,children:r},t):_.jsx("div",{className:n,children:r},t)})}),_.jsx(uwe,{})]})}),pwe=({className:e})=>_.jsx("svg",{viewBox:"0 0 24 24",className:e,"aria-hidden":"true",children:_.jsx("text",{x:"12",y:"17",textAnchor:"middle",fontSize:"14",fontWeight:"700",letterSpacing:"-0.5",fill:"currentColor",children:"JS"})}),mwe=[{name:"Vanilla TypeScript",slug:"vanilla",label:"TypeScript DOCX Editor",outcome:"Mount SuperDoc, open a DOCX, edit it, and export the result.",icon:pwe,iconColor:"text-amber-600 dark:text-amber-400"},{name:"React",slug:"react",label:"React DOCX Editor",outcome:"Create the editor in a component and destroy it cleanly on unmount.",icon:ZG,iconColor:"text-cyan-600 dark:text-cyan-400"},{name:"Version history",slug:"version-history",label:"Version History",outcome:"Capture DOCX snapshots and reopen any saved version.",icon:Hq,iconColor:"text-violet-600 dark:text-violet-400"},{name:"Custom UI",slug:"custom-ui",label:"Customize the toolbar",outcome:"Add your own custom toolbar buttons and UI elements.",icon:kD,iconColor:"text-pink-600 dark:text-pink-400"},{name:"Content controls",slug:"content-controls",label:"Insert document fields",outcome:"Find a tagged text field, update it, and preserve it on export.",icon:xW,iconColor:"text-emerald-600 dark:text-emerald-400"},{name:"Document modes",slug:"document-modes",label:"Toggle review mode",outcome:"Move between editing, suggesting, and viewing in one browser editor.",icon:Rq,iconColor:"text-orange-600 dark:text-orange-400"},{name:"Search",slug:"search",label:"Built-in search",outcome:"Open built-in search and find matches in the DOCX.",icon:CD,iconColor:"text-indigo-600 dark:text-indigo-400"},{name:"Collaboration",slug:"collaboration",label:"Real-time collaboration",outcome:"Create or join a room and synchronize edits with Yjs.",icon:AD,iconColor:"text-teal-600 dark:text-teal-400"}];function gwe(e="300px"){const t=Se.useRef(null),[n,r]=Se.useState(!1);return Se.useEffect(()=>{const i=t.current;if(!i||n)return;if(typeof IntersectionObserver>"u"){r(!0);return}const o=new IntersectionObserver(s=>{s.some(l=>l.isIntersecting)&&(r(!0),o.disconnect())},{rootMargin:e});return o.observe(i),()=>o.disconnect()},[n,e]),[t,n]}const ywe=({example:e})=>{const t=e.icon,n=Se.useRef(null),[r,i]=gwe(),[o,s]=Se.useState(!1),l=Se.useCallback(()=>{var f;const d=n.current;d&&((f=window.matchMedia)!=null&&f.call(window,"(prefers-reduced-motion: reduce)").matches||(d.src||(d.src=`/examples/${e.slug}.mp4`),d.play().catch(()=>{})))},[e.slug]),u=Se.useCallback(()=>{var f;if((f=window.matchMedia)!=null&&f.call(window,"(hover: none)").matches)return;const d=n.current;d&&(d.pause(),d.currentTime=0,s(!1))},[]);return Se.useEffect(()=>{var d;i&&(d=window.matchMedia)!=null&&d.call(window,"(hover: none)").matches&&l()},[i,l]),_.jsxs("a",{ref:r,href:`https://go.superdoc.dev/examples/${e.slug}`,target:"_blank",rel:"noopener noreferrer","aria-label":`View the ${e.name} example code on GitHub`,onMouseEnter:l,onMouseLeave:u,onFocus:l,onBlur:u,className:"group flex flex-col rounded-2xl border border-slate-200 bg-white p-6 transition-all hover:border-brand-500/40 hover:shadow-[0_0_30px_-10px_rgba(19,85,255,0.25)] dark:border-white/10 dark:bg-dark-800",children:[_.jsxs("div",{className:"mb-3 flex items-center gap-2.5",children:[_.jsx(t,{className:`h-7 w-7 shrink-0 ${e.iconColor}`,strokeWidth:1.8}),_.jsx("h4",{className:"font-bold leading-snug text-slate-900 transition-colors group-hover:text-brand-600 dark:text-white dark:group-hover:text-brand-400",children:e.label})]}),_.jsxs("div",{className:"relative mb-4 aspect-video overflow-hidden rounded-xl border border-slate-200 bg-slate-50 transition-opacity dark:border-white/10 dark:bg-dark-900 dark:opacity-80 dark:group-hover:opacity-100",children:[_.jsx("video",{ref:n,className:"absolute inset-0 h-full w-full object-cover",preload:"none",muted:!0,loop:!0,playsInl
636ine:!0,disablePictureInPicture:!0,"aria-hidden":"true",tabIndex:-1,onPlaying:()=>s(!0)}),_.jsx("img",{src:i?`/examples/${e.slug}.webp`:void 0,alt:"","aria-hidden":"true",loading:"lazy",decoding:"async",fetchPriority:"low",width:640,height:360,className:`absolute inset-0 h-full w-full object-cover transition-opacity duration-200 ${o?"opacity-0":"opacity-100"}`}),_.jsx("div",{className:"pointer-events-none absolute inset-0 bg-white/40 opacity-0 transition-opacity duration-300 [@media(hover:hover)]:opacity-100 group-hover:opacity-0"})]}),_.jsx("p",{className:"mb-3 text-sm leading-relaxed text-slate-600 dark:text-slate-400",children:e.outcome}),_.jsxs("span",{className:"mt-auto inline-flex items-center gap-2 text-sm font-bold text-slate-500 transition-colors group-hover:text-brand-600 dark:text-slate-400 dark:group-hover:text-brand-400",children:[_.jsx(ky,{className:"h-3.5 w-3.5"}),"Code",_.jsx(d2,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]})]})},vwe=()=>_.jsx("section",{id:"examples",className:"border-t border-slate-200 bg-gradient-to-b from-blue-50/60 via-trans
636parent to-transparent py-24 transition-colors duration-300 dark:border-white/5 dark:from-dark-900 dark:via-dark-900 dark:to-dark-900",children:_.jsxs("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:[_.jsxs("div",{className:"mx-auto mb-16 max-w-3xl text-center",children:[_.jsx("h2",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:"Examples"}),_.jsx("h3",{className:"mb-6 text-3xl font-bold text-[#1f74dd] dark:text-white md:text-4xl",children:"Demo apps"}),_.jsx("div",{className:"flex justify-center",children:_.jsxs("a",{href:"https://github.com/superdoc/docx-editor/tree/main/examples",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 py-2 px-3 rounded-lg bg-white dark:bg-white/5 border border-slate-200 dark:border-white/10 text-xs font-bold text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-white/10 hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:[_.jsx(ky,{className:"w-3.5 h-3.5"}),"View all code examples"]})})]}),_.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-4",children:mwe.map(e=>_.jsx(ywe,{example:e},e.slug))})]})}),CU=()=>_.jsx("footer",{className:"bg-white dark:bg-dark-900 border-t border-slate-200 dark:border-white/5 pt-16 pb-8 transition-colors duration-300",children:_.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[_.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-8 mb-12",children:[_.jsxs("div",{className:"col-span-2 lg:col-span-2",children:[_.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[_.jsx("img",{src:"/logo.jpg",alt:"SuperDoc logo",className:"h-[36px] w-[33px]"}),_.jsx("span",{className:"text-brand-500 dark:text-brand-400 font-bold text-xl tracking-tight",children:"SuperDoc"})]}),_.jsx("p",{className:"text-slate-600 dark:text-slate-500 text-sm max-w-xs mb-6",children:"Add DOCX editing into your product and agentic workflows"}),_.jsxs("div",{className:"flex gap-4",children:[_.jsx("a",{href:"https://x.com/superdocdev",target:"_blank",rel:"noopener noreferrer",className:"text-slate-500 hover:text-slate-900 dark:hover:text-white transition-colors",children:_.jsx(jW,{className:"w-5 h-5"})}),_.jsx("a",{href:"https://github.com/superdoc/docx-editor",target:"_blank",rel:"noopener noreferrer",className:"text-slate-500 hover:text-slate-900 dark:hover:text-white transition-colors",children:_.jsx(ky,{className:"w-5 h-5"})}),_.jsx("a",{href:"https://www.linkedin.com/company/superdoc-dev/",target:"_blank",rel:"noopener noreferrer",className:"text-slate-500 hover:text-slate-900 dark:hover:text-white transition-colors",children:_.jsx(Jq,{className:"w-5 h-5"})})]})]}),_.jsxs("div",{children:[_.jsx("h4",{className:"text-slate-900 dark:text-white font-semibold mb-4",children:"Product"}),_.jsxs("ul",{className:"space-y-2 text-sm text-slate-600 dark:text-slate-500",children:[_.jsx("li",{children:_.jsx("a",{href:"#features",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Features"})}),_.jsx("li",{children:_.jsx("a",{href:"#pricing",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Pricing"})}),_.jsx("li",{children:_.jsx("a",{href:"#examples",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Examples"})}),_.jsx("li",{children:_.jsx("a",{href:"#faq",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"FAQ"})})]})]}),_.jsxs("div",{children:[_.jsx("h4",{className:"text-slate-900 dark:text-white font-semibold mb-4",children:"Resources"}),_.jsxs("ul",{className:"space-y-2 text-sm text-slate-600 dark:text-slate-500",children:[_.jsx("li",{children:_.jsx("a",{href:"https://docs.superdoc.dev",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Documentation"})}),_.jsx("li",{children:_.jsx("a",{href:"hhttps://github.com/superdoc/docx-editor",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"GitHub"})}),_.jsx("li",{children:_.jsx("a",{href:"https://www.npmjs.com/package/superdoc",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"NPM"})}),_.jsx("li",{children:_.jsx("a",{href:"https://docs.superdoc.dev/resources/security/",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Trust & Security"})}),_.jsx("li",{children:_.jsx("a",{href:"https://docxcorp.us/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Open DOCX dataset"})}),_.jsx("li",{children:_.jsx("a",{href:"https://discord.com/invite/b9UuaZRyaB",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Community"})}),_.jsx("li",{children:_.jsx("a",{href:"https://github.com/superdoc/docx-editor/releases",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Release notes"})}),_.jsx("li",{children:_.jsx("a",{href:"/changelog",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Changelog"})}),_.jsx("li",{children:_.jsx("a",{href:"https://meetings.hubspot.com/josh-superdoc/talk-to-an-engineer",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Book eng meeting"})})]})]}),_.jsxs("div",{children:[_.jsx("h4",{className:"text-slate-900 dark:text-white font-semibold mb-4",children:"Company"}
636),_.jsxs("ul",{className:"space-y-2 text-sm text-slate-600 dark:text-slate-500",children:[_.jsx("li",{children:_.jsx("a",{href:"https://www.linkedin.com/company/superdoc-dev/jobs/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Careers"})}),_.jsx("li",{children:_.jsx("a",{href:"https://www.harbourshare.com/privacy-policy",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Privacy Policy"})}),_.jsx("li",{children:_.jsx("a",{href:"https://app.termly.io/policy-viewer/policy.html?policyUUID=0b852fc9-5d9c-4170-8c96-08b072a55a9f",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Website Terms of Use"})}),_.jsx("li",{children:_.jsx("a",{href:"https://www.gnu.org/licenses/agpl-3.0",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"AGPLv3 (Open-Source License)"})}),_.jsx("li",{children:_.jsx("a",{href:"https://www.superdocportal.dev/superdoc-terms-of-service",target:"_blank",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Commercial License"})}),_.jsx("li",{children:_.jsx("a",{href:"https://www.superdocportal.dev/contact",target:"_blank",rel:"noopener noreferrer",className:"hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:"Contact"})})]})]})]}),_.jsxs("div",{className:"border-t border-slate-200 dark:border-white/5 pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[_.jsxs("p",{className:"text-slate-600 text-sm",children:["© ",new Date().getFullYear()," Harbour Enterprises, Inc. 💙💛"]}),_.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-600",children:[_.jsx("span",{children:"Made with"}),_.jsx(Fq,{className:"w-4 h-4 text-red-500 fill-red-500"}),_.jsx("span",{children:"by OOXML geeks"})]})]})]})}),bwe=[{name:"ooxml.dev",description:"The OOXML spec, explained by implementers. Live previews, real-world gotchas, and AI-powered spec search.",href:"https://ooxml.dev/?utm_source=superdoc.dev&utm_medium=referral&utm_campaign=ecosystem",cta:"Explore reference",icon:f2},{name:"docx.tools",description:"Free, private document tools. Convert, redact, compare, and view Word files — entirely in your browser.",href:"https://docx.tools/?utm_source=superdoc.dev&utm_medium=referral&utm_campaign=ecosystem",cta:"Try tools",icon:hk},{name:"docxcorp.us",description:"Over 1 million Word documents from the public web. The largest open DOCX dataset for research.",href:"https://docxcorp.us/?utm_source=superdoc.dev&utm_medium=referral&utm_campaign=ecosystem",cta:"Browse dataset",icon:_q}],wwe=()=>_.jsx("section",{className:"py-24 bg-gradient-to-b from-transparent via-blue-50/30 to-transparent dark:from-dark-900 dark:via-dark-900 dark:to-dark-900 border-t border-slate-200 dark:border-white/5 transition-colors duration-300",children:_.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[_.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-16",children:[_.jsx("h2",{className:"text-brand-600 dark:text-brand-400 font-semibold tracking-wide uppercase text-sm mb-3",children:"Ecosystem"}),_.jsxs("h3",{className:"text-3xl md:text-4xl font-bold text-[#1f74dd] dark:text-white mb-6",children:["Our contribution to the",_.jsx("br",{}),"document ecosystem"]}),_.jsx("p",{className:"text-slate-600 dark:text-slate-400 text-lg",children:"Free, open-source tools and references we built while working on SuperDoc"})]}),_.jsx("div",{className:"grid md:grid-cols-3 gap-8 max-w-5xl mx-auto",children:bwe.map(e=>_.jsxs("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"group p-6 rounded-2xl bg-white dark:bg-dark-900 border border-slate-200 dark:border-white/5 hover:border-brand-500/30 transition-all hover:shadow-[0_0_30px_-10px_rgba(19,85,255,0.15)] relative overflow-hidden shadow-sm dark:shadow-none",children:[_.jsx("div",{className:"absolute top-0 right-0 p-6 opacity-5 group-hover:opacity-10 transition-opacity transform group-hover:scale-110 duration-500 text-slate-900 dark:text-white",children:_.jsx(e.icon,{className:"w-24 h-24"})}),_.jsx("div",{className:"w-12 h-12 bg-brand-100 dark:bg-brand-900/30 rounded-lg border border-brand-200 dark:border-brand-500/20 flex items-center justify-center text-brand-600 dark:text-brand-400 mb-6 group-hover:bg-brand-500 group-hover:text-white dark:group-hover:text-white transition-colors",children:_.jsx(e.icon,{className:"w-6 h-6"})}),_.jsx("h4",{className:"text-xl font-bold text-slate-900 dark:text-white mb-3",children:e.name}
636),_.jsx("p",{className:"text-slate-600 dark:text-slate-400 leading-relaxed text-sm",children:e.description}),_.jsxs("span",{className:"inline-flex items-center gap-1.5 mt-5 text-sm font-semibold text-brand-600 dark:text-brand-400 group-hover:gap-2.5 transition-all",children:[e.cta,_.jsx(d2,{className:"w-4 h-4"})]})]},e.name))})]})}),xwe="font-medium text-brand-600 dark:text-brand-400 underline underline-offset-2 hover:no-underline",kwe=[{name:"Getting Started",icon:T_,iconClass:"bg-purple-100 dark:bg-purple-500/15 border-purple-200 dark:border-purple-500/25 text-purple-600 dark:text-purple-400",items:[{q:"What is a document experience?",a:["A document experience is one product feature powered by SuperDoc. Browser, desktop, and server-side uses count together when they support that same feature. A separate product feature, such as a template builder or standalone signing experience, counts as another document experience."]},{q:"Can I start with Business and upgrade later?",a:["Yes. Business is the right place to start when you are launching one production document experience.","You can move to Enterprise as you add distinct workflows, products, teams, or broader deployment and support requirements."]},{q:"Does SuperDoc work with documents opened in Microsoft Word?",a:["Yes. SuperDoc works directly with DOCX files and is built for interoperability with Microsoft Word and other DOCX-compatible workflows."]}]},{name:"AI & Agents",icon:Jf,iconClass:"bg-blue-100 dark:bg-blue-500/15 border-blue-200 dark:border-blue-500/25 text-blue-600 dark:text-blue-400",items:[{q:"How can I use SuperDoc with AI and agents?",a:["SuperDoc provides the document infrastru
636cture for AI-powered products. You choose the models, prompts, agent framework, and application logic.","Your AI or agents can use SuperDoc’s self-hosted Document API and developer tools to inspect, generate, edit, review, and transform DOCX files. Changes can be represented through native document features such as tracked changes and comments and shown to users in the browser editor.","SuperDoc handles the DOCX editing, formatting, rendering, and Word interoperability layers. Your application controls the model, orchestration, permissions, retrieval, and user experience.","SuperDoc is model- and provider-independent and can be used with hosted or local models."]},{q:"Can agents edit documents using tracked changes and comments?",a:["Yes. Applications can use SuperDoc to let agents propose edits, create tracked changes, add comments, and participate in document-review workflows while preserving DOCX compatibility.","Your application determines which actions an agent may take and how users review or approve its work."]}]},{name:"Deployment",icon:EW,iconClass:"bg-emerald-100 dark:bg-emerald-500/15 border-emerald-200 dark:border-emerald-500/25 text-emerald-600 dark:text-emerald-400",items:[{q:"Where does SuperDoc run?",a:["SuperDoc is self-hosted and runs inside your application.","It can run:",{bullets:["In the browser for interactive document experiences","On your server for headless document generation, editing, and processing","Across both for products that combine server-side automation with an interactive editor","Directly within server-side or agent-driven workflows","As tools, CLI, or MCP leveraged directly by your LLM or agent framework"]},"You control the infrastructure and deployment."]},{q:"Does SuperDoc host or store my documents?",a:["No. Documents remain within your infrastructure. SuperDoc does not require document content to be sent to or stored by us.","Your application controls storage, access, retention, and data residency."]},{q:"Does SuperDoc require telemetry or usage reporting?",a:["No document-volume reporting is required.","Telemetry is configurable and can be disabled, including for deployments that cannot send data outside their environment."]},{q:"Can I use SuperDoc in development and testing environments?",a:["Yes. Development, QA, staging, and disaster recovery environments supporting your licensed production experience are included.","Licensing is based on production deployment scope, not the number of internal environments."]}]},{name:"Customization",icon:dW,iconClass:"bg-amber-100 dark:bg-amber-500/15 border-amber-200 dark:border-amber-500/25 text-amber-600 dark:text-amber-400",items:[{q:"How much can I customize the user experience?",a:["SuperDoc is extensively customizable and designed to fit into your product’s UX.","You can control the surrounding interface, styling, workflows, actions, and which document capabilities are available in each part of your product. You can also apply your own permissions to determine who can view, comment, suggest changes, edit directly, or approve changes.","SuperDoc can be combined with your own panels, AI experiences, review flows, and application logic. It provides the document editing and rendering layer while your product defines the final user experience."]},{q:"How does version history work?",a:["SuperDoc provides the document APIs and diff capabilities needed to build version-history workflows. Your application determines when to save and stores each version in your own infrastructure.","This lets you connect SuperDoc to your existing storage, permissions, retention, and audit model rather than adopting a separate SuperDoc-hosted document store."]}]},{name:"Commercial",icon:nq,iconClass:"bg-rose-100 dark:bg-rose-500/15 border-rose-200 dark:border-rose-500/25 text-rose-600 dar
636k:text-rose-400",items:[{q:"Do web and desktop count as separate document experiences?",a:["If web and desktop offer the same product feature, they count as one document experience."]},{q:"Do commercial plans include product updates?",a:["Yes. Business and Enterprise include SuperDoc releases made available during the active subscription, including new features, improvements, and fixes."]},{q:"What support is included?",a:["Business includes direct access to the SuperDoc team through a dedicated Slack channel.","Enterprise adds formal SLA options and deeper implementation and architecture guidance. Faster response options are available through an Enterprise agreement."]}]},{name:"Security & Privacy",icon:iW,iconClass:"bg-orange-100 dark:bg-orange-500/15 border-orange-200 dark:border-orange-500/25 text-orange-700 dark:text-orange-400",items:[{q:"Can SuperDoc access our documents?",a:["No. SuperDoc runs within your infrastructure and does not require document content to be sent to or stored by SuperDoc. Your team controls where documents are stored and processed."]},{q:"Can SuperDoc run in private or restricted environments?",a:["Yes. SuperDoc can run in your cloud, private network, or on-premises environment, including deployments without public internet access. Its collaboration infrastructure can also be self-hosted."]},{q:"What security materials are available?",a:["For Enterprise security reviews, we can provide our SOC 2 Type II report, security documentation, architecture and data-flow materials, and software bill of materials.",{node:_.jsxs(_.Fragment,{children:["Learn more on our"," ",_.jsx("a",{href:"https://docs.superdoc.dev/resources/security/",target:"_blank",rel:"noopener noreferrer",className:xwe,children:"Trust & Security page"}),"."]})}]}]}],_we=({blocks:e})=>_.jsx("div",{className:"mt-2 space-y-2 text-[13px] leading-5 text-slate-600 dark:text-slate-400",children:e.map((t,n)=>typeof t=="string"?_.jsx("p",{children:t},n):"node"in t?_.jsx("p",{children:t.node},n):_.jsx("ul",{className:"space-y-1 pl-1",children:t.bullets.map((r,i)=>_.jsxs("li",{className:"flex items-start gap-2",children:[_.jsx("span",{className:"mt-2 h-1 w-1 flex-shrink-0 rounded-full bg-brand-500 dark:bg-brand-400"}),_.jsx("span",{children:r})]},i))},n))}),Cwe=()=>_.jsx("section",{id:"faq",className:"py-24 border-t border-slate-200 dark:border-white/5 transition-colors duration-300",children:_.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[_.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-16",children:[_.jsx("h2",{className:"text-brand-600 dark:text-brand-400 font-semibold tracking-wide uppercase text-sm mb-3",children:"FAQ"}),_.jsx("h3",{className:"text-3xl md:text-4xl font-bold text-[#1f74dd] dark:text-white mb-6",children:"Common Questions"})]}),_.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:kwe.map(e=>_.jsxs("div",{className:"h-[440px] p-5 rounded-2xl bg-white dark:bg-dark-900 border border-slate-200 dark:border-white/5 shadow-sm dark:shadow-none flex flex-col",children:[_.jsx("div",{className:`w-11 h-11 rounded-lg border flex items-center justify-center mb-4 ${e.iconClass}`,children:_.jsx(e.icon,{className:"w-5 h-5"})}),_.jsx("h4",{className:"text-base font-bold text-slate-900 dark:text-white mb-3",children:e.name}),_.jsx("div",{className:"flex-1 overflow-y-auto pr-1 divide-y divide-slate-200 dark:divide-white/5 border-t border-slate-200 dark:border-white/5",children:e.items.map(t=>_.jsxs("details",{className:"group py-3 scroll-m-10",onToggle:n=>{const r=n.currentTarget;r.open&&requestAnimationFrame(()=>{r.scrollIntoView({behavior:"smooth",block:"nearest"})})},children:[_.jsxs("summary",{className:"flex items-start justify-between gap-2 cursor-pointer list-none text-sm font-medium text-slate-800 dark:text-slate-200 hover:text-brand-600 dark:hover:text-brand-400 transition-colors",children:[_.jsx("span",{children:t.q}),_.jsx(A_,{className:"w-4 h-4 mt-0.5 flex-shrink-0 text-slate-400 transition-transform group-open:rotate-180"})]}),_.jsx(_we,{blocks:t.a})]},t.q))})]},e.name))}),_.jsxs("div",{className:"mt-10 flex flex-col sm:flex-row items-center justify-between gap-4 roun
636ded-2xl bg-white dark:bg-dark-900 border border-slate-200 dark:border-white/5 shadow-sm dark:shadow-none px-6 py-5",children:[_.jsxs("div",{className:"flex items-center gap-4 text-center sm:text-left",children:[_.jsx("div",{className:"hidden sm:flex w-11 h-11 flex-shrink-0 rounded-lg items-center justify-center bg-brand-100 dark:bg-brand-500/15 border border-brand-200 dark:border-brand-500/25 text-brand-600 dark:text-brand-400",children:_.jsx(iq,{className:"w-5 h-5"})}),_.jsxs("div",{children:[_.jsx("p",{className:"font-bold text-slate-900 dark:text-white",children:"Still have questions?"}),_.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"Our team is happy to help you choose the right plan and get started."})]})]}),_.jsx("a",{href:"https://meetings.hubspot.com/josh-superdoc/talk-to-an-engineer",target:"_blank",rel:"noopener noreferrer",className:"flex-shrink-0 inline-flex items-center justify-center px-5 py-3 rounded-lg bg-[#5E5FEE] text-white font-bold hover:opacity-90 transition-all select-none",children:"Talk to an engineer"})]})]})}),Swe="bg-blue-100 border-blue-200 text-blue-600 dark:bg-blue-500/15 dark:border-blue-500/25 dark:text-blue-400",Ewe="bg-purple-100 border-purple-200 text-purple-600 dark:bg-purple-500/15 dark:border-purple-500/25 dark:text-purple-400",h_=[{id:"pages",name:"1,000 page test",detail:"A large and richly-formatted DOCX, that opens quickly without freezing the web app.",tags:["Pagination","Performance"],icon:Nq,file:"/testkit_docs/msa-1000pages.docx",successToastNote:""},{id:"i18n",name:"International documents",detail:"Right-to-left scripts, CJK text, and mixed directions.",tags:["RTL","CJK"],icon:qq,file:"/testkit_docs/international.docx",successToastNote:""},{id:"tables",name:"Advanced tables and columns",detail:"Merged cells, nested tables, multi-column text.",tags:["Tables","Columns"],icon:ED,file:"/testkit_docs/advanced-tables-columns.docx",successToastNote:""},{id:"formatting",name:"Formatting gauntlet",detail:"Advanced headers/footers, pleading, non-breaking hyphens, text boxes, lower-roman level-2 list items, and advanced content positioning.",tags:["Footnotes","Styles"],icon:Uq,file:"/testkit_docs/case-formatting-gauntlet.docx",successToastNote:""}],VN=[{id:"redline-list",title:"Make a precise redline to a list",promptDisplay:"Add a new item about reliability benefits of self-hosted solutions to the first list. Add this as a tracked change.",promptFull:"Add a new item about reliability benefits of self-hosted solutions to the first list. Add this as a tracked change. If no lists exists in the document, add a new list and then insert the tracked change.",tags:["Lists","Tracked changes","Context-aware styling"],icon:_D},{id:"table-summary",title:"Work inside a table",promptDisplay:"Add a summary row to the first table. Match the existing column widths, borders, and table styling.",promptFull:"Add a summary row to the first table. Match the existing column widths, borders, and table styling. Make the summary row bold. If no tables exist in the document, add a new table and then insert the summary row.",tags:["Table editing","Context-aware styling"],icon:ED},{id:"redline-repy",title:"Reply to an existing comment",promptDisplay:"Reply to the first comment and clarify the related document content.",promptFull:"Add a reply that clarifies the document content to the first comment. If no comments exist in the document, add a new comment first and then add the reply.",tags:["Multi-party","Comments","Context-aware styling"],icon:tW},{id:"review",title:"New section, same style",promptDisplay:"Append a paragraph summarizing the document including a title, a description, and a list of summary points.",promptFull:"Append a paragraph summarizing the document including a title, a description, and a list of summary points. Style the title. Add a extra line above the summary points.",tags:["Document context","Context-aware styling"],icon:lW}],SU="group flex cursor-pointer flex-col rounded-xl border border-slate-200 bg-slate-50/70 transition-colors duration-200 ease-out hover:border-brand-500/40 hover:bg-slate-200/60 dark:border-white/10 dark:bg-white/[0.03] dark:hover:border-brand-400/40 dark:hover:bg-white/[0.08]",EU="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-500 shadow-sm transition-colors hover:bg-brand-50 hover:text-brand-600 dark:border-white/10 dark:bg-white/5 dark:text-slate-300 dark:shadow-none dark:hover:bg-brand-500/10 dark:hover:text-brand-400",Awe="inline-flex h-8 items-center gap-1.5 rounded-lg border border-brand-200 bg-brand-50 px-2.5 text-xs font-bold text-brand-700 transition-colors hover:bg-brand-100 dark:border-brand-500/20 dark:bg-brand-900/20 dark:text-brand-300 dark:hover:bg-brand-900/30",bT="inline-flex h-8 items-center gap-1.5 rounded-lg border border-slate-200 bg-white px-2.5 text-xs font-semibold text-slate-700 shadow-sm transition-colors hover:border-brand-500/40 hover:text-brand-600 dark:border-white/10 dark:bg-white/5 dark:text-slate-200 dark:shadow-none dark:hover:border-brand-400/40 dark:hover:text-brand-400",HN="-mx-5 flex snap-x snap-mandatory gap-3 overflow-x-auto px-5 pb-1 scrollbar-hide sm:mx-0 sm:grid sm:overflow-visible sm:px-0 sm:pb-0",AU="inline-flex items-center gap-1 rounded-md bg-white px-1.5 py-0.5 text-[10px] font-medium text-slate-600 ring-1 ring-slate-200 dark:bg-white/5 dark:text-slate-300 dark:ring-white/10",Twe="inline-flex h-8 items-center gap-1.5 rounded-lg border border-purple-200 bg-purple-50 px-2.5 text-xs font-bold text-purple-700 transition-colors hover:bg-purple-100 dar
636k:border-purple-500/25 dark:bg-purple-500/15 dark:text-purple-300 dark:hover:bg-purple-500/25",TU="inline-flex items-center gap-1 rounded-full bg-white px-2 py-0.5 text-[10px] font-semibold text-slate-500 ring-1 ring-slate-200 dark:bg-white/5 dark:text-slate-400 dark:ring-white/10",$N=({icon:e,title:t,count:n})=>_.jsxs("h4",{className:"flex items-center gap-2 text-sm font-bold text-slate-900 dark:text-white",children:[_.jsx(e,{className:"h-4 w-4 text-slate-400 dark:text-slate-500",strokeWidth:2}),t,_.jsx("span",{className:"rounded-full bg-slate-100 px-2 py-0.5 text-[11px] font-semibold text-slate-500 dark:bg-white/10 dark:text-slate-400",children:n})]}),Iwe=({doc:e,onOpen:t})=>{const n=e.icon;return _.jsxs("li",{className:`${SU} w-[220px] shrink-0 snap-start p-3 sm:w-auto`,role:"button",tabIndex:0,"aria-label":`Open ${e.name} in the editor above`,onClick:t,onKeyDown:r=>{r.target===r.currentTarget&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t==null||t())},children:[_.jsxs("div",{className:"flex items-start justify-between gap-2",children:[_.jsx("span",{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border ${Swe}`,children:_.jsx(n,{className:"h-[18px] w-[18px]",strokeWidth:1.75})}),_.jsx("span",{className:`${TU} font-mono tracking-wide`,children:"DOCX"})]}),_.jsx("p",{lang:"en",className:"mt-3 hyphens-auto break-words text-[13px] font-semibold leading-snug text-slate-900 dark:text-white",children:e.name}),_.jsx("p",{className:"mt-1 flex-1 text-[11px] leading-snug text-slate-500 dark:text-slate-400",children:e.detail}),_.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-1",children:e.tags.map(r=>_.jsx("span",{className:AU,children:r},r))}),_.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[_.jsxs("button",{type:"button",title:`Open ${e.name} in the editor above`,className:Awe,onClick:r=>{r.stopPropagation(),t==null||t()},children:[_.jsx(Kp,{className:"h-3.5 w-3.5",strokeWidth:2.25}),"Open DOCX"]}),_.jsx("a",{href:e.file,download:!0,"aria-label":`Download ${e.name}`,title:`Download ${e.name}`,className:`${EU} group-hover:border-brand-500/40 group-hover:text-brand-600 dark:group-hover:border-brand-400/40 dark:group-hover:text-brand-400`,onClick:r=>r.stopPropagation(),children:_.jsx(FA,{className:"h-4 w-4",strokeWidth:2.25})})]})]})},Rwe=({item:e,onRun:t})=>{const n=e.icon,r=()=>t==null?void 0:t(e.promptFull),[i,o]=Se.useState(!1);Se.useEffect(()=>{if(!i)return;const l=window.setTimeout(()=>o(!1),1500);return()=>window.clearTimeout(l)},[i]);const s=async()=>{try{await navigator.clipboard.writeText(e.promptFull),o(!0)}catch{}};return _.jsxs("li",{className:`${SU} w-[220px] shrink-0 snap-start p-3 sm:w-auto`,role:"button",tabIndex:0,"aria-label":`Run prompt in the editor above: ${e.title}`,onClick:r,onKeyDown:l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},children:[_.jsxs("div",{className:"flex items-start justify-between gap-2",children:[_.jsx("span",{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border ${Ewe}`,children:_.jsx(n,{className:"h-[18px] w-[18px]",strokeWidth:1.75})}),_.jsx("span",{className:`${TU} font-mono tracking-wide`,children:"Prompt"})]}),_.jsx("h5",{className:"mt-3 text-[13px] font-semibold leading-snug text-slate-900 dark:text-white",children:e.title}),_.jsxs("p",{className:"mt-1 flex-1 text-[11px] leading-snug text-slate-500 dark:text-slate-400",children:["“",e.promptDisplay,"”"]}),_.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-1",children:e.tags.map(l=>_.jsx("span",{className:AU,children:l},l))}),_.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[_.jsxs("button",{type:"button",title:"Run this prompt in the editor",className:Twe,onClick:l=>{l.stopPropagation(),r()},children:[_.jsx(I_,{className:"h-3.5 w-3.5"}),"Run prompt"]}),_.jsx("button",{type:"button","aria-label":`Copy prompt: ${e.title}`,title:i?"Copied":"Copy prompt",className:EU,onClick:l=>{l.stopPropagation(),s()},children:i?_.jsx(E_,{className:"h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400"}):_.jsx(bD,{className:"h-3.5 w-3.5"})})]})]})},Owe="SuperDoc_TestKit_AdvancedTestDocuments.zip",Nwe=()=>{const e=Se.useRef(!1),t=async()=>
636{if(!e.current){e.current=!0;try{const[{zipSync:n},r]=await Promise.all([ag(()=>import("./browser-BzBbrBKd.js"),[]),Promise.all(h_.map(async l=>{const u=await fetch(l.file);if(!u.ok)throw new Error(`Could not fetch ${l.file} (${u.status})`);return[decodeURIComponent(l.file.split("/").pop()??`${l.id}.docx`),new Uint8Array(await u.arrayBuffer())]}))]),i=n(Object.fromEntries(r),{level:0}),o=URL.createObjectURL(new Blob([i],{type:"application/zip"})),s=document.createElement("a");s.href=o,s.download=Owe,document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(o),1e3)}catch(n){console.error("Download all failed",n),alert("Sorry, the test documents could not be downloaded. Please try again.")}finally{e.current=!1}}};return _.jsxs("button",{type:"button",onClick:t,title:`Download all ${h_.length} test documents as a zip`,className:bT,children:[_.jsx(FA,{className:"h-3.5 w-3.5",strokeWidth:2.25}),"Download all"]})},Mwe=({onOpenDocument:e})=>{const t=Se.useRef(null),n=r=>{var o;const i=(o=r.target.files)==null?void 0:o[0];if(r.target.value="",!!i){if(!/\.docx$/i.test(i.name)){alert("Please select a .docx file.");return}e==null||e({file:i,name:i.name.replace(/\.docx$/i,"")})}};return _.jsxs(_.Fragment,{children:[_.jsx("input",{ref:t,type:"file",accept:".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",className:"hidden",onChange:n}),_.jsxs("button",{type:"button",title:"Upload your own DOCX to the editor above",className:bT,onClick:()=>{var r;return(r=t.current)==null?void 0:r.click()},children:[_.jsx(VW,{className:"h-3.5 w-3.5",strokeWidth:2.25}),"Upload your own test docx"]})]})},Dwe=({onOpenDocument:e,onRunPrompt:t})=>_.jsx("section",{id:"test-it-out",className:"relative border-t border-slate-200 bg-gradient-to-b from-slate-100/80 via-slate-50 to-slate-50 py-20 transition-colors duration-300 dark:border-white/5 dark:from-dark-900 dark:via-dark-900 dark:to-dark-900 sm:py-24",children:_.jsxs("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:[_.jsxs("div",{className:"mx-auto mb-12 max-w-3xl text-center",children:[_.jsx("h2",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:"Test it out"}),_.jsx("h3",{className:"mb-6 text-3xl font-bold text-[#1f74dd] dark:text-white md:text-4xl",children:"Built for the hard cases"}),_.jsx("p",{className:"text-lg text-slate-600 dark:text-slate-400",children:"SuperDoc is built for enterprise-grade use and complex, real-world documents"})]}),_.jsxs("div",{className:"relative",children:[_.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 hidden -rotate-1 scale-[1.02] rounded-3xl bg-gradient-to-tr from-brand-500/15 via-sky-400/10 to-violet-500/15 blur-2xl dark:from-brand-500/10 dark:via-transparent dark:to-violet-500/10 sm:block"}),_.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-slate-200 bg-white text-left shadow-[0_18px_50px_-24px_rgba(19,85,255,0.35)] dark:border-white/10 dark:bg-dark-800 dark:shadow-none",children:[_.jsx("div",{className:"flex flex-wrap items-center justify-between gap-x-6 gap-y-3 border-b border-slate-200 bg-gradient-to-r from-brand-50/90 via-white to-violet-50/70 px-5 py-4 dark:border-white/10 dark:from-brand-500/10 dark:via-transparent dark:to-violet-500/10 sm:px-6",children:_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-brand-500 text-white shadow-[0_0_20px_rgba(19,85,255,0.35)]",children:_.jsx(wD,{className:"h-5 w-5",strokeWidth:2.25})}),_.jsxs("div",{children:[_.jsx("p",{className:"text-[15px] font-bold leading-tight text-slate-900 dark:text-white",children:"Test kit"}),_.jsx("p",{className:"mt-0.5 text-xs text-slate-500 dark:text-slate-400",children:"Test us out and see the SuperDoc difference"})]})]})}),_.jsxs("div",{className:"p-5 sm:p-6",children:[_.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[_.jsx($N,{icon:Kp,title:"Advanced test documents",count:h_.length}),_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_.jsx(Mwe,{onOpenDocument:e}),_.jsx(Nwe,{})]})]}),_.jsx("ul",{className:HN+" sm:grid-cols-2 xl:grid-cols-4",children:h_.map(n=>_.jsx(Iwe,{doc:n,onOpen:()=>e==null?void 0:e(n)},n.id))})]}),_.jsxs("div",{className:"border-t border-dotted border-slate-200 p-5 dark:border-white/10 sm:p-6",children:[_.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[_.jsx($N,{icon:Jf,title:"Advanced AI prompts",count:VN.length}),_.jsxs("a",{href:"https://docs.superdoc.dev/agents/build/build-an-agent/",target:"_blank",rel:"noopener noreferrer",title:"Learn how to build a DOCX agent with SuperDoc",className:bT,children:["View DOCX Agent docs",_.
636jsx(d2,{className:"h-3.5 w-3.5",strokeWidth:2.25})]})]}),_.jsx("ul",{className:HN+" sm:grid-cols-2 xl:grid-cols-4",children:VN.map(n=>_.jsx(Rwe,{item:n,onRun:t},n.id))})]}),_.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-slate-200 bg-slate-50/80 px-5 py-3 dark:border-white/10 dark:bg-white/[0.02] sm:px-6",children:_.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-slate-500 dark:text-slate-400",children:[_.jsx(xD,{className:"h-3.5 w-3.5 shrink-0"}),"Compare SuperDoc results with other DOCX solutions"]})})]})]})]})}),GN="superdoc-theme",Lwe="superdoc-banner-dismissed-document-engine",Pwe=!1,Bwe=()=>_.jsxs("span",{className:"block",children:[_.jsx("span",{className:"block font-semibold text-slate-900 dark:text-white",style:{fontSize:"16px"},children:"A document experience"}),_.jsx("span",{style:{fontSize:"14px"},children:"This is defined as one product feature powered by SuperDoc. Browser, desktop, and server-side uses count together when they support that same feature."}),_.jsxs("span",{className:"mt-2 flex items-start gap-2 rounded-xl bg-slate-50 px-3 py-2 text-[13px] leading-5 text-slate-700 dark:bg-white/5 dark:text-slate-200",children:[_.jsx(xD,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-[#6d5ce8] dark:text-brand-300"}),_.jsxs("span",{children:[_.jsx("span",{className:"font-medium",children:"Talk to us about Enterprise when:"})," SuperDoc will support multiple document experiences, a broader product or platform deployment, or requirements such as SLAs, deeper support, or custom commercial terms."]})]})]}),qN=({children:e,align:t="left",onClick:n})=>_.jsxs("span",{className:"group relative inline-block max-w-full cursor-pointer align-baseline",onClick:r=>{r.preventDefault(),r.stopPropagation(),n==null||n()},children:[_.jsx("span",{className:"underline decoration-dotted decoration-[#a78bfa] decoration-2 underline-offset-4 whitespace-normal break-words",children:e}),_.jsx("span",{className:`pointer-events-none absolute top-full z-30 mt-3 w-[34rem] max-w-[calc(100vw)] rounded-2xl border border-[#e9e4ff] bg-white p-4 text-sm leading-6 text-slate-700 shadow-[0_18px_50px_rgba(15,23,42,0.14)] opacity-0 transition-all duration-150 group-hover:visible group-hover:translate-y-0 group-hover:opacity-100 group-focus-within:visible group-focus-within:translate-y-0 group-focus-within:opacity-100 invisible translate-y-1 max-[999px]:hidden dark:border-white/10 dark:bg-dark-800 dark:text-slate-200 ${t==="right"?"right-0":"left-0"}`,children:_.jsxs("span",{className:"flex items-start gap-3",children:[_.jsx("span",{className:"flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-full bg-[#f1edff] text-[#5E5FEE]",children:_.jsx(f2,{className:"h-6 w-6 stroke-[1.8]"})}),_.jsx(Bwe,{})]})})]}),jwe=()=>_.jsxs("span",{className:"block",children:[_.jsx("span",{className:"block font-semibold text-slate-900 dark:text-white",style:{fontSize:"16px"},children:"Choosing the right plan"}),_.jsxs("span",{className:"mt-2 block text-[13px] leading-5 text-slate-700 dark:text-slate-200",children:[_.jsxs("span",{className:"block border-l-2 border-[#6d5ce8] dark:border-brand-400 bg-slate-50 dark:bg-white/5 pl-3 py-2 text-slate-600 dark:text-slate-300",children:[_.jsx("strong",{className:"text-[#6d5ce8] dark:text-brand-300",children:"A document experience"})," is defined as one product feature powered by SuperDoc."]}),_.jsx("span",{className:"mt-2 block",children:"Browser, desktop, and server-side uses count together when they support that same feature. A separate product feature, such as a template builder or standalone signing experience, counts as another document experience."})]}),_.jsx("span",{className:"mt-2 block",children:_.jsxs("span",{className:"block rounded-xl border border-[#e9e4ff] bg-[#f5f3ff] px-3 py-2.5 text-[13px] leading-5 text-slate-700 dark:border-white/10 dark:bg-white/5 dark:text-slate-200",children:[_.jsxs("span",{className:"mb-1 flex items-center gap-2 text-[16px]",children:[_.jsx(T_,{className:"h-4 w-4 flex-shrink-0 text-purple-500 dark:text-purple-400"}),_.jsx("span",{className:"font-normal text-slate-700 dark:text-slate-300 text-[15px]",children:"Talk to us about Enterprise when:"})]}),_.jsx("span",{className:"block",children:"SuperDoc will support multiple document experiences, a broader product or platform deployment, or requirements such as SLAs, deeper support, or custom commercial terms."})]})})]}),Fwe=()=>{const[e,t]=Se.useState(!1),[n,r]=Se.useState(!1),i=Se.useRef(null),o=Se.useRef(null),s=Se.useRef(null),l=Se.useRef(null),u=Se.useRef(null),d=Se.useRef(null),f=Se.useRef(null),[p,m]=Se.useState(""),[y,b]=Se.useState(!1),[k,S]=Se.useState(!1),[x,T]=Se.useState(!1),[C,I]=Se.useState(()=>!0),[D,P]=Se.useState(()=>{try{return localStorage.getItem(GN)==="dark"}catch{return!1}});Se.useEffect(()=>{D?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark");try{localStorage.setItem(GN,D?"dark":"light")}catch{}},[D]),Se.useEffect(()=>
636{const H=document.documentElement,te=new MutationObserver(()=>{const M=H.classList.contains("dark");P(Z=>Z!==M?M:Z)});return te.observe(H,{attributes:!0,attributeFilter:["class"]}),()=>te.disconnect()},[]),Se.useEffect(()=>{var M;const H=window.location.hash,te=new URLSearchParams(window.location.search).has("demo");if(H==="#editor"){const Z=document.getElementById("editor");Z&&Z.scrollIntoView({behavior:"instant",block:"start"})}else if(H==="#pricing"){const Z=document.getElementById("pricing");Z&&Z.scrollIntoView({behavior:"instant",block:"start"})}else if(H==="#examples"||H==="#demos"){const Z=document.getElementById("examples");Z&&Z.scrollIntoView({behavior:"instant",block:"start"})}else if(H==="#faq"){const Z=document.getElementById("faq");Z&&Z.scrollIntoView({behavior:"instant",block:"start"})}else if(H==="#test-it-out"){const Z=document.getElementById("test-it-out");Z&&Z.scrollIntoView({behavior:"instant",block:"start"})}else te&&((M=document.getElementById("examples"))==null||M.scrollIntoView({behavior:"instant",block:"start"}))},[]),Se.useEffect(()=>{let H;const te=()=>{document.documentElement.classList.add("scrollbar-visible"),clearTimeout(H),H=setTimeout(()=>{document.documentElement.classList.remove("scrollbar-visible")},1500)};return document.addEventListener("scroll",te,{capture:!0,passive:!0}),()=>{document.removeEventListener("scroll",te,{capture:!0}),clearTimeout(H)}},[]),Se.useEffect(()=>{const H=o.current;if(!H)return;const te=()=>{const Z=H.getBoundingClientRect(),W=Math.max(0,Math.min(Z.bottom,window.innerHeight-15)-Math.max(Z.top,0))>=150;r(W)};te();const M=new IntersectionObserver(()=>te(),{root:null,rootMargin:"0px",threshold:[0,.25,.5,.75,1]});return M.observe(H),window.addEventListener("scroll",te,{passive:!0}),window.addEventListener("resize",te),()=>{M.disconnect(),window.removeEventListener("scroll",te),window.removeEventListener("resize",te)}},[]),Se.useEffect(()=>{const H=s.current;if(!H)return;const te=()=>{const Z=H.getBoundingClientRect(),L=Z.top>=0&&Z.bottom<=window.innerHeight;t(W=>L&&!W?!0:!L&&W?!1:W)};te();const M=new IntersectionObserver(()=>te(),{root:null,rootMargin:"0px",threshold:[0,.25,.5,.75,1]});return M.observe(H),window.addEventListener("scroll",te,{passive:!0}),window.addEventListener("resize",te),()=>{M.disconnect(),window.removeEventListener("scroll",te),window.removeEventListener("resize",te)}},[]);const V=()=>P(H=>!H),ee=()=>{if(!l.current)return;const H=l.current.getBoundingClientRect().top+window.scrollY-80;window.scrollTo({top:H,behavior:"smooth"})},F=x&&n&&!e&&!k;return _.jsxs("div",{className:"min-h-screen bg-slate-50 dark:bg-dark-900 text-slate-600 dark:text-slate-200 font-sans transition-colors duration-300",children:[!C&&_.jsx(ZW,{onDismiss:()=>{I(!0);try{localStorage.setItem(Lwe,"true")}catch{}}}),_.jsx(TD,{isDark:D,toggleTheme:V,bannerVisible:!C}),!C&&_.jsx("div",{className:"h-[32px] sm:h-[40px]"}),_.jsxs("main",{children:[_.jsx(cwe,{editorSectionRef:i,demoContainerRef:o,promptContainerRef:s,insertAtTopRef:u,submitToChatRef:d,openDocumentRef:f,showDemoFloatingPrompt:n&&e,aiPromptValue:p,onAiPromptValueChange:m,isAiSubmitting:y,onAiSubmittingChange:b,onChatOpenChange:S,onDocumentLoadedChange:T}),_.jsx(Dwe,{onOpenDocument:H=>{var te;return(te=f.current)==null?void 0:te.call(f,H)},onRunPrompt:H=>{var te,M;(te=document.getElementById("editor"))==null||te.scrollIntoView({behavior:"smooth",block:"start"}),(M=d.current)==null||M.call(d,H)}}),Pwe,_.jsx(hwe,{}),_.jsx(vwe,{}),_.jsxs("section",{id:"pricing",className:"py-24 relative overflow-hidden",children:[_.jsx("div",{className:"absolute inset-0 bg-brand-100/50 dark:bg-brand-900/10 skew-y-3 transform origin-bottom-left scale-110"}),_.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10 text-center",children:[_.jsx("h2",{className:"text-3xl md:text-5xl font-bold text-[#1f74dd] dark:text-white mb-8",children:"Pricing"}),_.jsx("p",{className:"text-xl text-slate-600 dark:text-slate-400 mb-6 max-w-2xl mx-auto",children:"Simple, everything-included pricing. Built for how you build."}),_.jsxs("div",{className:"mb-10 max-w-2xl mx-auto px-6 py-6 rounded-2xl bg-white dark:bg-dark-800 border border-slate-200/70 dark:border-white/10 shadow-[0_8px_30px_-12px_rgba(19,85,255,0.3)] text-center",children:[_.jsxs("h3",{className:"flex items-center justify-center gap-2 text-base font-semibold tracking-wide text-purple-600 dar
636k:text-purple-400 mb-4",children:[_.jsx(SD,{className:"w-5 h-5 flex-shrink-0",strokeWidth:2}),"Every plan includes:"]}),_.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2 mb-4",children:["Unlimited documents","Unlimited users","Unlimited actions","All features included","All environments (QA, staging, prod)","Self-hosted"].map(H=>_.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-purple-50 dark:bg-purple-500/10 border border-purple-200/70 dark:border-purple-500/20 text-[13px] font-semibold text-purple-700 dark:text-purple-300",children:[_.jsx(dl,{className:"w-3.5 h-3.5 flex-shrink-0"}),H]},H))}),_.jsxs("p",{className:"text-sm text-slate-500 dark:text-slate-400 max-w-xl mx-auto",children:[_.jsx("strong",{children:"SuperDoc is a self-hosted component"})," for browsers, servers, and agentic workflows."]})]}),_.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-6",children:[_.jsxs("a",{href:"https://docs.superdoc.dev/",target:"_blank",rel:"noopener noreferrer",className:"bg-white dark:bg-dark-800 border border-slate-200 dark:border-white/5 p-6 rounded-xl text-left shadow-sm dark:shadow-none transition-colors flex flex-col cursor-pointer",children:[_.jsx(wq,{className:"w-8 h-8 text-purple-500 dark:text-purple-400 mb-4"}),_.jsx("h3",{className:"text-slate-900 dark:text-white font-bold mb-2",children:"Community"}),_.jsx("div",{className:"text-3xl font-bold text-slate-900 dark:text-white mb-1",children:"Free"}),_.jsx("p",{className:"text-slate-600 dark:text-slate-300 text-sm mb-1 min-h-[3.75rem]",children:"For open source software builders, hobbyists, and tinkerers"}),_.jsx("p",{className:"border-t border-slate-200 dark:border-white/5 mt-2 pt-2"}),_.jsxs("p",{className:"flex items-start gap-2 text-slate-600 dark:text-slate-400 text-base mt-2 min-h-[1.75rem]",children:[_.jsx(IS,{className:"w-5 h-5 mt-0.5 text-[#5E5FEE] dark:text-brand-400 flex-shrink-0 stroke-[1.75]"}),_.jsxs("span",{className:"text-[14px]",children:[_.jsx("span",{className:"font-medium",children:"License:"})," AGPLv3 (Open Source)"]})]}),_.jsxs("p",{className:"flex items-start gap-2 text-slate-600 dark:text-slate-400 text-base mb-1 min-h-[1.75rem]",children:[_.jsx(RS,{className:"w-5 h-5 mt-0.5 text-[#5E5FEE] dark:text-brand-400 flex-shrink-0 stroke-[1.75]"}),_.jsxs("span",{className:"text-[14px]",children:[_.jsx("span",{className:"font-medium",children:"Scope:"})," Testing and personal use"]})]}),_.jsxs("p",{className:"flex items-start gap-2 text-slate-600 dark:text-slate-400 text-base mb-4 min-h-[2.5rem]",children:[_.jsx(Hb,{className:"w-5 h-5 mt-0.5 text-[#5E5FEE] dark:text-brand-400 flex-shrink-0 stroke-[1.75]"}),_.jsxs("span",{className:"text-[14px]",children:[_.jsx("span",{className:"font-medium text-[14px]",children:"Support:"})," Community"]})]}),_.jsxs("ul",{className:"space-y-3 pt-4 border-t border-slate-200 dark:border-white/5",children:[_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Full DOCX editor, Document APIs, and AI Tools/CLI/SDK"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Tracked changes"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Threaded comments"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Real-time collaboration"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Run in-browser or on own server"})]})]}),_.jsx("span",{className:"block w-full mt-auto pt-[10px] mb-7",children:_.jsx("span",{className:"block w-full bg-[#5E5FEE] text-white py-3 rounded-lg font-bold hover:opacity-90 transition-all text-center select-none",children:"Get started"})})]}),_.jsxs("div",{role:"link",tabIndex:0,onClick:()=>window.open("https://docsend.com/v/wmyyp/sd-biztier-7day","_blank","noopener,noreferrer"),onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),window.open("https://docsend.com/v/wmyyp/sd-biztier-7day","_blank","noopener,noreferrer"))},className:"relative bg-white dark:bg-dark-800 border-2 border-blue-500 dark:border-blue-400 p-6 rounded-xl text-left shadow-sm dark:shadow-none transition-colors flex flex-col cursor-pointer",children:[_.jsx("span",{className:"absolute top-4 right-4 bg-blue-100 dar
636k:bg-blue-500/20 text-blue-600 dark:text-blue-300 text-xs font-semibold px-3 py-1 rounded-full select-none",children:"Most popular"}),_.jsx(AD,{className:"w-8 h-8 text-purple-500 dark:text-purple-400 mb-4"}),_.jsx("h3",{className:"text-slate-900 dark:text-white font-bold mb-2",children:"Business"}),_.jsxs("div",{className:"text-3xl font-bold text-slate-900 dark:text-white mb-1",children:["$6,000",_.jsx("span",{className:"text-base font-normal text-slate-500 ml-1",children:"/year"})]}),_.jsx("p",{className:"text-slate-600 dark:text-slate-300 text-sm mb-1 min-h-[3.75rem]",children:"Add SuperDoc into one production document experience running in the browser, on the server, or across both"}),_.jsx("p",{className:"border-t border-slate-200 dark:border-white/5 mt-2 pt-2"}),_.jsxs("p",{className:"flex items-start gap-2 text-slate-600 dark:text-slate-400 text-base mt-2 min-h-[1.75rem]",children:[_.jsx(IS,{className:"w-5 h-5 mt-0.5 text-[#5E5FEE] dark:text-brand-400 flex-shrink-0 stroke-[1.75]"}),_.jsxs("span",{className:"text-[14px]",children:[_.jsx("span",{className:"font-medium",children:"License:"})," Commercial"]})]}),_.jsxs("p",{className:"flex items-start gap-2 text-slate-600 dark:text-slate-400 text-base mb-1 min-h-[1.75rem]",children:[_.jsx(RS,{className:"w-5 h-5 mt-0.5 text-[#5E5FEE] dark:text-brand-400 flex-shrink-0 stroke-[1.75]"}),_.jsxs("span",{className:"text-[14px]",children:[_.jsx("span",{className:"font-medium",children:"Scope: "}),_.jsx(qN,{align:"right",onClick:ee,children:"1 production document experience"})]})]}),_.jsxs("p",{className:"flex items-start gap-2 text-slate-600 dark:text-slate-400 text-base mb-4 text-[14px] min-h-[2.5rem]",children:[_.jsx(Hb,{className:"w-5 h-5 mt-0.5 text-[#5E5FEE] dark:text-brand-400 flex-shrink-0 stroke-[1.75]"}),_.jsxs("span",{className:"text-[14px]",children:[_.jsx("span",{className:"font-medium",children:"Support:"})," Dedicated Slack channel"]})]}),_.jsxs("ul",{className:"space-y-3 pt-4 border-t border-slate-200 dark:border-white/5",children:[_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Everything in Community tier"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Unlimited editor customization"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Dedicated Slack channel with the SuperDoc team"})]})]}),_.jsxs("div",{className:"mt-auto pt-[10px]",children:[_.jsxs("a",{href:"https://docsend.com/v/wmyyp/sd-biztier-7day",target:"_blank",onClick:H=>{H.stopPropagation()},className:"flex items-center justify-center gap-2 w-full bg-blue-500 dark:bg-blue-400 text-white py-3 rounded-lg font-bold hover:opacity-90 transition-all text-center select-none",children:["Start free trial",_.jsx(Eq,{className:"w-4 h-4"})]}),_.jsxs("a",{href:"https://www.superdocportal.dev/contact",target:"_blank",onClick:H=>{H.stopPropagation()},className:"mt-3 block w-full text-center text-xs font-medium text-blue-700 dark:text-blue-400 hover:opacity-80 transition-opacity",children:[_.jsx("span",{className:"max-[999px]:hidden",children:"Questions before checkout? Contact us >"}),_.jsx("span",{className:"hidden max-[999px]:inline",children:"Questions? Contact us"})]})]})]}),_.jsxs("a",{href:"https://www.superdocportal.dev/enterprise-license",target:"_blank",rel:"noopener noreferrer",className:"bg-white dark:bg-dark-800 border border-slate-200 dark:border-white/5 p-6 rounded-xl text-left shadow-sm dark:shadow-none transition-colors flex flex-col cursor-pointer",children:[_.jsx(T_,{className:"w-8 h-8 text-purple-500 dark:text-purple-400 mb-4"}),_.jsx("h3",{className:"text-slate-900 dark:text-white font-bold mb-2",children:"Enterprise"}),_.jsx("div",{className:"text-3xl font-bold text-slate-900 dark:text-white mb-1",children:"Talk to us"}
636),_.jsx("p",{className:"text-slate-600 dark:text-slate-300 text-sm mb-1 min-h-[3.75rem]",children:"Build SuperDoc into broader product and platform deployments across multiple experiences or products"}),_.jsx("p",{className:"border-t border-slate-200 dark:border-white/5 mt-2 pt-2"}),_.jsxs("p",{className:"flex items-start gap-2 text-slate-600 dark:text-slate-400 text-base mt-2 min-h-[1.75rem]",children:[_.jsx(IS,{className:"w-5 h-5 mt-0.5 text-[#5E5FEE] dark:text-brand-400 flex-shrink-0 stroke-[1.75]"}),_.jsxs("span",{className:"text-[14px]",children:[_.jsx("span",{className:"font-medium",children:"License:"})," Commercial (with custom enterprise terms)"]})]}),_.jsxs("p",{className:"flex items-start gap-2 text-slate-600 dark:text-slate-400 text-base mb-1 min-h-[1.75rem]",children:[_.jsx(RS,{className:"w-5 h-5 mt-0.5 text-[#5E5FEE] dark:text-brand-400 flex-shrink-0 stroke-[1.75]"}),_.jsxs("span",{className:"text-[14px]",children:[_.jsx("span",{className:"font-medium",children:"Scope: "}),_.jsx(qN,{align:"right",onClick:ee,children:"Multiple production document experiences or platform-wide"})]})]}),_.jsxs("p",{className:"flex items-start gap-2 text-slate-600 dark:text-slate-400 text-base mb-4 min-h-[2.5rem]",children:[_.jsx(Hb,{className:"w-5 h-5 mt-0.5 text-[#5E5FEE] dark:text-brand-400 flex-shrink-0 stroke-[1.75]"}),_.jsxs("span",{className:"text-[14px]",children:[_.jsx("span",{className:"font-medium",children:"Support:"})," Dedicated Slack channel with SLA options"]})]}),_.jsxs("ul",{className:"space-y-3 pt-4 border-t border-slate-200 dark:border-white/5 pb-[30px]",children:[_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Everything in Business tier"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Contracted enterprise response and escalation times"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Security and procurement support"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Technical implementation guidance"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Priority roadmap input"})]}),_.jsxs("li",{className:"flex items-center gap-2 text-sm text-slate-600 dark:text-slate-300",children:[_.jsx(dl,{className:"w-4 h-4 text-brand-500 flex-shrink-0"}),_.jsx("span",{children:"Custom commercial and legal terms"})]})]}),_.jsx("span",{className:"block w-full mt-auto mb-7 bg-[#5E5FEE] text-white py-3 rounded-lg font-bold hover:opacity-90 transition-all text-center select-none",children:"Get in touch"})]})]}),_.jsx("div",{ref:l,className:"w-full rounded-2xl border border-slate-200 bg-white p-6 text-left shadow-sm dark:border-white/5 dark:bg-dark-800/80",children:_.jsxs("div",{className:"flex items-start gap-4",children:[_.jsx("div",{className:"flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-full bg-[#f1edff] text-[#5E5FEE]",children:_.jsx(f2,{className:"h-6 w-6 stroke-[1.8]"})}),_.jsx(jwe,{})]})})]})]}),_.jsx(Cwe,{}),_.jsx(wwe,{})]}),_.jsx("div",{className:"fixed left-0 right-0 flex justify-center pointer-events-none z-30",style:{bottom:"12px",width:"100vw",height:"46px",marginRight:"50px",display:F?"flex":"none"},children:_.jsx("div",{className:"pointer-events-auto w-full max-w-xl px-4 flex justify-center",children:_.jsx(_U,{visible:F,value:p,onValueChange:m,onSubmitToChat:H=>{var te;return(te=d.current)==null?void 0:te.call(d,H)},isSubmitting:y,onSubmittingChange:b})})}),_.jsx(CU,{})]})},wT="/changelog";function IU(e){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}function p_(e){return`${wT}/${e}`}function RU(){const e=window.__CHANGELOG_DATA__;return e&&delete window.__CHANGELOG_DATA__,e}async function OU(){const e=await fetch(`${wT}/index.json`);if(!e.ok)throw new Error("Failed to load changelog index");return[...(await e.json()).posts].sort((n,r)=>new Date(r.date).getTime()-new Date(n.date).getTime())}function zwe(){var t;const e=RU();return(t=e==null?void 0:e.posts)!=null&&t.length?e.posts:[]}function Uwe(){const[e]=Se.useState(zwe),[t,n]=Se.useState(e),[r,i]=Se.useState(e.length===0),[o,s]=Se.useState(null);return Se.useEffect(()=>{e.length>0||OU().then(n).catch(l=>s(l.message)).finally(()=>i(!1))},[]),_.jsxs("div",{className:"max-w-[680px] mx-auto px-6 pt-32 pb-24",children:[_.jsxs("header",{className:"mb-14 text-center",children:[_.jsx("h2",{className:"text-brand-600 dark:text-brand-400 font-semibold tracking-wide uppercase text-sm mb-3",children:"Changelog"}),_.jsx("h1",{className:"text-3xl md:text-4xl font-bold gradient-text tracking-tight mb-3",children:"What's new in SuperDoc"}),_.jsx("p",{className:"text-lg text-slate-500 dark:text-slate-400",children:"New updates and improvements to SuperDoc."})]}),r&&_.jsx("p",{className:"text-slate-400 dark:text-slate-500 text-sm",children:"Loading..."}),o&&_.jsx("p",{className:"text-red-500 text-sm",children:o}),_.jsx("div",{children:t.map((l,u)=>_.jsxs("article",{className:`py-10 ${u>0?"border-t border-slate-200 dark:border-white/5":""}`,children:[_.jsx("time",{className:"block text-sm font-medium text-brand-600 dark:text-brand-400 uppercase tracking-wide mb-4",children:IU(l.date)}),l.image&&_.jsx(zp,{to:`/changelog/${l.id}`,className:"block rounded-xl border border-slate-200 dark:border-white/5 overflow-hidden mb-5 hover:shadow-md transition-shadow",children:_.jsx("img",{src:p_(l.image),alt:l.title,className:"w-full h-auto",loading:"lazy"})}),_.jsx("h2",{className:"mb-2",children:_.jsx(zp,{to:`/changelog/${l.id}`,className:"text-2xl font-bold text-slate-900 dark:text-white tracking-tight leading-snug hover:text-[#1355FF] dark:hover:text-[#6B9FFF] transition-colors",children:l.title})}),_.jsx("p",{className:"text-base text-slate-500 dark:text-slate-400 leading-relaxed max-w-[580px]",children:l.description}),_.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[l.author.avatar?_.jsx("img",{src:p_(l.author.avatar),alt:l.author.name,className:"w-6 h-6 rounded-full object-cover"}):_.jsx("div",{className:"w-6 h-6 rounded-full bg-gradient-to-br from-[#1355FF] to-[#9333ea] flex-shrink-0"}),_.jsx("span",{className:"text-[13px] font-medium text-slate-400 dark:text-slate-500",children:l.author.name})]})]},l.id))})]})}function Vwe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Hwe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$we=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gwe={};function WN(e,t){return(Gwe.jsx?$we:Hwe).test(e)}const qwe=/[ \t\n\f\r]/g;function Wwe(e){return typeof e=="object"?e.type==="text"?KN(e.value):!1:KN(e)}function KN(e){return e.replace(qwe,"")===""}
vendor: 5,433 bytes, line 636
636class I2{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}I2.prototype.normal={};I2.prototype.property={};I2.prototype.space=void 0;function NU(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new I2(n,r,t)}function bA(e){return e.toLowerCase()}class tc{constructor(t,n){this.attribute=n,this.property=t}}tc.prototype.attribute="";tc.prototype.booleanish=!1;tc.prototype.boolean=!1;tc.prototype.commaOrSpaceSeparated=!1;tc.prototype.commaSeparated=!1;tc.prototype.defined=!1;tc.prototype.mustUseProperty=!1;tc.prototype.number=!1;tc.prototype.overloadedBoolean=!1;tc.prototype.property="";tc.prototype.spaceSeparated=!1;tc.prototype.space=void 0;let Kwe=0;const Vr=Ng(),Bs=Ng(),wA=Ng(),wn=Ng(),uo=Ng(),mg=Ng(),bc=Ng();function Ng(){return 2**++Kwe}const xA=Object.freeze(Object.defineProperty({__proto__:null,boolean:Vr,booleanish:Bs,commaOrSpaceSeparated:bc,commaSeparated:mg,number:wn,overloadedBoolean:wA,spaceSeparated:uo},Symbol.toStringTag,{value:"Module"})),o4=Object.keys(xA);class xT extends tc{constructor(t,n,r,i){let o=-1;if(super(t,n),YN(this,"space",i),typeof r=="number")for(;++o<o4.length;){const s=o4[o];YN(this,o4[o],(r&xA[s])===xA[s])}}}xT.prototype.defined=!0;function YN(e,t,n){n&&(e[t]=n)}function iv(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new xT(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[bA(r)]=r,n[bA(o.attribute)]=r}return new I2(t,n,e.space)}const MU=iv({properties:{ariaActiveDescendant:null,ariaAtomic:Bs,ariaAutoComplete:null,ariaBusy:Bs,ariaChecked:Bs,ariaColCount:wn,ariaColIndex:wn,ariaColSpan:wn,ariaControls:uo,ariaCurrent:null,ariaDescribedBy:uo,ariaDetails:null,ariaDisabled:Bs,ariaDropEffect:uo,ariaErrorMessage:null,ariaExpanded:Bs,ariaFlowTo:uo,ariaGrabbed:Bs,ariaHasPopup:null,ariaHidden:Bs,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:uo,ariaLevel:wn,ariaLive:null,ariaModal:Bs,ariaMultiLine:Bs,ariaMultiSelectable:Bs,ariaOrientation:null,ariaOwns:uo,ariaPlaceholder:null,ariaPosInSet:wn,ariaPressed:Bs,ariaReadOnly:Bs,ariaRelevant:null,ariaRequired:Bs,ariaRoleDescription:uo,ariaRowCount:wn,ariaRowIndex:wn,ariaRowSpan:wn,ariaSelected:Bs,ariaSetSize:wn,ariaSort:null,ariaValueMax:wn,ariaValueMin:wn,ariaValueNow:wn,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function DU(e,t){return t in e?e[t]:t}function LU(e,t){return DU(e,t.toLowerCase())}const Ywe=iv({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mg,acceptCharset:uo,accessKey:uo,action:null,allow:null,allowFullScreen:Vr,allowPaymentRequest:Vr,allowUserMedia:Vr,alpha:Vr,alt:null,as:null,async:Vr,autoCapitalize:null,autoComplete:uo,autoFocus:Vr,autoPlay:Vr,blocking:uo,capture:null,charSet:null,checked:Vr,cite:null,className:uo,closedBy:null,colorSpace:null,cols:wn,colSpan:wn,command:null,commandFor:null,content:null,contentEditable:Bs,controls:Vr,controlsList:uo,coords:wn|mg,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Vr,defer:Vr,dir:null,dirName:null,disabled:Vr,download:wA,draggable:Bs,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Vr,formTarget:null,headers:uo,height:wn,hidden:wA,high:wn,href:null,hrefLang:null,htmlFor:uo,httpEquiv:uo,id:null,imageSizes:null,imageSrcSet:null,inert:Vr,inputMode:null,integrity:null,is:null,isMap:Vr,itemId:null,itemProp:uo,itemRef:uo,itemScope:Vr,itemType:uo,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Vr,low:wn,manifest:null,max:null,maxLength:wn,media:null,method:null,min:null,minLength:wn,multiple:Vr,muted:Vr,name:null,nonce:null,noModule:Vr,noValidate:Vr,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Vr,optimum:wn,pattern:null,ping:uo,placeholder:null,playsInl
636ine:Vr,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Vr,referrerPolicy:null,rel:uo,required:Vr,reversed:Vr,rows:wn,rowSpan:wn,sandbox:uo,scope:null,scoped:Vr,seamless:Vr,selected:Vr,shadowRootClonable:Vr,shadowRootCustomElementRegistry:Vr,shadowRootDelegatesFocus:Vr,shadowRootMode:null,shadowRootSerializable:Vr,shape:null,size:wn,sizes:null,slot:null,span:wn,spellCheck:Bs,src:null,srcDoc:null,srcLang:null,srcSet:null,start:wn,step:null,style:null,tabIndex:wn,target:null,title:null,translate:null,type:null,typeMustMatch:Vr,useMap:null,value:Bs,width:wn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:uo,axis:null,background:null,bgColor:null,border:wn,borderColor:null,bottomMargin:wn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Vr,declare:Vr,event:null,face:null,frame:null,frameBorder:null,hSpace:wn,leftMargin:wn,link:null,longDesc:null,lowSrc:null,marginHeight:wn,marginWidth:wn,noResize:Vr,noHref:Vr,noShade:Vr,noWrap:Vr,object:null,profile:null,prompt:null,rev:null,rightMargin:wn,rules:null,scheme:null,scrolling:Bs,standby:null,summary:null,text:null,topMargin:wn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:wn,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Vr,disablePictureInPicture:Vr,disableRemotePlayback:Vr,exportParts:mg,part:uo,prefix:null,property:null,results:wn,security:null,unselectable:null},space:"html",transform:LU}),Xwe=iv({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
636-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bc,accentHeight:wn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:wn,amplitude:wn,arabicForm:null,ascent:wn,attributeName:null,attributeType:null,azimuth:wn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:wn,by:null,calcMode:null,capHeight:wn,className:uo,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:wn,diffuseConstant:wn,direction:null,display:null,dur:null,divisor:wn,dominantBaseline:null,download:Vr,dx:null,dy:null,edgeMode:null,editable:null,elevation:wn,enableBackground:null,end:null,event:null,exponent:wn,externalResourcesRequired:null,fill:null,fillOpacity:wn,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:mg,g2:mg,glyphName:mg,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:wn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:wn,horizOriginX:wn,horizOriginY:wn,id:null,ideographic:wn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:wn,k:wn,k1:wn,k2:wn,k3:wn,k4:wn,kernelMatrix:bc,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:wn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:wn,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
vendor: 5,591 bytes, lines 636-637
636Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:wn,overlineThickness:wn,paintOrder:null,panose1:null,path:null,pathLength:wn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:uo,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:wn,pointsAtY:wn,pointsAtZ:wn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bc,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bc,rev:bc,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bc,requiredFeatures:bc,requiredFonts:bc,requiredFormats:bc,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:wn,specularExponent:wn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:wn,strikethroughThickness:wn,string:null,stroke:null,strokeDashArray:bc,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:wn,strokeOpacity:wn,strokeWidth:null,style:null,surfaceScale:wn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bc,tabIndex:wn,tableValues:null,target:null,targetX:wn,targetY:wn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bc,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:wn,underlineThickness:wn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:wn,values:null,vAlphabetic:wn,vMathematical:wn,vectorEffect:null,vHanging:wn,vIdeographic:wn,version:null,vertAdvY:wn,vertOriginX:wn,vertOriginY:wn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:wn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:DU}),PU=iv({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),BU=iv({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:LU}),jU=iv({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Zwe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Qwe=/[A-Z]/g,XN=/-[a-z]/g,Jwe=/^data[-\w.:]+$/i;function exe(e,t){const n=bA(t);let r=t,i=tc;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Jwe.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(XN,nxe);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!XN.test(o)){let s=o.replace(Qwe,txe);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=xT}return new i(r,t)}function txe(e){return"-"+e.toLowerCase()}function nxe(e){return e.charAt(1).toUpperCase()}const rxe=NU([MU,Ywe,PU,BU,jU],"html"),kT=NU([MU,Xwe,PU,BU,jU],"svg");function ixe(e){return e.join(" ").trim()}var I0={},s4,ZN;function oxe(){if(ZN)return s4;ZN=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
637`,d="/",f="*",p="",m="comment",y="declaration";function b(S,x){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];x=x||{};var T=1,C=1;function I(L){var W=L.match(t);W&&(T+=W.length);var U=L.lastIndexOf(u);C=~U?L.length-U:C+L.length}function D(){var L={line:T,column:C};return function(W){return W.position=new P(L),F(),W}}function P(L){this.start=L,this.end={line:T,column:C},this.source=x.source}P.prototype.content=S;function V(L){var W=new Error(x.source+":"+T+":"+C+": "+L);if(W.reason=L,W.filename=x.source,W.line=T,W.column=C,W.source=S,!x.silent)throw W}function ee(L){var W=L.exec(S);if(W){var U=W[0];return I(U),S=S.slice(U.length),W}}function F(){ee(n)}function H(L){var W;for(L=L||[];W=te();)W!==!1&&L.push(W);return L}function te(){var L=D();if(!(d!=S.charAt(0)||f!=S.charAt(1))){for(var W=2;p!=S.charAt(W)&&(f!=S.charAt(W)||d!=S.charAt(W+1));)++W;if(W+=2,p===S.charAt(W-1))return V("End of comment missing");var U=S.slice(2,W-2);return C+=2,I(U),S=S.slice(W),C+=2,L({type:m,comment:U})}}function M(){var L=D(),W=ee(r);if(W){if(te(),!ee(i))return V("property missing ':'");var U=ee(o),q=L({type:y,property:k(W[0].replace(e,p)),value:U?k(U[0].replace(e,p)):p});return ee(s),q}}function Z(){var L=[];H(L);for(var W;W=M();)W!==!1&&(L.push(W),H(L));return L}return F(),Z()}function k(S){return S?S.replace(l,p):p}return s4=b,s4}var QN;function sxe(){if(QN)return I0;QN=1;var e=I0&&I0.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(I0,"__esModule",{value:!0}),I0.default=n;const t=e(oxe());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const s=(0,t.default)(r),l=typeof i=="function";
vendor: 3,540 bytes, line 637
637return s.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:f}=u;l?i(d,f,u):f&&(o=o||{},o[d]=f)}),o}return I0}var mb={},JN;function axe(){if(JN)return mb;JN=1,Object.defineProperty(mb,"__esModule",{value:!0}),mb.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},s=function(d,f){return f.toUpperCase()},l=function(d,f){return"".concat(f,"-")},u=function(d,f){return f===void 0&&(f={}),o(d)?d:(d=d.toLowerCase(),f.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(t,s))};return mb.camelCase=u,mb}var gb,eM;function lxe(){if(eM)return gb;eM=1;var e=gb&&gb.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(sxe()),n=axe();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(s[(0,n.camelCase)(l,o)]=u)}),s}return r.default=r,gb=r,gb}var cxe=lxe();const uxe=a2(cxe),FU=zU("end"),_T=zU("start");function zU(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function dxe(e){const t=_T(e),n=FU(e);if(t&&n)return{start:t,end:n}}function d1(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?tM(e.position):"start"in e||"end"in e?tM(e):"line"in e||"column"in e?kA(e):""}function kA(e){return nM(e&&e.line)+":"+nM(e&&e.column)}function tM(e){return kA(e&&e.start)+"-"+kA(e&&e.end)}function nM(e){return e&&typeof e=="number"?e:1}class Qa extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=d1(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qa.prototype.file="";Qa.prototype.name="";Qa.prototype.reason="";Qa.prototype.message="";Qa.prototype.stack="";Qa.prototype.column=void 0;Qa.prototype.line=void 0;Qa.prototype.ancestors=void 0;Qa.prototype.cause=void 0;Qa.prototype.fatal=void 0;Qa.prototype.place=void 0;Qa.prototype.ruleId=void 0;Qa.prototype.source=void 0;const CT={}.hasOwnProperty,fxe=new Map,hxe=/[A-Z]/g,pxe=new Set(["table","tbody","thead","tfoot","tr"]),mxe=new Set(["td","th"]),UU="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function gxe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Cxe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 5,879 bytes, line 637
637if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_xe(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?kT:rxe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=VU(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function VU(e,t,n){if(t.type==="element")return yxe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return vxe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return wxe(e,t,n);if(t.type==="mdxjsEsm")return bxe(e,t);if(t.type==="root")return xxe(e,t,n);if(t.type==="text")return kxe(e,t)}function yxe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=kT,e.schema=i),e.ancestors.push(t);const o=$U(e,t.tagName,!1),s=Sxe(e,t);let l=ET(e,t);return pxe.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Wwe(u):!0})),HU(e,s,o,t),ST(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function vxe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Q1(e,t.position)}function bxe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Q1(e,t.position)}function wxe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=kT,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:$U(e,t.name,!0),s=Exe(e,t),l=ET(e,t);return HU(e,s,o,t),ST(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function xxe(e,t,n){const r={};return ST(r,ET(e,t)),e.create(t,e.Fragment,r,n)}function kxe(e,t){return t.value}function HU(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ST(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _xe(e,t,n){return r;function r(i,o,s,l){const d=Array.isArray(s.children)?n:t;return l?d(o,s,l):d(o,s)}}function Cxe(e,t){return n;function n(r,i,o,s){const l=Array.isArray(o.children),u=_T(r);return t(i,o,s,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Sxe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&CT.call(t.properties,i)){const o=Axe(e,i,t.properties[i]);if(o){const[s,l]=o;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&mxe.has(t.tagName)?r=l:n[s]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Exe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Q1(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Q1(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function ET(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:fxe;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const d=i.get(u)||0;s=u+"-"+d,i.set(u,d+1)}}const l=VU(e,o,s);l!==void 0&&n.push(l)}return n}function Axe(e,t,n){const r=exe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Vwe(n):ixe(n)),r.property==="style"){let i=typeof n=="object"?n:Txe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Ixe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Zwe[r.property]||r.property:r.attribute,n]}}function Txe(e,t){try{return uxe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Qa("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=UU+"#cannot-parse-style-attribute",i}}function $U(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const l=WN(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}r=s}else r=WN(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return CT.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Q1(e)}function Q1(e,t){const n=new Qa("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=UU+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ixe(e){const t={};let n;for(n in e)CT.call(e,n)&&(t[Rxe(n)]=e[n]);return t}function Rxe(e){let t=e.replace(hxe,Oxe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Oxe(e){return"-"+e.toLowerCase()}const a4={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Nxe={};function AT(e,t){const n=Nxe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;
vendor: 13,526 bytes, line 637
637return GU(e,r,i)}function GU(e,t,n){if(Mxe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return rM(e.children,t,n)}return Array.isArray(e)?rM(e,t,n):""}function rM(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=GU(e[i],t,n);return r.join("")}function Mxe(e){return!!(e&&typeof e=="object")}const iM=document.createElement("i");function TT(e){const t="&"+e+";";iM.innerHTML=t;const n=iM.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Tc(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function ou(e,t){return e.length>0?(Tc(e,e.length,0,t),e):t}const oM={}.hasOwnProperty;function qU(e){const t={};let n=-1;for(;++n<e.length;)Dxe(t,e[n]);return t}function Dxe(e,t){let n;for(n in t){const i=(oM.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){oM.call(i,s)||(i[s]=[]);const l=o[s];Lxe(i[s],Array.isArray(l)?l:l?[l]:[])}}}function Lxe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Tc(e,0,0,r)}function WU(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function zu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Cl=om(/[A-Za-z]/),Xa=om(/[\dA-Za-z]/),Pxe=om(/[#-'*+\--9=?A-Z^-~]/);function m_(e){return e!==null&&(e<32||e===127)}const _A=om(/\d/),Bxe=om(/[\dA-Fa-f]/),jxe=om(/[!-/:-@[-`{-~]/);function Ar(e){return e!==null&&e<-2}function ho(e){return e!==null&&(e<0||e===32)}function mi(e){return e===-2||e===-1||e===32}const EC=om(new RegExp("\\p{P}|\\p{S}","u")),kg=om(/\s/);function om(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ov(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Xa(e.charCodeAt(n+1))&&Xa(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(s=String.fromCharCode(o,l),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ii(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return mi(u)?(e.enter(n),l(u)):t(u)}function l(u){return mi(u)&&o++<i?(e.consume(u),l):(e.exit(n),t(u))}}const Fxe={tokenize:zxe};function zxe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ii(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ar(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),s)}}const Uxe={tokenize:Vxe},sM={tokenize:Hxe};function Vxe(e){const t=this,n=[];let r=0,i,o,s;return l;function l(C){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,u,d)(C)}return d(C)}function u(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&T();const I=t.events.length;let D=I,P;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){P=t.events[D][1].end;break}x(r);let V=I;for(;V<t.events.length;)t.events[V][1].end={...P},V++;return Tc(t.events,D+1,0,t.events.slice(I)),t.events.length=V,d(C)}return l(C)}function d(C){if(r===n.length){if(!i)return m(C);if(i.currentConstruct&&i.currentConstruct.concrete)return b(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(sM,f,p)(C)}function f(C){return i&&T(),x(r),m(C)}function p(C){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,b(C)}function m(C){return t.containerState={},e.attempt(sM,y,b)(C)}function y(C){return r++,n.push([t.currentConstruct,t.containerState]),m(C)}function b(C){if(C===null){i&&T(),x(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),k(C)}function k(C){if(C===null){S(e.exit("chunkFlow"),!0),x(0),e.consume(C);return}return Ar(C)?(e.consume(C),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(C),k)}function S(C,I){const D=t.sliceStream(C);if(I&&D.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(D),t.parser.lazy[C.start.line]){let P=i.events.length;for(;P--;)if(i.events[P][1].start.offset<s&&(!i.events[P][1].end||i.events[P][1].end.offset>s))return;const V=t.events.length;let ee=V,F,H;for(;ee--;)if(t.events[ee][0]==="exit"&&t.events[ee][1].type==="chunkFlow"){if(F){H=t.events[ee][1].end;break}F=!0}for(x(r),P=V;P<t.events.length;)t.events[P][1].end={...H},P++;Tc(t.events,ee+1,0,t.events.slice(V)),t.events.length=P}}function x(C){let I=n.length;for(;I-- >C;){const D=n[I];t.containerState=D[1],D[0].exit.call(t,e)}n.length=C}function T(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Hxe(e,t,n){return Ii(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function zy(e){if(e===null||ho(e)||kg(e))return 1;if(EC(e))return 2}function AC(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const CA={name:"attention",resolveAll:$xe,tokenize:Gxe};function $xe(e,t){let n=-1,r,i,o,s,l,u,d,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};aM(p,-u),aM(m,u),s={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=ou(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=ou(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=ou(d,AC(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=ou(d,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,d=ou(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Tc(e,r-1,n-r+3,d),n=r+d.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Gxe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=zy(r);let o;return s;function s(u){return o=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===o)return e.consume(u),l;const d=e.exit("attentionSequence"),f=zy(u),p=!f||f===2&&i||n.includes(u),m=!i||i===2&&f||n.includes(r);return d._open=!!(o===42?p:p&&(i||!m)),d._close=!!(o===42?m:m&&(f||!p)),t(u)}}function aM(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const qxe={name:"autolink",tokenize:Wxe};function Wxe(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return Cl(y)?(e.consume(y),s):y===64?n(y):d(y)}function s(y){return y===43||y===45||y===46||Xa(y)?(r=1,l(y)):d(y)}function l(y){return y===58?(e.consume(y),r=0,u):(y===43||y===45||y===46||Xa(y))&&r++<32?(e.consume(y),l):(r=0,d(y))}function u(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||m_(y)?n(y):(e.consume(y),u)}function d(y){return y===64?(e.consume(y),f):Pxe(y)?(e.consume(y),d):n(y)}function f(y){return Xa(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,f):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):m(y)}function m(y){if((y===45||Xa(y))&&r++<63){const b=y===45?m:p;return e.consume(y),b}return n(y)}}const R2={partial:!0,tokenize:Kxe};function Kxe(e,t,n){return r;function r(o){return mi(o)?Ii(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ar(o)?t(o):n(o)}}const KU={continuation:{tokenize:Xxe},exit:Zxe,name:"blockQuote",tokenize:Yxe};function Yxe(e,t,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return mi(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Xxe(e,t,n){const r=this;return i;function i(s){return mi(s)?Ii(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(KU,t,n)(s)}}function Zxe(e){e.exit("blockQuote")}const YU={name:"characterEscape",tokenize:Qxe};function Qxe(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return jxe(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const XU={name:"characterReference",tokenize:Jxe};function Jxe(e,t,n){const r=this;let i=0,o,s;return l;function l(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),u}function u(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,s=Xa,f(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=Bxe,f):(e.enter("characterReferenceValue"),o=7,s=_A,f(p))}function f(p){if(p===59&&i){const m=e.exit("characterReferenceValue");return s===Xa&&!TT(r.sliceSerialize(m))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(p)&&i++<o?(e.consume(p),f):n(p)}}const lM={partial:!0,tokenize:tke},cM={concrete:!0,name:"codeFenced",tokenize:eke};function eke(e,t,n){const r=this,i={partial:!0,tokenize:D};let o=0,s=0,l;return u;function u(P){return d(P)}function d(P){const V=r.events[r.events.length-1];return o=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,l=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(P)}function f(P){return P===l?(s++,e.consume(P),f):s<3?n(P):(e.exit("codeFencedFenceSequence"),mi(P)?Ii(e,p,"whitespace")(P):p(P))}function p(P){return P===null||Ar(P)?(e.exit("codeFencedFence"),r.interrupt?t(P):e.check(lM,k,I)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(P))}function m(P){return P===null||Ar(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(P)):mi(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ii(e,y,"whitespace")(P)):P===96&&P===l?n(P):(e.consume(P),m)}function y(P){return P===null||Ar(P)?p(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(P))}function b(P){return P===null||Ar(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(P)):P===96&&P===l?n(P):(e.consume(P),b)}function k(P){return e.attempt(i,I,S)(P)}function S(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),x}function x(P){return o>0&&mi(P)?Ii(e,T,"linePrefix",o+1)(P):T(P)}function T(P){return P===null||Ar(P)?e.check(lM,k,I)(P):(e.enter("codeFlowValue"),C(P))}function C(P){return P===null||Ar(P)?(e.exit("codeFlowValue"),T(P)):(e.consume(P),C)}function I(P){return e.exit("codeFenced"),t(P)}function D(P,V,ee){let F=0;return H;function H(W){return P.enter("lineEnding"),P.consume(W),P.exit("lineEnding"),te}function te(W){return P.enter("codeFencedFence"),mi(W)?Ii(P,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):M(W)}function M(W){return W===l?(P.enter("codeFencedFenceSequence"),Z(W)):ee(W)}function Z(W){return W===l?(F++,P.consume(W),Z):F>=s?(P.exit("codeFencedFenceSequence"),mi(W)?Ii(P,L,"whitespace")(W):L(W)):ee(W)}function L(W){return W===null||Ar(W)?(P.exit("codeFencedFence"),V(W)):ee(W)}}}function tke(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const l4={name:"codeIndented",tokenize:rke},nke={partial:!0,tokenize:ike};function rke(e,t,n){const r=this;return i;
vendor: 20,221 bytes, line 637
637function i(d){return e.enter("codeIndented"),Ii(e,o,"linePrefix",5)(d)}function o(d){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?u(d):Ar(d)?e.attempt(nke,s,u)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||Ar(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),l)}function u(d){return e.exit("codeIndented"),t(d)}}function ike(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ar(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Ii(e,o,"linePrefix",5)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):Ar(s)?i(s):n(s)}}const oke={name:"codeText",previous:ake,resolve:ske,tokenize:lke};function ske(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ake(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function lke(e,t,n){let r=0,i,o;return s;function s(p){return e.enter("codeText"),e.enter("codeTextSequence"),l(p)}function l(p){return p===96?(e.consume(p),r++,l):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(o=e.enter("codeTextSequence"),i=0,f(p)):Ar(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||Ar(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),d)}function f(p){return p===96?(e.consume(p),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(o.type="codeTextData",d(p))}}class cke{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&yb(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),yb(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),yb(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);yb(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);yb(this.left,n.reverse())}}}function yb(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ZU(e){const t={};let n=-1,r,i,o,s,l,u,d;const f=new cke(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,uke(f,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},l=f.slice(i,n),l.unshift(r),f.splice(i,n-i+1,l))}}return Tc(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!d}function uke(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,u=[],d={};let f,p,m=-1,y=n,b=0,k=0;const S=[k];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),y._tokenizer||(f=r.sliceStream(y),y.next||f.push(null),p&&s.defineSkip(y.start),y._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),y._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++m<l.length;)l[m][0]==="exit"&&l[m-1][0]==="enter"&&l[m][1].type===l[m-1][1].type&&l[m][1].start.line!==l[m][1].end.line&&(k=m+1,S.push(k),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(s.events=[],y?(y._tokenizer=void 0,y.previous=void 0):S.pop(),m=S.length;m--;){const x=l.slice(S[m],S[m+1]),T=o.pop();u.push([T,T+x.length-1]),e.splice(T,2,x)}for(u.reverse(),m=-1;++m<u.length;)d[b+u[m][0]]=b+u[m][1],b+=u[m][1]-u[m][0]-1;return d}const dke={resolve:hke,tokenize:pke},fke={partial:!0,tokenize:mke};function hke(e){return ZU(e),e}function pke(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):Ar(l)?e.check(fke,s,o)(l):(e.consume(l),i)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function mke(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ii(e,o,"linePrefix")}function o(s){if(s===null||Ar(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function QU(e,t,n,r,i,o,s,l,u){const d=u||Number.POSITIVE_INFINITY;let f=0;return p;function p(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),m):x===null||x===32||x===41||m_(x)?n(x):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),k(x))}function m(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===62?(e.exit("chunkString"),e.exit(l),m(x)):x===null||x===60||Ar(x)?n(x):(e.consume(x),x===92?b:y)}function b(x){return x===60||x===62||x===92?(e.consume(x),y):y(x)}function k(x){return!f&&(x===null||x===41||ho(x))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(x)):f<d&&x===40?(e.consume(x),f++,k):x===41?(e.consume(x),f--,k):x===null||x===32||x===40||m_(x)?n(x):(e.consume(x),x===92?S:k)}function S(x){return x===40||x===41||x===92?(e.consume(x),k):k(x)}}function JU(e,t,n,r,i,o){const s=this;let l=0,u;return d;function d(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),f}function f(y){return l>999||y===null||y===91||y===93&&!u||y===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):Ar(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||Ar(y)||l++>999?(e.exit("chunkString"),f(y)):(e.consume(y),u||(u=!mi(y)),y===92?m:p)}function m(y){return y===91||y===92||y===93?(e.consume(y),l++,p):p(y)}}function eV(e,t,n,r,i,o){let s;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,u):n(m)}function u(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),d(m))}function d(m){return m===s?(e.exit(o),u(s)):m===null?n(m):Ar(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Ii(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===s||m===null||Ar(m)?(e.exit("chunkString"),d(m)):(e.consume(m),m===92?p:f)}function p(m){return m===s||m===92?(e.consume(m),f):f(m)}}function f1(e,t){let n;return r;function r(i){return Ar(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):mi(i)?Ii(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const gke={name:"definition",tokenize:vke},yke={partial:!0,tokenize:bke};function vke(e,t,n){const r=this;let i;return o;function o(y){return e.enter("definition"),s(y)}function s(y){return JU.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function l(y){return i=zu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),u):n(y)}function u(y){return ho(y)?f1(e,d)(y):d(y)}function d(y){return QU(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function f(y){return e.attempt(yke,p,p)(y)}function p(y){return mi(y)?Ii(e,m,"whitespace")(y):m(y)}function m(y){return y===null||Ar(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function bke(e,t,n){return r;function r(l){return ho(l)?f1(e,i)(l):n(l)}function i(l){return eV(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return mi(l)?Ii(e,s,"whitespace")(l):s(l)}function s(l){return l===null||Ar(l)?t(l):n(l)}}const wke={name:"hardBreakEscape",tokenize:xke};function xke(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ar(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const kke={name:"headingAtx",resolve:_ke,tokenize:Cke};function _ke(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Tc(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Cke(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||ho(f)?(e.exit("atxHeadingSequence"),l(f)):n(f)}function l(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||Ar(f)?(e.exit("atxHeading"),t(f)):mi(f)?Ii(e,l,"whitespace")(f):(e.enter("atxHeadingText"),d(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),l(f))}function d(f){return f===null||f===35||ho(f)?(e.exit("atxHeadingText"),l(f)):(e.consume(f),d)}}const Ske=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],uM=["pre","script","style","textarea"],Eke={concrete:!0,name:"htmlFlow",resolveTo:Ike,tokenize:Rke},Ake={partial:!0,tokenize:Nke},Tke={partial:!0,tokenize:Oke};function Ike(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Rke(e,t,n){const r=this;let i,o,s,l,u;return d;function d(le){return f(le)}function f(le){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(le),p}function p(le){return le===33?(e.consume(le),m):le===47?(e.consume(le),o=!0,k):le===63?(e.consume(le),i=3,r.interrupt?t:ne):Cl(le)?(e.consume(le),s=String.fromCharCode(le),S):n(le)}function m(le){return le===45?(e.consume(le),i=2,y):le===91?(e.consume(le),i=5,l=0,b):Cl(le)?(e.consume(le),i=4,r.interrupt?t:ne):n(le)}function y(le){return le===45?(e.consume(le),r.interrupt?t:ne):n(le)}function b(le){const ve="CDATA[";return le===ve.charCodeAt(l++)?(e.consume(le),l===ve.length?r.interrupt?t:M:b):n(le)}function k(le){return Cl(le)?(e.consume(le),s=String.fromCharCode(le),S):n(le)}function S(le){if(le===null||le===47||le===62||ho(le)){const ve=le===47,Ee=s.toLowerCase();return!ve&&!o&&uM.includes(Ee)?(i=1,r.interrupt?t(le):M(le)):Ske.includes(s.toLowerCase())?(i=6,ve?(e.consume(le),x):r.interrupt?t(le):M(le)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(le):o?T(le):C(le))}return le===45||Xa(le)?(e.consume(le),s+=String.fromCharCode(le),S):n(le)}function x(le){return le===62?(e.consume(le),r.interrupt?t:M):n(le)}function T(le){return mi(le)?(e.consume(le),T):H(le)}function C(le){return le===47?(e.consume(le),H):le===58||le===95||Cl(le)?(e.consume(le),I):mi(le)?(e.consume(le),C):H(le)}function I(le){return le===45||le===46||le===58||le===95||Xa(le)?(e.consume(le),I):D(le)}function D(le){return le===61?(e.consume(le),P):mi(le)?(e.consume(le),D):C(le)}function P(le){return le===null||le===60||le===61||le===62||le===96?n(le):le===34||le===39?(e.consume(le),u=le,V):mi(le)?(e.consume(le),P):ee(le)}function V(le){return le===u?(e.consume(le),u=null,F):le===null||Ar(le)?n(le):(e.consume(le),V)}function ee(le){return le===null||le===34||le===39||le===47||le===60||le===61||le===62||le===96||ho(le)?D(le):(e.consume(le),ee)}function F(le){return le===47||le===62||mi(le)?C(le):n(le)}function H(le){return le===62?(e.consume(le),te):n(le)}function te(le){return le===null||Ar(le)?M(le):mi(le)?(e.consume(le),te):n(le)}function M(le){return le===45&&i===2?(e.consume(le),U):le===60&&i===1?(e.consume(le),q):le===62&&i===4?(e.consume(le),J):le===63&&i===3?(e.consume(le),ne):le===93&&i===5?(e.consume(le),re):Ar(le)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Ake,ge,Z)(le)):le===null||Ar(le)?(e.exit("htmlFlowData"),Z(le)):(e.consume(le),M)}function Z(le){return e.check(Tke,L,ge)(le)}function L(le){return e.enter("lineEnding"),e.consume(le),e.exit("lineEnding"),W}function W(le){return le===null||Ar(le)?Z(le):(e.enter("htmlFlowData"),M(le))}function U(le){return le===45?(e.consume(le),ne):M(le)}function q(le){return le===47?(e.consume(le),s="",Q):M(le)}function Q(le){if(le===62){const ve=s.toLowerCase();return uM.includes(ve)?(e.consume(le),J):M(le)}return Cl(le)&&s.length<8?(e.consume(le),s+=String.fromCharCode(le),Q):M(le)}function re(le){return le===93?(e.consume(le),ne):M(le)}function ne(le){return le===62?(e.consume(le),J):le===45&&i===2?(e.consume(le),ne):M(le)}function J(le){return le===null||Ar(le)?(e.exit("htmlFlowData"),ge(le)):(e.consume(le),J)}function ge(le){return e.exit("htmlFlow"),t(le)}}function Oke(e,t,n){const r=this;return i;function i(s){return Ar(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Nke(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(R2,t,n)}}const Mke={name:"htmlText",tokenize:Dke};function Dke(e,t,n){const r=this;let i,o,s;return l;function l(ne){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(ne),u}function u(ne){return ne===33?(e.consume(ne),d):ne===47?(e.consume(ne),D):ne===63?(e.consume(ne),C):Cl(ne)?(e.consume(ne),ee):n(ne)}function d(ne){return ne===45?(e.consume(ne),f):ne===91?(e.consume(ne),o=0,b):Cl(ne)?(e.consume(ne),T):n(ne)}function f(ne){return ne===45?(e.consume(ne),y):n(ne)}function p(ne){return ne===null?n(ne):ne===45?(e.consume(ne),m):Ar(ne)?(s=p,q(ne)):(e.consume(ne),p)}function m(ne){return ne===45?(e.consume(ne),y):p(ne)}function y(ne){return ne===62?U(ne):ne===45?m(ne):p(ne)}function b(ne){const J="CDATA[";return ne===J.charCodeAt(o++)?(e.consume(ne),o===J.length?k:b):n(ne)}function k(ne){return ne===null?n(ne):ne===93?(e.consume(ne),S):Ar(ne)?(s=k,q(ne)):(e.consume(ne),k)}function S(ne){return ne===93?(e.consume(ne),x):k(ne)}function x(ne){return ne===62?U(ne):ne===93?(e.consume(ne),x):k(ne)}function T(ne){return ne===null||ne===62?U(ne):Ar(ne)?(s=T,q(ne)):(e.consume(ne),T)}function C(ne){return ne===null?n(ne):ne===63?(e.consume(ne),I):Ar(ne)?(s=C,q(ne)):(e.consume(ne),C)}function I(ne){return ne===62?U(ne):C(ne)}function D(ne){return Cl(ne)?(e.consume(ne),P):n(ne)}function P(ne){return ne===45||Xa(ne)?(e.consume(ne),P):V(ne)}function V(ne){return Ar(ne)?(s=V,q(ne)):mi(ne)?(e.consume(ne),V):U(ne)}function ee(ne){return ne===45||Xa(ne)?(e.consume(ne),ee):ne===47||ne===62||ho(ne)?F(ne):n(ne)}function F(ne){return ne===47?(e.consume(ne),U):ne===58||ne===95||Cl(ne)?(e.consume(ne),H):Ar(ne)?(s=F,q(ne)):mi(ne)?(e.consume(ne),F):U(ne)}function H(ne){return ne===45||ne===46||ne===58||ne===95||Xa(ne)?(e.consume(ne),H):te(ne)}function te(ne){return ne===61?(e.consume(ne),M):Ar(ne)?(s=te,q(ne)):mi(ne)?(e.consume(ne),te):F(ne)}function M(ne){return ne===null||ne===60||ne===61||ne===62||ne===96?n(ne):ne===34||ne===39?(e.consume(ne),i=ne,Z):Ar(ne)?(s=M,q(ne)):mi(ne)?(e.consume(ne),M):(e.consume(ne),L)}function Z(ne){return ne===i?(e.consume(ne),i=void 0,W):ne===null?n(ne):Ar(ne)?(s=Z,q(ne)):(e.consume(ne),Z)}function L(ne){return ne===null||ne===34||ne===39||ne===60||ne===61||ne===96?n(ne):ne===47||ne===62||ho(ne)?F(ne):(e.consume(ne),L)}function W(ne){return ne===47||ne===62||ho(ne)?F(ne):n(ne)}function U(ne){return ne===62?(e.consume(ne),e.exit("htmlTextData"),e.exit("htmlText"),t):n(ne)}function q(ne){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(ne),e.exit("lineEnding"),Q}function Q(ne){return mi(ne)?Ii(e,re,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):re(ne)}function re(ne){return e.enter("htmlTextData"),s(ne)}}const IT={name:"labelEnd",resolveAll:jke,resolveTo:Fke,tokenize:zke},Lke={tokenize:Uke},Pke={tokenize:Vke},Bke={tokenize:Hke};function jke(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Tc(e,0,e.length,n),e}function Fke(e,t){let n=e.length,r=0,i,o,s,l;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",u,t],["enter",d,t]],l=ou(l,e.slice(o+1,o+r+3)),l=ou(l,[["enter",f,t]]),l=ou(l,AC(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),l=ou(l,[["exit",f,t],e[s-2],e[s-1],["exit",d,t]]),l=ou(l,e.slice(s+1)),l=ou(l,[["exit",u,t]]),Tc(e,o,e.length,l),e}function zke(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(m){return o?o._inactive?p(m):(s=r.parser.defined.includes(zu(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):n(m)}
vendor: 8,090 bytes, line 637
637function u(m){return m===40?e.attempt(Lke,f,s?f:p)(m):m===91?e.attempt(Pke,f,s?d:p)(m):s?f(m):p(m)}function d(m){return e.attempt(Bke,f,p)(m)}function f(m){return t(m)}function p(m){return o._balanced=!0,n(m)}}function Uke(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return ho(p)?f1(e,o)(p):o(p)}function o(p){return p===41?f(p):QU(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function s(p){return ho(p)?f1(e,u)(p):f(p)}function l(p){return n(p)}function u(p){return p===34||p===39||p===40?eV(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):f(p)}function d(p){return ho(p)?f1(e,f)(p):f(p)}function f(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function Vke(e,t,n){const r=this;return i;function i(l){return JU.call(r,e,o,s,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(zu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function Hke(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const $ke={name:"labelStartImage",resolveAll:IT.resolveAll,tokenize:Gke};function Gke(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const qke={name:"labelStartLink",resolveAll:IT.resolveAll,tokenize:Wke};function Wke(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const c4={name:"lineEnding",tokenize:Kke};function Kke(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ii(e,t,"linePrefix")}}const ck={name:"thematicBreak",tokenize:Yke};function Yke(e,t,n){let r=0,i;return o;function o(d){return e.enter("thematicBreak"),s(d)}function s(d){return i=d,l(d)}function l(d){return d===i?(e.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||Ar(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===i?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),mi(d)?Ii(e,l,"whitespace")(d):l(d))}}const Kl={continuation:{tokenize:Jke},exit:t_e,name:"list",tokenize:Qke},Xke={partial:!0,tokenize:n_e},Zke={partial:!0,tokenize:e_e};function Qke(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(y){const b=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:_A(y)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(ck,n,d)(y):d(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(y)}return n(y)}function u(y){return _A(y)&&++s<10?(e.consume(y),u):(!r.interrupt||s<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),d(y)):n(y)}function d(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(R2,r.interrupt?n:f,e.attempt(Xke,m,p))}function f(y){return r.containerState.initialBlankLine=!0,o++,m(y)}function p(y){return mi(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),m):n(y)}function m(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function Jke(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(R2,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ii(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!mi(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Zke,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ii(e,e.attempt(Kl,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function e_e(e,t,n){const r=this;return Ii(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function t_e(e){e.exit(this.containerState.type)}function n_e(e,t,n){const r=this;return Ii(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!mi(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const dM={name:"setextUnderline",resolveTo:r_e,tokenize:i_e};function r_e(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function i_e(e,t,n){const r=this;let i;return o;function o(d){let f=r.events.length,p;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){p=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),mi(d)?Ii(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||Ar(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const o_e={tokenize:s_e};function s_e(e){const t=this,n=e.attempt(R2,r,e.attempt(this.parser.constructs.flowInitial,i,Ii(e,e.attempt(this.parser.constructs.flow,i,e.attempt(dke,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const a_e={resolveAll:nV()},l_e=tV("string"),c_e=tV("text");function tV(e){return{resolveAll:nV(e==="text"?u_e:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,l);return s;function s(f){return d(f)?o(f):l(f)}function l(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return d(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function d(f){if(f===null)return!0;const p=i[f];let m=-1;if(p)for(;++m<p.length;){const y=p[m];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function nV(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function u_e(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,l=0,u;
vendor: 2,600 bytes, line 637
637for(;o--;){const d=i[o];if(typeof d=="string"){for(s=d.length;d.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(d===-2)u=!0,l++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const d={type:n===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const d_e={42:Kl,43:Kl,45:Kl,48:Kl,49:Kl,50:Kl,51:Kl,52:Kl,53:Kl,54:Kl,55:Kl,56:Kl,57:Kl,62:KU},f_e={91:gke},h_e={[-2]:l4,[-1]:l4,32:l4},p_e={35:kke,42:ck,45:[dM,ck],60:Eke,61:dM,95:ck,96:cM,126:cM},m_e={38:XU,92:YU},g_e={[-5]:c4,[-4]:c4,[-3]:c4,33:$ke,38:XU,42:CA,60:[qxe,Mke],91:qke,92:[wke,YU],93:IT,95:CA,96:oke},y_e={null:[CA,a_e]},v_e={null:[42,95]},b_e={null:[]},w_e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:v_e,contentInitial:f_e,disable:b_e,document:d_e,flow:p_e,flowInitial:h_e,insideSpan:y_e,string:m_e,text:g_e},Symbol.toStringTag,{value:"Module"}));function x_e(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],l=[];const u={attempt:V(D),check:V(P),consume:T,enter:C,exit:I,interrupt:V(P,{interrupt:!0})},d={code:null,containerState:{},defineSkip:k,events:[],now:b,parser:e,previous:null,sliceSerialize:m,sliceStream:y,write:p};let f=t.tokenize.call(d,u);return t.resolveAll&&o.push(t),d;function p(te){return s=ou(s,te),S(),s[s.length-1]!==null?[]:(ee(t,0),d.events=AC(o,d.events,d),d.events)}function m(te,M){return __e(y(te),M)}function y(te){return k_e(s,te)}function b(){const{_bufferIndex:te,_index:M,line:Z,column:L,offset:W}=r;return{_bufferIndex:te,_index:M,line:Z,column:L,offset:W}}function k(te){i[te.line]=te.column,H()}function S(){let te;for(;r._index<s.length;){const M=s[r._index];if(typeof M=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<M.length;)x(M.charCodeAt(r._bufferIndex));else x(M)}}function x(te){f=f(te)}function T(te){Ar(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,H()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=te}function C(te,M){const Z=M||{};return Z.type=te,Z.start=b(),d.events.push(["enter",Z,d]),l.push(Z),Z}function I(te){const M=l.pop();return M.end=b(),d.events.push(["exit",M,d]),M}function D(te,M){ee(te,M.from)}
vendor: 13,507 bytes, lines 637-639
637function P(te,M){M.restore()}function V(te,M){return Z;function Z(L,W,U){let q,Q,re,ne;return Array.isArray(L)?ge(L):"tokenize"in L?ge([L]):J(L);function J(st){return At;function At(yt){const Ge=yt!==null&&st[yt],Be=yt!==null&&st.null,he=[...Array.isArray(Ge)?Ge:Ge?[Ge]:[],...Array.isArray(Be)?Be:Be?[Be]:[]];return ge(he)(yt)}}function ge(st){return q=st,Q=0,st.length===0?U:le(st[Q])}function le(st){return At;function At(yt){return ne=F(),re=st,st.partial||(d.currentConstruct=st),st.name&&d.parser.constructs.disable.null.includes(st.name)?Ee():st.tokenize.call(M?Object.assign(Object.create(d),M):d,u,ve,Ee)(yt)}}function ve(st){return te(re,ne),W}function Ee(st){return ne.restore(),++Q<q.length?le(q[Q]):U}}}function ee(te,M){te.resolveAll&&!o.includes(te)&&o.push(te),te.resolve&&Tc(d.events,M,d.events.length-M,te.resolve(d.events.slice(M),d)),te.resolveTo&&(d.events=te.resolveTo(d.events,d))}function F(){const te=b(),M=d.previous,Z=d.currentConstruct,L=d.events.length,W=Array.from(l);return{from:L,restore:U};function U(){r=te,d.previous=M,d.currentConstruct=Z,d.events.length=L,l=W,H()}}function H(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function k_e(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function __e(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
638`;break}case-3:{s=`\r
639`;break}case-2:{s=t?" ":"	";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function C_e(e){const r={constructs:qU([w_e,...(e||{}).extensions||[]]),content:i(Fxe),defined:[],document:i(Uxe),flow:i(o_e),lazy:{},string:i(l_e),text:i(c_e)};return r;function i(o){return s;function s(l){return x_e(r,o,l)}}}function S_e(e){for(;!ZU(e););return e}const fM=/[\0\t\n\r]/g;function E_e(){let e=1,t="",n=!0,r;return i;function i(o,s,l){const u=[];let d,f,p,m,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),p=0,t="",n&&(o.charCodeAt(0)===65279&&p++,n=void 0);p<o.length;){if(fM.lastIndex=p,d=fM.exec(o),m=d&&d.index!==void 0?d.index:o.length,y=o.charCodeAt(m),!d){t=o.slice(p);break}if(y===10&&p===m&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<m&&(u.push(o.slice(p,m)),e+=m-p),y){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}p=m+1}return l&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const A_e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function T_e(e){return e.replace(A_e,I_e)}function I_e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return WU(n.slice(o?2:1),o?16:10)}return TT(n)||e}const rV={}.hasOwnProperty;function R_e(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),O_e(n)(S_e(C_e(n).document().write(E_e()(e,t,!0))))}function O_e(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ce),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(be),blockQuote:o(Be),characterEscape:F,characterReference:F,codeFenced:o(he),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(he,s),codeText:o(Oe,s),codeTextData:F,data:F,codeFlowValue:F,definition:o(ye),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(B),hardBreakEscape:o(ie),hardBreakTrailing:o(ie),htmlFlow:o(fe,s),htmlFlowData:F,htmlText:o(fe,s),htmlTextData:F,image:o(ue),label:s,link:o(Ce),listItem:o(K),listItemValue:m,listOrdered:o(Ue,p),listUnordered:o(Ue),paragraph:o(oe),reference:le,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(be),strong:o(Fe),thematicBreak:o(tt)},exit:{atxHeading:u(),atxHeadingSequence:D,autolink:u(),autolinkEmail:Ge,autolinkProtocol:yt,blockQuote:u(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:Ee,characterReferenceMarkerNumeric:Ee,characterReferenceValue:st,characterReference:At,codeFenced:u(S),codeFencedFence:k,codeFencedFenceInfo:y,codeFencedFenceMeta:b,codeFlowValue:H,codeIndented:u(x),codeText:u(W),codeTextData:H,data:H,definition:u(),definitionDestinationString:I,definitionLabelString:T,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(M),hardBreakTrailing:u(M),htmlFlow:u(Z),htmlFlowData:H,htmlText:u(L),htmlTextData:H,image:u(q),label:re,labelText:Q,lineEnding:te,link:u(U),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ve,resourceDestinationString:ne,resourceTitleString:J,resource:ge,setextHeading:u(ee),setextHeadingLineSequence:V,setextHeadingText:P,strong:u(),thematicBreak:u()}};iV(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(De){let Pe={type:"root",children:[]};const mt={stack:[Pe],tokenStack:[],config:t,enter:l,exit:d,buffer:s,resume:f,data:n},xt=[];let de=-1;for(;++de<De.length;)if(De[de][1].type==="listOrdered"||De[de][1].type==="listUnordered")if(De[de][0]==="enter")xt.push(de);else{const z=xt.pop();de=i(De,z,de)}for(de=-1;++de<De.length;){const z=t[De[de][0]];rV.call(z,De[de][1].type)&&z[De[de][1].type].call(Object.assign({sliceSerialize:De[de][2].sliceSerialize},mt),De[de][1])}if(mt.tokenStack.length>0){const z=mt.tokenStack[mt.tokenStack.length-1];(z[1]||hM).call(mt,void 0,z[0])}for(Pe.position={start:pp(De.length>0?De[0][1].start:{line:1,column:1,offset:0}),end:pp(De.length>0?De[De.length-2][1].end:{line:1,column:1,offset:0})},de=-1;++de<t.transforms.length;)Pe=t.transforms[de](Pe)||Pe;return Pe}function i(De,Pe,mt){let xt=Pe-1,de=-1,z=!1,Y,me,Ve,lt;for(;++xt<=mt;){const gt=De[xt];switch(gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{gt[0]==="enter"?de++:de--,lt=void 0;break}case"lineEndingBlank":{gt[0]==="enter"&&(Y&&!lt&&!de&&!Ve&&(Ve=xt),lt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:lt=void 0}if(!de&&gt[0]==="enter"&&gt[1].type==="listItemPrefix"||de===-1&&gt[0]==="exit"&&(gt[1].type==="listUnordered"||gt[1].type==="listOrdered")){if(Y){let dn=xt;for(me=void 0;dn--;){const Hn=De[dn];if(Hn[1].type==="lineEnding"||Hn[1].type==="lineEndingBlank"){if(Hn[0]==="exit")continue;me&&(De[me][1].type="lineEndingBlank",z=!0),Hn[1].type="lineEnding",me=dn}else if(!(Hn[1].type==="linePrefix"||Hn[1].type==="blockQuotePrefix"||Hn[1].type==="blockQuotePrefixWhitespace"||Hn[1].type==="blockQuoteMarker"||Hn[1].type==="listItemIndent"))break}Ve&&(!me||Ve<me)&&(Y._spread=!0),Y.end=Object.assign({},me?De[me][1].start:gt[1].end),De.splice(me||xt,0,["exit",Y,gt[2]]),xt++,mt++}if(gt[1].type==="listItemPrefix"){const dn={type:"listItem",_spread:!1,start:Object.assign({},gt[1].start),end:void 0};Y=dn,De.splice(xt,0,["enter",dn,gt[2]]),xt++,mt++,Ve=void 0,lt=!0}}}return De[Pe][1]._spread=z,mt}function o(De,Pe){return mt;function mt(xt){l.call(this,De(xt),xt),Pe&&Pe.call(this,xt)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(De,Pe,mt){this.stack[this.stack.length-1].children.push(De),this.stack.push(De),this.tokenStack.push([Pe,mt||void 0]),De.position={start:pp(Pe.start),end:void 0}}function u(De){return Pe;function Pe(mt){De&&De.call(this,mt),d.call(this,mt)}}function d(De,Pe){const mt=this.stack.pop(),xt=this.tokenStack.pop();if(xt)xt[0].type!==De.type&&(Pe?Pe.call(this,De,xt[0]):(xt[1]||hM).call(this,De,xt[0]));else throw new Error("Cannot close `"+De.type+"` ("+d1({start:De.start,end:De.end})+"): it’s not open");mt.position.end=pp(De.end)}function f(){return AT(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(De){if(this.data.expectingFirstListItemValue){const Pe=this.stack[this.stack.length-2];Pe.start=Number.parseInt(this.sliceSerialize(De),10),this.data.expectingFirstListItemValue=void 0}}function y(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.lang=De}function b(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.meta=De}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=De.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=De.replace(/(\r?\n|\r)$/g,"")}function T(De){const Pe=this.resume(),mt=this.stack[this.stack.length-1];mt.label=Pe,mt.identifier=zu(this.sliceSerialize(De)).toLowerCase()}function C(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=De}function I(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=De}function D(De){const Pe=this.stack[this.stack.length-1];if(!Pe.depth){const mt=this.sliceSerialize(De).length;Pe.depth=mt}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function V(De){const Pe=this.stack[this.stack.length-1];Pe.depth=this.sliceSerialize(De).codePointAt(0)===61?1:2}function ee(){this.data.setextHeadingSlurpLineEnding=void 0}function F(De){const mt=this.stack[this.stack.length-1].children;let xt=mt[mt.length-1];(!xt||xt.type!=="text")&&(xt=Le(),xt.position={start:pp(De.start),end:void 0},mt.push(xt)),this.stack.push(xt)}function H(De){const Pe=this.stack.pop();Pe.value+=this.sliceSerialize(De),Pe.position.end=pp(De.end)}function te(De){const Pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const mt=Pe.children[Pe.children.length-1];mt.position.end=pp(De.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Pe.type)&&(F.call(this,De),H.call(this,De))}function M(){this.data.atHardBreak=!0}function Z(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=De}function L(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=De}function W(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=De}function U(){const De=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";De.type+="Reference",De.referenceType=Pe,delete De.url,delete De.title}else delete De.identifier,delete De.label;this.data.referenceType=void 0}function q(){const De=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";De.type+="Reference",De.referenceType=Pe,delete De.url,delete De.title}else delete De.identifier,delete De.label;this.data.referenceType=void 0}function Q(De){const Pe=this.sliceSerialize(De),mt=this.stack[this.stack.length-2];mt.label=T_e(Pe),mt.identifier=zu(Pe).toLowerCase()}function re(){const De=this.stack[this.stack.length-1],Pe=this.resume(),mt=this.stack[this.stack.length-1];if(this.data.inReference=!0,mt.type==="link"){const xt=De.children;mt.children=xt}else mt.alt=Pe}function ne(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=De}function J(){const De=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=De}function ge(){this.data.inReference=void 0}function le(){this.data.referenceType="collapsed"}function ve(De){const Pe=this.resume(),mt=this.stack[this.stack.length-1];mt.label=Pe,mt.identifier=zu(this.sliceSerialize(De)).toLowerCase(),this.data.referenceType="full"}function Ee(De){this.data.characterReferenceType=De.type}function st(De){const Pe=this.sliceSerialize(De),mt=this.data.characterReferenceType;let xt;mt?(xt=WU(Pe,mt==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):xt=TT(Pe);const de=this.stack[this.stack.length-1];de.value+=xt}function At(De){const Pe=this.stack.pop();Pe.position.end=pp(De.end)}function yt(De){H.call(this,De);const Pe=this.stack[this.stack.length-1];Pe.url=this.sliceSerialize(De)}function Ge(De){H.call(this,De);const Pe=this.stack[this.stack.length-1];Pe.url="mailto:"+this.sliceSerialize(De)}function Be(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function B(){return{type:"emphasis",children:[]}}function be(){return{type:"heading",depth:0,children:[]}}function ie(){return{type:"break"}}function fe(){return{type:"html",value:""}}function ue(){return{type:"image",title:null,url:"",alt:null}}function Ce(){return{type:"link",title:null,url:"",children:[]}}function Ue(De){return{type:"list",ordered:De.type==="listOrdered",start:null,spread:De._spread,children:[]}}function K(De){return{type:"listItem",spread:De._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function Fe(){return{type:"strong",children:[]}}function Le(){return{type:"text",value:""}}function tt(){return{type:"thematicBreak"}}}function pp(e){return{line:e.line,column:e.column,offset:e.offset}}function iV(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?iV(e,r):N_e(e,r)}}function N_e(e,t){let n;for(n in t)if(rV.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function hM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+d1({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+d1({start:t.start,end:t.end}
vendor: 5,989 bytes, lines 639-643
639)+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+d1({start:t.start,end:t.end})+") is still open")}function M_e(e){const t=this;t.parser=n;function n(r){return R_e(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function D_e(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function L_e(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
640`}]}function P_e(e,t){const n=t.value?t.value+`
641`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function B_e(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function j_e(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function F_e(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ov(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function z_e(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function U_e(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function oV(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function V_e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return oV(e,t);const i={src:ov(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function H_e(e,t){const n={src:ov(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function $_e(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function G_e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return oV(e,t);const i={href:ov(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function q_e(e,t){const n={href:ov(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function W_e(e,t,n){const r=e.all(t),i=n?K_e(n):sV(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let p;f&&f.type==="element"&&f.tagName==="p"?p=f:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const f=r[l];(i||l!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
642`}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
643`});const d={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,d),e.applyData(t,d)}function K_e(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=sV(n[r])}return t}function sV(e){const t=e.spread;return t??e.children.length>1}function Y_e(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function X_e(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Z_e(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Q_e(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function J_e(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=_T(t.children[1]),u=FU(t.children[t.children.length-1]);l&&u&&(s.position={start:l,end:u}),i.push(s)}const o={type:"element",tagName:"table",properties:{}
vendor: 1,810 bytes, line 643
643,children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function eCe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let u=-1;const d=[];for(;++u<l;){const p=t.children[u],m={},y=s?s[u]:void 0;y&&(m.align=y);let b={type:"element",tagName:o,properties:m,children:[]};p&&(b.children=e.all(p),e.patch(p,b),b=e.applyData(p,b)),d.push(b)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,f),e.applyData(t,f)}function tCe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const pM=9,mM=32;function nCe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(gM(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(gM(t.slice(i),i>0,!1)),o.join("")}function gM(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===pM||o===mM;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===pM||o===mM;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function rCe(e,t){const n={type:"text",value:nCe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function iCe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const oCe={blockquote:D_e,break:L_e,code:P_e,delete:B_e,emphasis:j_e,footnoteReference:F_e,heading:z_e,html:U_e,imageReference:V_e,image:H_e,inlineCode:$_e,linkReference:G_e,link:q_e,listItem:W_e,list:Y_e,paragraph:X_e,root:Z_e,strong:Q_e,table:J_e,tableCell:tCe,tableRow:eCe,text:rCe,thematicBreak:iCe,toml:Cx,yaml:Cx,definition:Cx,footnoteDefinition:Cx};function Cx(){}const aV=-1,TC=0,h1=1,g_=2,RT=3,OT=4,NT=5,MT=6,lV=7,cV=8,uV=typeof self=="object"?self:globalThis,yM=(e,t)=>
vendor: 5,701 bytes, lines 643-645
643{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new uV[e](t)},sCe=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case TC:case aV:return n(s,i);case h1:{const l=n([],i);for(const u of s)l.push(r(u));return l}case g_:{const l=n({},i);for(const[u,d]of s)l[r(u)]=r(d);return l}case RT:return n(new Date(s),i);case OT:{const{source:l,flags:u}=s;return n(new RegExp(l,u),i)}case NT:{const l=n(new Map,i);for(const[u,d]of s)l.set(r(u),r(d));return l}case MT:{const l=n(new Set,i);for(const u of s)l.add(r(u));return l}case lV:{const{name:l,message:u}=s;return n(typeof uV[l]=="function"?yM(l,u):new Error(u),i)}case cV:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(yM(o,s),i)};return r},vM=e=>sCe(new Map,e)(0),$m="",{toString:aCe}={},{keys:lCe}=Object,vb=e=>{const t=typeof e;if(t!=="object"||!e)return[TC,t];const n=aCe.call(e).slice(8,-1);switch(n){case"Array":return[h1,$m];case"Object":return[g_,$m];case"Date":return[RT,$m];case"RegExp":return[OT,$m];case"Map":return[NT,$m];case"Set":return[MT,$m];case"DataView":return[h1,n]}return n.includes("Array")?[h1,n]:e instanceof Error?[lV,e.name||"Error"]:[g_,n]},Sx=([e,t])=>e===TC&&(t==="function"||t==="symbol"),cCe=(e,t,n,r)=>{const i=(s,l)=>{const u=r.push(s)-1;return n.set(l,u),u},o=s=>{if(n.has(s))return n.get(s);let[l,u]=vb(s);switch(l){case TC:{let f=s;switch(u){case"bigint":l=cV,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([aV],s)}return i([l,f],s)}case h1:{if(u){let m=s;return u==="DataView"?m=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(s)),i([u,[...m]],s)}const f=[],p=i([l,f],s);for(const m of s)f.push(o(m));return p}case g_:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],p=i([l,f],s);for(const m of lCe(s))(e||!Sx(vb(s[m])))&&f.push([o(m),o(s[m])]);return p}case RT:return i([l,isNaN(s.getTime())?$m:s.toISOString()],s);case OT:{const{source:f,flags:p}=s;return i([l,{source:f,flags:p}],s)}case NT:{const f=[],p=i([l,f],s);for(const[m,y]of s)(e||!(Sx(vb(m))||Sx(vb(y))))&&f.push([o(m),o(y)]);return p}case MT:{const f=[],p=i([l,f],s);for(const m of s)(e||!Sx(vb(m)))&&f.push(o(m));return p}}const{message:d}=s;return i([l,{name:u,message:d}],s)};return o},bM=(e,{json:t,lossy:n}={})=>{const r=[];return cCe(!(t||n),!!t,new Map,r)(e),r},y_=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?vM(bM(e,t)):structuredClone(e):(e,t)=>vM(bM(e,t));function uCe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function dCe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function fCe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||uCe,r=e.options.footnoteBackLabel||dCe,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[u]);if(!d)continue;const f=e.all(d),p=String(d.identifier).toUpperCase(),m=ov(p.toLowerCase());let y=0;const b=[],k=e.footnoteCounts.get(p);for(;k!==void 0&&++y<=k;){b.length>0&&b.push({type:"text",value:" "});let T=typeof n=="string"?n:n(u,y);typeof T=="string"&&(T={type:"text",value:T}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,y),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const T=S.children[S.children.length-1];T&&T.type==="text"?T.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...b)}else f.push(...b);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(f,!0)};e.patch(d,x),l.push(x)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...y_(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
644`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
645`}]}}const IC=(function(e){if(e==null)return gCe;if(typeof e=="function")return RC(e);if(typeof e=="object")return Array.isArray(e)?hCe(e):pCe(e);if(typeof e=="string")return mCe(e);throw new Error("Expected function, string, or object as test")});function hCe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=IC(e[n]);return RC(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function pCe(e){const t=e;return RC(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function mCe(e){return RC(t);function t(n){return n&&n.type===e}}function RC(e){return t;function t(n,r,i){return!!(yCe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function gCe(){return!0}function yCe(e){return e!==null&&typeof e=="object"&&"type"in e}const dV=[],vCe=!0,SA=!1,bCe="skip";function fV(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=IC(i),s=r?-1:1;l(e,void 0,[])();function l(u,d,f){const p=u&&typeof u=="object"?u:{};
vendor: 4,565 bytes, lines 645-649
645if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(u.type+(y?"<"+y+">":""))+")"})}return m;function m(){let y=dV,b,k,S;if((!t||o(u,d,f[f.length-1]||void 0))&&(y=wCe(n(u,f)),y[0]===SA))return y;if("children"in u&&u.children){const x=u;if(x.children&&y[0]!==bCe)for(k=(r?x.children.length:-1)+s,S=f.concat(x);k>-1&&k<x.children.length;){const T=x.children[k];if(b=l(T,k,S)(),b[0]===SA)return b;k=typeof b[1]=="number"?b[1]:k+s}}return y}}}function wCe(e){return Array.isArray(e)?e:typeof e=="number"?[vCe,e]:e==null?dV:[e]}function DT(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),fV(e,o,l,i);function l(u,d){const f=d[d.length-1],p=f?f.children.indexOf(u):void 0;return s(u,p,f)}}const EA={}.hasOwnProperty,xCe={};function kCe(e,t){const n=t||xCe,r=new Map,i=new Map,o=new Map,s={...oCe,...n.handlers},l={all:d,applyData:CCe,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:u,options:n,patch:_Ce,wrap:ECe};return DT(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const p=f.type==="definition"?r:i,m=String(f.identifier).toUpperCase();p.has(m)||p.set(m,f)}}),l;function u(f,p){const m=f.type,y=l.handlers[m];if(EA.call(l.handlers,m)&&y)return y(l,f,p);if(l.options.passThrough&&l.options.passThrough.includes(m)){if("children"in f){const{children:k,...S}=f,x=y_(S);return x.children=l.all(f),x}return y_(f)}return(l.options.unknownHandler||SCe)(l,f,p)}function d(f){const p=[];if("children"in f){const m=f.children;let y=-1;for(;++y<m.length;){const b=l.one(m[y],f);if(b){if(y&&m[y-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=wM(b.value)),!Array.isArray(b)&&b.type==="element")){const k=b.children[0];k&&k.type==="text"&&(k.value=wM(k.value))}Array.isArray(b)?p.push(...b):p.push(b)}}}return p}}function _Ce(e,t){e.position&&(t.position=dxe(e))}function CCe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,y_(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function SCe(e,t){const n=t.data||{},r="value"in t&&!(EA.call(n,"hProperties")||EA.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ECe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
646`});++r<e.length;)r&&n.push({type:"text",value:`
647`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
648`}),n}function wM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xM(e,t){const n=kCe(e,t),r=n.one(e,void 0),i=fCe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
649`},i),o}function ACe(e,t){return e&&"run"in e?async function(n,r){const i=xM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return xM(n,{file:r,...e||t})}}function kM(e){if(e)throw e}var u4,_M;function TCe(){if(_M)return u4;_M=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var f=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!f&&!p)return!1;var m;for(m in d);return typeof m>"u"||e.call(d,m)},s=function(d,f){n&&f.name==="__proto__"?n(d,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):d[f.name]=f.newValue},l=function(d,f){if(f==="__proto__")if(e.call(d,f)){if(r)return r(d,f).value}else return;return d[f]};return u4=function u(){var d,f,p,m,y,b,k=arguments[0],S=1,x=arguments.length,T=!1;for(typeof k=="boolean"&&(T=k,k=arguments[1]||{},S=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});S<x;++S)if(d=arguments[S],d!=null)for(f in d)p=l(k,f),m=l(d,f),k!==m&&(T&&m&&(o(m)||(y=i(m)))?(y?(y=!1,b=p&&i(p)?p:[]):b=p&&o(p)?p:{},s(k,{name:f,newValue:u(T,b,m)})):typeof m<"u"&&s(k,{name:f,newValue:m}));return k},u4}var ICe=TCe();const d4=a2(ICe);function AA(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);
vendor: 4,474 bytes, line 649
649return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function RCe(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(u,...d){const f=e[++o];let p=-1;if(u){s(u);return}for(;++p<i.length;)(d[p]===null||d[p]===void 0)&&(d[p]=i[p]);i=d,f?OCe(f,l)(...d):s(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function OCe(e,t){let n;return r;function r(...s){const l=e.length>s.length;let u;l&&s.push(i);try{u=e.apply(this,s)}catch(d){const f=d;if(l&&n)throw f;return i(f)}l||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...l){n||(n=!0,t(s,...l))}function o(s){i(null,s)}}const wd={basename:NCe,dirname:MCe,extname:DCe,join:LCe,sep:"/"};function NCe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');O2(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function MCe(e){if(O2(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function DCe(e){O2(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function LCe(...e){let t=-1,n;for(;++t<e.length;)O2(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":PCe(n)}function PCe(e){O2(e);const t=e.codePointAt(0)===47;let n=BCe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function BCe(e,t){let n="",r=0,i=-1,o=0,s=-1,l,u;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else l===46&&o>-1?o++:o=-1}return n}function O2(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const jCe={cwd:FCe};function FCe(){return"/"}function TA(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function zCe(e){if(typeof e=="string")e=new URL(e);else if(!TA(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return UCe(e)}function UCe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const f4=["history","path","basename","stem","extname","dirname"];class hV{constructor(t){let n;t?TA(t)?n={path:t}:typeof t=="string"||VCe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":jCe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<f4.length;){const o=f4[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)f4.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?wd.basename(this.path):void 0}
vendor: 4,124 bytes, line 649
649set basename(t){p4(t,"basename"),h4(t,"basename"),this.path=wd.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wd.dirname(this.path):void 0}set dirname(t){CM(this.basename,"dirname"),this.path=wd.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wd.extname(this.path):void 0}set extname(t){if(h4(t,"extname"),CM(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wd.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){TA(t)&&(t=zCe(t)),p4(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wd.basename(this.path,this.extname):void 0}set stem(t){p4(t,"stem"),h4(t,"stem"),this.path=wd.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Qa(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function h4(e,t){if(e&&e.includes(wd.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wd.sep+"`")}function p4(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function CM(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function VCe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const HCe=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),$Ce={}.hasOwnProperty;class LT extends HCe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=RCe()}copy(){const t=new LT;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(d4(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(y4("data",this.frozen),this.namespace[t]=n,this):$Ce.call(this.namespace,t)&&this.namespace[t]||void 0:t?(y4("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ex(t),r=this.parser||this.Parser;return m4("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),m4("process",this.parser||this.Parser),g4("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const l=Ex(t),u=r.parse(l);r.run(u,l,function(f,p,m){if(f||!p||!m)return d(f);const y=p,b=r.stringify(y,m);WCe(b)?m.value=b:m.result=b,d(f,m)});function d(f,p){f||!p?s(f):o?o(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),m4("processSync",this.parser||this.Parser),g4("processSync",this.compiler||this.Compiler),this.process(t,i),EM("processSync","process",n),r;function i(o,s){n=!0,kM(o),r=s}}run(t,n,r){SM(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,l){const u=Ex(n);i.run(t,u,d);function d(f,p,m){const y=p||t;f?l(f):s?s(y):r(void 0,y,m)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),EM("runSync","run",r),i;function o(s,l){kM(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=Ex(n),i=this.compiler||this.Compiler;return g4("stringify",i),SM(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(y4("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;
vendor: 4,927 bytes, line 649
649function o(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[f,...p]=d;u(f,p)}else s(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function s(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(d.plugins),d.settings&&(i.settings=d4(!0,i.settings,d.settings))}function l(d){let f=-1;if(d!=null)if(Array.isArray(d))for(;++f<d.length;){const p=d[f];o(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,f){let p=-1,m=-1;for(;++p<r.length;)if(r[p][0]===d){m=p;break}if(m===-1)r.push([d,...f]);else if(f.length>0){let[y,...b]=f;const k=r[m][1];AA(k)&&AA(y)&&(y=d4(!0,k,y)),r[m]=[d,y,...b]}}}}const GCe=new LT().freeze();function m4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function g4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function y4(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function SM(e){if(!AA(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function EM(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ex(e){return qCe(e)?e:new hV(e)}function qCe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function WCe(e){return typeof e=="string"||KCe(e)}function KCe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const YCe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",AM=[],TM={allowDangerousHtml:!0},XCe=/^(https?|ircs?|mailto|xmpp)$/i,ZCe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function QCe(e){const t=JCe(e),n=eSe(e);return tSe(t.runSync(t.parse(n),n),e)}function JCe(e){const t=e.rehypePlugins||AM,n=e.remarkPlugins||AM,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...TM}:TM;return GCe().use(M_e).use(n).use(ACe,r).use(t)}function eSe(e){const t=e.children||"",n=new hV;return typeof t=="string"&&(n.value=t),n}function tSe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||nSe;for(const f of ZCe)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+YCe+f.id,void 0);return DT(e,d),gxe(e,{Fragment:_.Fragment,components:i,ignoreInvalidStyle:!0,jsx:_.jsx,jsxs:_.jsxs,passKeys:!0,passNode:!0});function d(f,p,m){if(f.type==="raw"&&m&&typeof p=="number")return s?m.children.splice(p,1):m.children[p]={type:"text",value:f.value},p;if(f.type==="element"){let y;for(y in a4)if(Object.hasOwn(a4,y)&&Object.hasOwn(f.properties,y)){const b=f.properties[y],k=a4[y];(k===null||k.includes(f.tagName))&&(f.properties[y]=u(String(b||""),y,f))}}if(f.type==="element"){let y=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(f,p,m)),y&&m&&typeof p=="number")return l&&f.children?m.children.splice(p,1,...f.children):m.children.splice(p,1),p}}}function nSe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||XCe.test(e.slice(0,t))?e:""}function IM(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function rSe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function iSe(e,t,n){const i=IC((n||{}).ignore||[]),o=oSe(t);let s=-1;for(;++s<o.length;)fV(e,"text",l);function l(d,f){let p=-1,m;
vendor: 6,018 bytes, lines 649-650
649for(;++p<f.length;){const y=f[p],b=m?m.children:void 0;if(i(y,b?b.indexOf(y):void 0,m))return;m=y}if(m)return u(d,f)}function u(d,f){const p=f[f.length-1],m=o[s][0],y=o[s][1];let b=0;const S=p.children.indexOf(d);let x=!1,T=[];m.lastIndex=0;let C=m.exec(d.value);for(;C;){const I=C.index,D={index:C.index,input:C.input,stack:[...f,d]};let P=y(...C,D);if(typeof P=="string"&&(P=P.length>0?{type:"text",value:P}:void 0),P===!1?m.lastIndex=I+1:(b!==I&&T.push({type:"text",value:d.value.slice(b,I)}),Array.isArray(P)?T.push(...P):P&&T.push(P),b=I+C[0].length,x=!0),!m.global)break;C=m.exec(d.value)}return x?(b<d.value.length&&T.push({type:"text",value:d.value.slice(b)}),p.children.splice(S,1,...T)):T=[d],S+T.length}}function oSe(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([sSe(i[0]),aSe(i[1])])}return t}function sSe(e){return typeof e=="string"?new RegExp(rSe(e),"g"):e}function aSe(e){return typeof e=="function"?e:function(){return e}}const v4="phrasing",b4=["autolink","link","image","label"];function lSe(){return{transforms:[mSe],enter:{literalAutolink:uSe,literalAutolinkEmail:w4,literalAutolinkHttp:w4,literalAutolinkWww:w4},exit:{literalAutolink:pSe,literalAutolinkEmail:hSe,literalAutolinkHttp:dSe,literalAutolinkWww:fSe}}}function cSe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:v4,notInConstruct:b4},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:v4,notInConstruct:b4},{character:":",before:"[ps]",after:"\\/",inConstruct:v4,notInConstruct:b4}]}}function uSe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function w4(e){this.config.enter.autolinkProtocol.call(this,e)}function dSe(e){this.config.exit.autolinkProtocol.call(this,e)}function fSe(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function hSe(e){this.config.exit.autolinkEmail.call(this,e)}function pSe(e){this.exit(e)}function mSe(e){iSe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,gSe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ySe]],{ignore:["link","linkReference"]})}function gSe(e,t,n,r,i){let o="";if(!pV(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!vSe(n)))return!1;const s=bSe(n+r);if(!s[0])return!1;const l={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[l,{type:"text",value:s[1]}]:l}function ySe(e,t,n,r){return!pV(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function vSe(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function bSe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=IM(e,"(");let o=IM(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function pV(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||kg(n)||EC(n))&&(!t||n!==47)}mV.peek=TSe;function wSe(){this.buffer()}function xSe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function kSe(){this.buffer()}function _Se(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function CSe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=zu(this.sliceSerialize(e)).toLowerCase(),n.label=t}function SSe(e){this.exit(e)}function ESe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=zu(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ASe(e){this.exit(e)}function TSe(){return"["}function mV(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),l=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),l(),s(),o+=i.move("]"),o}function ISe(){return{enter:{gfmFootnoteCallString:wSe,gfmFootnoteCall:xSe,gfmFootnoteDefinitionLabelString:kSe,gfmFootnoteDefinition:_Se},exit:{gfmFootnoteCallString:CSe,gfmFootnoteCall:SSe,gfmFootnoteDefinitionLabelString:ESe,gfmFootnoteDefinition:ASe}}}function RSe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:mV},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const l=o.createTracker(s);let u=l.move("[^");const d=o.enter("footnoteDefinition"),f=o.enter("label");return u+=l.move(o.safe(o.associationId(r),{before:u,after:"]"})),f(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?`
650`:" ")+o.indentLines(o.containerFlow(r,l.current()),t?gV:OSe))),d(),u}}function OSe(e,t,n){return t===0?e:gV(e,t,n)}function gV(e,t,n){return(n?"":"    ")+e}const NSe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];yV.peek=BSe;function MSe(){return{canContainEols:["delete"],enter:{strikethrough:LSe},exit:{strikethrough:PSe}}}function DSe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:NSe}],handlers:{delete:yV}}}function LSe(e){this.enter({type:"delete",children:[]},e)}function PSe(e){this.exit(e)}function yV(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function BSe(){return"~"}function jSe(e){return e.length}function FSe(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||jSe,o=[],s=[],l=[],u=[];let d=0,f=-1;for(;++f<e.length;){const k=[],S=[];let x=-1;for(e[f].length>d&&(d=e[f].length);++x<e[f].length;){const T=zSe(e[f][x]);if(n.alignDelimiters!==!1){const C=i(T);S[x]=C,(u[x]===void 0||C>u[x])&&(u[x]=C)}k.push(T)}s[f]=k,l[f]=S}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)o[p]=RM(r[p]);
vendor: 10,873 bytes, lines 650-662
650else{const k=RM(r);for(;++p<d;)o[p]=k}p=-1;const m=[],y=[];for(;++p<d;){const k=o[p];let S="",x="";k===99?(S=":",x=":"):k===108?S=":":k===114&&(x=":");let T=n.alignDelimiters===!1?1:Math.max(1,u[p]-S.length-x.length);const C=S+"-".repeat(T)+x;n.alignDelimiters!==!1&&(T=S.length+T+x.length,T>u[p]&&(u[p]=T),y[p]=T),m[p]=C}s.splice(1,0,m),l.splice(1,0,y),f=-1;const b=[];for(;++f<s.length;){const k=s[f],S=l[f];p=-1;const x=[];for(;++p<d;){const T=k[p]||"";let C="",I="";if(n.alignDelimiters!==!1){const D=u[p]-(S[p]||0),P=o[p];P===114?C=" ".repeat(D):P===99?D%2?(C=" ".repeat(D/2+.5),I=" ".repeat(D/2-.5)):(C=" ".repeat(D/2),I=C):I=" ".repeat(D)}n.delimiterStart!==!1&&!p&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||p)&&x.push(" "),n.alignDelimiters!==!1&&x.push(C),x.push(T),n.alignDelimiters!==!1&&x.push(I),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&x.push("|")}b.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return b.join(`
651`)}function zSe(e){return e==null?"":String(e)}function RM(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function USe(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),VSe);return i(),s}function VSe(e,t,n){return">"+(n?"":" ")+e}function HSe(e,t){return OM(e,t.inConstruct,!0)&&!OM(e,t.notInConstruct,!1)}function OM(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function NM(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
652`&&HSe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
653`}function $Se(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function GSe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function qSe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function WSe(e,t,n,r){const i=qSe(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(GSe(e,n)){const p=n.enter("codeIndented"),m=n.indentLines(o,KSe);return p(),m}const l=n.createTracker(r),u=i.repeat(Math.max($Se(o,i)+1,3)),d=n.enter("codeFenced");let f=l.move(u);if(e.lang){const p=n.enter(`codeFencedLang${s}`);f+=l.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...l.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${s}`);f+=l.move(" "),f+=l.move(n.safe(e.meta,{before:f,after:`
654`,encode:["`"],...l.current()})),p()}return f+=l.move(`
655`),o&&(f+=l.move(o+`
656`)),f+=l.move(u),d(),f}function KSe(e,t,n){return(n?"":"    ")+e}function PT(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function YSe(e,t,n,r){const i=PT(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":`
657`,...u.current()}))),l(),e.title&&(l=n.enter(`title${o}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),s(),d}function XSe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function J1(e){return"&#x"+e.toString(16).toUpperCase()+";"}function v_(e,t,n){const r=zy(e),i=zy(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vV.peek=ZSe;function vV(e,t,n,r){const i=XSe(n),o=n.enter("emphasis"),s=n.createTracker(r),l=s.move(i);let u=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const d=u.charCodeAt(0),f=v_(r.before.charCodeAt(r.before.length-1),d,i);f.inside&&(u=J1(d)+u.slice(1));const p=u.charCodeAt(u.length-1),m=v_(r.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+J1(p));const y=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},l+u+y}function ZSe(e,t,n){return n.options.emphasis||"*"}function QSe(e,t){let n=!1;return DT(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,SA}),!!((!e.depth||e.depth<3)&&AT(e)&&(t.options.setext||n))}function JSe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(QSe(e,n)){const f=n.enter("headingSetext"),p=n.enter("phrasing"),m=n.containerPhrasing(e,{...o.current(),before:`
658`,after:`
659`});return p(),f(),m+`
660`+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
661`))+1))}const s="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
662`,...o.current()});return/^[\t ]/.test(d)&&(d=J1(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),u(),l(),d}bV.peek=e3e;function bV(e){return e.value||""}function e3e(){return"<"}wV.peek=t3e;function wV(e,t,n,r){const i=PT(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${o}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),d+=u.move(")"),s(),d}function t3e(){return"!"}xV.peek=n3e;function xV(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const d=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const p=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return s(),n.stack=f,o(),i==="full"||!d||d!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function n3e(){return"!"}kV.peek=r3e;function kV(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],l=n.compilePattern(s);let u;if(s.atBreak)for(;u=l.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return i+r+i}function r3e(){return"`"}function _V(e,t){const n=AT(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}CV.peek=i3e;function CV(e,t,n,r){const i=PT(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let l,u;if(_V(e,n)){const f=n.stack;n.stack=[],l=n.enter("autolink");let p=s.move("<");return p+=s.move(n.containerPhrasing(e,{before:p,after:">",...s.current()})),p+=s.move(">"),l(),n.stack=f,p}l=n.enter("link"),u=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(u=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),u()),d+=s.move(")"),l(),d}function i3e(e,t,n){return _V(e,n)?"<":"["}SV.peek=o3e;function SV(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const d=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const p=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return s(),n.stack=f,o(),i==="full"||!d||d!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function o3e(){return"["}function BT(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function s3e(e){const t=BT(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function a3e(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function EV(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function l3e(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?a3e(n):BT(n);const l=e.ordered?s==="."?")":".":s3e(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),EV(n)===s&&f){let p=-1;for(;++p<e.children.length;){const m=e.children[p];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=l),n.bulletCurrent=s;const d=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),d}function c3e(e){const t=e.options.listItemIndent||"one";
vendor: 8,199 bytes, lines 662-664
662if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function u3e(e,t,n,r){const i=c3e(n);let o=n.bulletCurrent||BT(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const l=n.createTracker(r);l.move(o+" ".repeat(s-o.length)),l.shift(s);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),f);return u(),d;function f(p,m,y){return m?(y?"":" ".repeat(s))+p:(y?o:o+" ".repeat(s-o.length))+p}}function d3e(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const f3e=IC(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function h3e(e,t,n,r){return(e.children.some(function(s){return f3e(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function p3e(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}AV.peek=m3e;function AV(e,t,n,r){const i=p3e(n),o=n.enter("strong"),s=n.createTracker(r),l=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const d=u.charCodeAt(0),f=v_(r.before.charCodeAt(r.before.length-1),d,i);f.inside&&(u=J1(d)+u.slice(1));const p=u.charCodeAt(u.length-1),m=v_(r.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+J1(p));const y=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},l+u+y}function m3e(e,t,n){return n.options.strong||"*"}function g3e(e,t,n,r){return n.safe(e.value,r)}function y3e(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function v3e(e,t,n){const r=(EV(n)+(n.options.ruleSpaces?" ":"")).repeat(y3e(n));return n.options.ruleSpaces?r.slice(0,-1):r}const TV={blockquote:USe,break:NM,code:WSe,definition:YSe,emphasis:vV,hardBreak:NM,heading:JSe,html:bV,image:wV,imageReference:xV,inlineCode:kV,link:CV,linkReference:SV,list:l3e,listItem:u3e,paragraph:d3e,root:h3e,strong:AV,text:g3e,thematicBreak:v3e};function b3e(){return{enter:{table:w3e,tableData:MM,tableHeader:MM,tableRow:k3e},exit:{codeText:_3e,table:x3e,tableData:x4,tableHeader:x4,tableRow:x4}}}function w3e(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function x3e(e){this.exit(e),this.data.inTable=void 0}function k3e(e){this.enter({type:"tableRow",children:[]},e)}function x4(e){this.exit(e)}function MM(e){this.enter({type:"tableCell",children:[]},e)}function _3e(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,C3e));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function C3e(e,t){return t==="|"?t:e}function S3e(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
663`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:s,tableCell:u,tableRow:l}};function s(y,b,k,S){return d(f(y,k,S),y.align)}function l(y,b,k,S){const x=p(y,k,S),T=d([x]);return T.slice(0,T.indexOf(`
664`))}function u(y,b,k,S){const x=k.enter("tableCell"),T=k.enter("phrasing"),C=k.containerPhrasing(y,{...S,before:o,after:o});return T(),x(),C}function d(y,b){return FSe(y,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function f(y,b,k){const S=y.children;let x=-1;const T=[],C=b.enter("table");for(;++x<S.length;)T[x]=p(S[x],b,k);return C(),T}function p(y,b,k){const S=y.children;let x=-1;const T=[],C=b.enter("tableRow");for(;++x<S.length;)T[x]=u(S[x],y,b,k);return C(),T}function m(y,b,k){let S=TV.inlineCode(y,b,k);return k.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function E3e(){return{exit:{taskListCheckValueChecked:DM,taskListCheckValueUnchecked:DM,paragraph:T3e}}}function A3e(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:I3e}}}function DM(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function T3e(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const l=i[o];if(l.type==="paragraph"){s=l;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function I3e(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);o&&l.move(s);let u=TV.listItem(e,t,n,{...r,...l.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(f){return f+s}}function R3e(){return[lSe(),ISe(),MSe(),b3e(),E3e()]}function O3e(e){return{extensions:[cSe(),RSe(e),DSe(),S3e(e),A3e()]}}const N3e={tokenize:j3e,partial:!0},IV={tokenize:F3e,partial:!0},RV={tokenize:z3e,partial:!0},OV={tokenize:U3e,partial:!0},M3e={tokenize:V3e,partial:!0},NV={name:"wwwAutolink",tokenize:P3e,previous:DV},MV={name:"protocolAutolink",tokenize:B3e,previous:LV},vh={name:"emailAutolink",tokenize:L3e,previous:PV},Yd={};function D3e(){return{text:Yd}}let zm=48;for(;zm<123;)Yd[zm]=vh,zm++,zm===58?zm=65:zm===91&&(zm=97);Yd[43]=vh;Yd[45]=vh;Yd[46]=vh;Yd[95]=vh;Yd[72]=[vh,MV];Yd[104]=[vh,MV];Yd[87]=[vh,NV];Yd[119]=[vh,NV];function L3e(e,t,n){const r=this;let i,o;return s;function s(p){return!IA(p)||!PV.call(r,r.previous)||jT(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(p))}function l(p){return IA(p)?(e.consume(p),l):p===64?(e.consume(p),u):n(p)}function u(p){return p===46?e.check(M3e,f,d)(p):p===45||p===95||Xa(p)?(o=!0,e.consume(p),u):f(p)}function d(p){return e.consume(p),i=!0,u}function f(p){return o&&i&&Cl(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function P3e(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!DV.call(r,r.previous)||jT(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(N3e,e.attempt(IV,e.attempt(RV,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function B3e(e,t,n){const r=this;let i="",o=!1;return s;function s(p){return(p===72||p===104)&&LV.call(r,r.previous)&&!jT(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),e.consume(p),l):n(p)}function l(p){if(Cl(p)&&i.length<5)return i+=String.fromCodePoint(p),e.consume(p),l;if(p===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(p),u}return n(p)}function u(p){return p===47?(e.consume(p),o?d:(o=!0,u)):n(p)}function d(p){return p===null||m_(p)||ho(p)||kg(p)||EC(p)?n(p):e.attempt(IV,e.attempt(RV,f),n)(p)}function f(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function j3e(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function F3e(e,t,n){let r,i,o;return s;function s(d){return d===46||d===95?e.check(OV,u,l)(d):d===null||ho(d)||kg(d)||d!==45&&EC(d)?u(d):(o=!0,e.consume(d),s)}function l(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),s}function u(d){return i||r||!o?n(d):t(d)}}function z3e(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===4
vendor: 6,915 bytes, line 664
6641||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(OV,t,o)(s):s===null||ho(s)||kg(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function U3e(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),o):l===93?(e.consume(l),i):l===60||l===null||ho(l)||kg(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||ho(l)||kg(l)?t(l):r(l)}function o(l){return Cl(l)?s(l):n(l)}function s(l){return l===59?(e.consume(l),r):Cl(l)?(e.consume(l),s):n(l)}}function V3e(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Xa(o)?n(o):t(o)}}function DV(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ho(e)}function LV(e){return!Cl(e)}function PV(e){return!(e===47||IA(e))}function IA(e){return e===43||e===45||e===46||e===95||Xa(e)}function jT(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const H3e={tokenize:Z3e,partial:!0};function $3e(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:K3e,continuation:{tokenize:Y3e},exit:X3e}},text:{91:{name:"gfmFootnoteCall",tokenize:W3e},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:G3e,resolveTo:q3e}}}}function G3e(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!s||!s._balanced)return n(u);const d=zu(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function q3e(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function W3e(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return l;function l(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(o>999||p===93&&!s||p===null||p===91||ho(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(zu(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return ho(p)||(s=!0),o++,e.consume(p),p===92?f:d}function f(p){return p===91||p===92||p===93?(e.consume(p),o++,d):d(p)}}function K3e(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,l;return u;function u(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(b)}function f(b){if(s>999||b===93&&!l||b===null||b===91||ho(b))return n(b);if(b===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=zu(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return ho(b)||(l=!0),s++,e.consume(b),b===92?p:f}function p(b){return b===91||b===92||b===93?(e.consume(b),s++,f):f(b)}function m(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(o)||i.push(o),Ii(e,y,"gfmFootnoteDefinitionWhitespace")):n(b)}function y(b){return t(b)}}function Y3e(e,t,n){return e.check(R2,t,e.attempt(H3e,t,n))}function X3e(e){e.exit("gfmFootnoteDefinition")}function Z3e(e,t,n){const r=this;return Ii(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function Q3e(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,l){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let d=u;for(;d--;)if(s[d][0]==="exit"&&s[d][1].type==="strikethroughSequenceTemporary"&&s[d][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[d][1].end.offset-s[d][1].start.offset){s[u][1].type="strikethroughSequence",s[d][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[d][1].start),end:Object.assign({},s[u][1].end)},p={type:"strikethroughText",start:Object.assign({},s[d][1].end),end:Object.assign({},s[u][1].start)},m=[["enter",f,l],["enter",s[d][1],l],["exit",s[d][1],l],["enter",p,l]],y=l.parser.constructs.insideSpan.null;y&&Tc(m,m.length,0,AC(y,s.slice(d+1,u),l)),Tc(m,m.length,0,[["exit",p,l],["enter",s[u][1],l],["exit",s[u][1],l],["exit",f,l]]),Tc(s,d-1,u-d+3,m),u=d+m.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,l,u){const d=this.previous,f=this.events;let p=0;return m;function m(b){return d===126&&f[f.length-1][1].type!=="characterEscape"?u(b):(s.enter("strikethroughSequenceTemporary"),y(b))}function y(b){const k=zy(d);if(b===126)return p>1?u(b):(s.consume(b),p++,y);if(p<2&&!n)return u(b);const S=s.exit("strikethroughSequenceTemporary"),x=zy(b);return S._open=!x||x===2&&!!k,S._close=!k||k===2&&!!x,l(b)}}}class J3e{constructor(){this.map=[]}
vendor: 4,571 bytes, line 664
664add(t,n,r){e4e(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function e4e(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function t4e(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function n4e(){return{flow:{null:{name:"table",tokenize:r4e,resolveAll:i4e}}}}function r4e(e,t,n){const r=this;let i=0,o=0,s;return l;function l(H){let te=r.events.length-1;for(;te>-1;){const L=r.events[te][1].type;if(L==="lineEnding"||L==="linePrefix")te--;else break}const M=te>-1?r.events[te][1].type:null,Z=M==="tableHead"||M==="tableRow"?P:u;return Z===P&&r.parser.lazy[r.now().line]?n(H):Z(H)}function u(H){return e.enter("tableHead"),e.enter("tableRow"),d(H)}function d(H){return H===124||(s=!0,o+=1),f(H)}function f(H){return H===null?n(H):Ar(H)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),y):n(H):mi(H)?Ii(e,f,"whitespace")(H):(o+=1,s&&(s=!1,i+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),p(H)))}function p(H){return H===null||H===124||ho(H)?(e.exit("data"),f(H)):(e.consume(H),H===92?m:p)}function m(H){return H===92||H===124?(e.consume(H),p):p(H)}function y(H){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(H):(e.enter("tableDelimiterRow"),s=!1,mi(H)?Ii(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):b(H))}function b(H){return H===45||H===58?S(H):H===124?(s=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),k):D(H)}function k(H){return mi(H)?Ii(e,S,"whitespace")(H):S(H)}function S(H){return H===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),x):H===45?(o+=1,x(H)):H===null||Ar(H)?I(H):D(H)}function x(H){return H===45?(e.enter("tableDelimiterFiller"),T(H)):D(H)}function T(H){return H===45?(e.consume(H),T):H===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(H))}function C(H){return mi(H)?Ii(e,I,"whitespace")(H):I(H)}function I(H){return H===124?b(H):H===null||Ar(H)?!s||i!==o?D(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(H)):D(H)}function D(H){return n(H)}function P(H){return e.enter("tableRow"),V(H)}function V(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),V):H===null||Ar(H)?(e.exit("tableRow"),t(H)):mi(H)?Ii(e,V,"whitespace")(H):(e.enter("data"),ee(H))}function ee(H){return H===null||H===124||ho(H)?(e.exit("data"),V(H)):(e.consume(H),H===92?F:ee)}function F(H){return H===92||H===124?(e.consume(H),ee):ee(H)}}function i4e(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],l=!1,u=0,d,f,p;const m=new J3e;for(;++n<e.length;){const y=e[n],b=y[1];y[0]==="enter"?b.type==="tableHead"?(l=!1,u!==0&&(LM(m,t,u,d,f),f=void 0,u=0),d={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},m.add(n,0,[["enter",d,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,p=void 0,o=[0,0,0,0],s=[0,n+1,0,0],l&&(l=!1,f={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},m.add(n,0,[["enter",f,t]])),i=b.type==="tableDelimiterRow"?2:f?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],p=Ax(m,t,o,i,void 0,p),o=[0,0,0,0]),s[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],p=Ax(m,t,o,i,void 0,p)),o=s,s=[o[1],n,0,0])):b.type==="tableHead"?(l=!0,u=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],p=Ax(m,t,o,i,n,p)):s[1]!==0&&(p=Ax(m,t,s,i,n,p)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&LM(m,t,u,d,f),m.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];
vendor: 4,343 bytes, line 664
664y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=t4e(t.events,n))}return e}function Ax(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(o.end=Object.assign({},j0(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=j0(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=j0(t.events,n[2]),f=j0(t.events,n[3]),p={type:l,start:Object.assign({},d),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const m=t.events[n[2]],y=t.events[n[3]];if(m[1].end=Object.assign({},y[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,k=n[3]-n[2]-1;e.add(b,k,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return i!==void 0&&(o.end=Object.assign({},j0(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function LM(e,t,n,r,i){const o=[],s=j0(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function j0(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const o4e={name:"tasklistCheck",tokenize:a4e};function s4e(){return{text:{91:o4e}}}function a4e(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return ho(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return Ar(u)?t(u):mi(u)?e.check({tokenize:l4e},t,n)(u):n(u)}}function l4e(e,t,n){return Ii(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function c4e(e){return qU([D3e(),$3e(),Q3e(e),n4e(),s4e()])}const u4e={};function d4e(e){const t=this,n=e||u4e,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(c4e(n)),o.push(R3e()),s.push(O3e(n))}var k4,PM;function f4e(){if(PM)return k4;PM=1;function e($e){return $e instanceof Map?$e.clear=$e.delete=$e.set=function(){throw new Error("map is read-only")}:$e instanceof Set&&($e.add=$e.clear=$e.delete=function(){throw new Error("set is read-only")}),Object.freeze($e),Object.getOwnPropertyNames($e).forEach(Bt=>{const hn=$e[Bt],Pn=typeof hn;(Pn==="object"||Pn==="function")&&!Object.isFrozen(hn)&&e(hn)}),$e}class t{constructor(Bt){Bt.data===void 0&&(Bt.data={}),this.data=Bt.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n($e){return $e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r($e,...Bt){const hn=Object.create(null);for(const Pn in $e)hn[Pn]=$e[Pn];return Bt.forEach(function(Pn){for(const jn in Pn)hn[jn]=Pn[jn]}),hn}const i="</span>",o=$e=>!!$e.scope,s=($e,{prefix:Bt})=>{if($e.startsWith("language:"))return $e.replace("language:","language-");if($e.includes(".")){const hn=$e.split(".");return[`${Bt}${hn.shift()}`,...hn.map((Pn,jn)=>`${Pn}${"_".repeat(jn+1)}`)].join(" ")}return`${Bt}${$e}`};class l{constructor(Bt,hn){this.buffer="",this.classPrefix=hn.classPrefix,Bt.walk(this)}addText(Bt){this.buffer+=n(Bt)}openNode(Bt){if(!o(Bt))return;const hn=s(Bt.scope,{prefix:this.classPrefix});this.span(hn)}closeNode(Bt){o(Bt)&&(this.buffer+=i)}value(){return this.buffer}span(Bt){this.buffer+=`<span class="${Bt}">`}}const u=($e={})=>{const Bt={children:[]};return Object.assign(Bt,$e),Bt};class d{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Bt){this.top.children.push(Bt)}openNode(Bt){const hn=u({scope:Bt});this.add(hn),this.stack.push(hn)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Bt){return this.constructor._walk(Bt,this.rootNode)}static _walk(Bt,hn){return typeof hn=="string"?Bt.addText(hn):hn.children&&(Bt.openNode(hn),hn.children.forEac
vendor: 21,125 bytes, lines 664-666
664h(Pn=>this._walk(Bt,Pn)),Bt.closeNode(hn)),Bt}static _collapse(Bt){typeof Bt!="string"&&Bt.children&&(Bt.children.every(hn=>typeof hn=="string")?Bt.children=[Bt.children.join("")]:Bt.children.forEach(hn=>{d._collapse(hn)}))}}class f extends d{constructor(Bt){super(),this.options=Bt}addText(Bt){Bt!==""&&this.add(Bt)}startScope(Bt){this.openNode(Bt)}endScope(){this.closeNode()}__addSublanguage(Bt,hn){const Pn=Bt.root;hn&&(Pn.scope=`language:${hn}`),this.add(Pn)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p($e){return $e?typeof $e=="string"?$e:$e.source:null}function m($e){return k("(?=",$e,")")}function y($e){return k("(?:",$e,")*")}function b($e){return k("(?:",$e,")?")}function k(...$e){return $e.map(hn=>p(hn)).join("")}function S($e){const Bt=$e[$e.length-1];return typeof Bt=="object"&&Bt.constructor===Object?($e.splice($e.length-1,1),Bt):{}}function x(...$e){return"("+(S($e).capture?"":"?:")+$e.map(Pn=>p(Pn)).join("|")+")"}function T($e){return new RegExp($e.toString()+"|").exec("").length-1}function C($e,Bt){const hn=$e&&$e.exec(Bt);return hn&&hn.index===0}const I=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function D($e,{joinWith:Bt}){let hn=0;return $e.map(Pn=>{hn+=1;const jn=hn;let Lt=p(Pn),St="";for(;Lt.length>0;){const Te=I.exec(Lt);if(!Te){St+=Lt;break}St+=Lt.substring(0,Te.index),Lt=Lt.substring(Te.index+Te[0].length),Te[0][0]==="\\"&&Te[1]?St+="\\"+String(Number(Te[1])+jn):(St+=Te[0],Te[0]==="("&&hn++)}return St}).map(Pn=>`(${Pn})`).join(Bt)}const P=/\b\B/,V="[a-zA-Z]\\w*",ee="[a-zA-Z_]\\w*",F="\\b\\d+(\\.\\d+)?",H="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",te="\\b(0b[01]+)",M="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Z=($e={})=>{const Bt=/^#![ ]*\//;return $e.binary&&($e.begin=k(Bt,/.*\b/,$e.binary,/\b.*/)),r({scope:"meta",begin:Bt,end:/$/,relevance:0,"on:begin":(hn,Pn)=>{hn.index!==0&&Pn.ignoreMatch()}},$e)},L={begin:"\\\\[\\s\\S]",relevance:0},W={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[L]},U={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[L]},q={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Q=function($e,Bt,hn={}){const Pn=r({scope:"comment",begin:$e,end:Bt,contains:[]},hn);Pn.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const jn=x("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Pn.contains.push({begin:k(/[ ]+/,"(",jn,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Pn},re=Q("//","$"),ne=Q("/\\*","\\*/"),J=Q("#","$"),ge={scope:"number",begin:F,relevance:0},le={scope:"number",begin:H,relevance:0},ve={scope:"number",begin:te,relevance:0},Ee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[L,{begin:/\[/,end:/\]/,relevance:0,contains:[L]}]},st={scope:"title",begin:V,relevance:0},At={scope:"title",begin:ee,relevance:0},yt={begin:"\\.\\s*"+ee,relevance:0};var Be=Object.freeze({__proto__:null,APOS_STRING_MODE:W,BACKSLASH_ESCAPE:L,BINARY_NUMBER_MODE:ve,BINARY_NUMBER_RE:te,COMMENT:Q,C_BLOCK_COMMENT_MODE:ne,C_LINE_COMMENT_MODE:re,C_NUMBER_MODE:le,C_NUMBER_RE:H,END_SAME_AS_BEGIN:function($e){return Object.assign($e,{"on:begin":(Bt,hn)=>{hn.data._beginMatch=Bt[1]},"on:end":(Bt,hn)=>{hn.data._beginMatch!==Bt[1]&&hn.ignoreMatch()}})},HASH_COMMENT_MODE:J,IDENT_RE:V,MATCH_NOTHING_RE:P,METHOD_GUARD:yt,NUMBER_MODE:ge,NUMBER_RE:F,PHRASAL_WORDS_MODE:q,QUOTE_STRING_MODE:U,REGEXP_MODE:Ee,RE_STARTERS_RE:M,SHEBANG:Z,TITLE_MODE:st,UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:At});function he($e,Bt){$e.input[$e.index-1]==="."&&Bt.ignoreMatch()}function Oe($e,Bt){$e.className!==void 0&&($e.scope=$e.className,delete $e.className)}function ye($e,Bt){Bt&&$e.beginKeywords&&($e.begin="\\b("+$e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$e.__beforeBegin=he,$e.keywords=$e.keywords||$e.beginKeywords,delete $e.beginKeywords,$e.relevance===void 0&&($e.relevance=0))}function B($e,Bt){Array.isArray($e.illegal)&&($e.illegal=x(...$e.illegal))}function be($e,Bt){if($e.match){if($e.begin||$e.end)throw new Error("begin & end are not supported with match");$e.begin=$e.match,delete $e.match}}function ie($e,Bt){$e.relevance===void 0&&($e.relevance=1)}const fe=($e,Bt)=>{if(!$e.beforeMatch)return;if($e.starts)throw new Error("beforeMatch cannot be used with starts");const hn=Object.assign({},$e);Object.keys($e).forEach(Pn=>{delete $e[Pn]}),$e.keywords=hn.keywords,$e.begin=k(hn.beforeMatch,m(hn.begin)),$e.starts={relevance:0,contains:[Object.assign(hn,{endsParent:!0})]},$e.relevance=0,delete hn.beforeMatch},ue=["of","and","for","in","not","or","if","then","parent","list","value"],Ce="keyword";function Ue($e,Bt,hn=Ce){const Pn=Object.create(null);return typeof $e=="string"?jn(hn,$e.split(" ")):Array.isArray($e)?jn(hn,$e):Object.keys($e).forEach(function(Lt){Object.assign(Pn,Ue($e[Lt],Bt,Lt))}),Pn;function jn(Lt,St){Bt&&(St=St.map(Te=>Te.toLowerCase())),St.forEach(function(Te){const qe=Te.split("|");Pn[qe[0]]=[Lt,K(qe[0],qe[1])]})}}function K($e,Bt){return Bt?Number(Bt):oe($e)?0:1}function oe($e){return ue.includes($e.toLowerCase())}const Fe={},Le=$e=>{console.error($e)},tt=($e,...Bt)=>{console.log(`WARN: ${$e}`,...Bt)},De=($e,Bt)=>{Fe[`${$e}/${Bt}`]||(console.log(`Deprecated as of ${$e}. ${Bt}`),Fe[`${$e}/${Bt}`]=!0)},Pe=new Error;function mt($e,Bt,{key:hn}){let Pn=0;const jn=$e[hn],Lt={},St={};for(let Te=1;Te<=Bt.length;Te++)St[Te+Pn]=jn[Te],Lt[Te+Pn]=!0,Pn+=T(Bt[Te-1]);$e[hn]=St,$e[hn]._emit=Lt,$e[hn]._multi=!0}function xt($e){if(Array.isArray($e.begin)){if($e.skip||$e.excludeBegin||$e.returnBegin)throw Le("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Pe;if(typeof $e.beginScope!="object"||$e.beginScope===null)throw Le("beginScope must be object"),Pe;mt($e,$e.begin,{key:"beginScope"}),$e.begin=D($e.begin,{joinWith:""})}}function de($e){if(Array.isArray($e.end)){if($e.skip||$e.excludeEnd||$e.returnEnd)throw Le("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Pe;if(typeof $e.endScope!="object"||$e.endScope===null)throw Le("endScope must be object"),Pe;mt($e,$e.end,{key:"endScope"}),$e.end=D($e.end,{joinWith:""})}}function z($e){$e.scope&&typeof $e.scope=="object"&&$e.scope!==null&&($e.beginScope=$e.scope,delete $e.scope)}function Y($e){z($e),typeof $e.beginScope=="string"&&($e.beginScope={_wrap:$e.beginScope}),typeof $e.endScope=="string"&&($e.endScope={_wrap:$e.endScope}),xt($e),de($e)}function me($e){function Bt(St,Te){return new RegExp(p(St),"m"+($e.case_insensitive?"i":"")+($e.unicodeRegex?"u":"")+(Te?"g":""))}class hn{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Te,qe){qe.position=this.position++,this.matchIndexes[this.matchAt]=qe,this.regexes.push([qe,Te]),this.matchAt+=T(Te)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Te=this.regexes.map(qe=>qe[1]);this.matcherRe=Bt(D(Te,{joinWith:"|"}),!0),this.lastIndex=0}exec(Te){this.matcherRe.lastIndex=this.lastIndex;const qe=this.matcherRe.exec(Te);if(!qe)return null;const it=qe.findIndex(($t,sn)=>sn>0&&$t!==void 0),Et=this.matchIndexes[it];return qe.splice(0,it),Object.assign(qe,Et)}}class Pn{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Te){if(this.multiRegexes[Te])return this.multiRegexes[Te];const qe=new hn;return this.rules.slice(Te).forEach(([it,Et])=>qe.addRule(it,Et)),qe.compile(),this.multiRegexes[Te]=qe,qe}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Te,qe){this.rules.push([Te,qe]),qe.type==="begin"&&this.count++}exec(Te){const qe=this.getMatcher(this.regexIndex);qe.lastIndex=this.lastIndex;let it=qe.exec(Te);if(this.resumingScanAtSamePosition()&&!(it&&it.index===this.lastIndex)){const Et=this.getMatcher(0);Et.lastIndex=this.lastIndex+1,it=Et.exec(Te)}return it&&(this.regexIndex+=it.position+1,this.regexIndex===this.count&&this.considerAll()),it}}function jn(St){const Te=new Pn;return St.contains.forEach(qe=>Te.addRule(qe.begin,{rule:qe,type:"begin"})),St.terminatorEnd&&Te.addRule(St.terminatorEnd,{type:"end"}),St.illegal&&Te.addRule(St.illegal,{type:"illegal"}),Te}function Lt(St,Te){const qe=St;if(St.isCompiled)return qe;[Oe,be,Y,fe].forEach(Et=>Et(St,Te)),$e.compilerExtensions.forEach(Et=>Et(St,Te)),St.__beforeBegin=null,[ye,B,ie].forEach(Et=>Et(St,Te)),St.isCompiled=!0;let it=null;return typeof St.keywords=="object"&&St.keywords.$pattern&&(St.keywords=Object.assign({},St.keywords),it=St.keywords.$pattern,delete St.keywords.$pattern),it=it||/\w+/,St.keywords&&(St.keywords=Ue(St.keywords,$e.case_insensitive)),qe.keywordPatternRe=Bt(it,!0),Te&&(St.begin||(St.begin=/\B|\b/),qe.beginRe=Bt(qe.begin),!St.end&&!St.endsWithParent&&(St.end=/\B|\b/),St.end&&(qe.endRe=Bt(qe.end)),qe.terminatorEnd=p(qe.end)||"",St.endsWithParent&&Te.terminatorEnd&&(qe.terminatorEnd+=(St.end?"|":"")+Te.terminatorEnd)),St.illegal&&(qe.illegalRe=Bt(St.illegal)),St.contains||(St.contains=[]),St.contains=[].concat(...St.contains.map(function(Et){return lt(Et==="self"?St:Et)})),St.contains.forEach(function(Et){Lt(Et,qe)}),St.starts&&Lt(St.starts,Te),qe.matcher=jn(qe),qe}if($e.compilerExtensions||($e.compilerExtensions=[]),$e.contains&&$e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return $e.classNameAliases=r($e.classNameAliases||{}),Lt($e)}function Ve($e){return $e?$e.endsWithParent||Ve($e.starts):!1}function lt($e){return $e.variants&&!$e.cachedVariants&&($e.cachedVariants=$e.variants.map(function(Bt){return r($e,{variants:null},Bt)})),$e.cachedVariants?$e.cachedVariants:Ve($e)?r($e,{starts:$e.starts?r($e.starts):null}):Object.isFrozen($e)?r($e):$e}var gt="11.11.1";class dn extends Error{constructor(Bt,hn){super(Bt),this.name="HTMLInjectionError",this.html=hn}}const Hn=n,br=r,ur=Symbol("nomatch"),tr=7,Br=function($e){const Bt=Object.create(null),hn=Object.create(null),Pn=[];let jn=!0;const Lt="Could not find the language '{}', did you forget to load/include a language module?",St={disableAutodetect:!0,name:"Plain text",contains:[]};let Te={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function qe(cn){return Te.noHighlightRe.test(cn)}function it(cn){let Fn=cn.className+" ";Fn+=cn.parentNode?cn.parentNode.className:"";const dr=Te.languageDetectRe.exec(Fn);if(dr){const rr=Gn(dr[1]);return rr||(tt(Lt.replace("{}",dr[1])),tt("Falling back to no-highlight mode for this block.",cn)),rr?dr[1]:"no-highlight"}return Fn.split(/\s+/).find(rr=>qe(rr)||Gn(rr))}function Et(cn,Fn,dr){let rr="",je="";typeof Fn=="object"?(rr=cn,dr=Fn.ignoreIllegals,je=Fn.language):(De("10.7.0","highlight(lang, code, ...args) has been deprecated."),De("10.7.0",`Please use highlight(code, options) instead.
665https://github.com/highlightjs/highlight.js/issues/2277`),je=cn,rr=Fn),dr===void 0&&(dr=!0);const Je={code:rr,language:je};Oo("before:highlight",Je);const Ut=Je.result?Je.result:$t(Je.language,Je.code,dr);return Ut.code=Je.code,Oo("after:highlight",Ut),Ut}function $t(cn,Fn,dr,rr){const je=Object.create(null);function Je(yn,Nn){return yn.keywords[Nn]}function Ut(){if(!er.keywords){di.addText(Hr);return}let yn=0;er.keywordPatternRe.lastIndex=0;let Nn=er.keywordPatternRe.exec(Hr),yr="";for(;Nn;){yr+=Hr.substring(yn,Nn.index);const fr=Zr.case_insensitive?Nn[0].toLowerCase():Nn[0],Ri=Je(er,fr);if(Ri){const[Co,uu]=Ri;if(di.addText(yr),yr="",je[fr]=(je[fr]||0)+1,je[fr]<=tr&&(No+=uu),Co.startsWith("_"))yr+=Nn[0];else{const nc=Zr.classNameAliases[Co]||Co;Zn(Nn[0],nc)}}else yr+=Nn[0];yn=er.keywordPatternRe.lastIndex,Nn=er.keywordPatternRe.exec(Hr)}yr+=Hr.substring(yn),di.addText(yr)}function un(){if(Hr==="")return;let yn=null;if(typeof er.subLanguage=="string"){if(!Bt[er.subLanguage]){di.addText(Hr);return}yn=$t(er.subLanguage,Hr,!0,is[er.subLanguage]),is[er.subLanguage]=yn._top}else yn=Tn(Hr,er.subLanguage.length?er.subLanguage:null);er.relevance>0&&(No+=yn.relevance),di.__addSublanguage(yn._emitter,yn.language)}function Xt(){er.subLanguage!=null?un():Ut(),Hr=""}function Zn(yn,Nn){yn!==""&&(di.startScope(Nn),di.addText(yn),di.endScope())}function Bi(yn,Nn){let yr=1;const fr=Nn.length-1;for(;yr<=fr;){if(!yn._emit[yr]){yr++;continue}const Ri=Zr.classNameAliases[yn[yr]]||yn[yr],Co=Nn[yr];Ri?Zn(Co,Ri):(Hr=Co,Ut(),Hr=""),yr++}}function ri(yn,Nn){return yn.scope&&typeof yn.scope=="string"&&di.openNode(Zr.classNameAliases[yn.scope]||yn.scope),yn.beginScope&&(yn.beginScope._wrap?(Zn(Hr,Zr.classNameAliases[yn.beginScope._wrap]||yn.beginScope._wrap),Hr=""):yn.beginScope._multi&&(Bi(yn.beginScope,Nn),Hr="")),er=Object.create(yn,{parent:{value:er}}),er}function ot(yn,Nn,yr){let fr=C(yn.endRe,yr);if(fr){if(yn["on:end"]){const Ri=new t(yn);yn["on:end"](Nn,Ri),Ri.isMatchIgnored&&(fr=!1)}if(fr){for(;yn.endsParent&&yn.parent;)yn=yn.parent;return yn}}if(yn.endsWithParent)return ot(yn.parent,Nn,yr)}function jt(yn){return er.matcher.regexIndex===0?(Hr+=yn[0],1):(_o=!0,0)}function gr(yn){const Nn=yn[0],yr=yn.rule,fr=new t(yr),Ri=[yr.__beforeBegin,yr["on:begin"]];for(const Co of Ri)if(Co&&(Co(yn,fr),fr.isMatchIgnored))return jt(Nn);return yr.skip?Hr+=Nn:(yr.excludeBegin&&(Hr+=Nn),Xt(),!yr.returnBegin&&!yr.excludeBegin&&(Hr=Nn)),ri(yr,yn),yr.returnBegin?0:Nn.length}function $n(yn){const Nn=yn[0],yr=Fn.substring(yn.index),fr=ot(er,yn,yr);if(!fr)return ur;const Ri=er;er.endScope&&er.endScope._wrap?(Xt(),Zn(Nn,er.endScope._wrap)):er.endScope&&er.endScope._multi?(Xt(),Bi(er.endScope,yn)):Ri.skip?Hr+=Nn:(Ri.returnEnd||Ri.excludeEnd||(Hr+=Nn),Xt(),Ri.excludeEnd&&(Hr=Nn));do er.scope&&di.closeNode(),!er.skip&&!er.subLanguage&&(No+=er.relevance),er=er.parent;while(er!==fr.parent);return fr.starts&&ri(fr.starts,yn),Ri.returnEnd?0:Nn.length}function Pr(){const yn=[];for(let Nn=er;Nn!==Zr;Nn=Nn.parent)Nn.scope&&yn.unshift(Nn.scope);yn.forEach(Nn=>di.openNode(Nn))}let ui={};function jr(yn,Nn){const yr=Nn&&Nn[0];if(Hr+=yn,yr==null)return Xt(),0;if(ui.type==="begin"&&Nn.type==="end"&&ui.index===Nn.index&&yr===""){if(Hr+=Fn.slice(Nn.index,Nn.index+1),!jn){const fr=new Error(`0 width match regex (${cn})`);throw fr.languageName=cn,fr.badRule=ui.rule,fr}return 1}if(ui=Nn,Nn.type==="begin")return gr(Nn);if(Nn.type==="illegal"&&!dr){const fr=new Error('Illegal lexeme "'+yr+'" for mode "'+(er.scope||"<unnamed>")+'"');throw fr.mode=er,fr}else if(Nn.type==="end"){const fr=$n(Nn);if(fr!==ur)return fr}if(Nn.type==="illegal"&&yr==="")return Hr+=`
666`,1;if(Ti>1e5&&Ti>Nn.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Hr+=yr,yr.length}const Zr=Gn(cn);if(!Zr)throw Le(Lt.replace("{}",cn)),new Error('Unknown language: "'+cn+'"');const ro=me(Zr);let Go="",er=rr||ro;const is={},di=new Te.__emitter(Te);Pr();let Hr="",No=0,Mo=0,Ti=0,_o=!1;try{if(Zr.__emitTokens)Zr.__emitTokens(Fn,di);else{for(er.matcher.considerAll();;){Ti++,_o?_o=!1:er.matcher.considerAll(),er.matcher.lastIndex=Mo;const yn=er.matcher.exec(Fn);if(!yn)break;const Nn=Fn.substring(Mo,yn.index),yr=jr(Nn,yn);Mo=yn.index+yr}jr(Fn.substring(Mo))}return di.finalize(),Go=di.toHTML(),{language:cn,value:Go,relevance:No,illegal:!1,_emitter:di,_top:er}}catch(yn){if(yn.message&&yn.message.includes("Illegal"))return{language:cn,value:Hn(Fn),illegal:!0,relevance:0,_illegalBy:{message:yn.message,index:Mo,context:Fn.slice(Mo-100,Mo+100),mode:yn.mode,resultSoFar:Go},_emitter:di};if(jn)return{language:cn,value:Hn(Fn),illegal:!1,relevance:0,errorRaised:yn,_emitter:di,_top:er};throw yn}}function sn(cn){const Fn={value:Hn(cn),illegal:!1,relevance:0,_top:St,_emitter:new Te.__emitter(Te)};return Fn._emitter.addText(cn),Fn}function Tn(cn,Fn){Fn=Fn||Te.languages||Object.keys(Bt);const dr=sn(cn),rr=Fn.filter(Gn).filter(Di).map(Xt=>$t(Xt,cn,!1));rr.unshift(dr);const je=rr.sort((Xt,Zn)=>{if(Xt.relevance!==Zn.relevance)return Zn.relevance-Xt.relevance;if(Xt.language&&Zn.language){if(Gn(Xt.language).supersetOf===Zn.language)return 1;if(Gn(Zn.language).supersetOf===Xt.language)return-1}return 0}),[Je,Ut]=je,un=Je;return un.secondBest=Ut,un}function kn(cn,Fn,dr){const rr=Fn&&hn[Fn]||dr;cn.classList.add("hljs"),cn.classList.add(`language-${rr}`)}function rn(cn){let Fn=null;const dr=it(cn);if(qe(dr))return;if(Oo("before:highlightElement",{el:cn,language:dr}),cn.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",cn);return}if(cn.children.length>0&&(Te.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(cn)),Te.throwUnescapedHTML))throw new dn("One of your code blocks includes unescaped HTML.",cn.innerHTML);Fn=cn;const rr=Fn.textContent,je=dr?Et(rr,{language:dr,ignoreIllegals:!0}):Tn(rr);cn.innerHTML=je.value,cn.dataset.highlighted="yes",kn(cn,dr,je.language),cn.result={language:je.language,re:je.relevance,relevance:je.relevance},je.secondBest&&(cn.secondBest={language:je.secondBest.language,relevance:je.secondBest.relevance}),Oo("after:highlightElement",{el:cn,result:je,text:rr})}function Wn(cn){Te=br(Te,cn)}const qr=()=>{Jn(),De("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")};function Yr(){Jn(),De("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")}let gi=!1;function Jn(){function cn(){Jn()}if(document.readyState==="loading"){gi||window.addEventListener("DOMContentLoaded",cn,!1),gi=!0;return}document.querySelectorAll(Te.cssSelector).forEach(rn)}function Tr(cn,Fn){let dr=null;try{dr=Fn($e)}catch(rr){if(Le("Language definition for '{}' could not be registered.".replace("{}",cn)),jn)Le(rr);else throw rr;dr=St}dr.name||(dr.name=cn),Bt[cn]=dr,dr.rawDefinition=Fn.bind(null,$e),dr.aliases&&ni(dr.aliases,{languageName:cn})}function zr(cn){delete Bt[cn];for(const Fn of Object.keys(hn))hn[Fn]===cn&&delete hn[Fn]}function Kn(){return Object.keys(Bt)}function Gn(cn){return cn=(cn||"").toLowerCase(),Bt[cn]||Bt[hn[cn]]}function ni(cn,{languageName:Fn}){typeof cn=="string"&&(cn=[cn]),cn.forEach(dr=>{hn[dr.toLowerCase()]=Fn})}function Di(cn){const Fn=Gn(cn);return Fn&&!Fn.disableAutodetect}function Ro(cn){cn["before:highlightBlock"]&&!cn["before:highlightElement"]&&(cn["before:highlightElement"]=Fn=>{cn["before:highlightBlock"](Object.assign({block:Fn.el},Fn))}),cn["after:highlightBlock"]&&!cn["after:highlightElement"]&&(cn["after:highlightElement"]=Fn=>{cn["after:highlightBlock"](Object.assign({block:Fn.el},Fn))})}function Si(cn){Ro(cn),Pn.push(cn)}function Gs(cn){const Fn=Pn.indexOf(cn);Fn!==-1&&Pn.splice(Fn,1)}function Oo(cn,Fn){const dr=cn;Pn.forEach(function(rr){rr[dr]&&rr[dr](Fn)})}function Hi(cn){return De("10.7.0","highlightBlock will be removed entirely in v12.0"),De("10.7.0","Please use highlightElement now."),rn(cn)}Object.assign($e,{highlight:Et,highlightAuto:Tn,highlightAll:Jn,highlightElement:rn,highlightBlock:Hi,configure:Wn,initHighlighting:qr,initHighlightingOnLoad:Yr,registerLanguage:Tr,unregisterLanguage:zr,listLanguages:Kn,getLanguage:Gn,registerAliases:ni,autoDetection:Di,inherit:br,addPlugin:Si,removePlugin:Gs}),$e.debugMode=function(){jn=!1},$e.safeMode=function(){jn=!0},$e.versionString=gt,$e.regex={concat:k,lookahead:m,either:x,optional:b,anyNumberOfTimes:y};for(const cn in Be)typeof Be[cn]=="object"&&e(Be[cn]);return Object.assign($e,Be),$e},Lr=Br({});return Lr.newInstance=()=>Br({}),k4=Lr,Lr.HighlightJS=Lr,Lr.default=Lr,k4}var h4e=f4e();const El=a2(h4e),BM="[A-Za-z$_][0-9A-Za-z$_]*",p4e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],m4e=["true","false","null","undefined","NaN","Infinity"],BV=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],jV=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],FV=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decode
666URI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],g4e=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],y4e=[].concat(FV,BV,jV);function FT(e){const t=e.regex,n=(Q,{after:re})=>{const ne="</"+Q[0].slice(1);return Q.input.indexOf(ne,re)!==-1},r=BM,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,re)=>{const ne=Q[0].length+Q.index,J=Q.input[ne];if(J==="<"||J===","){re.ignoreMatch();return}J===">"&&(n(Q,{after:ne})||re.ignoreMatch());let ge;const le=Q.input.substring(ne);if(ge=le.match(/^\s*=/)){re.ignoreMatch();return}if((ge=le.match(/^\s+extends\s+/))&&ge.index===0){re.ignoreMatch();return}}},l={$pattern:BM,keyword:p4e,literal:m4e,built_in:y4e,"variable.language":g4e},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},T={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,k,S,{match:/\$\d+/},p];m.contains=C.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(C)});const I=[].concat(T,m.contains),D=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(I)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:D},V={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...BV,...jV]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},H={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(Q){return t.concat("(?!",Q.join("|"),")")}const Z={match:t.concat(/\b/,M([...FV,"super","import"].map(Q=>`${Q}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},U="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",q={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(U)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,k,S,T,{match:/\$\d+/},p,ee,{scope:"attr",match:r+t.lookahead(":"),relevance:0},q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,e.REGEXP_MODE,{className:"function",begin:U,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0}
vendor: 4,313 bytes, line 666
666,{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},H,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},Z,te,V,W,{match:/\$[(.]/}]}}const b_="[A-Za-z$_][0-9A-Za-z$_]*",zV=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],UV=["true","false","null","undefined","NaN","Infinity"],VV=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],HV=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$V=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],GV=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qV=[].concat($V,VV,HV);function v4e(e){const t=e.regex,n=(Q,{after:re})=>{const ne="</"+Q[0].slice(1);return Q.input.indexOf(ne,re)!==-1},r=b_,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,re)=>{const ne=Q[0].length+Q.index,J=Q.input[ne];if(J==="<"||J===","){re.ignoreMatch();return}J===">"&&(n(Q,{after:ne})||re.ignoreMatch());let ge;const le=Q.input.substring(ne);if(ge=le.match(/^\s*=/)){re.ignoreMatch();return}if((ge=le.match(/^\s+extends\s+/))&&ge.index===0){re.ignoreMatch();return}}},l={$pattern:b_,keyword:zV,literal:UV,built_in:qV,"variable.language":GV},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},T={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,k,S,{match:/\$\d+/},p];m.contains=C.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(C)});const I=[].concat(T,m.contains),D=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(I
vendor: 4,248 bytes, line 666
666)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:D},V={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...VV,...HV]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},H={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(Q){return t.concat("(?!",Q.join("|"),")")}const Z={match:t.concat(/\b/,M([...$V,"super","import"].map(Q=>`${Q}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},U="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",q={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(U)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,b,k,S,T,{match:/\$\d+/},p,ee,{scope:"attr",match:r+t.lookahead(":"),relevance:0},q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,e.REGEXP_MODE,{className:"function",begin:U,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},H,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},Z,te,V,W,{match:/\$[(.]/}]}}function zT(e){const t=e.regex,n=v4e(e),r=b_,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:b_,keyword:zV.concat(u),literal:UV,built_in:qV.concat(i),"variable.language":GV},f={className:"meta",begin:"@"+r},p=(k,S,x)=>{const T=k.contains.findIndex(C=>C.label===S);if(T===-1)throw new Error("can not find mode to replace");k.contains.splice(T,1,x)};Object.assign(n.keywords,d),n.exports.PARAMS_CONTAINS.push(f);const m=n.contains.find(k=>k.scope==="attr"),y=Object.assign({},m,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,m,y]),n.contains=n.contains.concat([f,o,s,y]),p(n,"shebang",e.SHEBANG()),p(n,"use_strict",l);const b=n.contains.find(k=>k.label==="func.def");return b.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["t
vendor: 4,349 bytes, line 666
666s","tsx","mts","cts"]}),n}function WV(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(o,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),u=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,u,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,s,u,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const b4e=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),w4e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],x4e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],k4e=[...w4e,...x4e],_4e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),C4e=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invali
666d","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),S4e=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),E4e=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-
666area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function A4e(e){const t=e.regex,n=b4e(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0}
666,{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+C4e.join("|")+")"},{begin:":(:)?("+S4e.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+E4e.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:_4e.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+k4e.join("|")+")\\b"}]}}function KV(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const u={match:/\\"/},d={className:"string",begin:/'/,end:/'/},f={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],y=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),b={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},k=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],S=["true","false"],x={match:/(\/[a-z._-]+)+/},T=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],C=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],I=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],D=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:k,literal:S,built_in:[...T,...C,"set","shopt",...I,...D]},contains:[y,e.SHEBANG(),b,p,o,s,x,l,u,d,f,n]}}function T4e(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}El.registerLanguage("javascript",FT);El.registerLanguage("js",FT);El.registerLanguage("jsx",FT);El.registerLanguage("typescript",zT);El.registerLanguage("ts",zT);El.registerLanguage("tsx",zT);El.registerLanguage("html",WV);El.registerLanguage("xml",WV);El.registerLanguage("css",A4e);El.registerLanguage("bash",KV);El.registerLanguage("sh",KV);El.registerLanguage("json",T4e);function I4e({className:e,children:t}){const n=Se.useRef(null),r=(e==null?void 0:e.replace("language-",""))||"",i=String(t).replace(/\n$/,"");return Se.useEffect(()=>{n.current&&(r&&El.getLanguage(r)?n.current.innerHTML=El.highlight(i,{language:r}).value:n.current.innerHTML=El.highlightAuto(i).value)},[i,r]),_.jsx("code",{ref:n,className:"block font-mono text-[13.5px] leading-relaxed",children:i})}function R4e(e){var r;if(!e)return null;const t=RU();if(!((r=t==null?void 0:t.posts)!=null&&r.length))return null;const n=t.posts.findIndex(i=>i.id===e);return n===-1?null:{post:t.posts[n],prevPost:n<t.posts.length-1?t.posts[n+1]:null,nextPost:n>0?t.posts[n-1]:null,markdown:t.markdown||null}}function O4e(){const{id:e}=W$(),[t]=Se.useState(()=>R4e(e)),[n,r]=Se.useState((t==null?void 0:t.post)??null),[i,o]=Se.useState((t==null?void 0:t.prevPost)??null),[s,l]=Se.useState((t==null?void 0:t.nextPost)??null),[u,d]=Se.useState((t==null?void 0:t.markdown)??""),[f,p]=Se.useState(!(t!=null&&t.markdown));return Se.useEffect(()=>{window.scrollTo({top:0})},[e]),Se.useEffect(()=>{var y;if(!e||t!=null&&t.markdown&&((y=t.post)==null?void 0:y.id)===e)return;let m=!1;return p(!0),Promise.all([OU(),fetch(`${wT}/posts/${e}.md`).then(b=>{if(!b.ok)throw new Error("Not found");return b.text()})]).then(([b,k])=>{if(m)return;const S=b.findIndex(x=>x.id===e);S!==-1&&(r(b[S]),o(S<b.length-1?b[S+1]:null),l(S>0?b[S-1]:null)),d(k)}).catch(b=>{m||(console.error(b),d(""))}).finally(()=>{m||p(!1)}),()=>{m=!0}},[e]),f?_.jsx("div",{className:"max-w-[680px] mx-auto px-6 pt-32 pb-24",children:_.jsx("p",{className:"text-slate-400 text-sm",children:"Loading..."})}):n?_.jsxs("article",{className:"max-w-[680px] mx-auto px-6 pt-32 pb-24",children:[_.jsxs(zp,{to:"/changelog",className:"inline-flex items-center gap-1.5 text-sm font-medium text-[#1355FF] dark:text-[#6B9FFF] hover:text-[#0F44CC] dark:hover:text-white transition-colors mb-10",children:[_.jsx(uq,{className:"w-4 h-4"}),"Changelog"]}),_.jsxs("header",{className:"mb-8",children:[_.jsx("time",{className:"block text-sm font-medium text-brand-600 dark:text-brand-400 uppercase tracking-wide mb-3",children:IU(n.date)}),_.jsx("h1",{className:"text-3xl md:text-4xl font-bold gradient-text tracking-tight leading-tight mb-4",children:n.title}),_.jsxs("div",{className:"flex items-center gap-2.5",children:[n.author.avatar?_.jsx("img",{src:p_(n.author.avatar),alt:n.author.name,className:"w-8 h-8 rounded-full object-cover"}):_.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-[#1355FF] to-[#9333ea] flex-shrink-0"}),_.jsxs("div",{className:"flex flex-col",children:[_.jsx("span",{className:"text-sm font-semibold text-slate-900 dark:text-white leading-tight",children:n.author.name}),n.author.role&&_.jsx("span",{className:"text-[13px] text-slate-400 dark:text-slate-500 leading-tight",children:n.author.role})]})]})]}),n.image&&_.jsx("div",{className:"rounded-xl border border-slate-200 dark:border-white/5 overflow-hidden mb-10",children:_.jsx("img",{src:p_(n.image),alt:n.title,className:"w-full h-auto"})}),n.version&&_.jsx("span",{className:"inline-block font-mono text-[13px] font-medium text-[#1355FF] dark:text-[#6B9FFF] bg-[#1355FF]/5 dark:bg-[#1355FF]/10 px-2.5 py-1 rounded-md mb-5",children:n.version}),u&&_.jsx("div",{className:"changelog-body",children:_.jsx(QCe,{remarkPlugins:[d4e],components:{h2:({children:m})=>_.jsx("h2",{className:"text-[22px] font-bold text-slate-900 dark:text-white tracking-tight mt-10 mb-3 leading-snug first:mt-0",children:m}),h3:({children:m})=>_.jsx("h3",{className:"text-lg font-semibold text-slate-900 dark:text-white mt-8 mb-2",children:m}),p:({children:m})=>_.jsx("p",{className:"text-base text-slate-500 dark:text-slate-400 leading-[1.8] mb-4 last:mb-0",children:m}),ul:({children:m})=>_.jsx("ul",{className:"list-disc pl-6 mb-4 space-y-1.5",children:m}),ol:({children:m})=>_.jsx("ol",{className:"list-decimal pl-6 mb-4 space-y-1.5",children:m}),li:({children:m})=>_.jsx("li",{className:"text-base text-slate-500 dark:text-slate-400 leading-[1.8]",children:m}),strong:({children:m})=>_.jsx("strong",{className:"font-semibold text-slate-900 dark:text-white",children:m}),a:({href:m,children:y})=>_.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-[#1355FF] dark:text-[#6B9FFF] underline decoration-[#1355FF]/30 dark:decoration-[#6B9FFF]/30 underline-offset-2 hover:
666decoration-[#1355FF] dark:hover:decoration-[#6B9FFF] transition-colors",children:y}),code:({className:m,children:y})=>m!=null&&m.includes("language-")?_.jsx(I4e,{className:m,children:y}):_.jsx("code",{className:"font-mono text-sm bg-slate-100 dark:bg-white/5 px-1.5 py-0.5 rounded text-slate-900 dark:text-slate-200",children:y}),pre:({children:m})=>_.jsx("pre",{className:"bg-[#0B0C10] rounded-lg px-6 py-5 mb-5 overflow-x-auto border border-white/5",children:m}),hr:()=>_.jsx("hr",{className:"border-0 border-t border-slate-200 dark:border-white/5 my-10"}),table:({children:m})=>_.jsx("div",{className:"rounded-[10px] border border-slate-200 dark:border-white/10 overflow-hidden my-4 mb-5",children:_.jsx("table",{className:"w-full text-[13px] leading-[1.2] border-collapse",children:m})}),thead:({children:m})=>_.jsx("thead",{children:m}),th:({children:m})=>_.jsx("th",{className:"bg-slate-50 dark:bg-white/5 text-[11px] font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-[0.5px] text-left px-3.5 py-1.5 border-b border-slate-200 dark:border-white/10",children:m}),td:({children:m})=>_.jsx("td",{className:"text-slate-500 dark:text-slate-400 px-3.5 py-1.5 border-b border-slate-200/60 dark:border-white/5 last:[&:parent]:border-b-0",children:m}),tr:({children:m})=>_.jsx("tr",{className:"last:*:border-b-0",children:m}),img:({src:m,alt:y})=>_.jsxs("figure",{className:"rounded-lg border border-slate-200 dark:border-white/5 overflow-hidden my-6",children:[_.jsx("img",{src:m,alt:y||"",className:"w-full h-auto",loading:"lazy"}),y&&_.jsx("figcaption",{className:"text-[13px] text-slate-400 dark:text-slate-500 text-center py-2.5 px-4 border-t border-slate-200 dark:border-white/5 bg-white dark:bg-dark-800",children:y})]})},children:u})}),(i||s)&&_.jsxs("nav",{className:"mt-14 pt-8 border-t border-slate-200 dark:border-white/5 flex justify-between items-start",children:[i?_.jsxs(zp,{to:`/changelog/${i.id}`,className:"group text-left",children:[_.jsx("div",{className:"text-xs uppercase tracking-wider text-slate-400 dark:text-slate-500 mb-1",children:"Previous"}),_.jsx("div",{className:"text-[15px] font-semibold text-slate-900 dark:text-white group-hover:text-[#1355FF] dark:group-hover:text-[#6B9FFF] transition-colors",children:i.title})]}):_.jsx("div",{}),s?_.jsxs(zp,{to:`/changelog/${s.id}`,className:"group text-right",children:[_.jsx("div",{className:"text-xs uppercase tracking-wider text-slate-400 dark:text-slate-500 mb-1",children:"Next"}),_.jsx("div",{className:"text-[15px] font-semibold text-slate-900 dark:text-white group-hover:text-[#1355FF] dark:group-hover:text-[#6B9FFF] transition-colors",children:s.title})]}):_.jsx("div",{})]})]}):_.jsxs("div",{className:"max-w-[680px] mx-auto px-6 pt-32 pb-24 text-center",children:[_.jsx("h1",{className:"text-3xl font-bold text-slate-900 dark:text-white mb-4",children:"Post not found"}),_.jsx(zp,{to:"/changelog",className:"text-[#1355FF] dark:text-[#6B9FFF] hover:underline text-sm font-medium",children:"Back to Changelog"})]})}const jM="superdoc-theme";function N4e(){const[e,t]=Se.useState(()=>{try{return localStorage.getItem(jM)==="dark"}catch{return!1}});return Se.useEffect(()=>{e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark");try{localStorage.setItem(jM,e?"dark":"light")}catch{}},[e]),{isDark:e,toggleTheme:()=>t(r=>!r)}}function M4e(){const{isDark:e,toggleTheme:t}=N4e();return _.jsxs("div",{className:"min-h-screen bg-slate-50 dark:bg-dark-900 text-slate-600 dark:text-slate-200 font-sans transition-colors duration-300",children:[_.jsx(TD,{isDark:e,toggleTheme:t}),_.jsx("main",{className:"min-h-[1000px]",children:_.jsx(aG,{})}),_.jsx(CU,{})]})}const YV=document.getElementById("root");if(!YV)throw new Error("Could not find root element to mount to");const D4e=o$.createRoot(YV);D4e.render(_.jsx(MG,{children:_.jsxs(cG,{children:[_.jsx(bb,{path:"/",element:_.jsx(Fwe,{})}),_.jsxs(bb,{element:_.jsx(M4e,{}),children:[_.jsx(bb,{path:"/changelog",element:_.jsx(Uwe,{})}),_.jsx(bb,{path:"/changelog/:id",element:_.jsx(O4e,{})})]})]})}));export{Zs as $,H_ as A,Rk as B,As as C,R9 as D,xi as E,zs as F,Ne as G,dt as H,Ze as I,ut as J,et as K,Un as L,Lu as M,yg as N,gn as O,Nd as P,Gr as Q,po as R,Wr as S,Us as T,pr as U,wo as V,g1 as W,Dr as X,ki as Y,ei as Z,li as _,y5 as a,HZ as a0,Hs as a1,Ai as a2,ZJ as b,$ee as c,s5 as d,Qte as e,NL as f,zL as g,G_ as h,x2 as i,fJ as j,ene as k,$o as l,Gy as m,qy as n,T1 as o,Q_ as p,v5 as q,Zb as r,rP as s,c9 as t,v2 as u,jk as v,Z0 as w,Wee as x,w5 as y,Qb as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.