@valbuild/ui 0.59.0 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-7eyMwycs.js +239 -0
- package/{server/.tmp/assets/index-FU9L7oI1.css → dist/assets/index-ctzNOPVY.css} +1 -1
- package/dist/index.html +13 -0
- package/dist/valbuild-ui.cjs.d.ts +3 -14
- package/package.json +7 -9
- package/server/.tmp/assets/index-AOJXxfaA.js +239 -0
- package/server/.tmp/assets/index-ctzNOPVY.css +2 -0
- package/server/.tmp/index.html +2 -2
- package/server/dist/.vite/manifest.json +0 -5
- package/server/dist/valbuild-ui-server.cjs.js +1 -94
- package/server/dist/valbuild-ui-server.esm.js +42 -64
- package/dist/valbuild-ui.cjs.js +0 -88148
- package/dist/valbuild-ui.esm.js +0 -88132
- package/server/.tmp/assets/index-REL3fiGb.js +0 -237
- package/server/dist/valbuild-ui-main.cjs.js +0 -94223
- package/server/dist/valbuild-ui-main.esm.js +0 -94224
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
var qD=Object.defineProperty;var GD=(e,t,n)=>t in e?qD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var vt=(e,t,n)=>(GD(e,typeof t!="symbol"?t+"":t,n),n),YD=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Bv=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var bp=(e,t,n)=>(YD(e,t,"access private method"),n);function lO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var XD=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ai(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ZD(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var cO={exports:{}},lg={},uO={exports:{}},We={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its 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 Wf=Symbol.for("react.element"),JD=Symbol.for("react.portal"),QD=Symbol.for("react.fragment"),eI=Symbol.for("react.strict_mode"),tI=Symbol.for("react.profiler"),nI=Symbol.for("react.provider"),rI=Symbol.for("react.context"),oI=Symbol.for("react.forward_ref"),iI=Symbol.for("react.suspense"),sI=Symbol.for("react.memo"),aI=Symbol.for("react.lazy"),yS=Symbol.iterator;function lI(e){return e===null||typeof e!="object"?null:(e=yS&&e[yS]||e["@@iterator"],typeof e=="function"?e:null)}var dO={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fO=Object.assign,pO={};function nu(e,t,n){this.props=e,this.context=t,this.refs=pO,this.updater=n||dO}nu.prototype.isReactComponent={};nu.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};nu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function hO(){}hO.prototype=nu.prototype;function Sb(e,t,n){this.props=e,this.context=t,this.refs=pO,this.updater=n||dO}var kb=Sb.prototype=new hO;kb.constructor=Sb;fO(kb,nu.prototype);kb.isPureReactComponent=!0;var xS=Array.isArray,mO=Object.prototype.hasOwnProperty,Eb={current:null},gO={key:!0,ref:!0,__self:!0,__source:!0};function vO(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)mO.call(t,r)&&!gO.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Wf,type:e,key:i,ref:s,props:o,_owner:Eb.current}}function cI(e,t){return{$$typeof:Wf,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _b(e){return typeof e=="object"&&e!==null&&e.$$typeof===Wf}function uI(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var bS=/\/+/g;function Uv(e,t){return typeof e=="object"&&e!==null&&e.key!=null?uI(""+e.key):t.toString(36)}function rh(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Wf:case JD:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Uv(s,0):r,xS(o)?(n="",e!=null&&(n=e.replace(bS,"$&/")+"/"),rh(o,t,n,"",function(c){return c})):o!=null&&(_b(o)&&(o=cI(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(bS,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",xS(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Uv(i,a);s+=rh(i,t,n,l,o)}else if(l=lI(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Uv(i,a++),s+=rh(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function wp(e,t,n){if(e==null)return e;var r=[],o=0;return rh(e,r,"","",function(i){return t.call(n,i,o++)}),r}function dI(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Jn={current:null},oh={transition:null},fI={ReactCurrentDispatcher:Jn,ReactCurrentBatchConfig:oh,ReactCurrentOwner:Eb};We.Children={map:wp,forEach:function(e,t,n){wp(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return wp(e,function(){t++}),t},toArray:function(e){return wp(e,function(t){return t})||[]},only:function(e){if(!_b(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};We.Component=nu;We.Fragment=QD;We.Profiler=tI;We.PureComponent=Sb;We.StrictMode=eI;We.Suspense=iI;We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fI;We.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=fO({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Eb.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)mO.call(t,l)&&!gO.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Wf,type:e.type,key:o,ref:i,props:r,_owner:s}};We.createContext=function(e){return e={$$typeof:rI,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:nI,_context:e},e.Consumer=e};We.createElement=vO;We.createFactory=function(e){var t=vO.bind(null,e);return t.type=e,t};We.createRef=function(){return{current:null}};We.forwardRef=function(e){return{$$typeof:oI,render:e}};We.isValidElement=_b;We.lazy=function(e){return{$$typeof:aI,_payload:{_status:-1,_result:e},_init:dI}};We.memo=function(e,t){return{$$typeof:sI,type:e,compare:t===void 0?null:t}};We.startTransition=function(e){var t=oh.transition;oh.transition={};try{e()}finally{oh.transition=t}};We.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};We.useCallback=function(e,t){return Jn.current.useCallback(e,t)};We.useContext=function(e){return Jn.current.useContext(e)};We.useDebugValue=function(){};We.useDeferredValue=function(e){return Jn.current.useDeferredValue(e)};We.useEffect=function(e,t){return Jn.current.useEffect(e,t)};We.useId=function(){return Jn.current.useId()};We.useImperativeHandle=function(e,t,n){return Jn.current.useImperativeHandle(e,t,n)};We.useInsertionEffect=function(e,t){return Jn.current.useInsertionEffect(e,t)};We.useLayoutEffect=function(e,t){return Jn.current.useLayoutEffect(e,t)};We.useMemo=function(e,t){return Jn.current.useMemo(e,t)};We.useReducer=function(e,t,n){return Jn.current.useReducer(e,t,n)};We.useRef=function(e){return Jn.current.useRef(e)};We.useState=function(e){return Jn.current.useState(e)};We.useSyncExternalStore=function(e,t,n){return Jn.current.useSyncExternalStore(e,t,n)};We.useTransition=function(){return Jn.current.useTransition()};We.version="18.2.0";uO.exports=We;var h=uO.exports;const te=ai(h),yO=lO({__proto__:null,default:te},[h]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its 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 pI=h,hI=Symbol.for("react.element"),mI=Symbol.for("react.fragment"),gI=Object.prototype.hasOwnProperty,vI=pI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,yI={key:!0,ref:!0,__self:!0,__source:!0};function xO(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)gI.call(t,r)&&!yI.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:hI,type:e,key:i,ref:s,props:o,_owner:vI.current}}lg.Fragment=mI;lg.jsx=xO;lg.jsxs=xO;cO.exports=lg;var b=cO.exports,Ah={},bO={exports:{}},Rr={},wO={exports:{}},SO={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its 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
|
+
*/(function(e){function t(O,R){var N=O.length;O.push(R);e:for(;0<N;){var j=N-1>>>1,G=O[j];if(0<o(G,R))O[j]=R,O[N]=G,N=j;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var R=O[0],N=O.pop();if(N!==R){O[0]=N;e:for(var j=0,G=O.length,xe=G>>>1;j<xe;){var ue=2*(j+1)-1,je=O[ue],Ce=ue+1,J=O[Ce];if(0>o(je,N))Ce<G&&0>o(J,je)?(O[j]=J,O[Ce]=N,j=Ce):(O[j]=je,O[ue]=N,j=ue);else if(Ce<G&&0>o(J,N))O[j]=J,O[Ce]=N,j=Ce;else break e}}return R}function o(O,R){var N=O.sortIndex-R.sortIndex;return N!==0?N:O.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,m=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(O){for(var R=n(c);R!==null;){if(R.callback===null)r(c);else if(R.startTime<=O)r(c),R.sortIndex=R.expirationTime,t(l,R);else break;R=n(c)}}function k(O){if(g=!1,w(O),!m)if(n(l)!==null)m=!0,C(E);else{var R=n(c);R!==null&&T(k,R.startTime-O)}}function E(O,R){m=!1,g&&(g=!1,v(P),P=-1),p=!0;var N=f;try{for(w(R),d=n(l);d!==null&&(!(d.expirationTime>R)||O&&!I());){var j=d.callback;if(typeof j=="function"){d.callback=null,f=d.priorityLevel;var G=j(d.expirationTime<=R);R=e.unstable_now(),typeof G=="function"?d.callback=G:d===n(l)&&r(l),w(R)}else r(l);d=n(l)}if(d!==null)var xe=!0;else{var ue=n(c);ue!==null&&T(k,ue.startTime-R),xe=!1}return xe}finally{d=null,f=N,p=!1}}var S=!1,_=null,P=-1,M=5,A=-1;function I(){return!(e.unstable_now()-A<M)}function L(){if(_!==null){var O=e.unstable_now();A=O;var R=!0;try{R=_(!0,O)}finally{R?re():(S=!1,_=null)}}else S=!1}var re;if(typeof x=="function")re=function(){x(L)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,K=V.port2;V.port1.onmessage=L,re=function(){K.postMessage(null)}}else re=function(){y(L,0)};function C(O){_=O,S||(S=!0,re())}function T(O,R){P=y(function(){O(e.unstable_now())},R)}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(O){O.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,C(E))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(O){switch(f){case 1:case 2:case 3:var R=3;break;default:R=f}var N=f;f=R;try{return O()}finally{f=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,R){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var N=f;f=O;try{return R()}finally{f=N}},e.unstable_scheduleCallback=function(O,R,N){var j=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?j+N:j):N=j,O){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=N+G,O={id:u++,callback:R,priorityLevel:O,startTime:N,expirationTime:G,sortIndex:-1},N>j?(O.sortIndex=N,t(c,O),n(l)===null&&O===n(c)&&(g?(v(P),P=-1):g=!0,T(k,N-j))):(O.sortIndex=G,t(l,O),m||p||(m=!0,C(E))),O},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(O){var R=f;return function(){var N=f;f=R;try{return O.apply(this,arguments)}finally{f=N}}}})(SO);wO.exports=SO;var xI=wO.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its 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 kO=h,Or=xI;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var EO=new Set,Ld={};function ml(e,t){Mc(e,t),Mc(e+"Capture",t)}function Mc(e,t){for(Ld[e]=t,e=0;e<t.length;e++)EO.add(t[e])}var Ri=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),i0=Object.prototype.hasOwnProperty,bI=/^[: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]*$/,wS={},SS={};function wI(e){return i0.call(SS,e)?!0:i0.call(wS,e)?!1:bI.test(e)?SS[e]=!0:(wS[e]=!0,!1)}function SI(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function kI(e,t,n,r){if(t===null||typeof t>"u"||SI(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Qn(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var On={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){On[e]=new Qn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];On[t]=new Qn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){On[e]=new Qn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){On[e]=new Qn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){On[e]=new Qn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){On[e]=new Qn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){On[e]=new Qn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){On[e]=new Qn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){On[e]=new Qn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Cb=/[\-:]([a-z])/g;function Ob(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Cb,Ob);On[t]=new Qn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Cb,Ob);On[t]=new Qn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Cb,Ob);On[t]=new Qn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){On[e]=new Qn(e,1,!1,e.toLowerCase(),null,!1,!1)});On.xlinkHref=new Qn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){On[e]=new Qn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Tb(e,t,n,r){var o=On.hasOwnProperty(t)?On[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(kI(t,n,o,r)&&(n=null),r||o===null?wI(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ui=kO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Sp=Symbol.for("react.element"),ec=Symbol.for("react.portal"),tc=Symbol.for("react.fragment"),Pb=Symbol.for("react.strict_mode"),s0=Symbol.for("react.profiler"),_O=Symbol.for("react.provider"),CO=Symbol.for("react.context"),Mb=Symbol.for("react.forward_ref"),a0=Symbol.for("react.suspense"),l0=Symbol.for("react.suspense_list"),Rb=Symbol.for("react.memo"),ys=Symbol.for("react.lazy"),OO=Symbol.for("react.offscreen"),kS=Symbol.iterator;function bu(e){return e===null||typeof e!="object"?null:(e=kS&&e[kS]||e["@@iterator"],typeof e=="function"?e:null)}var Rt=Object.assign,Vv;function Hu(e){if(Vv===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Vv=t&&t[1]||""}return`
|
|
34
|
+
`+Vv+e}var Hv=!1;function Wv(e,t){if(!e||Hv)return"";Hv=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
|
|
37
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Hv=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hu(e):""}function EI(e){switch(e.tag){case 5:return Hu(e.type);case 16:return Hu("Lazy");case 13:return Hu("Suspense");case 19:return Hu("SuspenseList");case 0:case 2:case 15:return e=Wv(e.type,!1),e;case 11:return e=Wv(e.type.render,!1),e;case 1:return e=Wv(e.type,!0),e;default:return""}}function c0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case tc:return"Fragment";case ec:return"Portal";case s0:return"Profiler";case Pb:return"StrictMode";case a0:return"Suspense";case l0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case CO:return(e.displayName||"Context")+".Consumer";case _O:return(e._context.displayName||"Context")+".Provider";case Mb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rb:return t=e.displayName||null,t!==null?t:c0(e.type)||"Memo";case ys:t=e._payload,e=e._init;try{return c0(e(t))}catch{}}return null}function _I(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return c0(t);case 8:return t===Pb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function qs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function TO(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function CI(e){var t=TO(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kp(e){e._valueTracker||(e._valueTracker=CI(e))}function PO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=TO(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Dh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function u0(e,t){var n=t.checked;return Rt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ES(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qs(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function MO(e,t){t=t.checked,t!=null&&Tb(e,"checked",t,!1)}function d0(e,t){MO(e,t);var n=qs(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?f0(e,t.type,n):t.hasOwnProperty("defaultValue")&&f0(e,t.type,qs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _S(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function f0(e,t,n){(t!=="number"||Dh(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wu=Array.isArray;function gc(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+qs(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function p0(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return Rt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function CS(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(Wu(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:qs(n)}}function RO(e,t){var n=qs(t.value),r=qs(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function OS(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function NO(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function h0(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?NO(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ep,$O=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ep=Ep||document.createElement("div"),Ep.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ep.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function jd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yd={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},OI=["Webkit","ms","Moz","O"];Object.keys(yd).forEach(function(e){OI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yd[t]=yd[e]})});function AO(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||yd.hasOwnProperty(e)&&yd[e]?(""+t).trim():t+"px"}function DO(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=AO(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var TI=Rt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function m0(e,t){if(t){if(TI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function g0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 v0=null;function Nb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var y0=null,vc=null,yc=null;function TS(e){if(e=Gf(e)){if(typeof y0!="function")throw Error(H(280));var t=e.stateNode;t&&(t=pg(t),y0(e.stateNode,e.type,t))}}function IO(e){vc?yc?yc.push(e):yc=[e]:vc=e}function LO(){if(vc){var e=vc,t=yc;if(yc=vc=null,TS(e),t)for(e=0;e<t.length;e++)TS(t[e])}}function jO(e,t){return e(t)}function zO(){}var Kv=!1;function FO(e,t,n){if(Kv)return e(t,n);Kv=!0;try{return jO(e,t,n)}finally{Kv=!1,(vc!==null||yc!==null)&&(zO(),LO())}}function zd(e,t){var n=e.stateNode;if(n===null)return null;var r=pg(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var x0=!1;if(Ri)try{var wu={};Object.defineProperty(wu,"passive",{get:function(){x0=!0}}),window.addEventListener("test",wu,wu),window.removeEventListener("test",wu,wu)}catch{x0=!1}function PI(e,t,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var xd=!1,Ih=null,Lh=!1,b0=null,MI={onError:function(e){xd=!0,Ih=e}};function RI(e,t,n,r,o,i,s,a,l){xd=!1,Ih=null,PI.apply(MI,arguments)}function NI(e,t,n,r,o,i,s,a,l){if(RI.apply(this,arguments),xd){if(xd){var c=Ih;xd=!1,Ih=null}else throw Error(H(198));Lh||(Lh=!0,b0=c)}}function gl(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function BO(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function PS(e){if(gl(e)!==e)throw Error(H(188))}function $I(e){var t=e.alternate;if(!t){if(t=gl(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return PS(o),e;if(i===r)return PS(o),t;i=i.sibling}throw Error(H(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function UO(e){return e=$I(e),e!==null?VO(e):null}function VO(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=VO(e);if(t!==null)return t;e=e.sibling}return null}var HO=Or.unstable_scheduleCallback,MS=Or.unstable_cancelCallback,AI=Or.unstable_shouldYield,DI=Or.unstable_requestPaint,Ft=Or.unstable_now,II=Or.unstable_getCurrentPriorityLevel,$b=Or.unstable_ImmediatePriority,WO=Or.unstable_UserBlockingPriority,jh=Or.unstable_NormalPriority,LI=Or.unstable_LowPriority,KO=Or.unstable_IdlePriority,cg=null,Yo=null;function jI(e){if(Yo&&typeof Yo.onCommitFiberRoot=="function")try{Yo.onCommitFiberRoot(cg,e,void 0,(e.current.flags&128)===128)}catch{}}var _o=Math.clz32?Math.clz32:BI,zI=Math.log,FI=Math.LN2;function BI(e){return e>>>=0,e===0?32:31-(zI(e)/FI|0)|0}var _p=64,Cp=4194304;function Ku(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Ku(a):(i&=s,i!==0&&(r=Ku(i)))}else s=n&~o,s!==0?r=Ku(s):i!==0&&(r=Ku(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-_o(t),o=1<<n,r|=e[n],t&=~o;return r}function UI(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function VI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-_o(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=UI(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function w0(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function qO(){var e=_p;return _p<<=1,!(_p&4194240)&&(_p=64),e}function qv(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Kf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_o(t),e[t]=n}function HI(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-_o(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Ab(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-_o(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var lt=0;function GO(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var YO,Db,XO,ZO,JO,S0=!1,Op=[],Ns=null,$s=null,As=null,Fd=new Map,Bd=new Map,Ss=[],WI="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 submit".split(" ");function RS(e,t){switch(e){case"focusin":case"focusout":Ns=null;break;case"dragenter":case"dragleave":$s=null;break;case"mouseover":case"mouseout":As=null;break;case"pointerover":case"pointerout":Fd.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bd.delete(t.pointerId)}}function Su(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Gf(t),t!==null&&Db(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function KI(e,t,n,r,o){switch(t){case"focusin":return Ns=Su(Ns,e,t,n,r,o),!0;case"dragenter":return $s=Su($s,e,t,n,r,o),!0;case"mouseover":return As=Su(As,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Fd.set(i,Su(Fd.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Bd.set(i,Su(Bd.get(i)||null,e,t,n,r,o)),!0}return!1}function QO(e){var t=Pa(e.target);if(t!==null){var n=gl(t);if(n!==null){if(t=n.tag,t===13){if(t=BO(n),t!==null){e.blockedOn=t,JO(e.priority,function(){XO(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=k0(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);v0=r,n.target.dispatchEvent(r),v0=null}else return t=Gf(n),t!==null&&Db(t),e.blockedOn=n,!1;t.shift()}return!0}function NS(e,t,n){ih(e)&&n.delete(t)}function qI(){S0=!1,Ns!==null&&ih(Ns)&&(Ns=null),$s!==null&&ih($s)&&($s=null),As!==null&&ih(As)&&(As=null),Fd.forEach(NS),Bd.forEach(NS)}function ku(e,t){e.blockedOn===t&&(e.blockedOn=null,S0||(S0=!0,Or.unstable_scheduleCallback(Or.unstable_NormalPriority,qI)))}function Ud(e){function t(o){return ku(o,e)}if(0<Op.length){ku(Op[0],e);for(var n=1;n<Op.length;n++){var r=Op[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ns!==null&&ku(Ns,e),$s!==null&&ku($s,e),As!==null&&ku(As,e),Fd.forEach(t),Bd.forEach(t),n=0;n<Ss.length;n++)r=Ss[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ss.length&&(n=Ss[0],n.blockedOn===null);)QO(n),n.blockedOn===null&&Ss.shift()}var xc=Ui.ReactCurrentBatchConfig,Fh=!0;function GI(e,t,n,r){var o=lt,i=xc.transition;xc.transition=null;try{lt=1,Ib(e,t,n,r)}finally{lt=o,xc.transition=i}}function YI(e,t,n,r){var o=lt,i=xc.transition;xc.transition=null;try{lt=4,Ib(e,t,n,r)}finally{lt=o,xc.transition=i}}function Ib(e,t,n,r){if(Fh){var o=k0(e,t,n,r);if(o===null)ry(e,t,r,Bh,n),RS(e,r);else if(KI(o,e,t,n,r))r.stopPropagation();else if(RS(e,r),t&4&&-1<WI.indexOf(e)){for(;o!==null;){var i=Gf(o);if(i!==null&&YO(i),i=k0(e,t,n,r),i===null&&ry(e,t,r,Bh,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else ry(e,t,r,null,n)}}var Bh=null;function k0(e,t,n,r){if(Bh=null,e=Nb(r),e=Pa(e),e!==null)if(t=gl(e),t===null)e=null;else if(n=t.tag,n===13){if(e=BO(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Bh=e,null}function eT(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(II()){case $b:return 1;case WO:return 4;case jh:case LI:return 16;case KO:return 536870912;default:return 16}default:return 16}}var Cs=null,Lb=null,sh=null;function tT(){if(sh)return sh;var e,t=Lb,n=t.length,r,o="value"in Cs?Cs.value:Cs.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return sh=o.slice(e,1<r?1-r:void 0)}function ah(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Tp(){return!0}function $S(){return!1}function Nr(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Tp:$S,this.isPropagationStopped=$S,this}return Rt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Tp)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Tp)},persist:function(){},isPersistent:Tp}),t}var ru={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jb=Nr(ru),qf=Rt({},ru,{view:0,detail:0}),XI=Nr(qf),Gv,Yv,Eu,ug=Rt({},qf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zb,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Eu&&(Eu&&e.type==="mousemove"?(Gv=e.screenX-Eu.screenX,Yv=e.screenY-Eu.screenY):Yv=Gv=0,Eu=e),Gv)},movementY:function(e){return"movementY"in e?e.movementY:Yv}}),AS=Nr(ug),ZI=Rt({},ug,{dataTransfer:0}),JI=Nr(ZI),QI=Rt({},qf,{relatedTarget:0}),Xv=Nr(QI),e3=Rt({},ru,{animationName:0,elapsedTime:0,pseudoElement:0}),t3=Nr(e3),n3=Rt({},ru,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),r3=Nr(n3),o3=Rt({},ru,{data:0}),DS=Nr(o3),i3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s3={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"},a3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function l3(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=a3[e])?!!t[e]:!1}function zb(){return l3}var c3=Rt({},qf,{key:function(e){if(e.key){var t=i3[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ah(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?s3[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zb,charCode:function(e){return e.type==="keypress"?ah(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ah(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),u3=Nr(c3),d3=Rt({},ug,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),IS=Nr(d3),f3=Rt({},qf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zb}),p3=Nr(f3),h3=Rt({},ru,{propertyName:0,elapsedTime:0,pseudoElement:0}),m3=Nr(h3),g3=Rt({},ug,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),v3=Nr(g3),y3=[9,13,27,32],Fb=Ri&&"CompositionEvent"in window,bd=null;Ri&&"documentMode"in document&&(bd=document.documentMode);var x3=Ri&&"TextEvent"in window&&!bd,nT=Ri&&(!Fb||bd&&8<bd&&11>=bd),LS=" ",jS=!1;function rT(e,t){switch(e){case"keyup":return y3.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var nc=!1;function b3(e,t){switch(e){case"compositionend":return oT(t);case"keypress":return t.which!==32?null:(jS=!0,LS);case"textInput":return e=t.data,e===LS&&jS?null:e;default:return null}}function w3(e,t){if(nc)return e==="compositionend"||!Fb&&rT(e,t)?(e=tT(),sh=Lb=Cs=null,nc=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return nT&&t.locale!=="ko"?null:t.data;default:return null}}var S3={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 zS(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!S3[e.type]:t==="textarea"}function iT(e,t,n,r){IO(r),t=Uh(t,"onChange"),0<t.length&&(n=new jb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var wd=null,Vd=null;function k3(e){gT(e,0)}function dg(e){var t=ic(e);if(PO(t))return e}function E3(e,t){if(e==="change")return t}var sT=!1;if(Ri){var Zv;if(Ri){var Jv="oninput"in document;if(!Jv){var FS=document.createElement("div");FS.setAttribute("oninput","return;"),Jv=typeof FS.oninput=="function"}Zv=Jv}else Zv=!1;sT=Zv&&(!document.documentMode||9<document.documentMode)}function BS(){wd&&(wd.detachEvent("onpropertychange",aT),Vd=wd=null)}function aT(e){if(e.propertyName==="value"&&dg(Vd)){var t=[];iT(t,Vd,e,Nb(e)),FO(k3,t)}}function _3(e,t,n){e==="focusin"?(BS(),wd=t,Vd=n,wd.attachEvent("onpropertychange",aT)):e==="focusout"&&BS()}function C3(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return dg(Vd)}function O3(e,t){if(e==="click")return dg(t)}function T3(e,t){if(e==="input"||e==="change")return dg(t)}function P3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var No=typeof Object.is=="function"?Object.is:P3;function Hd(e,t){if(No(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!i0.call(t,o)||!No(e[o],t[o]))return!1}return!0}function US(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function VS(e,t){var n=US(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=US(n)}}function lT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cT(){for(var e=window,t=Dh();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Dh(e.document)}return t}function Bb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function M3(e){var t=cT(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&lT(n.ownerDocument.documentElement,n)){if(r!==null&&Bb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=VS(n,i);var s=VS(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var R3=Ri&&"documentMode"in document&&11>=document.documentMode,rc=null,E0=null,Sd=null,_0=!1;function HS(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_0||rc==null||rc!==Dh(r)||(r=rc,"selectionStart"in r&&Bb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sd&&Hd(Sd,r)||(Sd=r,r=Uh(E0,"onSelect"),0<r.length&&(t=new jb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=rc)))}function Pp(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var oc={animationend:Pp("Animation","AnimationEnd"),animationiteration:Pp("Animation","AnimationIteration"),animationstart:Pp("Animation","AnimationStart"),transitionend:Pp("Transition","TransitionEnd")},Qv={},uT={};Ri&&(uT=document.createElement("div").style,"AnimationEvent"in window||(delete oc.animationend.animation,delete oc.animationiteration.animation,delete oc.animationstart.animation),"TransitionEvent"in window||delete oc.transitionend.transition);function fg(e){if(Qv[e])return Qv[e];if(!oc[e])return e;var t=oc[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in uT)return Qv[e]=t[n];return e}var dT=fg("animationend"),fT=fg("animationiteration"),pT=fg("animationstart"),hT=fg("transitionend"),mT=new Map,WS="abort auxClick 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(" ");function aa(e,t){mT.set(e,t),ml(t,[e])}for(var ey=0;ey<WS.length;ey++){var ty=WS[ey],N3=ty.toLowerCase(),$3=ty[0].toUpperCase()+ty.slice(1);aa(N3,"on"+$3)}aa(dT,"onAnimationEnd");aa(fT,"onAnimationIteration");aa(pT,"onAnimationStart");aa("dblclick","onDoubleClick");aa("focusin","onFocus");aa("focusout","onBlur");aa(hT,"onTransitionEnd");Mc("onMouseEnter",["mouseout","mouseover"]);Mc("onMouseLeave",["mouseout","mouseover"]);Mc("onPointerEnter",["pointerout","pointerover"]);Mc("onPointerLeave",["pointerout","pointerover"]);ml("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ml("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ml("onBeforeInput",["compositionend","keypress","textInput","paste"]);ml("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ml("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ml("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qu="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(" "),A3=new Set("cancel close invalid load scroll toggle".split(" ").concat(qu));function KS(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,NI(r,t,void 0,e),e.currentTarget=null}function gT(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;KS(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;KS(o,a,c),i=l}}}if(Lh)throw e=b0,Lh=!1,b0=null,e}function xt(e,t){var n=t[M0];n===void 0&&(n=t[M0]=new Set);var r=e+"__bubble";n.has(r)||(vT(t,e,2,!1),n.add(r))}function ny(e,t,n){var r=0;t&&(r|=4),vT(n,e,r,t)}var Mp="_reactListening"+Math.random().toString(36).slice(2);function Wd(e){if(!e[Mp]){e[Mp]=!0,EO.forEach(function(n){n!=="selectionchange"&&(A3.has(n)||ny(n,!1,e),ny(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mp]||(t[Mp]=!0,ny("selectionchange",!1,t))}}function vT(e,t,n,r){switch(eT(t)){case 1:var o=GI;break;case 4:o=YI;break;default:o=Ib}n=o.bind(null,t,n,e),o=void 0,!x0||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function ry(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=Pa(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}FO(function(){var c=i,u=Nb(n),d=[];e:{var f=mT.get(e);if(f!==void 0){var p=jb,m=e;switch(e){case"keypress":if(ah(n)===0)break e;case"keydown":case"keyup":p=u3;break;case"focusin":m="focus",p=Xv;break;case"focusout":m="blur",p=Xv;break;case"beforeblur":case"afterblur":p=Xv;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=AS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=JI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=p3;break;case dT:case fT:case pT:p=t3;break;case hT:p=m3;break;case"scroll":p=XI;break;case"wheel":p=v3;break;case"copy":case"cut":case"paste":p=r3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=IS}var g=(t&4)!==0,y=!g&&e==="scroll",v=g?f!==null?f+"Capture":null:f;g=[];for(var x=c,w;x!==null;){w=x;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,v!==null&&(k=zd(x,v),k!=null&&g.push(Kd(x,k,w)))),y)break;x=x.return}0<g.length&&(f=new p(f,m,null,n,u),d.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==v0&&(m=n.relatedTarget||n.fromElement)&&(Pa(m)||m[Ni]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?Pa(m):null,m!==null&&(y=gl(m),m!==y||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=AS,k="onMouseLeave",v="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=IS,k="onPointerLeave",v="onPointerEnter",x="pointer"),y=p==null?f:ic(p),w=m==null?f:ic(m),f=new g(k,x+"leave",p,n,u),f.target=y,f.relatedTarget=w,k=null,Pa(u)===c&&(g=new g(v,x+"enter",m,n,u),g.target=w,g.relatedTarget=y,k=g),y=k,p&&m)t:{for(g=p,v=m,x=0,w=g;w;w=Rl(w))x++;for(w=0,k=v;k;k=Rl(k))w++;for(;0<x-w;)g=Rl(g),x--;for(;0<w-x;)v=Rl(v),w--;for(;x--;){if(g===v||v!==null&&g===v.alternate)break t;g=Rl(g),v=Rl(v)}g=null}else g=null;p!==null&&qS(d,f,p,g,!1),m!==null&&y!==null&&qS(d,y,m,g,!0)}}e:{if(f=c?ic(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var E=E3;else if(zS(f))if(sT)E=T3;else{E=C3;var S=_3}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=O3);if(E&&(E=E(e,c))){iT(d,E,n,u);break e}S&&S(e,f,c),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&f0(f,"number",f.value)}switch(S=c?ic(c):window,e){case"focusin":(zS(S)||S.contentEditable==="true")&&(rc=S,E0=c,Sd=null);break;case"focusout":Sd=E0=rc=null;break;case"mousedown":_0=!0;break;case"contextmenu":case"mouseup":case"dragend":_0=!1,HS(d,n,u);break;case"selectionchange":if(R3)break;case"keydown":case"keyup":HS(d,n,u)}var _;if(Fb)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else nc?rT(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(nT&&n.locale!=="ko"&&(nc||P!=="onCompositionStart"?P==="onCompositionEnd"&&nc&&(_=tT()):(Cs=u,Lb="value"in Cs?Cs.value:Cs.textContent,nc=!0)),S=Uh(c,P),0<S.length&&(P=new DS(P,e,null,n,u),d.push({event:P,listeners:S}),_?P.data=_:(_=oT(n),_!==null&&(P.data=_)))),(_=x3?b3(e,n):w3(e,n))&&(c=Uh(c,"onBeforeInput"),0<c.length&&(u=new DS("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=_))}gT(d,t)})}function Kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Uh(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=zd(e,n),i!=null&&r.unshift(Kd(e,i,o)),i=zd(e,t),i!=null&&r.push(Kd(e,i,o))),e=e.return}return r}function Rl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function qS(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=zd(n,i),l!=null&&s.unshift(Kd(n,l,a))):o||(l=zd(n,i),l!=null&&s.push(Kd(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var D3=/\r\n?/g,I3=/\u0000|\uFFFD/g;function GS(e){return(typeof e=="string"?e:""+e).replace(D3,`
|
|
38
|
+
`).replace(I3,"")}function Rp(e,t,n){if(t=GS(t),GS(e)!==t&&n)throw Error(H(425))}function Vh(){}var C0=null,O0=null;function T0(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var P0=typeof setTimeout=="function"?setTimeout:void 0,L3=typeof clearTimeout=="function"?clearTimeout:void 0,YS=typeof Promise=="function"?Promise:void 0,j3=typeof queueMicrotask=="function"?queueMicrotask:typeof YS<"u"?function(e){return YS.resolve(null).then(e).catch(z3)}:P0;function z3(e){setTimeout(function(){throw e})}function oy(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Ud(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Ud(t)}function Ds(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function XS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ou=Math.random().toString(36).slice(2),Ho="__reactFiber$"+ou,qd="__reactProps$"+ou,Ni="__reactContainer$"+ou,M0="__reactEvents$"+ou,F3="__reactListeners$"+ou,B3="__reactHandles$"+ou;function Pa(e){var t=e[Ho];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ni]||n[Ho]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=XS(e);e!==null;){if(n=e[Ho])return n;e=XS(e)}return t}e=n,n=e.parentNode}return null}function Gf(e){return e=e[Ho]||e[Ni],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ic(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function pg(e){return e[qd]||null}var R0=[],sc=-1;function la(e){return{current:e}}function bt(e){0>sc||(e.current=R0[sc],R0[sc]=null,sc--)}function gt(e,t){sc++,R0[sc]=e.current,e.current=t}var Gs={},In=la(Gs),ar=la(!1),qa=Gs;function Rc(e,t){var n=e.type.contextTypes;if(!n)return Gs;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function lr(e){return e=e.childContextTypes,e!=null}function Hh(){bt(ar),bt(In)}function ZS(e,t,n){if(In.current!==Gs)throw Error(H(168));gt(In,t),gt(ar,n)}function yT(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(H(108,_I(e)||"Unknown",o));return Rt({},n,r)}function Wh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gs,qa=In.current,gt(In,e),gt(ar,ar.current),!0}function JS(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=yT(e,t,qa),r.__reactInternalMemoizedMergedChildContext=e,bt(ar),bt(In),gt(In,e)):bt(ar),gt(ar,n)}var wi=null,hg=!1,iy=!1;function xT(e){wi===null?wi=[e]:wi.push(e)}function U3(e){hg=!0,xT(e)}function ca(){if(!iy&&wi!==null){iy=!0;var e=0,t=lt;try{var n=wi;for(lt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}wi=null,hg=!1}catch(o){throw wi!==null&&(wi=wi.slice(e+1)),HO($b,ca),o}finally{lt=t,iy=!1}}return null}var ac=[],lc=0,Kh=null,qh=0,Ur=[],Vr=0,Ga=null,ki=1,Ei="";function va(e,t){ac[lc++]=qh,ac[lc++]=Kh,Kh=e,qh=t}function bT(e,t,n){Ur[Vr++]=ki,Ur[Vr++]=Ei,Ur[Vr++]=Ga,Ga=e;var r=ki;e=Ei;var o=32-_o(r)-1;r&=~(1<<o),n+=1;var i=32-_o(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,ki=1<<32-_o(t)+o|n<<o|r,Ei=i+e}else ki=1<<i|n<<o|r,Ei=e}function Ub(e){e.return!==null&&(va(e,1),bT(e,1,0))}function Vb(e){for(;e===Kh;)Kh=ac[--lc],ac[lc]=null,qh=ac[--lc],ac[lc]=null;for(;e===Ga;)Ga=Ur[--Vr],Ur[Vr]=null,Ei=Ur[--Vr],Ur[Vr]=null,ki=Ur[--Vr],Ur[Vr]=null}var Er=null,kr=null,kt=!1,vo=null;function wT(e,t){var n=Wr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function QS(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Er=e,kr=Ds(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Er=e,kr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ga!==null?{id:ki,overflow:Ei}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Wr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Er=e,kr=null,!0):!1;default:return!1}}function N0(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $0(e){if(kt){var t=kr;if(t){var n=t;if(!QS(e,t)){if(N0(e))throw Error(H(418));t=Ds(n.nextSibling);var r=Er;t&&QS(e,t)?wT(r,n):(e.flags=e.flags&-4097|2,kt=!1,Er=e)}}else{if(N0(e))throw Error(H(418));e.flags=e.flags&-4097|2,kt=!1,Er=e}}}function ek(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Er=e}function Np(e){if(e!==Er)return!1;if(!kt)return ek(e),kt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!T0(e.type,e.memoizedProps)),t&&(t=kr)){if(N0(e))throw ST(),Error(H(418));for(;t;)wT(e,t),t=Ds(t.nextSibling)}if(ek(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kr=Ds(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kr=null}}else kr=Er?Ds(e.stateNode.nextSibling):null;return!0}function ST(){for(var e=kr;e;)e=Ds(e.nextSibling)}function Nc(){kr=Er=null,kt=!1}function Hb(e){vo===null?vo=[e]:vo.push(e)}var V3=Ui.ReactCurrentBatchConfig;function ho(e,t){if(e&&e.defaultProps){t=Rt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Gh=la(null),Yh=null,cc=null,Wb=null;function Kb(){Wb=cc=Yh=null}function qb(e){var t=Gh.current;bt(Gh),e._currentValue=t}function A0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function bc(e,t){Yh=e,Wb=cc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ir=!0),e.firstContext=null)}function Xr(e){var t=e._currentValue;if(Wb!==e)if(e={context:e,memoizedValue:t,next:null},cc===null){if(Yh===null)throw Error(H(308));cc=e,Yh.dependencies={lanes:0,firstContext:e}}else cc=cc.next=e;return t}var Ma=null;function Gb(e){Ma===null?Ma=[e]:Ma.push(e)}function kT(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Gb(t)):(n.next=o.next,o.next=n),t.interleaved=n,$i(e,r)}function $i(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var xs=!1;function Yb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ET(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ti(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Is(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xe&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,$i(e,n)}return o=r.interleaved,o===null?(t.next=t,Gb(r)):(t.next=o.next,o.next=t),r.interleaved=t,$i(e,n)}function lh(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ab(e,n)}}function tk(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xh(e,t,n,r){var o=e.updateQueue;xs=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,u=c=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,g=a;switch(f=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=Rt({},d,f);break e;case 2:xs=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(u===null&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Xa|=s,e.lanes=s,e.memoizedState=d}}function nk(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(H(191,o));o.call(r)}}}var _T=new kO.Component().refs;function D0(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Rt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var mg={isMounted:function(e){return(e=e._reactInternals)?gl(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Wn(),o=js(e),i=Ti(r,o);i.payload=t,n!=null&&(i.callback=n),t=Is(e,i,o),t!==null&&(Co(t,e,o,r),lh(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Wn(),o=js(e),i=Ti(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Is(e,i,o),t!==null&&(Co(t,e,o,r),lh(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Wn(),r=js(e),o=Ti(n,r);o.tag=2,t!=null&&(o.callback=t),t=Is(e,o,r),t!==null&&(Co(t,e,r,n),lh(t,e,r))}};function rk(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Hd(n,r)||!Hd(o,i):!0}function CT(e,t,n){var r=!1,o=Gs,i=t.contextType;return typeof i=="object"&&i!==null?i=Xr(i):(o=lr(t)?qa:In.current,r=t.contextTypes,i=(r=r!=null)?Rc(e,o):Gs),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=mg,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ok(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&mg.enqueueReplaceState(t,t.state,null)}function I0(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=_T,Yb(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Xr(i):(i=lr(t)?qa:In.current,o.context=Rc(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(D0(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&mg.enqueueReplaceState(o,o.state,null),Xh(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function _u(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;a===_T&&(a=o.refs={}),s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function $p(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ik(e){var t=e._init;return t(e._payload)}function OT(e){function t(v,x){if(e){var w=v.deletions;w===null?(v.deletions=[x],v.flags|=16):w.push(x)}}function n(v,x){if(!e)return null;for(;x!==null;)t(v,x),x=x.sibling;return null}function r(v,x){for(v=new Map;x!==null;)x.key!==null?v.set(x.key,x):v.set(x.index,x),x=x.sibling;return v}function o(v,x){return v=zs(v,x),v.index=0,v.sibling=null,v}function i(v,x,w){return v.index=w,e?(w=v.alternate,w!==null?(w=w.index,w<x?(v.flags|=2,x):w):(v.flags|=2,x)):(v.flags|=1048576,x)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function a(v,x,w,k){return x===null||x.tag!==6?(x=fy(w,v.mode,k),x.return=v,x):(x=o(x,w),x.return=v,x)}function l(v,x,w,k){var E=w.type;return E===tc?u(v,x,w.props.children,k,w.key):x!==null&&(x.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===ys&&ik(E)===x.type)?(k=o(x,w.props),k.ref=_u(v,x,w),k.return=v,k):(k=hh(w.type,w.key,w.props,null,v.mode,k),k.ref=_u(v,x,w),k.return=v,k)}function c(v,x,w,k){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=py(w,v.mode,k),x.return=v,x):(x=o(x,w.children||[]),x.return=v,x)}function u(v,x,w,k,E){return x===null||x.tag!==7?(x=Fa(w,v.mode,k,E),x.return=v,x):(x=o(x,w),x.return=v,x)}function d(v,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=fy(""+x,v.mode,w),x.return=v,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Sp:return w=hh(x.type,x.key,x.props,null,v.mode,w),w.ref=_u(v,null,x),w.return=v,w;case ec:return x=py(x,v.mode,w),x.return=v,x;case ys:var k=x._init;return d(v,k(x._payload),w)}if(Wu(x)||bu(x))return x=Fa(x,v.mode,w,null),x.return=v,x;$p(v,x)}return null}function f(v,x,w,k){var E=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return E!==null?null:a(v,x,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Sp:return w.key===E?l(v,x,w,k):null;case ec:return w.key===E?c(v,x,w,k):null;case ys:return E=w._init,f(v,x,E(w._payload),k)}if(Wu(w)||bu(w))return E!==null?null:u(v,x,w,k,null);$p(v,w)}return null}function p(v,x,w,k,E){if(typeof k=="string"&&k!==""||typeof k=="number")return v=v.get(w)||null,a(x,v,""+k,E);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Sp:return v=v.get(k.key===null?w:k.key)||null,l(x,v,k,E);case ec:return v=v.get(k.key===null?w:k.key)||null,c(x,v,k,E);case ys:var S=k._init;return p(v,x,w,S(k._payload),E)}if(Wu(k)||bu(k))return v=v.get(w)||null,u(x,v,k,E,null);$p(x,k)}return null}function m(v,x,w,k){for(var E=null,S=null,_=x,P=x=0,M=null;_!==null&&P<w.length;P++){_.index>P?(M=_,_=null):M=_.sibling;var A=f(v,_,w[P],k);if(A===null){_===null&&(_=M);break}e&&_&&A.alternate===null&&t(v,_),x=i(A,x,P),S===null?E=A:S.sibling=A,S=A,_=M}if(P===w.length)return n(v,_),kt&&va(v,P),E;if(_===null){for(;P<w.length;P++)_=d(v,w[P],k),_!==null&&(x=i(_,x,P),S===null?E=_:S.sibling=_,S=_);return kt&&va(v,P),E}for(_=r(v,_);P<w.length;P++)M=p(_,v,P,w[P],k),M!==null&&(e&&M.alternate!==null&&_.delete(M.key===null?P:M.key),x=i(M,x,P),S===null?E=M:S.sibling=M,S=M);return e&&_.forEach(function(I){return t(v,I)}),kt&&va(v,P),E}function g(v,x,w,k){var E=bu(w);if(typeof E!="function")throw Error(H(150));if(w=E.call(w),w==null)throw Error(H(151));for(var S=E=null,_=x,P=x=0,M=null,A=w.next();_!==null&&!A.done;P++,A=w.next()){_.index>P?(M=_,_=null):M=_.sibling;var I=f(v,_,A.value,k);if(I===null){_===null&&(_=M);break}e&&_&&I.alternate===null&&t(v,_),x=i(I,x,P),S===null?E=I:S.sibling=I,S=I,_=M}if(A.done)return n(v,_),kt&&va(v,P),E;if(_===null){for(;!A.done;P++,A=w.next())A=d(v,A.value,k),A!==null&&(x=i(A,x,P),S===null?E=A:S.sibling=A,S=A);return kt&&va(v,P),E}for(_=r(v,_);!A.done;P++,A=w.next())A=p(_,v,P,A.value,k),A!==null&&(e&&A.alternate!==null&&_.delete(A.key===null?P:A.key),x=i(A,x,P),S===null?E=A:S.sibling=A,S=A);return e&&_.forEach(function(L){return t(v,L)}),kt&&va(v,P),E}function y(v,x,w,k){if(typeof w=="object"&&w!==null&&w.type===tc&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Sp:e:{for(var E=w.key,S=x;S!==null;){if(S.key===E){if(E=w.type,E===tc){if(S.tag===7){n(v,S.sibling),x=o(S,w.props.children),x.return=v,v=x;break e}}else if(S.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===ys&&ik(E)===S.type){n(v,S.sibling),x=o(S,w.props),x.ref=_u(v,S,w),x.return=v,v=x;break e}n(v,S);break}else t(v,S);S=S.sibling}w.type===tc?(x=Fa(w.props.children,v.mode,k,w.key),x.return=v,v=x):(k=hh(w.type,w.key,w.props,null,v.mode,k),k.ref=_u(v,x,w),k.return=v,v=k)}return s(v);case ec:e:{for(S=w.key;x!==null;){if(x.key===S)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(v,x.sibling),x=o(x,w.children||[]),x.return=v,v=x;break e}else{n(v,x);break}else t(v,x);x=x.sibling}x=py(w,v.mode,k),x.return=v,v=x}return s(v);case ys:return S=w._init,y(v,x,S(w._payload),k)}if(Wu(w))return m(v,x,w,k);if(bu(w))return g(v,x,w,k);$p(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(v,x.sibling),x=o(x,w),x.return=v,v=x):(n(v,x),x=fy(w,v.mode,k),x.return=v,v=x),s(v)):n(v,x)}return y}var $c=OT(!0),TT=OT(!1),Yf={},Xo=la(Yf),Gd=la(Yf),Yd=la(Yf);function Ra(e){if(e===Yf)throw Error(H(174));return e}function Xb(e,t){switch(gt(Yd,t),gt(Gd,e),gt(Xo,Yf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:h0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=h0(t,e)}bt(Xo),gt(Xo,t)}function Ac(){bt(Xo),bt(Gd),bt(Yd)}function PT(e){Ra(Yd.current);var t=Ra(Xo.current),n=h0(t,e.type);t!==n&&(gt(Gd,e),gt(Xo,n))}function Zb(e){Gd.current===e&&(bt(Xo),bt(Gd))}var Tt=la(0);function Zh(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var sy=[];function Jb(){for(var e=0;e<sy.length;e++)sy[e]._workInProgressVersionPrimary=null;sy.length=0}var ch=Ui.ReactCurrentDispatcher,ay=Ui.ReactCurrentBatchConfig,Ya=0,Mt=null,Yt=null,un=null,Jh=!1,kd=!1,Xd=0,H3=0;function Pn(){throw Error(H(321))}function Qb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!No(e[n],t[n]))return!1;return!0}function e1(e,t,n,r,o,i){if(Ya=i,Mt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ch.current=e===null||e.memoizedState===null?G3:Y3,e=n(r,o),kd){i=0;do{if(kd=!1,Xd=0,25<=i)throw Error(H(301));i+=1,un=Yt=null,t.updateQueue=null,ch.current=X3,e=n(r,o)}while(kd)}if(ch.current=Qh,t=Yt!==null&&Yt.next!==null,Ya=0,un=Yt=Mt=null,Jh=!1,t)throw Error(H(300));return e}function t1(){var e=Xd!==0;return Xd=0,e}function Uo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?Mt.memoizedState=un=e:un=un.next=e,un}function Zr(){if(Yt===null){var e=Mt.alternate;e=e!==null?e.memoizedState:null}else e=Yt.next;var t=un===null?Mt.memoizedState:un.next;if(t!==null)un=t,Yt=e;else{if(e===null)throw Error(H(310));Yt=e,e={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},un===null?Mt.memoizedState=un=e:un=un.next=e}return un}function Zd(e,t){return typeof t=="function"?t(e):t}function ly(e){var t=Zr(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Yt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,c=i;do{var u=c.lane;if((Ya&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,Mt.lanes|=u,Xa|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,No(r,t.memoizedState)||(ir=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Mt.lanes|=i,Xa|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function cy(e){var t=Zr(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);No(i,t.memoizedState)||(ir=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function MT(){}function RT(e,t){var n=Mt,r=Zr(),o=t(),i=!No(r.memoizedState,o);if(i&&(r.memoizedState=o,ir=!0),r=r.queue,n1(AT.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||un!==null&&un.memoizedState.tag&1){if(n.flags|=2048,Jd(9,$T.bind(null,n,r,o,t),void 0,null),hn===null)throw Error(H(349));Ya&30||NT(n,t,o)}return o}function NT(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Mt.updateQueue,t===null?(t={lastEffect:null,stores:null},Mt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $T(e,t,n,r){t.value=n,t.getSnapshot=r,DT(t)&&IT(e)}function AT(e,t,n){return n(function(){DT(t)&&IT(e)})}function DT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!No(e,n)}catch{return!0}}function IT(e){var t=$i(e,1);t!==null&&Co(t,e,1,-1)}function sk(e){var t=Uo();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Zd,lastRenderedState:e},t.queue=e,e=e.dispatch=q3.bind(null,Mt,e),[t.memoizedState,e]}function Jd(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Mt.updateQueue,t===null?(t={lastEffect:null,stores:null},Mt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function LT(){return Zr().memoizedState}function uh(e,t,n,r){var o=Uo();Mt.flags|=e,o.memoizedState=Jd(1|t,n,void 0,r===void 0?null:r)}function gg(e,t,n,r){var o=Zr();r=r===void 0?null:r;var i=void 0;if(Yt!==null){var s=Yt.memoizedState;if(i=s.destroy,r!==null&&Qb(r,s.deps)){o.memoizedState=Jd(t,n,i,r);return}}Mt.flags|=e,o.memoizedState=Jd(1|t,n,i,r)}function ak(e,t){return uh(8390656,8,e,t)}function n1(e,t){return gg(2048,8,e,t)}function jT(e,t){return gg(4,2,e,t)}function zT(e,t){return gg(4,4,e,t)}function FT(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function BT(e,t,n){return n=n!=null?n.concat([e]):null,gg(4,4,FT.bind(null,t,e),n)}function r1(){}function UT(e,t){var n=Zr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Qb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function VT(e,t){var n=Zr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Qb(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function HT(e,t,n){return Ya&21?(No(n,t)||(n=qO(),Mt.lanes|=n,Xa|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ir=!0),e.memoizedState=n)}function W3(e,t){var n=lt;lt=n!==0&&4>n?n:4,e(!0);var r=ay.transition;ay.transition={};try{e(!1),t()}finally{lt=n,ay.transition=r}}function WT(){return Zr().memoizedState}function K3(e,t,n){var r=js(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},KT(e))qT(t,n);else if(n=kT(e,t,n,r),n!==null){var o=Wn();Co(n,e,r,o),GT(n,t,r)}}function q3(e,t,n){var r=js(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(KT(e))qT(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,No(a,s)){var l=t.interleaved;l===null?(o.next=o,Gb(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=kT(e,t,o,r),n!==null&&(o=Wn(),Co(n,e,r,o),GT(n,t,r))}}function KT(e){var t=e.alternate;return e===Mt||t!==null&&t===Mt}function qT(e,t){kd=Jh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function GT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ab(e,n)}}var Qh={readContext:Xr,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useInsertionEffect:Pn,useLayoutEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useMutableSource:Pn,useSyncExternalStore:Pn,useId:Pn,unstable_isNewReconciler:!1},G3={readContext:Xr,useCallback:function(e,t){return Uo().memoizedState=[e,t===void 0?null:t],e},useContext:Xr,useEffect:ak,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,uh(4194308,4,FT.bind(null,t,e),n)},useLayoutEffect:function(e,t){return uh(4194308,4,e,t)},useInsertionEffect:function(e,t){return uh(4,2,e,t)},useMemo:function(e,t){var n=Uo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Uo();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=K3.bind(null,Mt,e),[r.memoizedState,e]},useRef:function(e){var t=Uo();return e={current:e},t.memoizedState=e},useState:sk,useDebugValue:r1,useDeferredValue:function(e){return Uo().memoizedState=e},useTransition:function(){var e=sk(!1),t=e[0];return e=W3.bind(null,e[1]),Uo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Mt,o=Uo();if(kt){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),hn===null)throw Error(H(349));Ya&30||NT(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,ak(AT.bind(null,r,i,e),[e]),r.flags|=2048,Jd(9,$T.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Uo(),t=hn.identifierPrefix;if(kt){var n=Ei,r=ki;n=(r&~(1<<32-_o(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Xd++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=H3++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Y3={readContext:Xr,useCallback:UT,useContext:Xr,useEffect:n1,useImperativeHandle:BT,useInsertionEffect:jT,useLayoutEffect:zT,useMemo:VT,useReducer:ly,useRef:LT,useState:function(){return ly(Zd)},useDebugValue:r1,useDeferredValue:function(e){var t=Zr();return HT(t,Yt.memoizedState,e)},useTransition:function(){var e=ly(Zd)[0],t=Zr().memoizedState;return[e,t]},useMutableSource:MT,useSyncExternalStore:RT,useId:WT,unstable_isNewReconciler:!1},X3={readContext:Xr,useCallback:UT,useContext:Xr,useEffect:n1,useImperativeHandle:BT,useInsertionEffect:jT,useLayoutEffect:zT,useMemo:VT,useReducer:cy,useRef:LT,useState:function(){return cy(Zd)},useDebugValue:r1,useDeferredValue:function(e){var t=Zr();return Yt===null?t.memoizedState=e:HT(t,Yt.memoizedState,e)},useTransition:function(){var e=cy(Zd)[0],t=Zr().memoizedState;return[e,t]},useMutableSource:MT,useSyncExternalStore:RT,useId:WT,unstable_isNewReconciler:!1};function Dc(e,t){try{var n="",r=t;do n+=EI(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function uy(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function L0(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Z3=typeof WeakMap=="function"?WeakMap:Map;function YT(e,t,n){n=Ti(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){tm||(tm=!0,q0=r),L0(e,t)},n}function XT(e,t,n){n=Ti(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){L0(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){L0(e,t),typeof r!="function"&&(Ls===null?Ls=new Set([this]):Ls.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function lk(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Z3;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=dL.bind(null,e,t,n),t.then(e,e))}function ck(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function uk(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ti(-1,1),t.tag=2,Is(n,t,1))),n.lanes|=1),e)}var J3=Ui.ReactCurrentOwner,ir=!1;function Un(e,t,n,r){t.child=e===null?TT(t,null,n,r):$c(t,e.child,n,r)}function dk(e,t,n,r,o){n=n.render;var i=t.ref;return bc(t,o),r=e1(e,t,n,r,i,o),n=t1(),e!==null&&!ir?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ai(e,t,o)):(kt&&n&&Ub(t),t.flags|=1,Un(e,t,r,o),t.child)}function fk(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!d1(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,ZT(e,t,i,r,o)):(e=hh(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Hd,n(s,r)&&e.ref===t.ref)return Ai(e,t,o)}return t.flags|=1,e=zs(i,r),e.ref=t.ref,e.return=t,t.child=e}function ZT(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Hd(i,r)&&e.ref===t.ref)if(ir=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(ir=!0);else return t.lanes=e.lanes,Ai(e,t,o)}return j0(e,t,n,r,o)}function JT(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(dc,yr),yr|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,gt(dc,yr),yr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,gt(dc,yr),yr|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,gt(dc,yr),yr|=r;return Un(e,t,o,n),t.child}function QT(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function j0(e,t,n,r,o){var i=lr(n)?qa:In.current;return i=Rc(t,i),bc(t,o),n=e1(e,t,n,r,i,o),r=t1(),e!==null&&!ir?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ai(e,t,o)):(kt&&r&&Ub(t),t.flags|=1,Un(e,t,n,o),t.child)}function pk(e,t,n,r,o){if(lr(n)){var i=!0;Wh(t)}else i=!1;if(bc(t,o),t.stateNode===null)dh(e,t),CT(t,n,r),I0(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Xr(c):(c=lr(n)?qa:In.current,c=Rc(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&ok(t,s,r,c),xs=!1;var f=t.memoizedState;s.state=f,Xh(t,r,s,o),l=t.memoizedState,a!==r||f!==l||ar.current||xs?(typeof u=="function"&&(D0(t,n,u,r),l=t.memoizedState),(a=xs||rk(t,n,a,r,f,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,ET(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:ho(t.type,a),s.props=c,d=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Xr(l):(l=lr(n)?qa:In.current,l=Rc(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&ok(t,s,r,l),xs=!1,f=t.memoizedState,s.state=f,Xh(t,r,s,o);var m=t.memoizedState;a!==d||f!==m||ar.current||xs?(typeof p=="function"&&(D0(t,n,p,r),m=t.memoizedState),(c=xs||rk(t,n,c,r,f,m,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return z0(e,t,n,r,i,o)}function z0(e,t,n,r,o,i){QT(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&JS(t,n,!1),Ai(e,t,i);r=t.stateNode,J3.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=$c(t,e.child,null,i),t.child=$c(t,null,a,i)):Un(e,t,a,i),t.memoizedState=r.state,o&&JS(t,n,!0),t.child}function e2(e){var t=e.stateNode;t.pendingContext?ZS(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ZS(e,t.context,!1),Xb(e,t.containerInfo)}function hk(e,t,n,r,o){return Nc(),Hb(o),t.flags|=256,Un(e,t,n,r),t.child}var F0={dehydrated:null,treeContext:null,retryLane:0};function B0(e){return{baseLanes:e,cachePool:null,transitions:null}}function t2(e,t,n){var r=t.pendingProps,o=Tt.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),gt(Tt,o&1),e===null)return $0(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=xg(s,r,0,null),e=Fa(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=B0(n),t.memoizedState=F0,e):o1(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return Q3(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=zs(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=zs(a,i):(i=Fa(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?B0(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=F0,r}return i=e.child,e=i.sibling,r=zs(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function o1(e,t){return t=xg({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ap(e,t,n,r){return r!==null&&Hb(r),$c(t,e.child,null,n),e=o1(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Q3(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=uy(Error(H(422))),Ap(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=xg({mode:"visible",children:r.children},o,0,null),i=Fa(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&$c(t,e.child,null,s),t.child.memoizedState=B0(s),t.memoizedState=F0,i);if(!(t.mode&1))return Ap(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(H(419)),r=uy(i,r,void 0),Ap(e,t,s,r)}if(a=(s&e.childLanes)!==0,ir||a){if(r=hn,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,$i(e,o),Co(r,e,o,-1))}return u1(),r=uy(Error(H(421))),Ap(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=fL.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,kr=Ds(o.nextSibling),Er=t,kt=!0,vo=null,e!==null&&(Ur[Vr++]=ki,Ur[Vr++]=Ei,Ur[Vr++]=Ga,ki=e.id,Ei=e.overflow,Ga=t),t=o1(t,r.children),t.flags|=4096,t)}function mk(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),A0(e.return,t,n)}function dy(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function n2(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Un(e,t,r.children,n),r=Tt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mk(e,n,t);else if(e.tag===19)mk(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(gt(Tt,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Zh(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),dy(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Zh(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}dy(t,!0,n,null,i);break;case"together":dy(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function dh(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ai(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xa|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=zs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function eL(e,t,n){switch(t.tag){case 3:e2(t),Nc();break;case 5:PT(t);break;case 1:lr(t.type)&&Wh(t);break;case 4:Xb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;gt(Gh,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(gt(Tt,Tt.current&1),t.flags|=128,null):n&t.child.childLanes?t2(e,t,n):(gt(Tt,Tt.current&1),e=Ai(e,t,n),e!==null?e.sibling:null);gt(Tt,Tt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return n2(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),gt(Tt,Tt.current),r)break;return null;case 22:case 23:return t.lanes=0,JT(e,t,n)}return Ai(e,t,n)}var r2,U0,o2,i2;r2=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};U0=function(){};o2=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ra(Xo.current);var i=null;switch(n){case"input":o=u0(e,o),r=u0(e,r),i=[];break;case"select":o=Rt({},o,{value:void 0}),r=Rt({},r,{value:void 0}),i=[];break;case"textarea":o=p0(e,o),r=p0(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Vh)}m0(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ld.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ld.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&xt("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};i2=function(e,t,n,r){n!==r&&(t.flags|=4)};function Cu(e,t){if(!kt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function tL(e,t,n){var r=t.pendingProps;switch(Vb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mn(t),null;case 1:return lr(t.type)&&Hh(),Mn(t),null;case 3:return r=t.stateNode,Ac(),bt(ar),bt(In),Jb(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Np(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,vo!==null&&(X0(vo),vo=null))),U0(e,t),Mn(t),null;case 5:Zb(t);var o=Ra(Yd.current);if(n=t.type,e!==null&&t.stateNode!=null)o2(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Mn(t),null}if(e=Ra(Xo.current),Np(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Ho]=t,r[qd]=i,e=(t.mode&1)!==0,n){case"dialog":xt("cancel",r),xt("close",r);break;case"iframe":case"object":case"embed":xt("load",r);break;case"video":case"audio":for(o=0;o<qu.length;o++)xt(qu[o],r);break;case"source":xt("error",r);break;case"img":case"image":case"link":xt("error",r),xt("load",r);break;case"details":xt("toggle",r);break;case"input":ES(r,i),xt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},xt("invalid",r);break;case"textarea":CS(r,i),xt("invalid",r)}m0(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Rp(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Rp(r.textContent,a,e),o=["children",""+a]):Ld.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&xt("scroll",r)}switch(n){case"input":kp(r),_S(r,i,!0);break;case"textarea":kp(r),OS(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Vh)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=NO(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ho]=t,e[qd]=r,r2(e,t,!1,!1),t.stateNode=e;e:{switch(s=g0(n,r),n){case"dialog":xt("cancel",e),xt("close",e),o=r;break;case"iframe":case"object":case"embed":xt("load",e),o=r;break;case"video":case"audio":for(o=0;o<qu.length;o++)xt(qu[o],e);o=r;break;case"source":xt("error",e),o=r;break;case"img":case"image":case"link":xt("error",e),xt("load",e),o=r;break;case"details":xt("toggle",e),o=r;break;case"input":ES(e,r),o=u0(e,r),xt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Rt({},r,{value:void 0}),xt("invalid",e);break;case"textarea":CS(e,r),o=p0(e,r),xt("invalid",e);break;default:o=r}m0(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?DO(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&$O(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&jd(e,l):typeof l=="number"&&jd(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ld.hasOwnProperty(i)?l!=null&&i==="onScroll"&&xt("scroll",e):l!=null&&Tb(e,i,l,s))}switch(n){case"input":kp(e),_S(e,r,!1);break;case"textarea":kp(e),OS(e);break;case"option":r.value!=null&&e.setAttribute("value",""+qs(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?gc(e,!!r.multiple,i,!1):r.defaultValue!=null&&gc(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Vh)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Mn(t),null;case 6:if(e&&t.stateNode!=null)i2(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=Ra(Yd.current),Ra(Xo.current),Np(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ho]=t,(i=r.nodeValue!==n)&&(e=Er,e!==null))switch(e.tag){case 3:Rp(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Rp(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ho]=t,t.stateNode=r}return Mn(t),null;case 13:if(bt(Tt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(kt&&kr!==null&&t.mode&1&&!(t.flags&128))ST(),Nc(),t.flags|=98560,i=!1;else if(i=Np(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[Ho]=t}else Nc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mn(t),i=!1}else vo!==null&&(X0(vo),vo=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Tt.current&1?Zt===0&&(Zt=3):u1())),t.updateQueue!==null&&(t.flags|=4),Mn(t),null);case 4:return Ac(),U0(e,t),e===null&&Wd(t.stateNode.containerInfo),Mn(t),null;case 10:return qb(t.type._context),Mn(t),null;case 17:return lr(t.type)&&Hh(),Mn(t),null;case 19:if(bt(Tt),i=t.memoizedState,i===null)return Mn(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Cu(i,!1);else{if(Zt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Zh(e),s!==null){for(t.flags|=128,Cu(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return gt(Tt,Tt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ft()>Ic&&(t.flags|=128,r=!0,Cu(i,!1),t.lanes=4194304)}else{if(!r)if(e=Zh(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Cu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!kt)return Mn(t),null}else 2*Ft()-i.renderingStartTime>Ic&&n!==1073741824&&(t.flags|=128,r=!0,Cu(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ft(),t.sibling=null,n=Tt.current,gt(Tt,r?n&1|2:n&1),t):(Mn(t),null);case 22:case 23:return c1(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?yr&1073741824&&(Mn(t),t.subtreeFlags&6&&(t.flags|=8192)):Mn(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function nL(e,t){switch(Vb(t),t.tag){case 1:return lr(t.type)&&Hh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ac(),bt(ar),bt(In),Jb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zb(t),null;case 13:if(bt(Tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));Nc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return bt(Tt),null;case 4:return Ac(),null;case 10:return qb(t.type._context),null;case 22:case 23:return c1(),null;case 24:return null;default:return null}}var Dp=!1,An=!1,rL=typeof WeakSet=="function"?WeakSet:Set,se=null;function uc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$t(e,t,r)}else n.current=null}function V0(e,t,n){try{n()}catch(r){$t(e,t,r)}}var gk=!1;function oL(e,t){if(C0=Fh,e=cT(),Bb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++c===o&&(a=s),f===i&&++u===r&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(O0={focusedElem:e,selectionRange:n},Fh=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,y=m.memoizedState,v=t.stateNode,x=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:ho(t.type,g),y);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(k){$t(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return m=gk,gk=!1,m}function Ed(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&V0(t,n,i)}o=o.next}while(o!==r)}}function vg(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function H0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function s2(e){var t=e.alternate;t!==null&&(e.alternate=null,s2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ho],delete t[qd],delete t[M0],delete t[F3],delete t[B3])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function a2(e){return e.tag===5||e.tag===3||e.tag===4}function vk(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||a2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function W0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vh));else if(r!==4&&(e=e.child,e!==null))for(W0(e,t,n),e=e.sibling;e!==null;)W0(e,t,n),e=e.sibling}function K0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(K0(e,t,n),e=e.sibling;e!==null;)K0(e,t,n),e=e.sibling}var wn=null,mo=!1;function Ji(e,t,n){for(n=n.child;n!==null;)l2(e,t,n),n=n.sibling}function l2(e,t,n){if(Yo&&typeof Yo.onCommitFiberUnmount=="function")try{Yo.onCommitFiberUnmount(cg,n)}catch{}switch(n.tag){case 5:An||uc(n,t);case 6:var r=wn,o=mo;wn=null,Ji(e,t,n),wn=r,mo=o,wn!==null&&(mo?(e=wn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wn.removeChild(n.stateNode));break;case 18:wn!==null&&(mo?(e=wn,n=n.stateNode,e.nodeType===8?oy(e.parentNode,n):e.nodeType===1&&oy(e,n),Ud(e)):oy(wn,n.stateNode));break;case 4:r=wn,o=mo,wn=n.stateNode.containerInfo,mo=!0,Ji(e,t,n),wn=r,mo=o;break;case 0:case 11:case 14:case 15:if(!An&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&V0(n,t,s),o=o.next}while(o!==r)}Ji(e,t,n);break;case 1:if(!An&&(uc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){$t(n,t,a)}Ji(e,t,n);break;case 21:Ji(e,t,n);break;case 22:n.mode&1?(An=(r=An)||n.memoizedState!==null,Ji(e,t,n),An=r):Ji(e,t,n);break;default:Ji(e,t,n)}}function yk(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new rL),t.forEach(function(r){var o=pL.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ao(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:wn=a.stateNode,mo=!1;break e;case 3:wn=a.stateNode.containerInfo,mo=!0;break e;case 4:wn=a.stateNode.containerInfo,mo=!0;break e}a=a.return}if(wn===null)throw Error(H(160));l2(i,s,o),wn=null,mo=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){$t(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)c2(t,e),t=t.sibling}function c2(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ao(t,e),Fo(e),r&4){try{Ed(3,e,e.return),vg(3,e)}catch(g){$t(e,e.return,g)}try{Ed(5,e,e.return)}catch(g){$t(e,e.return,g)}}break;case 1:ao(t,e),Fo(e),r&512&&n!==null&&uc(n,n.return);break;case 5:if(ao(t,e),Fo(e),r&512&&n!==null&&uc(n,n.return),e.flags&32){var o=e.stateNode;try{jd(o,"")}catch(g){$t(e,e.return,g)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&MO(o,i),g0(a,s);var c=g0(a,i);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?DO(o,d):u==="dangerouslySetInnerHTML"?$O(o,d):u==="children"?jd(o,d):Tb(o,u,d,c)}switch(a){case"input":d0(o,i);break;case"textarea":RO(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?gc(o,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?gc(o,!!i.multiple,i.defaultValue,!0):gc(o,!!i.multiple,i.multiple?[]:"",!1))}o[qd]=i}catch(g){$t(e,e.return,g)}}break;case 6:if(ao(t,e),Fo(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){$t(e,e.return,g)}}break;case 3:if(ao(t,e),Fo(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ud(t.containerInfo)}catch(g){$t(e,e.return,g)}break;case 4:ao(t,e),Fo(e);break;case 13:ao(t,e),Fo(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(a1=Ft())),r&4&&yk(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(An=(c=An)||u,ao(t,e),An=c):ao(t,e),Fo(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(se=e,u=e.child;u!==null;){for(d=se=u;se!==null;){switch(f=se,p=f.child,f.tag){case 0:case 11:case 14:case 15:Ed(4,f,f.return);break;case 1:uc(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){$t(r,n,g)}}break;case 5:uc(f,f.return);break;case 22:if(f.memoizedState!==null){bk(d);continue}}p!==null?(p.return=f,se=p):bk(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{o=d.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=AO("display",s))}catch(g){$t(e,e.return,g)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){$t(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:ao(t,e),Fo(e),r&4&&yk(e);break;case 21:break;default:ao(t,e),Fo(e)}}function Fo(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(a2(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(jd(o,""),r.flags&=-33);var i=vk(e);K0(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=vk(e);W0(e,a,s);break;default:throw Error(H(161))}}catch(l){$t(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function iL(e,t,n){se=e,u2(e)}function u2(e,t,n){for(var r=(e.mode&1)!==0;se!==null;){var o=se,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Dp;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||An;a=Dp;var c=An;if(Dp=s,(An=l)&&!c)for(se=o;se!==null;)s=se,l=s.child,s.tag===22&&s.memoizedState!==null?wk(o):l!==null?(l.return=s,se=l):wk(o);for(;i!==null;)se=i,u2(i),i=i.sibling;se=o,Dp=a,An=c}xk(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,se=i):xk(e)}}function xk(e){for(;se!==null;){var t=se;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:An||vg(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!An)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ho(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&nk(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}nk(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Ud(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}An||t.flags&512&&H0(t)}catch(f){$t(t,t.return,f)}}if(t===e){se=null;break}if(n=t.sibling,n!==null){n.return=t.return,se=n;break}se=t.return}}function bk(e){for(;se!==null;){var t=se;if(t===e){se=null;break}var n=t.sibling;if(n!==null){n.return=t.return,se=n;break}se=t.return}}function wk(e){for(;se!==null;){var t=se;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{vg(4,t)}catch(l){$t(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){$t(t,o,l)}}var i=t.return;try{H0(t)}catch(l){$t(t,i,l)}break;case 5:var s=t.return;try{H0(t)}catch(l){$t(t,s,l)}}}catch(l){$t(t,t.return,l)}if(t===e){se=null;break}var a=t.sibling;if(a!==null){a.return=t.return,se=a;break}se=t.return}}var sL=Math.ceil,em=Ui.ReactCurrentDispatcher,i1=Ui.ReactCurrentOwner,Gr=Ui.ReactCurrentBatchConfig,Xe=0,hn=null,Kt=null,En=0,yr=0,dc=la(0),Zt=0,Qd=null,Xa=0,yg=0,s1=0,_d=null,or=null,a1=0,Ic=1/0,yi=null,tm=!1,q0=null,Ls=null,Ip=!1,Os=null,nm=0,Cd=0,G0=null,fh=-1,ph=0;function Wn(){return Xe&6?Ft():fh!==-1?fh:fh=Ft()}function js(e){return e.mode&1?Xe&2&&En!==0?En&-En:V3.transition!==null?(ph===0&&(ph=qO()),ph):(e=lt,e!==0||(e=window.event,e=e===void 0?16:eT(e.type)),e):1}function Co(e,t,n,r){if(50<Cd)throw Cd=0,G0=null,Error(H(185));Kf(e,n,r),(!(Xe&2)||e!==hn)&&(e===hn&&(!(Xe&2)&&(yg|=n),Zt===4&&ks(e,En)),cr(e,r),n===1&&Xe===0&&!(t.mode&1)&&(Ic=Ft()+500,hg&&ca()))}function cr(e,t){var n=e.callbackNode;VI(e,t);var r=zh(e,e===hn?En:0);if(r===0)n!==null&&MS(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&MS(n),t===1)e.tag===0?U3(Sk.bind(null,e)):xT(Sk.bind(null,e)),j3(function(){!(Xe&6)&&ca()}),n=null;else{switch(GO(r)){case 1:n=$b;break;case 4:n=WO;break;case 16:n=jh;break;case 536870912:n=KO;break;default:n=jh}n=y2(n,d2.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function d2(e,t){if(fh=-1,ph=0,Xe&6)throw Error(H(327));var n=e.callbackNode;if(wc()&&e.callbackNode!==n)return null;var r=zh(e,e===hn?En:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=rm(e,r);else{t=r;var o=Xe;Xe|=2;var i=p2();(hn!==e||En!==t)&&(yi=null,Ic=Ft()+500,za(e,t));do try{cL();break}catch(a){f2(e,a)}while(!0);Kb(),em.current=i,Xe=o,Kt!==null?t=0:(hn=null,En=0,t=Zt)}if(t!==0){if(t===2&&(o=w0(e),o!==0&&(r=o,t=Y0(e,o))),t===1)throw n=Qd,za(e,0),ks(e,r),cr(e,Ft()),n;if(t===6)ks(e,r);else{if(o=e.current.alternate,!(r&30)&&!aL(o)&&(t=rm(e,r),t===2&&(i=w0(e),i!==0&&(r=i,t=Y0(e,i))),t===1))throw n=Qd,za(e,0),ks(e,r),cr(e,Ft()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:ya(e,or,yi);break;case 3:if(ks(e,r),(r&130023424)===r&&(t=a1+500-Ft(),10<t)){if(zh(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Wn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=P0(ya.bind(null,e,or,yi),t);break}ya(e,or,yi);break;case 4:if(ks(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-_o(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ft()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sL(r/1960))-r,10<r){e.timeoutHandle=P0(ya.bind(null,e,or,yi),r);break}ya(e,or,yi);break;case 5:ya(e,or,yi);break;default:throw Error(H(329))}}}return cr(e,Ft()),e.callbackNode===n?d2.bind(null,e):null}function Y0(e,t){var n=_d;return e.current.memoizedState.isDehydrated&&(za(e,t).flags|=256),e=rm(e,t),e!==2&&(t=or,or=n,t!==null&&X0(t)),e}function X0(e){or===null?or=e:or.push.apply(or,e)}function aL(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!No(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ks(e,t){for(t&=~s1,t&=~yg,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-_o(t),r=1<<n;e[n]=-1,t&=~r}}function Sk(e){if(Xe&6)throw Error(H(327));wc();var t=zh(e,0);if(!(t&1))return cr(e,Ft()),null;var n=rm(e,t);if(e.tag!==0&&n===2){var r=w0(e);r!==0&&(t=r,n=Y0(e,r))}if(n===1)throw n=Qd,za(e,0),ks(e,t),cr(e,Ft()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ya(e,or,yi),cr(e,Ft()),null}function l1(e,t){var n=Xe;Xe|=1;try{return e(t)}finally{Xe=n,Xe===0&&(Ic=Ft()+500,hg&&ca())}}function Za(e){Os!==null&&Os.tag===0&&!(Xe&6)&&wc();var t=Xe;Xe|=1;var n=Gr.transition,r=lt;try{if(Gr.transition=null,lt=1,e)return e()}finally{lt=r,Gr.transition=n,Xe=t,!(Xe&6)&&ca()}}function c1(){yr=dc.current,bt(dc)}function za(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,L3(n)),Kt!==null)for(n=Kt.return;n!==null;){var r=n;switch(Vb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Hh();break;case 3:Ac(),bt(ar),bt(In),Jb();break;case 5:Zb(r);break;case 4:Ac();break;case 13:bt(Tt);break;case 19:bt(Tt);break;case 10:qb(r.type._context);break;case 22:case 23:c1()}n=n.return}if(hn=e,Kt=e=zs(e.current,null),En=yr=t,Zt=0,Qd=null,s1=yg=Xa=0,or=_d=null,Ma!==null){for(t=0;t<Ma.length;t++)if(n=Ma[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Ma=null}return e}function f2(e,t){do{var n=Kt;try{if(Kb(),ch.current=Qh,Jh){for(var r=Mt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Jh=!1}if(Ya=0,un=Yt=Mt=null,kd=!1,Xd=0,i1.current=null,n===null||n.return===null){Zt=1,Qd=t,Kt=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=En,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=ck(s);if(p!==null){p.flags&=-257,uk(p,s,a,i,t),p.mode&1&&lk(i,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){lk(i,c,t),u1();break e}l=Error(H(426))}}else if(kt&&a.mode&1){var y=ck(s);if(y!==null){!(y.flags&65536)&&(y.flags|=256),uk(y,s,a,i,t),Hb(Dc(l,a));break e}}i=l=Dc(l,a),Zt!==4&&(Zt=2),_d===null?_d=[i]:_d.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=YT(i,l,t);tk(i,v);break e;case 1:a=l;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ls===null||!Ls.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=XT(i,a,t);tk(i,k);break e}}i=i.return}while(i!==null)}m2(n)}catch(E){t=E,Kt===n&&n!==null&&(Kt=n=n.return);continue}break}while(!0)}function p2(){var e=em.current;return em.current=Qh,e===null?Qh:e}function u1(){(Zt===0||Zt===3||Zt===2)&&(Zt=4),hn===null||!(Xa&268435455)&&!(yg&268435455)||ks(hn,En)}function rm(e,t){var n=Xe;Xe|=2;var r=p2();(hn!==e||En!==t)&&(yi=null,za(e,t));do try{lL();break}catch(o){f2(e,o)}while(!0);if(Kb(),Xe=n,em.current=r,Kt!==null)throw Error(H(261));return hn=null,En=0,Zt}function lL(){for(;Kt!==null;)h2(Kt)}function cL(){for(;Kt!==null&&!AI();)h2(Kt)}function h2(e){var t=v2(e.alternate,e,yr);e.memoizedProps=e.pendingProps,t===null?m2(e):Kt=t,i1.current=null}function m2(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=nL(n,t),n!==null){n.flags&=32767,Kt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Zt=6,Kt=null;return}}else if(n=tL(n,t,yr),n!==null){Kt=n;return}if(t=t.sibling,t!==null){Kt=t;return}Kt=t=e}while(t!==null);Zt===0&&(Zt=5)}function ya(e,t,n){var r=lt,o=Gr.transition;try{Gr.transition=null,lt=1,uL(e,t,n,r)}finally{Gr.transition=o,lt=r}return null}function uL(e,t,n,r){do wc();while(Os!==null);if(Xe&6)throw Error(H(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(HI(e,i),e===hn&&(Kt=hn=null,En=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ip||(Ip=!0,y2(jh,function(){return wc(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Gr.transition,Gr.transition=null;var s=lt;lt=1;var a=Xe;Xe|=4,i1.current=null,oL(e,n),c2(n,e),M3(O0),Fh=!!C0,O0=C0=null,e.current=n,iL(n),DI(),Xe=a,lt=s,Gr.transition=i}else e.current=n;if(Ip&&(Ip=!1,Os=e,nm=o),i=e.pendingLanes,i===0&&(Ls=null),jI(n.stateNode),cr(e,Ft()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(tm)throw tm=!1,e=q0,q0=null,e;return nm&1&&e.tag!==0&&wc(),i=e.pendingLanes,i&1?e===G0?Cd++:(Cd=0,G0=e):Cd=0,ca(),null}function wc(){if(Os!==null){var e=GO(nm),t=Gr.transition,n=lt;try{if(Gr.transition=null,lt=16>e?16:e,Os===null)var r=!1;else{if(e=Os,Os=null,nm=0,Xe&6)throw Error(H(331));var o=Xe;for(Xe|=4,se=e.current;se!==null;){var i=se,s=i.child;if(se.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(se=c;se!==null;){var u=se;switch(u.tag){case 0:case 11:case 15:Ed(8,u,i)}var d=u.child;if(d!==null)d.return=u,se=d;else for(;se!==null;){u=se;var f=u.sibling,p=u.return;if(s2(u),u===c){se=null;break}if(f!==null){f.return=p,se=f;break}se=p}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}se=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,se=s;else e:for(;se!==null;){if(i=se,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ed(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,se=v;break e}se=i.return}}var x=e.current;for(se=x;se!==null;){s=se;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,se=w;else e:for(s=x;se!==null;){if(a=se,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:vg(9,a)}}catch(E){$t(a,a.return,E)}if(a===s){se=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,se=k;break e}se=a.return}}if(Xe=o,ca(),Yo&&typeof Yo.onPostCommitFiberRoot=="function")try{Yo.onPostCommitFiberRoot(cg,e)}catch{}r=!0}return r}finally{lt=n,Gr.transition=t}}return!1}function kk(e,t,n){t=Dc(n,t),t=YT(e,t,1),e=Is(e,t,1),t=Wn(),e!==null&&(Kf(e,1,t),cr(e,t))}function $t(e,t,n){if(e.tag===3)kk(e,e,n);else for(;t!==null;){if(t.tag===3){kk(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ls===null||!Ls.has(r))){e=Dc(n,e),e=XT(t,e,1),t=Is(t,e,1),e=Wn(),t!==null&&(Kf(t,1,e),cr(t,e));break}}t=t.return}}function dL(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Wn(),e.pingedLanes|=e.suspendedLanes&n,hn===e&&(En&n)===n&&(Zt===4||Zt===3&&(En&130023424)===En&&500>Ft()-a1?za(e,0):s1|=n),cr(e,t)}function g2(e,t){t===0&&(e.mode&1?(t=Cp,Cp<<=1,!(Cp&130023424)&&(Cp=4194304)):t=1);var n=Wn();e=$i(e,t),e!==null&&(Kf(e,t,n),cr(e,n))}function fL(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),g2(e,n)}function pL(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),g2(e,n)}var v2;v2=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ar.current)ir=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ir=!1,eL(e,t,n);ir=!!(e.flags&131072)}else ir=!1,kt&&t.flags&1048576&&bT(t,qh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;dh(e,t),e=t.pendingProps;var o=Rc(t,In.current);bc(t,n),o=e1(null,t,r,e,o,n);var i=t1();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lr(r)?(i=!0,Wh(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Yb(t),o.updater=mg,t.stateNode=o,o._reactInternals=t,I0(t,r,e,n),t=z0(null,t,r,!0,i,n)):(t.tag=0,kt&&i&&Ub(t),Un(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(dh(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=mL(r),e=ho(r,e),o){case 0:t=j0(null,t,r,e,n);break e;case 1:t=pk(null,t,r,e,n);break e;case 11:t=dk(null,t,r,e,n);break e;case 14:t=fk(null,t,r,ho(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ho(r,o),j0(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ho(r,o),pk(e,t,r,o,n);case 3:e:{if(e2(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,o=i.element,ET(e,t),Xh(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Dc(Error(H(423)),t),t=hk(e,t,r,n,o);break e}else if(r!==o){o=Dc(Error(H(424)),t),t=hk(e,t,r,n,o);break e}else for(kr=Ds(t.stateNode.containerInfo.firstChild),Er=t,kt=!0,vo=null,n=TT(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Nc(),r===o){t=Ai(e,t,n);break e}Un(e,t,r,n)}t=t.child}return t;case 5:return PT(t),e===null&&$0(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,T0(r,o)?s=null:i!==null&&T0(r,i)&&(t.flags|=32),QT(e,t),Un(e,t,s,n),t.child;case 6:return e===null&&$0(t),null;case 13:return t2(e,t,n);case 4:return Xb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=$c(t,null,r,n):Un(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ho(r,o),dk(e,t,r,o,n);case 7:return Un(e,t,t.pendingProps,n),t.child;case 8:return Un(e,t,t.pendingProps.children,n),t.child;case 12:return Un(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,gt(Gh,r._currentValue),r._currentValue=s,i!==null)if(No(i.value,s)){if(i.children===o.children&&!ar.current){t=Ai(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Ti(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),A0(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),A0(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Un(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,bc(t,n),o=Xr(o),r=r(o),t.flags|=1,Un(e,t,r,n),t.child;case 14:return r=t.type,o=ho(r,t.pendingProps),o=ho(r.type,o),fk(e,t,r,o,n);case 15:return ZT(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ho(r,o),dh(e,t),t.tag=1,lr(r)?(e=!0,Wh(t)):e=!1,bc(t,n),CT(t,r,o),I0(t,r,o,n),z0(null,t,r,!0,e,n);case 19:return n2(e,t,n);case 22:return JT(e,t,n)}throw Error(H(156,t.tag))};function y2(e,t){return HO(e,t)}function hL(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wr(e,t,n,r){return new hL(e,t,n,r)}function d1(e){return e=e.prototype,!(!e||!e.isReactComponent)}function mL(e){if(typeof e=="function")return d1(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Mb)return 11;if(e===Rb)return 14}return 2}function zs(e,t){var n=e.alternate;return n===null?(n=Wr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hh(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")d1(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case tc:return Fa(n.children,o,i,t);case Pb:s=8,o|=8;break;case s0:return e=Wr(12,n,t,o|2),e.elementType=s0,e.lanes=i,e;case a0:return e=Wr(13,n,t,o),e.elementType=a0,e.lanes=i,e;case l0:return e=Wr(19,n,t,o),e.elementType=l0,e.lanes=i,e;case OO:return xg(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _O:s=10;break e;case CO:s=9;break e;case Mb:s=11;break e;case Rb:s=14;break e;case ys:s=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Wr(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Fa(e,t,n,r){return e=Wr(7,e,r,t),e.lanes=n,e}function xg(e,t,n,r){return e=Wr(22,e,r,t),e.elementType=OO,e.lanes=n,e.stateNode={isHidden:!1},e}function fy(e,t,n){return e=Wr(6,e,null,t),e.lanes=n,e}function py(e,t,n){return t=Wr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function gL(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qv(0),this.expirationTimes=qv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qv(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function f1(e,t,n,r,o,i,s,a,l){return e=new gL(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Wr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yb(i),e}function vL(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ec,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function x2(e){if(!e)return Gs;e=e._reactInternals;e:{if(gl(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(lr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(lr(n))return yT(e,n,t)}return t}function b2(e,t,n,r,o,i,s,a,l){return e=f1(n,r,!0,e,o,i,s,a,l),e.context=x2(null),n=e.current,r=Wn(),o=js(n),i=Ti(r,o),i.callback=t??null,Is(n,i,o),e.current.lanes=o,Kf(e,o,r),cr(e,r),e}function bg(e,t,n,r){var o=t.current,i=Wn(),s=js(o);return n=x2(n),t.context===null?t.context=n:t.pendingContext=n,t=Ti(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Is(o,t,s),e!==null&&(Co(e,o,s,i),lh(e,o,s)),s}function om(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ek(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function p1(e,t){Ek(e,t),(e=e.alternate)&&Ek(e,t)}function yL(){return null}var w2=typeof reportError=="function"?reportError:function(e){console.error(e)};function h1(e){this._internalRoot=e}wg.prototype.render=h1.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));bg(e,t,null,null)};wg.prototype.unmount=h1.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Za(function(){bg(null,e,null,null)}),t[Ni]=null}};function wg(e){this._internalRoot=e}wg.prototype.unstable_scheduleHydration=function(e){if(e){var t=ZO();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ss.length&&t!==0&&t<Ss[n].priority;n++);Ss.splice(n,0,e),n===0&&QO(e)}};function m1(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Sg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function _k(){}function xL(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=om(s);i.call(c)}}var s=b2(t,r,e,0,null,!1,!1,"",_k);return e._reactRootContainer=s,e[Ni]=s.current,Wd(e.nodeType===8?e.parentNode:e),Za(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=om(l);a.call(c)}}var l=f1(e,0,!1,null,null,!1,!1,"",_k);return e._reactRootContainer=l,e[Ni]=l.current,Wd(e.nodeType===8?e.parentNode:e),Za(function(){bg(t,l,n,r)}),l}function kg(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=om(s);a.call(l)}}bg(t,s,e,o)}else s=xL(n,t,e,o,r);return om(s)}YO=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ku(t.pendingLanes);n!==0&&(Ab(t,n|1),cr(t,Ft()),!(Xe&6)&&(Ic=Ft()+500,ca()))}break;case 13:Za(function(){var r=$i(e,1);if(r!==null){var o=Wn();Co(r,e,1,o)}}),p1(e,1)}};Db=function(e){if(e.tag===13){var t=$i(e,134217728);if(t!==null){var n=Wn();Co(t,e,134217728,n)}p1(e,134217728)}};XO=function(e){if(e.tag===13){var t=js(e),n=$i(e,t);if(n!==null){var r=Wn();Co(n,e,t,r)}p1(e,t)}};ZO=function(){return lt};JO=function(e,t){var n=lt;try{return lt=e,t()}finally{lt=n}};y0=function(e,t,n){switch(t){case"input":if(d0(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=pg(r);if(!o)throw Error(H(90));PO(r),d0(r,o)}}}break;case"textarea":RO(e,n);break;case"select":t=n.value,t!=null&&gc(e,!!n.multiple,t,!1)}};jO=l1;zO=Za;var bL={usingClientEntryPoint:!1,Events:[Gf,ic,pg,IO,LO,l1]},Ou={findFiberByHostInstance:Pa,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},wL={bundleType:Ou.bundleType,version:Ou.version,rendererPackageName:Ou.rendererPackageName,rendererConfig:Ou.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ui.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=UO(e),e===null?null:e.stateNode},findFiberByHostInstance:Ou.findFiberByHostInstance||yL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lp.isDisabled&&Lp.supportsFiber)try{cg=Lp.inject(wL),Yo=Lp}catch{}}Rr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=bL;Rr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m1(t))throw Error(H(200));return vL(e,t,null,n)};Rr.createRoot=function(e,t){if(!m1(e))throw Error(H(299));var n=!1,r="",o=w2;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=f1(e,1,!1,null,null,n,!1,r,o),e[Ni]=t.current,Wd(e.nodeType===8?e.parentNode:e),new h1(t)};Rr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=UO(t),e=e===null?null:e.stateNode,e};Rr.flushSync=function(e){return Za(e)};Rr.hydrate=function(e,t,n){if(!Sg(t))throw Error(H(200));return kg(null,e,t,!0,n)};Rr.hydrateRoot=function(e,t,n){if(!m1(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=w2;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=b2(t,null,e,1,n??null,o,!1,i,s),e[Ni]=t.current,Wd(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new wg(t)};Rr.render=function(e,t,n){if(!Sg(t))throw Error(H(200));return kg(null,e,t,!1,n)};Rr.unmountComponentAtNode=function(e){if(!Sg(e))throw Error(H(40));return e._reactRootContainer?(Za(function(){kg(null,null,e,!1,function(){e._reactRootContainer=null,e[Ni]=null})}),!0):!1};Rr.unstable_batchedUpdates=l1;Rr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Sg(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return kg(e,t,n,!1,r)};Rr.version="18.2.0-next-9e3b772b8-20220608";function S2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(S2)}catch(e){console.error(e)}}S2(),bO.exports=Rr;var $r=bO.exports;const k2=ai($r),SL=lO({__proto__:null,default:k2},[$r]);var Ck=$r;Ah.createRoot=Ck.createRoot,Ah.hydrateRoot=Ck.hydrateRoot;function Z0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g1(e,t){if(e){if(typeof e=="string")return Z0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z0(e,t)}}function Eg(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g1(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
41
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,a;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function v1(e){return e.length>0}var Xf=Object.freeze({kind:"ok",value:void 0});function _n(e){return e===void 0?Xf:{kind:"ok",value:e}}function Vt(e){return{kind:"err",error:e}}function iu(e){return e===Xf||e.kind==="ok"}function _g(e){return e!==Xf&&e.kind==="err"}function E2(e){var t=[],n=[],r=Eg(e),o;try{for(r.s();!(o=r.n()).done;){var i=o.value;iu(i)?t.push(i.value):n.push(i.error)}}catch(s){r.e(s)}finally{r.f()}return v1(n)?Vt(n):_n(t)}function kL(e){return E2(e)}function EL(e){var t=[],n=Eg(e),r;try{for(n.s();!(r=n.n()).done;){var o=r.value;_g(o)&&t.push(o.error)}}catch(i){n.e(i)}finally{n.f()}return v1(t)?Vt(t):Xf}function y1(e,t){return function(n){for(var r=_n(t),o=0;o<n.length&&iu(r);++o)r=e(r.value,n[o],o);return r}}function Hr(e){return function(t){return iu(t)?_n(e(t.value)):t}}function Ja(e){return function(t){return iu(t)?e(t.value):t}}function _L(e){return function(t){return _g(t)?Vt(e(t.error)):t}}function CL(e,t){return function(n){return e(n)?_n(n):Vt(t(n))}}var Cg=function(t,n){return function(r){return iu(r)?t(r.value)?r:Vt(n(r.value)):r}},St=Object.freeze({__proto__:null,voidOk:Xf,ok:_n,err:Vt,isOk:iu,isErr:_g,allT:E2,all:kL,allV:EL,flatMapReduce:y1,map:Hr,flatMap:Ja,mapErr:_L,fromPredicate:CL,filterOrElse:Cg});function OL(e){if(Array.isArray(e))return Z0(e)}function TL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
42
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _2(e){return OL(e)||TL(e)||g1(e)||PL()}function ye(e){"@babel/helpers - typeof";return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(e)}function ML(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C2(e){var t=ML(e,"string");return typeof t=="symbol"?t:String(t)}function pe(e,t,n){return t=C2(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ok(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Lc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ok(Object(n),!0).forEach(function(r){pe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ok(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RL(e){if(Array.isArray(e))return e}function NL(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function $L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
43
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kn(e,t){return RL(e)||NL(e,t)||g1(e,t)||$L()}function nn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,C2(r.key),r)}}function rn(e,t,n){return t&&Tk(e.prototype,t),n&&Tk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function im(e){return im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},im(e)}function O2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(O2=function(){return!!e})()}function T2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AL(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T2(e)}function Ar(e,t,n){return t=im(t),AL(e,O2()?Reflect.construct(t,n||[],im(e).constructor):t.apply(e,n))}function J0(e,t){return J0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},J0(e,t)}function Dr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&J0(e,t)}var Ir=function(){function e(){nn(this,e)}return rn(e,[{key:"appendValidationError",value:function(n,r,o,i){return n?(n[r]?n[r].push({message:o,value:i}):n[r]=[{message:o,value:i}],n):pe({},r,[{message:o,value:i}])}}]),e}(),Od=Symbol("GetSchema"),Hn=Symbol("Path"),Xt=Symbol("GetSource");function DL(e){return e[Od]}var x1=rn(function e(t){nn(this,e),this.span=t}),IL=function(e){Dr(t,e);function t(n,r){var o;return nn(this,t),o=Ar(this,t,[r]),pe(T2(o),"type","Sym"),o.value=n,o}return rn(t,[{key:"transpile",value:function(){return this.value}}]),t}(x1);new IL("()");var mn="_type",Cn="_ref",Pk="_tag",LL=function(e){Dr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return nn(this,t),r=Ar(this,t),r.options=n,r.opt=o,r}return rn(t,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:o==null?pe({},r,[{message:"Non-optional file was null or undefined.",value:o}]):typeof o[Cn]!="string"?pe({},r,[{message:"File did not have a file reference string. Got: ".concat(ye(o[Cn])),value:o}]):o[mn]!=="file"?pe({},r,[{message:"File did not have the valid file extension type. Got: ".concat(o[mn]),value:o}]):o.metadata?pe({},r,[{message:"Found metadata, but it could not be validated. File metadata must be an object with the required props: width (positive number), height (positive number) and sha256 (string of length 64 of the base16 hash).",value:o,fixes:["file:check-metadata"]}]):pe({},r,[{message:"Missing File metadata.",value:o,fixes:["file:add-metadata"]}])}},{key:"assert",value:function(r){return this.opt&&r==null?!0:(r==null?void 0:r[Cn])==="file"&&(r==null?void 0:r[mn])==="file"}},{key:"optional",value:function(){return new t(this.options,!0)}},{key:"serialize",value:function(){return{type:"file",options:this.options,opt:this.opt}}}]),t}(Ir),jL=function(t){return new LL(t)};function P2(e){var t,n;if(!e[Cn].startsWith("/public")){var r,o;return{url:e[Cn]+((r=e.metadata)!==null&&r!==void 0&&r.sha256?"?sha256=".concat((o=e.metadata)===null||o===void 0?void 0:o.sha256):""),metadata:e.metadata}}return{url:e[Cn].slice(7)+((t=e.metadata)!==null&&t!==void 0&&t.sha256?"?sha256=".concat((n=e.metadata)===null||n===void 0?void 0:n.sha256):""),metadata:e.metadata}}function M2(e){return ye(e)==="object"&&e!==null&&e!==void 0&&("val"in e||"valPath"in e)}function zL(e){return ye(e)==="object"&&e!==null&&e!==void 0&&Hn in e&&"val"in e}function R2(e){return e[Hn]}function FL(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Mk(e,t,n){return t?ln(e(ln(t,n))):ln(t,n)}function Fs(e){return ye(e)==="object"&&e!==null&&(Xt in e||Hn in e)}function ln(e,t,n){if(ye(e)==="object"){if(Fs(e))return e;if(M2(e))return ln(e.val,e.valPath)}if(e&&e[Cn]&&e[mn]==="file"){var r=e[Cn];if(typeof r!="string")throw Error("Invalid file ref: "+r);return ln(P2(e),t,n)}switch(ye(e)){case"function":case"symbol":throw Error("Invalid selector type: ".concat(ye(e),": ").concat(e));case"object":if(e!==null)return new Proxy(e,{has:function(i,s){return s===Xt||s===Hn||s==="andThen"||s===Od?!0:s in i},get:function(i,s){if(s===Xt)return e;if(s===Hn)return t;if(s===Od)return n;if(s==="andThen")return function(l){return Mk(l,e,t)};if(Array.isArray(i)){if(s==="filter")return function(l){var c=i.map(function(u,d){return ln(u,Kr(t,d),n==null?void 0:n.item)}).filter(function(u){return l&&l instanceof Ir?l.assert(Rk(u)):Rk(l(u))});return ln(c,t,n)};if(s==="map")return function(l){var c=i.map(function(u,d){var f=l(ln(u,Kr(t,d),n==null?void 0:n.item),ln(d));return Fs(f)?f:ln(f)});return ln(c,t,n)}}if(Array.isArray(i)&&s==="length")return ln(i.length);var a=Reflect.get(i,s);return FL(e,s)?Number.isNaN(Number(s))?ln(a,Kr(t,s),n==null?void 0:n.items[s]):ln(a,Kr(t,Number(s)),n==null?void 0:n.item):a}});default:return pe(pe(pe({eq:function(i){var s=i;if(Fs(i)&&(s=i[Xt],s instanceof x1))throw Error("TODO: Cannot evaluate equality with an Expr");return ln(e===s,void 0)},andThen:function(i){return Mk(i,e===void 0?null:e,t)}},Xt,e===void 0?null:e),Hn,t),Od,n)}}function Kr(e,t){if(ye(t)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(t.toString()));return e!==void 0?"".concat(e,".").concat(JSON.stringify(t)):void 0}function Rk(e){if(ye(e)==="object"&&(Xt in e||Hn in e)){var t=e[Xt];return t}return e}var b1=function(e){Dr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return nn(this,t),r=Ar(this,t),r.items=n,r.opt=o,r}return rn(t,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:ye(o)!=="object"?pe({},r,[{message:"Expected 'object', got '".concat(ye(o),"'")}]):Array.isArray(o)?pe({},r,[{message:"Expected 'object', got 'array'"}]):(Object.entries(this.items).forEach(function(a){var l=Kn(a,2),c=l[0],u=l[1],d=Kr(r,c);if(!d)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(c),o);else{var f=u.validate(d,o[c]);f&&s?s=Lc(Lc({},f),s):f&&(s=f)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;for(var o=0,i=Object.entries(this.items);o<i.length;o++){var s=Kn(i[o],2),a=s[0],l=s[1];if(!l.assert(r[a]))return!1}return ye(r)==="object"&&!Array.isArray(r)}},{key:"optional",value:function(){return new t(this.items,!0)}},{key:"serialize",value:function(){return{type:"object",items:Object.fromEntries(Object.entries(this.items).map(function(r){var o=Kn(r,2),i=o[0],s=o[1];return[i,s.serialize()]})),opt:this.opt}}}]),t}(Ir),BL=function(t){return new b1(t)},N2=function(e){Dr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return nn(this,t),r=Ar(this,t),r.item=n,r.opt=o,r}return rn(t,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:ye(o)!=="object"||!Array.isArray(o)?pe({},r,[{message:"Expected 'array', got '".concat(ye(o),"'")}]):(o.forEach(function(a,l){var c=Kr(r,l);if(!c)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at index ").concat(l),o);else{var u=i.item.validate(c,a);u&&s?s=Lc(Lc({},u),s):u&&(s=u)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;var o=Eg(r),i;try{for(o.s();!(i=o.n()).done;){var s=i.value;if(!this.item.assert(s))return!1}}catch(a){o.e(a)}finally{o.f()}return ye(r)==="object"&&Array.isArray(r)}},{key:"optional",value:function(){return new t(this.item,!0)}},{key:"serialize",value:function(){return{type:"array",item:this.item.serialize(),opt:this.opt}}}]),t}(Ir),UL=function(t){return new N2(t)},Q0=function(e){Dr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return nn(this,t),r=Ar(this,t),r.value=n,r.opt=o,r}return rn(t,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="string"?pe({},r,[{message:"Expected 'string', got '".concat(ye(o),"'"),value:o}]):o!==this.value?pe({},r,[{message:"Expected literal '".concat(this.value,"', got '").concat(o,"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="string"}},{key:"optional",value:function(){return new t(this.value,!0)}},{key:"serialize",value:function(){return{type:"literal",value:this.value,opt:this.opt}}}]),t}(Ir),VL=function(t){return new Q0(t)},$2=function(e){Dr(t,e);function t(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return nn(this,t),o=Ar(this,t),o.key=n,o.items=r,o.opt=i,o}return rn(t,[{key:"validate",value:function(r,o){var i=o,s=!1;if(this.opt&&i==null)return!1;if(!this.key)return pe({},r,[{message:"Missing required first argument in union"}]);var a=this.key;if(!Array.isArray(this.items))return pe({},r,[{message:"A union schema must take more than 1 schema arguments",fatal:!0}]);if(typeof a=="string"){if(this.items.some(function(P){return!(P instanceof b1)}))return pe({},r,[{message:"Key is a string, so all schema items must be objects",fatal:!0}]);var l=this.items,c=l.map(function(P){return P.serialize()}),u=c.filter(function(P){return P.type!=="object"||P.items[a].type!=="literal"});if(u.length>0)return pe({},r,[{message:"All schema items must be objects with a key: ".concat(a," that is a literal schema. Found: ").concat(JSON.stringify(u,null,2)),fatal:!0}]);var d=c,f=d.filter(function(P){return P.items[a].opt});if(f.length>1)return pe({},r,[{message:"Schema cannot have an optional keys: ".concat(a),fatal:!0}]);if(ye(i)!=="object")return pe({},r,[{message:"Expected an object"}]);var p=i;if(p[a]===void 0)return pe({},r,[{message:"Missing required key: ".concat(a)}]);var m=[],g=Eg(d),y;try{for(g.s();!(y=g.n()).done;){var v=y.value,x=v.items[a];if(x.type==="literal")if(!m.includes(x.value))m.push(x.value);else return pe({},r,[{message:"Found duplicate key in schema: ".concat(x.value),fatal:!0}])}}catch(P){g.e(P)}finally{g.f()}var w=l.find(function(P){return!P.items[a].validate(r,p[a])});if(!w){var k=Kr(r,a);if(!k)throw new Error("Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(a));return pe({},k,[{message:'Invalid key: "'.concat(a,'". Value was: "').concat(p[a],'". Valid values: ').concat(d.map(function(P){var M=P.items[a];if(M.type==="literal"&&M.value)return'"'.concat(M.value,'"');throw new Error("Expected literal schema, got ".concat(JSON.stringify(M,null,2)))}).join(", "))}])}var E=w.validate(r,p);if(E)return E}else if(a instanceof Q0){if(this.items.some(function(P){return!(P instanceof Q0)}))return pe({},r,[{message:"Key is a literal schema, so all schema items must be literals",fatal:!0}]);var S=[a].concat(_2(this.items));if(typeof i=="string"){var _=S.some(function(P){return!P.validate(r,i)});if(!_)return pe({},r,[{message:"Union must match one of the following: ".concat(S.map(function(P){return'"'.concat(P.value,'"')}).join(", "))}])}}else return pe({},r,[{message:"Expected a string or literal"}]);return s}},{key:"assert",value:function(r){return!0}},{key:"optional",value:function(){return new t(this.key,this.items,!0)}},{key:"serialize",value:function(){return typeof this.key=="string"?{type:"union",key:this.key,items:this.items.map(function(r){return r.serialize()}),opt:this.opt}:{type:"union",key:this.key.serialize(),items:this.items.map(function(r){return r.serialize()}),opt:this.opt}}}]),t}(Ir),HL=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new $2(t,r)},A2=function(e){Dr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return nn(this,t),r=Ar(this,t),r.options=n,r.opt=o,r}return rn(t,[{key:"validate",value:function(r,o){return!1}},{key:"assert",value:function(r){return!0}},{key:"optional",value:function(){return new t(this.options,!0)}},{key:"serialize",value:function(){return{type:"richtext",opt:this.opt,options:this.options}}}]),t}(Ir),WL=function(t){return new A2(t??{})},D2=function(e){Dr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return nn(this,t),r=Ar(this,t),r.options=n,r.opt=o,r}return rn(t,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:o==null?pe({},r,[{message:"Non-optional image was null or undefined.",value:o}]):typeof o[Cn]!="string"?pe({},r,[{message:"Image did not have a file reference string. Got: ".concat(ye(o[Cn])),value:o}]):o[mn]!=="file"?pe({},r,[{message:"Image did not have the valid file extension type. Got: ".concat(o[mn]),value:o}]):o.metadata?pe({},r,[{message:"Found metadata, but it could not be validated. Image metadata must be an object with the required props: width (positive number), height (positive number) and sha256 (string of length 64 of the base16 hash).",value:o,fixes:["image:replace-metadata"]}]):pe({},r,[{message:"Could not validate Image metadata.",value:o,fixes:["image:add-metadata"]}])}},{key:"assert",value:function(r){return this.opt&&r==null?!0:(r==null?void 0:r[Cn])==="image"&&(r==null?void 0:r[mn])==="file"}},{key:"optional",value:function(){return new t(this.options,!0)}},{key:"serialize",value:function(){return{type:"image",options:this.options,opt:this.opt}}}]),t}(Ir),KL=function(t){return new D2(t)},I2=function(e){Dr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return nn(this,t),r=Ar(this,t),r.item=n,r.opt=o,r}return rn(t,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:ye(o)!=="object"?pe({},r,[{message:"Expected 'object', got '".concat(ye(o),"'")}]):Array.isArray(o)?pe({},r,[{message:"Expected 'object', got 'array'"}]):(Object.entries(o).forEach(function(a){var l=Kn(a,2),c=l[0],u=l[1],d=Kr(r,c);if(!d)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(u),o);else{var f=i.item.validate(d,u);f&&s?s=Lc(Lc({},f),s):f&&(s=f)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;for(var o=0,i=Object.entries(r);o<i.length;o++){var s=Kn(i[o],2),a=s[1];if(!this.item.assert(a))return!1}return ye(r)==="object"&&!Array.isArray(r)}},{key:"optional",value:function(){return new t(this.item,!0)}},{key:"serialize",value:function(){return{type:"record",item:this.item.serialize(),opt:this.opt}}}]),t}(Ir),qL=function(t){return new I2(t)};function GL(e){var t=e[Xt];if(t instanceof x1)throw Error("Cannot get raw source of an Expr");var n=t;return n}function YL(e){return e.indexOf(".")===-1?[e,""]:[e.slice(0,e.indexOf(".")),e.slice(e.indexOf(".")+1)]}function XL(e){return e instanceof b1||ye(e)==="object"&&"type"in e&&e.type==="object"}function ZL(e){return e instanceof I2||ye(e)==="object"&&"type"in e&&e.type==="record"}function JL(e){return e instanceof N2||ye(e)==="object"&&"type"in e&&e.type==="array"}function QL(e){return e instanceof $2||ye(e)==="object"&&"type"in e&&e.type==="union"}function e5(e){return e instanceof A2||ye(e)==="object"&&"type"in e&&e.type==="richtext"}function t5(e){return e instanceof D2||ye(e)==="object"&&"type"in e&&e.type==="image"}function n5(e,t,n){for(var r=L2(e),o=_2(r),i=n,s=t,a=function(){var u=r.shift();if(u===void 0)throw Error("Unexpected undefined part");if(JL(i)){if(Number.isNaN(Number(u)))throw Error("Invalid path: array schema ".concat(JSON.stringify(i)," must have a number as path, but got ").concat(u,". Path: ").concat(e));if(ye(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of array, but got ".concat(ye(s)));if(s[u]===void 0){var d;throw Error("Invalid path: array source (length: ".concat((d=s)===null||d===void 0?void 0:d.length,") did not have index ").concat(u," from path: ").concat(e))}s=s[u],i=i.item}else if(ZL(i)){if(typeof u!="string")throw Error("Invalid path: record schema ".concat(i," must have path: ").concat(u," as string"));if(ye(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of record, but got ".concat(ye(s)));if(!s[u])throw Error("Invalid path: record source did not have key ".concat(u," from path: ").concat(e));s=s[u],i=i.item}else if(XL(i)){if(ye(s)!=="object")throw Error("Schema type error: expected source to be type of object, but got ".concat(ye(s)));if(!s[u])throw Error("Invalid path: object source did not have key ".concat(u," from path: ").concat(e));s=s[u],i=i.items[u]}else{if(t5(i))return{v:{path:o.slice(0,o.length-r.length-1).map(function(g){return JSON.stringify(g)}).join("."),schema:i,source:s}};if(QL(i)){var f=i.key;if(typeof f!="string")return{v:{path:o.map(function(g){return Number.isNaN(Number(g))?JSON.stringify(g):g}).join("."),schema:i,source:s}};var p=s[f];if(!p)throw Error("Invalid path: union source ".concat(i," did not have required key ").concat(f," in path: ").concat(e));var m=i.items.find(function(g){var y;return(g==null||(y=g.items)===null||y===void 0||(y=y[f])===null||y===void 0?void 0:y.value)===p});if(!m)throw Error("Invalid path: union schema ".concat(i," did not have a child object with ").concat(f," of value ").concat(p," in path: ").concat(e));i=m.items[u],s=s[u]}else{if(e5(i))return{v:{path:o.slice(0,o.length-r.length-1).map(function(g){return JSON.stringify(g)}).join("."),schema:i,source:s}};throw Error("Invalid path: ".concat(u," resolved to an unexpected schema ").concat(JSON.stringify(i)))}}},l;r.length>0;)if(l=a(),l)return l.v;if(r.length>0)throw Error("Invalid path: ".concat(r.join(".")," is not a valid path"));return{path:o.map(function(c){return Number.isNaN(Number(c))?JSON.stringify(c):c}).join("."),schema:i,source:s}}function L2(e){for(var t=[],n=0;n<e.length;){var r="";if(e[n]==='"'){for(n++;n<e.length&&e[n]!=='"';)e[n]==="\\"&&e[n+1]==='"'?(r+='"',n++):r+=e[n],n++;if(e[n]!=='"'){var o;throw new Error("Invalid input (".concat(JSON.stringify(e),"): Missing closing double quote: ").concat((o=e[n])!==null&&o!==void 0?o:"at end of string"," (char: ").concat(n,"; length: ").concat(e.length,")"))}}else for(;n<e.length&&e[n]!==".";)r+=e[n],n++;r!==""&&t.push(r),n++}return t}var Tr=rn(function e(t){nn(this,e),this.message=t}),r5=function(e){Dr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return nn(this,t),r=Ar(this,t),r.options=n,r.opt=o,r}return rn(t,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="number"?pe({},r,[{message:"Expected 'number', got '".concat(ye(o),"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="number"}},{key:"optional",value:function(){return new t(this.options,!0)}},{key:"serialize",value:function(){return{type:"number",options:this.options,opt:this.opt}}}]),t}(Ir),o5=function(t){return new r5(t)},j2=function(e){Dr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return nn(this,t),r=Ar(this,t),r.options=n,r.opt=o,r.isRaw=i,r}return rn(t,[{key:"validate",value:function(r,o){var i,s,a;if(this.opt&&o==null)return!1;if(typeof o!="string")return pe({},r,[{message:"Expected 'string', got '".concat(ye(o),"'"),value:o}]);var l=[];return(i=this.options)!==null&&i!==void 0&&i.maxLength&&o.length>this.options.maxLength&&l.push({message:"Expected string to be at most ".concat(this.options.maxLength," characters long, got ").concat(o.length),value:o}),(s=this.options)!==null&&s!==void 0&&s.minLength&&o.length<this.options.minLength&&l.push({message:"Expected string to be at least ".concat(this.options.minLength," characters long, got ").concat(o.length),value:o}),(a=this.options)!==null&&a!==void 0&&a.regexp&&!this.options.regexp.test(o)&&l.push({message:"Expected string to match reg exp: ".concat(this.options.regexp.toString(),", got '").concat(o,"'"),value:o}),l.length>0?pe({},r,l):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="string"}},{key:"optional",value:function(){return new t(this.options,!0,this.isRaw)}},{key:"raw",value:function(){return new t(this.options,this.opt,!0)}},{key:"serialize",value:function(){var r,o,i;return{type:"string",options:{maxLength:(r=this.options)===null||r===void 0?void 0:r.maxLength,minLength:(o=this.options)===null||o===void 0?void 0:o.minLength,regexp:((i=this.options)===null||i===void 0?void 0:i.regexp)&&{source:this.options.regexp.source,flags:this.options.regexp.flags}},opt:this.opt,raw:this.isRaw}}}]),t}(Ir),i5=function(t){return new j2(t)},s5=function(e){Dr(t,e);function t(){var n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return nn(this,t),n=Ar(this,t),n.opt=r,n}return rn(t,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="boolean"?pe({},r,[{message:"Expected 'boolean', got '".concat(ye(o),"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="boolean"}},{key:"optional",value:function(){return new t(!0)}},{key:"serialize",value:function(){return{type:"boolean",opt:this.opt}}}]),t}(Ir),a5=function(){return new s5},l5=function(e){Dr(t,e);function t(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return nn(this,t),o=Ar(this,t),o.schema=n,o.sourcePath=r,o.opt=i,o}return rn(t,[{key:"validate",value:function(r,o){if(this.opt&&o==null)return!1;if(!this.schema)return pe({},r,[{message:"Schema not found for module. keyOf must be used with a Val Module"}]);var i=this.schema;if(!(i.type==="array"||i.type==="object"||i.type==="record"))return pe({},r,[{message:"Schema in keyOf must be an 'array', 'object' or 'record'. Found '".concat(i.type,"'")}]);if(i.opt&&o==null)return!1;if(i.type==="array"&&typeof o!="number")return pe({},r,[{message:"Type of value in keyof (array) must be 'number'"}]);if(i.type==="record"&&typeof o!="string")return pe({},r,[{message:"Type of value in keyof (record) must be 'string'"}]);if(i.type==="object"){var s=Object.keys(i.items);if(!s.includes(o))return pe({},r,[{message:"Value of keyOf (object) must be: ".concat(s.join(", "),". Found: ").concat(o)}])}return!1}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;var o=this.schema;if(!o)return!1;var i=o;if(!(i.type==="array"||i.type==="object"||i.type==="record"))return!1;if(i.opt&&r==null)return!0;if(i.type==="array"&&typeof r!="number"||i.type==="record"&&typeof r!="string")return!1;if(i.type==="object"){var s=Object.keys(i.items);if(!s.includes(r))return!1}return!0}},{key:"optional",value:function(){return new t(this.schema,void 0,!0)}},{key:"serialize",value:function(){var r=this.sourcePath;if(!r)throw new Error("Cannot serialize keyOf schema with empty selector. TIP: keyOf must be used with a Val Module.");var o=this.schema;if(!o)throw new Error("Cannot serialize oneOf schema with empty selector.");var i;switch(o.type){case"array":i="number";break;case"record":i="string";break;case"object":i=Object.keys(o.items);break;default:throw new Error("Cannot serialize oneOf schema with selector of type '".concat(o.type,"'. keyOf must be used with a Val Module."))}return{type:"keyOf",path:r,schema:o,opt:this.opt,values:i}}}]),t}(Ir),c5=function(t){var n;return new l5(t==null||(n=t[Od])===null||n===void 0?void 0:n.serialize(),R2(t))};function u5(){return{string:i5,boolean:a5,array:UL,object:BL,number:o5,union:HL,richtext:WL,image:KL,literal:VL,keyOf:c5,record:qL,file:jL}}var Nk="rt_image";function d5(e){return z2(h5(e))}function f5(e){return Fs(e)?ye(e[Xt])==="object"&&e[Xt]!==null&&Array.isArray(e[Xt]):Array.isArray(e)}function p5(e){return Fs(e)?ye(e[Xt])==="object"&&e[Xt]!==null&&!Array.isArray(e[Xt]):ye(e)==="object"}function h5(e){var t=ln(e);function n(r){var o=f5(r),i=p5(r);if(o){var s=Xt in r?r[Xt]:r,a=Hn in r?r[Hn]:void 0;return{val:s.map(function(u,d){return n(Fs(u)?u:ln(u,Kr(a,d)))}),valPath:a}}else if(i){var l=Xt in r?r[Xt]:r,c=Hn in r?r[Hn]:void 0;return{val:l!==null&&Object.fromEntries(Object.entries(l).map(function(u){var d=Kn(u,2),f=d[0],p=d[1];return[f,n(Fs(p)?p:ln(p,Kr(c,f)))]})),valPath:c}}else return Fs(r)?{val:n(r[Xt]),valPath:r[Hn]}:r}return n(t)}function ex(e){var t=M2(e)?e.val:e;switch(ye(t)){case"function":case"symbol":throw Error("Invalid val type: ".concat(ye(t)));case"object":return t===null?null:Array.isArray(t)?t.map(ex):Object.fromEntries(Object.entries(t).map(function(n){var r=Kn(n,2),o=r[0],i=r[1];return[o,i&&ex(i)]}));default:return t}}function z2(e){var t=e.val;switch(ye(t)){case"function":case"symbol":throw Error("Invalid val type: ".concat(ye(t)));case"object":if(t!==null)return new Proxy(t,{has:function(r,o){return o==="val"||o===Hn?!0:$k(r,o)},get:function(r,o){if(o===Hn)return e.valPath;if(o==="val")return ex(e);if(Array.isArray(r)&&o==="length")return r.length;if($k(t,o)){var i,s;return z2({val:Reflect.get(r,o).val,valPath:(i=(s=Reflect.get(r,o))===null||s===void 0?void 0:s.valPath)!==null&&i!==void 0?i:Kr(e.valPath,Array.isArray(r)?Number(o):o)})}return Reflect.get(r,o)}});default:return pe(pe({},Hn,e.valPath),"val",e.val)}}function $k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var m5=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],ut=function(e){return e[e.inputBytes=64]="inputBytes",e[e.inputWords=16]="inputWords",e[e.highIndex=14]="highIndex",e[e.lowIndex=15]="lowIndex",e[e.workWords=64]="workWords",e[e.allocBytes=80]="allocBytes",e[e.allocWords=20]="allocWords",e[e.allocTotal=8e3]="allocTotal",e}(ut||{}),Ak={sha256:1};function g5(e){if(e&&!Ak[e]&&!Ak[e.toLowerCase()])throw new Error("Digest method not supported");return new v5}var v5=function(){function e(){nn(this,e),pe(this,"A",1779033703),pe(this,"B",-1150833019),pe(this,"C",1013904242),pe(this,"D",-1521486534),pe(this,"E",1359893119),pe(this,"F",-1694144372),pe(this,"G",528734635),pe(this,"H",1541459225),pe(this,"_size",0),pe(this,"_sp",0),(!jp||Tu>=ut.allocTotal)&&(jp=new ArrayBuffer(ut.allocTotal),Tu=0),this._byte=new Uint8Array(jp,Tu,ut.allocBytes),this._word=new Int32Array(jp,Tu,ut.allocWords),Tu+=ut.allocBytes}return rn(e,[{key:"update",value:function(n){if(typeof n=="string")return this._utf8(n);if(n==null)throw new TypeError("Invalid type: "+ye(n));var r=n.byteOffset,o=n.byteLength,i=o/ut.inputBytes|0,s=0;if(i&&!(r&3)&&!(this._size%ut.inputBytes)){for(var a=new Int32Array(n.buffer,r,i*ut.inputWords);i--;)this._int32(a,s>>2),s+=ut.inputBytes;this._size+=s}var l=n.BYTES_PER_ELEMENT;if(l!==1&&n.buffer){var c=new Uint8Array(n.buffer,r+s,o-s);return this._uint8(c)}return s===o?this:this._uint8(n,s)}},{key:"_uint8",value:function(n,r){var o=this._byte,i=this._word,s=n.length;for(r=r|0;r<s;){for(var a=this._size%ut.inputBytes,l=a;r<s&&l<ut.inputBytes;)o[l++]=n[r++];l>=ut.inputBytes&&this._int32(i),this._size+=l-a}return this}},{key:"_utf8",value:function(n){for(var r=this._byte,o=this._word,i=n.length,s=this._sp,a=0;a<i;){for(var l=this._size%ut.inputBytes,c=l;a<i&&c<ut.inputBytes;){var u=n.charCodeAt(a++)|0;u<128?r[c++]=u:u<2048?(r[c++]=192|u>>>6,r[c++]=128|u&63):u<55296||u>57343?(r[c++]=224|u>>>12,r[c++]=128|u>>>6&63,r[c++]=128|u&63):s?(u=((s&1023)<<10)+(u&1023)+65536,r[c++]=240|u>>>18,r[c++]=128|u>>>12&63,r[c++]=128|u>>>6&63,r[c++]=128|u&63,s=0):s=u}c>=ut.inputBytes&&(this._int32(o),o[0]=o[ut.inputWords]),this._size+=c-l}return this._sp=s,this}},{key:"_int32",value:function(n,r){var o=this.A,i=this.B,s=this.C,a=this.D,l=this.E,c=this.F,u=this.G,d=this.H,f=0;for(r=r|0;f<ut.inputWords;)ma[f++]=lo(n[r++]);for(f=ut.inputWords;f<ut.workWords;f++)ma[f]=_5(ma[f-2])+ma[f-7]+E5(ma[f-15])+ma[f-16]|0;for(f=0;f<ut.workWords;f++){var p=d+k5(l)+b5(l,c,u)+m5[f]+ma[f]|0,m=S5(o)+w5(o,i,s)|0;d=u,u=c,c=l,l=a+p|0,a=s,s=i,i=o,o=p+m|0}this.A=o+this.A|0,this.B=i+this.B|0,this.C=s+this.C|0,this.D=a+this.D|0,this.E=l+this.E|0,this.F=c+this.F|0,this.G=u+this.G|0,this.H=d+this.H|0}},{key:"digest",value:function(n){var r=this._byte,o=this._word,i=this._size%ut.inputBytes|0;for(r[i++]=128;i&3;)r[i++]=0;if(i>>=2,i>ut.highIndex){for(;i<ut.inputWords;)o[i++]=0;i=0,this._int32(o)}for(;i<ut.inputWords;)o[i++]=0;var s=this._size*8,a=(s&4294967295)>>>0,l=(s-a)/4294967296;return l&&(o[ut.highIndex]=lo(l)),a&&(o[ut.lowIndex]=lo(a)),this._int32(o),n==="hex"?this._hex():this._bin()}},{key:"_hex",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H;return Qi(n)+Qi(r)+Qi(o)+Qi(i)+Qi(s)+Qi(a)+Qi(l)+Qi(c)}},{key:"_bin",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H,u=this._byte,d=this._word;return d[0]=lo(n),d[1]=lo(r),d[2]=lo(o),d[3]=lo(i),d[4]=lo(s),d[5]=lo(a),d[6]=lo(l),d[7]=lo(c),u.slice(0,32)}}]),e}(),ma=new Int32Array(ut.workWords),jp,Tu=0,Qi=function(t){return(t+4294967296).toString(16).substr(-8)},y5=function(t){return t<<24&4278190080|t<<8&16711680|t>>8&65280|t>>24&255},x5=function(t){return t},lo=C5()?x5:y5,b5=function(t,n,r){return r^t&(n^r)},w5=function(t,n,r){return t&n|r&(t|n)},S5=function(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)},k5=function(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)},E5=function(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3},_5=function(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10};function C5(){var e=new Uint8Array(new Uint16Array([65279]).buffer);return e[0]===254}var O5=function(t){return g5().update(t).digest("hex")};function vr(){vr=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(C,T,O){C[T]=O.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(C,T,O){return Object.defineProperty(C,T,{value:O,enumerable:!0,configurable:!0,writable:!0}),C[T]}try{c({},"")}catch{c=function(T,O,R){return T[O]=R}}function u(C,T,O,R){var N=T&&T.prototype instanceof v?T:v,j=Object.create(N.prototype),G=new V(R||[]);return o(j,"_invoke",{value:A(C,O,G)}),j}function d(C,T,O){try{return{type:"normal",arg:C.call(T,O)}}catch(R){return{type:"throw",arg:R}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",m="executing",g="completed",y={};function v(){}function x(){}function w(){}var k={};c(k,s,function(){return this});var E=Object.getPrototypeOf,S=E&&E(E(K([])));S&&S!==n&&r.call(S,s)&&(k=S);var _=w.prototype=v.prototype=Object.create(k);function P(C){["next","throw","return"].forEach(function(T){c(C,T,function(O){return this._invoke(T,O)})})}function M(C,T){function O(N,j,G,xe){var ue=d(C[N],C,j);if(ue.type!=="throw"){var je=ue.arg,Ce=je.value;return Ce&&typeof Ce=="object"&&r.call(Ce,"__await")?T.resolve(Ce.__await).then(function(J){O("next",J,G,xe)},function(J){O("throw",J,G,xe)}):T.resolve(Ce).then(function(J){je.value=J,G(je)},function(J){return O("throw",J,G,xe)})}xe(ue.arg)}var R;o(this,"_invoke",{value:function(N,j){function G(){return new T(function(xe,ue){O(N,j,xe,ue)})}return R=R?R.then(G,G):G()}})}function A(C,T,O){var R=f;return function(N,j){if(R===m)throw new Error("Generator is already running");if(R===g){if(N==="throw")throw j;return{value:e,done:!0}}for(O.method=N,O.arg=j;;){var G=O.delegate;if(G){var xe=I(G,O);if(xe){if(xe===y)continue;return xe}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(R===f)throw R=g,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);R=m;var ue=d(C,T,O);if(ue.type==="normal"){if(R=O.done?g:p,ue.arg===y)continue;return{value:ue.arg,done:O.done}}ue.type==="throw"&&(R=g,O.method="throw",O.arg=ue.arg)}}}function I(C,T){var O=T.method,R=C.iterator[O];if(R===e)return T.delegate=null,O==="throw"&&C.iterator.return&&(T.method="return",T.arg=e,I(C,T),T.method==="throw")||O!=="return"&&(T.method="throw",T.arg=new TypeError("The iterator does not provide a '"+O+"' method")),y;var N=d(R,C.iterator,T.arg);if(N.type==="throw")return T.method="throw",T.arg=N.arg,T.delegate=null,y;var j=N.arg;return j?j.done?(T[C.resultName]=j.value,T.next=C.nextLoc,T.method!=="return"&&(T.method="next",T.arg=e),T.delegate=null,y):j:(T.method="throw",T.arg=new TypeError("iterator result is not an object"),T.delegate=null,y)}function L(C){var T={tryLoc:C[0]};1 in C&&(T.catchLoc=C[1]),2 in C&&(T.finallyLoc=C[2],T.afterLoc=C[3]),this.tryEntries.push(T)}function re(C){var T=C.completion||{};T.type="normal",delete T.arg,C.completion=T}function V(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(L,this),this.reset(!0)}function K(C){if(C||C===""){var T=C[s];if(T)return T.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var O=-1,R=function N(){for(;++O<C.length;)if(r.call(C,O))return N.value=C[O],N.done=!1,N;return N.value=e,N.done=!0,N};return R.next=R}}throw new TypeError(typeof C+" is not iterable")}return x.prototype=w,o(_,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:x,configurable:!0}),x.displayName=c(w,l,"GeneratorFunction"),t.isGeneratorFunction=function(C){var T=typeof C=="function"&&C.constructor;return!!T&&(T===x||(T.displayName||T.name)==="GeneratorFunction")},t.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,w):(C.__proto__=w,c(C,l,"GeneratorFunction")),C.prototype=Object.create(_),C},t.awrap=function(C){return{__await:C}},P(M.prototype),c(M.prototype,a,function(){return this}),t.AsyncIterator=M,t.async=function(C,T,O,R,N){N===void 0&&(N=Promise);var j=new M(u(C,T,O,R),N);return t.isGeneratorFunction(T)?j:j.next().then(function(G){return G.done?G.value:j.next()})},P(_),c(_,l,"Generator"),c(_,s,function(){return this}),c(_,"toString",function(){return"[object Generator]"}),t.keys=function(C){var T=Object(C),O=[];for(var R in T)O.push(R);return O.reverse(),function N(){for(;O.length;){var j=O.pop();if(j in T)return N.value=j,N.done=!1,N}return N.done=!0,N}},t.values=K,V.prototype={constructor:V,reset:function(C){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(re),!C)for(var T in this)T.charAt(0)==="t"&&r.call(this,T)&&!isNaN(+T.slice(1))&&(this[T]=e)},stop:function(){this.done=!0;var C=this.tryEntries[0].completion;if(C.type==="throw")throw C.arg;return this.rval},dispatchException:function(C){if(this.done)throw C;var T=this;function O(ue,je){return j.type="throw",j.arg=C,T.next=ue,je&&(T.method="next",T.arg=e),!!je}for(var R=this.tryEntries.length-1;R>=0;--R){var N=this.tryEntries[R],j=N.completion;if(N.tryLoc==="root")return O("end");if(N.tryLoc<=this.prev){var G=r.call(N,"catchLoc"),xe=r.call(N,"finallyLoc");if(G&&xe){if(this.prev<N.catchLoc)return O(N.catchLoc,!0);if(this.prev<N.finallyLoc)return O(N.finallyLoc)}else if(G){if(this.prev<N.catchLoc)return O(N.catchLoc,!0)}else{if(!xe)throw new Error("try statement without catch or finally");if(this.prev<N.finallyLoc)return O(N.finallyLoc)}}}},abrupt:function(C,T){for(var O=this.tryEntries.length-1;O>=0;--O){var R=this.tryEntries[O];if(R.tryLoc<=this.prev&&r.call(R,"finallyLoc")&&this.prev<R.finallyLoc){var N=R;break}}N&&(C==="break"||C==="continue")&&N.tryLoc<=T&&T<=N.finallyLoc&&(N=null);var j=N?N.completion:{};return j.type=C,j.arg=T,N?(this.method="next",this.next=N.finallyLoc,y):this.complete(j)},complete:function(C,T){if(C.type==="throw")throw C.arg;return C.type==="break"||C.type==="continue"?this.next=C.arg:C.type==="return"?(this.rval=this.arg=C.arg,this.method="return",this.next="end"):C.type==="normal"&&T&&(this.next=T),y},finish:function(C){for(var T=this.tryEntries.length-1;T>=0;--T){var O=this.tryEntries[T];if(O.finallyLoc===C)return this.complete(O.completion,O.afterLoc),re(O),y}},catch:function(C){for(var T=this.tryEntries.length-1;T>=0;--T){var O=this.tryEntries[T];if(O.tryLoc===C){var R=O.completion;if(R.type==="throw"){var N=R.arg;re(O)}return N}}throw new Error("illegal catch attempt")},delegateYield:function(C,T,O){return this.delegate={iterator:K(C),resultName:T,nextLoc:O},this.method==="next"&&(this.arg=e),y}},t}function Dk(e,t,n,r,o,i,s){try{var a=e[i](s),l=a.value}catch(c){n(c);return}a.done?t(l):Promise.resolve(l).then(r,o)}function Ul(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(l){Dk(i,r,o,s,a,"next",l)}function a(l){Dk(i,r,o,s,a,"throw",l)}s(void 0)})}}var F2=function(){function e(t){nn(this,e),this.host=t}return rn(e,[{key:"getDisableUrl",value:function(n){return"".concat(this.host,"/disable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getLoginUrl",value:function(n){return"".concat(this.host,"/authorize?redirect_to=").concat(encodeURIComponent(n))}},{key:"getEnableUrl",value:function(n){return"".concat(this.host,"/enable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getPatches",value:function(){var t=Ul(vr().mark(function r(o){var i,s,a;return vr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return i=o.patchIds,s=o.headers,a=i?"?".concat(i.map(function(u){return"".concat(u,"=").concat(encodeURIComponent(u))}).join("&")):"",c.abrupt("return",fetch("".concat(this.host,"/patches/~").concat(a),{headers:s||{"Content-Type":"application/json"}}).then(function(u){return es(u)}).catch(ga));case 3:case"end":return c.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n}()},{key:"deletePatches",value:function(){var t=Ul(vr().mark(function r(o,i){var s;return vr().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return s=new URLSearchParams,o.forEach(function(c){return s.append("id",c)}),l.abrupt("return",fetch("".concat(this.host,"/patches/~?").concat(s),{method:"DELETE",headers:i||{"Content-Type":"application/json"}}).then(function(c){return es(c)}).catch(ga));case 3:case"end":return l.stop()}},r,this)}));function n(r,o){return t.apply(this,arguments)}return n}()},{key:"getEditUrl",value:function(){return"/val"}},{key:"postPatches",value:function(n,r,o){return fetch("".concat(this.host,"/patches/~"),{headers:o||{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(pe({},n,r))}).then(function(){var i=Ul(vr().mark(function s(a){return vr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",es(a));case 1:case"end":return c.stop()}},s)}));return function(s){return i.apply(this,arguments)}}()).catch(ga)}},{key:"getSession",value:function(){return fetch("".concat(this.host,"/session")).then(function(n){return es(n).catch(ga)})}},{key:"getTree",value:function(n){var r=n.patch,o=r===void 0?!1:r,i=n.includeSchema,s=i===void 0?!1:i,a=n.includeSource,l=a===void 0?!1:a,c=n.treePath,u=c===void 0?"/":c,d=n.headers,f=new URLSearchParams;return f.set("patch",o.toString()),f.set("schema",s.toString()),f.set("source",l.toString()),fetch("".concat(this.host,"/tree/~").concat(u,"?").concat(f.toString()),{headers:d}).then(function(p){return es(p)}).catch(ga)}},{key:"postCommit",value:function(n){var r=n.patches,o=n.headers;return fetch("".concat(this.host,"/commit"),{method:"POST",body:JSON.stringify({patches:r}),headers:o||{"Content-Type":"application/json"}}).then(function(){var i=Ul(vr().mark(function s(a){var l;return vr().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!a.ok){u.next=4;break}return u.abrupt("return",es(a));case 4:if(!(a.status===400&&a.headers.get("content-type")==="application/json")){u.next=13;break}return u.next=7,a.json();case 7:if(l=u.sent,!("validationErrors"in l)){u.next=12;break}return u.abrupt("return",Vt(l));case 12:return u.abrupt("return",B2(a.status,l,a.statusText));case 13:return u.abrupt("return",es(a));case 14:case"end":return u.stop()}},s)}));return function(s){return i.apply(this,arguments)}}()).catch(ga)}},{key:"postValidate",value:function(n){var r=n.patches,o=n.headers;return fetch("".concat(this.host,"/validate"),{method:"POST",body:JSON.stringify({patches:r}),headers:o||{"Content-Type":"application/json"}}).then(function(){var i=Ul(vr().mark(function s(a){return vr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",es(a));case 1:case"end":return c.stop()}},s)}));return function(s){return i.apply(this,arguments)}}()).catch(ga)}}]),e}();function ga(e){return Vt({statusCode:500,message:e instanceof Error?e.message:"Unknown error"})}function B2(e,t,n){return Vt({statusCode:e,message:t.message||n,details:t.details||Object.fromEntries(Object.entries(t).filter(function(r){var o=Kn(r,1),i=o[0];return i!=="message"}))})}function es(e){return tx.apply(this,arguments)}function tx(){return tx=Ul(vr().mark(function e(t){var n;return vr().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,!t.ok){o.next=9;break}return o.t0=St,o.next=5,t.json();case 5:return o.t1=o.sent,o.abrupt("return",o.t0.ok.call(o.t0,o.t1));case 9:return o.prev=9,o.next=12,t.json();case 12:return n=o.sent,o.abrupt("return",B2(t.status,n,t.statusText));case 16:return o.prev=16,o.t2=o.catch(9),o.abrupt("return",Vt({statusCode:t.status,message:t.statusText}));case 19:o.next=24;break;case 21:return o.prev=21,o.t3=o.catch(0),o.abrupt("return",Vt({message:o.t3 instanceof Error?o.t3.message:"Unknown error"}));case 24:case"end":return o.stop()}},e,null,[[0,21],[9,16]])})),tx.apply(this,arguments)}var ot={convertFileSource:P2,getSchema:DL,getValPath:R2,getVal:d5,getSource:GL,resolvePath:n5,splitModuleIdAndModulePath:YL,isVal:zL,createValPathOfItem:Kr,getSHA256Hash:O5,initSchema:u5,notFileOp:function(t){return t.op!=="file"},isFileOp:function(t){return t.op==="file"&&typeof t.filePath=="string"},createPatchJSONPath:function(t){return"/".concat(t.split(".").map(function(n){return n&&T5(n)}).join("/"))},createPatchPath:function(t){return L2(t)},patchPathToModulePath:function(t){return t.map(function(n){return Number.isInteger(Number(n))?n:JSON.stringify(n)}).join(".")},VAL_ENABLE_COOKIE_NAME:"val_enable",VAL_STATE_COOKIE:"val_state",VAL_SESSION_COOKIE:"val_session"};function T5(e){try{return JSON.parse(e)}catch{return e}}var U2={exports:{}};/*!
|
|
44
|
+
Copyright (c) 2018 Jed Watson.
|
|
45
|
+
Licensed under the MIT License (MIT), see
|
|
46
|
+
http://jedwatson.github.io/classnames
|
|
47
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(U2);var P5=U2.exports;const Qt=ai(P5);function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(this,arguments)}function M5(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Og(...e){return t=>e.forEach(n=>M5(n,t))}function qe(...e){return h.useCallback(Og(...e),e)}const Di=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(N5);if(i){const s=i.props.children,a=o.map(l=>l===i?h.Children.count(s)>1?h.Children.only(null):h.isValidElement(s)?s.props.children:null:l);return h.createElement(nx,B({},r,{ref:t}),h.isValidElement(s)?h.cloneElement(s,void 0,a):null)}return h.createElement(nx,B({},r,{ref:t}),n)});Di.displayName="Slot";const nx=h.forwardRef((e,t)=>{const{children:n,...r}=e;return h.isValidElement(n)?h.cloneElement(n,{...$5(r,n.props),ref:t?Og(t,n.ref):n.ref}):h.Children.count(n)>1?h.Children.only(null):null});nx.displayName="SlotClone";const R5=({children:e})=>h.createElement(h.Fragment,null,e);function N5(e){return h.isValidElement(e)&&e.type===R5}function $5(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const A5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$e=A5.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Di:t;return h.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),h.createElement(a,B({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function V2(e,t){e&&$r.flushSync(()=>e.dispatchEvent(t))}const Pr=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{};function D5(e,t){return h.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const er=e=>{const{present:t,children:n}=e,r=I5(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=qe(r.ref,o.ref);return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:i}):null};er.displayName="Presence";function I5(e){const[t,n]=h.useState(),r=h.useRef({}),o=h.useRef(e),i=h.useRef("none"),s=e?"mounted":"unmounted",[a,l]=D5(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=zp(r.current);i.current=a==="mounted"?c:"none"},[a]),Pr(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,p=zp(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Pr(()=>{if(t){const c=d=>{const p=zp(r.current).includes(d.animationName);d.target===t&&p&&$r.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=zp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function zp(e){return(e==null?void 0:e.animationName)||"none"}function to(e,t=[]){let n=[];function r(i,s){const a=h.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:f,children:p,...m}=d,g=(f==null?void 0:f[e][l])||a,y=h.useMemo(()=>m,Object.values(m));return h.createElement(g.Provider,{value:y},p)}function u(d,f){const p=(f==null?void 0:f[e][l])||a,m=h.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>h.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,L5(o,...t)]}function L5(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function pn(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const j5=h.createContext(void 0);function Zf(e){const t=h.useContext(j5);return e||t||"ltr"}function rx(e,[t,n]){return Math.min(n,Math.max(t,e))}function ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function z5(e,t){return h.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const H2="ScrollArea",[W2,Ule]=to(H2),[F5,no]=W2(H2),B5=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=h.useState(null),[c,u]=h.useState(null),[d,f]=h.useState(null),[p,m]=h.useState(null),[g,y]=h.useState(null),[v,x]=h.useState(0),[w,k]=h.useState(0),[E,S]=h.useState(!1),[_,P]=h.useState(!1),M=qe(t,I=>l(I)),A=Zf(o);return h.createElement(F5,{scope:n,type:r,dir:A,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:E,onScrollbarXEnabledChange:S,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:_,onScrollbarYEnabledChange:P,onCornerWidthChange:x,onCornerHeightChange:k},h.createElement($e.div,B({dir:A},s,{ref:M,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})))}),U5="ScrollAreaViewport",V5=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=no(U5,n),s=h.useRef(null),a=qe(t,s,i.onViewportChange);return h.createElement(h.Fragment,null,h.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),h.createElement($e.div,B({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),h.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Vi="ScrollAreaScrollbar",K2=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=no(Vi,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return h.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?h.createElement(H5,B({},r,{ref:t,forceMount:n})):o.type==="scroll"?h.createElement(W5,B({},r,{ref:t,forceMount:n})):o.type==="auto"?h.createElement(q2,B({},r,{ref:t,forceMount:n})):o.type==="always"?h.createElement(w1,B({},r,{ref:t})):null}),H5=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=no(Vi,e.__scopeScrollArea),[i,s]=h.useState(!1);return h.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),h.createElement(er,{present:n||i},h.createElement(q2,B({"data-state":i?"visible":"hidden"},r,{ref:t})))}),W5=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=no(Vi,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Pg(()=>l("SCROLL_END"),100),[a,l]=z5("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),h.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const p=c[u];d!==p&&(l("SCROLL"),s()),d=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,s]),h.createElement(er,{present:n||a!=="hidden"},h.createElement(w1,B({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:ae(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ae(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),q2=h.forwardRef((e,t)=>{const n=no(Vi,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=h.useState(!1),a=e.orientation==="horizontal",l=Pg(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return jc(n.viewport,l),jc(n.content,l),h.createElement(er,{present:r||i},h.createElement(w1,B({"data-state":i?"visible":"hidden"},o,{ref:t})))}),w1=h.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=no(Vi,e.__scopeScrollArea),i=h.useRef(null),s=h.useRef(0),[a,l]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Z2(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function d(f,p){return Q5(f,s.current,a,p)}return n==="horizontal"?h.createElement(K5,B({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,p=Ik(f,a,o.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}})):n==="vertical"?h.createElement(q5,B({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,p=Ik(f,a);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}})):null}),K5=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=no(Vi,e.__scopeScrollArea),[s,a]=h.useState(),l=h.useRef(null),c=qe(t,l,i.onScrollbarXChange);return h.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.createElement(Y2,B({"data-orientation":"horizontal"},o,{ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Tg(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),Q2(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:sm(s.paddingLeft),paddingEnd:sm(s.paddingRight)}})}}))}),q5=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=no(Vi,e.__scopeScrollArea),[s,a]=h.useState(),l=h.useRef(null),c=qe(t,l,i.onScrollbarYChange);return h.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.createElement(Y2,B({"data-orientation":"vertical"},o,{ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Tg(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),Q2(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:sm(s.paddingTop),paddingEnd:sm(s.paddingBottom)}})}}))}),[G5,G2]=W2(Vi),Y2=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,p=no(Vi,n),[m,g]=h.useState(null),y=qe(t,M=>g(M)),v=h.useRef(null),x=h.useRef(""),w=p.viewport,k=r.content-r.viewport,E=pn(u),S=pn(l),_=Pg(d,10);function P(M){if(v.current){const A=M.clientX-v.current.left,I=M.clientY-v.current.top;c({x:A,y:I})}}return h.useEffect(()=>{const M=A=>{const I=A.target;(m==null?void 0:m.contains(I))&&E(A,k)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[w,m,k,E]),h.useEffect(S,[r,S]),jc(m,_),jc(p.content,_),h.createElement(G5,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:pn(i),onThumbPointerUp:pn(s),onThumbPositionChange:S,onThumbPointerDown:pn(a)},h.createElement($e.div,B({},f,{ref:y,style:{position:"absolute",...f.style},onPointerDown:ae(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),v.current=m.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),P(M))}),onPointerMove:ae(e.onPointerMove,P),onPointerUp:ae(e.onPointerUp,M=>{const A=M.target;A.hasPointerCapture(M.pointerId)&&A.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})))}),ox="ScrollAreaThumb",Y5=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=G2(ox,e.__scopeScrollArea);return h.createElement(er,{present:n||o.hasThumb},h.createElement(X5,B({ref:t},r)))}),X5=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=no(ox,n),s=G2(ox,n),{onThumbPositionChange:a}=s,l=qe(t,d=>s.onThumbChange(d)),c=h.useRef(),u=Pg(()=>{c.current&&(c.current(),c.current=void 0)},100);return h.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const p=e4(d,a);c.current=p,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,a]),h.createElement($e.div,B({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ae(e.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),m=d.clientX-p.left,g=d.clientY-p.top;s.onThumbPointerDown({x:m,y:g})}),onPointerUp:ae(e.onPointerUp,s.onThumbPointerUp)}))}),X2="ScrollAreaCorner",Z5=h.forwardRef((e,t)=>{const n=no(X2,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.createElement(J5,B({},e,{ref:t})):null}),J5=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=no(X2,n),[i,s]=h.useState(0),[a,l]=h.useState(0),c=!!(i&&a);return jc(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),jc(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?h.createElement($e.div,B({},r,{ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function sm(e){return e?parseInt(e,10):0}function Z2(e,t){const n=e/t;return isNaN(n)?0:n}function Tg(e){const t=Z2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Q5(e,t,n,r="ltr"){const o=Tg(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return J2([l,c],d)(e)}function Ik(e,t,n="ltr"){const r=Tg(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=rx(e,l);return J2([0,s],[0,a])(c)}function J2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Q2(e,t){return e>0&&e<t}const e4=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Pg(e,t){const n=pn(e),r=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),h.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function jc(e,t){const n=pn(t);Pr(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const eP=B5,t4=V5,n4=Z5;function tP(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=tP(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function r4(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=tP(e))&&(r&&(r+=" "),r+=t);return r}const S1="-";function o4(e){const t=s4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(S1);return a[0]===""&&a.length!==1&&a.shift(),nP(a,t)||i4(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function nP(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?nP(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(S1);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const Lk=/^\[(.+)\]$/;function i4(e){if(Lk.test(e)){const t=Lk.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function s4(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return l4(Object.entries(e.classGroups),n).forEach(([i,s])=>{ix(s,r,i,t)}),r}function ix(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:jk(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(a4(o)){ix(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{ix(s,jk(t,i),n,r)})})}function jk(e,t){let n=e;return t.split(S1).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function a4(e){return e.isThemeGetter}function l4(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function c4(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const rP="!";function u4(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let g=0;g<s.length;g++){let y=s[g];if(l===0){if(y===r&&(n||s.slice(g,g+o)===t)){a.push(s.slice(c,g)),c=g+o;continue}if(y==="/"){u=g;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),f=d.startsWith(rP),p=f?d.substring(1):d,m=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}}}function d4(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function f4(e){return{cache:c4(e.cacheSize),splitModifiers:u4(e),...o4(e)}}const p4=/\s+/;function h4(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(p4).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const p=d4(a).join(":");return{isTailwindClass:!0,modifierId:l?p+rP:p,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function m4(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=oP(t))&&(r&&(r+=" "),r+=n);return r}function oP(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=oP(e[r]))&&(n&&(n+=" "),n+=t);return n}function g4(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=f4(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=h4(l,n);return o(l,u),u}return function(){return i(m4.apply(null,arguments))}}function yt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const iP=/^\[(?:([a-z-]+):)?(.+)\]$/i,v4=/^\d+\/\d+$/,y4=new Set(["px","full","screen"]),x4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,b4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,w4=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,S4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ui(e){return Na(e)||y4.has(e)||v4.test(e)}function ts(e){return su(e,"length",M4)}function Na(e){return!!e&&!Number.isNaN(Number(e))}function Fp(e){return su(e,"number",Na)}function Pu(e){return!!e&&Number.isInteger(Number(e))}function k4(e){return e.endsWith("%")&&Na(e.slice(0,-1))}function Re(e){return iP.test(e)}function ns(e){return x4.test(e)}const E4=new Set(["length","size","percentage"]);function _4(e){return su(e,E4,sP)}function C4(e){return su(e,"position",sP)}const O4=new Set(["image","url"]);function T4(e){return su(e,O4,N4)}function P4(e){return su(e,"",R4)}function Mu(){return!0}function su(e,t,n){const r=iP.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function M4(e){return b4.test(e)}function sP(){return!1}function R4(e){return w4.test(e)}function N4(e){return S4.test(e)}function $4(){const e=yt("colors"),t=yt("spacing"),n=yt("blur"),r=yt("brightness"),o=yt("borderColor"),i=yt("borderRadius"),s=yt("borderSpacing"),a=yt("borderWidth"),l=yt("contrast"),c=yt("grayscale"),u=yt("hueRotate"),d=yt("invert"),f=yt("gap"),p=yt("gradientColorStops"),m=yt("gradientColorStopPositions"),g=yt("inset"),y=yt("margin"),v=yt("opacity"),x=yt("padding"),w=yt("saturate"),k=yt("scale"),E=yt("sepia"),S=yt("skew"),_=yt("space"),P=yt("translate"),M=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Re,t],L=()=>[Re,t],re=()=>["",ui,ts],V=()=>["auto",Na,Re],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["solid","dashed","dotted","double","none"],T=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],O=()=>["start","end","center","between","around","evenly","stretch"],R=()=>["","0",Re],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Na,Fp],G=()=>[Na,Re];return{cacheSize:500,separator:":",theme:{colors:[Mu],spacing:[ui,ts],blur:["none","",ns,Re],brightness:j(),borderColor:[e],borderRadius:["none","","full",ns,Re],borderSpacing:L(),borderWidth:re(),contrast:j(),grayscale:R(),hueRotate:G(),invert:R(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[k4,ts],inset:I(),margin:I(),opacity:j(),padding:L(),saturate:j(),scale:j(),sepia:R(),skew:G(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Re]}],container:["container"],columns:[{columns:[ns]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),Re]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pu,Re]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Re]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",Pu,Re]}],"grid-cols":[{"grid-cols":[Mu]}],"col-start-end":[{col:["auto",{span:["full",Pu,Re]},Re]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[Mu]}],"row-start-end":[{row:["auto",{span:[Pu,Re]},Re]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Re]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Re,t]}],"min-w":[{"min-w":[Re,t,"min","max","fit"]}],"max-w":[{"max-w":[Re,t,"none","full","min","max","fit","prose",{screen:[ns]},ns]}],h:[{h:[Re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ns,ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fp]}],"font-family":[{font:[Mu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Re]}],"line-clamp":[{"line-clamp":["none",Na,Fp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ui,Re]}],"list-image":[{"list-image":["none",Re]}],"list-style-type":[{list:["none","disc","decimal",Re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...C(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ui,ts]}],"underline-offset":[{"underline-offset":["auto",ui,Re]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),C4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},T4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...C(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:C()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...C()]}],"outline-offset":[{"outline-offset":[ui,Re]}],"outline-w":[{outline:[ui,ts]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ui,ts]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ns,P4]}],"shadow-color":[{shadow:[Mu]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":T()}],"bg-blend":[{"bg-blend":T()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ns,Re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Re]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",Re]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",Re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Pu,Re]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Re]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ui,ts,Fp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const A4=g4($4);function Ue(...e){return A4(r4(e))}const Sc=h.forwardRef(({className:e,children:t,innerRef:n,...r},o)=>b.jsxs(eP,{ref:o,className:Ue("relative overflow-hidden",e),...r,children:[b.jsx(t4,{className:"h-full w-full rounded-[inherit]",ref:n,children:t}),b.jsx(aP,{}),b.jsx(n4,{})]}));Sc.displayName=eP.displayName;const aP=h.forwardRef(({className:e,orientation:t="vertical",...n},r)=>b.jsx(K2,{ref:r,orientation:t,className:Ue("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:b.jsx(Y5,{className:Ue("relative rounded-full bg-border",t==="vertical"&&"flex-1")})}));aP.displayName=K2.displayName;var D4={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"};const I4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Fe=(e,t)=>{const n=h.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:s,children:a,...l},c)=>h.createElement("svg",{ref:c,...D4,width:o,height:o,stroke:r,strokeWidth:s?Number(i)*24/Number(o):i,className:`lucide lucide-${I4(e)}`,...l},[...t.map(([u,d])=>h.createElement(u,d)),...(Array.isArray(a)?a:[a])||[]]));return n.displayName=`${e}`,n},L4=Fe("AlignJustify",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]]),j4=Fe("Bold",[["path",{d:"M14 12a4 4 0 0 0 0-8H6v8",key:"v2sylx"}],["path",{d:"M15 20a4 4 0 0 0 0-8H6v8Z",key:"1ef5ya"}]]),k1=Fe("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),Mg=Fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),z4=Fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),F4=Fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),B4=Fe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),U4=Fe("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]),V4=Fe("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]]),zk=Fe("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]),Fk=Fe("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]),Bk=Fe("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]),Uk=Fe("Heading4",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v4h4",key:"13sv97"}],["path",{d:"M21 10v8",key:"1kdml4"}]]),Vk=Fe("Heading5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]),Hk=Fe("Heading6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]),H4=Fe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),W4=Fe("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),K4=Fe("Languages",[["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"}]]),q4=Fe("Link",[["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"}]]),G4=Fe("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]),Y4=Fe("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]),Wk=Fe("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]),X4=Fe("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),Z4=Fe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),lP=Fe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),J4=Fe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),Q4=Fe("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),ej=Fe("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]),tj=Fe("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]),nj=Fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),rj=Fe("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),cP=Fe("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),oj=Fe("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]),ij=Fe("Sun",[["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"}]]),uP=Fe("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),sj=Fe("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11",key:"llx8ln"}]]),aj=Fe("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]),Rg=Fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Td({children:e}){const t=h.useRef(null),n=h.useRef(null),r=h.useRef(!1),o=h.useRef(0),i=h.useRef(null),s=h.useRef(0),[a,l]=h.useState(!0),c=()=>{r.current=!1,i.current=null,o.current=0,s.current=0},u=x=>{x.preventDefault();const w=i.current==="left"?t:n;if(w.current&&r.current){const k=i.current==="left"?x.screenX-o.current:o.current-x.screenX;w.current.style.width=`${Math.max(s.current+k,150)}px`}},d=x=>w=>{if(w.target){const E=x==="left"?t:x==="right"?n:null;r.current=!0,E&&E.current&&(o.current=w.screenX,i.current=x,E.current&&(s.current=E.current.offsetWidth))}},[f,p,m,g,y,v]=h.Children.toArray(e);return h.useEffect(()=>(document.addEventListener("mouseup",c),document.addEventListener("mousemove",u),()=>{document.removeEventListener("mouseup",c),document.removeEventListener("mousemove",u)}),[]),b.jsxs("div",{className:"relative flex h-screen",children:[b.jsxs("div",{ref:t,className:Qt("absolute top-0 left-0 border-r border-border md:relative z-[1] bg-gradient-to-br from-card from-50% to-background",{"w-[300px]":a,"w-0 md:w-[300px]":!a}),children:[b.jsxs(Td.Column,{children:[b.jsx(Kk,{showOnMobile:!a,onClick:()=>{l(!a)},children:f}),b.jsx(Sc,{style:{height:"calc(100vh - 50px)"},onClick:()=>{l(!1)},children:p})]}),b.jsx("div",{className:"absolute inset-y-0 right-0 cursor-col-resize w-[1px] hover:w-[3px] h-full hover:bg-border",onMouseDown:d("left")})]}),b.jsx("div",{className:Qt("w-[clamp(200px,70%,80vw)]",{"w-full":!y&&!v}),children:b.jsxs(Td.Column,{children:[b.jsxs("span",{className:"flex w-full",children:[b.jsx(Kk,{className:"md:hidden",showOnMobile:a,onClick:()=>{l(!a)},children:f}),b.jsx("span",{className:Qt({"pl-[300px] md:pl-0":a}),children:m})]}),b.jsx(Sc,{style:{height:"calc(100vh - 50px)"},children:g})]})}),(y||v)&&b.jsxs("div",{ref:n,className:"relative w-full h-screen",children:[b.jsxs(Td.Column,{children:[y,b.jsx(Sc,{style:{height:"calc(100vh - 50px)"},children:v})]}),b.jsx("div",{onMouseDown:d("right"),className:"absolute inset-y-0 left-0 cursor-col-resize w-[1px] bg-border hover:w-[3px] hover:bg-border"})]})]})}function Kk({className:e,showOnMobile:t,onClick:n,children:r}){return b.jsxs("div",{className:Qt("flex items-center px-4 md:px-4",e,{"hidden md:flex":t}),children:[b.jsx("button",{className:"md:hidden",onClick:n,children:b.jsx(Z4,{})}),b.jsx("span",{className:"flex items-center justify-between w-full",children:r})]})}Td.Column=({children:e,className:t})=>{const[n,r]=h.Children.toArray(e);return b.jsxs("div",{className:Qt("flex flex-col",t),children:[b.jsx("div",{className:"flex items-center border-b border-border",children:n}),r]})};const lj=({className:e})=>b.jsxs("svg",{width:"58",height:"34",viewBox:"0 0 58 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[b.jsx("g",{filter:"url(#filter0_d_21_1677)",children:b.jsx("path",{d:"M5 5.36426C5 5.16309 5.16309 5 5.36426 5H17.6581C17.8593 5 18.0223 5.16309 18.0223 5.36426V28.4949C18.0223 28.696 17.8593 28.8591 17.6581 28.8591H5.36426C5.16309 28.8591 5 28.696 5 28.4949V5.36426Z",fill:"hsl(var(--accent))"})}),b.jsx("g",{filter:"url(#filter1_i_21_1677)",children:b.jsx("circle",{cx:"11.4656",cy:"23.7595",r:"2.18557",fill:"currentColor"})}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M52.8588 23.839H48.7257H48.537H48.1128C47.6715 23.839 47.4508 23.5942 47.4508 23.1044V13.7293C47.4508 13.5784 47.3285 13.4561 47.1777 13.4561H45.8118C45.6609 13.4561 45.5386 13.5784 45.5386 13.7293V15.1836C45.5386 15.2844 45.4569 15.3661 45.3561 15.3661C45.2876 15.3661 45.225 15.3275 45.1924 15.2672C44.805 14.5503 44.283 14.02 43.6264 13.6765C42.9563 13.301 42.2045 13.1132 41.3709 13.1132C40.6028 13.1132 39.8755 13.252 39.189 13.5295C38.5026 13.8071 37.8979 14.2152 37.3748 14.7539C36.8682 15.2764 36.4678 15.9212 36.1736 16.6885C35.8794 17.4558 35.7323 18.3374 35.7323 19.3332V19.725C35.7323 20.7372 35.8794 21.627 36.1736 22.3942C36.4678 23.1615 36.8682 23.8146 37.3748 24.3533C37.8979 24.8757 38.5026 25.2757 39.189 25.5532C39.8755 25.8144 40.6191 25.945 41.42 25.945C42.1881 25.945 42.9154 25.7491 43.6019 25.3573C44.2751 24.982 44.8058 24.4119 45.1941 23.6471C45.2255 23.5852 45.2886 23.5452 45.358 23.5452H45.3917C45.4728 23.5452 45.5386 23.611 45.5386 23.6921C45.5386 23.7904 45.544 23.8856 45.5547 23.9777V25.1392C45.5547 25.3904 45.7584 25.5941 46.0096 25.5941H47.2261C47.2914 25.5995 47.3581 25.6022 47.4263 25.6022H48.537H48.7257H57.7268C57.8777 25.6022 58 25.4799 58 25.329V24.1122C58 23.9614 57.8777 23.839 57.7268 23.839H55.3174C55.1665 23.839 55.0442 23.7167 55.0442 23.5659V8.73368C55.0442 8.58279 54.9219 8.46048 54.771 8.46048H50.5054C50.3545 8.46048 50.2322 8.58279 50.2322 8.73368V9.95043C50.2322 10.1013 50.3545 10.2236 50.5054 10.2236H52.8588C53.0097 10.2236 53.132 10.3459 53.132 10.4968V23.5659C53.132 23.7167 53.0097 23.839 52.8588 23.839ZM41.6161 24.1329C42.1881 24.1329 42.7111 24.0268 43.1851 23.8146C43.6754 23.6023 44.0922 23.3003 44.4354 22.9085C44.7786 22.5167 45.0483 22.0514 45.2444 21.5127C45.4406 20.9576 45.5386 20.3454 45.5386 19.6761V19.3822C45.5386 18.7292 45.4406 18.1333 45.2444 17.5946C45.0483 17.0395 44.7705 16.5661 44.4109 16.1743C44.0677 15.7824 43.6509 15.4804 43.1606 15.2682C42.6866 15.0396 42.1718 14.9254 41.6161 14.9254C41.044 14.9254 40.521 15.0315 40.0471 15.2437C39.5731 15.4559 39.1563 15.758 38.7968 16.1498C38.4535 16.5252 38.1839 16.9905 37.9877 17.5456C37.7916 18.0843 37.6936 18.6802 37.6936 19.3332V19.725C37.6936 21.1127 38.0531 22.1983 38.7722 22.982C39.5077 23.7493 40.4557 24.1329 41.6161 24.1329ZM31.1115 25.4191C31.0732 25.5287 30.9698 25.6022 30.8536 25.6022H27.4661C27.35 25.6022 27.2465 25.5287 27.2082 25.4191L23.1578 13.8193C23.0958 13.6417 23.2276 13.4561 23.4157 13.4561H25.089C25.2068 13.4561 25.3114 13.5316 25.3484 13.6435L28.9666 24.581C28.9942 24.6643 29.0721 24.7206 29.1599 24.7206C29.2477 24.7206 29.3256 24.6643 29.3532 24.581L32.9714 13.6435C33.0084 13.5316 33.1129 13.4561 33.2308 13.4561H34.9041C35.0922 13.4561 35.224 13.6417 35.162 13.8193L31.1115 25.4191Z",fill:"currentColor"}),b.jsxs("defs",{children:[b.jsxs("filter",{id:"filter0_d_21_1677",x:"0.124722",y:"0.124722",width:"22.7729",height:"33.6097",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[b.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),b.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b.jsx("feOffset",{}),b.jsx("feGaussianBlur",{stdDeviation:"2.43764"}),b.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),b.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),b.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_21_1677"}),b.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_21_1677",result:"shape"})]}),b.jsxs("filter",{id:"filter1_i_21_1677",x:"9.28003",y:"21.5739",width:"4.37112",height:"4.37112",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[b.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),b.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),b.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b.jsx("feOffset",{}),b.jsx("feGaussianBlur",{stdDeviation:"0.546392"}),b.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),b.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),b.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_21_1677"})]})]})]}),dP=lj,E1=te.createContext({get session(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get theme(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setTheme(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get editMode(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setEditMode(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setWindowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get windowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")}});function Ng(){return te.useContext(E1)}/**
|
|
48
|
+
* @remix-run/router v1.14.2
|
|
49
|
+
*
|
|
50
|
+
* Copyright (c) Remix Software Inc.
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the MIT license found in the
|
|
53
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
54
|
+
*
|
|
55
|
+
* @license MIT
|
|
56
|
+
*/function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},At.apply(this,arguments)}var zt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(zt||(zt={}));const qk="popstate";function cj(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:s,hash:a}=r.location;return ef("",{pathname:i,search:s,hash:a},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Jf(o)}return dj(t,n,null,e)}function He(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Qa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function uj(){return Math.random().toString(36).substr(2,8)}function Gk(e,t){return{usr:e.state,key:e.key,idx:t}}function ef(e,t,n,r){return n===void 0&&(n=null),At({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Hi(t):t,{state:n,key:t&&t.key||r||uj()})}function Jf(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Hi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function dj(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=zt.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(At({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=zt.Pop;let y=u(),v=y==null?null:y-c;c=y,l&&l({action:a,location:g.location,delta:v})}function f(y,v){a=zt.Push;let x=ef(g.location,y,v);n&&n(x,y),c=u()+1;let w=Gk(x,c),k=g.createHref(x);try{s.pushState(w,"",k)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;o.location.assign(k)}i&&l&&l({action:a,location:g.location,delta:1})}function p(y,v){a=zt.Replace;let x=ef(g.location,y,v);n&&n(x,y),c=u();let w=Gk(x,c),k=g.createHref(x);s.replaceState(w,"",k),i&&l&&l({action:a,location:g.location,delta:0})}function m(y){let v=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof y=="string"?y:Jf(y);return He(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let g={get action(){return a},get location(){return e(o,s)},listen(y){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(qk,d),l=y,()=>{o.removeEventListener(qk,d),l=null}},createHref(y){return t(o,y)},createURL:m,encodeLocation(y){let v=m(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:p,go(y){return s.go(y)}};return g}var Nt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Nt||(Nt={}));const fj=new Set(["lazy","caseSensitive","path","id","index","children"]);function pj(e){return e.index===!0}function sx(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let s=[...n,i],a=typeof o.id=="string"?o.id:s.join("-");if(He(o.index!==!0||!o.children,"Cannot specify children on an index route"),He(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),pj(o)){let l=At({},o,t(o),{id:a});return r[a]=l,l}else{let l=At({},o,t(o),{id:a,children:void 0});return r[a]=l,o.children&&(l.children=sx(o.children,t,s,r)),l}})}function fc(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Hi(t):t,o=Qf(r.pathname||"/",n);if(o==null)return null;let i=fP(e);mj(i);let s=null;for(let a=0;s==null&&a<i.length;++a)s=Ej(i[a],Oj(o));return s}function hj(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function fP(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,s,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(He(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Bs([r,l.relativePath]),u=n.concat(l);i.children&&i.children.length>0&&(He(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),fP(i.children,t,u,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:Sj(c,i.index),routesMeta:u})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of pP(i.path))o(i,s,l)}),t}function pP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=pP(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function mj(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:kj(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const gj=/^:[\w-]+$/,vj=3,yj=2,xj=1,bj=10,wj=-2,Yk=e=>e==="*";function Sj(e,t){let n=e.split("/"),r=n.length;return n.some(Yk)&&(r+=wj),t&&(r+=yj),n.filter(o=>!Yk(o)).reduce((o,i)=>o+(gj.test(i)?vj:i===""?xj:bj),r)}function kj(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Ej(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let s=0;s<n.length;++s){let a=n[s],l=s===n.length-1,c=o==="/"?t:t.slice(o.length)||"/",u=_j({path:a.relativePath,caseSensitive:a.caseSensitive,end:l},c);if(!u)return null;Object.assign(r,u.params);let d=a.route;i.push({params:r,pathname:Bs([o,u.pathname]),pathnameBase:Rj(Bs([o,u.pathnameBase])),route:d}),u.pathnameBase!=="/"&&(o=Bs([o,u.pathnameBase]))}return i}function _j(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Cj(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:r.reduce((c,u,d)=>{let{paramName:f,isOptional:p}=u;if(f==="*"){let g=a[d]||"";s=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=a[d];return p&&!m?c[f]=void 0:c[f]=Tj(m||"",f),c},{}),pathname:i,pathnameBase:s,pattern:e}}function Cj(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Qa(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Oj(e){try{return decodeURI(e)}catch(t){return Qa(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Tj(e,t){try{return decodeURIComponent(e)}catch(n){return Qa(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function Qf(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 Pj(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Hi(e):e;return{pathname:n?n.startsWith("/")?n:Mj(n,t):t,search:Nj(r),hash:$j(o)}}function Mj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function hy(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 hP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function mP(e,t){let n=hP(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function gP(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Hi(e):(o=At({},e),He(!o.pathname||!o.pathname.includes("?"),hy("?","pathname","search",o)),He(!o.pathname||!o.pathname.includes("#"),hy("#","pathname","hash",o)),He(!o.search||!o.search.includes("#"),hy("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,a;if(s==null)a=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;o.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=Pj(o,a),c=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Bs=e=>e.join("/").replace(/\/\/+/g,"/"),Rj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Nj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$j=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class _1{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function vP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const yP=["post","put","patch","delete"],Aj=new Set(yP),Dj=["get",...yP],Ij=new Set(Dj),Lj=new Set([301,302,303,307,308]),jj=new Set([307,308]),my={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zj={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ru={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},xP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fj=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),bP="remix-router-transitions";function Bj(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;He(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let $=e.detectErrorBoundary;o=D=>({hasErrorBoundary:$(D)})}else o=Fj;let i={},s=sx(e.routes,o,void 0,i),a,l=e.basename||"/",c=At({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),u=null,d=new Set,f=null,p=null,m=null,g=e.hydrationData!=null,y=fc(s,e.history.location,l),v=null;if(y==null){let $=Fr(404,{pathname:e.history.location.pathname}),{matches:D,route:z}=rE(s);y=D,v={[z.id]:$}}let x,w=y.some($=>$.route.lazy),k=y.some($=>$.route.loader);if(w)x=!1;else if(!k)x=!0;else if(c.v7_partialHydration){let $=e.hydrationData?e.hydrationData.loaderData:null,D=e.hydrationData?e.hydrationData.errors:null;x=y.every(z=>z.route.loader&&z.route.loader.hydrate!==!0&&($&&$[z.route.id]!==void 0||D&&D[z.route.id]!==void 0))}else x=e.hydrationData!=null;let E,S={historyAction:e.history.action,location:e.history.location,matches:y,initialized:x,navigation:my,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||v,fetchers:new Map,blockers:new Map},_=zt.Pop,P=!1,M,A=!1,I=new Map,L=null,re=!1,V=!1,K=[],C=[],T=new Map,O=0,R=-1,N=new Map,j=new Set,G=new Map,xe=new Map,ue=new Set,je=new Map,Ce=new Map,J=!1;function tt(){if(u=e.history.listen($=>{let{action:D,location:z,delta:Q}=$;if(J){J=!1;return}Qa(Ce.size===0||Q!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ce=mS({currentLocation:S.location,nextLocation:z,historyAction:D});if(ce&&Q!=null){J=!0,e.history.go(Q*-1),vp(ce,{state:"blocked",location:z,proceed(){vp(ce,{state:"proceeding",proceed:void 0,reset:void 0,location:z}),e.history.go(Q)},reset(){let ze=new Map(S.blockers);ze.set(ce,Ru),Pe({blockers:ze})}});return}return xn(D,z)}),n){Jj(t,I);let $=()=>Qj(t,I);t.addEventListener("pagehide",$),L=()=>t.removeEventListener("pagehide",$)}return S.initialized||xn(zt.Pop,S.location,{initialHydration:!0}),E}function nt(){u&&u(),L&&L(),d.clear(),M&&M.abort(),S.fetchers.forEach(($,D)=>gp(D)),S.blockers.forEach(($,D)=>hS(D))}function rt($){return d.add($),()=>d.delete($)}function Pe($,D){D===void 0&&(D={}),S=At({},S,$);let z=[],Q=[];c.v7_fetcherPersist&&S.fetchers.forEach((ce,ze)=>{ce.state==="idle"&&(ue.has(ze)?Q.push(ze):z.push(ze))}),[...d].forEach(ce=>ce(S,{deletedFetchers:Q,unstable_viewTransitionOpts:D.viewTransitionOpts,unstable_flushSync:D.flushSync===!0})),c.v7_fetcherPersist&&(z.forEach(ce=>S.fetchers.delete(ce)),Q.forEach(ce=>gp(ce)))}function Ge($,D,z){var Q,ce;let{flushSync:ze}=z===void 0?{}:z,Ee=S.actionData!=null&&S.navigation.formMethod!=null&&go(S.navigation.formMethod)&&S.navigation.state==="loading"&&((Q=$.state)==null?void 0:Q._isRedirect)!==!0,ke;D.actionData?Object.keys(D.actionData).length>0?ke=D.actionData:ke=null:Ee?ke=S.actionData:ke=null;let ge=D.loaderData?nE(S.loaderData,D.loaderData,D.matches||[],D.errors):S.loaderData,Ke=S.blockers;Ke.size>0&&(Ke=new Map(Ke),Ke.forEach((ht,bn)=>Ke.set(bn,Ru)));let on=P===!0||S.navigation.formMethod!=null&&go(S.navigation.formMethod)&&((ce=$.state)==null?void 0:ce._isRedirect)!==!0;a&&(s=a,a=void 0),re||_===zt.Pop||(_===zt.Push?e.history.push($,$.state):_===zt.Replace&&e.history.replace($,$.state));let Ae;if(_===zt.Pop){let ht=I.get(S.location.pathname);ht&&ht.has($.pathname)?Ae={currentLocation:S.location,nextLocation:$}:I.has($.pathname)&&(Ae={currentLocation:$,nextLocation:S.location})}else if(A){let ht=I.get(S.location.pathname);ht?ht.add($.pathname):(ht=new Set([$.pathname]),I.set(S.location.pathname,ht)),Ae={currentLocation:S.location,nextLocation:$}}Pe(At({},D,{actionData:ke,loaderData:ge,historyAction:_,location:$,initialized:!0,navigation:my,revalidation:"idle",restoreScrollPosition:vS($,D.matches||S.matches),preventScrollReset:on,blockers:Ke}),{viewTransitionOpts:Ae,flushSync:ze===!0}),_=zt.Pop,P=!1,A=!1,re=!1,V=!1,K=[],C=[]}async function Tn($,D){if(typeof $=="number"){e.history.go($);return}let z=ax(S.location,S.matches,l,c.v7_prependBasename,$,c.v7_relativeSplatPath,D==null?void 0:D.fromRouteId,D==null?void 0:D.relative),{path:Q,submission:ce,error:ze}=Xk(c.v7_normalizeFormMethod,!1,z,D),Ee=S.location,ke=ef(S.location,Q,D&&D.state);ke=At({},ke,e.history.encodeLocation(ke));let ge=D&&D.replace!=null?D.replace:void 0,Ke=zt.Push;ge===!0?Ke=zt.Replace:ge===!1||ce!=null&&go(ce.formMethod)&&ce.formAction===S.location.pathname+S.location.search&&(Ke=zt.Replace);let on=D&&"preventScrollReset"in D?D.preventScrollReset===!0:void 0,Ae=(D&&D.unstable_flushSync)===!0,ht=mS({currentLocation:Ee,nextLocation:ke,historyAction:Ke});if(ht){vp(ht,{state:"blocked",location:ke,proceed(){vp(ht,{state:"proceeding",proceed:void 0,reset:void 0,location:ke}),Tn($,D)},reset(){let bn=new Map(S.blockers);bn.set(ht,Ru),Pe({blockers:bn})}});return}return await xn(Ke,ke,{submission:ce,pendingError:ze,preventScrollReset:on,replace:D&&D.replace,enableViewTransition:D&&D.unstable_viewTransition,flushSync:Ae})}function zn(){if(Dv(),Pe({revalidation:"loading"}),S.navigation.state!=="submitting"){if(S.navigation.state==="idle"){xn(S.historyAction,S.location,{startUninterruptedRevalidation:!0});return}xn(_||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation})}}async function xn($,D,z){M&&M.abort(),M=null,_=$,re=(z&&z.startUninterruptedRevalidation)===!0,HD(S.location,S.matches),P=(z&&z.preventScrollReset)===!0,A=(z&&z.enableViewTransition)===!0;let Q=a||s,ce=z&&z.overrideNavigation,ze=fc(Q,D,l),Ee=(z&&z.flushSync)===!0;if(!ze){let bn=Fr(404,{pathname:D.pathname}),{matches:zr,route:sn}=rE(Q);Iv(),Ge(D,{matches:zr,loaderData:{},errors:{[sn.id]:bn}},{flushSync:Ee});return}if(S.initialized&&!V&&Kj(S.location,D)&&!(z&&z.submission&&go(z.submission.formMethod))){Ge(D,{matches:ze},{flushSync:Ee});return}M=new AbortController;let ke=$u(e.history,D,M.signal,z&&z.submission),ge,Ke;if(z&&z.pendingError)Ke={[Pd(ze).route.id]:z.pendingError};else if(z&&z.submission&&go(z.submission.formMethod)){let bn=await Gi(ke,D,z.submission,ze,{replace:z.replace,flushSync:Ee});if(bn.shortCircuited)return;ge=bn.pendingActionData,Ke=bn.pendingActionError,ce=gy(D,z.submission),Ee=!1,ke=new Request(ke.url,{signal:ke.signal})}let{shortCircuited:on,loaderData:Ae,errors:ht}=await pa(ke,D,ze,ce,z&&z.submission,z&&z.fetcherSubmission,z&&z.replace,z&&z.initialHydration===!0,Ee,ge,Ke);on||(M=null,Ge(D,At({matches:ze},ge?{actionData:ge}:{},{loaderData:Ae,errors:ht})))}async function Gi($,D,z,Q,ce){ce===void 0&&(ce={}),Dv();let ze=Xj(D,z);Pe({navigation:ze},{flushSync:ce.flushSync===!0});let Ee,ke=cx(Q,D);if(!ke.route.action&&!ke.route.lazy)Ee={type:Nt.error,error:Fr(405,{method:$.method,pathname:D.pathname,routeId:ke.route.id})};else if(Ee=await Nu("action",$,ke,Q,i,o,l,c.v7_relativeSplatPath),$.signal.aborted)return{shortCircuited:!0};if(Aa(Ee)){let ge;return ce&&ce.replace!=null?ge=ce.replace:ge=Ee.location===S.location.pathname+S.location.search,await jo(S,Ee,{submission:z,replace:ge}),{shortCircuited:!0}}if(pc(Ee)){let ge=Pd(Q,ke.route.id);return(ce&&ce.replace)!==!0&&(_=zt.Push),{pendingActionData:{},pendingActionError:{[ge.route.id]:Ee.error}}}if($a(Ee))throw Fr(400,{type:"defer-action"});return{pendingActionData:{[ke.route.id]:Ee.data}}}async function pa($,D,z,Q,ce,ze,Ee,ke,ge,Ke,on){let Ae=Q||gy(D,ce),ht=ce||ze||sE(Ae),bn=a||s,[zr,sn]=Zk(e.history,S,z,ht,D,c.v7_partialHydration&&ke===!0,V,K,C,ue,G,j,bn,l,Ke,on);if(Iv(ft=>!(z&&z.some(wt=>wt.route.id===ft))||zr&&zr.some(wt=>wt.route.id===ft)),R=++O,zr.length===0&&sn.length===0){let ft=fS();return Ge(D,At({matches:z,loaderData:{},errors:on||null},Ke?{actionData:Ke}:{},ft?{fetchers:new Map(S.fetchers)}:{}),{flushSync:ge}),{shortCircuited:!0}}if(!re&&(!c.v7_partialHydration||!ke)){sn.forEach(wt=>{let zo=S.fetchers.get(wt.key),xp=Au(void 0,zo?zo.data:void 0);S.fetchers.set(wt.key,xp)});let ft=Ke||S.actionData;Pe(At({navigation:Ae},ft?Object.keys(ft).length===0?{actionData:null}:{actionData:ft}:{},sn.length>0?{fetchers:new Map(S.fetchers)}:{}),{flushSync:ge})}sn.forEach(ft=>{T.has(ft.key)&&Xi(ft.key),ft.controller&&T.set(ft.key,ft.controller)});let Tl=()=>sn.forEach(ft=>Xi(ft.key));M&&M.signal.addEventListener("abort",Tl);let{results:Lv,loaderResults:Pl,fetcherResults:Zi}=await cS(S.matches,z,zr,sn,$);if($.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener("abort",Tl),sn.forEach(ft=>T.delete(ft.key));let ha=oE(Lv);if(ha){if(ha.idx>=zr.length){let ft=sn[ha.idx-zr.length].key;j.add(ft)}return await jo(S,ha.result,{replace:Ee}),{shortCircuited:!0}}let{loaderData:jv,errors:zv}=tE(S,z,zr,Pl,on,sn,Zi,je);je.forEach((ft,wt)=>{ft.subscribe(zo=>{(zo||ft.done)&&je.delete(wt)})});let Fv=fS(),Ml=pS(R),yp=Fv||Ml||sn.length>0;return At({loaderData:jv,errors:zv},yp?{fetchers:new Map(S.fetchers)}:{})}function Nv($,D,z,Q){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");T.has($)&&Xi($);let ce=(Q&&Q.unstable_flushSync)===!0,ze=a||s,Ee=ax(S.location,S.matches,l,c.v7_prependBasename,z,c.v7_relativeSplatPath,D,Q==null?void 0:Q.relative),ke=fc(ze,Ee,l);if(!ke){xu($,D,Fr(404,{pathname:Ee}),{flushSync:ce});return}let{path:ge,submission:Ke,error:on}=Xk(c.v7_normalizeFormMethod,!0,Ee,Q);if(on){xu($,D,on,{flushSync:ce});return}let Ae=cx(ke,ge);if(P=(Q&&Q.preventScrollReset)===!0,Ke&&go(Ke.formMethod)){$v($,D,ge,Ae,ke,ce,Ke);return}G.set($,{routeId:D,path:ge}),Av($,D,ge,Ae,ke,ce,Ke)}async function $v($,D,z,Q,ce,ze,Ee){if(Dv(),G.delete($),!Q.route.action&&!Q.route.lazy){let wt=Fr(405,{method:Ee.formMethod,pathname:z,routeId:D});xu($,D,wt,{flushSync:ze});return}let ke=S.fetchers.get($);Yi($,Zj(Ee,ke),{flushSync:ze});let ge=new AbortController,Ke=$u(e.history,z,ge.signal,Ee);T.set($,ge);let on=O,Ae=await Nu("action",Ke,Q,ce,i,o,l,c.v7_relativeSplatPath);if(Ke.signal.aborted){T.get($)===ge&&T.delete($);return}if(c.v7_fetcherPersist&&ue.has($)){if(Aa(Ae)||pc(Ae)){Yi($,cs(void 0));return}}else{if(Aa(Ae))if(T.delete($),R>on){Yi($,cs(void 0));return}else return j.add($),Yi($,Au(Ee)),jo(S,Ae,{fetcherSubmission:Ee});if(pc(Ae)){xu($,D,Ae.error);return}}if($a(Ae))throw Fr(400,{type:"defer-action"});let ht=S.navigation.location||S.location,bn=$u(e.history,ht,ge.signal),zr=a||s,sn=S.navigation.state!=="idle"?fc(zr,S.navigation.location,l):S.matches;He(sn,"Didn't find any matches after fetcher action");let Tl=++O;N.set($,Tl);let Lv=Au(Ee,Ae.data);S.fetchers.set($,Lv);let[Pl,Zi]=Zk(e.history,S,sn,Ee,ht,!1,V,K,C,ue,G,j,zr,l,{[Q.route.id]:Ae.data},void 0);Zi.filter(wt=>wt.key!==$).forEach(wt=>{let zo=wt.key,xp=S.fetchers.get(zo),KD=Au(void 0,xp?xp.data:void 0);S.fetchers.set(zo,KD),T.has(zo)&&Xi(zo),wt.controller&&T.set(zo,wt.controller)}),Pe({fetchers:new Map(S.fetchers)});let ha=()=>Zi.forEach(wt=>Xi(wt.key));ge.signal.addEventListener("abort",ha);let{results:jv,loaderResults:zv,fetcherResults:Fv}=await cS(S.matches,sn,Pl,Zi,bn);if(ge.signal.aborted)return;ge.signal.removeEventListener("abort",ha),N.delete($),T.delete($),Zi.forEach(wt=>T.delete(wt.key));let Ml=oE(jv);if(Ml){if(Ml.idx>=Pl.length){let wt=Zi[Ml.idx-Pl.length].key;j.add(wt)}return jo(S,Ml.result)}let{loaderData:yp,errors:ft}=tE(S,S.matches,Pl,zv,void 0,Zi,Fv,je);if(S.fetchers.has($)){let wt=cs(Ae.data);S.fetchers.set($,wt)}pS(Tl),S.navigation.state==="loading"&&Tl>R?(He(_,"Expected pending action"),M&&M.abort(),Ge(S.navigation.location,{matches:sn,loaderData:yp,errors:ft,fetchers:new Map(S.fetchers)})):(Pe({errors:ft,loaderData:nE(S.loaderData,yp,sn,ft),fetchers:new Map(S.fetchers)}),V=!1)}async function Av($,D,z,Q,ce,ze,Ee){let ke=S.fetchers.get($);Yi($,Au(Ee,ke?ke.data:void 0),{flushSync:ze});let ge=new AbortController,Ke=$u(e.history,z,ge.signal);T.set($,ge);let on=O,Ae=await Nu("loader",Ke,Q,ce,i,o,l,c.v7_relativeSplatPath);if($a(Ae)&&(Ae=await kP(Ae,Ke.signal,!0)||Ae),T.get($)===ge&&T.delete($),!Ke.signal.aborted){if(ue.has($)){Yi($,cs(void 0));return}if(Aa(Ae))if(R>on){Yi($,cs(void 0));return}else{j.add($),await jo(S,Ae);return}if(pc(Ae)){xu($,D,Ae.error);return}He(!$a(Ae),"Unhandled fetcher deferred data"),Yi($,cs(Ae.data))}}async function jo($,D,z){let{submission:Q,fetcherSubmission:ce,replace:ze}=z===void 0?{}:z;D.revalidate&&(V=!0);let Ee=ef($.location,D.location,{_isRedirect:!0});if(He(Ee,"Expected a location on the redirect navigation"),n){let ht=!1;if(D.reloadDocument)ht=!0;else if(xP.test(D.location)){const bn=e.history.createURL(D.location);ht=bn.origin!==t.location.origin||Qf(bn.pathname,l)==null}if(ht){ze?t.location.replace(D.location):t.location.assign(D.location);return}}M=null;let ke=ze===!0?zt.Replace:zt.Push,{formMethod:ge,formAction:Ke,formEncType:on}=$.navigation;!Q&&!ce&&ge&&Ke&&on&&(Q=sE($.navigation));let Ae=Q||ce;if(jj.has(D.status)&&Ae&&go(Ae.formMethod))await xn(ke,Ee,{submission:At({},Ae,{formAction:D.location}),preventScrollReset:P});else{let ht=gy(Ee,Q);await xn(ke,Ee,{overrideNavigation:ht,fetcherSubmission:ce,preventScrollReset:P})}}async function cS($,D,z,Q,ce){let ze=await Promise.all([...z.map(ge=>Nu("loader",ce,ge,D,i,o,l,c.v7_relativeSplatPath)),...Q.map(ge=>ge.matches&&ge.match&&ge.controller?Nu("loader",$u(e.history,ge.path,ge.controller.signal),ge.match,ge.matches,i,o,l,c.v7_relativeSplatPath):{type:Nt.error,error:Fr(404,{pathname:ge.path})})]),Ee=ze.slice(0,z.length),ke=ze.slice(z.length);return await Promise.all([iE($,z,Ee,Ee.map(()=>ce.signal),!1,S.loaderData),iE($,Q.map(ge=>ge.match),ke,Q.map(ge=>ge.controller?ge.controller.signal:null),!0)]),{results:ze,loaderResults:Ee,fetcherResults:ke}}function Dv(){V=!0,K.push(...Iv()),G.forEach(($,D)=>{T.has(D)&&(C.push(D),Xi(D))})}function Yi($,D,z){z===void 0&&(z={}),S.fetchers.set($,D),Pe({fetchers:new Map(S.fetchers)},{flushSync:(z&&z.flushSync)===!0})}function xu($,D,z,Q){Q===void 0&&(Q={});let ce=Pd(S.matches,D);gp($),Pe({errors:{[ce.route.id]:z},fetchers:new Map(S.fetchers)},{flushSync:(Q&&Q.flushSync)===!0})}function uS($){return c.v7_fetcherPersist&&(xe.set($,(xe.get($)||0)+1),ue.has($)&&ue.delete($)),S.fetchers.get($)||zj}function gp($){let D=S.fetchers.get($);T.has($)&&!(D&&D.state==="loading"&&N.has($))&&Xi($),G.delete($),N.delete($),j.delete($),ue.delete($),S.fetchers.delete($)}function BD($){if(c.v7_fetcherPersist){let D=(xe.get($)||0)-1;D<=0?(xe.delete($),ue.add($)):xe.set($,D)}else gp($);Pe({fetchers:new Map(S.fetchers)})}function Xi($){let D=T.get($);He(D,"Expected fetch controller: "+$),D.abort(),T.delete($)}function dS($){for(let D of $){let z=uS(D),Q=cs(z.data);S.fetchers.set(D,Q)}}function fS(){let $=[],D=!1;for(let z of j){let Q=S.fetchers.get(z);He(Q,"Expected fetcher: "+z),Q.state==="loading"&&(j.delete(z),$.push(z),D=!0)}return dS($),D}function pS($){let D=[];for(let[z,Q]of N)if(Q<$){let ce=S.fetchers.get(z);He(ce,"Expected fetcher: "+z),ce.state==="loading"&&(Xi(z),N.delete(z),D.push(z))}return dS(D),D.length>0}function UD($,D){let z=S.blockers.get($)||Ru;return Ce.get($)!==D&&Ce.set($,D),z}function hS($){S.blockers.delete($),Ce.delete($)}function vp($,D){let z=S.blockers.get($)||Ru;He(z.state==="unblocked"&&D.state==="blocked"||z.state==="blocked"&&D.state==="blocked"||z.state==="blocked"&&D.state==="proceeding"||z.state==="blocked"&&D.state==="unblocked"||z.state==="proceeding"&&D.state==="unblocked","Invalid blocker state transition: "+z.state+" -> "+D.state);let Q=new Map(S.blockers);Q.set($,D),Pe({blockers:Q})}function mS($){let{currentLocation:D,nextLocation:z,historyAction:Q}=$;if(Ce.size===0)return;Ce.size>1&&Qa(!1,"A router only supports one blocker at a time");let ce=Array.from(Ce.entries()),[ze,Ee]=ce[ce.length-1],ke=S.blockers.get(ze);if(!(ke&&ke.state==="proceeding")&&Ee({currentLocation:D,nextLocation:z,historyAction:Q}))return ze}function Iv($){let D=[];return je.forEach((z,Q)=>{(!$||$(Q))&&(z.cancel(),D.push(Q),je.delete(Q))}),D}function VD($,D,z){if(f=$,m=D,p=z||null,!g&&S.navigation===my){g=!0;let Q=vS(S.location,S.matches);Q!=null&&Pe({restoreScrollPosition:Q})}return()=>{f=null,m=null,p=null}}function gS($,D){return p&&p($,D.map(Q=>hj(Q,S.loaderData)))||$.key}function HD($,D){if(f&&m){let z=gS($,D);f[z]=m()}}function vS($,D){if(f){let z=gS($,D),Q=f[z];if(typeof Q=="number")return Q}return null}function WD($){i={},a=sx($,o,void 0,i)}return E={get basename(){return l},get future(){return c},get state(){return S},get routes(){return s},get window(){return t},initialize:tt,subscribe:rt,enableScrollRestoration:VD,navigate:Tn,fetch:Nv,revalidate:zn,createHref:$=>e.history.createHref($),encodeLocation:$=>e.history.encodeLocation($),getFetcher:uS,deleteFetcher:BD,dispose:nt,getBlocker:UD,deleteBlocker:hS,_internalFetchControllers:T,_internalActiveDeferreds:je,_internalSetRoutes:WD},E}function Uj(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ax(e,t,n,r,o,i,s,a){let l,c;if(s){l=[];for(let d of t)if(l.push(d),d.route.id===s){c=d;break}}else l=t,c=t[t.length-1];let u=gP(o||".",mP(l,i),Qf(e.pathname,n)||e.pathname,a==="path");return o==null&&(u.search=e.search,u.hash=e.hash),(o==null||o===""||o===".")&&c&&c.route.index&&!C1(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Bs([n,u.pathname])),Jf(u)}function Xk(e,t,n,r){if(!r||!Uj(r))return{path:n};if(r.formMethod&&!Yj(r.formMethod))return{path:n,error:Fr(405,{method:r.formMethod})};let o=()=>({path:n,error:Fr(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),a=SP(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!go(s))return o();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,m)=>{let[g,y]=m;return""+p+g+"="+y+`
|
|
57
|
+
`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!go(s))return o();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return o()}}}He(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=lx(r.formData),c=r.formData;else if(r.body instanceof FormData)l=lx(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=eE(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=eE(l)}catch{return o()}let u={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(go(u.formMethod))return{path:n,submission:u};let d=Hi(n);return t&&d.search&&C1(d.search)&&l.append("index",""),d.search="?"+l,{path:Jf(d),submission:u}}function Vj(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Zk(e,t,n,r,o,i,s,a,l,c,u,d,f,p,m,g){let y=g?Object.values(g)[0]:m?Object.values(m)[0]:void 0,v=e.createURL(t.location),x=e.createURL(o),w=g?Object.keys(g)[0]:void 0,E=Vj(n,w).filter((_,P)=>{let{route:M}=_;if(M.lazy)return!0;if(M.loader==null)return!1;if(i)return M.loader.hydrate?!0:t.loaderData[M.id]===void 0&&(!t.errors||t.errors[M.id]===void 0);if(Hj(t.loaderData,t.matches[P],_)||a.some(L=>L===_.route.id))return!0;let A=t.matches[P],I=_;return Jk(_,At({currentUrl:v,currentParams:A.params,nextUrl:x,nextParams:I.params},r,{actionResult:y,defaultShouldRevalidate:s||v.pathname+v.search===x.pathname+x.search||v.search!==x.search||wP(A,I)}))}),S=[];return u.forEach((_,P)=>{if(i||!n.some(re=>re.route.id===_.routeId)||c.has(P))return;let M=fc(f,_.path,p);if(!M){S.push({key:P,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let A=t.fetchers.get(P),I=cx(M,_.path),L=!1;d.has(P)?L=!1:l.includes(P)?L=!0:A&&A.state!=="idle"&&A.data===void 0?L=s:L=Jk(I,At({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:y,defaultShouldRevalidate:s})),L&&S.push({key:P,routeId:_.routeId,path:_.path,matches:M,match:I,controller:new AbortController})}),[E,S]}function Hj(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function wP(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Jk(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Qk(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];He(o,"No route found in manifest");let i={};for(let s in r){let l=o[s]!==void 0&&s!=="hasErrorBoundary";Qa(!l,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!fj.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,At({},t(o),{lazy:void 0}))}async function Nu(e,t,n,r,o,i,s,a,l){l===void 0&&(l={});let c,u,d,f=g=>{let y,v=new Promise((x,w)=>y=w);return d=()=>y(),t.signal.addEventListener("abort",d),Promise.race([g({request:t,params:n.params,context:l.requestContext}),v])};try{let g=n.route[e];if(n.route.lazy)if(g){let y,v=await Promise.all([f(g).catch(x=>{y=x}),Qk(n.route,i,o)]);if(y)throw y;u=v[0]}else if(await Qk(n.route,i,o),g=n.route[e],g)u=await f(g);else if(e==="action"){let y=new URL(t.url),v=y.pathname+y.search;throw Fr(405,{method:t.method,pathname:v,routeId:n.route.id})}else return{type:Nt.data,data:void 0};else if(g)u=await f(g);else{let y=new URL(t.url),v=y.pathname+y.search;throw Fr(404,{pathname:v})}He(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(g){c=Nt.error,u=g}finally{d&&t.signal.removeEventListener("abort",d)}if(Gj(u)){let g=u.status;if(Lj.has(g)){let v=u.headers.get("Location");if(He(v,"Redirects returned/thrown from loaders/actions must have a Location header"),!xP.test(v))v=ax(new URL(t.url),r.slice(0,r.indexOf(n)+1),s,!0,v,a);else if(!l.isStaticRequest){let x=new URL(t.url),w=v.startsWith("//")?new URL(x.protocol+v):new URL(v),k=Qf(w.pathname,s)!=null;w.origin===x.origin&&k&&(v=w.pathname+w.search+w.hash)}if(l.isStaticRequest)throw u.headers.set("Location",v),u;return{type:Nt.redirect,status:g,location:v,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===Nt.error?Nt.error:Nt.data,response:u};let y;try{let v=u.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?u.body==null?y=null:y=await u.json():y=await u.text()}catch(v){return{type:Nt.error,error:v}}return c===Nt.error?{type:c,error:new _1(g,u.statusText,y),headers:u.headers}:{type:Nt.data,data:y,statusCode:u.status,headers:u.headers}}if(c===Nt.error)return{type:c,error:u};if(qj(u)){var p,m;return{type:Nt.deferred,deferredData:u,statusCode:(p=u.init)==null?void 0:p.status,headers:((m=u.init)==null?void 0:m.headers)&&new Headers(u.init.headers)}}return{type:Nt.data,data:u}}function $u(e,t,n,r){let o=e.createURL(SP(t)).toString(),i={signal:n};if(r&&go(r.formMethod)){let{formMethod:s,formEncType:a}=r;i.method=s.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=lx(r.formData):i.body=r.formData}return new Request(o,i)}function lx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function eE(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Wj(e,t,n,r,o){let i={},s=null,a,l=!1,c={};return n.forEach((u,d)=>{let f=t[d].route.id;if(He(!Aa(u),"Cannot handle redirect results in processLoaderData"),pc(u)){let p=Pd(e,f),m=u.error;r&&(m=Object.values(r)[0],r=void 0),s=s||{},s[p.route.id]==null&&(s[p.route.id]=m),i[f]=void 0,l||(l=!0,a=vP(u.error)?u.error.status:500),u.headers&&(c[f]=u.headers)}else $a(u)?(o.set(f,u.deferredData),i[f]=u.deferredData.data):i[f]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(a=u.statusCode),u.headers&&(c[f]=u.headers)}),r&&(s=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:c}}function tE(e,t,n,r,o,i,s,a){let{loaderData:l,errors:c}=Wj(t,n,r,o,a);for(let u=0;u<i.length;u++){let{key:d,match:f,controller:p}=i[u];He(s!==void 0&&s[u]!==void 0,"Did not find corresponding fetcher result");let m=s[u];if(!(p&&p.signal.aborted))if(pc(m)){let g=Pd(e.matches,f==null?void 0:f.route.id);c&&c[g.route.id]||(c=At({},c,{[g.route.id]:m.error})),e.fetchers.delete(d)}else if(Aa(m))He(!1,"Unhandled fetcher revalidation redirect");else if($a(m))He(!1,"Unhandled fetcher deferred data");else{let g=cs(m.data);e.fetchers.set(d,g)}}return{loaderData:l,errors:c}}function nE(e,t,n,r){let o=At({},t);for(let i of n){let s=i.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(o[s]=t[s]):e[s]!==void 0&&i.route.loader&&(o[s]=e[s]),r&&r.hasOwnProperty(s))break}return o}function Pd(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function rE(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Fr(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,s="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(s="Bad Request",o&&n&&r?a="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?a="defer() is not supported in actions":i==="invalid-body"&&(a="Unable to encode submission body")):e===403?(s="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",a='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",o&&n&&r?a="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(a='Invalid request method "'+o.toUpperCase()+'"')),new _1(e||500,s,new Error(a),!0)}function oE(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Aa(n))return{result:n,idx:t}}}function SP(e){let t=typeof e=="string"?Hi(e):e;return Jf(At({},t,{hash:""}))}function Kj(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function $a(e){return e.type===Nt.deferred}function pc(e){return e.type===Nt.error}function Aa(e){return(e&&e.type)===Nt.redirect}function qj(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Gj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Yj(e){return Ij.has(e.toLowerCase())}function go(e){return Aj.has(e.toLowerCase())}async function iE(e,t,n,r,o,i){for(let s=0;s<n.length;s++){let a=n[s],l=t[s];if(!l)continue;let c=e.find(d=>d.route.id===l.route.id),u=c!=null&&!wP(c,l)&&(i&&i[l.route.id])!==void 0;if($a(a)&&(o||u)){let d=r[s];He(d,"Expected an AbortSignal for revalidating fetcher deferred result"),await kP(a,d,o).then(f=>{f&&(n[s]=f||n[s])})}}}async function kP(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Nt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Nt.error,error:o}}return{type:Nt.data,data:e.deferredData.data}}}function C1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function cx(e,t){let n=typeof t=="string"?Hi(t).search:t.search;if(e[e.length-1].route.index&&C1(n||""))return e[e.length-1];let r=hP(e);return r[r.length-1]}function sE(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:s}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function gy(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Xj(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Au(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Zj(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function cs(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Jj(e,t){try{let n=e.sessionStorage.getItem(bP);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function Qj(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(bP,JSON.stringify(n))}catch(r){Qa(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
58
|
+
* React Router v6.21.2
|
|
59
|
+
*
|
|
60
|
+
* Copyright (c) Remix Software Inc.
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the MIT license found in the
|
|
63
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
64
|
+
*
|
|
65
|
+
* @license MIT
|
|
66
|
+
*/function tf(){return tf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tf.apply(this,arguments)}const $g=h.createContext(null),EP=h.createContext(null),Ag=h.createContext(null),Dg=h.createContext(null),vl=h.createContext({outlet:null,matches:[],isDataRoute:!1}),_P=h.createContext(null);function Ig(){return h.useContext(Dg)!=null}function CP(){return Ig()||He(!1),h.useContext(Dg).location}function OP(e){h.useContext(Ag).static||h.useLayoutEffect(e)}function O1(){let{isDataRoute:e}=h.useContext(vl);return e?f6():e6()}function e6(){Ig()||He(!1);let e=h.useContext($g),{basename:t,future:n,navigator:r}=h.useContext(Ag),{matches:o}=h.useContext(vl),{pathname:i}=CP(),s=JSON.stringify(mP(o,n.v7_relativeSplatPath)),a=h.useRef(!1);return OP(()=>{a.current=!0}),h.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=gP(c,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Bs([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,s,i,e])}function t6(){let{matches:e}=h.useContext(vl),t=e[e.length-1];return t?t.params:{}}function n6(e,t,n,r){Ig()||He(!1);let{navigator:o}=h.useContext(Ag),{matches:i}=h.useContext(vl),s=i[i.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let c=CP(),u;if(t){var d;let y=typeof t=="string"?Hi(t):t;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||He(!1),u=y}else u=c;let f=u.pathname||"/",p=l==="/"?f:f.slice(l.length)||"/",m=fc(e,{pathname:p}),g=a6(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Bs([l,o.encodeLocation?o.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Bs([l,o.encodeLocation?o.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return t&&g?h.createElement(Dg.Provider,{value:{location:tf({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:zt.Pop}},g):g}function r6(){let e=d6(),t=vP(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:o},n):null,null)}const o6=h.createElement(r6,null);class i6 extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(vl.Provider,{value:this.props.routeContext},h.createElement(_P.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function s6(e){let{routeContext:t,match:n,children:r}=e,o=h.useContext($g);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(vl.Provider,{value:t},r)}function a6(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let s=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let u=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id]));u>=0||He(!1),s=s.slice(0,Math.min(s.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<s.length;u++){let d=s[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:f,errors:p}=n,m=d.route.loader&&f[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||m){l=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((u,d,f)=>{let p,m=!1,g=null,y=null;n&&(p=a&&d.route.id?a[d.route.id]:void 0,g=d.route.errorElement||o6,l&&(c<0&&f===0?(p6("route-fallback",!1),m=!0,y=null):c===f&&(m=!0,y=d.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,f+1)),x=()=>{let w;return p?w=g:m?w=y:d.route.Component?w=h.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,h.createElement(s6,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?h.createElement(i6,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var TP=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(TP||{}),am=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(am||{});function l6(e){let t=h.useContext($g);return t||He(!1),t}function c6(e){let t=h.useContext(EP);return t||He(!1),t}function u6(e){let t=h.useContext(vl);return t||He(!1),t}function PP(e){let t=u6(),n=t.matches[t.matches.length-1];return n.route.id||He(!1),n.route.id}function d6(){var e;let t=h.useContext(_P),n=c6(am.UseRouteError),r=PP(am.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function f6(){let{router:e}=l6(TP.UseNavigateStable),t=PP(am.UseNavigateStable),n=h.useRef(!1);return OP(()=>{n.current=!0}),h.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,tf({fromRouteId:t},i)))},[e,t])}const aE={};function p6(e,t,n){!t&&!aE[e]&&(aE[e]=!0)}function h6(e){let{basename:t="/",children:n=null,location:r,navigationType:o=zt.Pop,navigator:i,static:s=!1,future:a}=e;Ig()&&He(!1);let l=t.replace(/^\/*/,"/"),c=h.useMemo(()=>({basename:l,navigator:i,static:s,future:tf({v7_relativeSplatPath:!1},a)}),[l,a,i,s]);typeof r=="string"&&(r=Hi(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:m="default"}=r,g=h.useMemo(()=>{let y=Qf(u,l);return y==null?null:{location:{pathname:y,search:d,hash:f,state:p,key:m},navigationType:o}},[l,u,d,f,p,m,o]);return g==null?null:h.createElement(Ag.Provider,{value:c},h.createElement(Dg.Provider,{children:n,value:g}))}new Promise(()=>{});function m6(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:h.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function MP(e="dark"){const[t,n]=h.useState(e);return h.useEffect(()=>{localStorage.getItem("val-theme")==="light"?n("light"):localStorage.getItem("val-theme")==="dark"||window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?n("dark"):window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&n("light");const r=o=>{localStorage.getItem("val-theme")||n(o.matches?"dark":"light")};return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",r)}},[]),[t,r=>{localStorage.setItem("val-theme",r),n(r)}]}function dn(e){for(var t=e,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0,s=r;i<s.length;i++){var a=s[i];t=a(t)}return t}function RP(e,t){const[n,r]=h.useState({}),[o,i]=h.useState(0);return h.useEffect(()=>{e.status==="success"&&t.getPatches({}).then(s=>{if(St.isOk(s)){const a={};for(const l in s.value)a[l]=s.value[l].map(c=>c.patch_id);r(a)}else console.error("Could not load patches",s.error)})},[e,o]),{patches:n,setPatchResetId:i}}var Ze;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},e.getValidEnumValues=o=>{const i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(const a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(const s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ze||(Ze={}));var ux;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(ux||(ux={}));const oe=Ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Es=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},W=Ze.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),g6=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Oo extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ze.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Oo.create=e=>new Oo(e);const nf=(e,t)=>{let n;switch(e.code){case W.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case W.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ze.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ze.joinValues(e.keys,", ")}`;break;case W.invalid_union:n="Invalid input";break;case W.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ze.joinValues(e.options)}`;break;case W.invalid_enum_value:n=`Invalid enum value. Expected ${Ze.joinValues(e.options)}, received '${e.received}'`;break;case W.invalid_arguments:n="Invalid function arguments";break;case W.invalid_return_type:n="Invalid function return type";break;case W.invalid_date:n="Invalid date";break;case W.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ze.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case W.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case W.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case W.custom:n="Invalid input";break;case W.invalid_intersection_types:n="Intersection results could not be merged";break;case W.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case W.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ze.assertNever(e)}return{message:n}};let NP=nf;function v6(e){NP=e}function lm(){return NP}const cm=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],s={...o,path:i};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:t,defaultError:a}).message;return{...o,path:i,message:o.message||a}},y6=[];function ie(e,t){const n=cm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,lm(),nf].filter(r=>!!r)});e.common.issues.push(n)}class Ln{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return Oe;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n)r.push({key:await o.key,value:await o.value});return Ln.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Oe;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:t.value,value:r}}}const Oe=Object.freeze({status:"aborted"}),$P=e=>({status:"dirty",value:e}),Gn=e=>({status:"valid",value:e}),dx=e=>e.status==="aborted",fx=e=>e.status==="dirty",rf=e=>e.status==="valid",um=e=>typeof Promise<"u"&&e instanceof Promise;var ve;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ve||(ve={}));class Jo{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const lE=(e,t)=>{if(rf(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Oo(e.common.issues);return this._error=n,this._error}}};function Me(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:o}}class Ie{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Es(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Es(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ln,ctx:{common:t.parent.common,data:t.data,parsedType:Es(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(um(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Es(t)},i=this._parseSync({data:t,path:o.path,parent:o});return lE(o,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Es(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(um(o)?o:Promise.resolve(o));return lE(r,i)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=t(o),a=()=>i.addIssue({code:W.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new $o({schema:this,typeName:Se.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Pi.create(this,this._def)}nullable(){return nl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return To.create(this,this._def)}promise(){return Fc.create(this,this._def)}or(t){return lf.create([this,t],this._def)}and(t){return cf.create(this,t,this._def)}transform(t){return new $o({...Me(this._def),schema:this,typeName:Se.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new hf({...Me(this._def),innerType:this,defaultValue:n,typeName:Se.ZodDefault})}brand(){return new DP({typeName:Se.ZodBranded,type:this,...Me(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new hm({...Me(this._def),innerType:this,catchValue:n,typeName:Se.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ep.create(this,t)}readonly(){return gm.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const x6=/^c[^\s-]{8,}$/i,b6=/^[a-z][a-z0-9]*$/,w6=/^[0-9A-HJKMNP-TV-Z]{26}$/,S6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,k6=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,E6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let vy;const _6=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,C6=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,O6=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function T6(e,t){return!!((t==="v4"||!t)&&_6.test(e)||(t==="v6"||!t)&&C6.test(e))}class So extends Ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const i=this._getOrReturnCtx(t);return ie(i,{code:W.invalid_type,expected:oe.string,received:i.parsedType}),Oe}const r=new Ln;let o;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:W.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?ie(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&ie(o,{code:W.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")k6.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"email",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")vy||(vy=new RegExp(E6,"u")),vy.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"emoji",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")S6.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"uuid",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")x6.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")b6.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid2",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")w6.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ulid",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ie(o,{validation:"url",code:W.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"regex",code:W.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),ie(o,{code:W.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:W.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:W.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?O6(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:W.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?T6(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ip",code:W.invalid_string,message:i.message}),r.dirty()):Ze.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:W.invalid_string,...ve.errToObj(r)})}_addCheck(t){return new So({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ve.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ve.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ve.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ve.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ve.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ve.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ve.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ve.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...ve.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ve.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ve.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ve.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ve.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ve.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ve.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ve.errToObj(n)})}nonempty(t){return this.min(1,ve.errToObj(t))}trim(){return new So({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new So({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new So({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}So.create=e=>{var t;return new So({checks:[],typeName:Se.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Me(e)})};function P6(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(e.toFixed(o).replace(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}class Ys extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==oe.number){const i=this._getOrReturnCtx(t);return ie(i,{code:W.invalid_type,expected:oe.number,received:i.parsedType}),Oe}let r;const o=new Ln;for(const i of this._def.checks)i.kind==="int"?Ze.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ie(r,{code:W.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:W.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:W.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?P6(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),ie(r,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ie(r,{code:W.not_finite,message:i.message}),o.dirty()):Ze.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ve.toString(n))}setLimit(t,n,r,o){return new Ys({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ve.toString(o)}]})}_addCheck(t){return new Ys({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ve.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ve.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ve.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ve.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ve.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ze.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ys.create=e=>new Ys({checks:[],typeName:Se.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Me(e)});class Xs extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==oe.bigint){const i=this._getOrReturnCtx(t);return ie(i,{code:W.invalid_type,expected:oe.bigint,received:i.parsedType}),Oe}let r;const o=new Ln;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:W.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:W.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ze.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ve.toString(n))}setLimit(t,n,r,o){return new Xs({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ve.toString(o)}]})}_addCheck(t){return new Xs({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ve.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Xs.create=e=>{var t;return new Xs({checks:[],typeName:Se.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Me(e)})};class of extends Ie{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return ie(r,{code:W.invalid_type,expected:oe.boolean,received:r.parsedType}),Oe}return Gn(t.data)}}of.create=e=>new of({typeName:Se.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Me(e)});class el extends Ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const i=this._getOrReturnCtx(t);return ie(i,{code:W.invalid_type,expected:oe.date,received:i.parsedType}),Oe}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ie(i,{code:W.invalid_date}),Oe}const r=new Ln;let o;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:W.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:W.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Ze.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new el({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ve.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ve.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}el.create=e=>new el({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Se.ZodDate,...Me(e)});class dm extends Ie{_parse(t){if(this._getType(t)!==oe.symbol){const r=this._getOrReturnCtx(t);return ie(r,{code:W.invalid_type,expected:oe.symbol,received:r.parsedType}),Oe}return Gn(t.data)}}dm.create=e=>new dm({typeName:Se.ZodSymbol,...Me(e)});class sf extends Ie{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ie(r,{code:W.invalid_type,expected:oe.undefined,received:r.parsedType}),Oe}return Gn(t.data)}}sf.create=e=>new sf({typeName:Se.ZodUndefined,...Me(e)});class af extends Ie{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return ie(r,{code:W.invalid_type,expected:oe.null,received:r.parsedType}),Oe}return Gn(t.data)}}af.create=e=>new af({typeName:Se.ZodNull,...Me(e)});class zc extends Ie{constructor(){super(...arguments),this._any=!0}_parse(t){return Gn(t.data)}}zc.create=e=>new zc({typeName:Se.ZodAny,...Me(e)});class Ba extends Ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Gn(t.data)}}Ba.create=e=>new Ba({typeName:Se.ZodUnknown,...Me(e)});class Ii extends Ie{_parse(t){const n=this._getOrReturnCtx(t);return ie(n,{code:W.invalid_type,expected:oe.never,received:n.parsedType}),Oe}}Ii.create=e=>new Ii({typeName:Se.ZodNever,...Me(e)});class fm extends Ie{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ie(r,{code:W.invalid_type,expected:oe.void,received:r.parsedType}),Oe}return Gn(t.data)}}fm.create=e=>new fm({typeName:Se.ZodVoid,...Me(e)});class To extends Ie{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==oe.array)return ie(n,{code:W.invalid_type,expected:oe.array,received:n.parsedType}),Oe;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(s||a)&&(ie(n,{code:s?W.too_big:W.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(ie(n,{code:W.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(ie(n,{code:W.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>o.type._parseAsync(new Jo(n,s,n.path,a)))).then(s=>Ln.mergeArray(r,s));const i=[...n.data].map((s,a)=>o.type._parseSync(new Jo(n,s,n.path,a)));return Ln.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new To({...this._def,minLength:{value:t,message:ve.toString(n)}})}max(t,n){return new To({...this._def,maxLength:{value:t,message:ve.toString(n)}})}length(t,n){return new To({...this._def,exactLength:{value:t,message:ve.toString(n)}})}nonempty(t){return this.min(1,t)}}To.create=(e,t)=>new To({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Se.ZodArray,...Me(t)});function Vl(e){if(e instanceof Ot){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Pi.create(Vl(r))}return new Ot({...e._def,shape:()=>t})}else return e instanceof To?new To({...e._def,type:Vl(e.element)}):e instanceof Pi?Pi.create(Vl(e.unwrap())):e instanceof nl?nl.create(Vl(e.unwrap())):e instanceof Qo?Qo.create(e.items.map(t=>Vl(t))):e}class Ot extends Ie{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ze.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const c=this._getOrReturnCtx(t);return ie(c,{code:W.invalid_type,expected:oe.object,received:c.parsedType}),Oe}const{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ii&&this._def.unknownKeys==="strip"))for(const c in o.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=i[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Jo(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof Ii){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(c==="strict")a.length>0&&(ie(o,{code:W.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Jo(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>Ln.mergeObjectSync(r,c)):Ln.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return ve.errToObj,new Ot({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,s,a;const l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ve.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Ot({...this._def,unknownKeys:"strip"})}passthrough(){return new Ot({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ot({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ot({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Se.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Ot({...this._def,catchall:t})}pick(t){const n={};return Ze.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Ot({...this._def,shape:()=>n})}omit(t){const n={};return Ze.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Ot({...this._def,shape:()=>n})}deepPartial(){return Vl(this)}partial(t){const n={};return Ze.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new Ot({...this._def,shape:()=>n})}required(t){const n={};return Ze.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Pi;)i=i._def.innerType;n[r]=i}}),new Ot({...this._def,shape:()=>n})}keyof(){return AP(Ze.objectKeys(this.shape))}}Ot.create=(e,t)=>new Ot({shape:()=>e,unknownKeys:"strip",catchall:Ii.create(),typeName:Se.ZodObject,...Me(t)});Ot.strictCreate=(e,t)=>new Ot({shape:()=>e,unknownKeys:"strict",catchall:Ii.create(),typeName:Se.ZodObject,...Me(t)});Ot.lazycreate=(e,t)=>new Ot({shape:e,unknownKeys:"strip",catchall:Ii.create(),typeName:Se.ZodObject,...Me(t)});class lf extends Ie{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(a=>new Oo(a.ctx.common.issues));return ie(n,{code:W.invalid_union,unionErrors:s}),Oe}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=s.map(l=>new Oo(l));return ie(n,{code:W.invalid_union,unionErrors:a}),Oe}}get options(){return this._def.options}}lf.create=(e,t)=>new lf({options:e,typeName:Se.ZodUnion,...Me(t)});const mh=e=>e instanceof df?mh(e.schema):e instanceof $o?mh(e.innerType()):e instanceof ff?[e.value]:e instanceof Zs?e.options:e instanceof pf?Object.keys(e.enum):e instanceof hf?mh(e._def.innerType):e instanceof sf?[void 0]:e instanceof af?[null]:null;class Lg extends Ie{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return ie(n,{code:W.invalid_type,expected:oe.object,received:n.parsedType}),Oe;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const i of n){const s=mh(i.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new Lg({typeName:Se.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...Me(r)})}}function px(e,t){const n=Es(e),r=Es(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const o=Ze.objectKeys(t),i=Ze.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(const a of i){const l=px(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let i=0;i<e.length;i++){const s=e[i],a=t[i],l=px(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===oe.date&&r===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class cf extends Ie{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(i,s)=>{if(dx(i)||dx(s))return Oe;const a=px(i.value,s.value);return a.valid?((fx(i)||fx(s))&&n.dirty(),{status:n.value,value:a.data}):(ie(r,{code:W.invalid_intersection_types}),Oe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}cf.create=(e,t,n)=>new cf({left:e,right:t,typeName:Se.ZodIntersection,...Me(n)});class Qo extends Ie{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return ie(r,{code:W.invalid_type,expected:oe.array,received:r.parsedType}),Oe;if(r.data.length<this._def.items.length)return ie(r,{code:W.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oe;!this._def.rest&&r.data.length>this._def.items.length&&(ie(r,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Jo(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Ln.mergeArray(n,s)):Ln.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new Qo({...this._def,rest:t})}}Qo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qo({items:e,typeName:Se.ZodTuple,rest:null,...Me(t)})};class uf extends Ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return ie(r,{code:W.invalid_type,expected:oe.object,received:r.parsedType}),Oe;const o=[],i=this._def.keyType,s=this._def.valueType;for(const a in r.data)o.push({key:i._parse(new Jo(r,a,r.path,a)),value:s._parse(new Jo(r,r.data[a],r.path,a))});return r.common.async?Ln.mergeObjectAsync(n,o):Ln.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ie?new uf({keyType:t,valueType:n,typeName:Se.ZodRecord,...Me(r)}):new uf({keyType:So.create(),valueType:t,typeName:Se.ZodRecord,...Me(n)})}}class pm extends Ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return ie(r,{code:W.invalid_type,expected:oe.map,received:r.parsedType}),Oe;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:o._parse(new Jo(r,a,r.path,[c,"key"])),value:i._parse(new Jo(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Oe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Oe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}pm.create=(e,t,n)=>new pm({valueType:t,keyType:e,typeName:Se.ZodMap,...Me(n)});class tl extends Ie{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return ie(r,{code:W.invalid_type,expected:oe.set,received:r.parsedType}),Oe;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ie(r,{code:W.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(ie(r,{code:W.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Oe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>i._parse(new Jo(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,n){return new tl({...this._def,minSize:{value:t,message:ve.toString(n)}})}max(t,n){return new tl({...this._def,maxSize:{value:t,message:ve.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}tl.create=(e,t)=>new tl({valueType:e,minSize:null,maxSize:null,typeName:Se.ZodSet,...Me(t)});class kc extends Ie{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return ie(n,{code:W.invalid_type,expected:oe.function,received:n.parsedType}),Oe;function r(a,l){return cm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,lm(),nf].filter(c=>!!c),issueData:{code:W.invalid_arguments,argumentsError:l}})}function o(a,l){return cm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,lm(),nf].filter(c=>!!c),issueData:{code:W.invalid_return_type,returnTypeError:l}})}const i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Fc){const a=this;return Gn(async function(...l){const c=new Oo([]),u=await a._def.args.parseAsync(l,i).catch(p=>{throw c.addIssue(r(l,p)),c}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,i).catch(p=>{throw c.addIssue(o(d,p)),c})})}else{const a=this;return Gn(function(...l){const c=a._def.args.safeParse(l,i);if(!c.success)throw new Oo([r(l,c.error)]);const u=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(u,i);if(!d.success)throw new Oo([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new kc({...this._def,args:Qo.create(t).rest(Ba.create())})}returns(t){return new kc({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new kc({args:t||Qo.create([]).rest(Ba.create()),returns:n||Ba.create(),typeName:Se.ZodFunction,...Me(r)})}}class df extends Ie{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}df.create=(e,t)=>new df({getter:e,typeName:Se.ZodLazy,...Me(t)});class ff extends Ie{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ie(n,{received:n.data,code:W.invalid_literal,expected:this._def.value}),Oe}return{status:"valid",value:t.data}}get value(){return this._def.value}}ff.create=(e,t)=>new ff({value:e,typeName:Se.ZodLiteral,...Me(t)});function AP(e,t){return new Zs({values:e,typeName:Se.ZodEnum,...Me(t)})}class Zs extends Ie{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ie(n,{expected:Ze.joinValues(r),received:n.parsedType,code:W.invalid_type}),Oe}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return ie(n,{received:n.data,code:W.invalid_enum_value,options:r}),Oe}return Gn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Zs.create(t)}exclude(t){return Zs.create(this.options.filter(n=>!t.includes(n)))}}Zs.create=AP;class pf extends Ie{_parse(t){const n=Ze.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const o=Ze.objectValues(n);return ie(r,{expected:Ze.joinValues(o),received:r.parsedType,code:W.invalid_type}),Oe}if(n.indexOf(t.data)===-1){const o=Ze.objectValues(n);return ie(r,{received:r.data,code:W.invalid_enum_value,options:o}),Oe}return Gn(t.data)}get enum(){return this._def.values}}pf.create=(e,t)=>new pf({values:e,typeName:Se.ZodNativeEnum,...Me(t)});class Fc extends Ie{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return ie(n,{code:W.invalid_type,expected:oe.promise,received:n.parsedType}),Oe;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return Gn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Fc.create=(e,t)=>new Fc({type:e,typeName:Se.ZodPromise,...Me(t)});class $o extends Ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{ie(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){const s=a=>{const l=o.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Oe:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Oe:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!rf(s))return s;const a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>rf(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:n.value,value:a})):s);Ze.assertNever(o)}}$o.create=(e,t,n)=>new $o({schema:e,typeName:Se.ZodEffects,effect:t,...Me(n)});$o.createWithPreprocess=(e,t,n)=>new $o({schema:t,effect:{type:"preprocess",transform:e},typeName:Se.ZodEffects,...Me(n)});class Pi extends Ie{_parse(t){return this._getType(t)===oe.undefined?Gn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Pi.create=(e,t)=>new Pi({innerType:e,typeName:Se.ZodOptional,...Me(t)});class nl extends Ie{_parse(t){return this._getType(t)===oe.null?Gn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}nl.create=(e,t)=>new nl({innerType:e,typeName:Se.ZodNullable,...Me(t)});class hf extends Ie{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}hf.create=(e,t)=>new hf({innerType:e,typeName:Se.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Me(t)});class hm extends Ie{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return um(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Oo(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Oo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}hm.create=(e,t)=>new hm({innerType:e,typeName:Se.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Me(t)});class mm extends Ie{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return ie(r,{code:W.invalid_type,expected:oe.nan,received:r.parsedType}),Oe}return{status:"valid",value:t.data}}}mm.create=e=>new mm({typeName:Se.ZodNaN,...Me(e)});const M6=Symbol("zod_brand");class DP extends Ie{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ep extends Ie{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Oe:i.status==="dirty"?(n.dirty(),$P(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Oe:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new ep({in:t,out:n,typeName:Se.ZodPipeline})}}class gm extends Ie{_parse(t){const n=this._def.innerType._parse(t);return rf(n)&&(n.value=Object.freeze(n.value)),n}}gm.create=(e,t)=>new gm({innerType:e,typeName:Se.ZodReadonly,...Me(t)});const IP=(e,t={},n)=>e?zc.create().superRefine((r,o)=>{var i,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(i=a.fatal)!==null&&i!==void 0?i:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...c,fatal:l})}}):zc.create(),R6={object:Ot.lazycreate};var Se;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Se||(Se={}));const N6=(e,t={message:`Input not instance of ${e.name}`})=>IP(n=>n instanceof e,t),LP=So.create,jP=Ys.create,$6=mm.create,A6=Xs.create,zP=of.create,D6=el.create,I6=dm.create,L6=sf.create,j6=af.create,z6=zc.create,F6=Ba.create,B6=Ii.create,U6=fm.create,V6=To.create,H6=Ot.create,W6=Ot.strictCreate,K6=lf.create,q6=Lg.create,G6=cf.create,Y6=Qo.create,X6=uf.create,Z6=pm.create,J6=tl.create,Q6=kc.create,e7=df.create,t7=ff.create,n7=Zs.create,r7=pf.create,o7=Fc.create,cE=$o.create,i7=Pi.create,s7=nl.create,a7=$o.createWithPreprocess,l7=ep.create,c7=()=>LP().optional(),u7=()=>jP().optional(),d7=()=>zP().optional(),f7={string:e=>So.create({...e,coerce:!0}),number:e=>Ys.create({...e,coerce:!0}),boolean:e=>of.create({...e,coerce:!0}),bigint:e=>Xs.create({...e,coerce:!0}),date:e=>el.create({...e,coerce:!0})},p7=Oe;var F=Object.freeze({__proto__:null,defaultErrorMap:nf,setErrorMap:v6,getErrorMap:lm,makeIssue:cm,EMPTY_PATH:y6,addIssueToContext:ie,ParseStatus:Ln,INVALID:Oe,DIRTY:$P,OK:Gn,isAborted:dx,isDirty:fx,isValid:rf,isAsync:um,get util(){return Ze},get objectUtil(){return ux},ZodParsedType:oe,getParsedType:Es,ZodType:Ie,ZodString:So,ZodNumber:Ys,ZodBigInt:Xs,ZodBoolean:of,ZodDate:el,ZodSymbol:dm,ZodUndefined:sf,ZodNull:af,ZodAny:zc,ZodUnknown:Ba,ZodNever:Ii,ZodVoid:fm,ZodArray:To,ZodObject:Ot,ZodUnion:lf,ZodDiscriminatedUnion:Lg,ZodIntersection:cf,ZodTuple:Qo,ZodRecord:uf,ZodMap:pm,ZodSet:tl,ZodFunction:kc,ZodLazy:df,ZodLiteral:ff,ZodEnum:Zs,ZodNativeEnum:pf,ZodPromise:Fc,ZodEffects:$o,ZodTransformer:$o,ZodOptional:Pi,ZodNullable:nl,ZodDefault:hf,ZodCatch:hm,ZodNaN:mm,BRAND:M6,ZodBranded:DP,ZodPipeline:ep,ZodReadonly:gm,custom:IP,Schema:Ie,ZodSchema:Ie,late:R6,get ZodFirstPartyTypeKind(){return Se},coerce:f7,any:z6,array:V6,bigint:A6,boolean:zP,date:D6,discriminatedUnion:q6,effect:cE,enum:n7,function:Q6,instanceof:N6,intersection:G6,lazy:e7,literal:t7,map:Z6,nan:$6,nativeEnum:r7,never:B6,null:j6,nullable:s7,number:jP,object:H6,oboolean:d7,onumber:u7,optional:i7,ostring:c7,pipeline:l7,preprocess:a7,promise:o7,record:X6,set:J6,strictObject:W6,string:LP,symbol:I6,transformer:cE,tuple:Y6,undefined:L6,union:K6,unknown:F6,void:U6,NEVER:p7,ZodIssueCode:W,quotelessJson:g6,ZodError:Oo});const h7=F.union([F.object({id:F.string(),mode:F.literal("proxy"),full_name:F.string().optional().nullable(),username:F.string().optional().nullable(),avatar_url:F.string().url().optional().nullable(),enabled:F.boolean()}),F.object({mode:F.literal("local"),enabled:F.boolean().optional()}),F.object({mode:F.literal("unauthorized"),enabled:F.boolean().optional()})]);function FP(e){const[t,n]=h.useState({status:"not-asked"}),[r,o]=h.useState(0);return h.useEffect(()=>{n({status:"loading"}),e.getSession().then(async i=>{try{if(St.isOk(i)){const s=i.value;n({status:"success",data:h7.parse(s)})}else i.error.statusCode===401?(console.error("Unauthorized",i.error),n({status:"success",data:{mode:"unauthorized"}})):r<3?setTimeout(()=>{o(r+1)},200*r):n({status:"error",error:"Could not fetch session"})}catch(s){console.error("Could not authorize:",s),n({status:"error",error:"Got an error while trying to get session"})}})},[r]),t}function qr({children:e}){const t=e.split("/").filter(n=>n);return t.map((n,r)=>r!==t.length-1?b.jsxs(h.Fragment,{children:[b.jsx("span",{children:n}),b.jsx("span",{className:"px-[2px] text-muted",children:"/"})]},`${e}/${n}`):b.jsx(m7,{children:n},e))}function m7({children:e}){if(e.includes(".")){const t=e.split(".");return t.map((n,r)=>r!==t.length-1?b.jsxs(h.Fragment,{children:[b.jsx("span",{children:r===0?n:JSON.parse(n)}),b.jsx("span",{className:"text-muted",children:"."})]},`${e}.${n}`):b.jsx("span",{children:r===0?n:JSON.parse(n)},e))}return b.jsx("span",{children:e})}function BP(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=BP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function g7(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=BP(e))&&(r&&(r+=" "),r+=t);return r}const uE=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,dE=g7,v7=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return dE(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=uE(u)||uE(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...i,...a}[g]):{...i,...a}[g]===y})?[...c,d,f]:c},[]);return dE(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},y7=v7("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Bc=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Di:"button";return b.jsx(s,{className:Ue(y7({variant:t,size:n,className:e})),ref:i,...o})});Bc.displayName="Button";function jg(e){const t=e+"CollectionProvider",[n,r]=to(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:m,children:g}=p,y=te.useRef(null),v=te.useRef(new Map).current;return te.createElement(o,{scope:m,itemMap:v,collectionRef:y},g)},a=e+"CollectionSlot",l=te.forwardRef((p,m)=>{const{scope:g,children:y}=p,v=i(a,g),x=qe(m,v.collectionRef);return te.createElement(Di,{ref:x},y)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=te.forwardRef((p,m)=>{const{scope:g,children:y,...v}=p,x=te.useRef(null),w=qe(m,x),k=i(c,g);return te.useEffect(()=>(k.itemMap.set(x,{ref:x,...v}),()=>void k.itemMap.delete(x))),te.createElement(Di,{[u]:"",ref:w},y)});function f(p){const m=i(e+"CollectionConsumer",p);return te.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const v=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((k,E)=>v.indexOf(k.ref.current)-v.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},f,r]}function ei({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=x7({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=pn(n),l=h.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function x7({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,o=h.useRef(r),i=pn(t);return h.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const b7=yO.useId||(()=>{});let w7=0;function Po(e){const[t,n]=h.useState(b7());return Pr(()=>{e||n(r=>r??String(w7++))},[e]),e||(t?`radix-${t}`:"")}const UP="Collapsible",[S7,VP]=to(UP),[k7,T1]=S7(UP),E7=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=ei({prop:r,defaultProp:o,onChange:s});return h.createElement(k7,{scope:n,disabled:i,contentId:Po(),open:l,onOpenToggle:h.useCallback(()=>c(u=>!u),[c])},h.createElement($e.div,B({"data-state":P1(l),"data-disabled":i?"":void 0},a,{ref:t})))}),_7="CollapsibleTrigger",C7=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=T1(_7,n);return h.createElement($e.button,B({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":P1(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:ae(e.onClick,o.onOpenToggle)}))}),HP="CollapsibleContent",O7=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=T1(HP,e.__scopeCollapsible);return h.createElement(er,{present:n||o.open},({present:i})=>h.createElement(T7,B({},r,{ref:t,present:i})))}),T7=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=T1(HP,n),[a,l]=h.useState(r),c=h.useRef(null),u=qe(t,c),d=h.useRef(0),f=d.current,p=h.useRef(0),m=p.current,g=s.open||a,y=h.useRef(g),v=h.useRef();return h.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),Pr(()=>{const x=c.current;if(x){v.current=v.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();d.current=w.height,p.current=w.width,y.current||(x.style.transitionDuration=v.current.transitionDuration,x.style.animationName=v.current.animationName),l(r)}},[s.open,r]),h.createElement($e.div,B({"data-state":P1(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!g},i,{ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style}}),g&&o)});function P1(e){return e?"open":"closed"}const P7=E7,M7=C7,R7=O7,ua="Accordion",N7=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[M1,$7,A7]=jg(ua),[zg,Vle]=to(ua,[A7,VP]),R1=VP(),WP=te.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return te.createElement(M1.Provider,{scope:e.__scopeAccordion},n==="multiple"?te.createElement(j7,B({},i,{ref:t})):te.createElement(L7,B({},o,{ref:t})))});WP.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[KP,D7]=zg(ua),[qP,I7]=zg(ua,{collapsible:!1}),L7=te.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=ei({prop:n,defaultProp:r,onChange:o});return te.createElement(KP,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:te.useCallback(()=>i&&l(""),[i,l])},te.createElement(qP,{scope:e.__scopeAccordion,collapsible:i},te.createElement(GP,B({},s,{ref:t}))))}),j7=te.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=ei({prop:n,defaultProp:r,onChange:o}),l=te.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=te.useCallback(u=>a((d=[])=>d.filter(f=>f!==u)),[a]);return te.createElement(KP,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},te.createElement(qP,{scope:e.__scopeAccordion,collapsible:!0},te.createElement(GP,B({},i,{ref:t}))))}),[z7,Fg]=zg(ua),GP=te.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=te.useRef(null),l=qe(a,t),c=$7(n),d=Zf(o)==="ltr",f=ae(e.onKeyDown,p=>{var m;if(!N7.includes(p.key))return;const g=p.target,y=c().filter(M=>{var A;return!((A=M.ref.current)!==null&&A!==void 0&&A.disabled)}),v=y.findIndex(M=>M.ref.current===g),x=y.length;if(v===-1)return;p.preventDefault();let w=v;const k=0,E=x-1,S=()=>{w=v+1,w>E&&(w=k)},_=()=>{w=v-1,w<k&&(w=E)};switch(p.key){case"Home":w=k;break;case"End":w=E;break;case"ArrowRight":i==="horizontal"&&(d?S():_());break;case"ArrowDown":i==="vertical"&&S();break;case"ArrowLeft":i==="horizontal"&&(d?_():S());break;case"ArrowUp":i==="vertical"&&_();break}const P=w%x;(m=y[P].ref.current)===null||m===void 0||m.focus()});return te.createElement(z7,{scope:n,disabled:r,direction:o,orientation:i},te.createElement(M1.Slot,{scope:n},te.createElement($e.div,B({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:f}))))}),hx="AccordionItem",[F7,N1]=zg(hx),Bg=te.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Fg(hx,n),s=D7(hx,n),a=R1(n),l=Po(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return te.createElement(F7,{scope:n,open:c,disabled:u,triggerId:l},te.createElement(P7,B({"data-orientation":i.orientation,"data-state":YP(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})))}),B7="AccordionHeader",U7=te.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Fg(ua,n),i=N1(B7,n);return te.createElement($e.h3,B({"data-orientation":o.orientation,"data-state":YP(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),fE="AccordionTrigger",Ug=te.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Fg(ua,n),i=N1(fE,n),s=I7(fE,n),a=R1(n);return te.createElement(M1.ItemSlot,{scope:n},te.createElement(M7,B({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),V7="AccordionContent",H7=te.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Fg(ua,n),i=N1(V7,n),s=R1(n);return te.createElement(R7,B({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function YP(e){return e?"open":"closed"}const W7=WP,K7=Bg,q7=U7,XP=Ug,ZP=H7,Vg=W7,JP=h.forwardRef(({className:e,...t},n)=>b.jsx(K7,{ref:n,className:Ue("border-b",e),...t}));JP.displayName="AccordionItem";const QP=h.forwardRef(({className:e,children:t,...n},r)=>b.jsx(q7,{className:"flex",children:b.jsxs(XP,{ref:r,className:Ue("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,b.jsx(Mg,{className:"w-4 h-4 transition-transform duration-200 shrink-0"})]})}));QP.displayName=XP.displayName;const tp=h.forwardRef(({className:e,children:t,...n},r)=>b.jsx(ZP,{ref:r,className:Ue("overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...n,children:b.jsx("div",{className:"pt-0 pb-4",children:t})}));tp.displayName=ZP.displayName;var eM={exports:{}},G7="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Y7=G7,X7=Y7;function tM(){}function nM(){}nM.resetWarningCache=tM;var Z7=function(){function e(r,o,i,s,a,l){if(l!==X7){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:nM,resetWarningCache:tM};return n.PropTypes=n,n};eM.exports=Z7();var np=eM.exports;const Ts=ai(np);function mx(){return mx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mx.apply(this,arguments)}function J7(e,t){if(e==null)return{};var n=Q7(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Q7(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var $1=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,s=J7(e,["color","size"]);return te.createElement("svg",mx({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("circle",{cx:"12",cy:"12",r:"10"}),te.createElement("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),te.createElement("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"}))});$1.propTypes={color:Ts.string,size:Ts.oneOfType([Ts.string,Ts.number])};$1.displayName="AlertCircle";const e8=$1;function gx(){return gx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gx.apply(this,arguments)}function t8(e,t){if(e==null)return{};var n=n8(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function n8(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var A1=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,s=t8(e,["color","size"]);return te.createElement("svg",gx({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("circle",{cx:"12",cy:"12",r:"10"}),te.createElement("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),te.createElement("line",{x1:"9",y1:"9",x2:"15",y2:"15"}))});A1.propTypes={color:Ts.string,size:Ts.oneOfType([Ts.string,Ts.number])};A1.displayName="XCircle";const rM=A1;function r8(e,t,n){var c,u,d,f;const r=[];let o,i={};const s={},a={};for(const[p,m]of Object.entries(e)){const g=p;for(const y of m){const v=n==null?void 0:n[y.author||""];(!o||((c=o.author)==null?void 0:c.id)!==(v==null?void 0:v.id))&&(o&&r.push({...o,changes:pE(i)}),i={},o={author:v,lastChangedAt:y.created_at,changeCount:0,changes:[]}),i[g]||(i[g]={});for(const x of y.patch){o.lastChangedAt=y.created_at,o.changeCount++;const w=ot.patchPathToModulePath(x.path);switch(i[g][w]||(i[g][w]=[]),(!s[`${g}.${w}`]||new Date(y.created_at).getTime()>new Date(s[`${g}.${w}`]).getTime())&&(s[`${g}.${w}`]=y.created_at,v&&(a[`${g}.${w}`]=v)),x.op){case"add":case"remove":case"replace":case"move":{const k=(u=i[g][w])==null?void 0:u.find(E=>E.type===x.op);k?(k.count++,k.patchIds.push(y.patch_id),k.changedAt=y.created_at):i[g][w].push({type:x.op,count:1,patchIds:[y.patch_id],changedAt:y.created_at,changedBy:v});break}case"file":{const k=x.filePath,E=i[g][w].find(S=>S.filePath===k);E?(E.count++,E.patchIds.push(y.patch_id),E.changedAt=y.created_at):i[g][w].push({filePath:k,type:"replace",count:1,changedAt:y.created_at,patchIds:[y.patch_id]});break}}}}}o&&r.push({...o,changes:pE(i)});for(const p of r){for(const m of p.changes)m.items.sort((g,y)=>g.changedAt&&y.changedAt?new Date(g.changedAt).getTime()-new Date(y.changedAt).getTime():0);p.changes.sort((m,g)=>{const y=m.items[m.items.length-1].changedAt,v=g.items[g.items.length-1].changedAt;return y?v?new Date(y).getTime()-new Date(v).getTime():-1:1})}r.sort((p,m)=>new Date(p.lastChangedAt).getTime()-new Date(m.lastChangedAt).getTime());const l=[];if(t!=null&&t.validationErrors)for(const[p,m]of Object.entries(t.validationErrors)){const g=p,y={validations:[]};if((d=m.errors)!=null&&d.fatal&&(y.fatalErrors=m.errors.fatal.map(v=>v.message)),(f=m.errors)!=null&&f.validation)for(const[v,x]of Object.entries(m.errors.validation)){const w=v,[,k]=ot.splitModuleIdAndModulePath(w);x.length>0&&y.validations.push({path:k,messages:x.map(E=>({message:E.message,severity:"warning"})),lastChangedAt:s[w],lastChangedBy:a[w]})}l.push([g,y])}return{history:r,errors:l.length>0?{errors:Object.fromEntries(l)}:void 0}}function pE(e){const t=[];for(const[n,r]of Object.entries(e)){const o=n,i=[];for(const[s,a]of Object.entries(r)){const l=s;for(const c of a)i.push({path:l,type:c.type,filePath:c.filePath,count:c.count,changedAt:c.changedAt,patchIds:c.patchIds})}t.push({moduleId:o,items:i})}return t}const oM=h.createContext(0);function o8(){return h.useContext(oM)}function i8(e){return b.jsxs(h8,{children:[b.jsx("div",{className:"flex justify-end p-2",children:b.jsx("button",{onClick:e.onCancel,children:b.jsx(Rg,{})})}),b.jsx("h1",{className:"block mb-6 font-sans text-2xl font-bold",children:"Review changes"}),b.jsx(iM,{...e})]})}function iM({api:e,isValidating:t,patches:n,validationResponse:r,onCommit:o,onCancel:i}){const[s,a]=h.useState(!1);h.useEffect(()=>{const u=d=>{d.key==="Escape"&&i&&i()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[]);const[l,c]=h.useState();return h.useEffect(()=>{let u=!1;return e.getPatches(n).then(d=>{if(!u)if(St.isErr(d)){console.error(d.error);return}else c(d.value)}),()=>{u=!0}},[n]),b.jsx(oM.Provider,{value:Date.now(),children:b.jsxs("div",{className:"flex flex-col items-start justify-start h-full p-8 gap-y-5",children:[l&&r&&b.jsx(s8,{...r8(l,{modules:r.modules,validationErrors:r.validationErrors}),onDeletePatch:u=>{e.deletePatches([u]).then(d=>{if(St.isErr(d)){console.error(d.error);return}c(f=>{const p={...f};for(const m in p){const g=m;p[g]=p[g].filter(y=>u!==y.patch_id)}return p})}).catch(console.error)}}),b.jsxs("div",{className:"flex gap-x-4",children:[b.jsx(Bc,{variant:"secondary",onClick:i,children:"Cancel"}),b.jsx(Bc,{disabled:t||s||!l||!r,onClick:()=>{a(!0),e.postCommit({patches:n}).then(u=>{St.isErr(u)?(console.error(u.error),"validationErrors"in u.error?alert("Cannot commit invalid patches"):alert("Could not commit patches: "+u.error.message)):(console.log("Committed patches: ",u.value),o())}).finally(()=>{a(!1)})},children:s?"Committing...":"Commit"})]})]})})}function s8({history:e,errors:t,onDeletePatch:n}){return b.jsxs("div",{className:"w-full",children:[b.jsx("h2",{className:"mt-10 mb-6 text-xl font-bold",children:"Timeline"}),e.length>0&&b.jsx("ol",{children:e.map((r,o)=>b.jsx("li",{children:b.jsx(d8,{index:o,last:o===e.length-1,defaultOpen:!(e.length>3),onDeletePatch:n,children:r})},o))}),(t==null?void 0:t.errors)&&Object.values(t.errors).some(r=>r.fatalErrors||r.validations&&r.validations.length>0)&&b.jsxs(b.Fragment,{children:[b.jsx("h2",{className:"mt-10 mb-6 text-xl font-bold",children:"Validation Notifications"}),Object.entries((t==null?void 0:t.errors)||{}).map(([r,o])=>(o.fatalErrors&&o.fatalErrors.length>0||o.validations&&o.validations.length>0)&&b.jsx(a8,{moduleId:r,children:o},r))]})]})}function a8({moduleId:e,children:t}){return b.jsxs("div",{className:"mt-6",children:[b.jsxs("div",{children:[b.jsx("span",{children:b.jsx(qr,{children:e})}),t.fatalErrors&&b.jsx("div",{className:"mt-3",children:t.fatalErrors.map((n,r)=>b.jsxs("div",{className:"mt-3",children:[b.jsx(rM,{className:"inline-block mr-2"}),b.jsx("span",{children:n})]},r))})]}),b.jsx("div",{children:t.validations.map((n,r)=>b.jsx(c8,{children:n},r))})]})}function sM({author:e}){return e!=null&&e.avatarUrl?b.jsx("img",{className:"w-8 h-8 border rounded-full border-border",src:e.avatarUrl}):b.jsx("span",{className:"w-8 h-8 text-sm leading-8 text-center border rounded-full border-border",children:(e==null?void 0:e.name)&&f8(e.name)})}const l8=new Intl.DateTimeFormat("en-US",{dateStyle:"short"});function D1(){const e=o8();return h.useCallback(n=>{const r=e-new Date(Number(n)).getTime();if(Math.floor(r/1e3)<60)return"just now";const i=Math.floor(r/1e3/60);if(i<60)return`${i} mins ago`;const s=Math.floor(i/60);if(s<24)return`${s} hours ago`;const a=Math.floor(s/24);if(a<3)return`${a} days ago`;try{return l8.format(new Date(n))}catch(l){console.debug("Val: Error formatting date",l)}},[e])}function c8({children:e}){const[t,n]=h.useState(!1),r=D1();return b.jsx(Vg,{type:"single",collapsible:!0,className:"text-sm",defaultValue:"validation-error",onValueChange:o=>n(o==="validation-error"),children:b.jsxs(Bg,{value:"validation-error",children:[b.jsxs("div",{className:"flex items-center justify-between w-full mt-3",children:[b.jsx("span",{children:b.jsx("span",{className:"min-w-[100px] text-left truncate",dir:"rtl",children:b.jsx(qr,{children:e.path})})}),b.jsxs(Ug,{className:"flex items-center gap-2",children:[b.jsxs("span",{className:"truncate",children:[e.messages.length," messages",e.lastChangedAt&&` • ${r(e.lastChangedAt)} `]}),e.lastChangedBy&&b.jsx(sM,{author:e.lastChangedBy}),b.jsx(Mg,{className:Qt("transition",{"-rotate-180":t})})]})]}),b.jsx(tp,{children:e.messages.map((o,i)=>b.jsx(u8,{children:o},i))})]})})}function u8({children:e}){const[t,n]=h.useState(!1),r=()=>n(o=>!o);return b.jsxs("button",{onClick:r,className:Qt("flex mt-3 gap-4 max-w-full text-left",{truncate:!t}),children:[e.severity==="warning"?b.jsx(e8,{className:"flex-shrink-0 text-warning"}):b.jsx(rM,{className:"flex-shrink-0 text-error"}),e.message]})}function d8({index:e,defaultOpen:t,last:n,children:r,onDeletePatch:o}){const i=D1(),[s,a]=h.useState(t),l=`history-item-${e}`;return b.jsx(Vg,{type:"single",collapsible:!0,defaultValue:t?l:void 0,onValueChange:c=>{a(c===l)},children:b.jsxs(Bg,{value:l,children:[b.jsxs(Ug,{className:"flex items-start justify-between w-full",children:[b.jsx(sM,{author:r.author}),b.jsxs("span",{className:"flex items-center gap-4 text-sm",children:[b.jsxs("span",{children:[r.changeCount," changes",` • ${i(r.lastChangedAt)}`]}),b.jsx(Mg,{className:Qt("transition",{"-rotate-180":s})})]})]}),b.jsxs("ol",{className:"pl-4 mt-4 mb-4 ml-4 border-l border-border",children:[!s&&!n&&b.jsx("div",{className:"h-2"}),b.jsx(tp,{children:r.changes.map((c,u)=>b.jsx("div",{children:b.jsx(p8,{change:c,onDeletePatch:o})},u))})]})]})})}function f8(e){var r;const[t,...n]=e.split(" ");return n.length===0?t.slice(0,2):`${t[0]}${(r=n.slice(-1)[0])==null?void 0:r[0]}`}function p8({change:e,onDeletePatch:t}){const n=D1();return b.jsxs("div",{children:[b.jsx("div",{className:"font-bold",children:b.jsx(qr,{children:e.moduleId})}),b.jsx("ol",{className:"ml-2",children:e.items.map((r,o)=>{var i;return b.jsx("li",{children:b.jsxs("div",{className:"grid grid-cols-3 py-2",children:[b.jsx("span",{children:r.filePath?r.filePath:b.jsx(qr,{children:r.path})}),b.jsx("span",{children:r.type==="replace"?`updated${r.count&&r.count>1?` ${r.count} times`:""}`:r.type==="add"?"added ":r.type==="move"?"moved ":"removed "}),r.changedAt&&b.jsx("div",{children:n(r.changedAt)}),b.jsx(Vg,{type:"single",collapsible:!0,children:b.jsxs(Bg,{value:"patch-ids",children:[b.jsx(Ug,{children:"Show Patch IDs"}),b.jsx(tp,{children:(i=r.patchIds)==null?void 0:i.map(s=>b.jsxs("div",{className:"mr-2",children:[b.jsx("span",{children:s}),b.jsx("button",{onClick:()=>{t(s)},children:b.jsx(sj,{})})]},s))})]})})]})},o)})})]})}function h8({children:e}){return b.jsx("div",{className:"h-full w-full rounded-lg bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg text-primary drop-shadow-2xl",children:e})}function I1(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let yl=I1();function aM(e){yl=e}const lM=/[&<>"']/,m8=new RegExp(lM.source,"g"),cM=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,g8=new RegExp(cM.source,"g"),v8={"&":"&","<":"<",">":">",'"':""","'":"'"},hE=e=>v8[e];function xr(e,t){if(t){if(lM.test(e))return e.replace(m8,hE)}else if(cM.test(e))return e.replace(g8,hE);return e}const y8=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function x8(e){return e.replace(y8,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const b8=/(^|[^\[])\^/g;function it(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(b8,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}function mE(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const vm={exec:()=>null};function gE(e,t){const n=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function Bp(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function w8(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function vE(e,t,n,r){const o=t.href,i=t.title?xr(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:o,title:i,text:xr(s)}}function S8(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
|
67
|
+
`).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[s]=i;return s.length>=r.length?o.slice(r.length):o}).join(`
|
|
68
|
+
`)}class ym{constructor(t){vt(this,"options");vt(this,"rules");vt(this,"lexer");this.options=t||yl}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Bp(r,`
|
|
69
|
+
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=S8(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=Bp(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=Bp(n[0].replace(/^ *>[ \t]?/gm,""),`
|
|
70
|
+
`),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r=n[1].trim();const o=r.length>1,i={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const s=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",l="",c=!1;for(;t;){let u=!1;if(!(n=s.exec(t))||this.rules.block.hr.test(t))break;a=n[0],t=t.substring(a.length);let d=n[2].split(`
|
|
71
|
+
`,1)[0].replace(/^\t+/,v=>" ".repeat(3*v.length)),f=t.split(`
|
|
72
|
+
`,1)[0],p=0;this.options.pedantic?(p=2,l=d.trimStart()):(p=n[2].search(/[^ ]/),p=p>4?1:p,l=d.slice(p),p+=n[1].length);let m=!1;if(!d&&/^ *$/.test(f)&&(a+=f+`
|
|
73
|
+
`,t=t.substring(f.length+1),u=!0),!u){const v=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),x=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),k=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;t;){const E=t.split(`
|
|
74
|
+
`,1)[0];if(f=E,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(f)||k.test(f)||v.test(f)||x.test(t))break;if(f.search(/[^ ]/)>=p||!f.trim())l+=`
|
|
75
|
+
`+f.slice(p);else{if(m||d.search(/[^ ]/)>=4||w.test(d)||k.test(d)||x.test(d))break;l+=`
|
|
76
|
+
`+f}!m&&!f.trim()&&(m=!0),a+=E+`
|
|
77
|
+
`,t=t.substring(E.length+1),d=f.slice(p)}}i.loose||(c?i.loose=!0:/\n *\n *$/.test(a)&&(c=!0));let g=null,y;this.options.gfm&&(g=/^\[[ xX]\] /.exec(l),g&&(y=g[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!g,checked:y,loose:!1,text:l,tokens:[]}),i.raw+=a}i.items[i.items.length-1].raw=a.trimEnd(),i.items[i.items.length-1].text=l.trimEnd(),i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){const d=i.items[u].tokens.filter(p=>p.type==="space"),f=d.length>0&&d.some(p=>/\n.*\n/.test(p.raw));i.loose=f}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}html(t){const n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),o=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:i}}}table(t){const n=this.rules.block.table.exec(t);if(n){if(!/[:|]/.test(n[2]))return;const r={type:"table",raw:n[0],header:gE(n[1]).map(o=>({text:o,tokens:[]})),align:n[2].replace(/^\||\| *$/g,"").split("|"),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
|
|
78
|
+
`):[]};if(r.header.length===r.align.length){let o=r.align.length,i,s,a,l;for(i=0;i<o;i++){const c=r.align[i];c&&(/^ *-+: *$/.test(c)?r.align[i]="right":/^ *:-+: *$/.test(c)?r.align[i]="center":/^ *:-+ *$/.test(c)?r.align[i]="left":r.align[i]=null)}for(o=r.rows.length,i=0;i<o;i++)r.rows[i]=gE(r.rows[i],r.header.length).map(c=>({text:c,tokens:[]}));for(o=r.header.length,s=0;s<o;s++)r.header[s].tokens=this.lexer.inline(r.header[s].text);for(o=r.rows.length,s=0;s<o;s++)for(l=r.rows[s],a=0;a<l.length;a++)l[a].tokens=this.lexer.inline(l[a].text);return r}}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===`
|
|
79
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:xr(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const s=Bp(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{const s=w8(n[2],"()");if(s>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+s;n[2]=n[2].substring(0,s),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),vE(n,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let o=(r[2]||r[1]).replace(/\s+/g," ");if(o=n[o.toLowerCase()],!o){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return vE(r,o,r[0],this.lexer)}}emStrong(t,n,r=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const s=[...o[0]].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+s);(o=d.exec(n))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=[...a].length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=[...o[0]][0].length,p=t.slice(0,s+o.index+f+l);if(Math.min(s,l)%2){const g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}const m=p.slice(2,-2);return{type:"strong",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=xr(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){const n=this.rules.inline.autolink.exec(t);if(n){let r,o;return n[2]==="@"?(r=xr(n[1]),o="mailto:"+r):(r=xr(n[1]),o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let r,o;if(n[2]==="@")r=xr(n[0]),o="mailto:"+r;else{let i;do i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(i!==n[0]);r=xr(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){const n=this.rules.inline.text.exec(t);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=xr(n[0]),{type:"text",raw:n[0],text:r}}}}const me={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:vm,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;me.def=it(me.def).replace("label",me._label).replace("title",me._title).getRegex();me.bullet=/(?:[*+-]|\d{1,9}[.)])/;me.listItemStart=it(/^( *)(bull) */).replace("bull",me.bullet).getRegex();me.list=it(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex();me._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";me._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;me.html=it(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();me.lheading=it(me.lheading).replace(/bull/g,me.bullet).getRegex();me.paragraph=it(me._paragraph).replace("hr",me.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex();me.blockquote=it(me.blockquote).replace("paragraph",me.paragraph).getRegex();me.normal={...me};me.gfm={...me.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};me.gfm.table=it(me.gfm.table).replace("hr",me.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex();me.gfm.paragraph=it(me._paragraph).replace("hr",me.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",me.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex();me.pedantic={...me.normal,html:it(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vm,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^
|
|
80
|
+
]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const ne={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:vm,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:vm,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};ne._punctuation="\\p{P}$+<=>`^|~";ne.punctuation=it(ne.punctuation,"u").replace(/punctuation/g,ne._punctuation).getRegex();ne.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;ne.anyPunctuation=/\\[punct]/g;ne._escapes=/\\([punct])/g;ne._comment=it(me._comment).replace("(?:-->|$)","-->").getRegex();ne.emStrong.lDelim=it(ne.emStrong.lDelim,"u").replace(/punct/g,ne._punctuation).getRegex();ne.emStrong.rDelimAst=it(ne.emStrong.rDelimAst,"gu").replace(/punct/g,ne._punctuation).getRegex();ne.emStrong.rDelimUnd=it(ne.emStrong.rDelimUnd,"gu").replace(/punct/g,ne._punctuation).getRegex();ne.anyPunctuation=it(ne.anyPunctuation,"gu").replace(/punct/g,ne._punctuation).getRegex();ne._escapes=it(ne._escapes,"gu").replace(/punct/g,ne._punctuation).getRegex();ne._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;ne._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;ne.autolink=it(ne.autolink).replace("scheme",ne._scheme).replace("email",ne._email).getRegex();ne._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;ne.tag=it(ne.tag).replace("comment",ne._comment).replace("attribute",ne._attribute).getRegex();ne._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;ne._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;ne._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;ne.link=it(ne.link).replace("label",ne._label).replace("href",ne._href).replace("title",ne._title).getRegex();ne.reflink=it(ne.reflink).replace("label",ne._label).replace("ref",me._label).getRegex();ne.nolink=it(ne.nolink).replace("ref",me._label).getRegex();ne.reflinkSearch=it(ne.reflinkSearch,"g").replace("reflink",ne.reflink).replace("nolink",ne.nolink).getRegex();ne.normal={...ne};ne.pedantic={...ne.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",ne._label).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne._label).getRegex()};ne.gfm={...ne.normal,escape:it(ne.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};ne.gfm.url=it(ne.gfm.url,"i").replace("email",ne.gfm._extended_email).getRegex();ne.breaks={...ne.gfm,br:it(ne.br).replace("{2,}","*").getRegex(),text:it(ne.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class qo{constructor(t){vt(this,"tokens");vt(this,"options");vt(this,"state");vt(this,"tokenizer");vt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||yl,this.options.tokenizer=this.options.tokenizer||new ym,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:me.normal,inline:ne.normal};this.options.pedantic?(n.block=me.pedantic,n.inline=ne.pedantic):this.options.gfm&&(n.block=me.gfm,this.options.breaks?n.inline=ne.breaks:n.inline=ne.gfm),this.tokenizer.rules=n}static get rules(){return{block:me,inline:ne}}static lex(t,n){return new qo(n).lex(t)}static lexInline(t,n){return new qo(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
|
81
|
+
`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let r,o,i,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
|
|
82
|
+
`:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
|
|
83
|
+
`+r.raw,o.text+=`
|
|
84
|
+
`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
|
|
85
|
+
`+r.raw,o.text+=`
|
|
86
|
+
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const l=t.slice(1);let c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(i=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){o=n[n.length-1],s&&o.type==="paragraph"?(o.raw+=`
|
|
87
|
+
`+r.raw,o.text+=`
|
|
88
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r),s=i.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&o.type==="text"?(o.raw+=`
|
|
89
|
+
`+r.raw,o.text+=`
|
|
90
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,o,i,s=t,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(r=u.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,s,c)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(r=this.tokenizer.inlineText(i)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=r.raw.slice(-1)),l=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}}class xm{constructor(t){vt(this,"options");this.options=t||yl}code(t,n,r){var i;const o=(i=(n||"").match(/^\S*/))==null?void 0:i[0];return t=t.replace(/\n$/,"")+`
|
|
91
|
+
`,o?'<pre><code class="language-'+xr(o)+'">'+(r?t:xr(t,!0))+`</code></pre>
|
|
92
|
+
`:"<pre><code>"+(r?t:xr(t,!0))+`</code></pre>
|
|
93
|
+
`}blockquote(t){return`<blockquote>
|
|
94
|
+
${t}</blockquote>
|
|
95
|
+
`}html(t,n){return t}heading(t,n,r){return`<h${n}>${t}</h${n}>
|
|
96
|
+
`}hr(){return`<hr>
|
|
97
|
+
`}list(t,n,r){const o=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+o+i+`>
|
|
98
|
+
`+t+"</"+o+`>
|
|
99
|
+
`}listitem(t,n,r){return`<li>${t}</li>
|
|
100
|
+
`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>
|
|
101
|
+
`}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
102
|
+
<thead>
|
|
103
|
+
`+t+`</thead>
|
|
104
|
+
`+n+`</table>
|
|
105
|
+
`}tablerow(t){return`<tr>
|
|
106
|
+
${t}</tr>
|
|
107
|
+
`}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
|
|
108
|
+
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){const o=mE(t);if(o===null)return r;t=o;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){const o=mE(t);if(o===null)return r;t=o;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=">",i}text(t){return t}}class L1{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class Go{constructor(t){vt(this,"options");vt(this,"renderer");vt(this,"textRenderer");this.options=t||yl,this.options.renderer=this.options.renderer||new xm,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new L1}static parse(t,n){return new Go(n).parse(t)}static parseInline(t,n){return new Go(n).parseInline(t)}parse(t,n=!0){let r="";for(let o=0;o<t.length;o++){const i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const s=i,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){r+=a||"";continue}}switch(i.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{const s=i;r+=this.renderer.heading(this.parseInline(s.tokens),s.depth,x8(this.parseInline(s.tokens,this.textRenderer)));continue}case"code":{const s=i;r+=this.renderer.code(s.text,s.lang,!!s.escaped);continue}case"table":{const s=i;let a="",l="";for(let u=0;u<s.header.length;u++)l+=this.renderer.tablecell(this.parseInline(s.header[u].tokens),{header:!0,align:s.align[u]});a+=this.renderer.tablerow(l);let c="";for(let u=0;u<s.rows.length;u++){const d=s.rows[u];l="";for(let f=0;f<d.length;f++)l+=this.renderer.tablecell(this.parseInline(d[f].tokens),{header:!1,align:s.align[f]});c+=this.renderer.tablerow(l)}r+=this.renderer.table(a,c);continue}case"blockquote":{const s=i,a=this.parse(s.tokens);r+=this.renderer.blockquote(a);continue}case"list":{const s=i,a=s.ordered,l=s.start,c=s.loose;let u="";for(let d=0;d<s.items.length;d++){const f=s.items[d],p=f.checked,m=f.task;let g="";if(f.task){const y=this.renderer.checkbox(!!p);c?f.tokens.length>0&&f.tokens[0].type==="paragraph"?(f.tokens[0].text=y+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&f.tokens[0].tokens[0].type==="text"&&(f.tokens[0].tokens[0].text=y+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:y+" "}):g+=y+" "}g+=this.parse(f.tokens,c),u+=this.renderer.listitem(g,m,!!p)}r+=this.renderer.list(u,a,l);continue}case"html":{const s=i;r+=this.renderer.html(s.text,s.block);continue}case"paragraph":{const s=i;r+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=i,a=s.tokens?this.parseInline(s.tokens):s.text;for(;o+1<t.length&&t[o+1].type==="text";)s=t[++o],a+=`
|
|
109
|
+
`+(s.tokens?this.parseInline(s.tokens):s.text);r+=n?this.renderer.paragraph(a):a;continue}default:{const s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}parseInline(t,n){n=n||this.renderer;let r="";for(let o=0;o<t.length;o++){const i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=s||"";continue}}switch(i.type){case"escape":{const s=i;r+=n.text(s.text);break}case"html":{const s=i;r+=n.html(s.text);break}case"link":{const s=i;r+=n.link(s.href,s.title,this.parseInline(s.tokens,n));break}case"image":{const s=i;r+=n.image(s.href,s.title,s.text);break}case"strong":{const s=i;r+=n.strong(this.parseInline(s.tokens,n));break}case"em":{const s=i;r+=n.em(this.parseInline(s.tokens,n));break}case"codespan":{const s=i;r+=n.codespan(s.text);break}case"br":{r+=n.br();break}case"del":{const s=i;r+=n.del(this.parseInline(s.tokens,n));break}case"text":{const s=i;r+=n.text(s.text);break}default:{const s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}}class Md{constructor(t){vt(this,"options");this.options=t||yl}preprocess(t){return t}postprocess(t){return t}}vt(Md,"passThroughHooks",new Set(["preprocess","postprocess"]));var Hf,vx,ag,uM;class k8{constructor(...t){Bv(this,Hf);Bv(this,ag);vt(this,"defaults",I1());vt(this,"options",this.setOptions);vt(this,"parse",bp(this,Hf,vx).call(this,qo.lex,Go.parse));vt(this,"parseInline",bp(this,Hf,vx).call(this,qo.lexInline,Go.parseInline));vt(this,"Parser",Go);vt(this,"Renderer",xm);vt(this,"TextRenderer",L1);vt(this,"Lexer",qo);vt(this,"Tokenizer",ym);vt(this,"Hooks",Md);this.use(...t)}walkTokens(t,n){var o,i;let r=[];for(const s of t)switch(r=r.concat(n.call(this,s)),s.type){case"table":{const a=s;for(const l of a.header)r=r.concat(this.walkTokens(l.tokens,n));for(const l of a.rows)for(const c of l)r=r.concat(this.walkTokens(c.tokens,n));break}case"list":{const a=s;r=r.concat(this.walkTokens(a.items,n));break}default:{const a=s;(i=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{r=r.concat(this.walkTokens(a[l],n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const s=n.renderers[i.name];s?n.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=n[i.level];s?s.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),o.extensions=n),r.renderer){const i=this.defaults.renderer||new xm(this.defaults);for(const s in r.renderer){const a=r.renderer[s],l=s,c=i[l];i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d||""}}o.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new ym(this.defaults);for(const s in r.tokenizer){const a=r.tokenizer[s],l=s,c=i[l];i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new Md;for(const s in r.hooks){const a=r.hooks[s],l=s,c=i[l];Md.passThroughHooks.has(s)?i[l]=u=>{if(this.defaults.async)return Promise.resolve(a.call(i,u)).then(f=>c.call(i,f));const d=a.call(i,u);return c.call(i,d)}:i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,s=r.walkTokens;o.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return qo.lex(t,n??this.defaults)}parser(t,n){return Go.parse(t,n??this.defaults)}}Hf=new WeakSet,vx=function(t,n){return(r,o)=>{const i={...o},s={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const a=bp(this,ag,uM).call(this,!!s.silent,!!s.async);if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(r):r).then(l=>t(l,s)).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>n(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));const l=t(r,s);s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=n(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(l){return a(l)}}},ag=new WeakSet,uM=function(t,n){return r=>{if(r.message+=`
|
|
110
|
+
Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An error occurred:</p><pre>"+xr(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}};const rl=new k8;function dt(e,t){return rl.parse(e,t)}dt.options=dt.setOptions=function(e){return rl.setOptions(e),dt.defaults=rl.defaults,aM(dt.defaults),dt};dt.getDefaults=I1;dt.defaults=yl;dt.use=function(...e){return rl.use(...e),dt.defaults=rl.defaults,aM(dt.defaults),dt};dt.walkTokens=function(e,t){return rl.walkTokens(e,t)};dt.parseInline=rl.parseInline;dt.Parser=Go;dt.parser=Go.parse;dt.Renderer=xm;dt.TextRenderer=L1;dt.Lexer=qo;dt.lexer=qo.lex;dt.Tokenizer=ym;dt.Hooks=Md;dt.parse=dt;dt.options;dt.setOptions;dt.use;dt.walkTokens;dt.parseInline;Go.parse;const E8=qo.lex;function dM(e){return v1(e)}function yx(e,t){if(e===t)return!0;if(ye(e)==="object"&&ye(t)==="object"&&e!==null&&t!==null){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!yx(e[n],t[n]))return!1;return!0}else if(!Array.isArray(e)&&!Array.isArray(t)){var r=Object.entries(e);if(r.length!==Object.keys(t).length)return!1;for(var o=0,i=r;o<i.length;o++){var s=Kn(i[o],2),a=s[0],l=s[1],c=t[a];if(c===void 0||!yx(l,c))return!1}return!0}}return!1}function xx(e){return Array.isArray(e)?e.map(xx):ye(e)==="object"&&e!==null?Object.fromEntries(Object.entries(e).map(function(t){var n=Kn(t,2),r=n[0],o=n[1];return[r,xx(o)]})):e}function j1(e){return/^(0|[1-9][0-9]*)$/g.test(e)?_n(Number(e)):Vt(new Tr('Invalid array index "'.concat(e,'"')))}function _8(e,t){return e==="-"?_n(t.length):dn(j1(e),Cg(function(n){return n<=t.length},function(){return new Tr("Array index out of bounds")}))}function fM(e,t){return dn(j1(e),Cg(function(n){return n<t.length},function(){return new Tr("Array index out of bounds")}))}function C8(e,t,n){if(Array.isArray(e))return dn(fM(t,e),Hr(function(o){var i=e[o];return e[o]=n,i}));if(ye(e)==="object"&&e!==null)if(Object.prototype.hasOwnProperty.call(e,t)){var r=e[t];return e[t]=n,_n(r)}else return console.log({node:e}),Vt(new Tr("Cannot replace object element which does not exist"));return Vt(new Tr("Cannot replace in non-object/array"))}function O8(e,t,n){return dM(t)?dn(z1(e,t),Ja(function(r){var o=Kn(r,2),i=o[0],s=o[1];return C8(i,s,n)}),Hr(function(r){return[e,r]})):_n([n,e])}function pM(e,t){return Array.isArray(e)?dn(j1(t),Ja(function(n){return n>=e.length?Vt(new Tr("Array index out of bounds")):_n(e[n])})):ye(e)==="object"&&e!==null?Object.prototype.hasOwnProperty.call(e,t)?_n(e[t]):_n(void 0):Vt(new Tr("Cannot access non-object/array"))}function z1(e,t){for(var n=e,r=t[0],o=0;o<t.length-1;++o,r=t[o]){var i=pM(n,r);if(_g(i))return i;if(i.value===void 0)return Vt(new Tr("Path refers to non-existing object/array"));n=i.value}return _n([n,r])}function yy(e,t){return dn(t,y1(function(n,r){return dn(pM(n,r),Cg(function(o){return o!==void 0},function(){return new Tr("Path refers to non-existing object/array")}))},e))}function T8(e,t){if(Array.isArray(e))return dn(fM(t,e),Hr(function(r){var o=e.splice(r,1),i=Kn(o,1),s=i[0];return s}));if(ye(e)==="object"&&e!==null&&Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];return delete e[t],_n(n)}return Vt(new Tr("Cannot remove from non-object/array"))}function yE(e,t){return dn(z1(e,t),Ja(function(n){var r=Kn(n,2),o=r[0],i=r[1];return T8(o,i)}))}function P8(e,t,n){if(Array.isArray(e))return dn(_8(t,e),Hr(function(o){e.splice(o,0,n)}));if(ye(e)==="object"&&e!==null){var r;return Object.prototype.hasOwnProperty.call(e,t)&&(r=e[t]),e[t]=n,_n(r)}return Vt(new Tr("Cannot add to non-object/array"))}function xy(e,t,n){return dM(t)?dn(z1(e,t),Ja(function(r){var o=Kn(r,2),i=o[0],s=o[1];return P8(i,s,n)}),Hr(function(r){return[e,r]})):_n([n,e])}function Up(e){var t=Kn(e,1),n=t[0];return n}var M8=function(){function e(){nn(this,e)}return rn(e,[{key:"get",value:function(n,r){return yy(n,r)}},{key:"add",value:function(n,r,o){return dn(xy(n,r,o),Hr(Up))}},{key:"remove",value:function(n,r){return dn(yE(n,r),Hr(function(){return n}))}},{key:"replace",value:function(n,r,o){return dn(O8(n,r,o),Hr(Up))}},{key:"move",value:function(n,r,o){return dn(yE(n,r),Ja(function(i){return xy(n,o,i)}),Hr(Up))}},{key:"copy",value:function(n,r,o){return dn(yy(n,r),Ja(function(i){return xy(n,o,xx(i))}),Hr(Up))}},{key:"test",value:function(n,r,o){return dn(yy(n,r),Hr(function(i){return yx(o,i)}))}}]),e}();function R8(e,t,n){switch(n.op){case"add":return t.add(e,n.path,n.value);case"remove":return t.remove(e,n.path);case"replace":return t.replace(e,n.path,n.value);case"move":return t.move(e,n.from,n.path);case"copy":return t.copy(e,n.from,n.path);case"test":return t.test(e,n.path,n.value)?_n(e):Vt(new Tr("Test failed"));case"file":return Vt(new Tr("Cannot apply a file patch here"))}}function N8(e,t,n){return dn(n,y1(function(r,o){return R8(r,t,o)},e))}function $8(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hM(e){var t=$8(e,"string");return typeof t=="symbol"?t:String(t)}function Wt(e,t,n){return t=hM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bx(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function F1(e,t){if(e){if(typeof e=="string")return bx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bx(e,t)}}function B1(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=F1(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
111
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,a;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function A8(e){if(Array.isArray(e))return bx(e)}function D8(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function I8(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
112
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mf(e){return A8(e)||D8(e)||F1(e)||I8()}function L8(e){if(Array.isArray(e))return e}function j8(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function z8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
113
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wx(e,t){return L8(e)||j8(e,t)||F1(e,t)||z8()}var mM={x3d:"application/vnd.hzn-3d-crossword","3gp":"video/3gpp","3g2":"video/3gpp2",mseq:"application/vnd.mseq",pwn:"application/vnd.3m.post-it-notes",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",acc:"application/vnd.americandynamics.acc",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",adp:"audio/adpcm",aab:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",air:"application/vnd.adobe.air-application-installer-package+zip",swf:"application/x-shockwave-flash",fxp:"application/vnd.adobe.fxp",pdf:"application/pdf",ppd:"application/vnd.cups-ppd",dir:"application/x-director",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",aac:"audio/x-aac",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",ami:"application/vnd.amiga.ami","N/A":"application/andrew-inset",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",dmg:"application/x-apple-diskimage",mpkg:"application/vnd.apple.installer+xml",aw:"application/applixware",mp3:"audio/mpeg",les:"application/vnd.hhe.lesson-player",swi:"application/vnd.aristanetworks.swi",s:"text/x-asm",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",atom:"application/atom+xml",ac:"application/pkix-attr-cert",aif:"audio/x-aiff",avi:"video/x-msvideo",aep:"application/vnd.audiograph",dxf:"image/vnd.dxf",dwf:"model/vnd.dwf",par:"text/plain-bas",bcpio:"application/x-bcpio",bin:"application/octet-stream",bmp:"image/bmp",torrent:"application/x-bittorrent",cod:"application/vnd.rim.cod",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",sh:"application/x-sh",btif:"image/prs.btif",rep:"application/vnd.businessobjects",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",c:"text/x-c",cdxml:"application/vnd.chemdraw+xml",css:"text/css",cdx:"chemical/x-cdx",cml:"chemical/x-cml",csml:"chemical/x-csml",cdbcmsg:"application/vnd.contact.cmsg",cla:"application/vnd.claymore",c4g:"application/vnd.clonk.c4group",sub:"image/vnd.dvb.subtitle",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",ras:"image/x-cmu-raster",dae:"model/vnd.collada+xml",csv:"text/csv",cpt:"application/mac-compactpro",wmlc:"application/vnd.wap.wmlc",cgm:"image/cgm",ice:"x-conference/x-cooltalk",cmx:"image/x-cmx",xar:"application/vnd.xara",cmc:"application/vnd.cosmocaller",cpio:"application/x-cpio",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",cryptonote:"application/vnd.rig.cryptonote",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cu:"application/cu-seeme",cww:"application/prs.cww",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",mcurl:"text/vnd.curl.mcurl",scurl:"text/vnd.curl.scurl",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",cmp:"application/vnd.yellowriver-custom-menu",dssc:"application/dssc+der",xdssc:"application/dssc+xml",deb:"application/x-debian-package",uva:"audio/vnd.dece.audio",uvi:"image/vnd.dece.graphic",uvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvu:"video/vnd.uvvu.mp4",uvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",dvi:"application/x-dvi",seed:"application/vnd.fdsn.seed",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",eol:"audio/vnd.digital-winds",djvu:"image/vnd.djvu",dtd:"application/xml-dtd",mlp:"application/vnd.dolby.mlp",wad:"application/x-doom",dpg:"application/vnd.dpgraph",dra:"audio/vnd.dra",dfac:"application/vnd.dreamfactory",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",dwg:"image/vnd.dwg",geo:"application/vnd.dynageo",es:"application/ecmascript",mag:"application/vnd.ecowin.chart",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",exi:"application/exi",mgz:"application/vnd.proteus.magazine",epub:"application/epub+zip",eml:"message/rfc822",nml:"application/vnd.enliven",xpr:"application/vnd.is-xpr",xif:"image/vnd.xiff",xfdl:"application/vnd.xfdl",emma:"application/emma+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fst:"image/vnd.fst",fvt:"video/vnd.fvt",fbs:"image/vnd.fastbidsheet",fe_launch:"application/vnd.denovo.fcselayout-link",f4v:"video/x-f4v",flv:"video/x-flv",fpx:"image/vnd.fpx",npx:"image/vnd.net-fpx",flx:"text/vnd.fmi.flexstor",fli:"video/x-fli",ftc:"application/vnd.fluxtime.clip",fdf:"application/vnd.fdf",f:"text/x-fortran",mif:"application/vnd.mif",fm:"application/vnd.framemaker",fh:"image/x-freehand",fsc:"application/vnd.fsc.weblaunch",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",spl:"application/x-futuresplash",fzs:"application/vnd.fuzzysheet",g3:"image/g3fax",gmx:"application/vnd.gmx",gtw:"model/vnd.gtw",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gdl:"model/vnd.gdl",gex:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gsf:"application/x-font-ghostscript",bdf:"application/x-font-bdf",gtar:"application/x-gtar",texinfo:"application/x-texinfo",gnumeric:"application/x-gnumeric",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gif:"image/gif",gv:"text/vnd.graphviz",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",h261:"video/h261",h263:"video/h263",h264:"video/h264",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",hdf:"application/x-hdf",rip:"audio/vnd.rip",hbci:"application/vnd.hbci",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",hpgl:"application/vnd.hp-hpgl",hvs:"application/vnd.yamaha.hv-script",hvd:"application/vnd.yamaha.hv-dic",hvp:"application/vnd.yamaha.hv-voice","sfd-hdstx":"application/vnd.hydrostatix.sof-data",stk:"application/hyperstudio",hal:"application/vnd.hal+xml",html:"text/html",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",ics:"text/calendar",icc:"application/vnd.iccprofile",ico:"image/x-icon",igl:"application/vnd.igloader",ief:"image/ief",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",rif:"application/reginfo+xml","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",igs:"model/iges",i2g:"application/vnd.intergeo",cdy:"application/vnd.cinderella",xpw:"application/vnd.intercon.formnet",fcs:"application/vnd.isac.fcs",ipfix:"application/ipfix",cer:"application/pkix-cert",pki:"application/pkixcmp",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",igm:"application/vnd.insors.igm",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",jad:"text/vnd.sun.j2me.app-descriptor",jar:"application/java-archive",class:"application/java-vm",jnlp:"application/x-java-jnlp-file",ser:"application/java-serialized-object",java:"text/x-java-source,java",js:"application/javascript",json:"application/json",joda:"application/vnd.joost.joda-archive",jpm:"video/jpm",jpeg:"image/jpeg",jpg:"image/jpeg",pjpeg:"image/pjpeg",jpgv:"video/jpeg",ktz:"application/vnd.kahootz",mmd:"application/vnd.chipnuts.karaoke-mmd",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",latex:"application/x-latex",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",jam:"application/vnd.jam",123:"application/vnd.lotus-1-2-3",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",lvp:"audio/vnd.lucent.voice",m3u:"audio/x-mpegurl",m4v:"video/x-m4v",hqx:"application/mac-binhex40",portpkg:"application/vnd.macports.portpkg",mgp:"application/vnd.osgeo.mapguide.package",mrc:"application/marc",mrcx:"application/marcxml+xml",mxf:"application/mxf",nbp:"application/vnd.wolfram.player",ma:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mc1:"application/vnd.medcalcdata",mscml:"application/mediaservercontrol+xml",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",msh:"model/mesh",mads:"application/mads+xml",mets:"application/mets+xml",mods:"application/mods+xml",meta4:"application/metalink4+xml",mcd:"application/vnd.mcd",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",es3:"application/vnd.eszigno3+xml",mdb:"application/x-msaccess",asf:"video/x-ms-asf",exe:"application/x-msdownload",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",ims:"application/vnd.ms-ims",application:"application/x-ms-application",clp:"application/x-msclip",mdi:"image/vnd.ms-modi",eot:"application/vnd.ms-fontobject",xls:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",chm:"application/vnd.ms-htmlhelp",crd:"application/x-mscardfile",lrm:"application/vnd.ms-lrm",mvb:"application/x-msmediaview",mny:"application/x-msmoney",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",obd:"application/x-msbinder",thmx:"application/vnd.ms-officetheme",onetoc:"application/onenote",pya:"audio/vnd.ms-playready.media.pya",pyv:"video/vnd.ms-playready.media.pyv",ppt:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",pub:"application/x-mspublisher",scd:"application/x-msschedule",xap:"application/x-silverlight-app",stl:"application/vnd.ms-pki.stl",cat:"application/vnd.ms-pki.seccat",vsd:"application/vnd.visio",vsdx:"application/vnd.visio2013",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wax:"audio/x-ms-wax",wmx:"video/x-ms-wmx",wmd:"application/x-ms-wmd",wpl:"application/vnd.ms-wpl",wmz:"application/x-ms-wmz",wmv:"video/x-ms-wmv",wvx:"video/x-ms-wvx",wmf:"application/x-msmetafile",trm:"application/x-msterminal",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wri:"application/x-mswrite",wps:"application/vnd.ms-works",xbap:"application/x-ms-xbap",xps:"application/vnd.ms-xpsdocument",mid:"audio/midi",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",rms:"application/vnd.jcp.javame.midlet-rms",tmo:"application/vnd.tmobile-livetv",prc:"application/x-mobipocket-ebook",mbk:"application/vnd.mobius.mbk",dis:"application/vnd.mobius.dis",plc:"application/vnd.mobius.plc",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",txf:"application/vnd.mobius.txf",daf:"application/vnd.mobius.daf",fly:"text/vnd.fly",mpc:"application/vnd.mophun.certificate",mpn:"application/vnd.mophun.application",mj2:"video/mj2",mpga:"audio/mpeg",mxu:"video/vnd.mpegurl",mpeg:"video/mpeg",m21:"application/mp21",mp4a:"audio/mp4",mp4:"video/mp4",m3u8:"application/vnd.apple.mpegurl",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",mxml:"application/xv+xml",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",ncx:"application/x-dtbncx+xml",nc:"application/x-netcdf",nlu:"application/vnd.neurolanguage.nlu",dna:"application/vnd.dna",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",n3:"text/n3",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",gph:"application/vnd.flographit",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",oda:"application/oda",ogx:"application/ogg",oga:"audio/ogg",ogv:"video/ogg",dd2:"application/vnd.oma.dd2+xml",oth:"application/vnd.oasis.opendocument.text-web",opf:"application/oebps-package+xml",qbo:"application/vnd.intu.qbo",oxt:"application/vnd.openofficeorg.extension",osf:"application/vnd.yamaha.openscoreformat",weba:"audio/webm",webm:"video/webm",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",ktx:"image/ktx",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",otf:"application/x-font-otf",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",dp:"application/vnd.osgi.dp",pdb:"application/vnd.palm",p:"text/x-pascal",paw:"application/vnd.pawaafile",pclxl:"application/vnd.hp-pclxl",efif:"application/vnd.picsel",pcx:"image/x-pcx",psd:"image/vnd.adobe.photoshop",prf:"application/pics-rules",pic:"image/x-pict",chat:"application/x-chat",p10:"application/pkcs10",p12:"application/x-pkcs12",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p7r:"application/x-pkcs7-certreqresp",p7b:"application/x-pkcs7-certificates",p8:"application/pkcs8",plf:"application/vnd.pocketlearn",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pcf:"application/x-font-pcf",pfr:"application/font-tdpfr",pgn:"application/x-chess-pgn",pgm:"image/x-portable-graymap",png:"image/png",ppm:"image/x-portable-pixmap",pskcxml:"application/pskc+xml",pml:"application/vnd.ctc-posml",ai:"application/postscript",pfa:"application/x-font-type1",pbd:"application/vnd.powerbuilder6",pgp:"application/pgp-signature",box:"application/vnd.previewsystems.box",ptid:"application/vnd.pvi.ptid1",pls:"application/pls+xml",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",dsc:"text/prs.lines.tag",psf:"application/x-font-linux-psf",qps:"application/vnd.publishare-delta-tree",wg:"application/vnd.pmi.widget",qxd:"application/vnd.quark.quarkxpress",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",ssf:"application/vnd.epson.ssf",qam:"application/vnd.epson.quickanime",qfx:"application/vnd.intu.qfx",qt:"video/quicktime",rar:"application/x-rar-compressed",ram:"audio/x-pn-realaudio",rmp:"audio/x-pn-realaudio-plugin",rsd:"application/rsd+xml",rm:"application/vnd.rn-realmedia",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",rnc:"application/relax-ng-compact-syntax",rdz:"application/vnd.data-vision.rdz",rdf:"application/rdf+xml",rp9:"application/vnd.cloanto.rp9",jisp:"application/vnd.jisp",rtf:"application/rtf",rtx:"text/richtext",link66:"application/vnd.route66.link66+xml",rss:"application/rss+xml",shf:"application/shf+xml",st:"application/vnd.sailingtracker.track",svg:"image/svg+xml",sus:"application/vnd.sus-calendar",sru:"application/sru+xml",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",see:"application/vnd.seemail",snf:"application/x-font-snf",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",sdp:"application/sdp",etx:"text/x-setext",movie:"video/x-sgi-movie",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",tfi:"application/thraud+xml",shar:"application/x-shar",rgb:"image/x-rgb",slt:"application/vnd.epson.salt",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",twd:"application/vnd.simtech-mindmapper",csp:"application/vnd.commonspace",saf:"application/vnd.yamaha.smaf-audio",mmf:"application/vnd.smaf",spf:"application/vnd.yamaha.smaf-phrase",teacher:"application/vnd.smart.teacher",svd:"application/vnd.svd",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",ssml:"application/ssml+xml",skp:"application/vnd.koan",sgml:"text/sgml",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",sm:"application/vnd.stepmania.stepchart",sit:"application/x-stuffit",sitx:"application/x-stuffitx",sdkm:"application/vnd.solent.sdkm+xml",xo:"application/vnd.olpc-sugar",au:"audio/basic",wqd:"application/vnd.wqd",sis:"application/vnd.symbian.install",smi:"application/smil+xml",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",sbml:"application/sbml+xml",tsv:"text/tab-separated-values",tiff:"image/tiff",tao:"application/vnd.tao.intent-module-archive",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",tei:"application/tei+xml",txt:"text/plain",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",tsd:"application/timestamped-data",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",t:"text/troff",tra:"application/vnd.trueapp",ttf:"application/x-font-ttf",ttl:"text/turtle",umj:"application/vnd.umajin",uoml:"application/vnd.uoml+xml",unityweb:"application/vnd.unity",ufd:"application/vnd.ufdl",uri:"text/uri-list",utz:"application/vnd.uiq.theme",ustar:"application/x-ustar",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard",vcd:"application/x-cdlink",vsf:"application/vnd.vsf",wrl:"model/vrml",vcx:"application/vnd.vcx",mts:"model/vnd.mts",vtu:"model/vnd.vtu",vis:"application/vnd.visionary",viv:"video/vnd.vivo",ccxml:"application/ccxml+xml,",vxml:"application/voicexml+xml",src:"application/x-wais-source",wbxml:"application/vnd.wap.wbxml",wbmp:"image/vnd.wap.wbmp",wav:"audio/x-wav",davmount:"application/davmount+xml",woff:"application/x-font-woff",wspolicy:"application/wspolicy+xml",webp:"image/webp",wtb:"application/vnd.webturbo",wgt:"application/widget",hlp:"application/winhlp",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wpd:"application/vnd.wordperfect",stf:"application/vnd.wt.stf",wsdl:"application/wsdl+xml",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",der:"application/x-x509-ca-cert",fig:"application/x-xfig",xhtml:"application/xhtml+xml",xml:"application/xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xer:"application/patch-ops-error+xml",rl:"application/resource-lists+xml",rs:"application/rls-services+xml",rld:"application/resource-lists-diff+xml",xslt:"application/xslt+xml",xop:"application/xop+xml",xpi:"application/x-xpinstall",xspf:"application/xspf+xml",xul:"application/vnd.mozilla.xul+xml",xyz:"chemical/x-xyz",yaml:"text/yaml",yang:"application/yang",yin:"application/yin+xml",zir:"application/vnd.zul",zip:"application/zip",zmm:"application/vnd.handheld-entertainment+xml",zaz:"application/vnd.zzazz.deck+xml"},F8=Object.fromEntries(Object.entries(mM).map(function(e){var t=wx(e,2),n=t[0],r=t[1];return[r,n]})),B8=/^data:(.*?);base64,/;function Hg(e){var t=B8.exec(e);if(t&&t[1])return t[1]}function Wg(e){var t=F8[e];return t||e.split("/")[1]}function U8(e){var t=e.split(".").pop(),n=t&&mM[t];if(n)return n}function V8(e){var t={},n=e.content.map(function(r){return H8(r,t)});return W8(n,t)}function H8(e,t){if(e.type==="heading"){var n,r,o="",i=((n=e.attrs)===null||n===void 0?void 0:n.level)||1;if(Number.isNaN(i))throw new Error("Invalid header depth");for(var s=0;s<Number(i);s++)o+="#";var a=["".concat(o," ")];return{type:"block",children:a.concat.apply(a,mf(((r=e.content)===null||r===void 0?void 0:r.map(function(d){return Sx(d,t)}))||[]))}}else if(e.type==="paragraph"){var l;return!e.content||((l=e.content)===null||l===void 0?void 0:l.length)===0?{type:"block",children:["<br />"]}:{type:"block",children:e.content.map(function(d){return Sx(d,t)})}}else if(e.type==="bulletList"||e.type==="orderedList"){var c;return{type:"block",children:((c=e.content)===null||c===void 0?void 0:c.flatMap(function(d,f){return gM(vM(e),d,0,t,f===0)}))||[]}}else{var u=e;throw new Error("Unhandled node type: ".concat("type"in u?"exhaustiveCheck.type":"unknown"))}}function W8(e,t){for(var n=[`
|
|
114
|
+
`],r=[],o=0;o<e.length;o++){var i=e[o],s=B1(i.children),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;if(typeof l=="string")n[n.length-1]+=l;else{if(l._type==="file")r.push(l);else if(l._type==="link")r.push(l);else{var c=l;throw new Error("Unexpected node type: ".concat(JSON.stringify(c,null,2)))}n.push("")}}}catch(u){s.e(u)}finally{s.f()}o===e.length-1?n[n.length-1]+=`
|
|
115
|
+
`:n[n.length-1]+=`
|
|
116
|
+
|
|
117
|
+
`}return Wt(Wt(Wt(Wt({},mn,"richtext"),"templateStrings",n),"exprs",r),"files",t)}function xE(e){var t,n=((t=e.marks)===null||t===void 0?void 0:t.flatMap(function(s){return s.type==="bold"?["bold"]:s.type==="italic"?["italic"]:s.type==="strike"?["line-through"]:[]}))||[],r=e.text.trimStart(),o=e.text.length-r.length;r=r.trimEnd();var i=e.text.length-r.length-o;return n.includes("bold")&&n.includes("italic")?r="***".concat(r,"***"):n.includes("bold")?r="**".concat(r,"**"):n.includes("italic")&&(r="_".concat(r,"_")),n.includes("line-through")&&(r="~~".concat(r,"~~")),"".concat(" ".repeat(o)).concat(r).concat(" ".repeat(i))}function Sx(e,t){if(e.type==="text"){var n,r=(n=e.marks)===null||n===void 0?void 0:n.find(function(i){return i.type==="link"});return(r==null?void 0:r.type)==="link"?{_type:"link",href:r.attrs.href,children:[xE(e)]}:xE(e)}else{if(e.type==="hardBreak")return"<br />";if(e.type==="image")return q8(e,t);var o=e;throw new Error("Unexpected node type: ".concat(JSON.stringify(o)))}}function gM(e,t,n,r){var o,i,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,a=s?"":`
|
|
118
|
+
`,l=["".concat(a).concat(" ".repeat(n)).concat(e)];return((o=t.content)===null||o===void 0||(o=o[0])===null||o===void 0?void 0:o.type)==="bulletList"||((i=t.content)===null||i===void 0||(i=i[0])===null||i===void 0?void 0:i.type)==="orderedList"||l.push(" "),l.concat((t.content||[]).flatMap(function(c,u){return c.type==="bulletList"||c.type==="orderedList"?(c.content||[]).flatMap(function(d){return gM(vM(c),d,n+4,r)}):(c.content||[]).flatMap(function(d){var f,p,m=[];return(f=c.content)!==null&&f!==void 0&&f.length&&((p=c.content)===null||p===void 0?void 0:p.length)>0&&u>0&&m.push(`<br />
|
|
119
|
+
`),m.push(Sx(d,r)),m})}))}function vM(e){if(e.type==="bulletList")return"-";if(e.type==="orderedList")return"1.";var t=e;throw new Error("Unhandled list node: ".concat(JSON.stringify(t)))}var K8=new TextEncoder;function q8(e,t){if(e.attrs&&e.attrs.src.startsWith("data:")){var n=ot.getSHA256Hash(K8.encode(e.attrs.src)),r=Hg(e.attrs.src);if(r===void 0)throw new Error("Could not detect Mime Type for image: ".concat(e.attrs.src));var o=Wg(r),i=e.attrs.fileName||"".concat(n,".").concat(o),s="/public/".concat(i);return t[s]=e.attrs.src,Wt(Wt(Wt(Wt({},mn,"file"),Cn,s),Pk,Nk),"metadata",{width:typeof e.attrs.width=="number"?e.attrs.width:0,height:typeof e.attrs.height=="number"?e.attrs.height:0,sha256:n||"",mimeType:r})}else if(e.attrs){var a=G8("sha256",e.attrs.src),l=e.attrs.src.split("?")[0];return Wt(Wt(Wt(Wt({},mn,"file"),Cn,"/public".concat(e.attrs.src.split("?")[0])),Pk,Nk),"metadata",{width:typeof e.attrs.width=="number"?e.attrs.width:0,height:typeof e.attrs.height=="number"?e.attrs.height:0,sha256:a||"",mimeType:l&&U8(l)||""})}else throw new Error("Invalid image node (no attrs): "+JSON.stringify(e))}function G8(e,t){var n=t.split("?");if(!(n.length<2)){var r=n[1],o=new URLSearchParams(r);if(o.has(e))return o.get(e)}}var bm='<val value="',kx='">',Ex="</val>";function hi(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=[];function i(l,c){var u=hi(l.tokens?l.tokens:[],t,0);o.push({tag:"span",classes:[c].concat(u.children.flatMap(function(d){return typeof d=="string"?[]:d.classes})),children:u.children.flatMap(function(d){return typeof d=="string"?d:d.children})})}for(var s=function(){var c=e[n];if(c.type==="heading")o.push({tag:"h".concat(c.depth),children:hi(c.tokens?c.tokens:[],t,0).children});else if(c.type==="paragraph")o.push({tag:"p",children:hi(c.tokens?c.tokens:[],t,0).children});else if(c.type==="strong")i(c,"bold");else if(c.type==="em")i(c,"italic");else if(c.type==="del")i(c,"line-through");else if(c.type==="text")if("tokens"in c&&Array.isArray(c.tokens))o.push.apply(o,mf(hi(c.tokens,t,n,r).children));else if(r&&typeof c.raw=="string"){var u=c.raw.split(`
|
|
120
|
+
`),d=u.flatMap(function(_,P){return P===u.length-1?[_]:P===u.length-1&&_===""?[]:_===""?{tag:"br"}:[_,{tag:"br"}]});o.push.apply(o,mf(d))}else o.push(c.raw);else if(c.type==="list")o.push({tag:c.ordered?"ol":"ul",children:hi(c.items,t,0).children});else if(c.type==="list_item")o.push({tag:"li",children:hi(c.tokens?c.tokens:[],t,0,!0).children});else if(c.type!=="space")if(c.type==="html"){if(c.text===Ex)return{v:{children:o,cursor:n}};var f=c.text.indexOf(kx);if(c.text.startsWith(bm)&&f>-1){var p=Number(c.text.slice(bm.length,f));if(Number.isNaN(p))throw Error("Illegal val intermediate node: ".concat(JSON.stringify(c)));var m=hi(e.map(function(_){return _.type==="link"||_.type==="list"?{type:"text",raw:_.raw,text:_.raw}:_}),t,n+1),g=m.children,y=m.cursor,v=t[p];if(v._type==="link")o.push({tag:"a",href:v.href,children:g});else if(v._type==="file"){var x,w,k;o.push({tag:"img",src:ot.convertFileSource(v).url,width:(x=v.metadata)===null||x===void 0?void 0:x.width,height:(w=v.metadata)===null||w===void 0?void 0:w.height,mimeType:(k=v.metadata)===null||k===void 0?void 0:k.mimeType})}n=y}var E=/<br\s*\/?>/gi;if(c.text.trim().match(E)){var S;o.push({tag:"br"}),((S=e[n+1])===null||S===void 0?void 0:S.raw.trim())===""&&n++}}else c.type==="link"?c.raw===c.href?o.push(c.raw):o.push({tag:"a",href:c.href,children:hi(c.tokens?c.tokens:[],t,0).children}):c.type==="br"?o.push({tag:"br"}):console.error("Could not parse markdown: unsupported token type: ".concat(c.type,". Found: ").concat(c.raw));n++},a;n<e.length;)if(a=s(),a)return a.v;return{children:o,cursor:n}}function yM(e){var t=e.templateStrings,n=e.exprs,r=t.flatMap(function(l,c){var u=n[c];return u?u[mn]==="link"?l.concat("".concat(bm).concat(c).concat(kx).concat(u.children[0]).concat(Ex)):l.concat("".concat(bm).concat(c).concat(kx).concat(Ex)):l}).join(""),o=E8(r,{gfm:!0}),i=hi(o,n,0),s=i.children,a=i.cursor;if(a!==o.length)throw Error("Unexpectedly terminated markdown parsing. Possible reason: unclosed html tag?");return Wt(Wt({},mn,"richtext"),"children",s)}var xM=F.object({type:F.union([F.literal("bold"),F.literal("strike"),F.literal("italic")])}),Y8=F.object({type:F.literal("link"),attrs:F.object({href:F.string(),target:F.union([F.literal("_blank"),F.null()]),auto:F.boolean()})}),bM=F.intersection(F.object({type:F.literal("text"),text:F.string()}),F.object({marks:F.array(F.union([xM,Y8]))}).partial()),wM=F.intersection(F.object({type:F.literal("hardBreak")}),F.object({marks:F.array(xM)}).partial()),X8=F.intersection(F.object({type:F.literal("image")}),F.object({attrs:F.intersection(F.object({src:F.string()}),F.object({align:F.union([F.literal("center"),F.literal("end"),F.literal("justify"),F.literal("left"),F.literal("match-parent"),F.literal("right"),F.literal("start"),F.null()]),alt:F.union([F.string(),F.null()]),height:F.union([F.string(),F.number(),F.null()]),width:F.union([F.string(),F.number(),F.null()]),rotate:F.union([F.string(),F.null()]),title:F.union([F.string(),F.null()]),fileName:F.union([F.string(),F.null()])}).partial())}).partial()),Z8=F.intersection(F.object({type:F.literal("heading")}),F.object({attrs:F.object({level:F.number()}),content:F.array(F.union([bM,wM]))}).partial()),SM=F.lazy(function(){return F.intersection(F.object({type:F.literal("bulletList")}),F.object({content:F.array(EM)}).partial())}),kM=F.lazy(function(){return F.intersection(F.object({type:F.literal("orderedList")}),F.object({content:F.array(EM)}).partial())}),EM=F.lazy(function(){return F.intersection(F.object({type:F.literal("listItem")}),F.object({content:F.array(F.union([_M,SM,kM]))}).partial())}),_M=F.intersection(F.object({type:F.literal("paragraph")}),F.object({content:F.array(F.union([bM,X8,wM]))}).partial()),J8=F.object({type:F.literal("doc"),content:F.array(F.union([_M,Z8,SM,kM]))});function bE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function wm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bE(Object(n),!0).forEach(function(r){Wt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Q8(e){return{type:"doc",content:e.children.map(function(t){return ez(t)})}}function ez(e){switch(e.tag){case"h1":return Nl(1,e.children);case"h2":return Nl(2,e.children);case"h3":return Nl(3,e.children);case"h4":return Nl(4,e.children);case"h5":return Nl(5,e.children);case"h6":return Nl(6,e.children);case"p":return wE(e.children);case"ul":return TM(e);case"ol":return PM(e);case"br":return wE([e]);default:{var t=e;throw Error("Unexpected child node: "+JSON.stringify(t))}}}function Nl(e,t){return{type:"heading",attrs:{level:e},content:t.flatMap(CM)}}function Kg(e){return{type:"text",text:e}}function CM(e){return typeof e=="string"?[Kg(e)]:U1(e)}function U1(e){if(e.classes.length===0&&e.children.length===1){if(typeof e.children[0]=="string")return[Kg(e.children[0])];throw Error("Unexpected amount of children in span node: "+JSON.stringify(e,null,2))}return e.children.map(function(t){return{type:"text",text:t,marks:e.classes.map(function(n){switch(n){case"bold":return{type:"bold"};case"italic":return{type:"italic"};case"line-through":return{type:"strike"};default:{var r=n;throw Error("Unexpected span class: "+r)}}})}})}function wE(e){return{type:"paragraph",content:e.flatMap(function(t){if(typeof t=="string")return[Kg(t)];switch(t.tag){case"span":return U1(t);case"a":return OM(t);case"img":return[nz(t)];case"br":return[tz()];default:{var n=t;throw Error("Unexpected paragraph child: "+JSON.stringify(n))}}})}}function tz(){return{type:"hardBreak",marks:[]}}function OM(e){return e.children.flatMap(CM).map(function(t){return wm(wm({},t),{},{marks:(t.marks||[]).concat({type:"link",attrs:{href:e.href,auto:!1,target:null}})})})}function nz(e){return{type:"image",attrs:{height:e.height,width:e.width,src:e.src}}}function TM(e){return{type:"bulletList",content:e.children.map(MM)}}function PM(e){return{type:"orderedList",content:e.children.map(MM)}}function MM(e){return{type:"listItem",content:rz(e.children)}}function rz(e){var t=[],n=B1(e),r;try{for(n.s();!(r=n.n()).done;){var o=r.value,i=t[t.length-1];i||(i={type:"paragraph",content:[]},t.push(i));var s=i.content;if(typeof o=="string")s.push(Kg(o));else switch(o.tag){case"a":{s.push.apply(s,mf(OM(o)));break}case"br":{t.push({type:"paragraph",content:[]});break}case"span":{s.push.apply(s,mf(U1(o)));break}case"ol":{t.push(PM(o));break}case"ul":{t.push(TM(o));break}default:{var a=o;throw Error("Unexpected list item child: "+JSON.stringify(a))}}}}catch(l){n.e(l)}finally{n.f()}return t}function pr(){pr=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(C,T,O){C[T]=O.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(C,T,O){return Object.defineProperty(C,T,{value:O,enumerable:!0,configurable:!0,writable:!0}),C[T]}try{c({},"")}catch{c=function(T,O,R){return T[O]=R}}function u(C,T,O,R){var N=T&&T.prototype instanceof v?T:v,j=Object.create(N.prototype),G=new V(R||[]);return o(j,"_invoke",{value:A(C,O,G)}),j}function d(C,T,O){try{return{type:"normal",arg:C.call(T,O)}}catch(R){return{type:"throw",arg:R}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",m="executing",g="completed",y={};function v(){}function x(){}function w(){}var k={};c(k,s,function(){return this});var E=Object.getPrototypeOf,S=E&&E(E(K([])));S&&S!==n&&r.call(S,s)&&(k=S);var _=w.prototype=v.prototype=Object.create(k);function P(C){["next","throw","return"].forEach(function(T){c(C,T,function(O){return this._invoke(T,O)})})}function M(C,T){function O(N,j,G,xe){var ue=d(C[N],C,j);if(ue.type!=="throw"){var je=ue.arg,Ce=je.value;return Ce&&typeof Ce=="object"&&r.call(Ce,"__await")?T.resolve(Ce.__await).then(function(J){O("next",J,G,xe)},function(J){O("throw",J,G,xe)}):T.resolve(Ce).then(function(J){je.value=J,G(je)},function(J){return O("throw",J,G,xe)})}xe(ue.arg)}var R;o(this,"_invoke",{value:function(N,j){function G(){return new T(function(xe,ue){O(N,j,xe,ue)})}return R=R?R.then(G,G):G()}})}function A(C,T,O){var R=f;return function(N,j){if(R===m)throw new Error("Generator is already running");if(R===g){if(N==="throw")throw j;return{value:e,done:!0}}for(O.method=N,O.arg=j;;){var G=O.delegate;if(G){var xe=I(G,O);if(xe){if(xe===y)continue;return xe}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(R===f)throw R=g,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);R=m;var ue=d(C,T,O);if(ue.type==="normal"){if(R=O.done?g:p,ue.arg===y)continue;return{value:ue.arg,done:O.done}}ue.type==="throw"&&(R=g,O.method="throw",O.arg=ue.arg)}}}function I(C,T){var O=T.method,R=C.iterator[O];if(R===e)return T.delegate=null,O==="throw"&&C.iterator.return&&(T.method="return",T.arg=e,I(C,T),T.method==="throw")||O!=="return"&&(T.method="throw",T.arg=new TypeError("The iterator does not provide a '"+O+"' method")),y;var N=d(R,C.iterator,T.arg);if(N.type==="throw")return T.method="throw",T.arg=N.arg,T.delegate=null,y;var j=N.arg;return j?j.done?(T[C.resultName]=j.value,T.next=C.nextLoc,T.method!=="return"&&(T.method="next",T.arg=e),T.delegate=null,y):j:(T.method="throw",T.arg=new TypeError("iterator result is not an object"),T.delegate=null,y)}function L(C){var T={tryLoc:C[0]};1 in C&&(T.catchLoc=C[1]),2 in C&&(T.finallyLoc=C[2],T.afterLoc=C[3]),this.tryEntries.push(T)}function re(C){var T=C.completion||{};T.type="normal",delete T.arg,C.completion=T}function V(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(L,this),this.reset(!0)}function K(C){if(C||C===""){var T=C[s];if(T)return T.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var O=-1,R=function N(){for(;++O<C.length;)if(r.call(C,O))return N.value=C[O],N.done=!1,N;return N.value=e,N.done=!0,N};return R.next=R}}throw new TypeError(typeof C+" is not iterable")}return x.prototype=w,o(_,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:x,configurable:!0}),x.displayName=c(w,l,"GeneratorFunction"),t.isGeneratorFunction=function(C){var T=typeof C=="function"&&C.constructor;return!!T&&(T===x||(T.displayName||T.name)==="GeneratorFunction")},t.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,w):(C.__proto__=w,c(C,l,"GeneratorFunction")),C.prototype=Object.create(_),C},t.awrap=function(C){return{__await:C}},P(M.prototype),c(M.prototype,a,function(){return this}),t.AsyncIterator=M,t.async=function(C,T,O,R,N){N===void 0&&(N=Promise);var j=new M(u(C,T,O,R),N);return t.isGeneratorFunction(T)?j:j.next().then(function(G){return G.done?G.value:j.next()})},P(_),c(_,l,"Generator"),c(_,s,function(){return this}),c(_,"toString",function(){return"[object Generator]"}),t.keys=function(C){var T=Object(C),O=[];for(var R in T)O.push(R);return O.reverse(),function N(){for(;O.length;){var j=O.pop();if(j in T)return N.value=j,N.done=!1,N}return N.done=!0,N}},t.values=K,V.prototype={constructor:V,reset:function(C){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(re),!C)for(var T in this)T.charAt(0)==="t"&&r.call(this,T)&&!isNaN(+T.slice(1))&&(this[T]=e)},stop:function(){this.done=!0;var C=this.tryEntries[0].completion;if(C.type==="throw")throw C.arg;return this.rval},dispatchException:function(C){if(this.done)throw C;var T=this;function O(ue,je){return j.type="throw",j.arg=C,T.next=ue,je&&(T.method="next",T.arg=e),!!je}for(var R=this.tryEntries.length-1;R>=0;--R){var N=this.tryEntries[R],j=N.completion;if(N.tryLoc==="root")return O("end");if(N.tryLoc<=this.prev){var G=r.call(N,"catchLoc"),xe=r.call(N,"finallyLoc");if(G&&xe){if(this.prev<N.catchLoc)return O(N.catchLoc,!0);if(this.prev<N.finallyLoc)return O(N.finallyLoc)}else if(G){if(this.prev<N.catchLoc)return O(N.catchLoc,!0)}else{if(!xe)throw new Error("try statement without catch or finally");if(this.prev<N.finallyLoc)return O(N.finallyLoc)}}}},abrupt:function(C,T){for(var O=this.tryEntries.length-1;O>=0;--O){var R=this.tryEntries[O];if(R.tryLoc<=this.prev&&r.call(R,"finallyLoc")&&this.prev<R.finallyLoc){var N=R;break}}N&&(C==="break"||C==="continue")&&N.tryLoc<=T&&T<=N.finallyLoc&&(N=null);var j=N?N.completion:{};return j.type=C,j.arg=T,N?(this.method="next",this.next=N.finallyLoc,y):this.complete(j)},complete:function(C,T){if(C.type==="throw")throw C.arg;return C.type==="break"||C.type==="continue"?this.next=C.arg:C.type==="return"?(this.rval=this.arg=C.arg,this.method="return",this.next="end"):C.type==="normal"&&T&&(this.next=T),y},finish:function(C){for(var T=this.tryEntries.length-1;T>=0;--T){var O=this.tryEntries[T];if(O.finallyLoc===C)return this.complete(O.completion,O.afterLoc),re(O),y}},catch:function(C){for(var T=this.tryEntries.length-1;T>=0;--T){var O=this.tryEntries[T];if(O.tryLoc===C){var R=O.completion;if(R.type==="throw"){var N=R.arg;re(O)}return N}}throw new Error("illegal catch attempt")},delegateYield:function(C,T,O){return this.delegate={iterator:K(C),resultName:T,nextLoc:O},this.method==="next"&&(this.arg=e),y}},t}function SE(e,t,n,r,o,i,s){try{var a=e[i](s),l=a.value}catch(c){n(c);return}a.done?t(l):Promise.resolve(l).then(r,o)}function Du(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(l){SE(i,r,o,s,a,"next",l)}function a(l){SE(i,r,o,s,a,"throw",l)}s(void 0)})}}function oz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hM(r.key),r)}}function iz(e,t,n){return t&&kE(e.prototype,t),n&&kE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var sz=new M8,RM=function(){function e(t){var n=this;oz(this,e),Wt(this,"subscribe",function(r){return function(o){var i=EE(r);return n.listeners[i]||(n.listeners[i]=[],n.subscribers.set(i,{})),n.listeners[i].push(o),function(){n.listeners[i].splice(n.listeners[i].indexOf(o),1)}}}),Wt(this,"getSnapshot",function(r){return function(){return n.get(r)}}),Wt(this,"getServerSnapshot",function(r){return function(){return n.get(r)}}),Wt(this,"get",function(r){var o=EE(r);return n.subscribers.get(o)}),this.api=t,this.subscribers=new Map,this.listeners={},this.drafts={},this.schema={}}return iz(e,[{key:"getModule",value:function(){var t=Du(pr().mark(function r(o){var i,s,a,l,c=arguments;return pr().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(i=c.length>1&&c[1]!==void 0?c[1]:!1,!(!i&&this.drafts[o]&&this.schema[o])){d.next=3;break}return d.abrupt("return",St.ok({source:this.drafts[o],schema:this.schema[o]}));case 3:return d.next=5,this.api.getTree({patch:!0,treePath:o,includeSource:!0});case 5:if(s=d.sent,!St.isOk(s)){d.next=19;break}if(a=s.value.modules[o].source,l=s.value.modules[o].schema,!(a!==void 0&&l!==void 0)){d.next=15;break}return this.drafts[o]=a,this.schema[o]=l,d.abrupt("return",St.ok({source:a,schema:l}));case 15:return console.error("Val: could not find the module source"),d.abrupt("return",St.err({message:"Could not fetch data. Verify that the module exists."}));case 17:d.next=21;break;case 19:return console.error("Val: failed to get module",s.error),d.abrupt("return",St.err({message:"Could not fetch data. Verify that Val is correctly configured."}));case 21:case"end":return d.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n}()},{key:"applyPatch",value:function(){var t=Du(pr().mark(function r(o,i){var s,a,l,c,u,d,f,p,m,g,y,v;return pr().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(s=this.drafts[o],a=this.schema[o],!(!s||!a)){w.next=21;break}return w.next=5,this.api.getTree({patch:!0,treePath:o,includeSource:!0});case 5:if(l=w.sent,!St.isOk(l)){w.next=19;break}if(c=l.value.modules[o].source,u=l.value.modules[o].schema,!(c!==void 0&&u!==void 0)){w.next=15;break}s=c,this.drafts[o]=c,this.schema[o]=u,w.next=17;break;case 15:return console.error("Val: could not find the module source"),w.abrupt("return",St.err({message:"Val: could not fetch data. Verify that the module exists."}));case 17:w.next=21;break;case 19:return console.error("Val: failed to get module",l.error),w.abrupt("return",St.err({message:"Val: could not fetch data. Verify that Val is correctly configured."}));case 21:return w.next=23,this.api.postPatches(o,i);case 23:if(d=w.sent,!St.isErr(d)){w.next=27;break}return console.error("Val: failed to post patch",d.error),w.abrupt("return",d);case 27:if(f=N8(s,sz,i.filter(ot.notFileOp)),!St.isOk(f)){w.next=35;break}for(this.drafts[o]=f.value,this.emitEvent(o,f.value),p=0,m=Array.from(this.subscribers.entries());p<m.length;p++)g=wx(m[p],2),y=g[0],v=g[1],v[o]&&(this.subscribers.set(y,wm(wm({},v),{},Wt({},o,this.drafts[o]))),this.emitChange(y));return w.abrupt("return",d);case 35:return console.error("Val: failed to apply patch",f.error),w.abrupt("return",f);case 37:case"end":return w.stop()}},r,this)}));function n(r,o){return t.apply(this,arguments)}return n}()},{key:"emitEvent",value:function(n,r){var o=new CustomEvent("val-event",{detail:{type:"module-update",moduleId:n,source:r}});window.dispatchEvent(o)}},{key:"update",value:function(){var t=Du(pr().mark(function r(o){var i=this;return pr().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Promise.all(o.map(function(l){return i.updateTree(l)}));case 2:case"end":return a.stop()}},r)}));function n(r){return t.apply(this,arguments)}return n}()},{key:"reset",value:function(){var t=Du(pr().mark(function r(){return pr().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",this.updateTree());case 1:case"end":return i.stop()}},r,this)}));function n(){return t.apply(this,arguments)}return n}()},{key:"updateTree",value:function(){var t=Du(pr().mark(function r(o){var i=this,s,a,l,c,u,d,f,p,m,g,y,v,x,w;return pr().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,this.api.getTree({patch:!0,treePath:o,includeSource:!0});case 2:if(s=E.sent,a=[],!St.isOk(s)){E.next=18;break}l=new Map,c=Array.from(this.subscribers.keys()),u=pr().mark(function S(){var _,P,M;return pr().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:_=f[d],a.push(_),P=s.value.modules[_].source,typeof P<"u"&&(i.emitEvent(_,P),M=c.find(function(L){return L.includes(_)}),M&&l.set(M,(l.get(M)||[]).concat(_)));case 4:case"end":return I.stop()}},S)}),d=0,f=Object.keys(s.value.modules);case 9:if(!(d<f.length)){E.next=14;break}return E.delegateYield(u(),"t0",11);case 11:d++,E.next=9;break;case 14:for(p=0,m=Array.from(l.entries());p<m.length;p++)g=wx(m[p],2),y=g[0],v=g[1],x=Object.fromEntries(v.flatMap(function(S){var _=s.value.modules[S].source;return _?[[S,_]]:[]})),this.subscribers.set(y,x),this.emitChange(y);return E.abrupt("return",St.ok(a));case 18:return w="Failed to fetch content. ",s.error.statusCode===401?w+="Authorization failed - check that you are logged in.":w+="Get a developer to verify that Val is correctly setup.",E.abrupt("return",St.err({message:w,details:{fetchError:s.error}}));case 21:case"end":return E.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n}()},{key:"emitChange",value:function(n){var r=B1(this.listeners[n]),o;try{for(r.s();!(o=r.n()).done;){var i=o.value;i()}}catch(s){r.e(s)}finally{r.f()}}}]),e}();function EE(e){return e.slice().sort().join("&")}const az=new TextEncoder;function NM(e){return new Promise((t,n)=>{var i;const r=(i=e.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=new Image;a.addEventListener("load",()=>{const l=ot.getSHA256Hash(az.encode(s));if(a.naturalWidth&&a.naturalHeight){const c=Hg(s);t({src:s,width:a.naturalWidth,height:a.naturalHeight,filename:r==null?void 0:r.name,sha256:l,mimeType:c,fileExt:c&&Wg(c)})}else t({src:s,filename:r==null?void 0:r.name,sha256:l})}),a.src=s}else n(s?{message:"Unexpected image result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function $M(e,t,n){if(!n||!e)return t;const r=n.sha256.slice(0,5),o=Hg(e)??"unknown",i=Wg(o)??"unknown";if(t){let s=t.split(".").slice(0,-1).join(".")||t;const a=s.lastIndexOf("_");return s.slice(a+1,s.length)===r&&(s=s.slice(0,a)),`${encodeURIComponent(s).replace(/%[0-9A-Fa-f]{2}/g,"").toLowerCase()}_${r}.${i}`}return`${n.sha256}.${i}`}const V1=h.forwardRef(({className:e,type:t,...n},r)=>b.jsx("input",{type:t,className:Ue("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));V1.displayName="Input";let qg=()=>({events:{},emit(e,...t){(this.events[e]||[]).forEach(n=>n(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(n=>n!==t)}});var _x={exports:{}};(function(e,t){var n=typeof Reflect<"u"?Reflect.construct:void 0,r=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;r(c,"stack",{configurable:!0,get:function(){var f=u.stack;return r(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){r(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&r(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&r(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return r(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=n!==void 0?function(){return n(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}t=e.exports=a,t.BaseError=i})(_x,_x.exports);var AM=_x.exports,_E="ProseMirror-selectednode",DM="",Ps="\0",CE="__state_override__",lz={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},Le=lz,Li=Symbol.for("__remirror__"),gn=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))(gn||{}),ct=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(ct||{}),rr=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(rr||{}),Y=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(Y||{}),q=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(q||{}),cz=function(t){return uz(t)&&!dz(t)};function uz(e){return!!e&&typeof e=="object"}function dz(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||hz(e)}var fz=typeof Symbol=="function"&&Symbol.for,pz=fz?Symbol.for("react.element"):60103;function hz(e){return e.$$typeof===pz}function mz(e){return Array.isArray(e)?[]:{}}function gf(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Uc(mz(e),e,t):e}function gz(e,t,n){return e.concat(t).map(function(r){return gf(r,n)})}function vz(e,t){if(!t.customMerge)return Uc;var n=t.customMerge(e);return typeof n=="function"?n:Uc}function yz(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function OE(e){return Object.keys(e).concat(yz(e))}function IM(e,t){try{return t in e}catch{return!1}}function xz(e,t){return IM(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function bz(e,t,n){var r={};return n.isMergeableObject(e)&&OE(e).forEach(function(o){r[o]=gf(e[o],n)}),OE(t).forEach(function(o){xz(e,o)||(IM(e,o)&&n.isMergeableObject(t[o])?r[o]=vz(o,n)(e[o],t[o],n):r[o]=gf(t[o],n))}),r}function Uc(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||gz,n.isMergeableObject=n.isMergeableObject||cz,n.cloneUnlessOtherwiseSpecified=gf;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):bz(e,t,n):gf(t,n)}Uc.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Uc(r,o,n)},{})};var wz=Uc,Sz=wz;const kz=ai(Sz);/*!
|
|
121
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
122
|
+
*
|
|
123
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
124
|
+
* Released under the MIT License.
|
|
125
|
+
*/var LM=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*!
|
|
126
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
127
|
+
*
|
|
128
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
129
|
+
* Released under the MIT License.
|
|
130
|
+
*/var Ez=LM;function TE(e){return Ez(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var _z=function(t){var n,r;return!(TE(t)===!1||(n=t.constructor,typeof n!="function")||(r=n.prototype,TE(r)===!1)||r.hasOwnProperty("isPrototypeOf")===!1)};/*!
|
|
131
|
+
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
132
|
+
*
|
|
133
|
+
* Copyright (c) 2015-2017, Jon Schlinkert.
|
|
134
|
+
* Released under the MIT License.
|
|
135
|
+
*/var Cz=_z,Oz=function(t){return Cz(t)||typeof t=="function"||Array.isArray(t)};/*!
|
|
136
|
+
* object.omit <https://github.com/jonschlinkert/object.omit>
|
|
137
|
+
*
|
|
138
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
139
|
+
* Released under the MIT License.
|
|
140
|
+
*/var Tz=Oz,Pz=function(t,n,r){if(!Tz(t))return{};typeof n=="function"&&(r=n,n=[]),typeof n=="string"&&(n=[n]);for(var o=typeof r=="function",i=Object.keys(t),s={},a=0;a<i.length;a++){var l=i[a],c=t[l];(!n||n.indexOf(l)===-1&&(!o||r(c,l,t)))&&(s[l]=c)}return s};const H1=ai(Pz);/*!
|
|
141
|
+
* object.pick <https://github.com/jonschlinkert/object.pick>
|
|
142
|
+
*
|
|
143
|
+
* Copyright (c) 2014-2015 Jon Schlinkert, contributors.
|
|
144
|
+
* Licensed under the MIT License
|
|
145
|
+
*/var Mz=LM,Rz=function(t,n){if(!Mz(t)&&typeof t!="function")return{};var r={};if(typeof n=="string")return n in t&&(r[n]=t[n]),r;for(var o=n.length,i=-1;++i<o;){var s=n[i];s in t&&(r[s]=t[s])}return r};const Cx=ai(Rz),jM=/^[a-zà-öø-ÿ]+|[A-ZÀ-ÖØ-ß][a-zà-öø-ÿ]+|[a-zà-öø-ÿ]+|[0-9]+|[A-ZÀ-ÖØ-ß]+(?![a-zà-öø-ÿ])/g,Nz=/\S+/g;function $z(e,t){const n={parts:[],prefixes:[]},r=e.matchAll(t);let o=0;for(const s of r){if(typeof s.index!="number")continue;const a=s[0];n.parts.push(a);const l=e.slice(o,s.index).trim();n.prefixes.push(l),o=s.index+a.length}const i=e.slice(o).trim();return i&&(n.parts.push(""),n.prefixes.push(i)),n}function zM(e,t){const{keepSpecialCharacters:n=!1,keep:r,prefix:o=""}=t||{},i=e.trim().normalize("NFC"),s=i.includes(" "),l=$z(i,s?Nz:jM);return l.parts.map((c,u)=>{let d=l.prefixes[u]||"",f=c;return n===!1&&(r&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${r.join("")}]`,"g"),"")),r||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),r&&(d=d.replace(new RegExp(`[^${r.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function Az(e){const t=e.matchAll(jM).next().value,n=t?t.index:0;return e.slice(0,n+1).toUpperCase()+e.slice(n+1).toLowerCase()}function FM(e,t){return zM(e,t).reduce((n,r)=>n+Az(r),"")}function PE(e,t){return zM(e,{...t,prefix:"-"}).join("").toLowerCase()}function Ox(e,t,n,r){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof t!="boolean"&&(r=n,n=t,t=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];var p=this,m=Date.now()-s;if(i)return;function g(){s=Date.now(),n.apply(p,d)}function y(){o=void 0}r&&!o&&g(),a(),r===void 0&&m>e?g():t!==!0&&(o=setTimeout(r?y:g,r===void 0?e-m:e))}return c.cancel=l,c}function Dz(e,t,n){return n===void 0?Ox(e,t,!1):Ox(e,n,t!==!1)}function Pt(e,t,n){const r=e[t];return BM(!Yg(r),n),r}function BM(e,t){if(!e)throw new Iz(t)}var Iz=class extends AM.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function Jt(e){return Object.entries(e)}function vf(e){return Object.keys(e)}function Gg(e){return Object.values(e)}function Ao(e,t,n){return e.includes(t,n)}function he(e){return Object.assign(Object.create(null),e)}function UM(e){return Object.prototype.toString.call(e)}function VM(e){return UM(e).slice(8,-1)}function rp(e,t){return n=>typeof n!==e?!1:t?t(n):!0}function W1(e){return t=>VM(t)===e}var Yg=rp("undefined"),_e=rp("string"),Mr=rp("number",e=>!Number.isNaN(e)),pt=rp("function");function Lz(e){return e===null}function jz(e){return e===!0||e===!1}function xl(e){if(VM(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})}function zz(e){return e==null||/^[bns]/.test(typeof e)}function Js(e){return Lz(e)||Yg(e)}function jn(e){return!Js(e)&&(pt(e)||rp("object")(e))}var Fz=W1("RegExp");function Bz(e){return W1("Map")(e)}function Uz(e){return W1("Set")(e)}function Sm(e){return jn(e)&&!Bz(e)&&!Uz(e)&&Object.keys(e).length===0}var en=Array.isArray;function Qs(e){return en(e)&&e.length===0}function ME(e){return en(e)&&e.length>0}function Xg(e,t,n=r=>!!r){t.lastIndex=0;const r=[],o=t.flags;let i;o.includes("g")||(t=new RegExp(t.source,`g${o}`));do i=t.exec(e),i&&r.push(i);while(n(i));return t.lastIndex=0,r}function km(){const e=Date.now(),t=km.last||e;return km.last=e>t?e:t+1}km.last=0;function Em(e=""){return`${e}${km().toString(36)}`}function Vz(e){return H1(e,t=>!Yg(t))}function Hz(e){if(!xl(e))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}function yf(e,t=!1){const n=t?[...e].reverse():e,r=new Set(n);return t?[...r].reverse():[...r]}function HM(){}function Wz(...e){return kz.all(e,{isMergeableObject:xl})}function Kz({min:e,max:t,value:n}){return n<e?e:n>t?t:n}function qz(e){return e[e.length-1]}function ol(e,t){return[...e].map((n,r)=>({value:n,index:r})).sort((n,r)=>t(n.value,r.value)||n.index-r.index).map(({value:n})=>n)}function Gz(e,t,n){try{if(_e(t)&&t in e)return e[t];en(t)&&(t=`['${t.join("']['")}']`);let r=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(r=r[s||a||l||c],"")),r===void 0?n:r}catch{return n}}function Yz(e,t){const n=Hz(t);let r=n;for(const[o,i]of e.entries()){const s=o>=e.length-1;let a=r[i];if(s){if(en(r)){const l=Number.parseInt(i.toString(),10);Mr(l)&&r.splice(l,1)}else Reflect.deleteProperty(r,i);return n}if(zz(a))return n;a=en(a)?[...a]:{...a},r[i]=a,r=a}return n}function Xz(e){return t=>Gz(t,e)}function WM(e,t,n=!1){const r=[],o=new Set,i=pt(t)?t:Xz(t),s=n?[...e].reverse():e;for(const a of s){const l=i(a);o.has(l)||(o.add(l),r.push(a))}return n?r.reverse():r}function KM(e,t){const n=en(e)?e[0]:e;return Mr(t)?n<=t?Array.from({length:t+1-n},(r,o)=>o+n):Array.from({length:n+1-t},(r,o)=>-1*o+n):Array.from({length:Math.abs(n)},(r,o)=>(n<0?-1:1)*o)}function RE(e,...t){const n=t.filter(Mr);return e>=Math.min(...n)&&e<=Math.max(...n)}function qM(e){return pt(e)?e():e}var GM="https://remirror.io/docs/errors",Zz={[q.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[q.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[q.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[q.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[q.MUTATION]:"Mutation of immutable value detected.",[q.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[q.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[q.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[q.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[q.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[q.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[q.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[q.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[q.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[q.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[q.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[q.INVALID_EXTENSION]:"The provided extension is invalid.",[q.INVALID_CONTENT]:"The content provided to the editor is not supported.",[q.INVALID_NAME]:"An invalid name was used for the extension.",[q.EXTENSION]:"An error occurred within an extension. More details should be made available.",[q.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[q.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[q.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[q.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.",[q.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[q.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[q.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[q.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[q.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[q.REACT_COMPONENTS]:"An error occurred within a remirror component.",[q.REACT_HOOKS]:"An error occurred within a remirror hook.",[q.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function Jz(e){return _e(e)&&Ao(Gg(q),e)}function Qz(e,t){const n=Zz[e],r=n?`${n}
|
|
146
|
+
|
|
147
|
+
`:"",o=t?`${t}
|
|
148
|
+
|
|
149
|
+
`:"";return`${r}${o}For more information visit ${GM}#${e.toLowerCase()}`}var YM=class extends AM.BaseError{constructor({code:e,message:t,disableLogging:n=!1}={}){const r=Jz(e)?e:q.CUSTOM;super(Qz(r,t)),this.errorCode=r,this.url=`${GM}#${r.toLowerCase()}`,n||console.error(this.message)}static create(e={}){return new YM(e)}};function be(e,t){if(!e)throw YM.create(t)}function Da(e,t={}){return e}function Sn(e){this.content=e}Sn.prototype={constructor:Sn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return o==-1?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new Sn(i)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Sn(n)},addToStart:function(e,t){return new Sn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Sn(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(i==-1?o.length:i,0,t,n),new Sn(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Sn.from(e),e.size?new Sn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Sn.from(e),e.size?new Sn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Sn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Sn.from=function(e){if(e instanceof Sn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Sn(t)};function XM(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=XM(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function ZM(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=ZM(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class U{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>t&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,o){let i="",s=!0;return this.nodesBetween(t,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)o.push(t.content[i]);return new U(o,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],o=0;if(n>t)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>t&&((s<t||l>n)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new U(r,o)}cutByIndex(t,n){return t==n?U.empty:t==0&&n==this.content.length?this:new U(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new U(o,i)}addToStart(t){return new U([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new U(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];t(o,r,n),r+=o.nodeSize}}findDiffStart(t,n=0){return XM(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return ZM(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Vp(0,t);if(t==this.size)return Vp(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=t)return s==t||n>0?Vp(r+1,s):Vp(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return U.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new U(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return U.empty;let n,r=0;for(let o=0;o<t.length;o++){let i=t[o];r+=i.nodeSize,o&&i.isText&&t[o-1].sameMarkup(i)?(n||(n=t.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new U(n||t,r)}static from(t){if(!t)return U.empty;if(t instanceof U)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new U([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}U.empty=new U([],0);const by={index:0,offset:0};function Vp(e,t){return by.index=e,by.offset=t,by}function _m(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!_m(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!_m(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}class Ye{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let o=0;o<t.length;o++){let i=t[o];if(this.eq(i))return t;if(this.type.excludes(i.type))n||(n=t.slice(0,o));else{if(i.type.excludes(this.type))return t;!r&&i.type.rank>this.type.rank&&(n||(n=t.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&_m(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Ye.none;if(t instanceof Ye)return[t];let n=t.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}}Ye.none=[];class Cm extends Error{}class Z{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=QM(this.content,t+this.openStart,n);return r&&new Z(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Z(JM(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Z.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Z(U.fromJSON(t,n.content),r,o)}static maxOpen(t,n=!0){let r=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=t.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new Z(t,r,o)}}Z.empty=new Z(U.empty,0,0);function JM(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(JM(i.content,t-o-1,n-o-1)))}function QM(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=QM(s.content,t-i-1,n);return a&&e.replaceChild(o,s.copy(a))}function e9(e,t,n){if(n.openStart>e.depth)throw new Cm("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Cm("Inconsistent open depths");return eR(e,t,n,0)}function eR(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=eR(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,a=s.content;return Va(s,a.cut(0,e.parentOffset).append(n.content).append(a.cut(t.parentOffset)))}else{let{start:s,end:a}=t9(n,e);return Va(i,nR(e,s,a,t,r))}else return Va(i,Om(e,t,r))}function tR(e,t){if(!t.type.compatibleContent(e.type))throw new Cm("Cannot join "+t.type.name+" onto "+e.type.name)}function Tx(e,t,n){let r=e.node(n);return tR(r,t.node(n)),r}function Ua(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Rd(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Ua(e.nodeAfter,r),i++));for(let a=i;a<s;a++)Ua(o.child(a),r);t&&t.depth==n&&t.textOffset&&Ua(t.nodeBefore,r)}function Va(e,t){return e.type.checkContent(t),e.copy(t)}function nR(e,t,n,r,o){let i=e.depth>o&&Tx(e,t,o+1),s=r.depth>o&&Tx(n,r,o+1),a=[];return Rd(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(tR(i,s),Ua(Va(i,nR(e,t,n,r,o+1)),a)):(i&&Ua(Va(i,Om(e,t,o+1)),a),Rd(t,n,o,a),s&&Ua(Va(s,Om(n,r,o+1)),a)),Rd(r,null,o,a),new U(a)}function Om(e,t,n){let r=[];if(Rd(null,e,n,r),e.depth>n){let o=Tx(e,t,n+1);Ua(Va(o,Om(e,t,n+1)),r)}return Rd(t,null,n,r),new U(r)}function t9(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)o=t.node(i).copy(U.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class Vc{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=t.child(n);return r?t.child(n).cut(r):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<t;i++)o+=r.child(i).nodeSize;return o}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Ye.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),o=t.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=t.parent.maybeChild(t.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new il(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new Vc(n,r,i)}static resolveCached(t,n){for(let o=0;o<wy.length;o++){let i=wy[o];if(i.pos==n&&i.doc==t)return i}let r=wy[Sy]=Vc.resolve(t,n);return Sy=(Sy+1)%n9,r}}let wy=[],Sy=0,n9=12;class il{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const r9=Object.create(null);let Us=class Px{constructor(t,n,r,o=Ye.none){this.type=t,this.attrs=n,this.marks=o,this.content=r||U.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,o=0){this.content.nodesBetween(t,n,r,o,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,o){return this.content.textBetween(t,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&_m(this.attrs,n||t.defaultAttrs||r9)&&Ye.sameSet(this.marks,r||Ye.none)}copy(t=null){return t==this.content?this:new Px(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Px(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return Z.empty;let o=this.resolve(t),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new Z(c,o.depth-s,i.depth-s)}replace(t,n,r){return e9(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(o==t||n.isText)return n;t-=o+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(t){return Vc.resolveCached(this,t)}resolveNoCache(t){return Vc.resolve(this,t)}rangeHasMark(t,n,r){let o=!1;return n>t&&this.nodesBetween(t,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),rR(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=U.empty,o=0,i=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(t).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=Ye.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!Ye.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let o=U.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,o,r)}};Us.prototype.text=void 0;class Tm extends Us{constructor(t,n,r,o){if(super(t,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):rR(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Tm(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Tm(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function rR(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class sl{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new o9(t,n);if(r.next==null)return sl.empty;let o=oR(r);r.next&&r.err("Unexpected trailing text");let i=d9(u9(o));return f9(i,r),i}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(t.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(t,r);if(l&&(!n||l.validEnd))return U.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=i(d,a.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(t)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let o=0;o<r.next.length;o++)t.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),t.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return i}).join(`
|
|
150
|
+
`)}}sl.empty=new sl(!0);class o9{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function oR(e){let t=[];do t.push(i9(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function i9(e){let t=[];do t.push(s9(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function s9(e){let t=c9(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=a9(e,t);else break;return t}function NE(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function a9(e,t){let n=NE(e),r=n;return e.eat(",")&&(e.next!="}"?r=NE(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function l9(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function c9(e){if(e.eat("(")){let t=oR(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=l9(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function u9(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function iR(e,t){return t-e}function $E(e,t){let n=[];return r(t),n.sort(iR);function r(o){let i=e[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function d9(e){let t=Object.create(null);return n($E(e,0));function n(r){let o=[];r.forEach(s=>{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);$E(e,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[r.join(",")]=new sl(r.indexOf(e.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(iR);i.next.push({type:o[s][0],next:t[a.join(",")]||n(a)})}return i}}function f9(e,t){for(let n=0,r=[e];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function sR(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function aR(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(o===void 0){let i=e[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function lR(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new p9(e[n]);return t}let Mx=class cR{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=lR(r.attrs),this.defaultAttrs=sR(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==sl.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:aR(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Us(this,this.computeAttrs(t),U.from(n),Ye.setFrom(r))}createChecked(t=null,n,r){return n=U.from(n),this.checkContent(n),new Us(this,this.computeAttrs(t),n,Ye.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=U.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(U.empty,!0);return i?new Us(this,t,n.append(i),Ye.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Ye.none:t}static compile(t,n){let r=Object.create(null);t.forEach((i,s)=>r[i]=new cR(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class p9{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class op{constructor(t,n,r,o){this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=lR(o.attrs),this.excluded=null;let i=sR(this.attrs);this.instance=i?new Ye(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Ye(this,aR(this.attrs,t))}static compile(t,n){let r=Object.create(null),o=0;return t.forEach((i,s)=>r[i]=new op(i,o++,n,s)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class h9{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Sn.from(t.nodes),n.marks=Sn.from(t.marks||{}),this.nodes=Mx.compile(this.spec.nodes,this),this.marks=op.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=r[s]||(r[s]=sl.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?AE(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:AE(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Mx){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,o)}text(t,n){let r=this.nodes.text;return new Tm(r,r.defaultAttrs,t,Ye.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Us.fromJSON(this,t)}markFromJSON(t){return Ye.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function AE(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let a in e.marks){let l=e.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Hc{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=t.nodes[r.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new IE(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new IE(this,n,!0);return r.addAll(t,n.from,n.to),Z.maxOpen(r.finish())}matchTag(t,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(v9(t,i.tag)&&(i.namespace===void 0||t.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(t);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(t,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(t)!=0||s.context&&!r.matchesContext(s.context)||a.length>t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in t.marks){let i=t.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=LE(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=LE(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Hc(t,Hc.schemaRules(t)))}}const uR={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},m9={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},dR={ol:!0,ul:!0},Pm=1,Mm=2,Nd=4;function DE(e,t,n){return t!=null?(t?Pm:0)|(t==="full"?Mm:0):e&&e.whitespace=="pre"?Pm|Mm:n&~Nd}class Hp{constructor(t,n,r,o,i,s,a){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Ye.none,this.stashMarks=[],this.match=s||(a&Nd?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(U.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(t.type))?(this.match=r,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Pm)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=U.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(U.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let o=r[n];(this.type?this.type.allowsMarkType(o.type):x9(o.type,t))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!uR.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class IE{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=DE(null,n.preserveWhitespace,0)|(r?Nd:0);o?i=new Hp(o.type,o.attrs,Ye.none,Ye.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new Hp(null,null,Ye.none,Ye.none,!0,null,s):i=new Hp(t.schema.topNodeType,null,Ye.none,Ye.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){t.nodeType==3?this.addTextNode(t):t.nodeType==1&&this.addElement(t)}withStyleRules(t,n){let r=t.getAttribute("style");if(!r)return n();let o=this.readStyles(y9(r));if(!o)return;let[i,s]=o,a=this.top;for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<i.length;l++)this.addPendingMark(i[l]);n();for(let l=0;l<i.length;l++)this.removePendingMark(i[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l])}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&Mm||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Pm)r.options&Mm?n=n.replace(/\r\n?/g,`
|
|
151
|
+
`):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],i=t.previousSibling;(!o||i&&i.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),o;dR.hasOwnProperty(r)&&this.parser.normalizeLists&&g9(t);let i=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,n));if(i?i.ignore:m9.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(t=i.skip);let s,a=this.top,l=this.needsBlock;if(uR.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}i&&i.skip?this.addAll(t):this.withStyleRules(t,()=>this.addAll(t)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
152
|
+
`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=Ye.none,r=Ye.none;for(let o=0;o<t.length;o+=2)for(let i=void 0;;){let s=this.parser.matchStyle(t[o],t[o+1],this,i);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)i=s;else break}return[n,r]}addElementByRule(t,n,r){let o,i,s;n.node?(i=this.parser.schema.nodes[n.node],i.isLeaf?this.insertNode(i.create(n.attrs))||this.leafFallback(t):o=this.enter(i,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,n,r){let o=n||0;for(let i=n?t.childNodes[n]:t.firstChild,s=r==null?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let n,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!n||n.length>s.length)&&(n=s,r=i,!s.length)||i.solid)break}if(!n)return!1;this.sync(r);for(let o=0;o<n.length;o++)this.enterInner(n[o],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let o=0;o<t.marks.length;o++)(!n.type||n.type.allowsMarkType(t.marks[o].type))&&(r=t.marks[o].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let o=this.findPlace(t.create(n));return o&&this.enterInner(t,n,!0,r),o}enterInner(t,n=null,r=!1,o){this.closeExtra();let i=this.top;i.applyPending(t),i.match=i.match&&i.match.matchType(t);let s=DE(t,o,i.options);i.options&Nd&&i.content.length==0&&(s|=Nd),this.nodes.push(new Hp(t,n,i.activeMarks,i.pendingMarks,r,null,s)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)t+=r[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&t.nodeType==1&&t.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=b9(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}}function g9(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&dR.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function v9(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function y9(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function LE(e){let t={};for(let n in e)t[n]=e[n];return t}function x9(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==t||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}function b9(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class ko{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=ky(n).createDocumentFragment());let o=r,i=[];return t.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:o}=ko.renderSpec(ky(n),this.nodes[t.type.name](t));if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,o)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let o=t.marks.length-1;o>=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(t,n,r={}){let o=this.marks[t.type.name];return o&&ko.renderSpec(ky(r),o(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));let s,a=r?t.createElementNS(r,o):t.createElement(o),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;u<n.length;u++){let d=n[u];if(d===0){if(u<n.length-1||u>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=ko.renderSpec(t,d,r);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new ko(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=jE(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return jE(t.marks)}}function jE(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ky(e){return e.document||window.document}const fR=65535,pR=Math.pow(2,16);function w9(e,t){return e+t*pR}function zE(e){return e&fR}function S9(e){return(e-(e&fR))/pR}const hR=1,mR=2,gh=4,gR=8;class Rx{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&gR)>0}get deletedBefore(){return(this.delInfo&(hR|gh))>0}get deletedAfter(){return(this.delInfo&(mR|gh))>0}get deletedAcross(){return(this.delInfo&gh)>0}}class Sr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Sr.empty)return Sr.empty}recover(t){let n=0,r=zE(t);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+S9(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>t)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:n:n,p=l+o+(f<0?0:u);if(r)return p;let m=t==(n<0?l:d)?null:w9(a/3,t-l),g=t==l?mR:t==d?hR:gh;return(n<0?t!=l:t!=d)&&(g|=gR),new Rx(p,g,m)}o+=u-c}return r?t+o:new Rx(t+o,0,null)}touches(t,n){let r=0,o=zE(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];t(a,a+c,l,l+u),i+=u-c}}invert(){return new Sr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Sr.empty:new Sr(t<0?[0,-t,0]:[0,0,t])}}Sr.empty=new Sr([]);class Ec{constructor(t=[],n,r=0,o=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=o}slice(t=0,n=this.maps.length){return new Ec(this.maps,this.mirror,t,n)}copy(){return new Ec(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let o=t.getMirror(n);this.appendMap(t.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let o=t.getMirror(n);this.appendMap(t.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let t=new Ec;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],a=s.mapResult(t,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,t=this.maps[l].recover(a.recover);continue}}o|=a.delInfo,t=a.pos}return r?t:new Rx(t,o,null)}}const Ey=Object.create(null);class tn{getMap(){return Sr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ey[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Ey)throw new RangeError("Duplicate use of step JSON ID "+t);return Ey[t]=n,n.prototype.jsonID=t,n}}class Bt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Bt(t,null)}static fail(t){return new Bt(null,t)}static fromReplace(t,n,r,o){try{return Bt.ok(t.replace(n,r,o))}catch(i){if(i instanceof Cm)return Bt.fail(i.message);throw i}}}function K1(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(K1(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return U.fromArray(r)}class _i extends tn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new Z(K1(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return Bt.fromReplace(t,this.from,this.to,i)}invert(){return new Eo(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new _i(n.pos,r.pos,this.mark)}merge(t){return t instanceof _i&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new _i(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new _i(n.from,n.to,t.markFromJSON(n.mark))}}tn.jsonID("addMark",_i);class Eo extends tn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new Z(K1(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return Bt.fromReplace(t,this.from,this.to,r)}invert(){return new _i(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Eo(n.pos,r.pos,this.mark)}merge(t){return t instanceof Eo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Eo(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Eo(n.from,n.to,t.markFromJSON(n.mark))}}tn.jsonID("removeMark",Eo);class Ms extends tn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Bt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Bt.fromReplace(t,this.pos,this.pos+1,new Z(U.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Ms(this.pos,n.marks[o]);return new Ms(this.pos,this.mark)}}return new Wc(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ms(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ms(n.pos,t.markFromJSON(n.mark))}}tn.jsonID("addNodeMark",Ms);class Wc extends tn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Bt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Bt.fromReplace(t,this.pos,this.pos+1,new Z(U.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ms(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Wc(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Wc(n.pos,t.markFromJSON(n.mark))}}tn.jsonID("removeNodeMark",Wc);class fn extends tn{constructor(t,n,r,o=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=o}apply(t){return this.structure&&Nx(t,this.from,this.to)?Bt.fail("Structure replace would overwrite content"):Bt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Sr([this.from,this.to-this.from,this.slice.size])}invert(t){return new fn(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new fn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof fn)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Z.empty:new Z(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new fn(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Z.empty:new Z(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new fn(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new fn(n.from,n.to,Z.fromJSON(t,n.slice),!!n.structure)}}tn.jsonID("replace",fn);class Ut extends tn{constructor(t,n,r,o,i,s,a=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(t){if(this.structure&&(Nx(t,this.from,this.gapFrom)||Nx(t,this.gapTo,this.to)))return Bt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Bt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Bt.fromReplace(t,this.from,this.to,r):Bt.fail("Content does not fit in gap")}getMap(){return new Sr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Ut(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new Ut(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ut(n.from,n.to,n.gapFrom,n.gapTo,Z.fromJSON(t,n.slice),n.insert,!!n.structure)}}tn.jsonID("replaceAround",Ut);function Nx(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function k9(e,t,n,r){let o=[],i=[],s,a;e.doc.nodesBetween(t,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,t),p=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(s&&s.to==f&&s.mark.eq(d[g])?s.to=p:o.push(s=new Eo(f,p,d[g])));a&&a.to==f?a.to=p:i.push(a=new _i(f,p,r))}}),o.forEach(l=>e.step(l)),i.forEach(l=>e.step(l))}function E9(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof op){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let p=0;p<o.length;p++){let m=o[p];m.step==i-1&&d.eq(o[p].style)&&(f=m)}f?(f.to=c,f.step=i):o.push({style:d,from:Math.max(a,t),to:c,step:i})}}}),o.forEach(s=>e.step(new Eo(s.from,s.to,s.style)))}function _9(e,t,n,r=n.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=s+l.nodeSize,u=r.matchType(l.type);if(!u)i.push(new fn(s,c,Z.empty));else{r=u;for(let d=0;d<l.marks.length;d++)n.allowsMarkType(l.marks[d].type)||e.step(new Eo(s,c,l.marks[d]));if(l.isText&&!n.spec.code){let d,f=/\r?\n|\r/g,p;for(;d=f.exec(l.text);)p||(p=new Z(U.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),i.push(new fn(s+d.index,s+d.index+d[0].length,p))}}s=c}if(!r.validEnd){let a=r.fillBefore(U.empty,!0);e.replace(s,s,new Z(a,0,0))}for(let a=i.length-1;a>=0;a--)e.step(i[a])}function C9(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function au(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let o=e.$from.node(r),i=e.$from.index(r),s=e.$to.indexAfter(r);if(r<e.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!C9(o,i,s))break}return null}function O9(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=U.empty,d=0;for(let m=i,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=U.from(r.node(m).copy(u)),d++):l--;let f=U.empty,p=0;for(let m=i,g=!1;m>n;m--)g||o.after(m+1)<o.end(m)?(g=!0,f=U.from(o.node(m).copy(f)),p++):c++;e.step(new Ut(l,c,s,a,new Z(u.append(f),d,p),u.size-d,!0))}function q1(e,t,n=null,r=e){let o=T9(e,t),i=o&&P9(r,t);return i?o.map(FE).concat({type:t,attrs:n}).concat(i.map(FE)):null}function FE(e){return{type:e,attrs:null}}function T9(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}function P9(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function M9(e,t,n){let r=U.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=U.from(n[s].type.create(n[s].attrs,r))}let o=t.start,i=t.end;e.step(new Ut(o,i,o,i,new Z(r,0,0),n.length,!0))}function R9(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&N9(e.doc,e.mapping.slice(i).map(a),r)){e.clearIncompatible(e.mapping.slice(i).map(a,1),r);let l=e.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return e.step(new Ut(c,u,c+1,u-1,new Z(U.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function N9(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function $9(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ut(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Z(U.from(s),0,0),1,!0))}function _c(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(p))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function A9(e,t,n=1,r){let o=e.doc.resolve(t),i=U.empty,s=U.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=U.from(o.node(a).copy(i));let u=r&&r[c];s=U.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}e.step(new fn(t,t,new Z(i.append(s),n,n),!0))}function ip(e,t){let n=e.resolve(t),r=n.index();return D9(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function D9(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function I9(e,t,n){let r=new fn(t-n,t+n,Z.empty,!0);e.step(r)}function vR(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function yR(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function G1(e,t,n=t,r=Z.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return xR(o,i,r)?new fn(t,n,r):new L9(o,i,r).fit()}function xR(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class L9{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=U.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=U.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new Z(i,s,a);return t>-1?new Ut(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new fn(r.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<t;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){t=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=_y(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(U.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=_y(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new Z(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=_y(t,n);if(o.childCount<=1&&n>0){let i=t.size-n<=n+o.size;this.unplaced=new Z(Gu(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new Z(Gu(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-t,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));d=d.matchFragment(o)}let p=a.size+t-(s.content.size-s.openEnd);for(;c<a.childCount;){let g=a.child(c),y=d.matchType(g.type);if(!y)break;c++,(c>1||l==0||g.content.size)&&(d=y,u.push(bR(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?p:-1)))}let m=c==a.childCount;m||(p=-1),this.placed=Yu(this.placed,n,U.from(u)),this.frontier[n].match=d,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<p;g++){let v=y.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),y=v.content}this.unplaced=m?t==0?Z.empty:new Z(Gu(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new Z(Gu(s.content,t,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Cy(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=Cy(t,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Cy(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Yu(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Yu(this.placed,this.depth,U.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(U.empty,!0);n.childCount&&(this.placed=Yu(this.placed,this.frontier.length,n))}}function Gu(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Gu(e.firstChild.content,t-1,n)))}function Yu(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Yu(e.lastChild.content,t-1,n)))}function _y(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function bR(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,bR(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(U.empty,!0)))),e.copy(r)}function Cy(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!j9(n,i.content,s)?a:null}function j9(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function z9(e){return e.spec.defining||e.spec.definingForContent}function F9(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(xR(o,i,r))return e.step(new fn(t,n,r));let s=SR(o,e.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,p=o.pos-1;f>0;f--,p--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let m=f.firstChild;if(c.push(m),p==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let p=c[f],m=z9(p.type);if(m&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(m||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),m=c[p];if(m)for(let g=0;g<s.length;g++){let y=s[(g+l)%s.length],v=!0;y<0&&(v=!1,y=-y);let x=o.node(y-1),w=o.index(y-1);if(x.canReplaceWith(w,w,m.type,m.marks))return e.replace(o.before(y),v?i.after(y):n,new Z(wR(r.content,0,r.openStart,p),p,r.openEnd))}}let d=e.steps.length;for(let f=s.length-1;f>=0&&(e.replace(t,n,r),!(e.steps.length>d));f--){let p=s[f];p<0||(t=o.before(p),n=i.after(p))}}function wR(e,t,n,r,o){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(wR(i.content,t+1,n,r,i)))}if(t>r){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(U.empty,!0))}return e}function B9(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=vR(e.doc,t,r.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new Z(U.from(r),0,0))}function U9(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=SR(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return e.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return e.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}function SR(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let i=e.start(o);if(i<e.pos-(e.depth-o)||t.end(o)>t.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&n.push(o)}return n}class Cc extends tn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Bt.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Bt.fromReplace(t,this.pos,this.pos+1,new Z(U.from(o),0,n.isLeaf?0:1))}getMap(){return Sr.empty}invert(t){return new Cc(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Cc(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Cc(n.pos,n.attr,n.value)}}tn.jsonID("attr",Cc);class xf extends tn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Bt.ok(r)}getMap(){return Sr.empty}invert(t){return new xf(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new xf(n.attr,n.value)}}tn.jsonID("docAttr",xf);let Kc=class extends Error{};Kc=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Kc.prototype=Object.create(Error.prototype);Kc.prototype.constructor=Kc;Kc.prototype.name="TransformError";class V9{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Ec}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Kc(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=Z.empty){let o=G1(this.doc,t,n,r);return o&&this.step(o),this}replaceWith(t,n,r){return this.replace(t,n,new Z(U.from(r),0,0))}delete(t,n){return this.replace(t,n,Z.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return F9(this,t,n,r),this}replaceRangeWith(t,n,r){return B9(this,t,n,r),this}deleteRange(t,n){return U9(this,t,n),this}lift(t,n){return O9(this,t,n),this}join(t,n=1){return I9(this,t,n),this}wrap(t,n){return M9(this,t,n),this}setBlockType(t,n=t,r,o=null){return R9(this,t,n,r,o),this}setNodeMarkup(t,n,r=null,o){return $9(this,t,n,r,o),this}setNodeAttribute(t,n,r){return this.step(new Cc(t,n,r)),this}setDocAttribute(t,n){return this.step(new xf(t,n)),this}addNodeMark(t,n){return this.step(new Ms(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Ye)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Wc(t,n)),this}split(t,n=1,r){return A9(this,t,n,r),this}addMark(t,n,r){return k9(this,t,n,r),this}removeMark(t,n,r){return E9(this,t,n,r),this}clearIncompatible(t,n,r){return _9(this,t,n,r),this}}const Oy=Object.create(null);class Be{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new H9(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=Z.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=t.mapping.slice(i);t.replaceRange(u.map(l.pos),u.map(c.pos),a?Z.empty:n),a==0&&VE(t,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=t.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?t.deleteRange(c,u):(t.replaceRangeWith(c,u,n),VE(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let o=t.parent.inlineContent?new Te(t):Hl(t.node(0),t.parent,t.pos,t.index(),n,r);if(o)return o;for(let i=t.depth-1;i>=0;i--){let s=n<0?Hl(t.node(0),t.node(i),t.before(i+1),t.index(i),n,r):Hl(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new qn(t.node(0))}static atStart(t){return Hl(t,t,0,0,1)||new qn(t)}static atEnd(t){return Hl(t,t,t.content.size,t.childCount,-1)||new qn(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Oy[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Oy)throw new RangeError("Duplicate use of selection JSON ID "+t);return Oy[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Te.between(this.$anchor,this.$head).getBookmark()}}Be.prototype.visible=!0;class H9{constructor(t,n){this.$from=t,this.$to=n}}let BE=!1;function UE(e){!BE&&!e.parent.inlineContent&&(BE=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Te extends Be{constructor(t,n=t){UE(t),UE(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Be.near(r);let o=t.resolve(n.map(this.anchor));return new Te(o.parent.inlineContent?o:r,r)}replace(t,n=Z.empty){if(super.replace(t,n),n==Z.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Te&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Zg(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Te(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let o=t.resolve(n);return new this(o,r==n?o:t.resolve(r))}static between(t,n,r){let o=t.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Be.findFrom(n,r,!0)||Be.findFrom(n,-r,!0);if(i)n=i.$head;else return Be.near(n,r)}return t.parent.inlineContent||(o==0?t=n:(t=(Be.findFrom(t,-r,!0)||Be.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=o<0&&(t=n))),new Te(t,n)}}Be.jsonID("text",Te);class Zg{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Zg(t.map(this.anchor),t.map(this.head))}resolve(t){return Te.between(t.resolve(this.anchor),t.resolve(this.head))}}class we extends Be{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=t.resolve(o);return r?Be.near(i):new we(i)}content(){return new Z(U.from(this.node),0,0)}eq(t){return t instanceof we&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Y1(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new we(t.resolve(n.anchor))}static create(t,n){return new we(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}we.prototype.visible=!1;Be.jsonID("node",we);class Y1{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Zg(r,r):new Y1(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&we.isSelectable(r)?new we(n):Be.near(n)}}class qn extends Be{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Z.empty){if(n==Z.empty){t.delete(0,t.doc.content.size);let r=Be.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new qn(t)}map(t){return new qn(t)}eq(t){return t instanceof qn}getBookmark(){return W9}}Be.jsonID("all",qn);const W9={map(){return this},resolve(e){return new qn(e)}};function Hl(e,t,n,r,o,i=!1){if(t.inlineContent)return Te.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&we.isSelectable(a))return we.create(e,n-(o<0?a.nodeSize:0))}else{let l=Hl(e,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function VE(e,t,n){let r=e.steps.length-1;if(r<t)return;let o=e.steps[r];if(!(o instanceof fn||o instanceof Ut))return;let i=e.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),e.setSelection(Be.near(e.doc.resolve(s),n))}const HE=1,Wp=2,WE=4;class K9 extends V9{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|HE)&~Wp,this.storedMarks=null,this}get selectionSet(){return(this.updated&HE)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Wp,this}ensureMarks(t){return Ye.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Wp)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Wp,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ye.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(t,i)),this.selection.empty||this.setSelection(Be.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=WE,this}get scrolledIntoView(){return(this.updated&WE)>0}}function KE(e,t){return!t||!e?e:e.bind(t)}class Xu{constructor(t,n,r){this.name=t,this.init=KE(n.init,r),this.apply=KE(n.apply,r)}}const q9=[new Xu("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Xu("selection",{init(e,t){return e.selection||Be.atStart(t.doc)},apply(e){return e.selection}}),new Xu("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Xu("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class Ty{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=q9.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Xu(r.key,r.spec.state,r))})}}class Ia{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",t),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ia(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new K9(this)}static create(t){let n=new Ty(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Ia(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(t,r);return r}reconfigure(t){let n=new Ty(this.schema,t.plugins),r=n.fields,o=new Ia(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(t,o)}return o}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new Ty(t.schema,t.plugins),i=new Ia(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Us.fromJSON(t.schema,n.doc);else if(s.name=="selection")i.selection=Be.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,t,n[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function kR(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=kR(o,t,{})),n[r]=o}return n}class Wi{constructor(t){this.spec=t,this.props={},t.props&&kR(t.props,this,this.props),this.key=t.key?t.key.key:ER("plugin")}getState(t){return t[this.key]}}const Py=Object.create(null);function ER(e){return e in Py?e+"$"+ ++Py[e]:(Py[e]=0,e+"$")}class lu{constructor(t="key"){this.key=ER(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}function _R(){return typeof document<"u"?document:null}function CR(e,t){if(typeof e!="string")return[e];var n=[e];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var r=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],o=t.escape||"___",i=!!t.flat;r.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,p,m){var g=n.push(f.slice(l[0].length,-l[1].length))-1;return u.push(g),o+g+o}n.forEach(function(f,p){for(var m,g=0;f!=m;)if(m=f,f=f.replace(c,d),g++>1e4)throw Error("References have circular dependency. Please, check them.");n[p]=f}),u=u.reverse(),n=n.map(function(f){return u.forEach(function(p){f=f.replace(new RegExp("(\\"+o+p+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,p=0;f=s.exec(l);){if(p++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?n:a(n[0],n)}function OR(e,t){if(t&&t.flat){var n=t&&t.escape||"___",r=e[0],o;if(!r)return"";for(var i=new RegExp("\\"+n+"([0-9]+)\\"+n),s=0;r!=o;){if(s++>1e4)throw Error("Circular references in "+e);o=r,r=r.replace(i,a)}return r}return e.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(e[c]==null)throw Error("Reference "+c+"is undefined");return e[c]}}function TR(e,t){return Array.isArray(e)?OR(e,t):CR(e,t)}TR.parse=CR;TR.stringify=OR;const G9={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},Y9={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},X9={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},Z9={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},J9={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},Q9={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},eF={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},tF={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var ea=Object.freeze({__proto__:null,COPY_DESCRIPTION:Y9,COPY_LABEL:G9,CUT_DESCRIPTION:Z9,CUT_LABEL:X9,PASTE_DESCRIPTION:Q9,PASTE_LABEL:J9,SELECT_ALL_DESCRIPTION:tF,SELECT_ALL_LABEL:eF});const nF={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},rF={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var qE=Object.freeze({__proto__:null,DESCRIPTION:rF,LABEL:nF});const oF={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1}
|
|
153
|
+
2 {Heading 2}
|
|
154
|
+
3 {Heading 3}
|
|
155
|
+
4 {Heading 4}
|
|
156
|
+
5 {Heading 5}
|
|
157
|
+
6 {Heading 6}
|
|
158
|
+
other {Heading}}`,comment:"Label for heading command with support for levels."};var iF=Object.freeze({__proto__:null,LABEL:oF});const sF={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},aF={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},lF={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},cF={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var Rm=Object.freeze({__proto__:null,REDO_DESCRIPTION:cF,REDO_LABEL:lF,UNDO_DESCRIPTION:aF,UNDO_LABEL:sF});const uF={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},dF={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var GE=Object.freeze({__proto__:null,DESCRIPTION:dF,LABEL:uF});const fF={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},pF={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},hF={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var X1=Object.freeze({__proto__:null,BULLET_LIST_LABEL:pF,ORDERED_LIST_LABEL:fF,TASK_LIST_LABEL:hF});const mF={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},gF={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},vF={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},yF={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var Nm=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:yF,CONVERT_LABEL:vF,INSERT_DESCRIPTION:gF,INSERT_LABEL:mF});const xF={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},bF={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var YE=Object.freeze({__proto__:null,DESCRIPTION:bF,LABEL:xF});class ro{constructor(t,n,r={}){this.match=t,this.match=t,this.handler=typeof n=="string"?wF(n):n,this.undoable=r.undoable!==!1}}function wF(e){return function(t,n,r,o){let i=e;if(n[1]){let s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length),r+=s;let a=r-o;a>0&&(i=n[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}}const SF=500;function kF({rules:e}){let t=new Wi({state:{init(){return null},apply(n,r){let o=n.getMeta(this);return o||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,o,i){return XE(n,r,o,i,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&XE(n,r.pos,r.pos,"",e,t)})}}},isInputRules:!0});return t}function XE(e,t,n,r,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-SF),a.parentOffset,null,"")+r;for(let c=0;c<o.length;c++){let u=o[c],d=u.match.exec(l),f=d&&u.handler(s,d,t-(d[0].length-r.length),n);if(f)return u.undoable&&f.setMeta(i,{transform:f,from:t,to:n,text:r}),e.dispatch(f),!0}return!1}const EF=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let o=n[r],i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let s=e.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1};new ro(/--$/,"—");new ro(/\.\.\.$/,"…");new ro(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“");new ro(/"$/,"”");new ro(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘");new ro(/'$/,"’");function Z1(e,t,n=null,r){return new ro(e,(o,i,s,a)=>{let l=n instanceof Function?n(i):n,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&q1(d,t,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&ip(c.doc,s-1)&&(!r||r(i,p))&&c.join(s-1),c})}function _F(e,t,n=null){return new ro(e,(r,o,i,s)=>{let a=r.doc.resolve(i),l=n instanceof Function?n(o):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?r.tr.delete(i,s).setBlockType(i,i,t,l):null})}const Vn=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},bf=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let ZE=null;const xi=function(e,t,n){let r=ZE||(ZE=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},al=function(e,t,n,r){return n&&(JE(e,t,n,r,-1)||JE(e,t,n,r,1))},CF=/^(img|br|input|textarea|hr)$/i;function JE(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Wo(e))){let i=e.parentNode;if(!i||i.nodeType!=1||J1(e)||CF.test(e.nodeName)||e.contentEditable=="false")return!1;t=Vn(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?Wo(e):0}else return!1}}function Wo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function OF(e,t,n){for(let r=t==0,o=t==Wo(e);r||o;){if(e==n)return!0;let i=Vn(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,o=o&&i==Wo(e)}}function J1(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Jg=function(e){return e.focusNode&&al(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ta(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function TF(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function PF(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const ti=typeof navigator<"u"?navigator:null,QE=typeof document<"u"?document:null,da=ti&&ti.userAgent||"",$x=/Edge\/(\d+)/.exec(da),PR=/MSIE \d/.exec(da),Ax=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(da),ur=!!(PR||Ax||$x),Vs=PR?document.documentMode:Ax?+Ax[1]:$x?+$x[1]:0,Do=!ur&&/gecko\/(\d+)/i.test(da);Do&&+(/Firefox\/(\d+)/.exec(da)||[0,0])[1];const Dx=!ur&&/Chrome\/(\d+)/.exec(da),Dn=!!Dx,MF=Dx?+Dx[1]:0,Yn=!ur&&!!ti&&/Apple Computer/.test(ti.vendor),qc=Yn&&(/Mobile\/\w+/.test(da)||!!ti&&ti.maxTouchPoints>2),Br=qc||(ti?/Mac/.test(ti.platform):!1),RF=ti?/Win/.test(ti.platform):!1,yo=/Android \d/.test(da),sp=!!QE&&"webkitFontSmoothing"in QE.documentElement.style,NF=sp?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function $F(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function di(e,t){return typeof e=="number"?e:e[t]}function AF(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function e_(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=bf(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?$F(i):AF(a),u=0,d=0;if(t.top<c.top+di(r,"top")?d=-(c.top-t.top+di(o,"top")):t.bottom>c.bottom-di(r,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+di(o,"top")-c.top:t.bottom-c.bottom+di(o,"bottom")),t.left<c.left+di(r,"left")?u=-(c.left-t.left+di(o,"left")):t.right>c.right-di(r,"right")&&(u=t.right-c.right+di(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let m=a.scrollLeft-f,g=a.scrollTop-p;t={left:t.left-m,top:t.top-g,right:t.right-m,bottom:t.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function DF(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,o;for(let i=(t.left+t.right)/2,s=n+1;s<Math.min(innerHeight,t.bottom);s+=5){let a=e.root.elementFromPoint(i,s);if(!a||a==e.dom||!e.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:MR(e.dom)}}function MR(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=bf(r));return t}function IF({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;RR(n,r==0?0:r-t)}function RR(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let $l=null;function LF(e){if(e.setActive)return e.setActive();if($l)return e.focus($l);let t=MR(e);e.focus($l==null?{get preventScroll(){return $l={preventScroll:!0},!0}}:void 0),$l||($l=!1,RR(t,0))}function NR(e,t){let n,r=2e8,o,i=0,s=t.top,a=t.top,l,c;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=xi(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let m=f[p];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>t.left?m.left-t.left:m.right<t.left?t.left-m.right:0;if(g<r){n=u,r=g,o=g&&n.nodeType==3?{left:m.right<t.left?m.right:m.left,top:t.top}:t,u.nodeType==1&&g&&(i=d+(t.left>=(m.left+m.right)/2?1:0));continue}}else m.top>t.top&&!l&&m.left<=t.left&&m.right>=t.left&&(l=u,c={left:Math.max(m.left,Math.min(m.right,t.left)),top:m.top});!n&&(t.left>=m.right&&t.top>=m.top||t.left>=m.left&&t.top>=m.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?jF(n,o):!n||r&&n.nodeType==1?{node:e,offset:i}:NR(n,o)}function jF(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let i=us(r,1);if(i.top!=i.bottom&&Q1(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function Q1(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function zF(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function FF(e,t,n){let{node:r,offset:o}=NR(t,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}function BF(e,t,n,r){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>r.left||l.top>r.top?o=a.posBefore:(l.right<r.left||l.bottom<r.top)&&(o=a.posAfter)),!a.contentDOM&&o<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}i=a.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}function $R(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=e.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Q1(t,c))return $R(s,t,c)}}if((i=(i+1)%r)==o)break}return e}function UF(e,t){let n=e.dom.ownerDocument,r,o=0,i=PF(n,t.left,t.top);i&&({node:r,offset:o}=i);let s=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!s||!e.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=e.dom.getBoundingClientRect();if(!Q1(t,c)||(s=$R(e.dom,t,c),!s))return null}if(Yn)for(let c=s;r&&c;c=bf(c))c.draggable&&(r=void 0);if(s=zF(s,t),r){if(Do&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=t.left&&d.bottom>t.top&&o++}let c;sp&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,r==e.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=BF(e,r,o,t))}a==null&&(a=FF(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function t_(e){return e.top<e.bottom||e.left<e.right}function us(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(t_(r))return r}return Array.prototype.find.call(n,t_)||e.getBoundingClientRect()}const VF=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function AR(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=sp||Do;if(r.nodeType==3)if(s&&(VF.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=us(xi(r,o,o),n);if(Do&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=us(xi(r,o-1,o-1),-1);if(c.top==l.top){let u=us(xi(r,o,o+1),-1);if(u.top!=l.top)return Iu(u,u.left<c.left)}}return l}else{let l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Iu(us(xi(r,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==Wo(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return My(l.getBoundingClientRect(),!1)}if(i==null&&o<Wo(r)){let l=r.childNodes[o];if(l.nodeType==1)return My(l.getBoundingClientRect(),!0)}return My(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==Wo(r))){let l=r.childNodes[o-1],c=l.nodeType==3?xi(l,Wo(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Iu(us(c,1),!1)}if(i==null&&o<Wo(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?xi(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Iu(us(c,-1),!0)}return Iu(us(r.nodeType==3?xi(r):r,-n),n>=0)}function Iu(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function My(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function DR(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function HF(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return DR(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=AR(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=xi(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const WF=/[\u0590-\u08ac]/;function KF(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return!WF.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:DR(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:m,focusOffset:g}=e.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),y})}let n_=null,r_=null,o_=!1;function qF(e,t,n){return n_==t&&r_==n?o_:(n_=t,r_=n,o_=n=="up"||n=="down"?HF(e,t,n):KF(e,t,n))}const Yr=0,i_=1,La=2,ni=3;class ap{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Yr,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==t)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let i,s;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(t==this.contentDOM)i=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(t==this.dom&&this.contentDOM)o=n>Vn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==t&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(t<i)return o.descAt(t-r-o.border);r=i}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>t||s instanceof LR){o=t-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof IR&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Vn(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Vn(i.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&t<=c){let u=s+l.border;if(t>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,u);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=Vn(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=Vn(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:t,to:n,fromOffset:o,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,o=!1){let i=Math.min(t,n),s=Math.max(t,n);for(let f=0,p=0;f<this.children.length;f++){let m=this.children[f],g=p+m.size;if(i>p&&s<g)return m.setSelection(t-p-m.border,n-p-m.border,r,o);p=g}let a=this.domFromPos(t,t?-1:1),l=n==t?a:this.domFromPos(n,n?-1:1),c=r.getSelection(),u=!1;if((Do||Yn)&&t==n){let{node:f,offset:p}=a;if(f.nodeType==3){if(u=!!(p&&f.nodeValue[p-1]==`
|
|
159
|
+
`),u&&p==f.nodeValue.length)for(let m=f,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:Vn(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=f.childNodes[p-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(Do&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||u&&Yn)&&al(a.node,a.offset,c.anchorNode,c.anchorOffset)&&al(l.node,l.offset,c.focusNode,c.focusOffset))return;let d=!1;if((c.extend||t==n)&&!u){c.collapse(a.node,a.offset);try{t!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(t>n){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let a=r+i.border,l=s-i.border;if(t>=a&&n<=l){this.dirty=t==r||n==s?La:i_,t==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ni:i.markDirty(t-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?La:ni}r=s}this.dirty=La}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?La:i_;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class IR extends ap{constructor(t,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(t){return this.dirty==Yr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class GF extends ap{constructor(t,n,r,o){super(t,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class ll extends ap{constructor(t,n,r,o){super(t,[],r,o),this.mark=n}static create(t,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=ko.renderSpec(document,n.type.spec.toDOM(n,r))),new ll(t,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&ni||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=ni&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Yr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Yr}}slice(t,n,r){let o=ll.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=jx(i,n,s,r)),t>0&&(i=jx(i,0,t,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}}class Hs extends ap{constructor(t,n,r,o,i,s,a,l,c){super(t,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(t,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=ko.renderSpec(document,n.type.spec.toDOM(n)));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=FR(u,r,n),c?l=new YF(t,n,r,o,u,d||null,f,c,i,s+1):n.isText?new Qg(t,n,r,o,u,f,i):new Hs(t,n,r,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>U.empty)}return t}matchesNode(t,n,r){return this.dirty==Yr&&t.eq(this.node)&&Lx(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,o=n,i=t.composing?this.localCompositionInfo(t,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new ZF(this,s&&s.node,t);eB(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,t):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Ye.none:this.node.child(u).marks,r,t),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,t);let p;l.findNodeMatch(c,u,d,f)||a&&t.state.selection.from>o&&t.state.selection.to<o+c.nodeSize&&(p=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,p,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],r,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==La)&&(s&&this.protectLocalComposition(t,s),jR(this.contentDOM,this.children,t),qc&&tB(this.dom))}localCompositionInfo(t,n){let{from:r,to:o}=t.state.selection;if(!(t.state.selection instanceof Te)||r<n||o>n+this.node.content.size)return null;let i=t.domSelectionRange(),s=nB(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=rB(this.node.content,a,r-n,o-n);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new GF(this,i,n,o);t.input.compositionNodes.push(s),this.children=jx(this.children,r,r+o.length,t,s)}update(t,n,r,o){return this.dirty==ni||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,o),!0)}updateInner(t,n,r,o){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Yr}updateOuterDeco(t){if(Lx(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=zR(this.dom,this.nodeDOM,Ix(this.outerDeco,this.node,n),Ix(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function s_(e,t,n,r,o){FR(r,t,e);let i=new Hs(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Qg extends Hs{constructor(t,n,r,o,i,s,a){super(t,n,r,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,o){return this.dirty==ni||this.dirty!=Yr&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Yr||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=Yr,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let o=this.node.cut(t,n),i=document.createTextNode(o.text);return new Qg(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ni)}get domAtom(){return!1}}class LR extends ap{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Yr&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class YF extends Hs{constructor(t,n,r,o,i,s,a,l,c,u){super(t,n,r,o,i,s,a,c,u),this.spec=l}update(t,n,r,o){if(this.dirty==ni)return!1;if(this.spec.update){let i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function jR(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=a_(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(a,r);if(s instanceof ll){let l=r?r.previousSibling:e.lastChild;jR(s.contentDOM,s.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=a_(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const $d=function(e){e&&(this.nodeName=e)};$d.prototype=Object.create(null);const ja=[new $d];function Ix(e,t,n){if(e.length==0)return ja;let r=n?ja[0]:new $d,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new $d(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new $d(t.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function zR(e,t,n,r){if(n==ja&&r==ja)return t;let o=t;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=e&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=ja[0]),o=l}XF(o,a||ja[0],s)}return o}function XF(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&e.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&e.classList.add(o[i]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(t.style);)e.style.removeProperty(o[1])}n.style&&(e.style.cssText+=n.style)}}function FR(e,t,n){return zR(e,e,ja,Ix(t,n,e.nodeType!=1))}function Lx(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function a_(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ZF{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=JF(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,t.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=Yr,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(t[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=ll.create(this.top,t[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,n,r,o,i){let s=this.top.children[o];return s.dirty==ni&&s.dom==s.contentDOM&&(s.dirty=La),s.update(t,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}t=n}}updateNextNode(t,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Hs){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&l.dirty!=ni&&Lx(n,l.outerDeco));if(!f&&l.update(t,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,t,n,r,o,s)))return this.top.children[this.index]=d,d.contentDOM&&(d.dirty=La,d.updateChildren(o,s+1),d.dirty=Yr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,o,i,s){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content))return null;let a=Hs.create(this.top,n,r,o,i,s);if(a.contentDOM){a.children=t.children,t.children=[];for(let l of a.children)l.parent=a}return t.destroy(),a}addNode(t,n,r,o,i){let s=Hs.create(this.top,t,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(t)&&(t==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new IR(this.top,t,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof ll;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Qg)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Yn||Dn)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new LR(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function JF(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof ll)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function QF(e,t){return e.type.side-t.type.side}function eB(e,t,n,r){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;c<e.childCount;c++){let u=e.child(c);r(u,o,t.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let y=o[s++];y.widget&&(u?(d||(d=[u])).push(y):u=y)}if(u)if(d){d.sort(QF);for(let y=0;y<d.length;y++)n(d[y],c,!!l)}else n(u,c,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(c<e.childCount)p=c,f=e.child(c++);else break;for(let y=0;y<a.length;y++)a[y].to<=i&&a.splice(y--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let m=i+f.nodeSize;if(f.isText){let y=m;s<o.length&&o[s].from<y&&(y=o[s].from);for(let v=0;v<a.length;v++)a[v].to<y&&(y=a[v].to);y<m&&(l=f.cut(y-i),f=f.cut(0,y-i),m=y,p=-1)}else for(;s<o.length&&o[s].to<m;)s++;let g=f.isInline&&!f.isLeaf?a.filter(y=>!y.inline):a.slice();r(f,g,t.forChild(i,f),p),i=m}}function tB(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function nB(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=Wo(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function rB(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let c=e.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let c=a<r?l.lastIndexOf(t,r-a-1):-1;if(c>=0&&c+t.length+a>=n)return a+c;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}function jx(e,t,n,r,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function ew(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Jg(n)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&we.isSelectable(u)&&o.parent&&!(u.isInline&&OF(n.focusNode,n.focusOffset,o.dom))){let d=o.posBefore;c=new we(s==d?a:r.resolve(d))}}else{let u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=t=="pointer"||e.state.selection.head<a.pos&&!i?1:-1;c=tw(e,l,a,u)}return c}function BR(e){return e.editable?e.hasFocus():VR(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Mi(e,t=!1){let n=e.state.selection;if(UR(e,n),!!BR(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Dn){let r=e.domSelectionRange(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&al(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)iB(e);else{let{anchor:r,head:o}=n,i,s;l_&&!(n instanceof Te)&&(n.$from.parent.inlineContent||(i=c_(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=c_(e,n.to))),e.docView.setSelection(r,o,e.root,t),l_&&(i&&u_(i),s&&u_(s)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&oB(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const l_=Yn||Dn&&MF<63;function c_(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Yn&&o&&o.contentEditable=="false")return Ry(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Ry(o);if(i)return Ry(i)}}function Ry(e){return e.contentEditable="true",Yn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function u_(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function oB(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!BR(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function iB(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,Vn(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&ur&&Vs<=11&&(r.disabled=!0,r.disabled=!1)}function UR(e,t){if(t instanceof we){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(d_(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else d_(e)}function d_(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function tw(e,t,n,r){return e.someProp("createSelectionBetween",o=>o(e,t,n))||Te.between(t,n,r)}function f_(e){return e.editable&&!e.hasFocus()?!1:VR(e)}function VR(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function sB(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return al(t.node,t.offset,n.anchorNode,n.anchorOffset)}function zx(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&Be.findFrom(i,t)}function bs(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function p_(e,t,n){let r=e.state.selection;if(r instanceof Te)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return bs(e,new Te(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=zx(e.state,t);return o&&o instanceof we?bs(e,o):!1}else if(!(Br&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?we.isSelectable(i)?bs(e,new we(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):sp?bs(e,new Te(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof we&&r.node.isInline)return bs(e,new Te(t>0?r.$to:r.$from));{let o=zx(e.state,t);return o?bs(e,o):!1}}}function $m(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Ad(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Al(e,t){return t<0?aB(e):lB(e)}function aB(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(Do&&n.nodeType==1&&r<$m(n)&&Ad(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Ad(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(HR(n))break;{let a=n.previousSibling;for(;a&&Ad(a,-1);)o=n.parentNode,i=Vn(a),a=a.previousSibling;if(a)n=a,r=$m(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Fx(e,n,r):o&&Fx(e,o,i)}function lB(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o=$m(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Ad(a,1))i=n,s=++r;else break}else{if(HR(n))break;{let a=n.nextSibling;for(;a&&Ad(a,1);)i=a.parentNode,s=Vn(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=$m(n);else{if(n=n.parentNode,n==e.dom)break;r=o=0}}}i&&Fx(e,i,s)}function HR(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function cB(e,t){for(;e&&t==e.childNodes.length&&!J1(e);)t=Vn(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function uB(e,t){for(;e&&!t&&!J1(e);)t=Vn(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function Fx(e,t,n){if(t.nodeType!=3){let i,s;(s=cB(t,n))?(t=s,n=0):(i=uB(t,n))&&(t=i,n=i.nodeValue.length)}let r=e.domSelection();if(Jg(r)){let i=document.createRange();i.setEnd(t,n),i.setStart(t,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&Mi(e)},50)}function h_(e,t){let n=e.state.doc.resolve(t);if(!(Dn||RF)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(t<n.end()){let i=e.coordsAtPos(t+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function m_(e,t,n){let r=e.state.selection;if(r instanceof Te&&!r.empty||n.indexOf("s")>-1||Br&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=zx(e.state,t);if(s&&s instanceof we)return bs(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=r instanceof qn?Be.near(s,t):Be.findFrom(s,t);return a?bs(e,a):!1}return!1}function g_(e,t){if(!(e.state.selection instanceof Te))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),e.dispatch(s),!0}return!1}function v_(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function dB(e){if(!Yn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;v_(e,r,"true"),setTimeout(()=>v_(e,r,"false"),20)}return!1}function fB(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function pB(e,t){let n=t.keyCode,r=fB(t);if(n==8||Br&&n==72&&r=="c")return g_(e,-1)||Al(e,-1);if(n==46&&!t.shiftKey||Br&&n==68&&r=="c")return g_(e,1)||Al(e,1);if(n==13||n==27)return!0;if(n==37||Br&&n==66&&r=="c"){let o=n==37?h_(e,e.state.selection.from)=="ltr"?-1:1:-1;return p_(e,o,r)||Al(e,o)}else if(n==39||Br&&n==70&&r=="c"){let o=n==39?h_(e,e.state.selection.from)=="ltr"?1:-1:1;return p_(e,o,r)||Al(e,o)}else{if(n==38||Br&&n==80&&r=="c")return m_(e,-1,r)||Al(e,-1);if(n==40||Br&&n==78&&r=="c")return dB(e)||m_(e,1,r)||Al(e,1);if(r==(Br?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function WR(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=e.someProp("clipboardSerializer")||ko.fromSchema(e.state.schema),a=ZR(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=XR[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=a.createElement(u[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,`
|
|
160
|
+
|
|
161
|
+
`);return{dom:l,text:f}}function KR(e,t,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=t&&(r||i||!n);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,i||r,e)}),i)return t?new Z(U.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
162
|
+
`))),0,0):Z.empty;let d=e.someProp("clipboardTextParser",f=>f(t,o,r,e));if(d)a=d;else{let f=o.marks(),{schema:p}=e.state,m=ko.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(p.text(g,f)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),s=gB(n),sp&&vB(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Hc.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!hB.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=yB(y_(a,+u[1],+u[2]),u[4]);else if(a=Z.maxOpen(mB(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d<a.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=y_(a,d,f)}return e.someProp("transformPasted",d=>{a=d(a,e)}),a}const hB=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function mB(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&GR(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=YR(s[s.length-1],i.length));let u=qR(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return U.from(s)}return e}function qR(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,U.from(e));return e}function GR(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=GR(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(U.from(qR(n,e,o+1))))}}function YR(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,YR(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(U.empty,!0);return e.copy(n.append(r))}function Bx(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(i=0),o<r-1&&(a=Bx(a,t,n,r,o+1,i)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(U.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function y_(e,t,n){return t<e.openStart&&(e=new Z(Bx(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Z(Bx(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const XR={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let x_=null;function ZR(){return x_||(x_=document.implementation.createHTMLDocument("title"))}function gB(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=ZR().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&XR[r[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=e,o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function vB(e){let t=e.querySelectorAll(Dn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function yB(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:o,openStart:i,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=U.from(l.create(r[a+1],o)),i++,s++}return new Z(o,i,s)}const Xn={},Zn={},xB={touchstart:!0,touchmove:!0};class bB{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function wB(e){for(let t in Xn){let n=Xn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{kB(e,r)&&!nw(e,r)&&(e.editable||!(r.type in Zn))&&n(e,r)},xB[t]?{passive:!0}:void 0)}Yn&&e.dom.addEventListener("input",()=>null),Ux(e)}function Rs(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function SB(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Ux(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>nw(e,r))})}function nw(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function kB(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function EB(e,t){!nw(e,t)&&Xn[t.type]&&(e.editable||!(t.type in Zn))&&Xn[t.type](e,t)}Zn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!QR(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(yo&&Dn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),qc&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",o=>o(e,Ta(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||pB(e,n)?n.preventDefault():Rs(e,"key")};Zn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Zn.keypress=(e,t)=>{let n=t;if(QR(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Br&&n.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Te)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,r.$from.pos,r.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function ev(e){return{left:e.clientX,top:e.clientY}}function _B(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function rw(e,t,n,r,o){if(r==-1)return!1;let i=e.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,n,i.nodeAfter,i.before(s),o,!0):a(e,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Oc(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function CB(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&we.isSelectable(r)?(Oc(e,new we(n),"pointer"),!0):!1}function OB(e,t){if(t==-1)return!1;let n=e.state.selection,r,o;n instanceof we&&(r=n.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(we.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(Oc(e,we.create(e.state.doc,o),"pointer"),!0):!1}function TB(e,t,n,r,o){return rw(e,"handleClickOn",t,n,r)||e.someProp("handleClick",i=>i(e,t,r))||(o?OB(e,n):CB(e,n))}function PB(e,t,n,r){return rw(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",o=>o(e,t,r))}function MB(e,t,n,r){return rw(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",o=>o(e,t,r))||RB(e,n,r)}function RB(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Oc(e,Te.create(r,0,r.content.size),"pointer"),!0):!1;let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)Oc(e,Te.create(r,a+1,a+1+s.content.size),"pointer");else if(we.isSelectable(s))Oc(e,we.create(r,a),"pointer");else continue;return!0}}function ow(e){return Am(e)}const JR=Br?"metaKey":"ctrlKey";Xn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=ow(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&_B(n,e.input.lastClick)&&!n[JR]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(ev(n));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new NB(e,s,n,!!r)):(i=="doubleClick"?PB:MB)(e,s.pos,s.inside,n)?n.preventDefault():Rs(e,"pointer"))};class NB{constructor(t,n,r,o){this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[JR],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=t.state.doc.nodeAt(n.inside),s=n.inside;else{let u=t.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof we&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Do&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Rs(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Mi(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(ev(t))),this.updateAllowDefault(t),this.allowDefault||!n?Rs(this.view,"pointer"):TB(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Yn&&this.mightDrag&&!this.mightDrag.node.isAtom||Dn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Oc(this.view,Be.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):Rs(this.view,"pointer")}move(t){this.updateAllowDefault(t),Rs(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Xn.touchstart=e=>{e.input.lastTouch=Date.now(),ow(e),Rs(e,"pointer")};Xn.touchmove=e=>{e.input.lastTouch=Date.now(),Rs(e,"pointer")};Xn.contextmenu=e=>ow(e);function QR(e,t){return e.composing?!0:Yn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const $B=yo?5e3:-1;Zn.compositionstart=Zn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Am(e,!0),e.markCursor=null;else if(Am(e),Do&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}eN(e,$B)};Zn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,eN(e,20))};function eN(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Am(e),t))}function tN(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=AB());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function AB(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Am(e,t=!1){if(!(yo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),tN(e),t||e.docView&&e.docView.dirty){let n=ew(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function DB(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const wf=ur&&Vs<15||qc&&NF<604;Xn.copy=Zn.cut=(e,t)=>{let n=t,r=e.state.selection,o=n.type=="cut";if(r.empty)return;let i=wf?null:n.clipboardData,s=r.content(),{dom:a,text:l}=WR(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):DB(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function IB(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function LB(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Sf(e,r.value,null,o,t):Sf(e,r.textContent,r.innerHTML,o,t)},50)}function Sf(e,t,n,r,o){let i=KR(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||Z.empty)))return!0;if(!i)return!1;let s=IB(i),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function nN(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Zn.paste=(e,t)=>{let n=t;if(e.composing&&!yo)return;let r=wf?null:n.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Sf(e,nN(r),r.getData("text/html"),o,n)?n.preventDefault():LB(e,n)};class rN{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const oN=Br?"altKey":"ctrlKey";Xn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(ev(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof we?o.to-1:o.to))){if(r&&r.mightDrag)s=we.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let u=e.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=e.docView&&(s=we.create(e.state.doc,u.posBefore))}}let a=(s||e.state.selection).content(),{dom:l,text:c}=WR(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(wf?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",wf||n.dataTransfer.setData("text/plain",c),e.dragging=new rN(a,!n[oN],s)};Xn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Zn.dragover=Zn.dragenter=(e,t)=>t.preventDefault();Zn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(ev(n));if(!o)return;let i=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",m=>{s=m(s,e)}):s=KR(e,nN(n.dataTransfer),wf?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[oN]);if(e.someProp("handleDrop",m=>m(e,n,s||Z.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?yR(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;if(a){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&we.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new we(p));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,y,v,x)=>m=x),c.setSelection(tw(e,p,c.doc.resolve(m)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Xn.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Mi(e)},20))};Xn.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Xn.beforeinput=(e,t)=>{if(Dn&&yo&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,Ta(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Zn)Xn[e]=Zn[e];function kf(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Dm{constructor(t,n){this.toDOM=t,this.spec=n||Ha,this.side=this.spec.side||0}map(t,n,r,o){let{pos:i,deleted:s}=t.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Et(i-r,i-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Dm&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&kf(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ws{constructor(t,n){this.attrs=t,this.spec=n||Ha}map(t,n,r,o){let i=t.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Et(i,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Ws&&kf(this.attrs,t.attrs)&&kf(this.spec,t.spec)}static is(t){return t.type instanceof Ws}destroy(){}}class iw{constructor(t,n){this.attrs=t,this.spec=n||Ha}map(t,n,r,o){let i=t.mapResult(n.from+o,1);if(i.deleted)return null;let s=t.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Et(i.pos-r,s.pos-r,this)}valid(t,n){let{index:r,offset:o}=t.content.findIndex(n.from),i;return o==n.from&&!(i=t.child(r)).isText&&o+i.nodeSize==n.to}eq(t){return this==t||t instanceof iw&&kf(this.attrs,t.attrs)&&kf(this.spec,t.spec)}destroy(){}}class Et{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Et(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Et(t,t,new Dm(n,r))}static inline(t,n,r,o){return new Et(t,n,new Ws(r,o))}static node(t,n,r,o){return new Et(t,n,new iw(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ws}get widget(){return this.type instanceof Dm}}const Wl=[],Ha={};class et{constructor(t,n){this.local=t.length?t:Wl,this.children=n.length?n:Wl}static create(t,n){return n.length?Im(n,t,0,Ha):$n}find(t,n,r){let o=[];return this.findInner(t??0,n??1e9,o,0,r),o}findInner(t,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=t&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,o+a,i)}}map(t,n,r){return this==$n||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Ha)}mapInner(t,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(t,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?jB(this.children,s||[],t,n,r,o,i):s?new et(s.sort(Wa),Wl):$n}add(t,n){return n.length?this==$n?et.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let o,i=0;t.forEach((a,l)=>{let c=l+r,u;if(u=sN(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,Im(u,a,c+1,Ha)),i+=3}});let s=iN(i?aN(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new et(s.length?this.local.concat(s).sort(Wa):this.local,o||this.children)}remove(t){return t.length==0||this==$n?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,d;u<t.length;u++)(d=t[u])&&d.from>a&&d.to<l&&(t[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=$n?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<t.length;i++)if(s=t[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new et(o,r):$n}forChild(t,n){if(this==$n)return this;if(n.isLeaf)return et.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(r=this.children[a+2]);break}let i=t+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof Ws){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new et(o.sort(Wa),Wl);return r?new _s([a,r]):a}return r||$n}eq(t){if(this==t)return!0;if(!(t instanceof et)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return sw(this.localsInner(t))}localsInner(t){if(this==$n)return Wl;if(t.inlineContent||!this.local.some(Ws.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ws||n.push(this.local[r]);return n}}et.empty=new et([],[]);et.removeOverlap=sw;const $n=et.empty;class _s{constructor(t){this.members=t}map(t,n){const r=this.members.map(o=>o.map(t,n,Ha));return _s.from(r)}forChild(t,n){if(n.isLeaf)return et.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(t,n);i!=$n&&(i instanceof _s?r=r.concat(i.members):r.push(i))}return _s.from(r)}eq(t){if(!(t instanceof _s)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(t);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?sw(r?n:n.sort(Wa)):Wl}static from(t){switch(t.length){case 0:return $n;case 1:return t[0];default:return new _s(t.every(n=>n instanceof et)?t:t.reduce((n,r)=>n.concat(r instanceof et?r:r.members),[]))}}}function jB(e,t,n,r,o,i,s){let a=e.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,p,m,g)=>{let y=g-m-(p-f);for(let v=0;v<a.length;v+=3){let x=a[v+1];if(x<0||f>x+u-d)continue;let w=a[v]+u-d;p>=w?a[v+1]=f<=w?-2:-1:f>=u&&y&&(a[v]+=y,a[v+1]+=y)}d+=y}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(e[c]+i),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(e[c+1]+i,-1),p=f-o,{index:m,offset:g}=r.content.findIndex(d),y=r.maybeChild(m);if(y&&g==d&&g+y.nodeSize==p){let v=a[c+2].mapInner(n,y,u+1,e[c]+i+1,s);v!=$n?(a[c]=d,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=zB(a,e,t,n,o,i,s),u=Im(c,r,0,s);t=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let p=u.children[d];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new et(t.sort(Wa),a)}function iN(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new Et(o.from+t,o.to+t,o.type))}return n}function zB(e,t,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&a(e[l+2],t[l]+i+1);return n}function sN(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let i=0,s;i<e.length;i++)(s=e[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),e[i]=null);return o}function aN(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Im(e,t,n,r){let o=[],i=!1;t.forEach((a,l)=>{let c=sN(e,a,l+n);if(c){i=!0;let u=Im(c,a,n+l+1,r);u!=$n&&o.push(l,l+a.nodeSize,u)}});let s=iN(i?aN(e):e,-n).sort(Wa);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new et(s,o):$n}function Wa(e,t){return e.from-t.from||e.to-t.to}function sw(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from==r.from){i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),b_(t,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),b_(t,o,r.copy(i.from,r.to)));break}}}return t}function b_(e,t,n){for(;t<e.length&&Wa(n,e[t])>0;)t++;e.splice(t,0,n)}function Ny(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=$n&&t.push(r)}),e.cursorWrapper&&t.push(et.create(e.state.doc,[e.cursorWrapper.deco])),_s.from(t)}const FB={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},BB=ur&&Vs<=11;class UB{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class VB{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new UB,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);ur&&Vs<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),BB&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,FB)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(f_(this.view)){if(this.suppressingSelectionUpdates)return Mi(this.view);if(ur&&Vs<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&al(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=bf(i))n.add(i);for(let i=t.anchorNode;i;i=bf(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&f_(t)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(Do&&l.length>1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Jg(r)&&(c=ew(t))&&c.eq(Be.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Mi(t),this.currentSelection.set(r),t.scrollToSelection()):(i>-1||o)&&(i>-1&&(t.docView.markDirty(i,s),HB(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||Mi(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;u<t.addedNodes.length;u++)n.push(t.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,i=t.nextSibling;if(ur&&Vs<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=t.addedNodes[u];(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==t.target?Vn(o)+1:0,a=r.localPosFromDOM(t.target,s,-1),l=i&&i.parentNode==t.target?Vn(i):t.target.childNodes.length,c=r.localPosFromDOM(t.target,l,1);return{from:a,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let w_=new WeakMap,S_=!1;function HB(e){if(!w_.has(e)&&(w_.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Do,S_)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),S_=!0}}function WB(e){let t;function n(l){l.preventDefault(),l.stopImmediatePropagation(),t=l.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,o=t.startOffset,i=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return al(a.node,a.offset,i,s)&&([r,o,i,s]=[i,s,r,o]),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}}function KB(e,t,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=e.docView.parseRange(t,n),l=e.domSelectionRange(),c,u=l.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Jg(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Dn&&e.input.lastKeyCode===8)for(let y=i;y>o;y--){let v=r.childNodes[y-1],x=v.pmViewDesc;if(v.nodeName=="BR"&&!x){i=y;break}if(!x||x.size)break}let d=e.state.doc,f=e.someProp("domParser")||Hc.fromSchema(e.state.schema),p=d.resolve(s),m=null,g=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:qB,context:p});if(c&&c[0].pos!=null){let y=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=y),m={anchor:y+s,head:v+s}}return{doc:g,sel:m,from:s,to:a}}function qB(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Yn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||Yn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const GB=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function YB(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let M=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,A=ew(e,M);if(A&&!e.state.selection.eq(A)){if(Dn&&yo&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",L=>L(e,Ta(13,"Enter"))))return;let I=e.state.tr.setSelection(A);M=="pointer"?I.setMeta("pointer",!0):M=="key"&&I.scrollIntoView(),i&&I.setMeta("composition",i),e.dispatch(I)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l=e.state.selection,c=KB(e,t,n),u=e.state.doc,d=u.slice(c.from,c.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p="end"):(f=e.state.selection.from,p="start"),e.input.lastKeyCode=null;let m=JB(d.content,c.doc.content,c.from,f,p);if((qc&&e.input.lastIOSEnter>Date.now()-225||yo)&&o.some(M=>M.nodeType==1&&!GB.test(M.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",M=>M(e,Ta(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof Te&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let M=k_(e,e.state.doc,c.sel);if(M&&!M.eq(e.state.selection)){let A=e.state.tr.setSelection(M);i&&A.setMeta("composition",i),e.dispatch(A)}}return}if(Dn&&e.cursorWrapper&&c.sel&&c.sel.anchor==e.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let M=m.endB-m.start;c.sel={anchor:c.sel.anchor+M,head:c.sel.anchor+M}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof Te&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=c.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),ur&&Vs<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),y=c.doc.resolveNoCache(m.endB-c.from),v=u.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&v.end()>=m.endA,w;if((qc&&e.input.lastIOSEnter>Date.now()-225&&(!x||o.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!x&&g.pos<c.doc.content.size&&!g.sameParent(y)&&(w=Be.findFrom(c.doc.resolve(g.pos+1),1,!0))&&w.head==y.pos)&&e.someProp("handleKeyDown",M=>M(e,Ta(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&ZB(u,m.start,m.endA,g,y)&&e.someProp("handleKeyDown",M=>M(e,Ta(8,"Backspace")))){yo&&Dn&&e.domObserver.suppressSelectionUpdates();return}Dn&&yo&&m.endB==m.start&&(e.input.lastAndroidDelete=Date.now()),yo&&!x&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,y=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(M){return M(e,Ta(13,"Enter"))})},20));let k=m.start,E=m.endA,S,_,P;if(x){if(g.pos==y.pos)ur&&Vs<=11&&g.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Mi(e),20)),S=e.state.tr.delete(k,E),_=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(P=XB(g.parent.content.cut(g.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,m.endA-v.start()))))S=e.state.tr,P.type=="add"?S.addMark(k,E,P.mark):S.removeMark(k,E,P.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let M=g.parent.textBetween(g.parentOffset,y.parentOffset);if(e.someProp("handleTextInput",A=>A(e,k,E,M)))return;S=e.state.tr.insertText(M,k,E)}}if(S||(S=e.state.tr.replace(k,E,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let M=k_(e,S.doc,c.sel);M&&!(Dn&&yo&&e.composing&&M.empty&&(m.start!=m.endB||e.input.lastAndroidDelete<Date.now()-100)&&(M.head==k||M.head==S.mapping.map(E)-1)||ur&&M.empty&&M.head==k)&&S.setSelection(M)}_&&S.ensureMarks(_),i&&S.setMeta("composition",i),e.dispatch(S.scrollIntoView())}function k_(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:tw(e,t.resolve(n.anchor),t.resolve(n.head))}function XB(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<t.childCount;u++)c.push(l(t.child(u)));if(U.from(c).eq(e))return{mark:a,type:s}}function ZB(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||$y(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve($y(i,!0,!0));return!s.parent.isTextblock||s.pos>n||$y(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function $y(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let i=e.node(r).maybeChild(e.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function JB(e,t,n,r,o){let i=e.findDiffStart(t,n);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&e.size<t.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<t.size&&E_(t.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<e.size&&E_(e.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function E_(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class QB{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new bB,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(P_),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=O_(this),C_(this),this.nodeViews=T_(this),this.docView=s_(this.state.doc,__(this),Ny(this),this.dom,this),this.domObserver=new VB(this,(r,o,i,s)=>YB(this,r,o,i,s)),this.domObserver.start(),wB(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Ux(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(P_),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let o=this.state,i=!1,s=!1;t.storedMarks&&this.composing&&(tN(this),s=!0),this.state=t;let a=o.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=T_(this);tU(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ux(this),this.editable=O_(this),C_(this);let l=Ny(this),c=__(this),u=o.plugins!=t.plugins&&!o.doc.eq(t.doc)?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(t.doc,c,l);(d||!t.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&DF(this);if(s){this.domObserver.stop();let p=d&&(ur||Dn)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&eU(o.selection,t.selection);if(d){let m=Dn?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,c,l,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=s_(t.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&sB(this))?Mi(this,p):(UR(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&IF(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof we){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&e_(this,n.getBoundingClientRect(),t)}else e_(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new rN(t.slice,t.move,o<0?void 0:we.create(this.state.doc,o))}someProp(t,n){let r=this._props&&this._props[t],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[t];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[t];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(ur){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&LF(this.dom),Mi(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return UF(this,t)}coordsAtPos(t,n=1){return AR(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let o=this.docView.posFromDOM(t,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,n){return qF(this,n||this.state,t)}pasteHTML(t,n){return Sf(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Sf(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(SB(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ny(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return EB(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Yn&&this.root.nodeType===11&&TF(this.dom.ownerDocument)==this.dom?WB(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function __(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Et.node(0,e.state.doc.content.size,t)]}function C_(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Et.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function O_(e){return!e.someProp("editable",t=>t(e.state)===!1)}function eU(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function T_(e){let t=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=r[o])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function tU(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r}function P_(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var nU=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const rU=ai(nU);var lN=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},De=(e,t,n)=>(lN(e,t,"read from private field"),n?n.call(e):t.get(e)),fi=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},mt=(e,t,n,r)=>(lN(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function oU(e){return!!(e.prev&&e.next&&e.prev.text.full!==e.next.text.full)}function iU(e){return!!(e.prev&&e.next&&e.prev.range.cursor!==e.next.range.cursor)}function sU(e){return!!(!e.prev&&e.next)}function aU(e){return!!(e.prev&&!e.next)}function lU(e){return!!(e.prev&&e.next&&e.prev.range.from!==e.next.range.from)}function cU(e){return e==="invalid-exit-split"}var uU=["jump-backward-exit","jump-forward-exit"],dU=["jump-backward-change","jump-forward-change"];function fU(e){var t,n;return Ao(uU,(t=e.exit)==null?void 0:t.exitReason)||Ao(dU,(n=e.change)==null?void 0:n.changeReason)}function M_(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function R_(e){return jn(e)&&e instanceof Te}function sr(e){const{match:t,changeReason:n,exitReason:r}=e;return{...t,changeReason:n,exitReason:r}}function pU(e,t){const{invalidPrefixCharacters:n,validPrefixCharacters:r}=t;return n?!new RegExp(Hx(n)).test(e):new RegExp(Hx(r)).test(e)}function hU(e){const{text:t,regexp:n,$pos:r,suggester:o}=e,i=r.start();let s;return Xg(t,n).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(pU(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!_e(u)||!_e(d))return;const f=c+u.length,p=Math.min(f,r.pos),m=p-c;c<r.pos&&f>=r.pos&&(s={range:{from:c,to:f,cursor:p},match:a,query:{partial:u.slice(d.length,m),full:u.slice(d.length)},text:{partial:u.slice(0,m),full:u},textAfter:r.doc.textBetween(f,r.end(),Ps,Ps),textBefore:r.doc.textBetween(i,c,Ps,Ps),suggester:o})}}),s}function cN(e){const{$pos:t,suggester:n}=e,{char:r,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=n,d=kU({char:r,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=t.doc.textBetween(t.before(),t.end(),Ps,Ps);return hU({suggester:n,text:f,regexp:d,$pos:t,char:r,name:o})}function uN(e){const{state:t,match:n}=e;try{return cN({$pos:t.doc.resolve(n.range.cursor),suggester:n.suggester})}catch{return}}function dN(e){const{prev:t,next:n,state:r}=e;return!n&&t.range.from>=r.doc.nodeSize?{exit:sr({match:t,exitReason:"delete"})}:!n||!t.query.partial?{exit:sr({match:t,exitReason:"invalid-exit-split"})}:t.range.to===n.range.cursor?{exit:sr({match:n,exitReason:"exit-end"})}:t.query.partial?{exit:sr({match:n,exitReason:"exit-split"})}:{}}function mU(e){const{prev:t,next:n,state:r}=e,o=he(),i=uN({state:r,match:t}),{exit:s}=i&&i.query.full!==t.query.full?dN({prev:t,next:i,state:r}):o;return t.range.from<n.range.from?{exit:s??sr({match:t,exitReason:"jump-forward-exit"}),change:sr({match:n,changeReason:"jump-forward-change"})}:{exit:s??sr({match:t,exitReason:"jump-backward-exit"}),change:sr({match:n,changeReason:"jump-backward-change"})}}function gU(e){const{match:t,state:n,$pos:r}=e,{selection:o}=n,i=uN({match:t,state:n});return!i||i.text.full!==t.text.full?dN({prev:t,next:i,state:n}):!o.empty&&(o.from<=t.range.from||o.to>=t.range.to)?{exit:sr({match:t,exitReason:"selection-outside"})}:r.pos>t.range.to?{exit:sr({match:t,exitReason:"move-end"})}:r.pos<=t.range.from?{exit:sr({match:t,exitReason:"move-start"})}:{}}function vU(e){const{prev:t,next:n,state:r,$pos:o}=e,i=he();if(!t&&!n)return i;const s={prev:t,next:n};return lU(s)?mU({prev:s.prev,next:s.next,state:r}):sU(s)?{change:sr({match:s.next,changeReason:"start"})}:aU(s)?gU({$pos:o,match:s.prev,state:r}):oU(s)?{change:sr({match:s.next,changeReason:"change-character"})}:iU(s)?{change:sr({match:s.next,changeReason:r.selection.empty?"move":"selection-inside"})}:i}function N_(e,t){for(let n=e.depth;n>0;n--){const r=e.node(n);if(t.includes(r.type.name))return!0}return!1}function Vx(e,t){const{$from:n,$to:r}=e;return fN(e,t)?!0:KM(n.pos,r.pos).some(o=>yU(n.doc.resolve(o),t))}function fN(e,t){const{$from:n,$to:r}=e,o=new Set((n.marksAcross(r)??[]).map(i=>i.type.name));return t.some(i=>o.has(i))}function yU(e,t){const n=new Set(e.marks().map(r=>r.type.name));return t.some(r=>n.has(r))}function xU(e,t){const{$cursor:n}=t,{validMarks:r,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!r&&!o&&Qs(i)&&Qs(s)?!0:!(r&&!fN(t,r)||o&&!N_(n,o)||!r&&Vx(t,i)||!o&&N_(n,s))}function $_(e){const{suggesters:t,$pos:n,selectionEmpty:r}=e;for(const o of t)if(!(o.emptySelectionsOnly&&!r))try{const i=cN({suggester:o,$pos:n});if(!i)continue;const s={$from:n.doc.resolve(i.range.from),$to:n.doc.resolve(i.range.to),$cursor:n};if(xU(o,s)&&o.isValidPosition(s,i))return i}catch{}}function Hx(e){return Fz(e)?e.source:e}function bU(e){return e?"^":""}function wU(e,t){return`(?:${Hx(e)}){${t},}`}function SU(e){return _e(e)?new RegExp(rU(e)):e}function kU(e){const{char:t,matchOffset:n,startOfLine:r,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=SU(t).source;return i&&(u=`(${u})`),new RegExp(`${bU(r)}${u}${wU(o,n)}`,c)}var EU={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},pN="__ignore_prosemirror_suggest_update__",vh,Zu,an,ds,Kl,Bo,Gt,fs,ql,hN=class{constructor(e){fi(this,vh,!1),fi(this,Zu,!1),fi(this,an,void 0),fi(this,ds,void 0),fi(this,Kl,void 0),fi(this,Bo,he()),fi(this,Gt,et.empty),fi(this,fs,!1),fi(this,ql,!1),this.setMarkRemoved=()=>{mt(this,fs,!0)},this.findNextTextSelection=n=>{const r=n.$from.doc,o=Math.min(r.nodeSize-2,n.to+1),i=r.resolve(o),s=Be.findFrom(i,1,!0);if(R_(s))return s},this.ignoreNextExit=()=>{mt(this,Zu,!0)},this.addIgnored=({from:n,name:r,specific:o=!1})=>{const i=De(this,an).find(u=>u.name===r);if(!i)throw new Error(`No suggester exists for the name provided: ${r}`);const s=_e(i.char)?i.char.length:1,a=n+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=Et.inline(n,a,{nodeName:i.ignoredTag,...l},{name:r,specific:o,char:i.char});mt(this,Gt,De(this,Gt).add(this.view.state.doc,[c]))},this.removeIgnored=({from:n,name:r})=>{const o=De(this,an).find(a=>a.name===r);if(!o)throw new Error(`No suggester exists for the name provided: ${r}`);const i=_e(o.char)?o.char.length:1,s=De(this,Gt).find(n,n+i)[0];!s||s.spec.name!==r||mt(this,Gt,De(this,Gt).remove([s]))},this.clearIgnored=n=>{if(!n){mt(this,Gt,et.empty);return}const o=De(this,Gt).find().filter(({spec:i})=>i.name===n);mt(this,Gt,De(this,Gt).remove(o))},this.findMatchAtPosition=(n,r)=>{const o=r?De(this,an).filter(i=>i.name===r):De(this,an);return $_({suggesters:o,$pos:n,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{mt(this,ql,!0)};const t=A_();mt(this,an,e.map(t)),mt(this,an,ol(De(this,an),(n,r)=>r.priority-n.priority))}static create(e){return new hN(e)}get decorationSet(){return De(this,Gt)}get removed(){return De(this,fs)}get match(){return De(this,ds)?De(this,ds):De(this,Kl)&&De(this,Bo).exit?De(this,Kl):void 0}init(e){return this.view=e,this}createProps(e){const{name:t,char:n}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:n,...e}}shouldRunExit(){return De(this,Zu)?(mt(this,Zu,!1),!1):!0}updateWithNextSelection(e){var t,n,r;const o=this.findNextTextSelection(e.selection);if(o)for(const i of De(this,an)){const s=(t=De(this,Bo).change)==null?void 0:t.suggester.name,a=(n=De(this,Bo).exit)==null?void 0:n.suggester.name;(r=i.checkNextValidSelection)==null||r.call(i,o.$from,e,{change:s,exit:a})}}changeHandler(e,t){const{change:n,exit:r}=De(this,Bo),o=this.match;if(!n&&!r||!M_(o))return;const i=t===(r==null?void 0:r.suggester.appendTransaction)&&this.shouldRunExit(),s=t===(n==null?void 0:n.suggester.appendTransaction);if(!(!i&&!s)){if(n&&r&&fU({change:n,exit:r})){const a=this.createProps(r),l=this.createProps(n),c=r.range.from<n.range.from;i&&r.suggester.onChange(a,e),s&&n.suggester.onChange(l,e),i&&mt(this,fs,!1);return}n&&s&&n.suggester.onChange(this.createProps(n),e),r&&i&&(r.suggester.onChange(this.createProps(r),e),mt(this,fs,!1),cU(r.exitReason)&&mt(this,Bo,he()))}}mapIgnoredDecorations(e){const t=De(this,Gt).map(e.mapping,e.doc),r=t.find().filter(({from:o,to:i,spec:s})=>{const a=_e(s.char)?s.char.length:1;return i-o!==a});mt(this,Gt,t.remove(r))}shouldIgnoreMatch({range:e,suggester:{name:t}}){return De(this,Gt).find().some(({spec:o,from:i})=>i!==e.from?!1:o.specific?o.name===t:!0)}resetState(){mt(this,Bo,he()),mt(this,ds,void 0),mt(this,fs,!1),mt(this,ql,!1)}updateReasons(e){const{$pos:t,state:n}=e,r=De(this,vh),o=De(this,an),i=n.selection.empty,s=R_(n.selection)?$_({suggesters:o,$pos:t,docChanged:r,selectionEmpty:i}):void 0;mt(this,ds,s&&this.shouldIgnoreMatch(s)?void 0:s),mt(this,Bo,vU({next:De(this,ds),prev:De(this,Kl),state:n,$pos:t}))}addSuggester(e){const t=De(this,an).find(r=>r.name===e.name),n=A_();if(t)mt(this,an,De(this,an).map(r=>r===t?n(e):r));else{const r=[...De(this,an),n(e)];mt(this,an,ol(r,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(e.name)}removeSuggester(e){const t=_e(e)?e:e.name;mt(this,an,De(this,an).filter(n=>n.name!==t)),this.clearIgnored(t)}toJSON(){return this.match}apply(e){const{exit:t,change:n}=De(this,Bo);if(De(this,ql)&&(mt(this,ql,!1),!(t!=null&&t.suggester.appendTransaction)&&!(n!=null&&n.suggester.appendTransaction)))return this;const{tr:r,state:o}=e,i=r.docChanged||r.selectionSet;return r.getMeta(pN)||!i&&!De(this,fs)?this:(mt(this,vh,r.docChanged),this.mapIgnoredDecorations(r),t&&this.resetState(),mt(this,Kl,De(this,ds)),this.updateReasons({$pos:r.selection.$from,state:o}),this)}createDecorations(e){const t=this.match;if(!M_(t))return De(this,Gt);const{disableDecorations:n}=t.suggester;if(pt(n)?n(e,t):n)return De(this,Gt);const{range:o,suggester:i}=t,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(t)?De(this,Gt):De(this,Gt).add(e.doc,[Et.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},_U=hN;vh=new WeakMap;Zu=new WeakMap;an=new WeakMap;ds=new WeakMap;Kl=new WeakMap;Bo=new WeakMap;Gt=new WeakMap;fs=new WeakMap;ql=new WeakMap;function A_(){const e=new Set;return t=>{if(e.has(t.name))throw new Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);const n={...EU,...t};return e.add(t.name),n}}var mN=new lu("suggest");function aw(e){return mN.getState(e)}function D_(e,t){return aw(e).addSuggester(t)}function I_(e){e.setMeta(pN,!0)}function CU(e,t){return aw(e).removeSuggester(t)}function OU(...e){const t=_U.create(e);return new Wi({key:mN,view:n=>(t.init(n),{update:r=>t.changeHandler(r.state.tr,!1)}),state:{init:()=>t,apply:(n,r,o,i)=>t.apply({tr:n,state:i})},appendTransaction:(n,r,o)=>{const i=o.tr;return t.updateWithNextSelection(i),t.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(t.setLastChangeFromAppend(),i):null},props:{decorations:n=>t.createDecorations(n)}})}function lw(e,t){const n=Object.getPrototypeOf(t);let r=e.selection,o=e.doc,i=e.storedMarks;const s=he();for(const[a,l]of Object.entries(t))s[a]={value:l};return Object.create(n,{...s,storedMarks:{get(){return i}},selection:{get(){return r}},doc:{get(){return o}},tr:{get(){return r=e.selection,o=e.doc,i=e.storedMarks,e}}})}function Dd(e){return({state:t,dispatch:n,view:r,tr:o})=>e(lw(o,t),n,r)}function L_(e){return t=>{var n;return be(t.dispatch===void 0||t.dispatch===((n=t.view)==null?void 0:n.dispatch),{code:q.NON_CHAINABLE_COMMAND}),e(t)}}function TU(...e){return({state:t,dispatch:n,view:r,tr:o,...i})=>{for(const s of e)if(s({state:t,dispatch:n,view:r,tr:o,...i}))return!0;return!1}}var xo={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return xo.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return xo.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return xo.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return xo.isNode?process.platform==="darwin":xo.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function rs(e,t){var n;const r=eV(e);return((n=r==null?void 0:r.getComputedStyle(e))==null?void 0:n.getPropertyValue(t))??""}function Nn(e,t){return Object.assign(e.style,t)}function Wx(e){return jn(e)&&Mr(e.nodeType)&&_e(e.nodeName)}function ri(e){return Wx(e)&&e.nodeType===1}function cw(e){const{types:t,node:n}=e;if(!n)return!1;const r=o=>o===n.type||o===n.type.name;return en(t)?t.some(r):r(t)}function PU(e,t){const{tr:n}=t;return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function tv(e){const{predicate:t,selection:n}=e,r=vN(n)?n.selection.$from:fw(n)?n.$from:n;for(let o=r.depth;o>0;o--){const i=r.node(o),s=o>0?r.before(o):0,a=r.start(o),l=s+i.nodeSize;if(t(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function MU(e){const{depth:t}=e,n=t>0?e.before(t):0,r=e.node(t),o=e.start(t),i=n+r.nodeSize;return{pos:n,start:o,node:r,end:i,depth:t}}function Ef(e){const{types:t,selection:n}=e;return tv({predicate:r=>cw({types:t,node:r}),selection:n})}function RU(e){const{types:t,selection:n}=e;if(!(!rv(n)||!cw({types:t,node:n.node})))return{pos:n.$from.pos,depth:n.$from.depth,start:n.$from.start(),end:n.$from.pos+n.node.nodeSize,node:n.node}}function uw(e){return fw(e)?e.empty:e.selection.empty}function NU(e){return e.docChanged||e.selectionSet}function $U(e){return!!_f(e)}function _f(e){const{state:t,type:n,attrs:r}=e,{selection:o,doc:i}=t,s=_e(n)?i.type.schema.nodes[n]:n;be(s,{code:q.SCHEMA,message:`No node exists for ${n}`});const a=RU({selection:o,types:n})??tv({predicate:l=>l.type===s,selection:o});return!r||Sm(r)||!a||a.node.hasMarkup(s,{...a.node.attrs,...r})?a:void 0}function Lm(...e){return t=>{if(!ME(e))return!1;const[n,...r]=e;let o=!1;const i=(...l)=>()=>{if(!ME(l))return!1;o=!0;const[,...c]=l;return Lm(...l)({...t,next:i(...c)})},s=i(...r),a=n({...t,next:s});return o||a?a:s()}}function AU(e,t){const n=new Map,r=he();for(const o of e)for(const[i,s]of Jt(o)){const l=[...n.get(i)??[],s],c=Lm(...l);n.set(i,l),r[i]=t(c)}return r}function DU(e){return AU(e,t=>(n,r,o)=>t({state:n,dispatch:r,view:o,tr:n.tr,next:()=>!1}))}function dw(e,t){const n=e.attrs??{};return Object.entries(t).every(([r,o])=>n[r]===o)}function IU(e){return xN(e,[_i,Ut,fn,Eo])}function cu(e){return jn(e)}function uu(e,t){return en(t)?Ao(t,e[Li]):t===e[Li]}function LU(e){return jn(e)&&e instanceof Mx}function jU(e,t){return _e(e)?Pt(t.nodes,e):e}function gN(e){return jn(e)&&e instanceof op}function zU(e,t){return _e(e)?Pt(t.marks,e):e}function nv(e){return jn(e)&&e instanceof Us}function FU(e){return jn(e)&&e instanceof U}function BU(e){return jn(e)&&e instanceof Ye}function vN(e){return jn(e)&&e instanceof Ia}function bl(e){return jn(e)&&e instanceof Te}function UU(e){return jn(e)&&e instanceof qn}function fw(e){return jn(e)&&e instanceof Be}function VU(e){return jn(e)&&e instanceof Vc}function j_(e){const{trState:t,from:n,to:r,type:o,attrs:i={}}=e,{doc:s}=t,a=zU(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(n,r,a);let l=!1;return r>n&&s.nodesBetween(n,r,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:dw(d,i)),!l)),l}function rv(e){return jn(e)&&e instanceof we}function jm(e){const{trState:t,type:n,attrs:r={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t,c=_e(n)?a.type.schema.marks[n]:n;if(be(c,{code:q.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)<a.nodeSize&&j_({...e,from:o,to:i})}catch{return!1}return s.empty?(l??s.$from.marks()).some(d=>d.type!==n?!1:dw(d,r??{})):j_({...e,from:s.from,to:s.to})}function pw(e,t={}){const n=HU(e.type.schema);if(!n)return!1;const{ignoreAttributes:r,ignoreDocAttributes:o}=t;return r?yN(n,e):o?n.content.eq(e.content):n.eq(e)}function yN(e,t){if(e===t)return!0;const n=e.type===t.type&&Ye.sameSet(e.marks,t.marks);function r(){if(e.content===t.content)return!0;if(e.content.size!==t.content.size)return!1;const o=[],i=[];e.content.forEach(s=>o.push(s)),t.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!yN(a,l))return!1}return!0}return n&&r()}function HU(e){var t;return((t=e.nodes.doc)==null?void 0:t.createAndFill())??void 0}function ov(e){for(const t of Object.values(e.nodes))if(t.name!=="doc"&&(t.isBlock||t.isTextblock))return t;be(!1,{code:q.SCHEMA,message:"No default block node found for the provided schema."})}function WU(e){return e.type===ov(e.type.schema)}function hw(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function ji(e,t,n){const r=e.parent.childAfter(e.parentOffset);if(!r.node)return;const o=_e(t)?t:t.name,i=r.node.marks.find(({type:d})=>d.name===o);let s=e.index(),a=e.start()+r.offset,l=s+1,c=a+r.node.nodeSize;if(!i)return n&&c<n.pos?ji(e.doc.resolve(c+1),t,n):void 0;for(;s>0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&i.isInSet(e.parent.child(l).marks);)c+=e.parent.child(l).nodeSize,l+=1;const u=e.doc.textBetween(a,c,DM,`
|
|
163
|
+
|
|
164
|
+
`);return{from:a,to:c,text:u,mark:i}}function xN(e,t){return t.length===0||t.some(n=>e instanceof n)}function KU(e){return WM(e,({from:n,to:r,prevFrom:o,prevTo:i})=>`${n}_${r}_${o}_${i}`).filter((n,r,o)=>!o.some((i,s)=>r===s?!1:n.prevFrom>=i.prevFrom&&n.prevTo<=i.prevTo&&n.from>=i.from&&n.to<=i.to))}function qU(e,t=[]){const n=[],{steps:r,mapping:o}=e,i=o.invert();r.forEach((a,l)=>{if(!xN(a,t))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&IU(a)){const{from:f,to:p}=a;c.push({from:f,to:p})}else u.forEach((f,p)=>{c.push({from:f,to:p})});c.forEach(f=>{const p=d.map(f.from,-1),m=d.map(f.to);n.push({from:p,to:m,prevFrom:i.map(p,-1),prevTo:i.map(m)})})});const s=ol(n,(a,l)=>a.from-l.from);return KU(s)}function GU(e){var t;return((t=e.content.firstChild)==null?void 0:t.textContent)??""}function YU(e,t){if(!bl(e.selection))return;let{from:n,to:r}=e.selection;const o=(s,a)=>GU(Te.between(e.doc.resolve(s),e.doc.resolve(a)).content());for(let s=o(n-1,n);s&&!t.test(s);n--,s=o(n-1,n));for(let s=o(r,r+1);s&&!t.test(s);r++,s=o(r,r+1));if(n===r)return;const i=e.doc.textBetween(n,r,DM,`
|
|
165
|
+
|
|
166
|
+
`);return{from:n,to:r,text:i}}function bN(e){return YU(e,/\W/)}function Id(e,t=0){const n=en(e)?e[t]:e;return BM(_e(n),`No match string found for match ${e}`),n??""}function XU(e){return bl(e)?e.$cursor:void 0}function ZU(e,t){return nv(e)?t?e.type===t.nodes.doc:e.type.name==="doc":!1}function JU(e){return jn(e)&&Mr(e.anchor)&&Mr(e.head)}function Jr(e,t){const n=t.nodeSize-2,r=0;let o;const i=l=>Kz({min:r,max:n,value:l});if(fw(e))return e;if(e==="all")return new qn(t);if(e==="start"?o=r:e==="end"?o=n:VU(e)?o=e.pos:o=e,Mr(o))return o=i(o),Te.near(t.resolve(o));if(JU(o)){const l=i(o.anchor),c=i(o.head);return Te.between(t.resolve(l),t.resolve(c))}const s=i(o.from),a=i(o.to);return Te.between(t.resolve(s),t.resolve(a))}var QU=3;function wN(e){const{content:t,schema:n,document:r,stringHandler:o,onError:i,attempts:s=0}=e,a=i&&s<=QU||s===0;if(be(a,{code:q.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),_e(t))return be(o,{code:q.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:r,content:t,schema:n});if(vN(t))return t.doc;if(nv(t))return t;try{return n.nodeFromJSON(t)}catch(l){const c=sV({schema:n,error:l,json:t}),u=i==null?void 0:i(c);return be(u,{code:q.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),wN({...e,content:u,attempts:s+1})}}function iv(){const e=_R();if(e)return e;throw new Error(`Unable to retrieve the document from the global scope.
|
|
167
|
+
It seems that you are running Remirror in a non-browser environment. Remirror need browser APIs to work.
|
|
168
|
+
If you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string).
|
|
169
|
+
If you are using Next.js (or other server-side rendering frameworks), please use dynamic import with \`ssr: false\` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr).
|
|
170
|
+
If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function SN(e){var t;return(e==null?void 0:e.defaultView)??(typeof window<"u"?window:void 0)??((t=_R())==null?void 0:t.defaultView)}function eV(e){return SN(e==null?void 0:e.ownerDocument)}function tV(e){const t=SN(e)??iv().defaultView;if(t)return t;throw new Error("Unable to retrieve the window from the global scope")}function nV(e,t=iv()){const n=ZU(e,e.type.schema)?e.content:U.from(e);return ko.fromSchema(e.type.schema).serializeFragment(n,{document:t})}function rV(e,t){return new(tV(t)).DOMParser().parseFromString(`<body>${e}</body>`,"text/html").body}function oV(e,t=iv()){const n=t.createElement("div");return n.append(nV(e,t)),n.innerHTML}function Kx(e){const{content:t,schema:n,document:r,fragment:o=!1,...i}=e,s=rV(t,r),a=Hc.fromSchema(n);return o?a.parseSlice(s,{...z_,...i}).content:a.parse(s,{...z_,...i})}var z_={preserveWhitespace:!1};function kN(e,t){const n=vf(t.defaults());return H1({...e},n)}var iV={remove(e,t){let n=e;for(const r of t)r.invalidParentNode||(n=Yz(r.path,n));return n}};function sV({json:e,schema:t,...n}){const r=new Set(vf(t.marks)),o=new Set(vf(t.nodes)),i=EN({json:e,path:[],validNodes:o,validMarks:r});return{json:e,invalidContent:i,transformers:iV,...n}}function EN(e){const{json:t,validMarks:n,validNodes:r,path:o=[]}=e,i={validMarks:n,validNodes:r},s=[],{type:a,marks:l,content:c}=t;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(l){const f=[];for(const[p,m]of l.entries()){const g=_e(m)?m:m.type;n.has(g)||(f.unshift({name:g,path:[...o,"marks",`${p}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(r.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[p,m]of c.entries())f.unshift(...EN({...i,json:m,path:[...o,"content",`${p}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function aV(e){return!!(bl(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function qx(e){return!!(bl(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function F_(e){const t=Be.atStart(e.$anchor.doc);return!!(qx(e)&&t.anchor===e.anchor)}function lV(e){return({dispatch:t,tr:n})=>{const{type:r,attrs:o=he(),appendText:i,range:s}=e,a=s?Te.between(n.doc.resolve(s.from),n.doc.resolve(s.to)):n.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?n.doc.type.allowsMarkType(r):!1;return n.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(r)){d=!0;return}}),d?(t==null||t(n.addMark(c,u,r.create(o))&&i?n.insertText(i):n),!0):!1}}function cV({tr:e,dispatch:t}){const{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&au(o);return!Mr(i)||!o?!1:(t==null||t(e.lift(o,i).scrollIntoView()),!0)}function _N(e,t={},n){return function(r){const{tr:o,dispatch:i,state:s}=r,a=_e(e)?Pt(s.schema.nodes,e):e,{from:l,to:c}=Jr(n??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),p=f&&q1(f,a,t);return!p||!f?!1:(i==null||i(o.wrap(f,p).scrollIntoView()),!0)}}function uV(e,t={},n){return r=>{const{tr:o,state:i}=r,s=_e(e)?Pt(i.schema.nodes,e):e;return _f({state:o,type:s,attrs:t})?cV(r):_N(e,t,n)(r)}}function zm(e,t,n,r=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=_e(e)?Pt(a.schema.nodes,e):e,{from:c,to:u}=Jr(n??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(p,m)=>{if(d)return!1;if(!p.isTextblock||p.hasMarkup(l,t))return;if(p.type===l){d=!0,f=p.attrs;return}const g=i.doc.resolve(m),y=g.index();d=g.parent.canReplaceWith(y,y+1,l),d&&(f=g.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...r?f:{},...t}).scrollIntoView()),!0):!1}}function CN(e){return t=>{const{tr:n,state:r}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=_f({state:n,type:o,attrs:i}),l=e.toggleType??ov(r.schema);if(a)return zm(l,{...s?a.node.attrs:{},...i})(t);const c=_f({state:n,type:l,attrs:i});return zm(o,{...s?c==null?void 0:c.node.attrs:{},...i})(t)}}function dV(e=0){const t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(Pt(t,2),10)>=e:!1}function fV(e,t){let{head:n,empty:r,anchor:o}=e;for(const i of t.steps)n=i.getMap().map(n);r?t.setSelection(Te.near(t.doc.resolve(n))):t.setSelection(Te.between(t.doc.resolve(o),t.doc.resolve(n)))}function pV(e){const{attrs:t={},appendText:n="",content:r="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=Jr(e.selection??i??a.selection,a.doc),f=d.$from.index(),{from:p,to:m,$from:g}=d,y=_e(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(be(_e(e.type)?y:!0,{code:q.SCHEMA,message:`Schema contains no marks or nodes with name ${y}`}),LU(y)){if(!g.parent.canReplaceWith(f,f,y))return!1;a.replaceWith(p,m,y.create(t,r?u.text(r):void 0))}else be(r,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,m,u.text(r,gN(y)?[y.create(t)]:void 0));return n&&a.insertText(n),o&&fV(s.selection,a),l&&(dV(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function ON(e,t){const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const{marks:r,nodeSize:o}=n.node;if(r[0])return r[0].type;const s=e.start()+n.offset+o;return ON(e.doc.resolve(s+1))}function TN(e){return({dispatch:t,tr:n,state:r})=>{const{type:o,expand:i=!0,range:s}=e,a=Jr(e.selection??s??n.selection,n.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=_e(o)?r.schema.marks[o]:o;f!==null&&be(f,{code:q.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const p=f??ON(u);if(!p)return!1;const m=ji(u,p,d);return i&&m&&(l=Math.max(0,Math.min(l,m.from)),c=Math.min(Math.max(c,m.to),n.doc.nodeSize-2)),t==null||t(n.removeMark(l,Mr(c)?c:l,gN(f)?f:void 0)),!0}}function Fm(e){const{regexp:t,type:n,getAttributes:r,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=e;let c;const u=new ro(t,(d,f,p,m)=>{const{tr:g,schema:y}=d;c||(c=_e(n)?y.marks[n]:n,be(c,{code:q.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}));let v=f[1],x=f[0];const w=hV({captureGroup:v,fullMatch:x,end:m,start:p,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!w)return null;({start:p,end:m,captureGroup:v,fullMatch:x}=w);const k=pt(r)?r(f):r;let E=m,S=[];if(v){const _=x.search(/\S/),P=p+x.indexOf(v),M=P+v.length;S=g.storedMarks??[],M<m&&g.delete(M,m),P>p&&g.delete(p+_,P),E=p+_+v.length}return g.addMark(p,E,c.create(k)),g.setStoredMarks(S),i==null||i({tr:g,match:f,start:p,end:m}),g});return u}function hV({captureGroup:e,fullMatch:t,end:n,start:r,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(t==null)return null;const d=(a==null?void 0:a({captureGroup:e,fullMatch:t,start:r,end:n}))??{};e=d.captureGroup??e,t=d.fullMatch??t,r=d.start??r,n=d.end??n;const f=l.doc.resolve(r),p=l.doc.resolve(n);return c&&Vx({$from:f,$to:p},c)||o.invalidMarks&&Vx({$from:f,$to:p},o.invalidMarks)||i&&(e==null?void 0:e.trim())===""||s!=null&&s({state:l,captureGroup:e,fullMatch:t,start:r,end:n,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:e,fullMatch:t,start:r,end:n,ruleType:"mark"})?null:{captureGroup:e,end:n,fullMatch:t,start:r}}var mV=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const o=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&o.push(n[i]);return o.push(...r),o.join(" ")},gV=mV;const PN=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function vV(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const MN=(e,t,n)=>{let r=vV(e,n);if(!r)return!1;let o=RN(r);if(!o){let s=r.blockRange(),a=s&&au(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&AN(e,o,t))return!0;if(r.parent.content.size==0&&(Gc(i,"end")||we.isSelectable(i))){let s=G1(e.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection(Gc(i,"end")?Be.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):we.create(a.doc,o.pos-i.nodeSize)),t(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1};function Gc(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const yV=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=RN(r)}let s=i&&i.nodeBefore;return!s||!we.isSelectable(s)?!1:(t&&t(e.tr.setSelection(we.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function RN(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function xV(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const bV=(e,t,n)=>{let r=xV(e,n);if(!r)return!1;let o=NN(r);if(!o)return!1;let i=o.nodeAfter;if(AN(e,o,t))return!0;if(r.parent.content.size==0&&(Gc(i,"start")||we.isSelectable(i))){let s=G1(e.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection(Gc(i,"start")?Be.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):we.create(a.doc,a.mapping.map(o.pos))),t(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},wV=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=NN(r)}let s=i&&i.nodeAfter;return!s||!we.isSelectable(s)?!1:(t&&t(e.tr.setSelection(we.create(e.doc,i.pos)).scrollIntoView()),!0)};function NN(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const SV=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
171
|
+
`).scrollIntoView()),!0)};function mw(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const $N=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=mw(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Be.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},kV=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof qn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=mw(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=e.tr.insert(s,i.createAndFill());a.setSelection(Te.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},EV=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(_c(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&au(r);return o==null?!1:(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};function _V(e){return(t,n)=>{let{$from:r,$to:o}=t.selection;if(t.selection instanceof we&&t.selection.node.isBlock)return!r.parentOffset||!_c(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof Te||t.selection instanceof qn)&&s.deleteSelection();let a=r.depth==0?null:mw(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=e&&e(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=_c(s.doc,s.mapping.map(r.pos),1,c);if(!c&&!u&&_c(s.doc,s.mapping.map(r.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(r.pos),1,c),!i&&!r.parentOffset&&r.parent.type!=a)){let d=s.mapping.map(r.before()),f=s.doc.resolve(d);a&&r.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}n(s.scrollIntoView())}return!0}}const CV=_V(),OV=(e,t)=>{let{$from:n,to:r}=e.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),t&&t(e.tr.setSelection(we.create(e.doc,o))),!0)},TV=(e,t)=>(t&&t(e.tr.setSelection(new qn(e.doc))),!0);function PV(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||ip(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function AN(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i,s;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(PV(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(n){let d=t.pos+o.nodeSize,f=U.empty;for(let g=i.length-1;g>=0;g--)f=U.from(i[g].create(null,f));f=U.from(r.copy(f));let p=e.tr.step(new Ut(t.pos-1,d,t.pos,d,new Z(f,1,0),i.length,!0)),m=d+2*i.length;ip(p.doc,m)&&p.join(m),n(p.scrollIntoView())}return!0}let l=Be.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&au(c);if(u!=null&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&Gc(o,"start",!0)&&Gc(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=o,m=1;for(;!p.isTextblock;p=p.firstChild)m++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(n){let g=U.empty;for(let v=f.length-1;v>=0;v--)g=U.from(f[v].copy(g));let y=e.tr.step(new Ut(t.pos-f.length,t.pos+o.nodeSize,t.pos+m,t.pos+o.nodeSize-m,new Z(g,f.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function DN(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(t.tr.setSelection(Te.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const MV=DN(-1),RV=DN(1);function NV(e,t,n){for(let r=0;r<t.length;r++){let{$from:o,$to:i}=t[r],s=o.depth==0?e.inlineContent&&e.type.allowsMarkType(n):!1;if(e.nodesBetween(o.pos,i.pos,a=>{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(n)}),s)return!0}return!1}function $V(e,t=null){return function(n,r){let{empty:o,$cursor:i,ranges:s}=n.selection;if(o&&!i||!NV(n.doc,s,e))return!1;if(r)if(i)e.isInSet(n.storedMarks||i.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let a=!1,l=n.tr;for(let c=0;!a&&c<s.length;c++){let{$from:u,$to:d}=s[c];a=n.doc.rangeHasMark(u.pos,d.pos,e)}for(let c=0;c<s.length;c++){let{$from:u,$to:d}=s[c];if(a)l.removeMark(u.pos,d.pos,e);else{let f=u.pos,p=d.pos,m=u.nodeAfter,g=d.nodeBefore,y=m&&m.isText?/^\s*/.exec(m.text)[0].length:0,v=g&&g.isText?/\s*$/.exec(g.text)[0].length:0;f+y<p&&(f+=y,p-=v),l.addMark(f,p,e.create(t))}}r(l.scrollIntoView())}return!0}}function sv(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let Ay=sv(PN,MN,yV),B_=sv(PN,bV,wV);const Si={Enter:sv(SV,kV,EV,CV),"Mod-Enter":$N,Backspace:Ay,"Mod-Backspace":Ay,"Shift-Backspace":Ay,Delete:B_,"Mod-Delete":B_,"Mod-a":TV},IN={"Ctrl-h":Si.Backspace,"Alt-Backspace":Si["Mod-Backspace"],"Ctrl-d":Si.Delete,"Ctrl-Alt-Backspace":Si["Mod-Delete"],"Alt-Delete":Si["Mod-Delete"],"Alt-d":Si["Mod-Delete"],"Ctrl-a":MV,"Ctrl-e":RV};for(let e in Si)IN[e]=Si[e];const AV=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,Dy=AV?IN:Si;var ta={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Bm={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},DV=typeof navigator<"u"&&/Mac/.test(navigator.platform),IV=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var kn=0;kn<10;kn++)ta[48+kn]=ta[96+kn]=String(kn);for(var kn=1;kn<=24;kn++)ta[kn+111]="F"+kn;for(var kn=65;kn<=90;kn++)ta[kn]=String.fromCharCode(kn+32),Bm[kn]=String.fromCharCode(kn);for(var Iy in ta)Bm.hasOwnProperty(Iy)||(Bm[Iy]=ta[Iy]);function LV(e){var t=DV&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||IV&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Bm:ta)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const jV=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function zV(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<t.length-1;a++){let l=t[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))jV?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function FV(e){let t=Object.create(null);for(let n in e)t[zV(n)]=e[n];return t}function Ly(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function LN(e){let t=FV(e);return function(n,r){let o=LV(r),i,s=t[Ly(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=t[Ly(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=ta[r.keyCode])&&i!=o){let a=t[Ly(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}function BV(e){const t=ol(e,(i,s)=>(s.priority??ct.Low)-(i.priority??ct.Low)),n=[],r=[];for(const i of t)GV(i)?n.push(i):r.push(i);let o;return new Wi({key:UV,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of n){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(x=>d.has(x)))continue;const p=((l=i.content.firstChild)==null?void 0:l.textContent)??"",m=!o.state.selection.empty&&i.content.childCount===1&&p,g=Xg(p,f.regexp)[0];if(m&&g&&f.type==="mark"&&f.replaceSelection){const{from:x,to:w}=o.state.selection,k=o.state.doc.slice(x,w),E=k.content.textBetween(0,k.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(E):f.replaceSelection){const S=[],{getAttributes:_,markType:P}=f,M=pt(_)?_(g,!0):_,A=P.create(M);return k.content.forEach(I=>{if(I.isText){const L=A.addToSet(I.marks);S.push(I.mark(L))}}),Z.maxOpen(U.fromArray(S))}}const{nodes:y,transformed:v}=KV(i.content,f,o.state.schema);v&&(i=f.type==="node"&&f.nodeType.isBlock?new Z(U.fromArray(y),0,0):new Z(U.fromArray(y),i.openStart,i.openEnd))}return JV(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(p=>p.getAsFile()).filter(p=>!!p);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:p,regexp:m}of r){const g=m?d.filter(y=>m.test(y.type)):d;if(g.length!==0&&p({event:c,files:g,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:p}=u;if(!d)return!1;const m=ZV(u);if(m.length===0)return!1;const g=((c=i.posAtCoords({left:f,top:p}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:y,regexp:v}of r){const x=v?m.filter(w=>v.test(w.type)):m;if(x.length!==0&&y({event:u,files:x,pos:g,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var UV=new lu("pasteRule");function jy(e,t){return function n(r){const{fragment:o,rule:i,nodes:s}=r,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||YV(f)){s.push(f);return}if(!f.isText){const g=n({fragment:f.content,rule:i,nodes:[]});d||(d=g.transformed);const y=U.fromArray(g.nodes);f.type.validContent(y)?s.push(f.copy(y)):s.push(...g.nodes);return}if(f.marks.some(g=>XV(g)||(c==null?void 0:c.includes(g.type.name)))){s.push(f);return}const p=f.text??"";let m=0;for(const g of Xg(p,a)){const y=g[1],v=g[0];if(l&&(y==null?void 0:y.trim())===""||!v)return;const x=g.index,w=x+v.length;x>m&&s.push(f.cut(m,x));let k=f.cut(x,w);if(v&&y){const E=v.search(/\S/),S=x+v.indexOf(y),_=S+y.length;E&&s.push(f.cut(x,x+E)),k=f.cut(S,_)}e({nodes:s,rule:i,textNode:k,match:g,schema:t}),d=!0,m=w}p&&m<p.length&&s.push(f.cut(m))}),{nodes:s,transformed:d}}}function VV(e){const{nodes:t,rule:n,textNode:r,match:o,schema:i}=e,{transformMatch:s,getAttributes:a,markType:l}=n,c=pt(a)?a(o,!1):a,u=r.text??"",d=l.create(c),f=s==null?void 0:s(o);if(f==="")return;if(f===!1){t.push(i.text(u,r.marks));return}const p=d.addToSet(r.marks);t.push(i.text(f??u,p))}function HV(e){const{nodes:t,rule:n,textNode:r,match:o,schema:i}=e,{transformMatch:s}=n,a=s==null?void 0:s(o);if(a===""||a===!1)return;const l=a??r.text??"";t.push(i.text(l,r.marks))}function WV(e){const{nodes:t,rule:n,textNode:r,match:o}=e,{getAttributes:i,nodeType:s,getContent:a}=n,l=pt(i)?i(o,!1):i,c=(a?a(o):r)||void 0;t.push(s.createChecked(l,c))}function KV(e,t,n){const r=[];switch(t.type){case"mark":return jy(VV,n)({fragment:e,nodes:r,rule:t});case"node":return jy(WV,n)({fragment:e,nodes:r,rule:t});default:return jy(HV,n)({fragment:e,nodes:r,rule:t})}}var qV=["mark","node","text"];function GV(e){return Ao(qV,e.type)}function YV(e){var t;return e.type.spec.code||((t=e.type.spec.group)==null?void 0:t.split(" ").includes("code"))}function XV(e){var t;return e.type.name==="code"||((t=e.type.spec.group)==null?void 0:t.split(" ").includes("code"))}function ZV(e){var t,n;const{dataTransfer:r}=e;return r?((t=r.files)==null?void 0:t.length)>0?[...r.files]:(n=r.items)!=null&&n.length?[...r.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function JV(e){const t=Z.maxOpen(e.content);return t.openStart<e.openStart||t.openEnd<e.openEnd?t:e}var QV=Object.defineProperty,eH=Object.getOwnPropertyDescriptor,le=(e,t,n,r)=>{for(var o=r>1?void 0:r?eH(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&QV(t,n,o),o},jN=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ee=(e,t,n)=>(jN(e,t,"read from private field"),n?n.call(e):t.get(e)),Ht=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},cn=(e,t,n,r)=>(jN(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function tH(e,t){return e===t}function U_(e){const{previousOptions:t,update:n,equals:r=tH}=e,o=Da({...t,...n}),i=he(),s=vf(t);for(const l of s){const c=t[l],u=o[l];if(r(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=he();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:Da(i),options:o,pickChanged:a}}var nH={[q.DUPLICATE_HELPER_NAMES]:"helper method",[q.DUPLICATE_COMMAND_NAMES]:"command method"};function zN(e){const{name:t,set:n,code:r}=e,o=nH[r];be(!n.has(t),{code:r,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),n.add(t)}function Gx(...e){return yf(gV(...e).split(" ")).join(" ")}var V_="__IGNORE__",rH="__ALL__",du=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=he(),this.populateMappedHandlers(),this._options=this._initialOptions=Wz(e,this.constructor.defaultOptions,t??he(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const e=[],{customHandlerKeys:t,handlerKeys:n,staticKeys:r}=this.constructor;for(const o of vf(this._options))r.includes(o)||n.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){}setOptions(e){var t;const n=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);const{changes:r,options:o,pickChanged:i}=U_({previousOptions:n,update:e});this.updateDynamicOptions(o),(t=this.onSetOptions)==null||t.call(this,{reason:"set",changes:r,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;const t=this.getDynamicOptions(),{changes:n,options:r,pickChanged:o}=U_({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(r),(e=this.onSetOptions)==null||e.call(this,{reason:"reset",options:r,changes:n,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return H1(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(const e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){const e=he();for(const t of this.constructor.handlerKeys)e[t]=(...n)=>{var r;const{handlerKeyOptions:o}=this.constructor,i=(r=o[t])==null?void 0:r.reducer;let s=i==null?void 0:i.getDefault(...n);for(const[,a]of this._mappedHandlers[t]){const l=a(...n);if(s=i?i.accumulator(s,l,...n):l,oH(o,s,t))return s}return s};return e}addHandler(e,t,n=ct.Default){return this._mappedHandlers[e].push([n,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,r])=>r!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=ol(this._mappedHandlers[e],([t],[n])=>n-t)}addCustomHandler(e,t){var n;return((n=this.onAddCustomHandler)==null?void 0:n.call(this,{[e]:t}))??HM}};du.defaultOptions={};du.staticKeys=[];du.handlerKeys=[];du.handlerKeyOptions={};du.customHandlerKeys=[];function oH(e,t,n){const{[rH]:r}=e,o=e[n];return!r&&!o?!1:!!(o&&o.earlyReturnValue!==V_&&(pt(o.earlyReturnValue)?o.earlyReturnValue(t)===!0:t===o.earlyReturnValue)||r&&r.earlyReturnValue!==V_&&(pt(r.earlyReturnValue)?r.earlyReturnValue(t)===!0:t===r.earlyReturnValue))}var av=class extends du{constructor(...e){super(iH,...e),this["~E"]={},this._extensions=WM(this.createExtensions(),t=>t.constructor),this.extensionMap=new Map;for(const t of this._extensions)this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${FM(this.name)}Extension`}get store(){return be(this._store,{code:q.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),Da(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(n=>t.constructor===e?t:n))}createExtensions(){return[]}getExtension(e){const t=this.extensionMap.get(e);return be(t,{code:q.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};av.defaultPriority=ct.Default;var _t=class extends av{static get[Li](){return gn.PlainExtensionConstructor}get[Li](){return gn.PlainExtension}},lp=class extends av{static get[Li](){return gn.MarkExtensionConstructor}get[Li](){return gn.MarkExtension}get type(){return Pt(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};lp.disableExtraAttributes=!1;var oo=class extends av{static get[Li](){return gn.NodeExtensionConstructor}get[Li](){return gn.NodeExtension}get type(){return Pt(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};oo.disableExtraAttributes=!1;var iH={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function FN(e){return cu(e)&&uu(e,[gn.PlainExtension,gn.MarkExtension,gn.NodeExtension])}function sH(e){return cu(e)&&uu(e,[gn.PlainExtensionConstructor,gn.MarkExtensionConstructor,gn.NodeExtensionConstructor])}function BN(e){return cu(e)&&uu(e,gn.PlainExtension)}function cp(e){return cu(e)&&uu(e,gn.NodeExtension)}function lv(e){return cu(e)&&uu(e,gn.MarkExtension)}function Je(e){return t=>{const{defaultOptions:n,customHandlerKeys:r,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=t;n&&(c.defaultOptions=n),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=r??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var aH=class extends _t{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=he(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,n;if(this.attributeObject=he(),(e=this.store.managerSettings.exclude)!=null&&e.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const r of this.store.extensions){if((t=r.options.exclude)!=null&&t.attributes)continue;const o=(n=r.createAttributes)==null?void 0:n.call(r),i={...o,class:Gx(...r.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const r of this.attributeList)this.attributeObject={...this.attributeObject,...r,class:Gx(this.attributeObject.class,r.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function It(e={}){return(t,n,r)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[n]=e}}function de(e={}){return(t,n,r)=>{(t.decoratedCommands??(t.decoratedCommands={}))[n]=e}}function Lr(e){return(t,n,r)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[n]=e}}var lH=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let n=!0;const{view:r,tr:o,dispatch:i}=t;if(!r)return!1;for(const a of this.validateHandlers)if(!a({...t,dispatch:()=>{}})){n=!1;break}return!i||!n?n:(this.promiseCreator(t).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}),i(o),!0)}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var n;for(const r of e)if(!r({...t,dispatch:()=>{}}))break;(n=t.dispatch)==null||n.call(t,t.tr)}};function Cf(e){const{type:t,attrs:n,range:r,selection:o}=e;return i=>{const{dispatch:s,tr:a,state:l}=i,c=_e(t)?l.schema.marks[t]:t;if(be(c,{code:q.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),r||o){const{from:u,to:d}=Jr(o??r??a.selection,a.doc);return jm({trState:a,type:t,...r})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(n))),!0}return Dd($V(c,n))(i)}}function cH(e,t,n){for(const{$from:r,$to:o}of n){let i=r.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(r.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(e)}),i)return!0}return!1}function uH(e,t,n){return({tr:r,dispatch:o,state:i})=>{const s=Jr(n??r.selection,r.doc),a=XU(s),l=_e(e)?i.schema.marks[e]:e;if(be(l,{code:q.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!cH(l,r.doc,s.ranges))return!1;if(!o)return!0;if(a)return r.removeStoredMark(l),t&&r.addStoredMark(l.create(t)),o(r),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=r.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&r.removeMark(u.pos,d.pos,l),t&&r.addMark(u.pos,d.pos,l.create(t));return o(r),!0}}function dH(e,t={}){return({tr:n,dispatch:r,state:o})=>{const i=o.schema,s=n.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!r)return!0;n.insertText(e,a,l);const u=Pt(n.steps,n.steps.length-1).getMap().map(l);for(const[d,f]of Jt(c))n.addMark(a,u,Pt(i.marks,d).create(f));return r(n),!0}}var Ve=class extends _t{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{const{forcedUpdates:n}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:yf([...n,...t])}),e}}get name(){return"commands"}get transaction(){const e=this.store.getState();this._transaction||(this._transaction=e.tr);const t=this._transaction.before.eq(e.doc),n=!Qs(this._transaction.steps);if(!t){const r=e.tr;if(n)for(const o of this._transaction.steps)r.step(o);this._transaction=r}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;const{extensions:n,helpers:r}=this.store,o=he(),i=new Set;let s=he();const a=c=>{var u;const d=he(),f=()=>c??this.transaction;let p=[];const m=()=>p;for(const[y,v]of Object.entries(o))(u=s[y])!=null&&u.disableChaining||(d[y]=this.chainedFactory({chain:d,command:v.original,getTr:f,getChain:m}));const g=y=>{be(y===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(y={})=>{const v=p;p=[];for(const x of v)if(!x(g)&&y.exitEarly)return;e.dispatch(f())},d.tr=()=>{const y=p;p=[];for(const v of y)v(g);return f()},d.enabled=()=>{for(const y of p)if(!y())return!1;return!0},d.new=y=>a(y),d};for(const c of n){const u=((t=c.createCommands)==null?void 0:t.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[p,m]of Object.entries(d)){const g=_e(m.shortcut)&&m.shortcut.startsWith("_|")?{shortcut:r.getNamedShortcut(m.shortcut,c.options)}:void 0;this.updateDecorated(p,{...m,name:c.name,...g}),u[p]=c[p].bind(c),m.active&&(f[p]=()=>{var y;return((y=m.active)==null?void 0:y.call(m,c.options,this.store))??!1})}Sm(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return _e(e)?dH(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(n,r,o)=>this.insertText(n,{...t,...r})(o)}).generateCommand()}selectText(e,t={}){return({tr:n,dispatch:r})=>{const o=Jr(e,n.doc);return n.selection.anchor===o.anchor&&n.selection.head===o.head&&!t.forceUpdate?!1:(r==null||r(n.setSelection(o)),!0)}}selectMark(e){return t=>{const{tr:n}=t,r=ji(n.selection.$from,e);return r?this.store.commands.selectText.original({from:r.from,to:r.to})(t):!1}}delete(e){return({tr:t,dispatch:n})=>{const{from:r,to:o}=e??t.selection;return n==null||n(t.delete(r,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:n})=>(n&&(e==null||e(),n(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:n})=>(n==null||n(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:n,dispatch:r})=>(r==null||r(n.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return n=>{const{tr:r,dispatch:o}=n,i=this.store.manager.createState({content:e,selection:t});return i?(o==null||o(r.replaceRangeWith(0,r.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return e=>{const{tr:t,dispatch:n}=e,r=this.store.manager.createEmptyDoc();return r?this.setContent(r)(e):(n==null||n(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t==null||t(e.setSelection(Te.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>bl(t.selection)?(e==null||e(t.insertText(`
|
|
172
|
+
`)),!0):!1}insertNode(e,t={}){return({dispatch:n,tr:r,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:f}=Jr(l??a??r.selection,r.doc);if(nv(e)||FU(e)){const v=f.before(f.depth);return n==null||n(c&&u===d&&hw(f.parent)?r.replaceWith(v,v+f.parent.nodeSize,e):r.replaceWith(u,d,e)),!0}const p=_e(e)?o.schema.nodes[e]:e;be(p,{code:q.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});const m=(i=t.marks)==null?void 0:i.map(v=>{if(v instanceof Ye)return v;const x=_e(v)?o.schema.marks[v]:v;return be(x,{code:q.SCHEMA,message:`The requested mark type ${v} does not exist in the schema.`}),x.create()}),g=p.createAndFill(s,_e(t.content)?o.schema.text(t.content):t.content,m);if(!g)return!1;const y=u!==d;return n==null||n(y?r.replaceRangeWith(u,d,g):r.insert(u,g)),!0}}focus(e){return t=>{const{dispatch:n,tr:r}=t,{view:o}=this.store;if(e===!1||o.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){const{from:i=0,to:s=i}=r.selection;e={from:i,to:s}}return n&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{const{view:n}=this.store;return n.hasFocus()?(requestAnimationFrame(()=>{n.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,n,r=!0){return zm(e,t,n,r)}toggleWrappingNode(e,t,n){return uV(e,t,n)}toggleBlockNodeItem(e){return CN(e)}wrapInNode(e,t,n){return _N(e,t,n)}applyMark(e,t,n){return uH(e,t,n)}toggleMark(e){return Cf(e)}removeMark(e){return TN(e)}setMeta(e,t){return({tr:n})=>(n.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)!=null&&e.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,n)=>this.insertNode(Kx({content:e,schema:n.state.schema}),{selection:t})(n)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return pV(e)}getAllCommandOptions(){const e={};for(const[t,n]of this.decorated)Sm(n)||(e[t]=n);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}const n=this.decorated.get(e)??{name:""};this.decorated.set(e,{...n,...t})}handleIosFocus(){xo.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...fH,...t}}setCommandMeta(e,t){const n=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...n,...t})}addCommands(e){const{extensionCommands:t,commands:n,names:r,active:o}=e;for(const[i,s]of Jt(t))zN({name:i,set:r,code:q.DUPLICATE_COMMAND_NAMES}),be(!pH.has(i),{code:q.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),n[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(e){return(...t)=>{const{shouldDispatch:n=!0,command:r}=e,{view:o}=this.store,{state:i}=o;let s;return n&&(s=o.dispatch),r(...t)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(e,t){const n=this.unchainedFactory({command:e});return n.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),n.isEnabled=n.enabled,n.original=e,n.active=t,n}chainedFactory(e){return(...t)=>{const{chain:n,command:r,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>r(...t)({state:l,dispatch:c,view:a,tr:o()})),n}}};le([de()],Ve.prototype,"customDispatch",1);le([de()],Ve.prototype,"insertText",1);le([de()],Ve.prototype,"selectText",1);le([de()],Ve.prototype,"selectMark",1);le([de()],Ve.prototype,"delete",1);le([de()],Ve.prototype,"emptyUpdate",1);le([de()],Ve.prototype,"forceUpdate",1);le([de()],Ve.prototype,"updateNodeAttributes",1);le([de()],Ve.prototype,"setContent",1);le([de()],Ve.prototype,"resetContent",1);le([de()],Ve.prototype,"emptySelection",1);le([de()],Ve.prototype,"insertNewLine",1);le([de()],Ve.prototype,"insertNode",1);le([de()],Ve.prototype,"focus",1);le([de()],Ve.prototype,"blur",1);le([de()],Ve.prototype,"setBlockNodeType",1);le([de()],Ve.prototype,"toggleWrappingNode",1);le([de()],Ve.prototype,"toggleBlockNodeItem",1);le([de()],Ve.prototype,"wrapInNode",1);le([de()],Ve.prototype,"applyMark",1);le([de()],Ve.prototype,"toggleMark",1);le([de()],Ve.prototype,"removeMark",1);le([de()],Ve.prototype,"setMeta",1);le([de({description:({t:e})=>e(ea.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(ea.SELECT_ALL_LABEL),shortcut:Y.SelectAll})],Ve.prototype,"selectAll",1);le([de({description:({t:e})=>e(ea.COPY_DESCRIPTION),label:({t:e})=>e(ea.COPY_LABEL),shortcut:Y.Copy,icon:"fileCopyLine"})],Ve.prototype,"copy",1);le([de({description:({t:e})=>e(ea.PASTE_DESCRIPTION),label:({t:e})=>e(ea.PASTE_LABEL),shortcut:Y.Paste,icon:"clipboardLine"})],Ve.prototype,"paste",1);le([de({description:({t:e})=>e(ea.CUT_DESCRIPTION),label:({t:e})=>e(ea.CUT_LABEL),shortcut:Y.Cut,icon:"scissorsFill"})],Ve.prototype,"cut",1);le([de()],Ve.prototype,"replaceText",1);le([It()],Ve.prototype,"getAllCommandOptions",1);le([It()],Ve.prototype,"getCommandOptions",1);le([It()],Ve.prototype,"getCommandProp",1);Ve=le([Je({defaultPriority:ct.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],Ve);var fH={forcedUpdates:[]},pH=new Set(["run","chain","original","raw","enabled","tr","new"]),Io=class extends _t{constructor(){super(...arguments),this.placeholders=et.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{const t=Em(),{promise:n,placeholder:r,onFailure:o,onSuccess:i}=e;return new lH(n).validate(s=>this.addPlaceholder(t,r)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(t);if(!f){const p=new Error("The placeholder has been removed");return(o==null?void 0:o({error:p,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(t)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(t)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,n,r,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){this.placeholders=et.empty;for(const[,d]of this.placeholderWidgets)(n=(t=d.spec).onDestroy)==null||n.call(t,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:d=>{var f,p;const m=this.placeholderWidgets.get(d.id);m&&((p=(f=m.spec).onDestroy)==null||p.call(f,this.store.view,m.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(r=d.spec).onUpdate)==null||o.call(r,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,e);continue}if(d.type==="node"){this.addNodePlaceholder(d,e);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,e);continue}}for(const{id:d,data:f}of u){const p=this.placeholderWidgets.get(d);if(!p)continue;const m=Et.widget(p.from,p.spec.element,{...p.spec,data:f});this.placeholders=this.placeholders.remove([p]).add(e.doc,[m]),this.placeholderWidgets.set(d,m)}for(const d of c){const f=this.placeholders.find(void 0,void 0,m=>m.id===d&&m.__type===Dl),p=this.placeholderWidgets.get(d);p&&((s=(i=p.spec).onDestroy)==null||s.call(i,this.store.view,p.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(const n of this.store.extensions){if(!n.createDecorations)continue;const r=n.createDecorations(e).find();t=t.add(e.doc,r)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(H_,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(H_,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t==null||t(e),!0)}addPlaceholder(e,t,n){return({dispatch:r,tr:o})=>this.addPlaceholderTransaction(e,t,o,!r)?(r==null||r(n?o.deleteSelection():o),!0):!1}updatePlaceholder(e,t){return({dispatch:n,tr:r})=>this.updatePlaceholderTransaction({id:e,data:t,tr:r,checkOnly:!n})?(n==null||n(r),!0):!1}removePlaceholder(e){return({dispatch:t,tr:n})=>this.removePlaceholderTransaction({id:e,tr:n,checkOnly:!t})?(t==null||t(n),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t==null||t(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){const e=new Map,t=this.placeholders.find(void 0,void 0,n=>n.__type===Dl);for(const n of t)e.set(n.spec.id,{from:n.from,to:n.to});return e}createDecorations(e){var t,n,r;const{persistentSelectionClass:o}=this.options;return!o||(t=this.store.view)!=null&&t.hasFocus()||(r=(n=this.store.helpers).isInteracting)!=null&&r.call(n)?et.empty:mH(e,et.empty,{class:_e(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){const{pos:n,createElement:r,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(r==null?void 0:r(this.store.view,n))??document.createElement(a);u.classList.add(s);const d=Et.widget(n,u,{id:l,__type:Dl,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){const{from:n=t.selection.from,to:r=t.selection.to,className:o,nodeName:i,id:s,type:a}=e;let l;if(n===r){const c=document.createElement(i);c.classList.add(o),l=Et.widget(n,c,{id:s,type:a,__type:Dl,widget:c})}else l=Et.inline(n,r,{nodeName:i,class:o},{id:s,__type:Dl});this.placeholders=this.placeholders.add(t.doc,[l])}addNodePlaceholder(e,t){const{pos:n,className:r,nodeName:o,id:i}=e,s=Mr(n)?t.doc.resolve(n):t.selection.$from,a=Mr(n)?s.nodeAfter?{pos:n,end:s.nodeAfter.nodeSize}:void 0:MU(s);if(!a)return;const l=Et.node(a.pos,a.end,{nodeName:o,class:r},{id:i,__type:Dl});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){const{placeholderNodeName:n,placeholderClassName:r}=this.options,{nodeName:o=n,className:i,...s}=t,a=(i?[r,i]:[r]).join(" ");return{nodeName:o,className:a,...s,id:e}}getMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...hH,...t}}setMeta(e,t){const n=this.getMeta(e);e.setMeta(this.pluginKey,{...n,...t})}addPlaceholderTransaction(e,t,n,r=!1){if(this.findPlaceholder(e))return!1;if(r)return!0;const{added:i}=this.getMeta(n);return this.setMeta(n,{added:[...i,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){const{id:t,tr:n,checkOnly:r=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(r)return!0;const{updated:s}=this.getMeta(n);return this.setMeta(n,{updated:yf([...s,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){const{id:t,tr:n,checkOnly:r=!1}=e;if(!this.findPlaceholder(t))return!1;if(r)return!0;const{removed:i}=this.getMeta(n);return this.setMeta(n,{removed:yf([...i,t])}),!0}clearPlaceholdersTransaction(e){const{tr:t,checkOnly:n=!1}=e;return this.getPluginState()===et.empty?!1:(n||this.setMeta(t,{clearTrackers:!0}),!0)}};le([de()],Io.prototype,"updateDecorations",1);le([de()],Io.prototype,"addPlaceholder",1);le([de()],Io.prototype,"updatePlaceholder",1);le([de()],Io.prototype,"removePlaceholder",1);le([de()],Io.prototype,"clearPlaceholders",1);le([It()],Io.prototype,"findPlaceholder",1);le([It()],Io.prototype,"findAllPlaceholders",1);Io=le([Je({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,n)=>e.add(n.doc,t.find()),getDefault:()=>et.empty}}},defaultPriority:ct.Low})],Io);var hH={added:[],updated:[],clearTrackers:!1,removed:[]},Dl="placeholderDecoration",H_="persistentSelectionFocus";function mH(e,t,n){const{selection:r,doc:o}=e;if(r.empty)return t;const{from:i,to:s}=r,a=rv(r)?Et.node(i,s,n):Et.inline(i,s,n);return t.add(o,[a])}var Um=class extends _t{get name(){return"docChanged"}onStateUpdate(e){const{firstUpdate:t,transactions:n,tr:r}=e;t||(n??[r]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(e)}};Um=le([Je({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:ct.Lowest})],Um);var Qr=class extends _t{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",Kx);const t=he(),n=he(),r=he(),o=new Set;for(const i of this.store.extensions){cp(i)&&(n[i.name]=a=>$U({state:this.store.getState(),type:i.type,attrs:a}),r[i.name]=a=>{var l;return(l=_f({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),lv(i)&&(n[i.name]=a=>jm({trState:this.store.getState(),type:i.type,attrs:a}),r[i.name]=a=>{const l=ji(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(dw(l.mark,a))return l.mark.attrs});const s=((e=i.createHelpers)==null?void 0:e.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!Sm(s))for(const[a,l]of Jt(s))zN({name:a,set:o,code:q.DUPLICATE_HELPER_NAMES}),t[a]=l}this.store.setStoreKey("attrs",r),this.store.setStoreKey("active",n),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",r),this.store.setExtensionStore("active",n),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return uw(e)}isViewEditable(e=this.store.getState()){var t,n;return((n=(t=this.store.view.props).editable)==null?void 0:n.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return n=>{const{state:r}=n,o=Kx({content:e,schema:r.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(n)}}getText({lineBreakDivider:e=`
|
|
173
|
+
|
|
174
|
+
`,state:t=this.store.getState()}={}){return t.doc.textBetween(0,t.doc.content.size,e,Ps)}getTextBetween(e,t,n=this.store.getState().doc){return n.textBetween(e,t,`
|
|
175
|
+
|
|
176
|
+
`,Ps)}getHTML(e=this.store.getState()){return oV(e.doc,this.store.document)}textToProsemirrorNode(e){const t=`<pre>${e.content}</pre>`;return this.store.stringHandlers.html({...e,content:t})}};le([It()],Qr.prototype,"isSelectionEmpty",1);le([It()],Qr.prototype,"isViewEditable",1);le([It()],Qr.prototype,"getStateJSON",1);le([It()],Qr.prototype,"getJSON",1);le([It()],Qr.prototype,"getRemirrorJSON",1);le([de()],Qr.prototype,"insertHtml",1);le([It()],Qr.prototype,"getText",1);le([It()],Qr.prototype,"getTextBetween",1);le([It()],Qr.prototype,"getHTML",1);Qr=le([Je({})],Qr);var Yx=class extends _t{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;const n=[],r=this.store.markTags[Le.ExcludeInputRules];for(const o of this.store.extensions)if(!((e=this.store.managerSettings.exclude)!=null&&e.inputRules||!o.createInputRules||(t=o.options.exclude)!=null&&t.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=r,n.push(i);return kF({rules:n})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};Yx=le([Je({defaultPriority:ct.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],Yx);var bo=class extends _t{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,n;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(n=(t=this.store).rebuildKeymap)==null||n.call(t),()=>{var r,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==e),(o=(r=this.store).rebuildKeymap)==null||o.call(r)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:e}=this.options;return _e(e)?xH[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)!=null&&e.keymap?[]:(this.setupKeydownHandler(),[new Wi({props:{handleKeyDown:(t,n)=>{var r;return(r=this.keydownHandler)==null?void 0:r.call(this,t,n)}}})])}setupKeydownHandler(){const e=this.generateKeymapBindings();this.keydownHandler=LN(e)}generateKeymapBindings(){var e;const t=[],n=this.shortcutMap,r=this.store.getExtension(Ve),o=a=>l=>yh({shortcut:l,map:n,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((e=a.options.exclude)!=null&&e.keymap)){a.createKeymap&&t.push(vH(a.createKeymap(o(a)),n));for(const[c,u]of Jt(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=yh({shortcut:u.shortcut,map:n,options:a.options,store:this.store}),p=pt(u.priority)?u.priority(a.options,this.store):u.priority??ct.Low,m=he();for(const g of f)m[g]=d;t.push([p,m]),u.command&&r.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...t]);return DU(i)}arrowRightShortcut(e){const t=this.store.markTags[Le.PreventExits],n=this.store.nodeTags[Le.PreventExits];return this.exitMarkForwards(t,n)(e)}arrowLeftShortcut(e){const t=this.store.markTags[Le.PreventExits],n=this.store.nodeTags[Le.PreventExits];return Lm(this.exitNodeBackwards(n),this.exitMarkBackwards(t,n))(e)}backspace(e){const t=this.store.markTags[Le.PreventExits],n=this.store.nodeTags[Le.PreventExits];return Lm(this.exitNodeBackwards(n,!0),this.exitMarkBackwards(t,n,!0))(e)}createKeymap(){const{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:n}=this.options,r=he();if(!n)for(const[o,i]of Jt(Dy))r[o]=Dd(i);return t&&Dy.Backspace&&(r.Backspace=Dd(sv(EF,Dy.Backspace))),e&&(r.Escape=Dd(OV)),[ct.Low,r]}getNamedShortcut(e,t={}){return e.startsWith("_|")?yh({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,n;const{changes:r}=e;(r.excludeBaseKeymap.changed||r.selectParentNodeOnEscape.changed||r.undoInputRuleOnBackspace.changed)&&((n=(t=this.store).rebuildKeymap)==null||n.call(t))}sortKeymaps(e){return ol(e.map(t=>en(t)?t:[ct.Default,t]),(t,n)=>n[0]-t[0]).map(t=>t[1])}exitMarkForwards(e,t){return n=>{const{tr:r,dispatch:o}=n;if(!aV(r.selection)||Ef({selection:r.selection,types:t}))return!1;const a=r.selection.$from.marks().filter(l=>!e.includes(l.type.name));if(Qs(a))return!1;if(!o)return!0;for(const l of a)r.removeStoredMark(l);return o(r.insertText(" ",r.selection.from)),!0}}exitNodeBackwards(e,t=!1){return n=>{const{tr:r}=n;if(!(t?F_:qx)(r.selection))return!1;const i=r.selection.$anchor.node();return!hw(i)||WU(i)||e.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(n)}}exitMarkBackwards(e,t,n=!1){return r=>{const{tr:o,dispatch:i}=r;if(!(n?F_:qx)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(Ef({selection:o.selection,types:t}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!e.includes(c.type.name));if(Qs(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};le([Lr({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],bo.prototype,"arrowRightShortcut",1);le([Lr({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],bo.prototype,"arrowLeftShortcut",1);le([Lr({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],bo.prototype,"backspace",1);le([It()],bo.prototype,"getNamedShortcut",1);bo=le([Je({defaultPriority:ct.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],bo);function gH(e){return Ao(Gg(Y),e)}function yh({shortcut:e,map:t,options:n,store:r}){return _e(e)?[Xx(e,t)]:en(e)?e.map(o=>Xx(o,t)):(e=e(n,r),yh({shortcut:e,map:t,options:n,store:r}))}function Xx(e,t){return gH(e)?t[e]:e}function vH(e,t){const n={};let r,o;en(e)?[o,r]=e:r=e;for(const[i,s]of Jt(r))n[Xx(i,t)]=s;return Yg(o)?n:[o,n]}var UN={[Y.Copy]:"Mod-c",[Y.Cut]:"Mod-x",[Y.Paste]:"Mod-v",[Y.PastePlain]:"Mod-Shift-v",[Y.SelectAll]:"Mod-a",[Y.Undo]:"Mod-z",[Y.Redo]:xo.isMac?"Shift-Mod-z":"Mod-y",[Y.Bold]:"Mod-b",[Y.Italic]:"Mod-i",[Y.Underline]:"Mod-u",[Y.Strike]:"Mod-d",[Y.Code]:"Mod-`",[Y.Paragraph]:"Mod-Shift-0",[Y.H1]:"Mod-Shift-1",[Y.H2]:"Mod-Shift-2",[Y.H3]:"Mod-Shift-3",[Y.H4]:"Mod-Shift-4",[Y.H5]:"Mod-Shift-5",[Y.H6]:"Mod-Shift-6",[Y.TaskList]:"Mod-Shift-7",[Y.BulletList]:"Mod-Shift-8",[Y.OrderedList]:"Mod-Shift-9",[Y.Quote]:"Mod->",[Y.Divider]:"Mod-Shift-|",[Y.Codeblock]:"Mod-Shift-~",[Y.ClearFormatting]:"Mod-Shift-C",[Y.Superscript]:"Mod-.",[Y.Subscript]:"Mod-,",[Y.LeftAlignment]:"Mod-Shift-L",[Y.CenterAlignment]:"Mod-Shift-E",[Y.RightAlignment]:"Mod-Shift-R",[Y.JustifyAlignment]:"Mod-Shift-J",[Y.InsertLink]:"Mod-k",[Y.Find]:"Mod-f",[Y.FindBackwards]:"Mod-Shift-f",[Y.FindReplace]:"Mod-Shift-H",[Y.AddFootnote]:"Mod-Alt-f",[Y.AddComment]:"Mod-Alt-m",[Y.ContextMenu]:"Mod-Shift-\\",[Y.IncreaseFontSize]:"Mod-Shift-.",[Y.DecreaseFontSize]:"Mod-Shift-,",[Y.IncreaseIndent]:"Tab",[Y.DecreaseIndent]:"Shift-Tab",[Y.Shortcuts]:"Mod-/",[Y.Format]:xo.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},yH={...UN,[Y.Strike]:"Mod-Shift-S",[Y.Code]:"Mod-Shift-M",[Y.Paragraph]:"Mod-Alt-0",[Y.H1]:"Mod-Alt-1",[Y.H2]:"Mod-Alt-2",[Y.H3]:"Mod-Alt-3",[Y.H4]:"Mod-Alt-4",[Y.H5]:"Mod-Alt-5",[Y.H6]:"Mod-Alt-6",[Y.OrderedList]:"Mod-Alt-7",[Y.BulletList]:"Mod-Alt-8",[Y.Quote]:"Mod-Alt-9",[Y.ClearFormatting]:"Mod-\\",[Y.IncreaseIndent]:"Mod-[",[Y.DecreaseIndent]:"Mod-]"},xH={default:UN,googleDoc:yH},bH=class extends _t{get name(){return"nodeViews"}createPlugin(){const e=[],t=he();for(const n of this.store.extensions){if(!n.createNodeViews)continue;const r=n.createNodeViews();e.unshift(pt(r)?{[n.name]:r}:r)}e.unshift(this.store.managerSettings.nodeViews??{});for(const n of e)Object.assign(t,n);return{props:{nodeViews:t}}}},wH=class extends _t{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;const n=[];for(const r of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.pasteRules||!r.createPasteRules||(t=r.options.exclude)!=null&&t.pasteRules)continue;const o=r.createPasteRules(),i=en(o)?o:[o];n.push(...i)}return BV(n)}},Zx=class extends _t{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=he(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{const t=this.stateGetters.get(e);return be(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){const{setStoreKey:e,setExtensionStore:t,managerSettings:n,extensions:r}=this.store;this.updateExtensionStore();const{plugins:o=[]}=n;this.updatePlugins(o,this.managerPlugins);for(const i of r)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,n)=>{const r=n.tr,o={previousState:t,tr:r,transactions:e,state:n};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),r.docChanged||r.steps.length>0||r.selectionSet||r.storedMarksSet?r:void 0},state:{init:(e,t)=>{for(const n of this.initStateHandlers)n(t)},apply:(e,t,n,r)=>{const o={previousState:n,state:r,tr:e};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,n;if(!(!e.createPlugin&&!e.createExternalPlugins||(t=this.store.managerSettings.exclude)!=null&&t.plugins||(n=e.options.exclude)!=null&&n.plugins)){if(e.createPlugin){const o=new lu(e.name);this.pluginKeys[e.name]=o;const i=this.getPluginStateCreator(o);e.pluginKey=o,e.getPluginState=i,this.stateGetters.set(e.name,i),this.stateGetters.set(e.constructor,i);const s={...e.createPlugin(),key:o},a=new Wi(s);this.updatePlugins([a],e.plugin?[e.plugin]:void 0),e.plugin=a}if(e.createExternalPlugins){const o=e.createExternalPlugins();this.updatePlugins(o,e.externalPlugins),e.externalPlugins=o}}}updatePlugins(e,t){if(!t||Qs(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(r=>!t.includes(r)),...e];return}const n=new Map;for(const[r,o]of e.entries())n.set(Pt(t,r),o);this.plugins=this.plugins.map(r=>t.includes(r)?n.get(r):r)}updateExtensionStore(){const{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){const t=FN(e)?e:sH(e)?this.store.manager.getExtension(e):this.store.extensions.find(n=>n.name===e);be(t,{code:q.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){be(this.store.phase>=rr.EditorView,{code:q.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:e,updateState:t}=this.store,n=e.state.reconfigure({plugins:this.plugins});t(n)}};Zx=le([Je({defaultPriority:ct.Highest,handlerKeys:["applyState","appendTransaction"]})],Zx);var Jx=class extends _t{constructor(){super(...arguments),this.dynamicAttributes={marks:he(),nodes:he()}}get name(){return"schema"}onCreate(){const{managerSettings:e,tags:t,markNames:n,nodeNames:r,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e,c=m=>!!(m&&t[Le.Block].includes(m));if(e.schema){const{nodes:m,marks:g}=PH(e.schema);this.addSchema(e.schema,m,g);return}const u=c(i)?{doc:he(),[i]:he()}:he(),d=he(),f=SH({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:r,markNames:n,tags:t});for(const m of o){f[m.name]={...f[m.name],...m.options.extraAttributes};const g=s===!0||m.options.disableExtraAttributes===!0||m.constructor.disableExtraAttributes===!0;if(cp(m)){const{spec:y,dynamic:v}=W_({createExtensionSpec:(x,w)=>m.createNodeSpec(x,w),extraAttributes:Pt(f,m.name),override:{...a,...m.options.nodeOverride},ignoreExtraAttributes:g,name:m.constructorName,tags:m.tags});m.spec=y,u[m.name]=y,Object.keys(v).length>0&&(this.dynamicAttributes.nodes[m.name]=v)}if(lv(m)){const{spec:y,dynamic:v}=W_({createExtensionSpec:(x,w)=>m.createMarkSpec(x,w),extraAttributes:Pt(f,m.name),override:{...l,...m.options.markOverride},ignoreExtraAttributes:g,name:m.constructorName,tags:m.tags??[]});m.spec=y,d[m.name]=y,Object.keys(v).length>0&&(this.dynamicAttributes.marks[m.name]=v)}}const p=new h9({nodes:u,marks:d,topNode:"doc"});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(e,t,n)=>{const{tr:r}=n;return!e.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(r.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,r),this.checkAndUpdateDynamicMarks(i,s,r),!0)),r.steps.length>0?r:null)}}}addSchema(e,t,n){this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",n),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",ov(e).name);for(const r of Object.values(e.nodes))if(r.name!=="doc"&&(r.isBlock||r.isTextblock))break}checkAndUpdateDynamicNodes(e,t,n){for(const[r,o]of Jt(this.dynamicAttributes.nodes))if(e.type.name===r)for(const[i,s]of Jt(o)){if(!Js(e.attrs[i]))continue;const a={...e.attrs,[i]:s(e)};n.setNodeMarkup(t,void 0,a),I_(n)}}checkAndUpdateDynamicMarks(e,t,n){for(const[r,o]of Jt(this.dynamicAttributes.marks)){const i=Pt(this.store.schema.marks,r),s=e.marks.find(a=>a.type.name===r);if(s)for(const[a,l]of Jt(o)){if(!Js(s.attrs[a]))continue;const c=ji(n.doc.resolve(t),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});n.removeMark(u,d,i).addMark(u,d,f),I_(n)}}}gatherExtraAttributes(e){const t=[];for(const n of e)n.createSchemaAttributes&&t.push(...n.createSchemaAttributes());return t}};Jx=le([Je({defaultPriority:ct.Highest})],Jx);function SH(e){const{settings:t,gatheredSchemaAttributes:n,nodeNames:r,markNames:o,tags:i}=e,s=he();if(t.disableExtraAttributes)return s;const a=[...n,...t.extraAttributes??[]];for(const l of a??[]){const c=EH({identifiers:l.identifiers,nodeNames:r,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function kH(e){return xl(e)&&en(e.tags)}function EH(e){const{identifiers:t,nodeNames:n,markNames:r,tags:o}=e;if(t==="nodes")return n;if(t==="marks")return r;if(t==="all")return[...n,...r];if(en(t))return t;be(kH(t),{code:q.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,f=u==="mark"?r:u==="node"?n:[...r,...n],p=g=>f.includes(g)&&!(l!=null&&l.includes(g));for(const g of s)p(g)&&d.add(g);const m=new Map;for(const g of i)if(!(c!=null&&c.includes(g)))for(const y of o[g]){if(!p(y))continue;if(a==="any"){d.add(y);continue}const v=m.get(y)??new Set;v.add(g),m.set(y,v)}for(const[g,y]of m)y.size===i.length&&d.add(g);return[...d]}function W_(e){var t;const{createExtensionSpec:n,extraAttributes:r,ignoreExtraAttributes:o,name:i,tags:s,override:a}=e,l=he();function c(y,v){l[y]=v}let u=!1;function d(){u=!0}const f=_H(r,o,d,c),p=CH(r,o),m=OH(r,o),g=n({defaults:f,parse:p,dom:m},a);return be(o||u,{code:q.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),g.group=[...((t=g.group)==null?void 0:t.split(" "))??[],...s].join(" ")||void 0,{spec:g,dynamic:l}}function gw(e){return _e(e)||pt(e)?{default:e}:(be(e,{message:`${UM(e)} is not supported`,code:q.EXTENSION_EXTRA_ATTRIBUTES}),e)}function _H(e,t,n,r){return()=>{n();const o=he();if(t)return o;for(const[i,s]of Jt(e)){let l=gw(s).default;pt(l)&&(r(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function CH(e,t){return n=>{const r=he();if(t)return r;for(const[o,i]of Jt(e)){const{parseDOM:s,...a}=gw(i);if(ri(n)){if(Js(s)){r[o]=n.getAttribute(o)??a.default;continue}if(pt(s)){r[o]=s(n)??a.default;continue}r[o]=n.getAttribute(s)??a.default}}return r}}function OH(e,t){return n=>{const r=he();if(t)return r;function o(i,s){if(i){if(_e(i)){r[s]=i;return}if(en(i)){const[a,l]=i;r[a]=l??n.attrs[s];return}for(const[a,l]of Jt(i))r[a]=l}}for(const[i,s]of Jt(e)){const{toDOM:a,parseDOM:l}=gw(s);if(Js(a)){const c=_e(l)?l:i;r[c]=n.attrs[i];continue}if(pt(a)){o(a(n.attrs,TH(n)),i);continue}o(a,i)}return r}}function TH(e){return nv(e)?{node:e}:BU(e)?{mark:e}:{}}function PH(e){const t=he(),n=he();for(const[r,o]of Object.entries(e.nodes))t[r]=o.spec;for(const[r,o]of Object.entries(e.marks))n[r]=o.spec;return{nodes:t,marks:n}}var Yc=class extends _t{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)!=null&&t.suggesters))return D_(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>D_(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>CU(this.store.getState(),e))}createExternalPlugins(){var e,t;const n=[];for(const r of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.suggesters)break;if(!r.createSuggesters||(t=r.options.exclude)!=null&&t.suggesters)continue;const o=r.createSuggesters(),i=en(o)?o:[o];n.push(...i)}return[OU(...n)]}getSuggestState(e){return aw(e??this.store.getState())}getSuggestMethods(){const{addIgnored:e,clearIgnored:t,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;return Ao(en(e)?e:[e],(t=this.getSuggestState().match)==null?void 0:t.suggester.name)}};le([It()],Yc.prototype,"getSuggestState",1);le([It()],Yc.prototype,"getSuggestMethods",1);le([It()],Yc.prototype,"isSuggesterActive",1);Yc=le([Je({customHandlerKeys:["suggester"]})],Yc);var Qx=class extends _t{constructor(){super(...arguments),this.allTags=he(),this.plainTags=he(),this.markTags=he(),this.nodeTags=he()}get name(){return"tags"}onCreate(){this.resetTags();for(const e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const e=he(),t=he(),n=he(),r=he();for(const o of Gg(Le))e[o]=[],t[o]=[],n[o]=[],r[o]=[];this.allTags=e,this.plainTags=t,this.markTags=n,this.nodeTags=r}updateTagForExtension(e){var t,n;const r=new Set([...e.tags??[],...((t=e.createTags)==null?void 0:t.call(e))??[],...e.options.extraTags??[],...((n=this.store.managerSettings.extraTags)==null?void 0:n[e.name])??[]]);for(const o of r)be(MH(o),{code:q.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(e.name),BN(e)&&this.plainTags[o].push(e.name),lv(e)&&this.markTags[o].push(e.name),cp(e)&&this.nodeTags[o].push(e.name);e.tags=[...r]}};Qx=le([Je({defaultPriority:ct.Highest})],Qx);function MH(e){return Ao(Gg(Le),e)}var RH=new lu("remirrorFilePlaceholderPlugin");function NH(){const e=new Wi({key:RH,state:{init(){return{set:et.empty,payloads:new Map}},apply(t,{set:n,payloads:r}){n=n.map(t.mapping,t.doc);const o=t.getMeta(e);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=Et.widget(o.pos,i,{id:o.id});n=n.add(t.doc,[s]),r.set(o.id,o.payload)}else o.type===1&&(n=n.remove(n.find(void 0,void 0,i=>i.id===o.id)),r.delete(o.id));return{set:n,payloads:r}}},props:{decorations(t){var n;return((n=e.getState(t))==null?void 0:n.set)??null}}});return e}var $H=class extends _t{get name(){return"upload"}createExternalPlugins(){return[NH()]}};function AH(e={}){e={...{exitMarksOnArrowPress:bo.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:bo.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:bo.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:bo.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:Io.defaultOptions.persistentSelectionClass},...e};const n=Cx(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),r=Cx(e,["persistentSelectionClass"]);return[new Qx,new Jx,new aH,new Zx,new Yx,new wH,new bH,new Yc,new Ve,new Qr,new bo(n),new Um,new $H,new Io(r)]}var K_=class extends _t{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){const t=e.decoratedCommands??{},n=e.createCommands;for(const r of Object.keys(t)){const o=e[r];e[r]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:r,extension:e.name,decorated:!0}),l}}n&&(e.createCommands=()=>{const r=n();for(const[o,i]of Object.entries(r))r[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:e.name,decorated:!1}),c};return r})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){const n=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...n,t])}};K_=le([Je({defaultOptions:{capture:xo.isDevelopment},staticKeys:["capture"],defaultPriority:ct.Highest})],K_);var xh,Ju,bh,Gl,ps,wh,Sh,DH=class{constructor(e){Ht(this,xh,Em()),Ht(this,Ju,void 0),Ht(this,bh,void 0),Ht(this,Gl,!0),Ht(this,ps,qg()),Ht(this,wh,void 0),Ht(this,Sh,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;be(!this.manager.destroyed,{code:q.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);cn(this,bh,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);Qs(d)||this.updateViewProps(...d)},this.onChange=(i=he())=>{var s,a;const l=this.eventListenerProps(i);ee(this,Gl)&&cn(this,Gl,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),ee(this,ps).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),ee(this,ps).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:t,initialEditorState:n,element:r}=e;if(cn(this,Ju,t),cn(this,Sh,n),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(n,r);this.manager.addView(o)}get addHandler(){return ee(this,wh)??cn(this,wh,ee(this,ps).on.bind(ee(this,ps)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return ee(this,Gl)}get props(){return ee(this,Ju).call(this)}get previousState(){return this.previousStateOverride??ee(this,bh)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return ee(this,xh)}get initialEditorState(){return ee(this,Sh)}updateListener(e){const{state:t,tr:n}=e;return ee(this,ps).emit("updated",this.eventListenerProps({state:t,tr:n}))}update(e){const{getProps:t}=e;return cn(this,Ju,t),this}updateViewProps(...e){const t=Cx(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;const{attributes:n,autoFocus:r,classNames:o=[],label:i,editable:s}=this.props,a=(t=this.manager.store)==null?void 0:t.attributes,l=pt(n)?n(this.eventListenerProps()):n;let c={};(r||Mr(r))&&(c=e?{autoFocus:!0}:{autofocus:"true"});const u=yf(Gx(e&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return Vz({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){ee(this,ps).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=he()){const{state:t,tr:n,transactions:r}=e;return{tr:n,transactions:r,internalUpdate:!n,view:this.view,firstRender:ee(this,Gl),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:ee(this,xh),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};xh=new WeakMap;Ju=new WeakMap;bh=new WeakMap;Gl=new WeakMap;ps=new WeakMap;wh=new WeakMap;Sh=new WeakMap;function IH(e,t){const n=[],r=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:t};for(const d of e)VN(a,{extension:d});s=ol(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,p=d.name,m=i.get(f);be(m,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:q.INTERNAL}),!(l.has(f)||c.has(p))&&(l.add(f),c.add(p),n.push(d),r.set(f,d),m.forEach(g=>g==null?void 0:g.replaceChildExtension(f,d)))}const u=[];for(const d of n)LH({extension:d,found:l,missing:u});return be(Qs(u),{code:q.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(`
|
|
177
|
+
`)}),{extensions:n,extensionMap:r}}function VN(e,t){var n;const{gatheredExtensions:r,duplicateMap:o,parentExtensions:i,settings:s}=e,{extension:a,parentExtension:l}=t;let{names:c=[]}=t;be(FN(a),{code:q.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((n=s.priority)==null?void 0:n[a.name]),r.push(a),jH({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)VN(e,{names:c,extension:d,parentExtension:a})}}function LH(e){const{extension:t,found:n,missing:r}=e;if(t.requiredExtensions)for(const o of t.requiredExtensions??[])n.has(o)||r.push({Constructor:o,extension:t})}function jH(e){const{duplicateMap:t,extension:n,parentExtension:r}=e,o=n.constructor,i=t.get(o),s=r?[r]:[];t.set(o,i?[...i,...s]:s)}function zH(e){var t,n,r,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);const d=(t=i.onCreate)==null?void 0:t.bind(i),f=(n=i.onView)==null?void 0:n.bind(i),p=(r=i.onStateUpdate)==null?void 0:r.bind(i),m=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),m&&u.destroy.push(m),lv(i)&&a.push(i.name),cp(i)&&i.name!=="doc"&&s.push(i.name),BN(i)&&l.push(i.name)}var hs,Qu,co,mi,ed,hr,xa,td,ba,nd,wa,uo,rd,kh=class{constructor(e,t={}){Ht(this,hs,void 0),Ht(this,Qu,he()),Ht(this,co,he()),Ht(this,mi,void 0),Ht(this,ed,void 0),Ht(this,hr,rr.None),Ht(this,xa,void 0),Ht(this,td,!0),Ht(this,ba,{create:[],view:[],update:[],destroy:[]}),Ht(this,nd,[]),Ht(this,wa,qg()),Ht(this,uo,void 0),Ht(this,rd,void 0),this.getState=()=>{var o;return ee(this,hr)>=rr.EditorView?this.view.state:(be(ee(this,uo),{code:q.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=ee(this,uo))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:n,extensionMap:r}=IH(e,t);cn(this,xa,t),cn(this,mi,Da(n)),cn(this,ed,r),cn(this,hs,this.createExtensionStore()),cn(this,hr,rr.Create),this.setupLifecycleHandlers();for(const o of ee(this,ba).create){const i=o();i&&ee(this,nd).push(i)}}static create(e,t={}){return new kh([...qM(e),...AH(t.builtin)],t)}get[Li](){return gn.Manager}get destroyed(){return ee(this,hr)===rr.Destroy}get mounted(){return ee(this,hr)>=rr.EditorView&&ee(this,hr)<rr.Destroy}get output(){var e;return(e=ee(this,uo))==null?void 0:e.frameworkOutput}get frameworkAttached(){return!!ee(this,uo)}get extensions(){return ee(this,mi)}get stringHandlers(){return ee(this,Qu)}get store(){return Da(ee(this,co))}get extensionStore(){return Da(ee(this,hs))}get tr(){return this.getExtension(Ve).transaction}get nodes(){return ee(this,co).nodes}get marks(){return ee(this,co).marks}get schema(){return ee(this,co).schema}get extensionTags(){return ee(this,co).tags}get view(){return ee(this,co).view}get settings(){return ee(this,xa)}get document(){return ee(this,xa).document??iv()}setupLifecycleHandlers(){const e=ee(this,hs),t=ee(this,ba),n=[],r=[],o=[];e.nodeNames=n,e.markNames=r,e.plainNames=o;for(const i of ee(this,mi))zH({extension:i,nodeNames:n,markNames:r,plainNames:o,handlers:t,store:e})}setStringHandler(e,t){ee(this,Qu)[e]=t}setStoreKey(e,t){ee(this,co)[e]=t}getStoreKey(e){const t=ee(this,co)[e];return be(!Js(t),{code:q.MANAGER_PHASE_ERROR,message:"`getStoreKey` should not be called before the values are available."}),t}setExtensionStore(e,t){be(ee(this,hr)<=rr.EditorView,{code:q.MANAGER_PHASE_ERROR,message:"`setExtensionStore` should only be called during the `onCreate` lifecycle hook. Make sure to only call it within the returned methods."}),ee(this,hs)[e]=t}createExtensionStore(){const e=he(),t=!0;let n,r;return Object.defineProperties(e,{extensions:{get:()=>ee(this,mi),enumerable:t},phase:{get:()=>ee(this,hr),enumerable:t},view:{get:()=>this.view,enumerable:t},managerSettings:{get:()=>Da(ee(this,xa)),enumerable:t},getState:{value:this.getState,enumerable:t},updateState:{value:this.updateState,enumerable:t},isMounted:{value:()=>this.mounted,enumerable:t},getExtension:{value:this.getExtension.bind(this),enumerable:t},manager:{get:()=>this,enumerable:t},document:{get:()=>this.document,enumerable:t},stringHandlers:{get:()=>ee(this,Qu),enumerable:t},currentState:{get:()=>n??(n=this.getState()),set:o=>{n=o},enumerable:t},previousState:{get:()=>r,set:o=>{r=o},enumerable:t}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(ee(this,hr)>=rr.EditorView)return this;cn(this,td,!0),cn(this,hr,rr.EditorView),ee(this,co).view=e;for(const t of ee(this,ba).view){const n=t(e);n&&ee(this,nd).push(n)}return this}attachFramework(e,t){var n;ee(this,uo)!==e&&(ee(this,uo)&&(ee(this,uo).destroy(),(n=ee(this,rd))==null||n.call(this)),cn(this,uo,e),cn(this,rd,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;const t=(e=this.schema.nodes.doc)==null?void 0:e.createAndFill();return be(t,{code:q.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),t}createState(e={}){const{onError:t,defaultSelection:n="end"}=this.settings,{content:r=this.createEmptyDoc(),selection:o=n,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=wN({stringHandler:_e(i)?this.stringHandlers[i]:i,document:this.document,content:r,onError:t,schema:s,selection:o});return Ia.create({schema:s,doc:l,plugins:a,selection:Jr(o,l)})}addHandler(e,t){return ee(this,wa).on(e,t)}onStateUpdate(e){const t=ee(this,td);ee(this,hs).currentState=e.state,ee(this,hs).previousState=e.previousState,t&&(cn(this,hr,rr.Runtime),cn(this,td,!1));const n={...e,firstUpdate:t};for(const r of ee(this,ba).update)r(n);ee(this,wa).emit("stateUpdate",n)}getExtension(e){const t=ee(this,ed).get(e);return be(t,{code:q.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!ee(this,ed).get(e)}clone(){const e=ee(this,mi).map(n=>n.clone(n.options)),t=kh.create(()=>e,ee(this,xa));return ee(this,wa).emit("clone",t),t}recreate(e=[],t={}){const n=ee(this,mi).map(o=>o.clone(o.initialOptions)),r=kh.create(()=>[...n,...e],t);return ee(this,wa).emit("recreate",r),r}destroy(){var e,t,n,r,o,i;cn(this,hr,rr.Destroy);for(const s of((e=this.view)==null?void 0:e.state.plugins)??[])(n=(t=s.getState(this.view.state))==null?void 0:t.destroy)==null||n.call(t);(r=ee(this,uo))==null||r.destroy(),(o=ee(this,rd))==null||o.call(this);for(const s of ee(this,nd))s();for(const s of ee(this,ba).destroy)s();(i=this.view)==null||i.destroy(),ee(this,wa).emit("destroy")}includes(e){const t=[],n=[];for(const r of ee(this,mi))t.push(r.name,r.constructorName),n.push(r.constructor);return e.every(r=>_e(r)?Ao(t,r):Ao(n,r))}},FH=kh;hs=new WeakMap;Qu=new WeakMap;co=new WeakMap;mi=new WeakMap;ed=new WeakMap;hr=new WeakMap;xa=new WeakMap;td=new WeakMap;ba=new WeakMap;nd=new WeakMap;wa=new WeakMap;uo=new WeakMap;rd=new WeakMap;function BH(e,t){return!cu(e)||!uu(e,gn.Manager)?!1:t?e.includes(t):!0}var UH=Object.defineProperty,VH=Object.getOwnPropertyDescriptor,HH=(e,t,n,r)=>{for(var o=r>1?void 0:r?VH(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&UH(t,n,o),o},HN=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},fe=(e,t,n)=>(HN(e,t,"read from private field"),n?n.call(e):t.get(e)),mr=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},fr=(e,t,n,r)=>(HN(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),od,WH=class{constructor(){this.portals=new Map,mr(this,od,qg()),this.on=e=>fe(this,od).on("update",e),this.once=e=>{const t=fe(this,od).on("update",n=>{t(),e(n)});return t}}update(){fe(this,od).emit("update",this.portals)}render({Component:e,container:t}){const n=this.portals.get(t);this.portals.set(t,{Component:e,key:(n==null?void 0:n.key)??Em()}),this.update()}forceUpdate(){for(const[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:Em()})}remove(e){this.portals.delete(e),this.update()}};od=new WeakMap;var KH=e=>{const{portals:t}=e;return te.createElement(te.Fragment,null,t.map(([n,{Component:r,key:o}])=>$r.createPortal(te.createElement(r,null),n,o)))};function qH(e){const[t,n]=h.useState(()=>Array.from(e.portals.entries()));return h.useEffect(()=>e.on(r=>{n(Array.from(r.entries()))}),[e]),h.useMemo(()=>t,[t])}var Ct,id,Sa,sd,Eh,ad,Yl,ld,_h,gi,Fn,eb,WN=class{constructor({getPosition:e,node:t,portalContainer:n,view:r,ReactComponent:o,options:i}){mr(this,Ct,void 0),mr(this,id,[]),mr(this,Sa,void 0),mr(this,sd,void 0),mr(this,Eh,void 0),mr(this,ad,void 0),mr(this,Yl,void 0),mr(this,ld,!1),mr(this,_h,void 0),mr(this,gi,void 0),mr(this,Fn,void 0),mr(this,eb,l=>{l&&(be(fe(this,gi),{code:q.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${fe(this,Ct).type.name}' which doesn't support content.`}),l.append(fe(this,gi)))}),this.Component=()=>{const l=fe(this,Eh);return be(l,{code:q.REACT_NODE_VIEW,message:`The custom react node view provided for ${fe(this,Ct).type.name} doesn't have a valid ReactComponent`}),te.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:fe(this,Sa),getPosition:fe(this,ad),node:fe(this,Ct),forwardRef:fe(this,eb),decorations:fe(this,id)})},this.updateAttributes=l=>{if(!fe(this,Sa).editable)return;const c=fe(this,ad).call(this);if(c==null)return;const u=fe(this,Sa).state.tr.setNodeMarkup(c,void 0,{...fe(this,Ct).attrs,...l});fe(this,Sa).dispatch(u)},be(pt(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),fr(this,Ct,t),fr(this,Sa,r),fr(this,sd,n),fr(this,Eh,o),fr(this,ad,e),fr(this,Yl,i),fr(this,Fn,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};fr(this,_h,s??void 0),fr(this,gi,a),fe(this,gi)&&fe(this,Fn).append(fe(this,gi)),this.setDomAttributes(fe(this,Ct),fe(this,Fn)),this.Component.displayName=FM(`${fe(this,Ct).type.name}NodeView`),this.renderComponent()}static create(e){const{portalContainer:t,ReactComponent:n,options:r}=e;return(o,i,s)=>new WN({options:r,node:o,view:i,getPosition:s,portalContainer:t,ReactComponent:n})}get selected(){return fe(this,ld)}get contentDOM(){return fe(this,_h)}get dom(){return fe(this,Fn)}renderComponent(){fe(this,sd).render({Component:this.Component,container:fe(this,Fn)})}createDom(){const{defaultBlockNode:e,defaultInlineNode:t}=fe(this,Yl),n=fe(this,Ct).isInline?document.createElement(t):document.createElement(e);return n.classList.add(`${PE(fe(this,Ct).type.name)}-node-view-wrapper`),n}createContentDom(){var e,t;if(fe(this,Ct).isLeaf)return;const n=(t=(e=fe(this,Ct).type.spec).toDOM)==null?void 0:t.call(e,fe(this,Ct));if(!n)return;const{contentDOM:r,dom:o}=ko.renderSpec(document,n);let i;if(ri(o))return i=o,o===r&&(i=document.createElement("span"),i.classList.add(`${PE(fe(this,Ct).type.name)}-node-view-content-wrapper`),i.append(r)),ri(r),{wrapper:i,contentDOM:r}}update(e,t){return cw({types:fe(this,Ct).type,node:e})?(fe(this,Ct)===e&&fe(this,id)===t||(fe(this,Ct).sameMarkup(e)||this.setDomAttributes(e,fe(this,Fn)),fr(this,Ct,e),fr(this,id,t),this.renderComponent()),!0):!1}setDomAttributes(e,t){const{toDOM:n}=fe(this,Ct).type.spec;let r=e.attrs;if(n){const o=n(e);if(_e(o)||GH(o))return;xl(o[1])&&(r=o[1])}for(const[o,i]of Jt(r))t.setAttribute(o,i)}selectNode(){fr(this,ld,!0),fe(this,Fn)&&fe(this,Fn).classList.add(_E),this.renderComponent()}deselectNode(){fr(this,ld,!1),fe(this,Fn)&&fe(this,Fn).classList.remove(_E),this.renderComponent()}destroy(){fe(this,sd).remove(fe(this,Fn))}ignoreMutation(e){return e.type==="selection"?!fe(this,Ct).type.spec.selectable:fe(this,gi)?!fe(this,gi).contains(e.target):!0}stopEvent(e){var t;if(!fe(this,Fn))return!1;if(pt(fe(this,Yl).stopEvent))return fe(this,Yl).stopEvent({event:e});const n=e.target;if(!(fe(this,Fn).contains(n)&&!((t=this.contentDOM)!=null&&t.contains(n))))return!1;const o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o)return!0;const s=!!fe(this,Ct).type.spec.draggable,a=we.isSelectable(fe(this,Ct)),l=e.type==="copy",c=e.type==="paste",u=e.type==="cut",d=e.type==="mousedown",f=e.type.startsWith("drag");return!s&&a&&f&&e.preventDefault(),!(f||o||l||c||u||d&&a)}},q_=WN;Ct=new WeakMap;id=new WeakMap;Sa=new WeakMap;sd=new WeakMap;Eh=new WeakMap;ad=new WeakMap;Yl=new WeakMap;ld=new WeakMap;_h=new WeakMap;gi=new WeakMap;Fn=new WeakMap;eb=new WeakMap;function GH(e){return Wx(e)||xl(e)&&Wx(e.dom)}var Of=class extends _t{constructor(){super(...arguments),this.portalContainer=new WH}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const e=he(),t=this.store.managerSettings.nodeViewComponents??{};for(const r of this.store.extensions)!r.ReactComponent||!cp(r)||r.reactComponentEnvironment==="ssr"||(e[r.name]=q_.create({options:this.options,ReactComponent:r.ReactComponent,portalContainer:this.portalContainer}));const n=Jt({...this.options.nodeViewComponents,...t});for(const[r,o]of n)e[r]=q_.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return e}};Of=HH([Je({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],Of);function YH(e){const t=h.createContext(null),n=XH(t);return[o=>{const i=e(o);return te.createElement(t.Provider,{value:i},o.children)},n,t]}function XH(e){return(t,n)=>{const r=h.useContext(e),o=ZH(r);if(!r)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!t)return r;if(typeof t!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=t(r);if(!o||!n)return i;const s=t(o);return n(s,i)?s:i}}function ZH(e){const t=h.useRef();return JH(()=>{t.current=e}),t.current}var JH=typeof document<"u"?h.useLayoutEffect:h.useEffect;function QH(e,t){return YH(n=>{const r=h.useRef(null),o=h.useRef(),i=t==null?void 0:t(n),[s,a]=h.useState(()=>e({get:G_(r),set:Y_(o),previousContext:void 0,props:n,state:i})),l=[...Object.values(n),i];return h.useEffect(()=>{l.length!==0&&a(c=>e({get:G_(r),set:Y_(o),previousContext:c,props:n,state:i}))},l),r.current=s,o.current=a,s})}function G_(e){return t=>{if(!e.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!t)return e.current;if(typeof t!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function Y_(e){return t=>{if(!e.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(n=>({...n,...typeof t=="function"?t(n):t}))}}var KN={},qN={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(n){n.MalformedUnicode="MALFORMED_UNICODE",n.MalformedHexadecimal="MALFORMED_HEXADECIMAL",n.CodePointLimit="CODE_POINT_LIMIT",n.OctalDeprecation="OCTAL_DEPRECATION",n.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])})(qN);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;const t=qN;Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function n(p){return!p.match(/[^a-f0-9]/i)?parseInt(p,16):NaN}function r(p,m,g){const y=n(p);if(Number.isNaN(y)||g!==void 0&&g!==p.length)throw new SyntaxError(t.errorMessages.get(m));return y}function o(p){const m=r(p,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(m)}function i(p,m){const g=r(p,t.ErrorType.MalformedUnicode,4);if(m!==void 0){const y=r(m,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(g,y)}return String.fromCharCode(g)}function s(p){return p.charAt(0)==="{"&&p.charAt(p.length-1)==="}"}function a(p){if(!s(p))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));const m=p.slice(1,-1),g=r(m,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(g)}catch(y){throw y instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):y}}function l(p,m=!1){if(m)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));const g=parseInt(p,8);return String.fromCharCode(g)}const c=new Map([["b","\b"],["f","\f"],["n",`
|
|
178
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(p){return c.get(p)||p}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(p,m=!1){return p.replace(d,function(g,y,v,x,w,k,E,S,_){if(y!==void 0)return"\\";if(v!==void 0)return o(v);if(x!==void 0)return a(x);if(w!==void 0)return i(w,k);if(E!==void 0)return i(E);if(S==="0")return"\0";if(S!==void 0)return l(S,!m);if(_!==void 0)return u(_);throw new SyntaxError(t.errorMessages.get(t.ErrorType.EndOfString))})}e.unraw=f,e.default=f})(KN);const eW=ai(KN),Ka=e=>typeof e=="string",tW=e=>typeof e=="function",X_=new Map,GN="en";function vw(e){return[...Array.isArray(e)?e:[e],GN]}function YN(e,t,n){const r=vw(e);return Vm(()=>Hm("date",r,n),()=>new Intl.DateTimeFormat(r,n)).format(Ka(t)?new Date(t):t)}function tb(e,t,n){const r=vw(e);return Vm(()=>Hm("number",r,n),()=>new Intl.NumberFormat(r,n)).format(t)}function Z_(e,t,n,{offset:r=0,...o}){const i=vw(e),s=t?Vm(()=>Hm("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):Vm(()=>Hm("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[n]??o[s.select(n-r)]??o.other}function Vm(e,t){const n=e();let r=X_.get(n);return r||(r=t(),X_.set(n,r)),r}function Hm(e,t,n){const r=t.join("-");return`${e}-${r}-${JSON.stringify(n)}`}const XN=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,nW=(e,t,n={})=>{const r=t||e,o=s=>typeof s=="object"?s:n[s]||{style:s},i=(s,a)=>{const l=Object.keys(n).length?o("number"):void 0,c=tb(r,s,l);return a.replace("#",c)};return{plural:(s,a)=>{const{offset:l=0}=a,c=Z_(r,!1,s,a);return i(s-l,c)},selectordinal:(s,a)=>{const{offset:l=0}=a,c=Z_(r,!0,s,a);return i(s-l,c)},select:rW,number:(s,a)=>tb(r,s,o(a)),date:(s,a)=>YN(r,s,o(a)),undefined:oW}},rW=(e,t)=>t[e]??t.other,oW=e=>e;function iW(e,t,n){return(r={},o)=>{const i=nW(t,n,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(Ka(u))return c+u;const[d,f,p]=u;let m={};p!=null&&typeof p=="object"?Object.entries(p).forEach(([v,x])=>{m[v]=s(x)}):m=p;const g=i[f],y=g(r[d],m);return y==null?c:c+y},""):l,a=s(e);return Ka(a)&&XN.test(a)?eW(a.trim()):Ka(a)?a.trim():a?String(a):""}}var sW=Object.defineProperty,aW=(e,t,n)=>t in e?sW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lW=(e,t,n)=>(aW(e,typeof t!="symbol"?t+"":t,n),n);class cW{constructor(){lW(this,"_events",{})}on(t,n){var r;return(r=this._events)[t]??(r[t]=[]),this._events[t].push(n),()=>this.removeListener(t,n)}removeListener(t,n){const r=this._getListeners(t);if(!r)return;const o=r.indexOf(n);~o&&r.splice(o,1)}emit(t,...n){const r=this._getListeners(t);r&&r.map(o=>o.apply(this,n))}_getListeners(t){const n=this._events[t];return Array.isArray(n)?n:!1}}var uW=Object.defineProperty,dW=(e,t,n)=>t in e?uW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Il=(e,t,n)=>(dW(e,typeof t!="symbol"?t+"":t,n),n);class fW extends cW{constructor(t){super(),Il(this,"_locale",""),Il(this,"_locales"),Il(this,"_localeData",{}),Il(this,"_messages",{}),Il(this,"_missing"),Il(this,"t",this._.bind(this)),t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(typeof t.locale=="string"||t.locales)&&this.activate(t.locale??GN,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(t,n){const r=this._localeData[t];r?Object.assign(r,n):this._localeData[t]=n}loadLocaleData(t,n){n!=null?this._loadLocaleData(t,n):Object.keys(t).forEach(r=>this._loadLocaleData(r,t[r])),this.emit("change")}_load(t,n){const r=this._messages[t];r?Object.assign(r,n):this._messages[t]=n}load(t,n){typeof t=="string"&&typeof n=="object"?this._load(t,n):Object.entries(t).forEach(([r,o])=>this._load(r,o)),this.emit("change")}loadAndActivate({locale:t,locales:n,messages:r}){this._locale=t,this._locales=n||void 0,this._messages[this._locale]=r,this.emit("change")}activate(t,n){this._locale=t,this._locales=n,this.emit("change")}_(t,n,r){let o=r==null?void 0:r.message;Ka(t)||(n=t.values||n,o=t.message,t=t.id);const i=this.messages[t],s=i===void 0,a=this._missing;if(a&&s)return tW(a)?a(this._locale,t):a;s&&this.emit("missing",{id:t,locale:this._locale});let l=i||o||t;return Ka(l)&&XN.test(l)?JSON.parse(`"${l}"`):Ka(l)?l:iW(l,this._locale,this._locales)(n,r==null?void 0:r.formats)}date(t,n){return YN(this._locales||this._locale,t,n)}number(t,n){return tb(this._locales||this._locale,t,n)}}function pW(e={}){return new fW(e)}const cv=pW();function X(e,t){return t?"other":e==1?"one":"other"}function Ki(e,t){return t?"other":e==0||e==1?"one":"other"}function dr(e,t){var n=String(e).split("."),r=!n[1];return t?"other":e==1&&r?"one":"other"}function st(e,t){return"other"}function fa(e,t){return t?"other":e==1?"one":e==2?"two":"other"}const hW=st,mW=X,gW=Ki;function vW(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const yW=X;function xW(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function bW(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function wW(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const SW=X,kW=dr;function EW(e,t){var n=String(e).split("."),r=n[0],o=r.slice(-1),i=r.slice(-2),s=r.slice(-3);return t?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":r==0||o==6||i==40||i==60||i==90?"many":"other":e==1?"one":"other"}function _W(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2);return t?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":r&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const CW=X,OW=X,TW=X,PW=Ki,MW=st;function RW(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const NW=st;function $W(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2),s=r&&n[0].slice(-6);return t?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":e!=0&&r&&s==0?"many":"other"}const AW=X;function DW(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function IW(e,t){var n=String(e).split("."),r=!n[1];return t?e==1||e==3?"one":e==2?"two":e==4?"few":"other":e==1&&r?"one":"other"}const LW=X;function jW(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return t?"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const zW=X,FW=X,BW=X;function UW(e,t){var n=String(e).split("."),r=n[0],o=!n[1];return t?"other":e==1&&o?"one":r>=2&&r<=4&&o?"few":o?"other":"many"}function VW(e,t){return t?e==0||e==7||e==8||e==9?"zero":e==1?"one":e==2?"two":e==3||e==4?"few":e==5||e==6?"many":"other":e==0?"zero":e==1?"one":e==2?"two":e==3?"few":e==6?"many":"other"}function HW(e,t){var n=String(e).split("."),r=n[0],o=Number(n[0])==e;return t?"other":e==1||!o&&(r==0||r==1)?"one":"other"}const WW=dr;function KW(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const qW=X,GW=st,YW=X,XW=X;function ZW(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return t?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":e==1&&r?"one":"other"}const JW=X,QW=X,eK=dr,tK=X;function nK(e,t){return t?"other":e>=0&&e<=1?"one":"other"}function rK(e,t){return t?"other":e>=0&&e<2?"one":"other"}const oK=dr;function iK(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const sK=X;function aK(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const lK=X,cK=dr;function uK(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?e==1?"one":"other":e==1?"one":e==2?"two":r&&e>=3&&e<=6?"few":r&&e>=7&&e<=10?"many":"other"}function dK(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?e==1||e==11?"one":e==2||e==12?"two":e==3||e==13?"few":"other":e==1||e==11?"one":e==2||e==12?"two":r&&e>=3&&e<=10||r&&e>=13&&e<=19?"few":"other"}const fK=dr,pK=X;function hK(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const mK=Ki;function gK(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const vK=X,yK=X;function xK(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=Number(n[0])==e,s=i&&n[0].slice(-1);return t?"other":e==1&&o?"one":r==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}function bK(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}function wK(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function SK(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function kK(e,t){return t?e==1||e==5?"one":"other":e==1?"one":"other"}function EK(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const _K=dr,CK=st,OK=st,TK=st,PK=dr;function MK(e,t){var n=String(e).split("."),r=n[0],o=Number(n[0])==e,i=r.slice(-1),s=r.slice(-2);return t?"other":o&&i==1&&s!=11||!o?"one":"other"}function RK(e,t){var n=String(e).split("."),r=!n[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&r?"one":"other"}const NK=fa;function $K(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=Number(n[0])==e,s=i&&n[0].slice(-1);return t?"other":e==1&&o?"one":r==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}const AK=st,DK=st,IK=X,LK=dr,jK=X,zK=st,FK=st;function BK(e,t){var n=String(e).split("."),r=n[0],o=r.slice(-2);return t?r==1?"one":r==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":e==1?"one":"other"}function UK(e,t){return t?"other":e>=0&&e<2?"one":"other"}const VK=X,HK=X,WK=st,KK=st;function qK(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1);return t?o==6||o==9||r&&o==0&&e!=0?"many":"other":e==1?"one":"other"}const GK=X,YK=X,XK=st;function ZK(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const JK=st,QK=X,eq=X;function tq(e,t){return t?"other":e==0?"zero":e==1?"one":"other"}const nq=X;function rq(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2),i=r&&n[0].slice(-3),s=r&&n[0].slice(-5),a=r&&n[0].slice(-6);return t?r&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":e==5||o==5?"many":"other":e==0?"zero":e==1?"one":o==2||o==22||o==42||o==62||o==82||r&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||e!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":e!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const oq=X;function iq(e,t){var n=String(e).split("."),r=n[0];return t?"other":e==0?"zero":(r==0||r==1)&&e!=0?"one":"other"}const sq=X,aq=X,lq=st,cq=Ki;function uq(e,t){return t&&e==1?"one":"other"}function dq(e,t){var n=String(e).split("."),r=n[1]||"",o=Number(n[0])==e,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return t?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":r!=0?"many":"other"}function fq(e,t){var n=String(e).split("."),r=n[1]||"",o=r.length,i=Number(n[0])==e,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const pq=X,hq=Ki,mq=X;function gq(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const vq=X,yq=X;function xq(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-2);return t?e==1?"one":"other":e==1&&r?"one":!r||e==0||i>=2&&i<=19?"few":"other"}function bq(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":"other":e==1?"one":"other"}function wq(e,t){return t&&e==1?"one":"other"}function Sq(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2);return t?"other":e==1?"one":e==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const kq=st,Eq=X,_q=fa,Cq=X,Oq=X;function Tq(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?r&&e>=1&&e<=4?"one":"other":e==1?"one":"other"}const Pq=dr,Mq=X,Rq=X,Nq=X,$q=st,Aq=X,Dq=Ki,Iq=X,Lq=X,jq=X;function zq(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?e==1||e==5||r&&e>=7&&e<=9?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e==1?"one":"other"}const Fq=X,Bq=st,Uq=Ki,Vq=X;function Hq(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return t?"other":e==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&r!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function Wq(e,t){var n=String(e).split("."),r=n[1]||"",o=r.length,i=Number(n[0])==e,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const Kq=X;function qq(e,t){var n=String(e).split("."),r=n[0];return t?"other":r==0||r==1?"one":"other"}const Gq=dr,Yq=X;function Xq(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-2);return t?e==1?"one":"other":e==1&&r?"one":!r||e==0||i>=2&&i<=19?"few":"other"}const Zq=X,Jq=st;function Qq(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return t?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const eG=X,tG=st,nG=X;function rG(e,t){var n=String(e).split("."),r=!n[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&r?"one":"other"}function oG(e,t){var n=String(e).split("."),r=!n[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&r?"one":"other"}const iG=X,sG=X,aG=fa,lG=X,cG=st,uG=st;function dG(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function fG(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e>=0&&e<=1?"one":r&&e>=2&&e<=10?"few":"other"}function pG(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"";return t?"other":e==0||e==1||r==0&&o==1?"one":"other"}function hG(e,t){var n=String(e).split("."),r=n[0],o=!n[1];return t?"other":e==1&&o?"one":r>=2&&r<=4&&o?"few":o?"other":"many"}function mG(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const gG=fa,vG=fa,yG=fa,xG=fa,bG=fa,wG=X,SG=X;function kG(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2);return t?e==1?"one":o==4&&i!=14?"many":"other":e==1?"one":"other"}function EG(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const _G=X,CG=X,OG=X,TG=st;function PG(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return t?(i==1||i==2)&&s!=11&&s!=12?"one":"other":e==1&&r?"one":"other"}const MG=dr,RG=X,NG=X,$G=X,AG=X,DG=st,IG=Ki,LG=X;function jG(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1);return t?o==6||o==9||e==10?"few":"other":e==1?"one":"other"}function zG(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const FG=X,BG=st,UG=X,VG=X;function HG(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e==0||e==1||r&&e>=11&&e<=99?"one":"other"}const WG=X;function KG(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=Number(n[0])==e,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-1),c=r.slice(-2);return t?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const qG=dr,GG=X,YG=X;function XG(e,t){return t&&e==1?"one":"other"}const ZG=X,JG=X,QG=Ki,eY=X,tY=st,nY=X,rY=X,oY=dr,iY=st,sY=st,aY=st;function lY(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const cY=Object.freeze(Object.defineProperty({__proto__:null,_in:hW,af:mW,ak:gW,am:vW,an:yW,ar:xW,ars:bW,as:wW,asa:SW,ast:kW,az:EW,be:_W,bem:CW,bez:OW,bg:TW,bho:PW,bm:MW,bn:RW,bo:NW,br:$W,brx:AW,bs:DW,ca:IW,ce:LW,ceb:jW,cgg:zW,chr:FW,ckb:BW,cs:UW,cy:VW,da:HW,de:WW,dsb:KW,dv:qW,dz:GW,ee:YW,el:XW,en:ZW,eo:JW,es:QW,et:eK,eu:tK,fa:nK,ff:rK,fi:oK,fil:iK,fo:sK,fr:aK,fur:lK,fy:cK,ga:uK,gd:dK,gl:fK,gsw:pK,gu:hK,guw:mK,gv:gK,ha:vK,haw:yK,he:xK,hi:bK,hr:wK,hsb:SK,hu:kK,hy:EK,ia:_K,id:CK,ig:OK,ii:TK,io:PK,is:MK,it:RK,iu:NK,iw:$K,ja:AK,jbo:DK,jgo:IK,ji:LK,jmc:jK,jv:zK,jw:FK,ka:BK,kab:UK,kaj:VK,kcg:HK,kde:WK,kea:KK,kk:qK,kkj:GK,kl:YK,km:XK,kn:ZK,ko:JK,ks:QK,ksb:eq,ksh:tq,ku:nq,kw:rq,ky:oq,lag:iq,lb:sq,lg:aq,lkt:lq,ln:cq,lo:uq,lt:dq,lv:fq,mas:pq,mg:hq,mgo:mq,mk:gq,ml:vq,mn:yq,mo:xq,mr:bq,ms:wq,mt:Sq,my:kq,nah:Eq,naq:_q,nb:Cq,nd:Oq,ne:Tq,nl:Pq,nn:Mq,nnh:Rq,no:Nq,nqo:$q,nr:Aq,nso:Dq,ny:Iq,nyn:Lq,om:jq,or:zq,os:Fq,osa:Bq,pa:Uq,pap:Vq,pl:Hq,prg:Wq,ps:Kq,pt:qq,pt_PT:Gq,rm:Yq,ro:Xq,rof:Zq,root:Jq,ru:Qq,rwk:eG,sah:tG,saq:nG,sc:rG,scn:oG,sd:iG,sdh:sG,se:aG,seh:lG,ses:cG,sg:uG,sh:dG,shi:fG,si:pG,sk:hG,sl:mG,sma:gG,smi:vG,smj:yG,smn:xG,sms:bG,sn:wG,so:SG,sq:kG,sr:EG,ss:_G,ssy:CG,st:OG,su:TG,sv:PG,sw:MG,syr:RG,ta:NG,te:$G,teo:AG,th:DG,ti:IG,tig:LG,tk:jG,tl:zG,tn:FG,to:BG,tr:UG,ts:VG,tzm:HG,ug:WG,uk:KG,ur:qG,uz:GG,ve:YG,vi:XG,vo:ZG,vun:JG,wa:QG,wae:eY,wo:tY,xh:nY,xog:rY,yi:oY,yo:iY,yue:sY,zh:aY,zu:lY},Symbol.toStringTag,{value:"Module"}));var uY=Object.defineProperty,dY=Object.getOwnPropertyDescriptor,fY=Object.getOwnPropertyNames,pY=Object.prototype.hasOwnProperty,J_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of fY(t))!pY.call(e,o)&&o!==n&&uY(e,o,{get:()=>t[o],enumerable:!(r=dY(t,o))||r.enumerable});return e},hY=(e,t,n)=>(J_(e,t,"default"),n&&J_(n,t,"default")),mY=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),ZN={};hY(ZN,cY);cv.loadLocaleData("en",{plurals:ZN.en});cv.load("en",mY);cv.activate("en");var gY=Object.defineProperty,vY=Object.getOwnPropertyDescriptor,yw=(e,t,n,r)=>{for(var o=r>1?void 0:r?vY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&gY(t,n,o),o},Xc=class extends oo{get name(){return"doc"}createNodeSpec(e,t){const{docAttributes:n,content:r}=this.options,o=he();if(xl(n))for(const[i,s]of Jt(n))o[i]={default:s};else for(const i of n)o[i]={default:null};return{attrs:o,content:r,...t}}setDocAttributes(e){return({tr:t,dispatch:n})=>{if(n){for(const[r,o]of Object.entries(e))t.step(new Tf(r,o));n(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return pw(e.doc,t)}};yw([de()],Xc.prototype,"setDocAttributes",1);yw([It()],Xc.prototype,"isDefaultDocNode",1);Xc=yw([Je({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:ct.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],Xc);var JN="SetDocAttribute",QN="RevertSetDocAttribute",Tf=class extends tn{constructor(e,t,n=JN){super(),this.stepType=n,this.key=e,this.value=t}static fromJSON(e,t){return new Tf(t.key,t.value,t.stepType)}apply(e){this.previous=e.attrs[this.key];const t={...e.attrs,[this.key]:this.value};return Bt.ok(e.type.create(t,e.content,e.marks))}invert(){return new Tf(this.key,this.previous,QN)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{tn.jsonID(JN,Tf),tn.jsonID(QN,Tf)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}var yY=Object.defineProperty,xY=Object.getOwnPropertyDescriptor,e$=(e,t,n,r)=>{for(var o=r>1?void 0:r?xY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&yY(t,n,o),o};function bY(e,t,n,r){const o=e.docView.posFromDOM(t,n,r);return o===null||o<0?null:o}function wY(e,t){const n=t.target;if(n){const r=bY(e,n,0);if(r!==null){const o=e.state.doc.resolve(r),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:r,inside:s}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var Wm=class extends _t{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,n)=>{const r=n,o=wY(t,r);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=t.state.doc.resolve(l),u=c.depth+1;for(const d of KM(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=ji(c,d);f&&s.push(f)}return e(r,{view:t,nodes:i,marks:s,getMark:d=>{const f=_e(d)?t.state.schema.marks[d]:d;return be(f,{code:q.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(p=>p.mark.type===f)},getNode:d=>{var f;const p=_e(d)?t.state.schema.nodes[d]:d;be(p,{code:q.EXTENSION,message:"The node being checked does not exist"});const m=i.find(({node:g})=>g.type===p);if(m)return{...m,isRoot:!!((f=i[0])!=null&&f.node.eq(m.node))}}})}}get name(){return"events"}onView(){var e,t;if(!((e=this.store.managerSettings.exclude)!=null&&e.clickHandler))for(const n of this.store.extensions){if(!n.createEventHandlers||(t=n.options.exclude)!=null&&t.clickHandler)continue;const r=n.createEventHandlers();for(const[o,i]of Jt(r))this.addHandler(o,i)}}createPlugin(){const e=new WeakMap,t=(n,r,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,p=f.resolve(i),m=e.has(l),g=SY({$pos:p,handled:m,view:o,state:u});let y=!1;m||(y=n(l,g)||y);const v={...g,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:x=>{const w=_e(x)?d.nodes[x]:x;return be(w,{code:q.EXTENSION,message:"The node being checked does not exist"}),w===s.type?{node:s,pos:a}:void 0}};return e.set(l,!0),r(l,v)||y};return{props:{handleKeyPress:(n,r)=>this.options.keypress(r)||!1,handleKeyDown:(n,r)=>this.options.keydown(r)||!1,handleTextInput:(n,r,o,i)=>this.options.textInput({from:r,to:o,text:i})||!1,handleClickOn:(n,r,o,i,s,a)=>t(this.options.clickMark,this.options.click,n,r,o,i,s,a),handleDoubleClickOn:(n,r,o,i,s,a)=>t(this.options.doubleClickMark,this.options.doubleClick,n,r,o,i,s,a),handleTripleClickOn:(n,r,o,i,s,a)=>t(this.options.tripleClickMark,this.options.tripleClick,n,r,o,i,s,a),handleDOMEvents:{focus:(n,r)=>this.options.focus(r)||!1,blur:(n,r)=>this.options.blur(r)||!1,mousedown:(n,r)=>(this.startMouseover(),this.options.mousedown(r)||!1),mouseup:(n,r)=>(this.endMouseover(),this.options.mouseup(r)||!1),mouseleave:(n,r)=>(this.mouseover=!1,this.options.mouseleave(r)||!1),mouseenter:(n,r)=>(this.mouseover=!0,this.options.mouseenter(r)||!1),keyup:(n,r)=>this.options.keyup(r)||!1,mouseout:this.createMouseEventHandler((n,r)=>{const o={...r,hovering:!1};return this.options.hover(n,o)||!1}),mouseover:this.createMouseEventHandler((n,r)=>{const o={...r,hovering:!0};return this.options.hover(n,o)||!1}),contextmenu:this.createMouseEventHandler((n,r)=>this.options.contextmenu(n,r)||!1),scroll:(n,r)=>this.options.scroll(r)||!1,copy:(n,r)=>this.options.copy(r)||!1,cut:(n,r)=>this.options.cut(r)||!1,paste:(n,r)=>this.options.paste(r)||!1}},view:n=>{let r=n.editable;const o=this.options;return{update(i){const s=i.editable;s!==r&&(o.editable(s),r=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};e$([It()],Wm.prototype,"isInteracting",1);Wm=e$([Je({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:ct.High})],Wm);function SY(e){const{handled:t,view:n,$pos:r,state:o}=e,i={getMark:HM,markRanges:[],view:n,state:o};if(t)return i;for(const{type:s}of r.marksAcross(r)??[]){const a=ji(r,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=_e(s)?o.schema.marks[s]:s;return be(a,{code:q.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class Dt extends Be{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Dt.valid(r)?new Dt(r):Be.near(r)}content(){return Z.empty}eq(t){return t instanceof Dt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Dt(t.resolve(n.pos))}getBookmark(){return new xw(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!kY(t)||!EY(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Dt.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=n;let l=t.doc.resolve(o);if(Dt.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!we.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=t.doc.resolve(o);if(Dt.valid(a))return a}return null}}}Dt.prototype.visible=!1;Dt.findFrom=Dt.findGapCursorFrom;Be.jsonID("gapcursor",Dt);class xw{constructor(t){this.pos=t}map(t){return new xw(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Dt.valid(n)?new Dt(n):Be.near(n)}}function kY(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function EY(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function _Y(){return new Wi({props:{decorations:PY,createSelectionBetween(e,t,n){return t.pos==n.pos&&Dt.valid(n)?new Dt(n):null},handleClick:OY,handleKeyDown:CY,handleDOMEvents:{beforeinput:TY}}})}const CY=LN({ArrowLeft:Kp("horiz",-1),ArrowRight:Kp("horiz",1),ArrowUp:Kp("vert",-1),ArrowDown:Kp("vert",1)});function Kp(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,o,i){let s=r.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof Te){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}let c=Dt.findGapCursorFrom(a,t,l);return c?(o&&o(r.tr.setSelection(new Dt(c))),!0):!1}}function OY(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Dt.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&we.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Dt(r))),!0)}function TY(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Dt))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=U.empty;for(let s=r.length-1;s>=0;s--)o=U.from(r[s].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new Z(o,0,0));return i.setSelection(Te.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function PY(e){if(!(e.selection instanceof Dt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",et.create(e.doc,[Et.widget(e.selection.head,t,{key:"gapcursor"})])}var MY=Object.defineProperty,RY=Object.getOwnPropertyDescriptor,NY=(e,t,n,r)=>{for(var o=r>1?void 0:r?RY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&MY(t,n,o),o},nb=class extends _t{get name(){return"gapCursor"}createExternalPlugins(){return[_Y()]}};nb=NY([Je({})],nb);var Km=200,vn=function(){};vn.prototype.append=function(t){return t.length?(t=vn.from(t),!this.length&&t||t.length<Km&&this.leafAppend(t)||this.length<Km&&t.leafPrepend(this)||this.appendInner(t)):this};vn.prototype.prepend=function(t){return t.length?vn.from(t).append(this):this};vn.prototype.appendInner=function(t){return new $Y(this,t)};vn.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?vn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};vn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};vn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};vn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},n,r),o};vn.from=function(t){return t instanceof vn?t:t&&t.length?new t$(t):vn.empty};var t$=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Km)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Km)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(vn);vn.empty=new t$([]);var $Y=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,o,i,s){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(o,a),i,s)===!1)return!1},t.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new t(o,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(vn);const AY=500;class wo{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new Vo(d.map));let p=d.step.map(o.slice(i)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],c.push(new Vo(m,void 0,void 0,c.length+u.length))),i--,m&&o.appendMap(m,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new wo(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<t.steps.length;u++){let d=t.steps[u].invert(t.docs[u]),f=new Vo(t.mapping.maps[u],d,n),p;(p=l&&l.merge(f))&&(f=p,u?i.pop():a=a.slice(0,a.length-1)),i.push(f),n&&(s++,n=void 0),o||(l=f)}let c=s-r.depth;return c>IY&&(a=DY(a,c),s-=c),new wo(a.append(i),s)}remapping(t,n){let r=new Ec;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new wo(this.items.append(t.map(n=>new Vo(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=n;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let m=i.maps[p];if(f.step){let g=t.steps[p].invert(t.docs[p]),y=f.selection&&f.selection.map(i.slice(l+1,p));y&&a++,r.push(new Vo(m,g,y))}else r.push(new Vo(m))},o);let c=[];for(let f=n;f<s;f++)c.push(new Vo(i.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new wo(u,a);return d.emptyItemCount()>AY&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new Vo(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&r--},this.items.length,0),new wo(vn.from(o.reverse()),i)}}wo.empty=new wo(vn.empty,0);function DY(e,t){let n;return e.forEach((r,o)=>{if(r.selection&&t--==0)return n=o,!1}),e.slice(n)}class Vo{constructor(t,n,r,o){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Vo(n.getMap().invert(),n,this.selection)}}}class ws{constructor(t,n,r,o,i){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const IY=20;function LY(e,t,n,r){let o=n.getMeta(Zo),i;if(o)return o.historyState;n.getMeta(zY)&&(e=new ws(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(Zo))return s.getMeta(Zo).redo?new ws(e.done.addTransform(n,void 0,r,Ch(t)),e.undone,Q_(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new ws(e.done,e.undone.addTransform(n,void 0,r,Ch(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!jY(n,e.prevRanges)),c=s?zy(e.prevRanges,n.mapping):Q_(n.mapping.maps[n.steps.length-1]);return new ws(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,Ch(t)),wo.empty,c,n.time,a??e.prevComposition)}else return(i=n.getMeta("rebased"))?new ws(e.done.rebased(n,i),e.undone.rebased(n,i),zy(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new ws(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),zy(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function jY(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<t.length;i+=2)r<=t[i+1]&&o>=t[i]&&(n=!0)}),n}function Q_(e){let t=[];return e.forEach((n,r,o,i)=>t.push(o,i)),t}function zy(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function n$(e,t,n,r){let o=Ch(t),i=Zo.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,o),c=new ws(r?l:s.remaining,r?s.remaining:l,null,0,-1);n(s.transform.setSelection(a).setMeta(Zo,{redo:r,historyState:c}).scrollIntoView())}let Fy=!1,eC=null;function Ch(e){let t=e.plugins;if(eC!=t){Fy=!1,eC=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Fy=!0;break}}return Fy}const Zo=new lu("history"),zY=new lu("closeHistory");function FY(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Wi({key:Zo,state:{init(){return new ws(wo.empty,wo.empty,null,0,-1)},apply(t,n,r){return LY(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,o=r=="historyUndo"?Oh:r=="historyRedo"?cd:null;return o?(n.preventDefault(),o(t.state,t.dispatch)):!1}}}})}const Oh=(e,t)=>{let n=Zo.getState(e);return!n||n.done.eventCount==0?!1:(t&&n$(n,e,t,!1),!0)},cd=(e,t)=>{let n=Zo.getState(e);return!n||n.undone.eventCount==0?!1:(t&&n$(n,e,t,!0),!0)};function rb(e){let t=Zo.getState(e);return t?t.done.eventCount:0}function BY(e){let t=Zo.getState(e);return t?t.undone.eventCount:0}var UY=Object.defineProperty,VY=Object.getOwnPropertyDescriptor,wl=(e,t,n,r)=>{for(var o=r>1?void 0:r?VY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&UY(t,n,o),o},oi=class extends _t{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:n,dispatch:r,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=pt(i)?i():n,l=pt(s)&&r?s():r,c=e(a,l,o);return t==null||t(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":xo.isMac?()=>!1:this.wrapMethod(cd,this.options.onRedo),"Mod-z":this.wrapMethod(Oh,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(cd,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(Oh,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(cd,this.options.onRedo)(e)}createExternalPlugins(){const{depth:e,newGroupDelay:t}=this.options;return[FY({depth:e,newGroupDelay:t})]}undo(){return L_(this.wrapMethod(Oh,this.options.onUndo))}redo(){return L_(this.wrapMethod(cd,this.options.onRedo))}undoDepth(e=this.store.getState()){return rb(e)}redoDepth(e=this.store.getState()){return BY(e)}};wl([Lr({shortcut:Y.Undo,command:"undo"})],oi.prototype,"undoShortcut",1);wl([Lr({shortcut:Y.Redo,command:"redo"})],oi.prototype,"redoShortcut",1);wl([de({disableChaining:!0,description:({t:e})=>e(Rm.UNDO_DESCRIPTION),label:({t:e})=>e(Rm.UNDO_LABEL),icon:"arrowGoBackFill"})],oi.prototype,"undo",1);wl([de({disableChaining:!0,description:({t:e})=>e(Rm.REDO_DESCRIPTION),label:({t:e})=>e(Rm.REDO_LABEL),icon:"arrowGoForwardFill"})],oi.prototype,"redo",1);wl([It()],oi.prototype,"undoDepth",1);wl([It()],oi.prototype,"redoDepth",1);oi=wl([Je({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],oi);var HY=Object.defineProperty,WY=Object.getOwnPropertyDescriptor,uv=(e,t,n,r)=>{for(var o=r>1?void 0:r?WY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&HY(t,n,o),o},KY={icon:"paragraph",label:({t:e})=>e(Nm.INSERT_LABEL),description:({t:e})=>e(Nm.INSERT_DESCRIPTION)},qY={icon:"paragraph",label:({t:e})=>e(Nm.CONVERT_LABEL),description:({t:e})=>e(Nm.CONVERT_DESCRIPTION)},cl=class extends oo{get name(){return"paragraph"}createTags(){return[Le.LastNodeCompatible,Le.TextBlock,Le.Block,Le.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:n=>({...e.parse(n)})},...t.parseDOM??[]],toDOM:n=>["p",e.dom(n),0]}}convertParagraph(e={}){const{attrs:t,selection:n,preserveAttrs:r}=e;return this.store.commands.setBlockNodeType.original(this.type,t,n,r)}insertParagraph(e,t={}){const{selection:n,attrs:r}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:n,attrs:r})}shortcut(e){return this.convertParagraph()(e)}};uv([de(qY)],cl.prototype,"convertParagraph",1);uv([de(KY)],cl.prototype,"insertParagraph",1);uv([Lr({shortcut:Y.Paragraph,command:"convertParagraph"})],cl.prototype,"shortcut",1);cl=uv([Je({defaultPriority:ct.Medium})],cl);function Ci(e,t,n){return Math.min(Math.max(e,n),t)}class GY extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var ud=GY;function bw(e){if(typeof e!="string")throw new ud(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=nX.test(e)?ZY(e):e;const n=JY.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(Pf(a,2),16)),parseInt(Pf(s[3]||"f",2),16)/255]}const r=QY.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=eX.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=tX.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Ci(0,100,a)!==a)throw new ud(e);if(Ci(0,100,l)!==l)throw new ud(e);return[...rX(s,a,l),Number.isNaN(c)?1:c]}throw new ud(e)}function YY(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const tC=e=>parseInt(e.replace(/_/g,""),36),XY="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=tC(t.substring(0,3)),r=tC(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function ZY(e){const t=e.toLowerCase().trim(),n=XY[YY(t)];if(!n)throw new ud(e);return`#${n}`}const Pf=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),JY=new RegExp(`^#${Pf("([a-f0-9])",3)}([a-f0-9])?$`,"i"),QY=new RegExp(`^#${Pf("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),eX=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Pf(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),tX=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,nX=/^[a-z]+$/i,nC=e=>Math.round(e*255),rX=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(nC);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=r-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(nC)};function oX(e){const[t,n,r,o]=bw(e).map((d,f)=>f===3?d:d/255),i=Math.max(t,n,r),s=Math.min(t,n,r),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(t===i?(n-r)/l+(n<r?6:0):n===i?(r-t)/l+2:(t-n)/l+4),c,a,o]}function iX(e,t,n,r){return`hsla(${(e%360).toFixed()}, ${Ci(0,100,t*100).toFixed()}%, ${Ci(0,100,n*100).toFixed()}%, ${parseFloat(Ci(0,1,r).toFixed(3))})`}function br(e,t){const[n,r,o,i]=oX(e);return iX(n,r,o-t,i)}function sX(e){if(e==="transparent")return 0;function t(i){const s=i/255;return s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}const[n,r,o]=bw(e);return .2126*t(n)+.7152*t(r)+.0722*t(o)}function aX(e,t,n,r){return`rgba(${Ci(0,255,e).toFixed()}, ${Ci(0,255,t).toFixed()}, ${Ci(0,255,n).toFixed()}, ${parseFloat(Ci(0,1,r).toFixed(3))})`}function Th(e,t){return br(e,-t)}function qm(e,t){const[n,r,o,i]=bw(e);return aX(n,r,o,i-t)}function lX(e){return sX(e)>.179}function Tc(e){return lX(e)?"#000":"#fff"}const cX="remirror-editor-wrapper",uX="remirror-button-active",dX="remirror-button",fX="remirror-composite",pX="remirror-dialog",hX="remirror-dialog-backdrop",mX="remirror-form",gX="remirror-form-message",vX="remirror-form-label",yX="remirror-form-group",xX="remirror-group",bX="remirror-input",wX="remirror-menu",SX="remirror-menu-pane",kX="remirror-menu-pane-active",EX="remirror-menu-dropdown-label",_X="remirror-menu-pane-icon",CX="remirror-menu-pane-label",OX="remirror-menu-pane-shortcut",TX="remirror-menu-button-left",PX="remirror-menu-button-right",MX="remirror-menu-button-nested-left",RX="remirror-menu-button-nested-right",NX="remirror-menu-button",$X="remirror-menu-bar",AX="remirror-flex-column",DX="remirror-flex-row",IX="remirror-menu-item",LX="remirror-menu-item-row",jX="remirror-menu-item-column",zX="remirror-menu-item-checkbox",FX="remirror-menu-item-radio",BX="remirror-menu-group",UX="remirror-floating-popover",VX="remirror-popover",HX="remirror-animated-popover",WX="remirror-role",KX="remirror-separator",qX="remirror-tab",GX="remirror-tab-list",YX="remirror-tabbable",XX="remirror-toolbar",ZX="remirror-tooltip",JX="remirror-table-size-editor",QX="remirror-table-size-editor-body",eZ="remirror-table-size-editor-cell",tZ="remirror-table-size-editor-cell-selected",nZ="remirror-table-size-editor-footer",rZ="remirror-color-picker",oZ="remirror-color-picker-cell",iZ="remirror-color-picker-cell-selected";var sZ=Object.freeze({__proto__:null,ANIMATED_POPOVER:HX,BUTTON:dX,BUTTON_ACTIVE:uX,COLOR_PICKER:rZ,COLOR_PICKER_CELL:oZ,COLOR_PICKER_CELL_SELECTED:iZ,COMPOSITE:fX,DIALOG:pX,DIALOG_BACKDROP:hX,EDITOR_WRAPPER:cX,FLEX_COLUMN:AX,FLEX_ROW:DX,FLOATING_POPOVER:UX,FORM:mX,FORM_GROUP:yX,FORM_LABEL:vX,FORM_MESSAGE:gX,GROUP:xX,INPUT:bX,MENU:wX,MENU_BAR:$X,MENU_BUTTON:NX,MENU_BUTTON_LEFT:TX,MENU_BUTTON_NESTED_LEFT:MX,MENU_BUTTON_NESTED_RIGHT:RX,MENU_BUTTON_RIGHT:PX,MENU_DROPDOWN_LABEL:EX,MENU_GROUP:BX,MENU_ITEM:IX,MENU_ITEM_CHECKBOX:zX,MENU_ITEM_COLUMN:jX,MENU_ITEM_RADIO:FX,MENU_ITEM_ROW:LX,MENU_PANE:SX,MENU_PANE_ACTIVE:kX,MENU_PANE_ICON:_X,MENU_PANE_LABEL:CX,MENU_PANE_SHORTCUT:OX,POPOVER:VX,ROLE:WX,SEPARATOR:KX,TAB:qX,TABBABLE:YX,TABLE_SIZE_EDITOR:JX,TABLE_SIZE_EDITOR_BODY:QX,TABLE_SIZE_EDITOR_CELL:eZ,TABLE_SIZE_EDITOR_CELL_SELECTED:tZ,TABLE_SIZE_EDITOR_FOOTER:nZ,TAB_LIST:GX,TOOLBAR:XX,TOOLTIP:ZX});const aZ="remirror-image-loader";var lZ=Object.freeze({__proto__:null,IMAGE_LOADER:aZ});const cZ="remirror-list-item-with-custom-mark",uZ="remirror-ul-list-content",dZ="remirror-editor",fZ="remirror-list-item-marker-container",pZ="remirror-list-item-checkbox",hZ="remirror-collapsible-list-item-closed",mZ="remirror-collapsible-list-item-button",gZ="remirror-list-spine";var na=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:mZ,COLLAPSIBLE_LIST_ITEM_CLOSED:hZ,EDITOR:dZ,LIST_ITEM_CHECKBOX:pZ,LIST_ITEM_MARKER_CONTAINER:fZ,LIST_ITEM_WITH_CUSTOM_MARKER:cZ,LIST_SPINE:gZ,UL_LIST_CONTENT:uZ});const vZ="remirror-is-empty";var yZ=Object.freeze({__proto__:null,IS_EMPTY:vZ});const xZ="remirror-editor",bZ="remirror-positioner",wZ="remirror-positioner-widget";var SZ=Object.freeze({__proto__:null,EDITOR:xZ,POSITIONER:bZ,POSITIONER_WIDGET:wZ});const fo={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},Oi="#000000",ww="#ffffff",kZ="#252103",Sw=qm(Oi,.75),dv="#7963d2",kw="#bcd263",EZ="#fff",_Z="#fff",Ew=fo.gray[1],rC="rgba(10,31,68,0.08)",oC="rgba(10,31,68,0.10)",iC="rgba(10,31,68,0.12)",CZ=Th(qm(Oi,.1),.13),_w={background:ww,border:Sw,foreground:Oi,muted:Ew,primary:dv,secondary:kw,primaryText:EZ,secondaryText:_Z,text:kZ,faded:CZ},OZ={..._w,background:br(ww,.15),border:br(Sw,.15),foreground:br(Oi,.15),muted:br(Ew,.15),primary:br(dv,.15),secondary:br(kw,.15),get text(){return Tc(this.background)},get primaryText(){return Tc(this.primary)},get secondaryText(){return Tc(this.secondary)}},TZ={..._w,background:br(ww,.075),border:br(Sw,.075),foreground:br(Oi,.075),muted:br(Ew,.075),primary:br(dv,.075),secondary:br(kw,.075),get text(){return Tc(this.background)},get primaryText(){return Tc(this.primary)},get secondaryText(){return Tc(this.secondary)}};({..._w,backdrop:qm(Oi,.1),outline:qm(dv,.6),table:(Th(Oi,.8),Th(Oi,.4),fo.gray[3],fo.blue[7],fo.blue[1],fo.blue[5],fo.blue[7],Th(Oi,.4),fo.blue[5],fo.red[7],fo.red[1],fo.red[5])},`${rC}`,`${oC}`,`${iC}`);var PZ=Object.defineProperty,MZ=Object.getOwnPropertyDescriptor,Cw=(e,t,n,r)=>{for(var o=r>1?void 0:r?MZ(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&PZ(t,n,o),o},r$=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},qt=(e,t,n)=>(r$(e,t,"read from private field"),n?n.call(e):t.get(e)),pi=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},is=(e,t,n,r)=>(r$(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),dd,fd,Xl,pd,Ph,hd,md,gd,vd,Mh=class{constructor(e){pi(this,dd,qg()),pi(this,fd,[]),pi(this,Xl,new Map),pi(this,pd,[]),pi(this,Ph,!1),pi(this,hd,void 0),pi(this,md,void 0),pi(this,gd,void 0),pi(this,vd,void 0),this.addListener=(t,n)=>qt(this,dd).on(t,n),is(this,hd,e),is(this,md,e.getActive),is(this,vd,e.getPosition),is(this,gd,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new Mh(e)}static fromPositioner(e,t){return Mh.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:qt(this,md),getPosition:qt(this,vd),hasChanged:this.hasChanged,events:this.events,getID:qt(this,gd)}}onActiveChanged(e){this.recentUpdate=e;const t=qt(this,md).call(this,e);is(this,fd,t),is(this,Xl,new Map),is(this,Ph,!1),is(this,pd,[]);const n=[];for(const[r,o]of t.entries()){const i=this.getID(o,r);qt(this,pd).push(i),n.push({setElement:s=>this.addProps({...e,data:o,element:s},r),id:i,data:o})}qt(this,dd).emit("update",n)}getID(e,t){var n;return((n=qt(this,gd))==null?void 0:n.call(this,e,t))??t.toString()}addProps(e,t){if(qt(this,Ph)||(qt(this,Xl).set(t,e),qt(this,Xl).size<qt(this,fd).length))return;const n=[];for(const r of qt(this,fd).keys()){const o=qt(this,Xl).get(r);be(o,{code:q.INTERNAL,message:"Something went wrong when retrieving the parameters"});const i=qt(this,pd)[r];if(!i)return;n.push({position:qt(this,vd).call(this,o),element:o.element,id:i})}qt(this,dd).emit("done",n)}clone(e){return Mh.create({...qt(this,hd),...pt(e)?e(qt(this,hd)):e})}active(e){const t=pt(e)?e:()=>e;return this.clone(n=>({getActive:r=>n.getActive(r).filter(t)}))}},Mo=Mh;dd=new WeakMap;fd=new WeakMap;Xl=new WeakMap;pd=new WeakMap;Ph=new WeakMap;hd=new WeakMap;md=new WeakMap;gd=new WeakMap;vd=new WeakMap;Mo.EMPTY=[];function RZ(e,t=a$){const{key:n}=(e==null?void 0:e.getMeta(s$))??{};return n===t}function o$(e){const{tr:t,state:n,previousState:r}=e;return!r||t&&RZ(t)?!0:t?NU(t):!n.doc.eq(r.doc)||!n.selection.eq(r.selection)}function i$(e,t,n={}){const r=t.getBoundingClientRect(),{accountForPadding:o=!1}=n;let i=0,s=0,a=0,l=0;if(ri(t)&&o){const u=Number.parseFloat(rs(t,"padding-left").replace("px","")),d=Number.parseFloat(rs(t,"padding-right").replace("px","")),f=Number.parseFloat(rs(t,"padding-top").replace("px","")),p=Number.parseFloat(rs(t,"padding-bottom").replace("px","")),m=Number.parseFloat(rs(t,"border-left").replace("px","")),g=Number.parseFloat(rs(t,"border-right").replace("px","")),y=Number.parseFloat(rs(t,"border-top").replace("px","")),v=Number.parseFloat(rs(t,"border-bottom").replace("px","")),x=t.offsetWidth-t.clientWidth,w=t.offsetHeight-t.clientHeight;i+=u+m+(t.dir==="rtl"?x:0),s+=d+g+(t.dir==="rtl"?0:x),a+=f+y,l+=p+v+w}const c=new DOMRect(r.left+i,r.top+a,r.width-s,r.height-l);for(const[u,d]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(RE(u,c.top,c.bottom)&&RE(d,c.left,c.right))return!0;return!1}var NZ="remirror-positioner-widget",s$="positionerUpdate",a$="__all_positioners__",l$={y:-999999,x:-999999,width:0,height:0},sC={...l$,left:-999999,top:-999999,bottom:-999999,right:-999999},$Z={...l$,rect:{...sC,toJSON:()=>sC},visible:!1},AZ=Mo.create({hasChanged:o$,getActive(e){const{state:t}=e;if(!uw(t)||t.selection.$anchor.depth>2)return Mo.EMPTY;const n=tv({predicate:r=>r.type.isBlock,selection:t});return n?[n]:Mo.EMPTY},getPosition(e){const{view:t,data:n}=e,r=t.nodeDOM(n.pos);if(!ri(r))return $Z;const o=r.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=i$(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),c$=AZ.clone(({getActive:e})=>({getActive:t=>{const[n]=e(t);return n&&hw(n.node)&&n.node.type===ov(t.state.schema)?[n]:Mo.EMPTY}}));c$.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})}));c$.clone(({getPosition:e})=>({getPosition:t=>{const{width:n,x:r,y:o,height:i}=e(t);return{...e(t),width:1,x:n+r,rect:new DOMRect(n+r,o,1,i)}}}));function Ow(e){return Mo.create({hasChanged:o$,getActive:t=>{const{state:n,view:r}=t;if(!e(n)||!bl(n.selection))return Mo.EMPTY;try{const{head:o,anchor:i}=n.selection;return[{from:r.coordsAtPos(i),to:r.coordsAtPos(o)}]}catch{return Mo.EMPTY}},getPosition(t){const{element:n,data:r,view:o}=t,{from:i,to:s}=r,a=n.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),p=a.scrollLeft+(u?s.left-l.left:d-l.left),m=a.scrollTop+f-l.top,g=u?1:Math.abs(i.left-s.right),y=new DOMRect(u?s.left:d,f,g,c),v=i$(y,o.dom);return{rect:y,y:m,x:p,height:c,width:g,visible:v}}})}var DZ=Ow(e=>!e.selection.empty);Ow(e=>e.selection.empty);Ow(()=>!0);DZ.clone(()=>({getActive:e=>{const{state:t,view:n}=e;if(!t.selection.empty)return Mo.EMPTY;const r=bN(t);if(!r)return Mo.EMPTY;try{return[{from:n.coordsAtPos(r.from),to:n.coordsAtPos(r.to)}]}catch{return Mo.EMPTY}}}));var Mf=class extends _t{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:SZ.EDITOR}}init(){this.onScroll=Dz(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return et.empty;const t=Et.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return et.create(e.doc,[t])}forceUpdatePositioners(e=a$){return({tr:t,dispatch:n})=>(n==null||n(t.setMeta(s$,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const e=document.createElement("span");return e.dataset.id=NZ,e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(const t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){const n=this.store.getState(),r=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:r,state:n,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};Cw([de()],Mf.prototype,"forceUpdatePositioners",1);Cw([It()],Mf.prototype,"getPositionerWidget",1);Mf=Cw([Je({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],Mf);var IZ=Object.defineProperty,LZ=Object.getOwnPropertyDescriptor,jZ=(e,t,n,r)=>{for(var o=r>1?void 0:r?LZ(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&IZ(t,n,o),o},ob=class extends oo{get name(){return"text"}createTags(){return[Le.InlineNode]}createNodeSpec(){return{}}};ob=jZ([Je({disableExtraAttributes:!0,defaultPriority:ct.Medium})],ob);var zZ={...Xc.defaultOptions,...cl.defaultOptions,...oi.defaultOptions,excludeExtensions:[]};function FZ(e={}){e={...zZ,...e};const{content:t,depth:n,getDispatch:r,getState:o,newGroupDelay:i,excludeExtensions:s}=e,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new oi({depth:n,getDispatch:r,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new Xc({content:t})),a.text||l.push(new ob),a.paragraph||l.push(new cl),a.positioner||l.push(new Mf),a.gapCursor||l.push(new nb),a.events||l.push(new Wm),l}var BZ=Object.defineProperty,UZ=Object.getOwnPropertyDescriptor,VZ=(e,t,n,r)=>{for(var o=r>1?void 0:r?UZ(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&BZ(t,n,o),o},ul=class extends _t{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:pw(t.doc,{ignoreAttributes:!0})}),apply:(e,t,n,r)=>HZ({pluginState:t,tr:e,extension:this,state:r})},props:{decorations:e=>WZ({state:e,extension:this})}}}onSetOptions(e){const{changes:t}=e;t.placeholder.changed&&this.store.phase>=rr.EditorView&&this.store.updateAttributes()}};ul=VZ([Je({defaultOptions:{emptyNodeClass:yZ.IS_EMPTY,placeholder:""}})],ul);function HZ(e){const{pluginState:t,extension:n,tr:r,state:o}=e;return r.docChanged?{...n.options,empty:pw(o.doc)}:t}function WZ(e){const{extension:t,state:n}=e,{empty:r}=t.pluginKey.getState(n),{emptyNodeClass:o,placeholder:i}=t.options;if(!r)return null;const s=[];return n.doc.descendants((a,l)=>{const c=Et.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),et.create(n.doc,s)}var KZ=Object.defineProperty,qZ=Object.getOwnPropertyDescriptor,GZ=(e,t,n,r)=>{for(var o=r>1?void 0:r?qZ(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&KZ(t,n,o),o},YZ={...ul.defaultOptions,...Of.defaultOptions},XZ=[...ul.staticKeys,...Of.staticKeys],Rf=class extends _t{get name(){return"react"}onSetOptions(e){const{pickChanged:t}=e;this.getExtension(ul).setOptions(t(["placeholder"]))}createExtensions(){const{emptyNodeClass:e,placeholder:t,defaultBlockNode:n,defaultContentNode:r,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new ul({emptyNodeClass:e,placeholder:t,priority:ct.Low}),new Of({defaultBlockNode:n,defaultContentNode:r,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};Rf=GZ([Je({defaultOptions:YZ,staticKeys:XZ})],Rf);var u$={};Object.defineProperty(u$,"__esModule",{value:!0});function ZZ(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return lC(e[0],e[1])||null;var n=e.slice(1).reduce(function(r,o){return lC(r,o)},e[0]);return n||null}var Lu=u$.default=ZZ,aC=new WeakMap;function lC(e,t){if(e&&t){var n=aC.get(e)||new WeakMap;aC.set(e,n);var r=n.get(t)||function(o){cC(e,o),cC(t,o)};return n.set(t,r),r}return e||t}function cC(e,t){typeof e=="function"?e(t):e.current=t}var d$=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},By=(e,t,n)=>(d$(e,t,"read from private field"),n?n.call(e):t.get(e)),JZ=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},QZ=(e,t,n,r)=>(d$(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function eJ(){const[,e]=h.useState(he());return h.useCallback(()=>{e(he())},[])}var f$=h.createContext(null);function fu(e){const t=h.useContext(f$),n=h.useRef(eJ());be(t,{code:q.REACT_PROVIDER_CONTEXT});const{addHandler:r}=t;return h.useEffect(()=>{let o=e;if(o){if(xl(o)){const{autoUpdate:i}=o;o=i?()=>n.current():void 0}if(pt(o))return r("updated",o)}},[r,e]),t}function tJ(e=!0){return fu({autoUpdate:e}).active}function nJ(e=!1){return fu(e?{autoUpdate:!0}:void 0).attrs}function Tw(){return fu().chain.new()}function rJ(e,t=void 0,n){const{getExtension:r}=fu(),o=h.useMemo(()=>r(e),[e,r]);let i;if(pt(t)?i=n?[o,...n]:[o,t]:i=t?[o,...Object.values(t)]:[],h.useEffect(()=>{pt(t)||!t||o.setOptions(t)},i),h.useEffect(()=>{if(pt(t))return t({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!t)return o}function oJ(e,t,n){const r=h.useCallback(({addHandler:o})=>o(t,n),[n,t]);return rJ(e,r)}function iJ(e){oJ(Um,"docChanged",e)}function sJ(e=!1){return fu(e?{autoUpdate:!0}:void 0).helpers}var[aJ,Hle]=QH(({props:e})=>{const t=e.locale??"en",n=e.i18n??cv,r=e.supportedLocales??[t],o=n._.bind(n);return{locale:t,i18n:n,supportedLocales:r,t:o}});function uC(e,t={}){const{core:n,react:r,...o}=t;return BH(e)?e:FH.create(()=>[...qM(e),new Rf(r),...FZ(n)],o)}function lJ(e,t={}){const n=h.useRef(e),r=h.useRef(t),[o,i]=h.useState(()=>uC(e,t));return n.current=e,r.current=t,h.useEffect(()=>o.addHandler("destroy",()=>{i(()=>uC(n.current,r.current))}),[o]),o}var cJ=typeof Lu=="object"&&Lu.__esModule&&Lu.default?Lu.default:Lu,Zl,uJ=class extends DH{constructor(e){if(super(e),JZ(this,Zl,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=t=>this.internalGetRootProps(t,null),this.internalGetRootProps=(t,n)=>{this.rootPropsConfig.called=!0;const{refKey:r="ref",ref:o,...i}=t??he();return{[r]:cJ(o,this.onRef),key:this.uid,...i,children:n}},this.onRef=t=>{t&&(this.rootPropsConfig.count+=1,be(this.rootPropsConfig.count<=1,{code:q.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),QZ(this,Zl,t),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(ul).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new QB(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){const{triggerChange:n=!0,tr:r,transactions:o}=t;if(this.props.state){const{onChange:i}=this.props;be(i,{code:q.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),be(n,{code:q.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:r,transactions:o});return}!r&&!o&&(e=e.apply(e.tr.setMeta(CE,{}))),this.view.updateState(e),n&&(o==null?void 0:o.length)!==0&&this.onChange({state:e,tr:r,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:r,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(CE,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){this.props.insertPosition==="start"?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){be(By(this,Zl),{code:q.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:e}=this.props;this.addProsemirrorViewToDom(By(this,Zl),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&By(this,Zl)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};Zl=new WeakMap;var p$=typeof document<"u"?h.useLayoutEffect:h.useEffect;function dJ(e){const t=h.useRef();return p$(()=>{t.current=e}),t.current}function fJ(e){const{manager:t,state:n}=e,{placeholder:r,editable:o}=e;h.useRef(!0).current&&!Js(r)&&t.getExtension(Rf).setOptions({placeholder:r}),h.useEffect(()=>{r!=null&&t.getExtension(Rf).setOptions({placeholder:r})},[r,t]);const[s]=h.useState(()=>{if(n)return n;const l=t.createEmptyDoc(),[c,u]=en(e.initialContent)?e.initialContent:[e.initialContent??l];return t.createState({content:c,selection:u})}),a=pJ({initialEditorState:s,getProps:()=>e});return h.useEffect(()=>()=>{a.destroy()},[a]),h.useEffect(()=>{a.onUpdate()},[o,a]),hJ(a),a.frameworkOutput}function pJ(e){const t=h.useRef(e);t.current=e;const n=h.useMemo(()=>new uJ(t.current),[]);return n.update(e),n}function hJ(e){const{state:t}=e.props,n=h.useRef(!!t),r=dJ(t);p$(()=>{const o=t?n.current===!0:n.current===!1;be(o,{code:q.REACT_CONTROLLED,message:n.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!t||t===r)&&e.updateControlledState(t,r??void 0)},[t,r,e])}function mJ(e={}){const{content:t,document:n,selection:r,extensions:o,...i}=e,s=lJ(o??(()=>[]),i),[a,l]=h.useState(()=>s.createState({selection:r,content:t??s.createEmptyDoc()})),c=h.useCallback(({state:d})=>{l(d)},[]),u=h.useCallback(()=>s.output,[s]);return h.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var gJ=({onChange:e})=>{const{getJSON:t}=sJ();return iJ(h.useCallback(({state:n})=>{const r=t(n);e(r)},[e,t])),null},ib=()=>te.createElement("div",{className:sZ.EDITOR_WRAPPER,...fu().getRootProps()}),vJ=e=>(e.hook(),null);function yJ(e){const{children:t,autoRender:n,i18n:r,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=fJ(a),c=qH(l.portalContainer),u=n==="start"||n===!0||!t&&Js(n),d=n==="end";return te.createElement(aJ,{i18n:r,locale:o,supportedLocales:i},te.createElement(f$.Provider,{value:l},te.createElement(KH,{portals:c}),s.map((f,p)=>te.createElement(vJ,{hook:f,key:p})),u&&te.createElement(ib,null),t,d&&te.createElement(ib,null)))}const xJ=["top","right","bottom","left"],ra=Math.min,wr=Math.max,Gm=Math.round,qp=Math.floor,oa=e=>({x:e,y:e}),bJ={left:"right",right:"left",bottom:"top",top:"bottom"},wJ={start:"end",end:"start"};function sb(e,t,n){return wr(e,ra(t,n))}function zi(e,t){return typeof e=="function"?e(t):e}function Fi(e){return e.split("-")[0]}function pu(e){return e.split("-")[1]}function Pw(e){return e==="x"?"y":"x"}function Mw(e){return e==="y"?"height":"width"}function hu(e){return["top","bottom"].includes(Fi(e))?"y":"x"}function Rw(e){return Pw(hu(e))}function SJ(e,t,n){n===void 0&&(n=!1);const r=pu(e),o=Rw(e),i=Mw(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ym(s)),[s,Ym(s)]}function kJ(e){const t=Ym(e);return[ab(e),t,ab(t)]}function ab(e){return e.replace(/start|end/g,t=>wJ[t])}function EJ(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function _J(e,t,n,r){const o=pu(e);let i=EJ(Fi(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(ab)))),i}function Ym(e){return e.replace(/left|right|bottom|top/g,t=>bJ[t])}function CJ(e){return{top:0,right:0,bottom:0,left:0,...e}}function h$(e){return typeof e!="number"?CJ(e):{top:e,right:e,bottom:e,left:e}}function Xm(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function dC(e,t,n){let{reference:r,floating:o}=e;const i=hu(t),s=Rw(t),a=Mw(s),l=Fi(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(pu(t)){case"start":p[s]-=f*(n&&c?-1:1);break;case"end":p[s]+=f*(n&&c?-1:1);break}return p}const OJ=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=dC(c,r,l),f=r,p={},m=0;for(let g=0;g<a.length;g++){const{name:y,fn:v}=a[g],{x,y:w,data:k,reset:E}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=x??u,d=w??d,p={...p,[y]:{...p[y],...k}},E&&m<=50){m++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=dC(c,f,l)),g=-1;continue}}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}};async function Nf(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=zi(t,e),m=h$(p),y=a[f?d==="floating"?"reference":"floating":d],v=Xm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{...s.floating,x:r,y:o}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),k=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Xm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:w,strategy:l}):x);return{top:(v.top-E.top+m.top)/k.y,bottom:(E.bottom-v.bottom+m.bottom)/k.y,left:(v.left-E.left+m.left)/k.x,right:(E.right-v.right+m.right)/k.x}}const TJ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=zi(e,t)||{};if(c==null)return{};const d=h$(u),f={x:n,y:r},p=Rw(o),m=Mw(p),g=await s.getDimensions(c),y=p==="y",v=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",k=i.reference[m]+i.reference[p]-f[p]-i.floating[m],E=f[p]-i.reference[p],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let _=S?S[w]:0;(!_||!await(s.isElement==null?void 0:s.isElement(S)))&&(_=a.floating[w]||i.floating[m]);const P=k/2-E/2,M=_/2-g[m]/2-1,A=ra(d[v],M),I=ra(d[x],M),L=A,re=_-g[m]-I,V=_/2-g[m]/2+P,K=sb(L,V,re),C=!l.arrow&&pu(o)!=null&&V!=K&&i.reference[m]/2-(V<L?A:I)-g[m]/2<0,T=C?V<L?V-L:V-re:0;return{[p]:f[p]+T,data:{[p]:K,centerOffset:V-K-T,...C&&{alignmentOffset:T}},reset:C}}}),PJ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=zi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Fi(o),x=Fi(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=f||(x||!g?[Ym(a)]:kJ(a));!f&&m!=="none"&&k.push(..._J(a,g,m,w));const E=[a,...k],S=await Nf(t,y),_=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&_.push(S[v]),d){const L=SJ(o,s,w);_.push(S[L[0]],S[L[1]])}if(P=[...P,{placement:o,overflows:_}],!_.every(L=>L<=0)){var M,A;const L=(((M=i.flip)==null?void 0:M.index)||0)+1,re=E[L];if(re)return{data:{index:L,overflows:P},reset:{placement:re}};let V=(A=P.filter(K=>K.overflows[0]<=0).sort((K,C)=>K.overflows[1]-C.overflows[1])[0])==null?void 0:A.placement;if(!V)switch(p){case"bestFit":{var I;const K=(I=P.map(C=>[C.placement,C.overflows.filter(T=>T>0).reduce((T,O)=>T+O,0)]).sort((C,T)=>C[1]-T[1])[0])==null?void 0:I[0];K&&(V=K);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function fC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pC(e){return xJ.some(t=>e[t]>=0)}const MJ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=zi(e,t);switch(r){case"referenceHidden":{const i=await Nf(t,{...o,elementContext:"reference"}),s=fC(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:pC(s)}}}case"escaped":{const i=await Nf(t,{...o,altBoundary:!0}),s=fC(i,n.floating);return{data:{escapedOffsets:s,escaped:pC(s)}}}default:return{}}}}};async function RJ(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Fi(n),a=pu(n),l=hu(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=zi(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const NJ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await RJ(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},$J=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:v,y:x}=y;return{x:v,y:x}}},...l}=zi(e,t),c={x:n,y:r},u=await Nf(t,l),d=hu(Fi(o)),f=Pw(d);let p=c[f],m=c[d];if(i){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+u[y],w=p-u[v];p=sb(x,p,w)}if(s){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",x=m+u[y],w=m-u[v];m=sb(x,m,w)}const g=a.fn({...t,[f]:p,[d]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}},AJ=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=zi(e,t),u={x:n,y:r},d=hu(o),f=Pw(d);let p=u[f],m=u[d];const g=zi(a,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=f==="y"?"height":"width",k=i.reference[f]-i.floating[w]+y.mainAxis,E=i.reference[f]+i.reference[w]-y.mainAxis;p<k?p=k:p>E&&(p=E)}if(c){var v,x;const w=f==="y"?"width":"height",k=["top","left"].includes(Fi(o)),E=i.reference[d]-i.floating[w]+(k&&((v=s.offset)==null?void 0:v[d])||0)+(k?0:y.crossAxis),S=i.reference[d]+i.reference[w]+(k?0:((x=s.offset)==null?void 0:x[d])||0)-(k?y.crossAxis:0);m<E?m=E:m>S&&(m=S)}return{[f]:p,[d]:m}}}},DJ=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=zi(e,t),l=await Nf(t,a),c=Fi(n),u=pu(n),d=hu(n)==="y",{width:f,height:p}=r.floating;let m,g;c==="top"||c==="bottom"?(m=c,g=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,m=u==="end"?"top":"bottom");const y=p-l[m],v=f-l[g],x=!t.middlewareData.shift;let w=y,k=v;if(d){const S=f-l.left-l.right;k=u||x?ra(v,S):S}else{const S=p-l.top-l.bottom;w=u||x?ra(y,S):S}if(x&&!u){const S=wr(l.left,0),_=wr(l.right,0),P=wr(l.top,0),M=wr(l.bottom,0);d?k=f-2*(S!==0||_!==0?S+_:wr(l.left,l.right)):w=p-2*(P!==0||M!==0?P+M:wr(l.top,l.bottom))}await s({...t,availableWidth:k,availableHeight:w});const E=await o.getDimensions(i.floating);return f!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function ia(e){return m$(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qi(e){var t;return(t=(m$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function m$(e){return e instanceof Node||e instanceof _r(e).Node}function Bi(e){return e instanceof Element||e instanceof _r(e).Element}function ii(e){return e instanceof HTMLElement||e instanceof _r(e).HTMLElement}function hC(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}function up(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=eo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function IJ(e){return["table","td","th"].includes(ia(e))}function Nw(e){const t=$w(),n=eo(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function LJ(e){let t=Zc(e);for(;ii(t)&&!fv(t);){if(Nw(t))return t;t=Zc(t)}return null}function $w(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fv(e){return["html","body","#document"].includes(ia(e))}function eo(e){return _r(e).getComputedStyle(e)}function pv(e){return Bi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Zc(e){if(ia(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hC(e)&&e.host||qi(e);return hC(t)?t.host:t}function g$(e){const t=Zc(e);return fv(t)?e.ownerDocument?e.ownerDocument.body:e.body:ii(t)&&up(t)?t:g$(t)}function $f(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=g$(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=_r(o);return i?t.concat(s,s.visualViewport||[],up(o)?o:[],s.frameElement&&n?$f(s.frameElement):[]):t.concat(o,$f(o,[],n))}function v$(e){const t=eo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ii(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Gm(n)!==i||Gm(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Aw(e){return Bi(e)?e:e.contextElement}function Pc(e){const t=Aw(e);if(!ii(t))return oa(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=v$(t);let s=(i?Gm(n.width):n.width)/r,a=(i?Gm(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const jJ=oa(0);function y$(e){const t=_r(e);return!$w()||!t.visualViewport?jJ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zJ(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_r(e)?!1:t}function dl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Aw(e);let s=oa(1);t&&(r?Bi(r)&&(s=Pc(r)):s=Pc(e));const a=zJ(i,n,r)?y$(i):oa(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=_r(i),p=r&&Bi(r)?_r(r):r;let m=f.frameElement;for(;m&&r&&p!==f;){const g=Pc(m),y=m.getBoundingClientRect(),v=eo(m),x=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,w=y.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=x,c+=w,m=_r(m).frameElement}}return Xm({width:u,height:d,x:l,y:c})}function FJ(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=ii(n),i=qi(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=oa(1);const l=oa(0);if((o||!o&&r!=="fixed")&&((ia(n)!=="body"||up(i))&&(s=pv(n)),ii(n))){const c=dl(n);a=Pc(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function BJ(e){return Array.from(e.getClientRects())}function x$(e){return dl(qi(e)).left+pv(e).scrollLeft}function UJ(e){const t=qi(e),n=pv(e),r=e.ownerDocument.body,o=wr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=wr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+x$(e);const a=-n.scrollTop;return eo(r).direction==="rtl"&&(s+=wr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function VJ(e,t){const n=_r(e),r=qi(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=$w();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function HJ(e,t){const n=dl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ii(e)?Pc(e):oa(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function mC(e,t,n){let r;if(t==="viewport")r=VJ(e,n);else if(t==="document")r=UJ(qi(e));else if(Bi(t))r=HJ(t,n);else{const o=y$(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Xm(r)}function b$(e,t){const n=Zc(e);return n===t||!Bi(n)||fv(n)?!1:eo(n).position==="fixed"||b$(n,t)}function WJ(e,t){const n=t.get(e);if(n)return n;let r=$f(e,[],!1).filter(a=>Bi(a)&&ia(a)!=="body"),o=null;const i=eo(e).position==="fixed";let s=i?Zc(e):e;for(;Bi(s)&&!fv(s);){const a=eo(s),l=Nw(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||up(s)&&!l&&b$(e,s))?r=r.filter(u=>u!==s):o=a,s=Zc(s)}return t.set(e,r),r}function KJ(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?WJ(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=mC(t,u,o);return c.top=wr(d.top,c.top),c.right=ra(d.right,c.right),c.bottom=ra(d.bottom,c.bottom),c.left=wr(d.left,c.left),c},mC(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qJ(e){const{width:t,height:n}=v$(e);return{width:t,height:n}}function GJ(e,t,n){const r=ii(t),o=qi(t),i=n==="fixed",s=dl(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=oa(0);if(r||!r&&!i)if((ia(t)!=="body"||up(o))&&(a=pv(t)),r){const c=dl(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=x$(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function gC(e,t){return!ii(e)||eo(e).position==="fixed"?null:t?t(e):e.offsetParent}function w$(e,t){const n=_r(e);if(!ii(e))return n;let r=gC(e,t);for(;r&&IJ(r)&&eo(r).position==="static";)r=gC(r,t);return r&&(ia(r)==="html"||ia(r)==="body"&&eo(r).position==="static"&&!Nw(r))?n:r||LJ(e)||n}const YJ=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||w$,i=this.getDimensions;return{reference:GJ(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function XJ(e){return eo(e).direction==="rtl"}const ZJ={convertOffsetParentRelativeRectToViewportRelativeRect:FJ,getDocumentElement:qi,getClippingRect:KJ,getOffsetParent:w$,getElementRects:YJ,getClientRects:BJ,getDimensions:qJ,getScale:Pc,isElement:Bi,isRTL:XJ};function JJ(e,t){let n=null,r;const o=qi(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const p=qp(u),m=qp(o.clientWidth-(c+d)),g=qp(o.clientHeight-(u+f)),y=qp(c),x={rootMargin:-p+"px "+-m+"px "+-g+"px "+-y+"px",threshold:wr(0,ra(1,l))||1};let w=!0;function k(E){const S=E[0].intersectionRatio;if(S!==l){if(!w)return s();S?s(!1,S):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(k,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,x)}n.observe(e)}return s(!0),i}function QJ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Aw(e),u=o||i?[...c?$f(c):[],...$f(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?JJ(c,n):null;let f=-1,p=null;s&&(p=new ResizeObserver(v=>{let[x]=v;x&&x.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let m,g=l?dl(e):null;l&&y();function y(){const v=dl(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,m=requestAnimationFrame(y)}return n(),()=>{u.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),d&&d(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const eQ=$J,tQ=PJ,nQ=DJ,rQ=MJ,vC=TJ,oQ=AJ,iQ=(e,t,n)=>{const r=new Map,o={platform:ZJ,...n},i={...o.platform,_c:r};return OJ(e,t,{...o,platform:i})},sQ=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?vC({element:r.current,padding:o}).fn(n):{}:r?vC({element:r,padding:o}).fn(n):{}}}};var Rh=typeof document<"u"?h.useLayoutEffect:h.useEffect;function Zm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Zm(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Zm(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function S$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yC(e,t){const n=S$(e);return Math.round(t*n)/n}function xC(e){const t=h.useRef(e);return Rh(()=>{t.current=e}),t}function aQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=h.useState(r);Zm(f,r)||p(r);const[m,g]=h.useState(null),[y,v]=h.useState(null),x=h.useCallback(C=>{C!=S.current&&(S.current=C,g(C))},[g]),w=h.useCallback(C=>{C!==_.current&&(_.current=C,v(C))},[v]),k=i||m,E=s||y,S=h.useRef(null),_=h.useRef(null),P=h.useRef(u),M=xC(l),A=xC(o),I=h.useCallback(()=>{if(!S.current||!_.current)return;const C={placement:t,strategy:n,middleware:f};A.current&&(C.platform=A.current),iQ(S.current,_.current,C).then(T=>{const O={...T,isPositioned:!0};L.current&&!Zm(P.current,O)&&(P.current=O,$r.flushSync(()=>{d(O)}))})},[f,t,n,A]);Rh(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(C=>({...C,isPositioned:!1})))},[c]);const L=h.useRef(!1);Rh(()=>(L.current=!0,()=>{L.current=!1}),[]),Rh(()=>{if(k&&(S.current=k),E&&(_.current=E),k&&E){if(M.current)return M.current(k,E,I);I()}},[k,E,I,M]);const re=h.useMemo(()=>({reference:S,floating:_,setReference:x,setFloating:w}),[x,w]),V=h.useMemo(()=>({reference:k,floating:E}),[k,E]),K=h.useMemo(()=>{const C={position:n,left:0,top:0};if(!V.floating)return C;const T=yC(V.floating,u.x),O=yC(V.floating,u.y);return a?{...C,transform:"translate("+T+"px, "+O+"px)",...S$(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:T,top:O}},[n,a,V.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:I,refs:re,elements:V,floatingStyles:K}),[u,I,re,V,K])}function lQ(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new il(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new il(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=q1(l,e,t,s);return c?(r&&r(cQ(n.tr,s,c,a,e).scrollIntoView()),!0):!1}}function cQ(e,t,n,r,o){let i=U.empty;for(let u=n.length-1;u>=0;u--)i=U.from(n[u].type.create(n[u].attrs,i));e.step(new Ut(t.start-(r?2:0),t.end,t.start,t.end,new Z(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let u=t.startIndex,d=t.endIndex,f=!0;u<d;u++,f=!1)!f&&_c(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return e}function uQ(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==e);return i?n?r.node(i.depth-1).type==e?dQ(t,n,e,i):fQ(t,n,i):!0:!1}}function dQ(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new Ut(i-1,s,i,s,new Z(U.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new il(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=au(r);if(a==null)return!1;o.lift(r,a);let l=o.mapping.map(i,-1)-1;return ip(o.doc,l)&&o.join(l),t(o.scrollIntoView()),!0}function fQ(e,t,n){let r=e.tr,o=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=o.child(m).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?U.empty:U.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return r.step(new Ut(d-(a?1:0),f+(l?1:0),d+1,f-1,new Z((a?U.empty:U.from(o.copy(U.empty))).append(l?U.empty:U.from(o.copy(U.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}var pQ=Object.defineProperty,hQ=Object.getOwnPropertyDescriptor,io=(e,t,n,r)=>{for(var o=r>1?void 0:r?hQ(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&pQ(t,n,o),o};function lb(e){var t;return!!((t=e.spec.group)!=null&&t.includes(Le.ListContainerNode))}function mQ(e){var t;return!!((t=e.spec.group)!=null&&t.includes(Le.ListItemNode))}function sa(e){return lb(e.type)}function Ks(e){return mQ(e.type)}function Dw(e,t){return n=>{const{dispatch:r,tr:o}=n,i=lw(o,n.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=tv({predicate:u=>lb(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===e)return _$(t)(n);if(lb(c.node.type))return e.validContent(c.node.content)?(r==null||r(o.setNodeMarkup(c.pos,e)),!0):gQ(o,c,e,t)?(r==null||r(o.scrollIntoView()),!0):!1}return lQ(e)(i,r)}}function k$(e,t=["checked"]){return function({tr:n,dispatch:r,state:o}){var i,s;const a=jU(e,o.schema),{$from:l,$to:c}=n.selection;if(rv(n.selection)&&n.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){const g=l.index(-1)>0;let y=U.empty;for(let w=l.depth-(g?1:2);w>=l.depth-3;w--)y=U.from(l.node(w).copy(y));const v=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;y=y.append(U.from(a.createAndFill(null,v)||void 0));const x=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3;n.replace(l.before(g?void 0:-1),l.after(-x),new Z(y,g?3:2,2)),n.setSelection(n.selection.constructor.near(n.doc.resolve(l.pos+(g?3:2)))),r(n.scrollIntoView())}return!0}if(u.attrs.closed&&l.sameParent(c)&&c.pos===c.end()){if(r){const g=l.after(-1),y=((s=a.contentMatch.defaultType)==null?void 0:s.createAndFill())||void 0,v=a.createAndFill(null,y);v&&(n.insert(g,v),n.setSelection(Te.near(n.doc.resolve(g+1)))),n.delete(l.pos,c.pos),r(n.scrollIntoView())}return!0}const d=Object.fromEntries(Object.entries(u.attrs).filter(([g])=>!t.includes(g))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...l.node().attrs};n.delete(l.pos,c.pos);const m=f?[{type:a,attrs:d},{type:f,attrs:p}]:[{type:a,attrs:d}];return _c(n.doc,l.pos,2)?(r&&r(n.split(l.pos,2,m).scrollIntoView()),!0):!1}}function gQ(e,t,n,r){const o=t.node,i=e.doc.resolve(t.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,U.from(n.create())))return!1;const l=[];for(let p=0;p<o.childCount;p++){const m=o.child(p);if(!r.validContent(m.content))return!1;const g=r.createChecked(null,m.content);l.push(g)}const c=n.createChecked(null,l),u=t.pos,d=u+o.nodeSize,f=e.selection.from;return e.replaceRangeWith(u,d,c),e.setSelection(e.selection.constructor.near(e.doc.resolve(f))),!0}function vQ({listType:e,itemType:t,tr:n,range:r}){var o;const i=r.parent,s=n.doc.slice(r.start,r.end);if(i.type===e&&((o=s.content.firstChild)==null?void 0:o.type)===t)return!1;const a=[];for(let c=0;c<s.content.childCount;c++){const u=s.content.child(c);if(!t.validContent(u.content))return!1;const d=t.createChecked(null,u.content);a.push(d)}const l=e.createChecked(null,a);return n.replaceRange(r.start,r.end,new Z(U.from(l),0,0)),!0}function Jc({listType:e,itemType:t,tr:n}){const r=Jm(n.selection);if(!r)return!1;const o=r.startIndex===0,{from:i,to:s}=n.selection;return vQ({listType:e,itemType:t,tr:n,range:r})?(n.setSelection(Te.between(n.doc.resolve(o?i:i+2),n.doc.resolve(o?s:s+2))),n.scrollIntoView(),!0):!1}function yQ(e,t,n){const r=e.tr,o=n.parent,i=r.mapping.maps.length;for(let m=n.end,g=n.endIndex-1,y=n.startIndex;g>y;g--)m-=o.child(g).nodeSize,r.delete(m-1,m+1);const s=r.doc.resolve(n.start),a=s.nodeAfter;if(!a||r.mapping.slice(i).map(n.end)!==n.start+a.nodeSize)return!1;const l=n.startIndex===0,c=n.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?U.empty:U.from(o))))return!1;const f=s.pos,p=f+a.nodeSize;return r.step(new Ut(f-(l?1:0),p+(c?1:0),f+1,p-1,new Z((l?U.empty:U.from(o.copy(U.empty))).append(c?U.empty:U.from(o.copy(U.empty))),l?0:1,c?0:1),l?0:1)),t(r.scrollIntoView()),!0}function E$(e,t){const n=t||e.selection.$from;let r=[],o,i,s,a;for(let c=n.depth;c>=0;c--){if(i=n.node(c),o=n.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&sa(s)){const u=n.before(c+1);r.push(u)}if(o=n.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&sa(s)){const u=n.after(c+1);r.push(u)}}r=[...new Set(r)].sort((c,u)=>u-c);let l=!1;for(const c of r)ip(e.doc,c)&&(e.join(c),l=!0);return l}function _$(e){return t=>{const{dispatch:n,tr:r}=t,o=lw(r,t.state),i=xQ(e,r.selection);return i?(n&&yQ(o,n,i),!0):!1}}function xQ(e,t){const{$from:n,$to:r}=t;return n.blockRange(r,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===e})}function Jm(e){const{$from:t,$to:n}=e;return t.blockRange(n,sa)}function bQ(e){const t=e.selection.$from,n=t.blockRange();if(!n||!Ks(n.parent)||n.startIndex!==0)return!1;const r=t.node(n.depth-2),o=t.index(n.depth),i=t.index(n.depth-1),s=t.index(n.depth-2),a=r.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&sa(a)&&l&&Ks(l))return Jc({listType:a.type,itemType:l.type,tr:e});if(Ks(r)){const c=r,u=t.node(n.depth-3);if(sa(u))return Jc({listType:u.type,itemType:c.type,tr:e})}return!1}function bC({view:e}){if(!e)return!1;{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const n=t.blockRange();if(!n||!Ks(n.parent)||n.startIndex!==0)return!1}{const t=e.state.tr;bQ(t)&&e.dispatch(t)}{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const n=t.blockRange();if(!n||!Ks(n.parent)||n.startIndex!==0)return!1;const r=t.index(n.depth),o=t.index(n.depth-1),i=t.index(n.depth-2),s=n.depth-2>=1&&Ks(t.node(n.depth-2));r===0&&o===0&&i<=1&&s&&uQ(n.parent.type)(e.state,e.dispatch)}return MN(e.state,e.dispatch,e),!0}function C$({node:e,mark:t,updateDOM:n,updateMark:r}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(na.LIST_ITEM_MARKER_CONTAINER),o.append(t);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(na.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==e.type?!1:(e=l,n(e,s),r(e,t),!0);return a(e),{dom:s,contentDOM:i,update:a}}function wQ(e,t){const n=e.node(t.depth-1),r=e.node(t.depth-2);return!Ks(n)||!sa(r)?!1:{parentItem:n,parentList:r}}function SQ(e,t){const n=t.parent,r=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth);return o<i?(e.step(new Ut(o-1,i,o,i,new Z(U.from(r.type.create(null,n.copy())),1,0),1,!0)),new il(e.doc.resolve(t.$from.pos),e.doc.resolve(i),t.depth)):t}function kQ(e,t){const n=t.parent,r=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth-1);return o+1<i?(e.step(new Ut(o-1,i,o+1,i,new Z(U.from(n.type.create(null,r.type.create(null))),2,0),0,!0)),new il(e.selection.$from,e.selection.$to,t.depth)):t}function EQ(e,t,n,r){return Jc({listType:n.type,itemType:r.type,tr:e})?new il(e.selection.$from,e.selection.$to,t.depth):t}function _Q(e){let t=Jm(e.selection);if(!t)return!1;const n=wQ(e.selection.$from,t);if(!n)return!1;const{parentItem:r,parentList:o}=n;t=SQ(e,t),t=kQ(e,t),t=EQ(e,t,o,r);const i=au(t);return typeof i!="number"||(e.lift(t,i),t=Jm(e.selection),t&&E$(e,e.doc.resolve(t.end-2))),!0}var CQ=({tr:e,dispatch:t})=>_Q(e)?(t==null||t(e.scrollIntoView()),!0):!1;function OQ(e,t,n){let r,o,i,s;const a=t.doc;if(n.startIndex>=1){r=e.child(n.startIndex-1),o=e,s=a.resolve(n.start).start(n.depth),i=s+1;for(let l=0;l<n.startIndex-1;l++)i+=o.child(l).nodeSize}else{const l=t.index(n.depth-1);if(l>=1){const c=t.node(n.depth-1),u=t.start(n.depth-1);if(o=c.child(l-1),!sa(o))return!1;s=u+1;for(let d=0;d<l-1;d++)s+=c.child(d).nodeSize;if(r=o.child(o.childCount-1),i=s+o.nodeSize-r.nodeSize-1,!Ks(r))return!1}else return!1}return{previousItem:r,previousList:o,previousItemStart:i,previousListStart:s}}function TQ(e,t,n){let r,o;const i=n.start,s=t.depth>=n.depth+2?t.end(n.depth+2):n.end-1,a=n.end;return s+1>=a?(r=e.slice(i,a),o=null):(r=e.slice(i,s),o=e.slice(s+1,a-1)),{selectedSlice:r,unselectedSlice:o}}function PQ(e){const{$from:t,$to:n}=e.selection,r=Jm(e.selection);if(!r)return!1;const o=e.doc.resolve(r.start).node();if(!sa(o))return!1;const i=OQ(o,t,r);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=TQ(e.doc,n,r),d=s.content.append(U.fromArray([o.copy(c.content)])).append(u?u.content:U.empty);e.deleteRange(r.start,r.end);const f=l+s.nodeSize-2,p=s.copy(d);return p.check(),e.replaceRangeWith(l-1,f+1,p),e.setSelection(a===o?Te.between(e.doc.resolve(t.pos),e.doc.resolve(n.pos)):Te.between(e.doc.resolve(t.pos-2),e.doc.resolve(n.pos-2))),!0}var MQ=({tr:e,dispatch:t})=>PQ(e)?(t==null||t(e.scrollIntoView()),!0):!1,O$=class extends _t{get name(){return"listItemShared"}createKeymap(){const e={Tab:MQ,"Shift-Tab":CQ,Backspace:bC,"Mod-Backspace":bC};if(xo.isMac){const t={"Ctrl-h":e.Backspace,"Alt-Backspace":e["Mod-Backspace"]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,n)=>{const r=n.tr;return E$(r)?r:null}}}},Qc=class extends oo{get name(){return"listItem"}createTags(){return[Le.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:e.parse,priority:ct.Lowest},...t.parseDOM??[]],toDOM:n=>["li",e.dom(n),0]}}createNodeViews(){return this.options.enableCollapsible?(e,t,n)=>{const r=document.createElement("div");return r.classList.add(na.COLLAPSIBLE_LIST_ITEM_BUTTON),r.contentEditable="false",r.addEventListener("click",()=>{if(r.classList.contains("disabled"))return;const o=n(),i=we.create(t.state.doc,o);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),C$({mark:r,node:e,updateDOM:RQ,updateMark:NQ})}:{}}createKeymap(){return{Enter:k$(this.type)}}createExtensions(){return[new O$]}toggleListItemClosed(e){return({state:{tr:t,selection:n},dispatch:r})=>{if(!rv(n)||n.node.type.name!==this.name)return!1;const{node:o,from:i}=n;return e=jz(e)?e:!o.attrs.closed,r==null||r(t.setNodeMarkup(i,void 0,{...o.attrs,closed:e})),!0}}liftListItemOutOfList(e){return _$(e??this.type)}};io([de()],Qc.prototype,"toggleListItemClosed",1);io([de()],Qc.prototype,"liftListItemOutOfList",1);Qc=io([Je({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],Qc);function RQ(e,t){e.attrs.closed?t.classList.add(na.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(na.COLLAPSIBLE_LIST_ITEM_CLOSED)}function NQ(e,t){e.childCount<=1?t.classList.add("disabled"):t.classList.remove("disabled")}var Af=class extends oo{get name(){return"bulletList"}createTags(){return[Le.Block,Le.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul",getAttrs:e.parse},...t.parseDOM??[]],toDOM:n=>["ul",e.dom(n),0]}}createNodeViews(){return this.options.enableSpine?(e,t,n)=>{var r;const o=document.createElement("div");o.style.position="relative";const i=n(),s=t.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((r=a==null?void 0:a.type)==null?void 0:r.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(na.LIST_SPINE),u.addEventListener("click",d=>{const f=n(),p=t.state.doc.resolve(f+1),m=p.start(p.depth-1),g=we.create(t.state.doc,m-1);t.dispatch(t.state.tr.setSelection(g)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(na.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new Qc({priority:ct.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return Dw(this.type,Pt(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){const e=/^\s*([*+-])\s$/;return[Z1(e,this.type),new ro(e,(t,n,r,o)=>{const i=t.tr;return i.deleteRange(r,o),Jc({listType:this.type,itemType:Pt(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};io([de({icon:"listUnordered",label:({t:e})=>e(X1.BULLET_LIST_LABEL)})],Af.prototype,"toggleBulletList",1);io([Lr({shortcut:Y.BulletList,command:"toggleBulletList"})],Af.prototype,"listShortcut",1);Af=io([Je({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],Af);var Df=class extends oo{get name(){return"orderedList"}createTags(){return[Le.Block,Le.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:n=>ri(n)?{...e.parse(n),order:+(n.getAttribute("start")??1)}:{}},...t.parseDOM??[]],toDOM:n=>{const r=e.dom(n);return n.attrs.order===1?["ol",r,0]:["ol",{...r,start:n.attrs.order},0]}}}createExtensions(){return[new Qc({priority:ct.Low})]}toggleOrderedList(){return Dw(this.type,Pt(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){const e=/^(\d+)\.\s$/;return[Z1(e,this.type,t=>({order:+Pt(t,1)}),(t,n)=>n.childCount+n.attrs.order===+Pt(t,1)),new ro(e,(t,n,r,o)=>{const i=t.tr;if(i.deleteRange(r,o),!Jc({listType:this.type,itemType:Pt(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+Pt(n,1);if(a!==1){const l=Ef({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};io([de({icon:"listOrdered",label:({t:e})=>e(X1.ORDERED_LIST_LABEL)})],Df.prototype,"toggleOrderedList",1);io([Lr({shortcut:Y.OrderedList,command:"toggleOrderedList"})],Df.prototype,"listShortcut",1);Df=io([Je({})],Df);var T$=class extends oo{get name(){return"taskListItem"}createTags(){return[Le.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:n=>{let r=!1;return ri(n)&&n.getAttribute("data-checked")!==null&&(r=!0),{checked:r,...e.parse(n)}},priority:ct.Medium},...t.parseDOM??[]],toDOM:n=>["li",{...e.dom(n),"data-task-list-item":"","data-checked":n.attrs.checked?"":void 0},0]}}createNodeViews(){return(e,t,n)=>{const r=document.createElement("input");return r.type="checkbox",r.classList.add(na.LIST_ITEM_CHECKBOX),r.contentEditable="false",r.addEventListener("click",o=>{t.editable||o.preventDefault()}),r.addEventListener("change",()=>{const o=n(),i=t.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),r.checked=e.attrs.checked,C$({node:e,mark:r,updateDOM:$Q,updateMark:AQ})}}createKeymap(){return{Enter:k$(this.type)}}createExtensions(){return[new O$]}toggleCheckboxChecked(e){let t,n;return typeof e=="boolean"?t=e:e&&(t=e.checked,n=e.$pos),({tr:r,dispatch:o})=>{const i=Ef({selection:n??r.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:t??!s.attrs.checked};return o==null||o(r.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const e=/^\s*(\[( ?|x|X)]\s)$/;return[Z1(e,this.type,t=>({checked:["x","X"].includes(Id(t,2))})),new ro(e,(t,n,r,o)=>{const i=t.tr;if(i.deleteRange(r,o),!Jc({listType:Pt(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(Id(n,2));if(a){const l=Ef({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};io([de()],T$.prototype,"toggleCheckboxChecked",1);function $Q(e,t){e.attrs.checked?t.setAttribute("data-checked",""):t.removeAttribute("data-checked"),t.setAttribute("data-task-list-item","")}function AQ(e,t){t.checked=!!e.attrs.checked}var P$=class extends oo{get name(){return"taskList"}createTags(){return[Le.Block,Le.ListContainerNode]}createNodeSpec(e,t){return{content:"taskListItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:e.parse,priority:ct.Medium},...t.parseDOM??[]],toDOM:n=>["ul",{...e.dom(n),"data-task-list":""},0]}}createExtensions(){return[new T$({})]}toggleTaskList(){return Dw(this.type,Pt(this.store.schema.nodes,"taskListItem"))}listShortcut(e){return this.toggleTaskList()(e)}};io([de({icon:"checkboxMultipleLine",label:({t:e})=>e(X1.TASK_LIST_LABEL)})],P$.prototype,"toggleTaskList",1);io([Lr({shortcut:Y.TaskList,command:"toggleTaskList"})],P$.prototype,"listShortcut",1);var DQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ll=new WeakMap,Gp=new WeakMap,Yp={},Uy=0,M$=function(e){return e&&(e.host||M$(e.parentNode))},IQ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=M$(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},LQ=function(e,t,n,r){var o=IQ(t,Array.isArray(e)?e:[e]);Yp[n]||(Yp[n]=new WeakMap);var i=Yp[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else{var p=f.getAttribute(r),m=p!==null&&p!=="false",g=(Ll.get(f)||0)+1,y=(i.get(f)||0)+1;Ll.set(f,g),i.set(f,y),s.push(f),g===1&&m&&Gp.set(f,!0),y===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}})};return u(t),a.clear(),Uy++,function(){s.forEach(function(d){var f=Ll.get(d)-1,p=i.get(d)-1;Ll.set(d,f),i.set(d,p),f||(Gp.has(d)||d.removeAttribute(r),Gp.delete(d)),p||d.removeAttribute(n)}),Uy--,Uy||(Ll=new WeakMap,Ll=new WeakMap,Gp=new WeakMap,Yp={})}},hv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||DQ(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),LQ(r,o,n,"aria-hidden")):function(){return null}};function jQ(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const cb="dismissableLayer.update",zQ="dismissableLayer.pointerDownOutside",FQ="dismissableLayer.focusOutside";let wC;const BQ=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mv=h.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=h.useContext(BQ),[d,f]=h.useState(null),p=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,m]=h.useState({}),g=qe(t,P=>f(P)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(v),w=d?y.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=x,S=UQ(P=>{const M=P.target,A=[...u.branches].some(I=>I.contains(M));!E||A||(i==null||i(P),a==null||a(P),P.defaultPrevented||l==null||l())},p),_=VQ(P=>{const M=P.target;[...u.branches].some(I=>I.contains(M))||(s==null||s(P),a==null||a(P),P.defaultPrevented||l==null||l())},p);return jQ(P=>{w===u.layers.size-1&&(o==null||o(P),!P.defaultPrevented&&l&&(P.preventDefault(),l()))},p),h.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wC=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),SC(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=wC)}},[d,p,r,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),SC())},[d,u]),h.useEffect(()=>{const P=()=>m({});return document.addEventListener(cb,P),()=>document.removeEventListener(cb,P)},[]),h.createElement($e.div,B({},c,{ref:g,style:{pointerEvents:k?E?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,_.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,S.onPointerDownCapture)}))});function UQ(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let u=function(){R$(zQ,n,c,{discrete:!0})};var l=u;const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function VQ(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=h.useRef(!1);return h.useEffect(()=>{const o=i=>{i.target&&!r.current&&R$(FQ,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function SC(){const e=new CustomEvent(cb);document.dispatchEvent(e)}function R$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?V2(o,i):o.dispatchEvent(i)}let Vy=0;function gv(){h.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:kC()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:kC()),Vy++,()=>{Vy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Vy--}},[])}function kC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const Hy="focusScope.autoFocusOnMount",Wy="focusScope.autoFocusOnUnmount",EC={bubbles:!1,cancelable:!0},vv=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=h.useState(null),c=pn(o),u=pn(i),d=h.useRef(null),f=qe(t,g=>l(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let x=function(S){if(p.paused||!a)return;const _=S.target;a.contains(_)?d.current=_:ms(d.current,{select:!0})},w=function(S){if(p.paused||!a)return;const _=S.relatedTarget;_!==null&&(a.contains(_)||ms(d.current,{select:!0}))},k=function(S){if(document.activeElement===document.body)for(const P of S)P.removedNodes.length>0&&ms(a)};var g=x,y=w,v=k;document.addEventListener("focusin",x),document.addEventListener("focusout",w);const E=new MutationObserver(k);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",w),E.disconnect()}}},[r,a,p.paused]),h.useEffect(()=>{if(a){CC.add(p);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Hy,EC);a.addEventListener(Hy,c),a.dispatchEvent(v),v.defaultPrevented||(HQ(YQ(N$(a)),{select:!0}),document.activeElement===g&&ms(a))}return()=>{a.removeEventListener(Hy,c),setTimeout(()=>{const v=new CustomEvent(Wy,EC);a.addEventListener(Wy,u),a.dispatchEvent(v),v.defaultPrevented||ms(g??document.body,{select:!0}),a.removeEventListener(Wy,u),CC.remove(p)},0)}}},[a,c,u,p]);const m=h.useCallback(g=>{if(!n&&!r||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const x=g.currentTarget,[w,k]=WQ(x);w&&k?!g.shiftKey&&v===k?(g.preventDefault(),n&&ms(w,{select:!0})):g.shiftKey&&v===w&&(g.preventDefault(),n&&ms(k,{select:!0})):v===x&&g.preventDefault()}},[n,r,p.paused]);return h.createElement($e.div,B({tabIndex:-1},s,{ref:f,onKeyDown:m}))});function HQ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ms(r,{select:t}),document.activeElement!==n)return}function WQ(e){const t=N$(e),n=_C(t,e),r=_C(t.reverse(),e);return[n,r]}function N$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _C(e,t){for(const n of e)if(!KQ(n,{upTo:t}))return n}function KQ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function qQ(e){return e instanceof HTMLInputElement&&"select"in e}function ms(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qQ(e)&&t&&e.select()}}const CC=GQ();function GQ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=OC(e,t),e.unshift(t)},remove(t){var n;e=OC(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function OC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function YQ(e){return e.filter(t=>t.tagName!=="A")}function $$(e){const[t,n]=h.useState(void 0);return Pr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const A$="Popper",[D$,mu]=to(A$),[XQ,I$]=D$(A$),ZQ=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return h.createElement(XQ,{scope:t,anchor:r,onAnchorChange:o},n)},JQ="PopperAnchor",QQ=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=I$(JQ,n),s=h.useRef(null),a=qe(t,s);return h.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:h.createElement($e.div,B({},o,{ref:a}))}),L$="PopperContent",[eee,Wle]=D$(L$),tee=h.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:d="bottom",sideOffset:f=0,align:p="center",alignOffset:m=0,arrowPadding:g=0,avoidCollisions:y=!0,collisionBoundary:v=[],collisionPadding:x=0,sticky:w="partial",hideWhenDetached:k=!1,updatePositionStrategy:E="optimized",onPlaced:S,..._}=e,P=I$(L$,u),[M,A]=h.useState(null),I=qe(t,xn=>A(xn)),[L,re]=h.useState(null),V=$$(L),K=(n=V==null?void 0:V.width)!==null&&n!==void 0?n:0,C=(r=V==null?void 0:V.height)!==null&&r!==void 0?r:0,T=d+(p!=="center"?"-"+p:""),O=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},R=Array.isArray(v)?v:[v],N=R.length>0,j={padding:O,boundary:R.filter(nee),altBoundary:N},{refs:G,floatingStyles:xe,placement:ue,isPositioned:je,middlewareData:Ce}=aQ({strategy:"fixed",placement:T,whileElementsMounted:(...xn)=>QJ(...xn,{animationFrame:E==="always"}),elements:{reference:P.anchor},middleware:[NJ({mainAxis:f+C,alignmentAxis:m}),y&&eQ({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?oQ():void 0,...j}),y&&tQ({...j}),nQ({...j,apply:({elements:xn,rects:Gi,availableWidth:pa,availableHeight:Nv})=>{const{width:$v,height:Av}=Gi.reference,jo=xn.floating.style;jo.setProperty("--radix-popper-available-width",`${pa}px`),jo.setProperty("--radix-popper-available-height",`${Nv}px`),jo.setProperty("--radix-popper-anchor-width",`${$v}px`),jo.setProperty("--radix-popper-anchor-height",`${Av}px`)}}),L&&sQ({element:L,padding:g}),ree({arrowWidth:K,arrowHeight:C}),k&&rQ({strategy:"referenceHidden",...j})]}),[J,tt]=j$(ue),nt=pn(S);Pr(()=>{je&&(nt==null||nt())},[je,nt]);const rt=(o=Ce.arrow)===null||o===void 0?void 0:o.x,Pe=(i=Ce.arrow)===null||i===void 0?void 0:i.y,Ge=((s=Ce.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Tn,zn]=h.useState();return Pr(()=>{M&&zn(window.getComputedStyle(M).zIndex)},[M]),h.createElement("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...xe,transform:je?xe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Tn,"--radix-popper-transform-origin":[(a=Ce.transformOrigin)===null||a===void 0?void 0:a.x,(l=Ce.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},h.createElement(eee,{scope:u,placedSide:J,onArrowChange:re,arrowX:rt,arrowY:Pe,shouldHideArrow:Ge},h.createElement($e.div,B({"data-side":J,"data-align":tt},_,{ref:I,style:{..._.style,animation:je?void 0:"none",opacity:(c=Ce.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function nee(e){return e!==null}const ree=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,d=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=d?0:e.arrowWidth,p=d?0:e.arrowHeight,[m,g]=j$(a),y={start:"0%",center:"50%",end:"100%"}[g],v=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+f/2,x=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+p/2;let w="",k="";return m==="bottom"?(w=d?y:`${v}px`,k=`${-p}px`):m==="top"?(w=d?y:`${v}px`,k=`${l.floating.height+p}px`):m==="right"?(w=`${-p}px`,k=d?y:`${x}px`):m==="left"&&(w=`${l.floating.width+p}px`,k=d?y:`${x}px`),{data:{x:w,y:k}}}});function j$(e){const[t,n="center"]=e.split("-");return[t,n]}const Iw=ZQ,Lw=QQ,jw=tee,yv=h.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?k2.createPortal(h.createElement($e.div,B({},o,{ref:t})),r):null}),Ky="rovingFocusGroup.onEntryFocus",oee={bubbles:!1,cancelable:!0},zw="RovingFocusGroup",[ub,z$,iee]=jg(zw),[see,F$]=to(zw,[iee]),[aee,lee]=see(zw),cee=h.forwardRef((e,t)=>h.createElement(ub.Provider,{scope:e.__scopeRovingFocusGroup},h.createElement(ub.Slot,{scope:e.__scopeRovingFocusGroup},h.createElement(uee,B({},e,{ref:t}))))),uee=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,d=h.useRef(null),f=qe(t,d),p=Zf(i),[m=null,g]=ei({prop:s,defaultProp:a,onChange:l}),[y,v]=h.useState(!1),x=pn(c),w=z$(n),k=h.useRef(!1),[E,S]=h.useState(0);return h.useEffect(()=>{const _=d.current;if(_)return _.addEventListener(Ky,x),()=>_.removeEventListener(Ky,x)},[x]),h.createElement(aee,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:h.useCallback(_=>g(_),[g]),onItemShiftTab:h.useCallback(()=>v(!0),[]),onFocusableItemAdd:h.useCallback(()=>S(_=>_+1),[]),onFocusableItemRemove:h.useCallback(()=>S(_=>_-1),[])},h.createElement($e.div,B({tabIndex:y||E===0?-1:0,"data-orientation":r},u,{ref:f,style:{outline:"none",...e.style},onMouseDown:ae(e.onMouseDown,()=>{k.current=!0}),onFocus:ae(e.onFocus,_=>{const P=!k.current;if(_.target===_.currentTarget&&P&&!y){const M=new CustomEvent(Ky,oee);if(_.currentTarget.dispatchEvent(M),!M.defaultPrevented){const A=w().filter(K=>K.focusable),I=A.find(K=>K.active),L=A.find(K=>K.id===m),V=[I,L,...A].filter(Boolean).map(K=>K.ref.current);B$(V)}}k.current=!1}),onBlur:ae(e.onBlur,()=>v(!1))})))}),dee="RovingFocusGroupItem",fee=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Po(),l=i||a,c=lee(dee,n),u=c.currentTabStopId===l,d=z$(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return h.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),h.createElement(ub.ItemSlot,{scope:n,id:l,focusable:r,active:o},h.createElement($e.span,B({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:ae(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:ae(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ae(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const g=mee(m,c.orientation,c.dir);if(g!==void 0){m.preventDefault();let v=d().filter(x=>x.focusable).map(x=>x.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const x=v.indexOf(m.currentTarget);v=c.loop?gee(v,x+1):v.slice(x+1)}setTimeout(()=>B$(v))}})})))}),pee={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hee(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mee(e,t,n){const r=hee(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return pee[r]}function B$(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function gee(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const vee=cee,yee=fee;var Ko=function(){return Ko=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ko.apply(this,arguments)};function U$(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function xee(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Nh="right-scroll-bar-position",$h="width-before-scroll-bar",bee="with-scroll-bars-hidden",wee="--removed-body-scroll-bar-size";function qy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function See(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var TC=new WeakMap;function kee(e,t){var n=See(t||null,function(r){return e.forEach(function(o){return qy(o,r)})});return h.useLayoutEffect(function(){var r=TC.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||qy(a,null)}),i.forEach(function(a){o.has(a)||qy(a,s)})}TC.set(n,e)},[e]),n}function Eee(e){return e}function _ee(e,t){t===void 0&&(t=Eee);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function Cee(e){e===void 0&&(e={});var t=_ee(null);return t.options=Ko({async:!0,ssr:!1},e),t}var V$=function(e){var t=e.sideCar,n=U$(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Ko({},n))};V$.isSideCarExport=!0;function Oee(e,t){return e.useMedium(t),V$}var H$=Cee(),Gy=function(){},xv=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Gy,onWheelCapture:Gy,onTouchMoveCapture:Gy}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,x=U$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),w=f,k=kee([n,t]),E=Ko(Ko({},x),o);return h.createElement(h.Fragment,null,u&&h.createElement(w,{sideCar:H$,removeScrollBar:c,shards:d,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:n}),s?h.cloneElement(h.Children.only(a),Ko(Ko({},E),{ref:k})):h.createElement(v,Ko({},E,{className:l,ref:k}),a))});xv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xv.classNames={fullWidth:$h,zeroRight:Nh};var Tee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Pee(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Tee();return t&&e.setAttribute("nonce",t),e}function Mee(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ree(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Nee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Pee())&&(Mee(t,n),Ree(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$ee=function(){var e=Nee();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},W$=function(){var e=$ee(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Aee={left:0,top:0,right:0,gap:0},Yy=function(e){return parseInt(e||"",10)||0},Dee=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Yy(n),Yy(r),Yy(o)]},Iee=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Aee;var t=Dee(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Lee=W$(),jee=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
179
|
+
.`.concat(bee,` {
|
|
180
|
+
overflow: hidden `).concat(r,`;
|
|
181
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
182
|
+
}
|
|
183
|
+
body {
|
|
184
|
+
overflow: hidden `).concat(r,`;
|
|
185
|
+
overscroll-behavior: contain;
|
|
186
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
187
|
+
padding-left: `.concat(o,`px;
|
|
188
|
+
padding-top: `).concat(i,`px;
|
|
189
|
+
padding-right: `).concat(s,`px;
|
|
190
|
+
margin-left:0;
|
|
191
|
+
margin-top:0;
|
|
192
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
193
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.`).concat(Nh,` {
|
|
197
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.`).concat($h,` {
|
|
201
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.`).concat(Nh," .").concat(Nh,` {
|
|
205
|
+
right: 0 `).concat(r,`;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.`).concat($h," .").concat($h,` {
|
|
209
|
+
margin-right: 0 `).concat(r,`;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
body {
|
|
213
|
+
`).concat(wee,": ").concat(a,`px;
|
|
214
|
+
}
|
|
215
|
+
`)},zee=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=h.useMemo(function(){return Iee(o)},[o]);return h.createElement(Lee,{styles:jee(i,!t,o,n?"":"!important")})},db=!1;if(typeof window<"u")try{var Xp=Object.defineProperty({},"passive",{get:function(){return db=!0,!0}});window.addEventListener("test",Xp,Xp),window.removeEventListener("test",Xp,Xp)}catch{db=!1}var jl=db?{passive:!1}:!1,Fee=function(e){return e.tagName==="TEXTAREA"},K$=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Fee(e)&&n[t]==="visible")},Bee=function(e){return K$(e,"overflowY")},Uee=function(e){return K$(e,"overflowX")},PC=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=q$(e,n);if(r){var o=G$(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Vee=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Hee=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},q$=function(e,t){return e==="v"?Bee(t):Uee(t)},G$=function(e,t){return e==="v"?Vee(t):Hee(t)},Wee=function(e,t){return e==="h"&&t==="rtl"?-1:1},Kee=function(e,t,n,r,o){var i=Wee(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=G$(e,a),m=p[0],g=p[1],y=p[2],v=g-y-i*m;(m||v)&&q$(e,a)&&(d+=v,f+=m),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&d===0||!o&&s>d)||!u&&(o&&f===0||!o&&-s>f))&&(c=!0),c},Zp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},MC=function(e){return[e.deltaX,e.deltaY]},RC=function(e){return e&&"current"in e?e.current:e},qee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Gee=function(e){return`
|
|
216
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
217
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
218
|
+
`)},Yee=0,zl=[];function Xee(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(Yee++)[0],i=h.useState(function(){return W$()})[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=xee([e.lockRef.current],(e.shards||[]).map(RC),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,y){if("touches"in g&&g.touches.length===2)return!s.current.allowPinchZoom;var v=Zp(g),x=n.current,w="deltaX"in g?g.deltaX:x[0]-v[0],k="deltaY"in g?g.deltaY:x[1]-v[1],E,S=g.target,_=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in g&&_==="h"&&S.type==="range")return!1;var P=PC(_,S);if(!P)return!0;if(P?E=_:(E=_==="v"?"h":"v",P=PC(_,S)),!P)return!1;if(!r.current&&"changedTouches"in g&&(w||k)&&(r.current=E),!E)return!0;var M=r.current||E;return Kee(M,y,g,M==="h"?w:k,!0)},[]),l=h.useCallback(function(g){var y=g;if(!(!zl.length||zl[zl.length-1]!==i)){var v="deltaY"in y?MC(y):Zp(y),x=t.current.filter(function(E){return E.name===y.type&&E.target===y.target&&qee(E.delta,v)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(s.current.shards||[]).map(RC).filter(Boolean).filter(function(E){return E.contains(y.target)}),k=w.length>0?a(y,w[0]):!s.current.noIsolation;k&&y.cancelable&&y.preventDefault()}}},[]),c=h.useCallback(function(g,y,v,x){var w={name:g,delta:y,target:v,should:x};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(k){return k!==w})},1)},[]),u=h.useCallback(function(g){n.current=Zp(g),r.current=void 0},[]),d=h.useCallback(function(g){c(g.type,MC(g),g.target,a(g,e.lockRef.current))},[]),f=h.useCallback(function(g){c(g.type,Zp(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return zl.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,jl),document.addEventListener("touchmove",l,jl),document.addEventListener("touchstart",u,jl),function(){zl=zl.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,jl),document.removeEventListener("touchmove",l,jl),document.removeEventListener("touchstart",u,jl)}},[]);var p=e.removeScrollBar,m=e.inert;return h.createElement(h.Fragment,null,m?h.createElement(i,{styles:Gee(o)}):null,p?h.createElement(zee,{gapMode:"margin"}):null)}const Zee=Oee(H$,Xee);var Y$=h.forwardRef(function(e,t){return h.createElement(xv,Ko({},e,{ref:t,sideCar:Zee}))});Y$.classNames=xv.classNames;const bv=Y$,fb=["Enter"," "],Jee=["ArrowDown","PageUp","Home"],X$=["ArrowUp","PageDown","End"],Qee=[...Jee,...X$],ete={ltr:[...fb,"ArrowRight"],rtl:[...fb,"ArrowLeft"]},tte={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wv="Menu",[If,nte,rte]=jg(wv),[Sl,Z$]=to(wv,[rte,mu,F$]),Fw=mu(),J$=F$(),[ote,kl]=Sl(wv),[ite,dp]=Sl(wv),ste=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=Fw(t),[l,c]=h.useState(null),u=h.useRef(!1),d=pn(i),f=Zf(o);return h.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),h.createElement(Iw,a,h.createElement(ote,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c},h.createElement(ite,{scope:t,onClose:h.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:s},r)))},Q$=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fw(n);return h.createElement(Lw,B({},o,r,{ref:t}))}),eA="MenuPortal",[ate,tA]=Sl(eA,{forceMount:void 0}),lte=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=kl(eA,t);return h.createElement(ate,{scope:t,forceMount:n},h.createElement(er,{present:n||i.open},h.createElement(yv,{asChild:!0,container:o},r)))},Ro="MenuContent",[cte,Bw]=Sl(Ro),ute=h.forwardRef((e,t)=>{const n=tA(Ro,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Ro,e.__scopeMenu),s=dp(Ro,e.__scopeMenu);return h.createElement(If.Provider,{scope:e.__scopeMenu},h.createElement(er,{present:r||i.open},h.createElement(If.Slot,{scope:e.__scopeMenu},s.modal?h.createElement(dte,B({},o,{ref:t})):h.createElement(fte,B({},o,{ref:t})))))}),dte=h.forwardRef((e,t)=>{const n=kl(Ro,e.__scopeMenu),r=h.useRef(null),o=qe(t,r);return h.useEffect(()=>{const i=r.current;if(i)return hv(i)},[]),h.createElement(Uw,B({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ae(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),fte=h.forwardRef((e,t)=>{const n=kl(Ro,e.__scopeMenu);return h.createElement(Uw,B({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),Uw=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...g}=e,y=kl(Ro,n),v=dp(Ro,n),x=Fw(n),w=J$(n),k=nte(n),[E,S]=h.useState(null),_=h.useRef(null),P=qe(t,_,y.onContentChange),M=h.useRef(0),A=h.useRef(""),I=h.useRef(0),L=h.useRef(null),re=h.useRef("right"),V=h.useRef(0),K=m?bv:h.Fragment,C=m?{as:Di,allowPinchZoom:!0}:void 0,T=R=>{var N,j;const G=A.current+R,xe=k().filter(nt=>!nt.disabled),ue=document.activeElement,je=(N=xe.find(nt=>nt.ref.current===ue))===null||N===void 0?void 0:N.textValue,Ce=xe.map(nt=>nt.textValue),J=Tte(Ce,G,je),tt=(j=xe.find(nt=>nt.textValue===J))===null||j===void 0?void 0:j.ref.current;(function nt(rt){A.current=rt,window.clearTimeout(M.current),rt!==""&&(M.current=window.setTimeout(()=>nt(""),1e3))})(G),tt&&setTimeout(()=>tt.focus())};h.useEffect(()=>()=>window.clearTimeout(M.current),[]),gv();const O=h.useCallback(R=>{var N,j;return re.current===((N=L.current)===null||N===void 0?void 0:N.side)&&Mte(R,(j=L.current)===null||j===void 0?void 0:j.area)},[]);return h.createElement(cte,{scope:n,searchRef:A,onItemEnter:h.useCallback(R=>{O(R)&&R.preventDefault()},[O]),onItemLeave:h.useCallback(R=>{var N;O(R)||((N=_.current)===null||N===void 0||N.focus(),S(null))},[O]),onTriggerLeave:h.useCallback(R=>{O(R)&&R.preventDefault()},[O]),pointerGraceTimerRef:I,onPointerGraceIntentChange:h.useCallback(R=>{L.current=R},[])},h.createElement(K,C,h.createElement(vv,{asChild:!0,trapped:o,onMountAutoFocus:ae(i,R=>{var N;R.preventDefault(),(N=_.current)===null||N===void 0||N.focus()}),onUnmountAutoFocus:s},h.createElement(mv,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p},h.createElement(vee,B({asChild:!0},w,{dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:ae(l,R=>{v.isUsingKeyboardRef.current||R.preventDefault()})}),h.createElement(jw,B({role:"menu","aria-orientation":"vertical","data-state":sA(y.open),"data-radix-menu-content":"",dir:v.dir},x,g,{ref:P,style:{outline:"none",...g.style},onKeyDown:ae(g.onKeyDown,R=>{const j=R.target.closest("[data-radix-menu-content]")===R.currentTarget,G=R.ctrlKey||R.altKey||R.metaKey,xe=R.key.length===1;j&&(R.key==="Tab"&&R.preventDefault(),!G&&xe&&T(R.key));const ue=_.current;if(R.target!==ue||!Qee.includes(R.key))return;R.preventDefault();const Ce=k().filter(J=>!J.disabled).map(J=>J.ref.current);X$.includes(R.key)&&Ce.reverse(),Cte(Ce)}),onBlur:ae(e.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(M.current),A.current="")}),onPointerMove:ae(e.onPointerMove,Lf(R=>{const N=R.target,j=V.current!==R.clientX;if(R.currentTarget.contains(N)&&j){const G=R.clientX>V.current?"right":"left";re.current=G,V.current=R.clientX}}))})))))))}),pte=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.createElement($e.div,B({},r,{ref:t}))}),pb="MenuItem",NC="menu.itemSelect",Vw=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=h.useRef(null),s=dp(pb,e.__scopeMenu),a=Bw(pb,e.__scopeMenu),l=qe(t,i),c=h.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(NC,{bubbles:!0,cancelable:!0});d.addEventListener(NC,p=>r==null?void 0:r(p),{once:!0}),V2(d,f),f.defaultPrevented?c.current=!1:s.onClose()}};return h.createElement(nA,B({},o,{ref:l,disabled:n,onClick:ae(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)===null||f===void 0||f.call(e,d),c.current=!0},onPointerUp:ae(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)===null||f===void 0||f.click()}),onKeyDown:ae(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||fb.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}))}),nA=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Bw(pb,n),a=J$(n),l=h.useRef(null),c=qe(t,l),[u,d]=h.useState(!1),[f,p]=h.useState("");return h.useEffect(()=>{const m=l.current;if(m){var g;p(((g=m.textContent)!==null&&g!==void 0?g:"").trim())}},[i.children]),h.createElement(If.ItemSlot,{scope:n,disabled:r,textValue:o??f},h.createElement(yee,B({asChild:!0},a,{focusable:!r}),h.createElement($e.div,B({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:ae(e.onPointerMove,Lf(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus())})),onPointerLeave:ae(e.onPointerLeave,Lf(m=>s.onItemLeave(m))),onFocus:ae(e.onFocus,()=>d(!0)),onBlur:ae(e.onBlur,()=>d(!1))}))))}),hte=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return h.createElement(oA,{scope:e.__scopeMenu,checked:n},h.createElement(Vw,B({role:"menuitemcheckbox","aria-checked":Qm(n)?"mixed":n},o,{ref:t,"data-state":Hw(n),onSelect:ae(o.onSelect,()=>r==null?void 0:r(Qm(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),mte="MenuRadioGroup",[Kle,gte]=Sl(mte,{value:void 0,onValueChange:()=>{}}),vte="MenuRadioItem",yte=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=gte(vte,e.__scopeMenu),i=n===o.value;return h.createElement(oA,{scope:e.__scopeMenu,checked:i},h.createElement(Vw,B({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":Hw(i),onSelect:ae(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),rA="MenuItemIndicator",[oA,xte]=Sl(rA,{checked:!1}),bte=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=xte(rA,n);return h.createElement(er,{present:r||Qm(i.checked)||i.checked===!0},h.createElement($e.span,B({},o,{ref:t,"data-state":Hw(i.checked)})))}),wte=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.createElement($e.div,B({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),Ste="MenuSub",[qle,iA]=Sl(Ste),Jp="MenuSubTrigger",kte=h.forwardRef((e,t)=>{const n=kl(Jp,e.__scopeMenu),r=dp(Jp,e.__scopeMenu),o=iA(Jp,e.__scopeMenu),i=Bw(Jp,e.__scopeMenu),s=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=h.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return h.useEffect(()=>u,[u]),h.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),h.createElement(Q$,B({asChild:!0},c),h.createElement(nA,B({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":sA(n.open)},e,{ref:Og(t,o.onTriggerChange),onClick:d=>{var f;(f=e.onClick)===null||f===void 0||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ae(e.onPointerMove,Lf(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ae(e.onPointerLeave,Lf(d=>{var f;u();const p=(f=n.content)===null||f===void 0?void 0:f.getBoundingClientRect();if(p){var m;const g=(m=n.content)===null||m===void 0?void 0:m.dataset.side,y=g==="right",v=y?-5:5,x=p[y?"left":"right"],w=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x,y:p.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ae(e.onKeyDown,d=>{const f=i.searchRef.current!=="";if(!(e.disabled||f&&d.key===" ")&&ete[r.dir].includes(d.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),d.preventDefault()}})})))}),Ete="MenuSubContent",_te=h.forwardRef((e,t)=>{const n=tA(Ro,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Ro,e.__scopeMenu),s=dp(Ro,e.__scopeMenu),a=iA(Ete,e.__scopeMenu),l=h.useRef(null),c=qe(t,l);return h.createElement(If.Provider,{scope:e.__scopeMenu},h.createElement(er,{present:r||i.open},h.createElement(If.Slot,{scope:e.__scopeMenu},h.createElement(Uw,B({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)===null||d===void 0||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ae(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ae(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:ae(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=tte[s.dir].includes(u.key);if(d&&f){var p;i.onOpenChange(!1),(p=a.trigger)===null||p===void 0||p.focus(),u.preventDefault()}})})))))});function sA(e){return e?"open":"closed"}function Qm(e){return e==="indeterminate"}function Hw(e){return Qm(e)?"indeterminate":e?"checked":"unchecked"}function Cte(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ote(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Tte(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Ote(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Pte(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function Mte(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Pte(n,t)}function Lf(e){return t=>t.pointerType==="mouse"?e(t):void 0}const Rte=ste,Nte=Q$,$te=lte,Ate=ute,Dte=pte,Ite=Vw,Lte=hte,jte=yte,zte=bte,Fte=wte,Bte=kte,Ute=_te,aA="DropdownMenu",[Vte,Gle]=to(aA,[Z$]),so=Z$(),[Hte,lA]=Vte(aA),Wte=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=so(t),c=h.useRef(null),[u=!1,d]=ei({prop:o,defaultProp:i,onChange:s});return h.createElement(Hte,{scope:t,triggerId:Po(),triggerRef:c,contentId:Po(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(f=>!f),[d]),modal:a},h.createElement(Rte,B({},l,{open:u,onOpenChange:d,dir:r,modal:a}),n))},Kte="DropdownMenuTrigger",qte=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=lA(Kte,n),s=so(n);return h.createElement(Nte,B({asChild:!0},s),h.createElement($e.button,B({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:Og(t,i.triggerRef),onPointerDown:ae(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ae(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),Gte=e=>{const{__scopeDropdownMenu:t,...n}=e,r=so(t);return h.createElement($te,B({},r,n))},Yte="DropdownMenuContent",Xte=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lA(Yte,n),i=so(n),s=h.useRef(!1);return h.createElement(Ate,B({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:ae(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:ae(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Zte=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=so(n);return h.createElement(Dte,B({},o,r,{ref:t}))}),Jte=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=so(n);return h.createElement(Ite,B({},o,r,{ref:t}))}),Qte=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=so(n);return h.createElement(Lte,B({},o,r,{ref:t}))}),ene=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=so(n);return h.createElement(jte,B({},o,r,{ref:t}))}),tne=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=so(n);return h.createElement(zte,B({},o,r,{ref:t}))}),nne=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=so(n);return h.createElement(Fte,B({},o,r,{ref:t}))}),rne=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=so(n);return h.createElement(Bte,B({},o,r,{ref:t}))}),one=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=so(n);return h.createElement(Ute,B({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),ine=Wte,sne=qte,ane=Gte,cA=Xte,uA=Zte,dA=Jte,fA=Qte,pA=ene,hA=tne,mA=nne,gA=rne,vA=one,lne=ine,cne=sne,une=h.forwardRef(({className:e,inset:t,children:n,...r},o)=>b.jsxs(gA,{ref:o,className:Ue("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,b.jsx(F4,{className:"w-4 h-4 ml-auto"})]}));une.displayName=gA.displayName;const dne=h.forwardRef(({className:e,...t},n)=>b.jsx(vA,{ref:n,className:Ue("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));dne.displayName=vA.displayName;const yA=h.forwardRef(({className:e,sideOffset:t=4,container:n,...r},o)=>b.jsx(ane,{container:n,children:b.jsx(cA,{ref:o,sideOffset:t,className:Ue("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));yA.displayName=cA.displayName;const gs=h.forwardRef(({className:e,inset:t,...n},r)=>b.jsx(dA,{ref:r,className:Ue("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));gs.displayName=dA.displayName;const fne=h.forwardRef(({className:e,children:t,checked:n,...r},o)=>b.jsxs(fA,{ref:o,className:Ue("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(hA,{children:b.jsx(k1,{className:"w-4 h-4"})})}),t]}));fne.displayName=fA.displayName;const pne=h.forwardRef(({className:e,children:t,...n},r)=>b.jsxs(pA,{ref:r,className:Ue("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(hA,{children:b.jsx(B4,{className:"w-2 h-2 fill-current"})})}),t]}));pne.displayName=pA.displayName;const hne=h.forwardRef(({className:e,inset:t,...n},r)=>b.jsx(uA,{ref:r,className:Ue("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));hne.displayName=uA.displayName;const mne=h.forwardRef(({className:e,...t},n)=>b.jsx(mA,{ref:n,className:Ue("-mx-1 my-1 h-px bg-muted",e),...t}));mne.displayName=mA.displayName;function eg(e){"@babel/helpers - typeof";return eg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eg(e)}function fl(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function yn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function jr(e){yn(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||eg(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function gne(e,t){yn(2,arguments);var n=jr(e).getTime(),r=fl(t);return new Date(n+r)}var vne={};function Sv(){return vne}function yne(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function $C(e){yn(1,arguments);var t=jr(e);return t.setHours(0,0,0,0),t}function xne(e){return yn(1,arguments),e instanceof Date||eg(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function bne(e){if(yn(1,arguments),!xne(e)&&typeof e!="number")return!1;var t=jr(e);return!isNaN(Number(t))}function wne(e){yn(1,arguments);var t=jr(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Sne(e){yn(1,arguments);var t=jr(e);return t.setDate(1),t.setHours(0,0,0,0),t}function kne(e,t){yn(2,arguments);var n=fl(t);return gne(e,-n)}var Ene=864e5;function _ne(e){yn(1,arguments);var t=jr(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/Ene)+1}function tg(e){yn(1,arguments);var t=1,n=jr(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function xA(e){yn(1,arguments);var t=jr(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=tg(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=tg(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Cne(e){yn(1,arguments);var t=xA(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=tg(n);return r}var One=6048e5;function Tne(e){yn(1,arguments);var t=jr(e),n=tg(t).getTime()-Cne(t).getTime();return Math.round(n/One)+1}function ng(e,t){var n,r,o,i,s,a,l,c;yn(1,arguments);var u=Sv(),d=fl((n=(r=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&o!==void 0?o:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=jr(e),p=f.getUTCDay(),m=(p<d?7:0)+p-d;return f.setUTCDate(f.getUTCDate()-m),f.setUTCHours(0,0,0,0),f}function bA(e,t){var n,r,o,i,s,a,l,c;yn(1,arguments);var u=jr(e),d=u.getUTCFullYear(),f=Sv(),p=fl((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:f.firstWeekContainsDate)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(d+1,0,p),m.setUTCHours(0,0,0,0);var g=ng(m,t),y=new Date(0);y.setUTCFullYear(d,0,p),y.setUTCHours(0,0,0,0);var v=ng(y,t);return u.getTime()>=g.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function Pne(e,t){var n,r,o,i,s,a,l,c;yn(1,arguments);var u=Sv(),d=fl((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=bA(e,t),p=new Date(0);p.setUTCFullYear(f,0,d),p.setUTCHours(0,0,0,0);var m=ng(p,t);return m}var Mne=6048e5;function Rne(e,t){yn(1,arguments);var n=jr(e),r=ng(n,t).getTime()-Pne(n,t).getTime();return Math.round(r/Mne)+1}function at(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var Nne={y:function(t,n){var r=t.getUTCFullYear(),o=r>0?r:1-r;return at(n==="yy"?o%100:o,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):at(r+1,2)},d:function(t,n){return at(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return at(t.getUTCHours()%12||12,n.length)},H:function(t,n){return at(t.getUTCHours(),n.length)},m:function(t,n){return at(t.getUTCMinutes(),n.length)},s:function(t,n){return at(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return at(i,n.length)}};const ss=Nne;var Fl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},$ne={G:function(t,n,r){var o=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return ss.y(t,n)},Y:function(t,n,r,o){var i=bA(t,o),s=i>0?i:1-i;if(n==="YY"){var a=s%100;return at(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):at(s,n.length)},R:function(t,n){var r=xA(t);return at(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return at(r,n.length)},Q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return at(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return at(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,n,r){var o=t.getUTCMonth();switch(n){case"M":case"MM":return ss.M(t,n);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(t,n,r){var o=t.getUTCMonth();switch(n){case"L":return String(o+1);case"LL":return at(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(t,n,r,o){var i=Rne(t,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):at(i,n.length)},I:function(t,n,r){var o=Tne(t);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):at(o,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):ss.d(t,n)},D:function(t,n,r){var o=_ne(t);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):at(o,n.length)},E:function(t,n,r){var o=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(t,n,r,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return at(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return at(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var o=t.getUTCDay(),i=o===0?7:o;switch(n){case"i":return String(i);case"ii":return at(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(t,n,r){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var o=t.getUTCHours(),i;switch(o===12?i=Fl.noon:o===0?i=Fl.midnight:i=o/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var o=t.getUTCHours(),i;switch(o>=17?i=Fl.evening:o>=12?i=Fl.afternoon:o>=4?i=Fl.morning:i=Fl.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return ss.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):ss.H(t,n)},K:function(t,n,r){var o=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):at(o,n.length)},k:function(t,n,r){var o=t.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):at(o,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):ss.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):ss.s(t,n)},S:function(t,n){return ss.S(t,n)},X:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return DC(s);case"XXXX":case"XX":return ka(s);case"XXXXX":case"XXX":default:return ka(s,":")}},x:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"x":return DC(s);case"xxxx":case"xx":return ka(s);case"xxxxx":case"xxx":default:return ka(s,":")}},O:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+AC(s,":");case"OOOO":default:return"GMT"+ka(s,":")}},z:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+AC(s,":");case"zzzz":default:return"GMT"+ka(s,":")}},t:function(t,n,r,o){var i=o._originalDate||t,s=Math.floor(i.getTime()/1e3);return at(s,n.length)},T:function(t,n,r,o){var i=o._originalDate||t,s=i.getTime();return at(s,n.length)}};function AC(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(i===0)return n+String(o);var s=t||"";return n+String(o)+s+at(i,2)}function DC(e,t){if(e%60===0){var n=e>0?"-":"+";return n+at(Math.abs(e)/60,2)}return ka(e,t)}function ka(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e),i=at(Math.floor(o/60),2),s=at(o%60,2);return r+i+n+s}var IC=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},wA=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Ane=function(t,n){var r=t.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return IC(t,n);var s;switch(o){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",IC(o,n)).replace("{{time}}",wA(i,n))},Dne={p:wA,P:Ane},Ine=["D","DD"],Lne=["YY","YYYY"];function jne(e){return Ine.indexOf(e)!==-1}function zne(e){return Lne.indexOf(e)!==-1}function LC(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Fne={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Bne=function(t,n,r){var o,i=Fne[t];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};const Une=Bne;function Xy(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var Vne={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Hne={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wne={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Kne={date:Xy({formats:Vne,defaultWidth:"full"}),time:Xy({formats:Hne,defaultWidth:"full"}),dateTime:Xy({formats:Wne,defaultWidth:"full"})};const qne=Kne;var Gne={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Yne=function(t,n,r,o){return Gne[t]};const Xne=Yne;function ju(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",o;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{var a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[l]||e.values[a]}var c=e.argumentCallback?e.argumentCallback(t):t;return o[c]}}var Zne={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Jne={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qne={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ere={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},tre={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nre={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},rre=function(t,n){var r=Number(t),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},ore={ordinalNumber:rre,era:ju({values:Zne,defaultWidth:"wide"}),quarter:ju({values:Jne,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ju({values:Qne,defaultWidth:"wide"}),day:ju({values:ere,defaultWidth:"wide"}),dayPeriod:ju({values:tre,defaultWidth:"wide",formattingValues:nre,defaultFormattingWidth:"wide"})};const ire=ore;function zu(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?are(a,function(d){return d.test(s)}):sre(a,function(d){return d.test(s)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function sre(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function are(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function lre(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;var a=t.slice(o.length);return{value:s,rest:a}}}var cre=/^(\d+)(th|st|nd|rd)?/i,ure=/\d+/i,dre={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},fre={any:[/^b/i,/^(a|c)/i]},pre={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hre={any:[/1/i,/2/i,/3/i,/4/i]},mre={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gre={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},vre={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},yre={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},xre={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},bre={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},wre={ordinalNumber:lre({matchPattern:cre,parsePattern:ure,valueCallback:function(t){return parseInt(t,10)}}),era:zu({matchPatterns:dre,defaultMatchWidth:"wide",parsePatterns:fre,defaultParseWidth:"any"}),quarter:zu({matchPatterns:pre,defaultMatchWidth:"wide",parsePatterns:hre,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:zu({matchPatterns:mre,defaultMatchWidth:"wide",parsePatterns:gre,defaultParseWidth:"any"}),day:zu({matchPatterns:vre,defaultMatchWidth:"wide",parsePatterns:yre,defaultParseWidth:"any"}),dayPeriod:zu({matchPatterns:xre,defaultMatchWidth:"any",parsePatterns:bre,defaultParseWidth:"any"})};const Sre=wre;var kre={code:"en-US",formatDistance:Une,formatLong:qne,formatRelative:Xne,localize:ire,match:Sre,options:{weekStartsOn:0,firstWeekContainsDate:1}};const SA=kre;var Ere=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_re=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Cre=/^'([^]*?)'?$/,Ore=/''/g,Tre=/[a-zA-Z]/;function El(e,t,n){var r,o,i,s,a,l,c,u,d,f,p,m,g,y,v,x,w,k;yn(2,arguments);var E=String(t),S=Sv(),_=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:S.locale)!==null&&r!==void 0?r:SA,P=fl((i=(s=(a=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:S.firstWeekContainsDate)!==null&&s!==void 0?s:(d=S.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(P>=1&&P<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=fl((p=(m=(g=(y=n==null?void 0:n.weekStartsOn)!==null&&y!==void 0?y:n==null||(v=n.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&g!==void 0?g:S.weekStartsOn)!==null&&m!==void 0?m:(w=S.locale)===null||w===void 0||(k=w.options)===null||k===void 0?void 0:k.weekStartsOn)!==null&&p!==void 0?p:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!_.localize)throw new RangeError("locale must contain localize property");if(!_.formatLong)throw new RangeError("locale must contain formatLong property");var A=jr(e);if(!bne(A))throw new RangeError("Invalid time value");var I=yne(A),L=kne(A,I),re={firstWeekContainsDate:P,weekStartsOn:M,locale:_,_originalDate:A},V=E.match(_re).map(function(K){var C=K[0];if(C==="p"||C==="P"){var T=Dne[C];return T(K,_.formatLong)}return K}).join("").match(Ere).map(function(K){if(K==="''")return"'";var C=K[0];if(C==="'")return Pre(K);var T=$ne[C];if(T)return!(n!=null&&n.useAdditionalWeekYearTokens)&&zne(K)&&LC(K,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&jne(K)&&LC(K,t,String(e)),T(L,K,_.localize,re);if(C.match(Tre))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return K}).join("");return V}function Pre(e){var t=e.match(Cre);return t?t[1].replace(Ore,"'"):e}var jt=function(){return jt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},jt.apply(this,arguments)};var kA={exports:{}},Fu={};/**
|
|
219
|
+
* @license React
|
|
220
|
+
* react-jsx-runtime.production.min.js
|
|
221
|
+
*
|
|
222
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the MIT license found in the
|
|
225
|
+
* LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/var jC;function Mre(){if(jC)return Fu;jC=1;var e=te,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},f=null,p=null;c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:f,ref:p,props:d,_owner:o.current}}return Fu.Fragment=n,Fu.jsx=s,Fu.jsxs=s,Fu}kA.exports=Mre();var EA=kA.exports;function Rre(e){return e.mode==="multiple"}function Nre(e){return e.mode==="range"}function $re(e){return e.mode==="single"}var Are={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Dre(e,t){return El(e,"LLLL y",t)}function Ire(e,t){return El(e,"d",t)}function Lre(e,t){return El(e,"LLLL",t)}function jre(e){return"".concat(e)}function zre(e,t){return El(e,"cccccc",t)}function Fre(e,t){return El(e,"yyyy",t)}var Bre=Object.freeze({__proto__:null,formatCaption:Dre,formatDay:Ire,formatMonthCaption:Lre,formatWeekNumber:jre,formatWeekdayName:zre,formatYearCaption:Fre}),Ure=function(e,t,n){return El(e,"do MMMM (EEEE)",n)},Vre=function(){return"Month: "},Hre=function(){return"Go to next month"},Wre=function(){return"Go to previous month"},Kre=function(e,t){return El(e,"cccc",t)},qre=function(e){return"Week n. ".concat(e)},Gre=function(){return"Year: "},Yre=Object.freeze({__proto__:null,labelDay:Ure,labelMonthDropdown:Vre,labelNext:Hre,labelPrevious:Wre,labelWeekNumber:qre,labelWeekday:Kre,labelYearDropdown:Gre});function Xre(){var e="buttons",t=Are,n=SA,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:Bre,labels:Yre,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function Zre(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=Sne(r):t&&(i=new Date(t,0,1)),o?s=wne(o):n&&(s=new Date(n,11,31)),{fromDate:i?$C(i):void 0,toDate:s?$C(s):void 0}}var _A=h.createContext(void 0);function Jre(e){var t,n=e.initialProps,r=Xre(),o=Zre(n),i=o.fromDate,s=o.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;($re(n)||Rre(n)||Nre(n))&&(l=n.onSelect);var c=jt(jt(jt({},r),n),{captionLayout:a,classNames:jt(jt({},r.classNames),n.classNames),components:jt({},n.components),formatters:jt(jt({},r.formatters),n.formatters),fromDate:i,labels:jt(jt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:jt(jt({},r.modifiers),n.modifiers),modifiersClassNames:jt(jt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:jt(jt({},r.styles),n.styles),toDate:s});return EA.jsx(_A.Provider,{value:c,children:e.children})}function Qre(){var e=h.useContext(_A);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}h.createContext(void 0);h.forwardRef(function(e,t){var n=Qre(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=jt(jt({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),EA.jsx("button",jt({},e,{ref:t,type:"button",className:s,style:a}))});h.createContext(void 0);h.createContext(void 0);var si;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(si||(si={}));si.Selected;si.Disabled;si.Hidden;si.Today;si.RangeEnd;si.RangeMiddle;si.RangeStart;si.Outside;h.createContext(void 0);h.createContext(void 0);h.createContext(void 0);var eoe=Object.defineProperty,toe=Object.getOwnPropertyDescriptor,fp=(e,t,n,r)=>{for(var o=r>1?void 0:r?toe(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&eoe(t,n,o),o},noe={icon:"bold",label:({t:e})=>e(qE.LABEL),description:({t:e})=>e(qE.DESCRIPTION)},pl=class extends lp{get name(){return"bold"}createTags(){return[Le.FormattingMark,Le.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"strong",getAttrs:e.parse},{tag:"b",getAttrs:n=>ri(n)&&n.style.fontWeight!=="normal"?e.parse(n):!1},{style:"font-weight",getAttrs:n=>_e(n)&&/^(bold(er)?|[5-9]\d{2,})$/.test(n)?null:!1},...t.parseDOM??[]],toDOM:n=>{const{weight:r}=this.options;return r?["strong",{"font-weight":r.toString()},0]:["strong",e.dom(n),0]}}}createInputRules(){return[Fm({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return Cf({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:n})=>{const{from:r,to:o}=Jr(e??t.selection,t.doc);return n==null||n(t.addMark(r,o,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:n})=>{const{from:r,to:o}=Jr(e??t.selection,t.doc);return t.doc.rangeHasMark(r,o,this.type)?(n==null||n(t.removeMark(r,o,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};fp([de(noe)],pl.prototype,"toggleBold",1);fp([de()],pl.prototype,"setBold",1);fp([de()],pl.prototype,"removeBold",1);fp([Lr({shortcut:Y.Bold,command:"toggleBold"})],pl.prototype,"shortcut",1);pl=fp([Je({defaultOptions:{weight:void 0},staticKeys:["weight"]})],pl);var roe=Object.defineProperty,ooe=Object.getOwnPropertyDescriptor,Ww=(e,t,n,r)=>{for(var o=r>1?void 0:r?ooe(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&roe(t,n,o),o},ioe={icon:"italic",label:({t:e})=>e(GE.LABEL),description:({t:e})=>e(GE.DESCRIPTION)},jf=class extends lp{get name(){return"italic"}createTags(){return[Le.FontStyle,Le.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"i",getAttrs:e.parse},{tag:"em",getAttrs:e.parse},{style:"font-style=italic"},...t.parseDOM??[]],toDOM:n=>["em",e.dom(n),0]}}createKeymap(){return{"Mod-i":Cf({type:this.type})}}createInputRules(){return[Fm({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}),Fm({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return Cf({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};Ww([de(ioe)],jf.prototype,"toggleItalic",1);Ww([Lr({shortcut:Y.Italic,command:"toggleItalic"})],jf.prototype,"shortcut",1);jf=Ww([Je({})],jf);var soe=Object.defineProperty,aoe=Object.getOwnPropertyDescriptor,Kw=(e,t,n,r)=>{for(var o=r>1?void 0:r?aoe(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&soe(t,n,o),o},loe={icon:"strikethrough",label:({t:e})=>e(YE.LABEL),description:({t:e})=>e(YE.DESCRIPTION)},zf=class extends lp{get name(){return"strike"}createTags(){return[Le.FontStyle,Le.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"s",getAttrs:e.parse},{tag:"del",getAttrs:e.parse},{tag:"strike",getAttrs:e.parse},{style:"text-decoration",getAttrs:n=>n==="line-through"?{}:!1},...t.parseDOM??[]],toDOM:n=>["s",e.dom(n),0]}}toggleStrike(){return Cf({type:this.type})}shortcut(e){return this.toggleStrike()(e)}createInputRules(){return[Fm({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};Kw([de(loe)],zf.prototype,"toggleStrike",1);Kw([Lr({shortcut:Y.Strike,command:"toggleStrike"})],zf.prototype,"shortcut",1);zf=Kw([Je({})],zf);var CA=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Qe=(e,t,n)=>(CA(e,t,"read from private field"),n?n.call(e):t.get(e)),Jl=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},vs=(e,t,n,r)=>(CA(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),coe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="22" height="22" fill="rgba(0, 0, 0, 0.65)" stroke="rgba(255, 255, 255, 0.5)" transform="rotate(90)" xmlns:v="https://vecta.io/nano"><path fill-rule="evenodd" d="M14 0a2 2 0 0 0-2 2v10H2a2 2 0 1 0 0 4h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/></svg>',uoe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="22" height="22" fill="rgba(0, 0, 0, 0.65)" stroke="rgba(255, 255, 255, 0.5)" transform="matrix(0 1 1 0 0 0)" xmlns:v="https://vecta.io/nano"><path fill-rule="evenodd" d="M14 0a2 2 0 0 0-2 2v10H2a2 2 0 1 0 0 4h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/></svg>',doe=encodeURIComponent(coe),foe=encodeURIComponent(uoe),nr,poe=class{constructor(e){Jl(this,nr,void 0);const t=document.createElement("div"),n=document.createElement("div");this.dom=t,vs(this,nr,n),this.type=e,this.createHandle(e)}createHandle(e){switch(Nn(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),Nn(Qe(this,nr),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),Qe(this,nr).dataset.dragging="",e){case 0:Nn(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),Nn(Qe(this,nr),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:Nn(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),Nn(Qe(this,nr),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:Nn(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),Nn(Qe(this,nr),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:Nn(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),Nn(Qe(this,nr),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${foe}") `});break;case 4:Nn(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),Nn(Qe(this,nr),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${doe}") `});break}this.dom.append(Qe(this,nr))}setHandleVisibility(e){const t=e||!!Qe(this,nr).dataset.dragging;Qe(this,nr).style.opacity=t?"1":"0"}dataSetDragging(e){Qe(this,nr).dataset.dragging=e?"true":""}};nr=new WeakMap;var Qp=50,OA=(e=>(e[e.Fixed=0]="Fixed",e[e.Flexible=1]="Flexible",e))(OA||{}),Ea,_a,Ca,vi,Oa,hoe=class{constructor({node:e,view:t,getPos:n,aspectRatio:r=0,options:o,initialSize:i}){Jl(this,Ea,void 0),Jl(this,_a,void 0),Jl(this,Ca,[]),Jl(this,vi,void 0),Jl(this,Oa,void 0);const s=this.createWrapper(e,i),a=this.createElement({node:e,view:t,getPos:n,options:o}),c=(r===1?[0,1,2,3,4]:[0,1]).map(f=>new poe(f));for(const f of c){const p=m=>{this.startResizing(m,t,n,f)};f.dom.addEventListener("mousedown",p),Qe(this,Ca).push(()=>f.dom.removeEventListener("mousedown",p)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),Qe(this,Ca).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,vs(this,_a,e),vs(this,Ea,a),this.aspectRatio=r}createWrapper(e,t){const n=document.createElement("div");return n.classList.add("remirror-resizable-view"),n.style.position="relative",t?Nn(n,{width:zC(t.width),aspectRatio:`${t.width} / ${t.height}`}):Nn(n,{width:zC(e.attrs.width),aspectRatio:`${e.attrs.width} / ${e.attrs.height}`}),Nn(n,{maxWidth:"100%",minWidth:`${Qp}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),n}startResizing(e,t,n,r){var o,i;e.preventDefault(),r.dataSetDragging(!0),Qe(this,Ea).style.pointerEvents="none";const s=e.pageX,a=e.pageY,l=((o=Qe(this,Ea))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=Qe(this,Ea))==null?void 0:i.getBoundingClientRect().height)||0,u=Ox(100,!1,f=>{const p=f.pageX,m=f.pageY,g=p-s,y=m-a;let v=null,x=null;if(this.aspectRatio===0&&l&&c)switch(r.type){case 0:case 3:v=l+g,x=c/l*v;break;case 1:case 4:v=l-g,x=c/l*v;break;case 2:x=c+y,v=l/c*x;break}else if(this.aspectRatio===1)switch(r.type){case 0:v=l+g;break;case 1:v=l-g;break;case 2:x=c+y;break;case 3:v=l+g,x=c+y;break;case 4:v=l-g,x=c+y;break}typeof v=="number"&&v<Qp&&(this.aspectRatio===0&&l&&c?(v=Qp,x=c/l*v):this.aspectRatio===1&&(v=Qp)),v&&(vs(this,vi,Math.round(v)),this.dom.style.width=`${Qe(this,vi)}px`),x&&vs(this,Oa,Math.round(x)),(v||x)&&(this.dom.style.aspectRatio=`${Qe(this,vi)} / ${Qe(this,Oa)}`)}),d=f=>{f.preventDefault(),r.dataSetDragging(!1),r.setHandleVisibility(!1),Qe(this,Ea).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const p=n(),m=t.state.tr.setNodeMarkup(p,void 0,{...Qe(this,_a).attrs,width:Qe(this,vi),height:Qe(this,Oa)});t.dispatch(m)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),Qe(this,Ca).push(()=>document.removeEventListener("mousemove",u)),Qe(this,Ca).push(()=>document.removeEventListener("mouseup",d))}update(e){return e.type!==Qe(this,_a).type||this.aspectRatio===0&&e.attrs.width&&e.attrs.width!==Qe(this,vi)||this.aspectRatio===1&&e.attrs.width&&e.attrs.height&&e.attrs.width!==Qe(this,vi)&&e.attrs.height!==Qe(this,Oa)||!moe(Qe(this,_a),e,["width","height"])?!1:(vs(this,_a,e),vs(this,vi,e.attrs.width),vs(this,Oa,e.attrs.height),!0)}destroy(){Qe(this,Ca).forEach(e=>e())}};Ea=new WeakMap;_a=new WeakMap;Ca=new WeakMap;vi=new WeakMap;Oa=new WeakMap;function moe(e,t,n){return e===t||goe(e,t,n)&&e.content.eq(t.content)}function goe(e,t,n){const r=e.attrs,o=t.attrs,i={};for(const a of n)i[a]=null;e.attrs={...r,...i},t.attrs={...o,...i};const s=e.sameMarkup(t);return e.attrs=r,t.attrs=o,s}function zC(e){return typeof e=="number"?`${e}px`:e||void 0}var voe=Object.defineProperty,yoe=Object.getOwnPropertyDescriptor,qw=(e,t,n,r)=>{for(var o=r>1?void 0:r?yoe(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&voe(t,n,o),o},xoe=class extends hoe{constructor(e,t,n){super({node:e,view:t,getPos:n,aspectRatio:OA.Fixed})}createElement({node:e}){const t=document.createElement("img");return t.setAttribute("src",e.attrs.src),Nn(t,{width:"100%",minWidth:"50px",objectFit:"contain"}),t}},Ff=class extends oo{get name(){return"image"}createTags(){return[Le.InlineNode,Le.Media]}createNodeSpec(e,t){const{preferPastedTextContent:n}=this.options;return{inline:!0,draggable:!0,selectable:!1,...t,attrs:{...e.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:r=>{var o;if(ri(r)){const i=woe({element:r,parse:e.parse});return n&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...t.parseDOM??[]],toDOM:r=>{const o=kN(r.attrs,e);return["img",{...e.dom(r),...o}]}}}insertImage(e,t){return({tr:n,dispatch:r})=>{const{from:o,to:i}=Jr(t??n.selection,n.doc),s=this.type.create(e);return r==null||r(n.replaceRangeWith(o,i,s)),!0}}uploadImage(e,t){const{updatePlaceholder:n,destroyPlaceholder:r,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:e,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return t==null||t(u),u},onUpdate:(l,c,u,d)=>{n(l,c,u,d)},onDestroy:(l,c)=>{r(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=vR(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(e,t,n){var r;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&Eoe(t)&&((r=t.clipboardData)!=null&&r.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=e.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);Mr(n)&&a.selectText(n);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:e=>{const t=e.type==="drop"?e.pos:void 0;return this.fileUploadFileHandler(e.files,e.event,t)}}]}createNodeViews(){return this.options.enableResizing?(e,t,n)=>new xoe(e,t,n):{}}};qw([de()],Ff.prototype,"insertImage",1);qw([de()],Ff.prototype,"uploadImage",1);Ff=qw([Je({defaultOptions:{createPlaceholder:Soe,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:koe,enableResizing:!1,preferPastedTextContent:!0}})],Ff);function boe(e){let{width:t,height:n}=e.style;return t=t||e.getAttribute("width")||"",n=n||e.getAttribute("height")||"",{width:t,height:n}}function woe({element:e,parse:t}){const{width:n,height:r}=boe(e);return{...t(e),alt:e.getAttribute("alt")??"",height:Number.parseInt(r||"0",10)||null,src:e.getAttribute("src")??null,title:e.getAttribute("title")??"",width:Number.parseInt(n||"0",10)||null,fileName:e.getAttribute("data-file-name")??null}}function Soe(e,t){const n=document.createElement("div");return n.classList.add(lZ.IMAGE_LOADER),n}function koe(e){be(e.length>0,{code:q.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let t=0;const n=[];for(const{file:r,progress:o}of e)n.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;t+=1,o(t/e.length),i({src:(l=a.target)==null?void 0:l.result,fileName:r.name})},{once:!0}),s.readAsDataURL(r)}));return n}function Eoe(e){return e.clipboardData!==void 0}function _oe(e={}){return new Wi({view(t){return new Coe(t,e)}})}class Coe{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return t.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r;if(n){let a=t.nodeBefore,l=t.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let a=o.getBoundingClientRect();i=a.left-o.scrollLeft,s=a.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,t):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=yR(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)}}var Ooe=Object.defineProperty,Toe=Object.getOwnPropertyDescriptor,Poe=(e,t,n,r)=>{for(var o=r>1?void 0:r?Toe(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&Ooe(t,n,o),o},hb=class extends _t{get name(){return"dropCursor"}createExternalPlugins(){const{color:e,width:t}=this.options;return[_oe({color:e,width:t})]}};hb=Poe([Je({defaultOptions:{color:"black",width:1}})],hb);var Moe=Object.defineProperty,Roe=Object.getOwnPropertyDescriptor,TA=(e,t,n,r)=>{for(var o=r>1?void 0:r?Roe(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&Moe(t,n,o),o},{LABEL:Noe}=iF,$oe={icon:({attrs:e})=>`h${(e==null?void 0:e.level)??"1"}`,label:({t:e,attrs:t})=>e({...Noe,values:{level:t==null?void 0:t.level}})},Aoe=[Y.H1,Y.H2,Y.H3,Y.H4,Y.H5,Y.H6],rg=class extends oo{get name(){return"heading"}createTags(){return[Le.Block,Le.TextBlock,Le.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(n=>({tag:`h${n}`,getAttrs:r=>({...e.parse(r),level:n})})),...t.parseDOM??[]],toDOM:n=>this.options.levels.includes(n.attrs.level)?[`h${n.attrs.level}`,e.dom(n),0]:[`h${this.options.defaultLevel}`,e.dom(n),0]}}toggleHeading(e={}){return CN({type:this.type,toggleType:"paragraph",attrs:e})}createKeymap(e){const t=this.store.getExtension(Ve),n=he(),r=[];for(const o of this.options.levels){const i=Aoe[o-1]??Y.H1;n[i]=zm(this.type,{level:o}),r.push({attrs:{level:o},shortcut:e(i)[0]})}return t.updateDecorated("toggleHeading",{shortcut:r}),n}createInputRules(){return this.options.levels.map(e=>_F(new RegExp(`^(#{1,${e}})\\s$`),this.type,()=>({level:e})))}createPasteRules(){return this.options.levels.map(e=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${e}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:e}),startOfTextBlock:!0}))}};TA([de($oe)],rg.prototype,"toggleHeading",1);rg=TA([Je({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],rg);var PA={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:XD,function(){return function(n){function r(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return n[i].call(s.exports,s,s.exports,r),s.l=!0,s.exports}var o={};return r.m=n,r.c=o,r.d=function(i,s,a){r.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},r.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(s,"a",s),s},r.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},r.p="",r(r.s=0)}([function(n,r,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,p=c.length,m=0;p--&&++m&&!(u&&-1<a.indexOf(c[m]));)c[m]==="."&&(++u,d=m);for(u=m,m=d;m--;)if(l.indexOf(c[m])!==-1){f=m+1;break}return 2>f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];n.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f<d;f++)u.push(s(c[f]));return u}i()}}])})})(PA);var Doe=PA.exports;const Ioe=ai(Doe);var Loe=Object.defineProperty,joe=Object.getOwnPropertyDescriptor,pp=(e,t,n,r)=>{for(var o=r>1?void 0:r?joe(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&Loe(t,n,o),o},zoe=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],FC="updateLink",Foe=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,hl=class extends lp{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[Le.Link,Le.ExcludeInputRules]}createMarkSpec(e,t){const n="data-link-auto",r=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&Ao(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...t,attrs:{...e.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!ri(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(n)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...e.parse(o),href:i,auto:a,...r(o.getAttribute("target"))}}},...t.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=kN(o.attrs,e),l=o.attrs.auto?{[n]:""}:{};return["a",{...e.dom(o),...a,rel:"noopener noreferrer nofollow",...l,...r(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:e}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${e.source}$`,e.flags.replace("g",""))}shortcut({tr:e}){let t="",{from:n,to:r,empty:o,$from:i}=e.selection,s=!1;const a=ji(i,this.type);if(o){const l=a??bN(e);if(!l)return!1;({text:t,from:n,to:r}=l),s=!0}return n===r?!1:(s||(t=e.doc.textBetween(n,r)),this.options.onActivateLink(t),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:t,from:n,to:r}),!0)}updateLink(e,t){return n=>{const{tr:r}=n;return!(bl(r.selection)&&!uw(r.selection)||UU(r.selection)||jm({trState:r,type:this.type}))&&!t?!1:(r.setMeta(this.name,{command:FC,attrs:e,range:t}),lV({type:this.type,attrs:e,range:t})(n))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(e){return t=>{const{tr:n}=t;return jm({trState:n,type:this.type,...e})?TN({type:this.type,expand:!0,range:e})(t):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(e,t)=>({href:this.buildHref(Id(e)),auto:!t}),transformMatch:e=>{const t=Id(e);return!t||!this.isValidUrl(t)?!1:t}}]}createEventHandlers(){return{clickMark:(e,t)=>{const n=t.getMark(this.type);if(!n)return;const r=n.mark.attrs,o={...r,...n};if(this.options.onClick(e,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=r.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(n)),i}}}createPlugin(){return{appendTransaction:(e,t,n)=>{if(e.filter(p=>!!p.getMeta(this.name)).forEach(p=>{const m=p.getMeta(this.name);if(m.command===FC){const{range:g,attrs:y}=m,{selection:v,doc:x}=n,w={range:g,selection:v,doc:x,attrs:y},{from:k,to:E}=g??v;this.options.onUpdateLink(x.textBetween(k,E),w)}}),!this.options.autoLink||rb(t)-rb(n)===1||!e.some(p=>p.docChanged))return;const s=PU(e,t),a=qU(s,[Ut,fn]),{mapping:l}=s,{tr:c,doc:u}=n,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:p,prevTo:m,from:g,to:y})=>{const v=[],x=y-g===2,w=this.getLinkMarksInRange(t.doc,p,m,!0).filter(k=>k.mark.type===this.type).map(({from:k,to:E,text:S})=>({mappedFrom:l.map(k),mappedTo:l.map(E),text:S,from:k,to:E}));w.forEach(({mappedFrom:k,mappedTo:E,from:S,to:_},P)=>this.getLinkMarksInRange(u,k,E,!0).filter(M=>M.mark.type===this.type).forEach(M=>{const A=t.doc.textBetween(S,_,void 0," "),I=u.textBetween(M.from,M.to+1,void 0," ").trim(),L=this.isValidUrl(A);this.isValidUrl(I)||(L&&(f({from:M.from,to:M.to}).tr(),w.splice(P,1)),!x&&g===y&&this.findAutoLinks(I).map(V=>this.addLinkProperties({...V,from:k+V.start,to:k+V.end})).forEach(({attrs:V,range:K,text:C})=>{d(V,K).tr(),v.push({attrs:V,range:K,text:C})}))})),this.findTextBlocksInRange(u,{from:g,to:y}).forEach(({text:k,positionStart:E})=>{this.findAutoLinks(k).map(S=>this.addLinkProperties({...S,from:E+S.start+1,to:E+S.end+1})).filter(({range:S})=>{const _=g>=S.from&&g<=S.to,P=y>=S.from&&y<=S.to;return _||P||x}).filter(({range:S})=>this.getLinkMarksInRange(c.doc,S.from,S.to,!1).length===0).filter(({range:{from:S},text:_})=>!w.some(({text:P,mappedFrom:M})=>M===S&&P===_)).forEach(({attrs:S,text:_,range:P})=>{d(S,P).tr(),v.push({attrs:S,range:P,text:_})})}),window.requestAnimationFrame(()=>{v.forEach(({attrs:k,range:E,text:S})=>{const{doc:_,selection:P}=c;this.options.onUpdateLink(S,{attrs:k,doc:_,range:E,selection:P})})})}),c.steps.length!==0)return c}}}buildHref(e){return this.options.extractHref({url:e,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(e,t,n,r){const o=[];if(t===n){const i=Math.max(t-1,0),s=e.resolve(i),a=ji(s,this.type);(a==null?void 0:a.mark.attrs.auto)===r&&o.push(a)}else e.nodesBetween(t,n,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===r);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(e,t){const n=[];return e.nodesBetween(t.from,t.to,(r,o)=>{!r.isTextblock||!r.type.allowsMarkType(this.type)||n.push({node:r,pos:o})}),n.map(r=>({text:e.textBetween(r.pos,r.pos+r.node.nodeSize,void 0," "),positionStart:r.pos}))}addLinkProperties({from:e,to:t,href:n,...r}){return{...r,range:{from:e,to:t},attrs:{href:n,auto:!0}}}findAutoLinks(e){if(this.options.findAutoLinks)return this.options.findAutoLinks(e,this.options.defaultProtocol);const t=[];for(const n of Xg(e,this.options.autoLinkRegex)){const r=Id(n);if(!r)continue;const o=this.buildHref(r);!this.isValidTLD(o)&&!o.startsWith("tel:")||t.push({text:r,href:o,start:n.index,end:n.index+r.length})}return t}isValidUrl(e){var t;return this.options.isValidUrl?this.options.isValidUrl(e,this.options.defaultProtocol):this.isValidTLD(this.buildHref(e))&&!!((t=this._autoLinkRegexNonGlobal)!=null&&t.test(e))}isValidTLD(e){const{autoLinkAllowedTLDs:t}=this.options;if(t.length===0)return!0;const n=Ioe(e);if(n==="")return!0;const r=qz(n.split("."));return t.includes(r)}};pp([Lr({shortcut:Y.InsertLink})],hl.prototype,"shortcut",1);pp([de()],hl.prototype,"updateLink",1);pp([de()],hl.prototype,"selectLink",1);pp([de()],hl.prototype,"removeLink",1);hl=pp([Je({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:Foe,autoLinkAllowedTLDs:zoe,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:Boe},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:ct.Medium})],hl);function Boe({url:e,defaultProtocol:t}){const n=/^((?:https?|ftp)?:)\/\//.test(e);return!n&&e.includes("@")?`mailto:${e}`:n?e:`${t}//${e}`}var Uoe=Object.defineProperty,Voe=Object.getOwnPropertyDescriptor,MA=(e,t,n,r)=>{for(var o=r>1?void 0:r?Voe(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&Uoe(t,n,o),o},og=class extends oo{get name(){return"hardBreak"}createTags(){return[Le.InlineNode]}createNodeSpec(e,t){return{inline:!0,selectable:!1,atom:!0,leafText:()=>`
|
|
227
|
+
`,...t,attrs:e.defaults(),parseDOM:[{tag:"br",getAttrs:e.parse},...t.parseDOM??[]],toDOM:n=>["br",e.dom(n)]}}createKeymap(){const e=TU(Dd($N),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":e,"Shift-Enter":e}}insertHardBreak(){return e=>{const{tr:t,dispatch:n}=e;return n==null||n(t.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};MA([de()],og.prototype,"insertHardBreak",1);og=MA([Je({defaultPriority:ct.Low})],og);const Hoe=[new pl,new jf,new zf,new Ff({enableResizing:!1}),new hb,new rg({levels:[1,2,3,4,5,6],defaultLevel:1}),new Af,new Df,new hl({autoLink:!0}),new og];function Woe(e){const{manager:t,state:n}=mJ({extensions:()=>Hoe.slice(),content:e,selection:"start"});return{manager:t,state:n}}function Koe({state:e,manager:t,options:n,onChange:r,debug:o}){const i=n&&Object.entries(n).some(([,c])=>c),[s,a]=h.useState(i),l=Qt("p-4 border rounded-md outline-none appearance-none border-input bg-background",{"rounded-t-none border-t-0":s});return b.jsx("div",{className:"text-base val-rich-text-editor",children:b.jsx(yJ,{manager:t,initialContent:e,classNames:[l],children:b.jsxs(Jre,{initialProps:{mode:"default"},children:[b.jsx(qoe,{hasOptions:i,options:n,debug:o,onShowToolbar:c=>{a(c)}}),b.jsx(ib,{}),r&&b.jsx(gJ,{onChange:r})]})})})}const qoe=({options:e,hasOptions:t,onShowToolbar:n,debug:r})=>{var l,c,u,d,f,p;const o=Tw(),i=tJ(),s=t||i.heading()||i.image()||i.link()||i.bulletList()||i.orderedList()||i.bold()||i.italic()||i.strike();h.useEffect(()=>{n(s)},[s]);const a=h.useRef(null);return b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"h-0",ref:a}),b.jsxs("div",{className:Qt("sticky top-0 flex flex-col py-2 z-[40] border divide-y rounded-md rounded-b-none border-input bg-background",{hidden:!s}),children:[b.jsxs("div",{className:"flex flex-row items-center justify-start px-4 py-1 gap-x-3",children:[((e==null?void 0:e.headings)||i.heading())&&b.jsxs(lne,{children:[b.jsx(cne,{asChild:!0,className:"pr-4",children:b.jsxs("button",{children:[i.heading({level:1})&&b.jsx(zk,{size:22}),i.heading({level:2})&&b.jsx(Fk,{size:22}),i.heading({level:3})&&b.jsx(Bk,{size:22}),i.heading({level:4})&&b.jsx(Uk,{size:22}),i.heading({level:5})&&b.jsx(Vk,{size:22}),i.heading({level:6})&&b.jsx(Hk,{size:22}),!i.heading()&&"Normal"]})}),b.jsxs(yA,{container:a.current,children:[b.jsx(gs,{onClick:()=>{o.setBlockNodeType("paragraph").focus().run()},children:"Normal"}),((l=e==null?void 0:e.headings)==null?void 0:l.includes("h1"))&&b.jsx(gs,{onClick:()=>{o.setBlockNodeType("heading",{level:1}).focus().run()},children:b.jsx(zk,{size:16})}),((c=e==null?void 0:e.headings)==null?void 0:c.includes("h2"))&&b.jsx(gs,{onClick:()=>{o.setBlockNodeType("heading",{level:2}).focus().run()},children:b.jsx(Fk,{size:16})}),((u=e==null?void 0:e.headings)==null?void 0:u.includes("h3"))&&b.jsx(gs,{onClick:()=>{o.setBlockNodeType("heading",{level:3}).focus().run()},children:b.jsx(Bk,{size:16})}),((d=e==null?void 0:e.headings)==null?void 0:d.includes("h4"))&&b.jsx(gs,{onClick:()=>{o.setBlockNodeType("heading",{level:4}).focus().run()},children:b.jsx(Uk,{size:16})}),((f=e==null?void 0:e.headings)==null?void 0:f.includes("h5"))&&b.jsx(gs,{onClick:()=>{o.setBlockNodeType("heading",{level:5}).focus().run()},children:b.jsx(Vk,{size:16})}),((p=e==null?void 0:e.headings)==null?void 0:p.includes("h5"))&&b.jsx(gs,{onClick:()=>{o.setBlockNodeType("heading",{level:6}).focus().run()},children:b.jsx(Hk,{size:16})})]})]}),b.jsx(Bl,{icon:b.jsx(j4,{size:18}),stroke:3,mark:"bold",isOption:e==null?void 0:e.bold,isActive:i.bold(),onToggle:m=>m.toggleBold().focus().run()}),b.jsx(Bl,{icon:b.jsx(oj,{size:18}),stroke:3,mark:"strike",isOption:e==null?void 0:e.lineThrough,isActive:i.strike(),onToggle:m=>m.toggleStrike().focus().run()}),b.jsx(Bl,{icon:b.jsx(W4,{size:18}),stroke:3,mark:"italic",isOption:e==null?void 0:e.italic,isActive:i.italic(),onToggle:m=>m.toggleItalic().focus().run()}),b.jsx(Bl,{icon:b.jsx(Y4,{size:18}),stroke:3,mark:"bulletList",isOption:e==null?void 0:e.ul,isActive:i.bulletList(),onToggle:m=>m.toggleBulletList().focus().run()}),b.jsx(Bl,{icon:b.jsx(G4,{size:18}),stroke:3,mark:"list",isOption:e==null?void 0:e.ol,isActive:i.orderedList(),onToggle:m=>m.toggleOrderedList().focus().run()}),b.jsx(Bl,{icon:b.jsx(q4,{size:18}),stroke:3,mark:"link",isOption:e==null?void 0:e.ol,isActive:i.link(),onToggle:m=>m.selectMark("link").updateLink({href:""}).focus().run()}),((e==null?void 0:e.img)||i.image())&&b.jsxs("label",{className:"cursor-pointer",htmlFor:"val-toolbar-image-select",children:[b.jsx("input",{hidden:!0,id:"val-toolbar-image-select",accept:"image/*",type:"file",onChange:m=>{NM(m).then(g=>{o.insertImage({src:g.src,width:g.width,height:g.height,fileName:$M(g.src,g.filename??null,{width:g.width,height:g.height,sha256:g.sha256,mimeType:g.mimeType})??void 0}).focus().run()})}}),b.jsx(H4,{size:18,className:`${i.image()&&"stroke-[3px]"}`})]}),r&&b.jsx("button",{onMouseDown:m=>m.preventDefault(),onClick:()=>o.insertHardBreak().run(),children:"Br"})]}),b.jsx(Goe,{})]})]})};function Goe(){const e=Tw(),[t,n]=h.useState(),r=nJ().link();return h.useEffect(()=>{const i=typeof r=="object"&&"href"in r&&typeof r.href=="string"?r.href:void 0;n(i)},[r==null?void 0:r.href]),r!==void 0?b.jsxs("div",{className:"flex items-center justify-start px-4 pt-1 gap-x-2",children:[b.jsx("input",{className:"bg-transparent text-accent",onChange:i=>{n(i.target.value)},defaultValue:t,placeholder:"https://"}),b.jsx("button",{className:"p-2",title:"Update",disabled:t===void 0,onClick:()=>{t!==void 0&&e.selectMark("link").updateLink({href:t}).focus().run()},children:b.jsx(k1,{size:14})}),b.jsx("button",{className:"p-2",title:"Remove",onClick:()=>{e.removeLink().focus().run()},children:b.jsx(aj,{size:13})})]}):null}function Bl({stroke:e,mark:t,isOption:n,isActive:r,onToggle:o,icon:i}){const s=Tw();return!n&&!r?null:b.jsx("button",{className:Qt({"text-accent":r,"stroke-[2px]":r&&e===2,"stroke-[3px]":r&&e===3}),onClick:a=>{a.preventDefault(),o(n?s:s.selectMark(t))},children:i})}function RA({path:e,disabled:t,source:n,schema:r,onSubmit:o}){return(typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="string"?b.jsx(tie,{path:e,defaultValue:n,disabled:t,schema:r,onSubmit:o}):(typeof n=="number"||n===null)&&(r==null?void 0:r.type)==="number"?b.jsx(UC,{defaultValue:n,disabled:t,onSubmit:o}):(typeof n=="number"||typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="keyOf"?b.jsx(BC,{defaultValue:n,disabled:t,onSubmit:o,selector:r.path}):(typeof n=="number"||n===null)&&(r==null?void 0:r.type)==="number"?b.jsx(UC,{defaultValue:n,disabled:t,onSubmit:o}):(typeof n=="number"||typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="keyOf"?b.jsx(BC,{defaultValue:n,disabled:t,onSubmit:o,selector:r.path}):(typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="richtext"?b.jsx(eie,{schema:r,onSubmit:o,defaultValue:n}):(typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="image"?b.jsx(Joe,{path:e,onSubmit:o,defaultValue:n}):(typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="file"?b.jsx(Zoe,{path:e,onSubmit:o,defaultValue:n}):b.jsxs("div",{children:["Unsupported schema: ",r.type," (source type: ",typeof n," source:"," ",JSON.stringify(n),")"]})}function NA(e,t,n,r){const o=$M(t,n,r);return!o||!r?[]:[{value:{[Cn]:`/public/${o}`,[mn]:"file",metadata:r},op:"replace",path:e},{value:t,op:"file",path:e,filePath:`/public/${o}`}]}function $A(e,t){const n=e.concat("metadata");return[{value:t,op:"replace",path:n}]}const Yoe=new TextEncoder;function Xoe(e){return new Promise((t,n)=>{var i;const r=(i=e.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=ot.getSHA256Hash(Yoe.encode(s)),l=Hg(s);t({src:s,filename:r==null?void 0:r.name,sha256:a,mimeType:l,fileExt:l&&Wg(l)})}else n(s?{message:"Unexpected file result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function Zoe({path:e,defaultValue:t,onSubmit:n}){var d,f;const[r,o]=h.useState(null),[i,s]=h.useState(!1),[a,l]=h.useState(),[c,u]=h.useState();return h.useEffect(()=>{const p=t&&ot.convertFileSource(t).url;u(p)},[t]),b.jsxs(_l,{children:[b.jsxs("div",{className:"w-fit",children:[b.jsx("div",{className:"flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",children:r||c?b.jsxs("div",{className:"relative flex flex-col justify-center items-center min-h-[100px] min-w-[200px]",children:[b.jsx("div",{children:b.jsx(V4,{})}),b.jsx("div",{children:r==null?void 0:r.filename})]}):b.jsx("div",{children:"Select file below"})},e),b.jsxs("div",{className:"p-4 border border-t-0 rounded-b-sm bg-background border-input",children:[b.jsx("label",{htmlFor:`img_input:${e}`,className:"block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",children:"Update"}),b.jsx("input",{hidden:!0,id:`img_input:${e}`,type:"file",onChange:p=>{Xoe(p).then(m=>{o({src:m.src,filename:m.filename}),m.mimeType?l({sha256:m.sha256,mimeType:m.mimeType}):l(void 0)}).catch(m=>{console.error(m.message),o(null),l(void 0)})}})]})]}),n&&b.jsx(gu,{loading:i,enabled:!!r||((d=t==null?void 0:t.metadata)==null?void 0:d.mimeType)!==(a==null?void 0:a.mimeType)||((f=t==null?void 0:t.metadata)==null?void 0:f.sha256)!==(a==null?void 0:a.sha256),onClick:()=>{r?(s(!0),n(p=>Promise.resolve(NA(p,r.src,r.filename??null,a))).finally(()=>{s(!1),o(null),l(void 0)})):a&&(s(!0),n(p=>Promise.resolve($A(p,a))).finally(()=>{s(!1),o(null),l(void 0)}))}})]})}function Joe({path:e,defaultValue:t,onSubmit:n}){var p,m,g,y,v,x,w,k,E,S,_,P;const[r,o]=h.useState(null),[i,s]=h.useState(!1),[a,l]=h.useState(),[c,u]=h.useState(),[d,f]=h.useState();return h.useEffect(()=>{f(t&&"/api/val/files/public"+ot.convertFileSource(t).url)},[t]),h.useEffect(()=>{var M;if(c)if(a){const A={...a,hotspot:c};l(A)}else t!=null&&t.metadata?l({...t.metadata,hotspot:c}):console.error("Neither image metadata nor value is set");else(M=t==null?void 0:t.metadata)!=null&&M.hotspot&&u(t.metadata.hotspot)},[c,t]),b.jsxs(_l,{children:[b.jsxs("div",{className:"w-fit",children:[b.jsx("div",{className:"flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",children:r||d?b.jsxs("div",{className:"relative",children:[c&&b.jsx("div",{className:"rounded-full h-[12px] w-[12px] bg-background mix-blend-difference border-accent border-2 absolute pointer-events-none",style:{top:`${c.y*100}%`,left:`${c.x*100}%`}}),b.jsx("img",{src:(r==null?void 0:r.src)||d,draggable:!1,className:"object-contain w-full max-h-[500px]",style:{cursor:"crosshair"},onClick:M=>{const{width:A,height:I,left:L,top:re}=M.currentTarget.getBoundingClientRect(),V=(M.clientX-6-L)/A,K=(M.clientY-6-re)/I;u({x:V,y:K,width:1,height:1})}})]}):b.jsx("div",{children:"Select image below"})},e),b.jsxs("div",{className:"p-4 border border-t-0 rounded-b-sm bg-background border-input",children:[b.jsx("label",{htmlFor:`img_input:${e}`,className:"block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",children:"Update"}),b.jsx("input",{hidden:!0,id:`img_input:${e}`,type:"file",onChange:M=>{NM(M).then(A=>{o({src:A.src,filename:A.filename}),A.width&&A.height&&A.mimeType?l({sha256:A.sha256,width:A.width,height:A.height,mimeType:A.mimeType,hotspot:c}):(l(void 0),u(void 0))}).catch(A=>{console.error(A.message),o(null),u(void 0),l(void 0)})}})]})]}),n&&b.jsx(gu,{loading:i,enabled:!!r||((m=(p=t==null?void 0:t.metadata)==null?void 0:p.hotspot)==null?void 0:m.height)!==(c==null?void 0:c.height)||((y=(g=t==null?void 0:t.metadata)==null?void 0:g.hotspot)==null?void 0:y.width)!==(c==null?void 0:c.width)||((x=(v=t==null?void 0:t.metadata)==null?void 0:v.hotspot)==null?void 0:x.x)!==(c==null?void 0:c.x)||((k=(w=t==null?void 0:t.metadata)==null?void 0:w.hotspot)==null?void 0:k.y)!==(c==null?void 0:c.y)||((E=t==null?void 0:t.metadata)==null?void 0:E.width)!==(a==null?void 0:a.width)||((S=t==null?void 0:t.metadata)==null?void 0:S.height)!==(a==null?void 0:a.height)||((_=t==null?void 0:t.metadata)==null?void 0:_.mimeType)!==(a==null?void 0:a.mimeType)||((P=t==null?void 0:t.metadata)==null?void 0:P.sha256)!==(a==null?void 0:a.sha256),onClick:()=>{r?(s(!0),n(M=>Promise.resolve(NA(M,r.src,r.filename??null,a))).finally(()=>{s(!1)})):a&&(s(!0),n(M=>Promise.resolve($A(M,a))).finally(()=>{s(!1)}))}})]})}function Qoe(e,t){const{templateStrings:n,exprs:r,files:o}=t?V8(t):{[mn]:"richtext",templateStrings:[""],exprs:[],files:{}};return[{op:"replace",path:e,value:{templateStrings:n,exprs:r,[mn]:"richtext"}},...Object.entries(o).map(([i,s])=>({op:"file",path:e,filePath:i,value:s}))]}function eie({defaultValue:e,schema:t,onSubmit:n}){const[r,o]=h.useState(!1),[i,s]=h.useState(!1),[a,l]=h.useState();h.useEffect(()=>{o(!0),l(void 0)},[e]);const{state:c,manager:u}=Woe(e&&Q8(yM(e)));return b.jsxs(_l,{children:[b.jsx(Koe,{options:t.options,onChange:d=>{o(!0),l(d)},state:c,manager:u}),n&&b.jsx(gu,{loading:i,enabled:r,onClick:()=>{if(a){s(!0);const d=J8.safeParse(a);d.success?n(async f=>Qoe(f,d.data)).finally(()=>{s(!1),o(!1)}):(s(!1),alert(`Could not parse Rich Text
|
|
228
|
+
`+JSON.stringify(d.error,null,2)))}}})]})}function BC({disabled:e,defaultValue:t,onSubmit:n,selector:r}){return b.jsx("div",{children:"TODO"})}function UC({disabled:e,defaultValue:t,onSubmit:n}){const[r,o]=h.useState(t||0),[i,s]=h.useState(!1);h.useEffect(()=>{s(e)},[e]);const a=h.useRef(null);return b.jsxs(_l,{children:[b.jsx(V1,{ref:a,disabled:i,defaultValue:r??0,onChange:l=>o(Number(l.target.value)),type:"number"}),n&&b.jsx(gu,{loading:i,enabled:t!==r,onClick:()=>{s(!0),n(async l=>{var c;return[{op:"replace",path:l,value:Number((c=a.current)==null?void 0:c.value)||0}]}).finally(()=>{s(!1)})}})]})}function tie({disabled:e,defaultValue:t,path:n,schema:r,onSubmit:o}){const[i,s]=h.useState(t||""),[a,l]=h.useState(!1);h.useEffect(()=>{l(e)},[e]);const c=h.useRef(null),d=new j2(r.options?{...r.options,regexp:r.options.regexp?new RegExp(r.options.regexp.source,r.options.regexp.flags):void 0}:void 0).validate(n,i);return b.jsxs(_l,{children:[b.jsx(V1,{ref:c,disabled:a,defaultValue:i??"",onChange:f=>s(f.target.value)}),o&&b.jsx(gu,{validationErrors:d&&d[n],loading:a,enabled:t!==i,onClick:()=>{l(!0),o(async f=>{var p;return[{op:"replace",path:f,value:((p=c.current)==null?void 0:p.value)||""}]}).finally(()=>{l(!1)})}})]})}function nie({errors:e}){return b.jsx("div",{className:"flex flex-col p-2 text-sm rounded-md gap-y-1 text-destructive-foreground bg-destructive",children:e.map((t,n)=>b.jsx("div",{children:t.message},n))})}function _l({children:e,className:t}){return b.jsx("div",{className:Qt("relative max-w-lg px-4 pt-4",t),children:e})}function gu({loading:e,enabled:t,validationErrors:n,onClick:r}){const{session:o}=Ng(),i=o.status==="success"&&o.data.mode==="proxy";return b.jsx("div",{className:"sticky bottom-0 m-4 mt-2 ml-0",children:b.jsxs("div",{className:"grid justify-start gap-2 text",children:[n?b.jsx(nie,{errors:n||[]}):b.jsx("span",{}),b.jsx(Bc,{disabled:e||!t,onClick:r,children:e?i?"Staging...":"Saving...":i?"Stage":"Save"})," "]})})}const Gw=h.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:Ue("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Gw.displayName="Card";const rie=h.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:Ue("flex flex-col space-y-1.5 p-6",e),...t}));rie.displayName="CardHeader";const oie=h.forwardRef(({className:e,...t},n)=>b.jsx("h3",{ref:n,className:Ue("text-2xl font-semibold leading-none tracking-tight",e),...t}));oie.displayName="CardTitle";const iie=h.forwardRef(({className:e,...t},n)=>b.jsx("p",{ref:n,className:Ue("text-sm text-muted-foreground",e),...t}));iie.displayName="CardDescription";const sie=h.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:Ue("p-6 pt-0",e),...t}));sie.displayName="CardContent";const aie=h.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:Ue("flex items-center p-6 pt-0",e),...t}));aie.displayName="CardFooter";function AA(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const lie=h.forwardRef((e,t)=>h.createElement($e.span,B({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),cie=[" ","Enter","ArrowUp","ArrowDown"],uie=[" ","Enter"],kv="Select",[Ev,Yw,die]=jg(kv),[vu,Yle]=to(kv,[die,mu]),Xw=mu(),[fie,Cl]=vu(kv),[pie,hie]=vu(kv),mie=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p}=e,m=Xw(t),[g,y]=h.useState(null),[v,x]=h.useState(null),[w,k]=h.useState(!1),E=Zf(c),[S=!1,_]=ei({prop:r,defaultProp:o,onChange:i}),[P,M]=ei({prop:s,defaultProp:a,onChange:l}),A=h.useRef(null),I=g?!!g.closest("form"):!0,[L,re]=h.useState(new Set),V=Array.from(L).map(K=>K.props.value).join(";");return h.createElement(Iw,m,h.createElement(fie,{required:p,scope:t,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:k,contentId:Po(),value:P,onValueChange:M,open:S,onOpenChange:_,dir:E,triggerPointerDownPosRef:A,disabled:f},h.createElement(Ev.Provider,{scope:t},h.createElement(pie,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(K=>{re(C=>new Set(C).add(K))},[]),onNativeOptionRemove:h.useCallback(K=>{re(C=>{const T=new Set(C);return T.delete(K),T})},[])},n)),I?h.createElement(jA,{key:V,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:P,onChange:K=>M(K.target.value),disabled:f},P===void 0?h.createElement("option",{value:""}):null,Array.from(L)):null))},gie="SelectTrigger",vie=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Xw(n),s=Cl(gie,n),a=s.disabled||r,l=qe(t,s.onTriggerChange),c=Yw(n),[u,d,f]=zA(m=>{const g=c().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),v=FA(g,m,y);v!==void 0&&s.onValueChange(v.value)}),p=()=>{a||(s.onOpenChange(!0),f())};return h.createElement(Lw,B({asChild:!0},i),h.createElement($e.button,B({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":LA(s.value)?"":void 0},o,{ref:l,onClick:ae(o.onClick,m=>{m.currentTarget.focus()}),onPointerDown:ae(o.onPointerDown,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:ae(o.onKeyDown,m=>{const g=u.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&d(m.key),!(g&&m.key===" ")&&cie.includes(m.key)&&(p(),m.preventDefault())})})))}),yie="SelectValue",xie=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Cl(yie,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=qe(t,l.onValueNodeChange);return Pr(()=>{c(u)},[c,u]),h.createElement($e.span,B({},a,{ref:d,style:{pointerEvents:"none"}}),LA(l.value)?h.createElement(h.Fragment,null,s):i)}),bie=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return h.createElement($e.span,B({"aria-hidden":!0},o,{ref:t}),r||"▼")}),wie=e=>h.createElement(yv,B({asChild:!0},e)),eu="SelectContent",Sie=h.forwardRef((e,t)=>{const n=Cl(eu,e.__scopeSelect),[r,o]=h.useState();if(Pr(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?$r.createPortal(h.createElement(DA,{scope:e.__scopeSelect},h.createElement(Ev.Slot,{scope:e.__scopeSelect},h.createElement("div",null,e.children))),i):null}return h.createElement(kie,B({},e,{ref:t}))}),bi=10,[DA,_v]=vu(eu),kie=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:g,avoidCollisions:y,...v}=e,x=Cl(eu,n),[w,k]=h.useState(null),[E,S]=h.useState(null),_=qe(t,J=>k(J)),[P,M]=h.useState(null),[A,I]=h.useState(null),L=Yw(n),[re,V]=h.useState(!1),K=h.useRef(!1);h.useEffect(()=>{if(w)return hv(w)},[w]),gv();const C=h.useCallback(J=>{const[tt,...nt]=L().map(Ge=>Ge.ref.current),[rt]=nt.slice(-1),Pe=document.activeElement;for(const Ge of J)if(Ge===Pe||(Ge==null||Ge.scrollIntoView({block:"nearest"}),Ge===tt&&E&&(E.scrollTop=0),Ge===rt&&E&&(E.scrollTop=E.scrollHeight),Ge==null||Ge.focus(),document.activeElement!==Pe))return},[L,E]),T=h.useCallback(()=>C([P,w]),[C,P,w]);h.useEffect(()=>{re&&T()},[re,T]);const{onOpenChange:O,triggerPointerDownPosRef:R}=x;h.useEffect(()=>{if(w){let J={x:0,y:0};const tt=rt=>{var Pe,Ge,Tn,zn;J={x:Math.abs(Math.round(rt.pageX)-((Pe=(Ge=R.current)===null||Ge===void 0?void 0:Ge.x)!==null&&Pe!==void 0?Pe:0)),y:Math.abs(Math.round(rt.pageY)-((Tn=(zn=R.current)===null||zn===void 0?void 0:zn.y)!==null&&Tn!==void 0?Tn:0))}},nt=rt=>{J.x<=10&&J.y<=10?rt.preventDefault():w.contains(rt.target)||O(!1),document.removeEventListener("pointermove",tt),R.current=null};return R.current!==null&&(document.addEventListener("pointermove",tt),document.addEventListener("pointerup",nt,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",tt),document.removeEventListener("pointerup",nt,{capture:!0})}}},[w,O,R]),h.useEffect(()=>{const J=()=>O(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[O]);const[N,j]=zA(J=>{const tt=L().filter(Pe=>!Pe.disabled),nt=tt.find(Pe=>Pe.ref.current===document.activeElement),rt=FA(tt,J,nt);rt&&setTimeout(()=>rt.ref.current.focus())}),G=h.useCallback((J,tt,nt)=>{const rt=!K.current&&!nt;(x.value!==void 0&&x.value===tt||rt)&&(M(J),rt&&(K.current=!0))},[x.value]),xe=h.useCallback(()=>w==null?void 0:w.focus(),[w]),ue=h.useCallback((J,tt,nt)=>{const rt=!K.current&&!nt;(x.value!==void 0&&x.value===tt||rt)&&I(J)},[x.value]),je=r==="popper"?VC:Eie,Ce=je===VC?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:g,avoidCollisions:y}:{};return h.createElement(DA,{scope:n,content:w,viewport:E,onViewportChange:S,itemRefCallback:G,selectedItem:P,onItemLeave:xe,itemTextRefCallback:ue,focusSelectedItem:T,selectedItemText:A,position:r,isPositioned:re,searchRef:N},h.createElement(bv,{as:Di,allowPinchZoom:!0},h.createElement(vv,{asChild:!0,trapped:x.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:ae(o,J=>{var tt;(tt=x.trigger)===null||tt===void 0||tt.focus({preventScroll:!0}),J.preventDefault()})},h.createElement(mv,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>x.onOpenChange(!1)},h.createElement(je,B({role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:J=>J.preventDefault()},v,Ce,{onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ae(v.onKeyDown,J=>{const tt=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!tt&&J.key.length===1&&j(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let rt=L().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);if(["ArrowUp","End"].includes(J.key)&&(rt=rt.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const Pe=J.target,Ge=rt.indexOf(Pe);rt=rt.slice(Ge+1)}setTimeout(()=>C(rt)),J.preventDefault()}})}))))))}),Eie=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Cl(eu,n),s=_v(eu,n),[a,l]=h.useState(null),[c,u]=h.useState(null),d=qe(t,_=>u(_)),f=Yw(n),p=h.useRef(!1),m=h.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:v,focusSelectedItem:x}=s,w=h.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&g&&y&&v){const _=i.trigger.getBoundingClientRect(),P=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(i.dir!=="rtl"){const Pe=A.left-P.left,Ge=M.left-Pe,Tn=_.left-Ge,zn=_.width+Tn,xn=Math.max(zn,P.width),Gi=window.innerWidth-bi,pa=rx(Ge,[bi,Gi-xn]);a.style.minWidth=zn+"px",a.style.left=pa+"px"}else{const Pe=P.right-A.right,Ge=window.innerWidth-M.right-Pe,Tn=window.innerWidth-_.right-Ge,zn=_.width+Tn,xn=Math.max(zn,P.width),Gi=window.innerWidth-bi,pa=rx(Ge,[bi,Gi-xn]);a.style.minWidth=zn+"px",a.style.right=pa+"px"}const I=f(),L=window.innerHeight-bi*2,re=g.scrollHeight,V=window.getComputedStyle(c),K=parseInt(V.borderTopWidth,10),C=parseInt(V.paddingTop,10),T=parseInt(V.borderBottomWidth,10),O=parseInt(V.paddingBottom,10),R=K+C+re+O+T,N=Math.min(y.offsetHeight*5,R),j=window.getComputedStyle(g),G=parseInt(j.paddingTop,10),xe=parseInt(j.paddingBottom,10),ue=_.top+_.height/2-bi,je=L-ue,Ce=y.offsetHeight/2,J=y.offsetTop+Ce,tt=K+C+J,nt=R-tt;if(tt<=ue){const Pe=y===I[I.length-1].ref.current;a.style.bottom="0px";const Ge=c.clientHeight-g.offsetTop-g.offsetHeight,Tn=Math.max(je,Ce+(Pe?xe:0)+Ge+T),zn=tt+Tn;a.style.height=zn+"px"}else{const Pe=y===I[0].ref.current;a.style.top="0px";const Tn=Math.max(ue,K+g.offsetTop+(Pe?G:0)+Ce)+nt;a.style.height=Tn+"px",g.scrollTop=tt-ue+g.offsetTop}a.style.margin=`${bi}px 0`,a.style.minHeight=N+"px",a.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,i.trigger,i.valueNode,a,c,g,y,v,i.dir,r]);Pr(()=>w(),[w]);const[k,E]=h.useState();Pr(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const S=h.useCallback(_=>{_&&m.current===!0&&(w(),x==null||x(),m.current=!1)},[w,x]);return h.createElement(_ie,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:S},h.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k}},h.createElement($e.div,B({},o,{ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),VC=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=bi,...i}=e,s=Xw(n);return h.createElement(jw,B({},s,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[_ie,Cie]=vu(eu,{}),HC="SelectViewport",Oie=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_v(HC,n),i=Cie(HC,n),s=qe(t,o.onViewportChange),a=h.useRef(0);return h.createElement(h.Fragment,null,h.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),h.createElement(Ev.Slot,{scope:n},h.createElement($e.div,B({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:ae(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:d}=i;if(d!=null&&d.current&&u){const f=Math.abs(a.current-c.scrollTop);if(f>0){const p=window.innerHeight-bi*2,m=parseFloat(u.style.minHeight),g=parseFloat(u.style.height),y=Math.max(m,g);if(y<p){const v=y+f,x=Math.min(p,v),w=v-x;u.style.height=x+"px",u.style.bottom==="0px"&&(c.scrollTop=w>0?w:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),Tie="SelectGroup",[Xle,Pie]=vu(Tie),Mie="SelectLabel",Rie=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pie(Mie,n);return h.createElement($e.div,B({id:o.id},r,{ref:t}))}),mb="SelectItem",[Nie,IA]=vu(mb),$ie=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Cl(mb,n),l=_v(mb,n),c=a.value===r,[u,d]=h.useState(i??""),[f,p]=h.useState(!1),m=qe(t,v=>{var x;return(x=l.itemRefCallback)===null||x===void 0?void 0:x.call(l,v,r,o)}),g=Po(),y=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.createElement(Nie,{scope:n,value:r,disabled:o,textId:g,isSelected:c,onItemTextChange:h.useCallback(v=>{d(x=>{var w;return x||((w=v==null?void 0:v.textContent)!==null&&w!==void 0?w:"").trim()})},[])},h.createElement(Ev.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},h.createElement($e.div,B({role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:m,onFocus:ae(s.onFocus,()=>p(!0)),onBlur:ae(s.onBlur,()=>p(!1)),onPointerUp:ae(s.onPointerUp,y),onPointerMove:ae(s.onPointerMove,v=>{if(o){var x;(x=l.onItemLeave)===null||x===void 0||x.call(l)}else v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ae(s.onPointerLeave,v=>{if(v.currentTarget===document.activeElement){var x;(x=l.onItemLeave)===null||x===void 0||x.call(l)}}),onKeyDown:ae(s.onKeyDown,v=>{var x;((x=l.searchRef)===null||x===void 0?void 0:x.current)!==""&&v.key===" "||(uie.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})}))))}),eh="SelectItemText",Aie=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Cl(eh,n),a=_v(eh,n),l=IA(eh,n),c=hie(eh,n),[u,d]=h.useState(null),f=qe(t,v=>d(v),l.onItemTextChange,v=>{var x;return(x=a.itemTextRefCallback)===null||x===void 0?void 0:x.call(a,v,l.value,l.disabled)}),p=u==null?void 0:u.textContent,m=h.useMemo(()=>h.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=c;return Pr(()=>(g(m),()=>y(m)),[g,y,m]),h.createElement(h.Fragment,null,h.createElement($e.span,B({id:l.textId},i,{ref:f})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?$r.createPortal(i.children,s.valueNode):null)}),Die="SelectItemIndicator",Iie=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return IA(Die,n).isSelected?h.createElement($e.span,B({"aria-hidden":!0},r,{ref:t})):null}),Lie=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.createElement($e.div,B({"aria-hidden":!0},r,{ref:t}))});function LA(e){return e===""||e===void 0}const jA=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=h.useRef(null),i=qe(t,o),s=AA(n);return h.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),h.createElement(lie,{asChild:!0},h.createElement("select",B({},r,{ref:i,defaultValue:n})))});jA.displayName="BubbleSelect";function zA(e){const t=pn(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function FA(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=jie(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function jie(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const zie=mie,BA=vie,Fie=xie,Bie=bie,Uie=wie,UA=Sie,Vie=Oie,VA=Rie,HA=$ie,Hie=Aie,Wie=Iie,WA=Lie,Kie=zie,qie=Fie,KA=h.forwardRef(({className:e,children:t,...n},r)=>b.jsxs(BA,{ref:r,className:Ue("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[t,b.jsx(Bie,{asChild:!0,children:b.jsx(Mg,{className:"w-4 h-4 opacity-50"})})]}));KA.displayName=BA.displayName;const qA=h.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>b.jsx(Uie,{children:b.jsx(UA,{ref:o,className:Ue("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:b.jsx(Vie,{className:Ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));qA.displayName=UA.displayName;const Gie=h.forwardRef(({className:e,...t},n)=>b.jsx(VA,{ref:n,className:Ue("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Gie.displayName=VA.displayName;const GA=h.forwardRef(({className:e,children:t,...n},r)=>b.jsxs(HA,{ref:r,className:Ue("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(Wie,{children:b.jsx(k1,{className:"w-4 h-4"})})}),b.jsx(Hie,{children:t})]}));GA.displayName=HA.displayName;const Yie=h.forwardRef(({className:e,...t},n)=>b.jsx(WA,{ref:n,className:Ue("-mx-1 my-1 h-px bg-muted",e),...t}));Yie.displayName=WA.displayName;const YA="Switch",[Xie,Zle]=to(YA),[Zie,Jie]=Xie(YA),Qie=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[d,f]=h.useState(null),p=qe(t,x=>f(x)),m=h.useRef(!1),g=d?!!d.closest("form"):!0,[y=!1,v]=ei({prop:o,defaultProp:i,onChange:c});return h.createElement(Zie,{scope:n,checked:y,disabled:a},h.createElement($e.button,B({type:"button",role:"switch","aria-checked":y,"aria-required":s,"data-state":ZA(y),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onClick:ae(e.onClick,x=>{v(w=>!w),g&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})),g&&h.createElement(tse,{control:d,bubbles:!m.current,name:r,value:l,checked:y,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),ese="SwitchThumb",XA=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Jie(ese,n);return h.createElement($e.span,B({"data-state":ZA(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),tse=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=h.useRef(null),s=AA(n),a=$$(t);return h.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[s,n,r]),h.createElement("input",B({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ZA(e){return e?"checked":"unchecked"}const Zw=Qie,nse=XA,JA=h.forwardRef(({className:e,...t},n)=>b.jsx(Zw,{className:Ue("peer inline-flex h-[22px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=unchecked]:bg-primary",e),...t,ref:n,children:b.jsx(nse,{className:Ue("pointer-events-none block h-[18px] w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));JA.displayName=Zw.displayName;const QA="Dialog",[eD,Jle]=to(QA),[rse,Lo]=eD(QA),ose=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=h.useRef(null),l=h.useRef(null),[c=!1,u]=ei({prop:r,defaultProp:o,onChange:i});return h.createElement(rse,{scope:t,triggerRef:a,contentRef:l,contentId:Po(),titleId:Po(),descriptionId:Po(),open:c,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(d=>!d),[u]),modal:s},n)},ise="DialogTrigger",sse=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Lo(ise,n),i=qe(t,o.triggerRef);return h.createElement($e.button,B({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Jw(o.open)},r,{ref:i,onClick:ae(e.onClick,o.onOpenToggle)}))}),tD="DialogPortal",[ase,nD]=eD(tD,{forceMount:void 0}),lse=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Lo(tD,t);return h.createElement(ase,{scope:t,forceMount:n},h.Children.map(r,s=>h.createElement(er,{present:n||i.open},h.createElement(yv,{asChild:!0,container:o},s))))},gb="DialogOverlay",cse=h.forwardRef((e,t)=>{const n=nD(gb,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Lo(gb,e.__scopeDialog);return i.modal?h.createElement(er,{present:r||i.open},h.createElement(use,B({},o,{ref:t}))):null}),use=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Lo(gb,n);return h.createElement(bv,{as:Di,allowPinchZoom:!0,shards:[o.contentRef]},h.createElement($e.div,B({"data-state":Jw(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Bf="DialogContent",dse=h.forwardRef((e,t)=>{const n=nD(Bf,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Lo(Bf,e.__scopeDialog);return h.createElement(er,{present:r||i.open},i.modal?h.createElement(fse,B({},o,{ref:t})):h.createElement(pse,B({},o,{ref:t})))}),fse=h.forwardRef((e,t)=>{const n=Lo(Bf,e.__scopeDialog),r=h.useRef(null),o=qe(t,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return hv(i)},[]),h.createElement(rD,B({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:ae(e.onFocusOutside,i=>i.preventDefault())}))}),pse=h.forwardRef((e,t)=>{const n=Lo(Bf,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return h.createElement(rD,B({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),rD=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Lo(Bf,n),l=h.useRef(null),c=qe(t,l);return gv(),h.createElement(h.Fragment,null,h.createElement(vv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},h.createElement(mv,B({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Jw(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),hse="DialogTitle",mse=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Lo(hse,n);return h.createElement($e.h2,B({id:o.titleId},r,{ref:t}))}),gse="DialogDescription",vse=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Lo(gse,n);return h.createElement($e.p,B({id:o.descriptionId},r,{ref:t}))}),yse="DialogClose",xse=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Lo(yse,n);return h.createElement($e.button,B({type:"button"},r,{ref:t,onClick:ae(e.onClick,()=>o.onOpenChange(!1))}))});function Jw(e){return e?"open":"closed"}const bse=ose,wse=sse,Sse=lse,oD=cse,iD=dse,sD=mse,aD=vse,lD=xse,kse=bse,Ese=wse,_se=Sse,WC=lD,cD=h.forwardRef(({className:e,...t},n)=>b.jsx(oD,{ref:n,className:Ue("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));cD.displayName=oD.displayName;const uD=h.forwardRef(({className:e,children:t,...n},r)=>b.jsxs(_se,{children:[b.jsx(cD,{}),b.jsxs(iD,{ref:r,className:Ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...n,children:[t,b.jsxs(lD,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[b.jsx(Rg,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));uD.displayName=iD.displayName;const dD=({className:e,...t})=>b.jsx("div",{className:Ue("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});dD.displayName="DialogHeader";const fD=({className:e,...t})=>b.jsx("div",{className:Ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});fD.displayName="DialogFooter";const pD=h.forwardRef(({className:e,...t},n)=>b.jsx(sD,{ref:n,className:Ue("text-lg font-semibold leading-none tracking-tight",e),...t}));pD.displayName=sD.displayName;const Cse=h.forwardRef(({className:e,...t},n)=>b.jsx(aD,{ref:n,className:Ue("text-sm text-muted-foreground",e),...t}));Cse.displayName=aD.displayName;function Cv({path:e,source:t,schema:n,setSelectedPath:r,field:o,initOnSubmit:i,top:s}){if(n.opt)return b.jsx(Rse,{path:e,source:t,schema:n,field:o,initOnSubmit:i,setSelectedPath:r});if(t===null)return b.jsx(gD,{source:t,schema:n,path:e,setSelectedPath:r,initOnSubmit:i});if(n.type==="object")return typeof t!="object"||hc(t)?b.jsxs("div",{children:["ERROR: expected object, but found ",typeof t]}):b.jsxs("div",{children:[o?b.jsx("div",{className:"text-left",children:o}):b.jsx("div",{className:"truncate max-w-[300px] text-left",title:e,dir:"rtl",children:b.jsx(qr,{children:e})}),b.jsx(hD,{source:t,path:e,schema:n,initOnSubmit:i,setSelectedPath:r,top:s})]});if(n.type==="array")return typeof t!="object"||!hc(t)?b.jsxs("div",{children:["ERROR: expected array, but found ",typeof t]}):b.jsxs("div",{children:[o?b.jsx("div",{className:"text-left",children:o}):b.jsx("div",{className:"truncate max-w-[300px] text-left",title:e,dir:"rtl",children:b.jsx(qr,{children:e})}),b.jsx(mD,{source:t,path:e,schema:n,initOnSubmit:i,setSelectedPath:r})]});if(n.type==="record")return typeof t!="object"?b.jsxs("div",{children:["ERROR: expected object for ",n.type,", but found ",typeof t]}):hc(t)?b.jsxs("div",{children:["ERROR: did not expect array for ",n.type]}):b.jsxs("div",{children:[o?b.jsx("div",{className:"text-left",children:o}):b.jsx("div",{className:"truncate max-w-[300px] text-left",title:e,dir:"rtl",children:b.jsx(qr,{children:e})}),b.jsx(Tse,{source:t,path:e,schema:n,setSelectedPath:r})]});if((n==null?void 0:n.type)==="union"){if(typeof n.key=="string"&&typeof t=="object"&&!hc(t))return b.jsx(Ose,{field:o,tag:n.key,source:t,path:e,schema:n,initOnSubmit:i,setSelectedPath:r,top:s})}else if((n==null?void 0:n.type)==="literal")return b.jsx(b.Fragment,{});return b.jsxs("div",{className:"py-2 gap-y-4",children:[o?b.jsx("div",{className:"text-left",children:o}):b.jsx("div",{className:"truncate max-w-[300px] text-left",title:e,dir:"rtl",children:b.jsx(qr,{children:e})}),b.jsx(RA,{path:e,disabled:!1,source:t,schema:n,onSubmit:i(e)})]})}function Ose({tag:e,field:t,path:n,source:r,schema:o,setSelectedPath:i,initOnSubmit:s,top:a}){const[l,c]=h.useState(null),[u,d]=h.useState(null),f=o.items.flatMap(g=>{if(g.type==="object"&&g.items[e]){const y=g.items[e];if(y.type==="literal")return[y.value]}return[]});h.useEffect(()=>{if(l){const g=r[e],y=o.items.find(v=>{if(v.type==="object"&&v.items[e]){const x=v.items[e];return x.type==="literal"?x.value===l:!1}});g&&typeof g=="string"&&y?d({source:r,schema:y}):y?d({schema:y}):(console.error("Could not find source or schema of key",l,r,o),d(null))}else{const g=r==null?void 0:r[e];g&&typeof g=="string"&&c(g)}},[l,r,e,o,f]),f.length!==o.items.length&&console.warn("Not all items have tag:",e);const p=!1,m=s(n);return b.jsxs(_l,{className:Qt("flex flex-col gap-y-4",{"border-l-2 border-border pl-6":!a}),children:[t?b.jsx("div",{className:"text-left",children:t}):b.jsx("div",{className:"truncate max-w-[300px] text-left",title:n,dir:"rtl",children:b.jsx(qr,{children:n})}),b.jsxs(Kie,{value:l??void 0,disabled:p,onValueChange:g=>{c(g)},children:[b.jsx(KA,{children:b.jsx(qie,{placeholder:"Select type"})}),b.jsx(qA,{children:f.map(g=>b.jsx(GA,{value:g.toString(),children:g.toString()},g))})]}),b.jsx(gu,{loading:p,enabled:!1,onClick:()=>m(async()=>[])}),u&&b.jsx(Cv,{path:n,source:u.source??null,schema:u.schema,setSelectedPath:i,initOnSubmit:s,top:a})]},n)}function hD({path:e,source:t,schema:n,setSelectedPath:r,initOnSubmit:o,top:i}){return b.jsx("div",{className:Qt("flex flex-col gap-y-1",{"border-l-2 border-border pl-6":!i}),children:Object.entries(n.items).map(([s,a])=>{const l=tu(e,s);return b.jsx(Cv,{path:l,source:(t==null?void 0:t[s])??null,schema:a,setSelectedPath:r,field:s,initOnSubmit:o},l)})},e)}function Tse({path:e,source:t,schema:n,setSelectedPath:r}){const o=O1();return b.jsx("div",{className:"flex flex-col gap-4 p-2",children:Object.entries(t).map(([i,s])=>{const a=tu(e,i);return b.jsx("button",{onClick:()=>{r(a),o(a)},children:b.jsx(Pse,{recordKey:i,path:a,source:s,schema:n.item})},a)})},e)}const vb=170;function Pse({recordKey:e,path:t,source:n,schema:r}){const o=te.useRef(null),[i,s]=h.useState(!1);return h.useEffect(()=>{o.current&&o.current.getBoundingClientRect().height>=vb&&s(!0)},[]),b.jsxs(Gw,{ref:o,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:vb},children:[b.jsx("div",{className:"pb-4 font-serif text-left text-accent",children:e}),b.jsx("div",{className:"text-xs",children:b.jsx(Qw,{path:t,source:n,schema:r})}),i&&b.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]},t)}function mD({path:e,source:t,schema:n,setSelectedPath:r,initOnSubmit:o}){const i=o(e),[,s]=ot.splitModuleIdAndModulePath(e);return b.jsxs(_l,{className:"flex flex-col gap-4 p-2 pb-8",children:[b.jsx("button",{onClick:()=>{i(async()=>{const a=[];return t===null&&a.push({op:"replace",path:ot.createPatchPath(s),value:[]}),a.push({op:"add",path:ot.createPatchPath(tu(s,t.length)),value:Uf(n.item)}),a})},children:b.jsx(nj,{})}),t.map((a,l)=>{const c=tu(e,l),u=o(c);return b.jsx(Mse,{index:l,path:c,source:a,loading:!1,schema:n.item,onDelete:()=>{u(async d=>d.length>0?[{op:"remove",path:d}]:(console.error("Cannot delete a root element"),[]))},setSelectedPath:r},c)})]},e)}const KC=vb;function Mse({index:e,path:t,source:n,schema:r,loading:o,setSelectedPath:i,onDelete:s}){const a=O1(),l=te.useRef(null),[c,u]=h.useState(!1);return h.useEffect(()=>{l.current&&l.current.getBoundingClientRect().height>=KC&&u(!0)},[]),b.jsxs(Gw,{ref:l,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:KC},children:[b.jsx("button",{className:"block",disabled:o,onClick:s,children:o?b.jsx(rj,{className:"animate-spin"}):b.jsx(uP,{})}),b.jsxs("button",{className:"block",disabled:o,onClick:()=>{i(t),a(t)},children:[b.jsx("div",{className:"pb-4 font-serif text-left uppercase text-accent",children:e+1<10?`0${e+1}`:e+1}),b.jsx("div",{className:"text-xs",children:b.jsx(Qw,{path:t,source:n,schema:r})}),c&&b.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]})]})}function tu(e,t){const n=ot.createValPathOfItem(e,t);if(!n)throw Error(`Could not create val path: ${e} of ${t==null?void 0:t.toString()}`);return n}function Qw({path:e,source:t,schema:n}){var s;const[r,o]=h.useState(null),i=(s=Dse())==null?void 0:s.hoverElem;if(n.type==="object")return b.jsx("div",{className:"grid grid-cols-[min-content_1fr] gap-2 text-left",children:Object.entries(n.items).map(([a])=>b.jsxs(h.Fragment,{children:[b.jsxs("span",{className:"text-muted",children:[a,":"]}),b.jsx("span",{children:b.jsx(Qw,{source:(t==null?void 0:t[a])??null,schema:n.items[a],path:tu(e,a)})})]},tu(e,a)))},e);if(n.type==="array")return t===null?b.jsx("span",{className:"text-accent",children:"Empty"},e):Array.isArray(t)?b.jsxs("span",{children:[b.jsx("span",{className:"text-accent",children:t.length}),b.jsx("span",{children:t.length===1?" item":" items"})]},e):b.jsx("span",{className:"px-2 bg-destructive text-destructive-foreground",children:"Unknown length"},e);if(n.type==="richtext")return t===null?b.jsx("span",{className:"text-accent",children:"Empty"},e):typeof t!="object"?b.jsxs("div",{className:"p-4 text-destructive-foreground bg-destructive",children:["ERROR: ",typeof t," not an object"]},e):!(mn in t)||t[mn]!=="richtext"?b.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not richtext"},e):b.jsx(Ase,{children:yM(t)},e);if(n.type==="string")return t===null?b.jsx("span",{className:"text-accent",children:"Empty"},e):b.jsx("span",{children:t});if(n.type==="image"){if(t===null)return b.jsx("span",{className:"text-accent",children:"Empty"},e);if(typeof t!="object")return b.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: not an object"},e);if(!(Cn in t)||typeof t[Cn]!="string")return b.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not an image"},e);const a=ot.convertFileSource(t).url;return b.jsxs("span",{onMouseOver:l=>{o({x:l.clientX,y:l.clientY})},onMouseLeave:()=>{o(null)},className:"relative flex items-center justify-start gap-1",children:[b.jsx("a",{href:a,className:"overflow-hidden underline truncate ",children:t[Cn]}),r&&i&&$r.createPortal(b.jsx("img",{className:"absolute z-[5] max-w-[10vw]",style:{left:r.x+10,top:r.y+10},src:a}),i)]},e)}else{if(n.type==="boolean")return t===null?b.jsx("span",{className:"text-accent",children:"Empty"},e):b.jsx("span",{className:"text-accent",children:t?"true":"false"},e);if(n.type==="number")return t===null?b.jsx("span",{className:"text-accent",children:"Empty"},e):b.jsx("span",{className:"text-accent",children:t.toString()});if(n.type==="keyOf")return t===null?b.jsx("span",{className:"text-accent",children:"Empty"},e):b.jsx("span",{className:"text-accent",children:t.toString()},e)}return b.jsxs("div",{children:["TODO: ",n.type]},e)}function Rse({path:e,source:t,schema:n,setSelectedPath:r,initOnSubmit:o,field:i}){const[s,a]=h.useState(t!==null),{editMode:l}=Ng(),c=o(e),[u,d]=h.useState(!1);return b.jsxs("div",{className:"flex flex-col gap-y-2",children:[b.jsxs("div",{className:"relative flex items-center justify-start gap-x-4",children:[l==="full"&&!s&&b.jsx(JA,{disabled:u,checked:s,onClick:()=>{a(f=>!f)}}),l==="full"&&s&&b.jsxs(kse,{children:[b.jsx(Ese,{children:b.jsx(uP,{})}),b.jsx(uD,{children:b.jsxs(dD,{children:[b.jsx(pD,{children:"About to delete. Are you sure?"}),b.jsxs(fD,{className:"sm:justify-start",children:[b.jsx(WC,{asChild:!0,children:b.jsx(Bc,{type:"button",variant:"secondary",onClick:async()=>{d(!0),a(!1);const[,f]=ot.splitModuleIdAndModulePath(e);c(async()=>[{op:"replace",path:ot.createPatchPath(f),value:null}]).catch(p=>{console.error(p),a(!0)}).finally(()=>{d(!1)})},children:"Yes"})}),b.jsx(WC,{asChild:!0,children:b.jsx(Bc,{type:"button",children:"Cancel"})})]})]})})]}),b.jsx("div",{className:"truncate max-w-[300px] text-left",title:e,dir:"rtl",children:i||b.jsx(qr,{children:e})})]}),s&&b.jsx(gD,{source:t===null?Uf(n):t,schema:n,path:e,setSelectedPath:r,initOnSubmit:f=>async p=>{const[,m]=ot.splitModuleIdAndModulePath(e),[,g]=ot.splitModuleIdAndModulePath(f),y=await p(ot.createPatchPath(g));c(async()=>t===null?[{op:"replace",path:ot.createPatchPath(m),value:Uf(n)}].concat(y):y)}})]},e)}function Uf(e){if(e.type==="object")return Object.fromEntries(Object.keys(e.items).map(n=>[n,Uf(e.items[n])]));if(e.type==="array")return[];if(e.type==="record")return{};if(e.opt)return null;if(e.type==="richtext")return{[mn]:"richtext",templateStrings:[""],exprs:[]};if(e.type==="string")return"";if(e.type==="boolean")return!1;if(e.type==="number")return 0;if(e.type==="keyOf")return e.values==="number"?0:e.values==="string"?"":e.values[0];if(e.type==="file")return{_ref:"/public/",_type:"file",metadata:{sha256:""}};if(e.type==="image")return{_ref:"/public/",_type:"file",metadata:{height:0,width:0,mimeType:"application/octet-stream",sha256:""}};if(e.type==="literal")return e.value;if(e.type==="union")return Uf(e.items[0]);throw Error("Unexpected schema type: "+JSON.stringify(e))}function gD({source:e,path:t,schema:n,setSelectedPath:r,initOnSubmit:o}){if(n.type==="array"){if(typeof e=="object"&&(e===null||hc(e)))return b.jsx(mD,{initOnSubmit:o,source:e===null?[]:e,path:t,schema:n,setSelectedPath:r})}else if(n.type==="object"){if(typeof e=="object"&&(e===null||!hc(e)))return b.jsx(hD,{source:e,path:t,schema:n,setSelectedPath:r,initOnSubmit:o})}else if(n.type==="richtext"||n.type==="string"||n.type==="image"||n.type==="number"||n.type==="keyOf")return b.jsx(RA,{path:t,disabled:!1,source:e,schema:n,onSubmit:o(t)},t);return b.jsxs("div",{className:"p-4 bg-destructive text-destructive-foreground",children:["ERROR: unexpected source type ",typeof e," for schema type"," ",n.type]})}function hc(e){return Array.isArray(e)}function Nse(e){const t={};return e.forEach(n=>{const r=n.split("/").filter(o=>o!=="");if(r.length===1)t[""]||(t[""]=[]),t[""].push(r[0]);else if(r.length>1){const o=r.slice(0,r.length-1).join("/"),i=r.slice(-1)[0];t[o]||(t[o]=[]),t[o].push(i)}}),t}function $se({selectedPath:e,paths:t,setSelectedModuleId:n}){const r=Nse(t),o=e&&ot.splitModuleIdAndModulePath(e)[0];return b.jsx("div",{className:"flex flex-col w-full py-2 text-xs",children:Object.entries(r).map(([i,s])=>b.jsxs("div",{className:"px-4 py-2",children:[i&&b.jsx("div",{className:"font-bold truncate max-w-[300px] text-left",title:i,children:b.jsx(qr,{children:i})}),b.jsx("div",{className:Qt({"flex flex-col py-2 justify-start items-start":!!i}),children:s.map(a=>{const l=`/${i}/${a}`;return b.jsx("button",{className:Qt("block px-2 py-1 rounded-full",{"bg-accent text-accent-foreground":o===l}),onClick:()=>{n(l)},children:a},l)})})]},`/${i}`))})}const qC={tags:{h1:"font-bold",h2:"font-bold",h3:"font-bold",h4:"font-bold",h5:"font-bold",h6:"font-bold",p:""},classes:{bold:"font-bold",italic:"italic",lineThrough:"line-through"}};function Ase({children:e}){const t=e;function n(i,s){const a=qC.tags[i];return a&&s?[s,a].join(" "):a||s}function r(i,s){const a=qC.classes[i];return a&&s?[s,a].join(" "):a||s}function o(i,s){var c,u;if(typeof i=="string")return i;if(i.tag==="p")return b.jsx("p",{className:n("p"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="img")return b.jsx("img",{className:n("img"),src:i.src},s);if(i.tag==="ul")return b.jsx("ul",{className:n("ul"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="ol")return b.jsx("ol",{className:n("ol"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="li")return b.jsx("li",{className:n("li"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="span")return b.jsx("span",{className:i.classes.map(d=>{switch(d){case"bold":return r("bold");case"line-through":return r("lineThrough");case"italic":return r("italic")}}).join(" "),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h1")return b.jsx("h1",{className:n("h1"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h2")return b.jsx("h2",{className:n("h2"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h3")return b.jsx("h3",{className:n("h3"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h4")return b.jsx("h4",{className:n("h4"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h5")return b.jsx("h5",{className:n("h5"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h6")return b.jsx("h6",{className:n("h6"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="br")return b.jsx("br",{},s);if(i.tag==="a")return b.jsx("a",{href:i.href,children:i.children.map((d,f)=>o(d,f))},s);console.error("Unknown tag",i.tag);const l=i.tag;return l!=null&&l.tag?te.createElement(l.tag,{key:s,className:(c=l.class)==null?void 0:c.join(" "),children:(u=l.children)==null?void 0:u.map(o)}):null}return b.jsx("span",{"data-val-path":t.valPath,children:t.children.map((i,s)=>o(i,s))})}const vD=te.createContext({hoverElem:null}),Dse=()=>te.useContext(vD),Ise=({api:e,store:t})=>{const{"*":n}=t6(),[r,o]=h.useState(null),[i,s]=h.useState(),[a,l]=h.useState();h.useEffect(()=>{s(n?`/${n}`:i)},[n]),h.useEffect(()=>{t.reset().then(E=>{St.isOk(E)?l(E.value):o(E.error.message)})},[]);const c=FP(e),u=O1(),[d,f]=MP(),{patches:p,setPatchResetId:m}=RP(c,e),g=te.useRef(null),y=h.useCallback(E=>async S=>{const[_,P]=ot.splitModuleIdAndModulePath(E),M=await S(ot.createPatchPath(P));t.applyPatch(_,M),m(A=>A+1)},[]),[v,x]=h.useState(!1),[w,k]=h.useState();return h.useEffect(()=>{let E=!1;return x(!0),e.postValidate({patches:p}).then(S=>{E||(St.isOk(S)?k({globalError:null,validationErrors:S.value}):k({globalError:{message:"Could not validate changes: check if Val is correctly setup.",details:S.error}}),x(!1))}).catch(S=>{E||(k({globalError:{message:"Could not validate changes: check the internet connection.",details:S}}),x(!1))}),()=>{E=!0}},[p]),b.jsx(E1.Provider,{value:{theme:d,setTheme:f,editMode:"full",session:c,setEditMode:()=>{},setWindowSize:()=>{}},children:b.jsxs("div",{id:"val-fullscreen-container",className:"relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary","data-mode":d,children:[b.jsx("div",{id:"val-fullscreen-hover",ref:g}),b.jsx(vD.Provider,{value:{hoverElem:g==null?void 0:g.current},children:b.jsx("div",{className:"text-primary",children:b.jsxs(Td,{children:[b.jsx("div",{className:"px-4 h-[50px] flex items-center justify-center",children:b.jsx(dP,{})}),b.jsx(Sc,{className:"px-4",children:a?b.jsx($se,{selectedPath:i,paths:a,setSelectedModuleId:E=>{u(E)}}):!r&&b.jsx("div",{className:"py-4",children:"Loading..."})}),b.jsxs("div",{className:"flex items-center justify-start h-[50px] gap-2 font-serif text-xs",children:[b.jsx("button",{onClick:()=>{history.back()},children:b.jsx(z4,{})}),b.jsx("div",{className:"truncate max-w-[300px] text-left",dir:"rtl",title:i,children:b.jsx(qr,{children:i||"/"})})]}),b.jsx(Lse,{path:i,error:r,initOnSubmit:y,session:c,setSelectedPath:s,api:e,store:t}),b.jsxs("div",{className:"w-full flex items-center justify-end h-[50px] gap-2 font-serif text-xs px-6",children:[b.jsx("button",{className:"px-4 py-2 border rounded border-border",children:b.jsx(lP,{size:14})}),b.jsx("button",{className:"px-4 py-2 border rounded border-border",children:b.jsx(K4,{size:14})}),b.jsx("button",{className:"px-4 py-2 border rounded border-border bg-border",children:b.jsx(cP,{size:14})})]}),b.jsx(iM,{patches:p,isValidating:v,validationResponse:w,api:e,onCommit:()=>{m(E=>E+1)}})]})})})]})})};function Lse({path:e,api:t,store:n,error:r,session:o,setSelectedPath:i,initOnSubmit:s}){var m;const[a,l]=h.useState(!1),[c,u]=h.useState(),[d,f]=h.useState(null),[p]=e?ot.splitModuleIdAndModulePath(e):[void 0,void 0];return h.useEffect(()=>{let g=!1;return p?(f(null),l(!0),n.getModule(p).then(y=>{g||o.status==="success"&&o.data.enabled&&(St.isOk(y)?f(y.value):u(y.error.message))}).finally(()=>{g||l(!1)})):f(null),()=>{g=!0}},[p,e,o]),b.jsxs("div",{className:"p-4",children:[(r||c)&&b.jsxs("div",{className:"max-w-xl p-4 text-lg bg-destructive text-destructive-foreground",children:["ERROR: ",r||c]}),o.status==="success"&&o.data.mode==="unauthorized"&&b.jsx("div",{className:"max-w-xl p-4 text-lg bg-destructive text-destructive-foreground",children:"Not authorized"}),o.status==="success"&&!o.data.enabled&&b.jsxs("div",{className:"max-w-xl p-4 text-lg",children:[b.jsx("div",{children:"Val is currently not enabled"}),b.jsx("a",{href:t.getEnableUrl(((m=window==null?void 0:window.location)==null?void 0:m.href)||"/val"),children:"Enable Val"})]}),a&&b.jsx("div",{className:"flex place-content-center",children:"Loading..."}),d&&e&&b.jsx(jse,{path:e,source:d.source,schema:d.schema,setSelectedPath:i,initOnSubmit:s})]})}function jse({path:e,source:t,schema:n,setSelectedPath:r,initOnSubmit:o}){const[,i]=ot.splitModuleIdAndModulePath(e),s=ot.resolvePath(i,t,n);if(!s)throw Error("Could not resolve module: "+e);return b.jsx(Cv,{path:e,source:s.source,schema:s.schema,setSelectedPath:r,initOnSubmit:o,top:!0})}const zse=h.createContext(null),Zy={didCatch:!1,error:null};class yD extends h.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Zy}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(Zy)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&Fse(t.resetKeys,o)){var i,s;(i=(s=this.props).onReset)===null||i===void 0||i.call(s,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Zy)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=h.createElement(r,l);else if(o===null||h.isValidElement(o))a=o;else throw s}return h.createElement(zse.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Fse(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}/**
|
|
229
|
+
* React Router DOM v6.21.2
|
|
230
|
+
*
|
|
231
|
+
* Copyright (c) Remix Software Inc.
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the MIT license found in the
|
|
234
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
235
|
+
*
|
|
236
|
+
* @license MIT
|
|
237
|
+
*/function ig(){return ig=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ig.apply(this,arguments)}function Bse(e,t){return Bj({basename:t==null?void 0:t.basename,future:ig({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:cj({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Use(),routes:e,mapRouteProperties:m6,window:t==null?void 0:t.window}).initialize()}function Use(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ig({},t,{errors:Vse(t.errors)})),t}function Vse(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new _1(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let s=new i(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const Hse=h.createContext({isTransitioning:!1}),Wse=h.createContext(new Map),Kse="startTransition",GC=yO[Kse],qse="flushSync",YC=SL[qse];function Gse(e){GC?GC(e):e()}function Bu(e){YC?YC(e):e()}class Yse{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Xse(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=h.useState(n.state),[s,a]=h.useState(),[l,c]=h.useState({isTransitioning:!1}),[u,d]=h.useState(),[f,p]=h.useState(),[m,g]=h.useState(),y=h.useRef(new Map),{v7_startTransition:v}=r||{},x=h.useCallback(_=>{v?Gse(_):_()},[v]),w=h.useCallback((_,P)=>{let{deletedFetchers:M,unstable_flushSync:A,unstable_viewTransitionOpts:I}=P;M.forEach(re=>y.current.delete(re)),_.fetchers.forEach((re,V)=>{re.data!==void 0&&y.current.set(V,re.data)});let L=n.window==null||typeof n.window.document.startViewTransition!="function";if(!I||L){A?Bu(()=>i(_)):x(()=>i(_));return}if(A){Bu(()=>{f&&(u&&u.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let re=n.window.document.startViewTransition(()=>{Bu(()=>i(_))});re.finished.finally(()=>{Bu(()=>{d(void 0),p(void 0),a(void 0),c({isTransitioning:!1})})}),Bu(()=>p(re));return}f?(u&&u.resolve(),f.skipTransition(),g({state:_,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(a(_),c({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[n.window,f,u,y,x]);h.useLayoutEffect(()=>n.subscribe(w),[n,w]),h.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new Yse)},[l]),h.useEffect(()=>{if(u&&s&&n.window){let _=s,P=u.promise,M=n.window.document.startViewTransition(async()=>{x(()=>i(_)),await P});M.finished.finally(()=>{d(void 0),p(void 0),a(void 0),c({isTransitioning:!1})}),p(M)}},[x,s,u,n.window]),h.useEffect(()=>{u&&s&&o.location.key===s.location.key&&u.resolve()},[u,f,o.location,s]),h.useEffect(()=>{!l.isTransitioning&&m&&(a(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),g(void 0))},[l.isTransitioning,m]),h.useEffect(()=>{},[]);let k=h.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:_=>n.navigate(_),push:(_,P,M)=>n.navigate(_,{state:P,preventScrollReset:M==null?void 0:M.preventScrollReset}),replace:(_,P,M)=>n.navigate(_,{replace:!0,state:P,preventScrollReset:M==null?void 0:M.preventScrollReset})}),[n]),E=n.basename||"/",S=h.useMemo(()=>({router:n,navigator:k,static:!1,basename:E}),[n,k,E]);return h.createElement(h.Fragment,null,h.createElement($g.Provider,{value:S},h.createElement(EP.Provider,{value:o},h.createElement(Wse.Provider,{value:y.current},h.createElement(Hse.Provider,{value:l},h.createElement(h6,{basename:E,location:o.location,navigationType:o.historyAction,navigator:k,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?h.createElement(Zse,{routes:n.routes,future:n.future,state:o}):t))))),null)}function Zse(e){let{routes:t,future:n,state:r}=e;return n6(t,void 0,r,n)}var XC;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(XC||(XC={}));var ZC;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ZC||(ZC={}));function xD({error:e,resetErrorBoundary:t}){return console.error(e),b.jsx("div",{className:"absolute top-0 left-0 flex items-center justify-center w-screen h-screen bg-card-foreground",children:b.jsx("div",{className:"w-full h-full p-10",children:b.jsxs("div",{className:"w-full h-full p-10 bg-card text-primary",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-[0.5em] text-lg font-bold text-center py-2",children:[b.jsx(dP,{})," encountered an error"]}),b.jsx("button",{onClick:t,children:b.jsx(Rg,{})})]}),b.jsx("div",{className:"text-4xl font-normal ",children:"Message:"}),b.jsx("pre",{children:e.message}),e.stack&&b.jsx(Vg,{type:"single",className:"font-serif",collapsible:!0,defaultValue:"error",children:b.jsxs(JP,{value:"error",children:[b.jsx(QP,{children:"Stack trace:"}),b.jsx(tp,{className:"p-4 bg-popover text-popover-foreground",children:e.stack&&b.jsx("pre",{children:e.stack})})]})})]})})})}function Jse(){const e=new F2("/api/val"),t=Bse([{path:"/*",element:b.jsx(yD,{fallbackRender:xD,children:b.jsx(Ise,{api:e,store:new RM(e)})})}],{basename:"/val"});return b.jsx(Xse,{router:t})}function Qse({root:e,children:t}){return $r.createPortal(t,e)}const eae=({children:e,style:t})=>{const n=h.useRef(null),[r,o]=h.useState(null);return h.useLayoutEffect(()=>{if(n.current)if(n.current.shadowRoot)o(n.current.shadowRoot);else{const i=n.current.attachShadow({mode:"open"});o(i)}},[]),b.jsx("div",{ref:n,style:t,id:"val-shadow-root",children:r&&b.jsx(Qse,{root:r,children:e})})},tae="/spa/index.css",nae="val-app",rae="val-overlay",bD="Popover",[wD,Qle]=to(bD,[mu]),eS=mu(),[oae,yu]=wD(bD),iae=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=eS(t),l=h.useRef(null),[c,u]=h.useState(!1),[d=!1,f]=ei({prop:r,defaultProp:o,onChange:i});return h.createElement(Iw,a,h.createElement(oae,{scope:t,contentId:Po(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:h.useCallback(()=>u(!0),[]),onCustomAnchorRemove:h.useCallback(()=>u(!1),[]),modal:s},n))},sae="PopoverTrigger",aae=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=yu(sae,n),i=eS(n),s=qe(t,o.triggerRef),a=h.createElement($e.button,B({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ED(o.open)},r,{ref:s,onClick:ae(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:h.createElement(Lw,B({asChild:!0},i),a)}),SD="PopoverPortal",[lae,cae]=wD(SD,{forceMount:void 0}),uae=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=yu(SD,t);return h.createElement(lae,{scope:t,forceMount:n},h.createElement(er,{present:n||i.open},h.createElement(yv,{asChild:!0,container:o},r)))},Vf="PopoverContent",dae=h.forwardRef((e,t)=>{const n=cae(Vf,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=yu(Vf,e.__scopePopover);return h.createElement(er,{present:r||i.open},i.modal?h.createElement(fae,B({},o,{ref:t})):h.createElement(pae,B({},o,{ref:t})))}),fae=h.forwardRef((e,t)=>{const n=yu(Vf,e.__scopePopover),r=h.useRef(null),o=qe(t,r),i=h.useRef(!1);return h.useEffect(()=>{const s=r.current;if(s)return hv(s)},[]),h.createElement(bv,{as:Di,allowPinchZoom:!0},h.createElement(kD,B({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ae(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),pae=h.forwardRef((e,t)=>{const n=yu(Vf,e.__scopePopover),r=h.useRef(!1),o=h.useRef(!1);return h.createElement(kD,B({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),kD=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=yu(Vf,n),p=eS(n);return gv(),h.createElement(vv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},h.createElement(mv,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1)},h.createElement(jw,B({"data-state":ED(f.open),role:"dialog",id:f.contentId},p,d,{ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function ED(e){return e?"open":"closed"}const hae=iae,mae=aae,_D=uae,tS=dae,gae=hae,vae=mae,yae=h.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>b.jsx(_D,{children:b.jsx(tS,{ref:o,align:t,sideOffset:n,className:Ue("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));yae.displayName=tS.displayName;const nS="p-1 border rounded-full shadow border-accent",JC="valbuild:urlBeforeNavigation";function xae({api:e,patches:t,direction:n,onClickPatches:r}){const{theme:o,setTheme:i,editMode:s,setEditMode:a,session:l}=Ng();if(l.status==="success"&&l.data.mode==="unauthorized")return b.jsxs(QC,{direction:n,href:e.getLoginUrl(window.location.href),children:[b.jsx("span",{children:"Login"}),b.jsx(Wk,{size:18})]});if(l.status==="success"&&!l.data.enabled)return b.jsxs(QC,{direction:n,href:e.getEnableUrl(window.location.href),children:[b.jsx("span",{children:"Enable"}),b.jsx(Wk,{size:18})]});const[c,u]=h.useState();return h.useEffect(()=>{let d=0;for(const f in t)d+=t[f].length;u(d)},[t]),b.jsxs(CD,{direction:n,children:[b.jsx(Jy,{active:s==="hover"||s==="window",onClick:()=>{a(d=>d==="hover"||s==="window"?"off":"hover")},children:b.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:s==="hover"||s==="window"?b.jsx(ej,{size:18}):b.jsx(tj,{size:18})})}),b.jsx(Jy,{active:s==="full",onClick:()=>{if(s!=="full")localStorage.setItem(JC,window.location.href),window.location.href=e.getEditUrl();else if(s==="full"){const d=localStorage.getItem(JC);window.location.href=d||"/"}},children:b.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:s==="full"?b.jsx(lP,{size:15}):b.jsx(X4,{size:15})})}),c!==void 0&&b.jsx(Jy,{onClick:()=>{c>0&&r()},children:b.jsxs("div",{className:"relative h-[24px] w-[24px] flex justify-center items-center",children:[b.jsx("div",{className:"absolute -right-[10px] -top-[10px] border border-border rounded-full px-1 font-sans text-xs bg-card text-accent",children:c}),b.jsx(cP,{size:18})]})}),b.jsx(vae,{className:nS,children:b.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:b.jsx(Q4,{size:18})})}),b.jsx(tS,{align:"start",sideOffset:12,side:"right",className:"z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",children:b.jsxs("div",{className:"flex flex-col items-start justify-center p-4 gap-x-4",children:[b.jsx("div",{className:"flex items-end justify-end w-full",children:b.jsx("div",{className:"h-[34px] w-[34px] flex justify-center items-center",children:b.jsxs(Zw,{className:"relative peer inline-flex h-[24px] w-[34px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-800 data-[state=unchecked]:bg-slate-800",defaultChecked:o==="light",onClick:()=>{i(o==="dark"?"light":"dark")},children:[o==="dark"&&b.jsx(J4,{size:13,className:"absolute top-[4px] left-[17px] text-white"}),b.jsx(XA,{className:"pointer-events-none block h-[16px] w-[16px] rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-[15px] data-[state=unchecked]:translate-x-0"}),o==="light"&&b.jsx(ij,{size:13,className:"absolute top-[4px] left-[1px] text-white"})]})})}),b.jsx("div",{children:b.jsxs("a",{className:"flex items-center justify-center font-bold h-[34px] gap-x-1",href:e.getDisableUrl(window.location.href),children:[b.jsx("span",{children:"Disable"}),b.jsx(U4,{size:18})]})})]})})]})}function QC({href:e,direction:t,children:n}){return b.jsx(CD,{direction:t,border:!1,children:b.jsx("a",{className:nS,href:e,children:b.jsx("div",{className:"flex items-center justify-center px-2 gap-y-2",children:n})})})}function CD({children:e,direction:t,border:n=!0}){return b.jsx("div",{className:Qt("flex justify-center w-full h-full px-2 py-2 font-sans rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",{"flex-col items-start":t==="vertical","flex-row items-center":t==="horizontal"},{border:n}),children:e})}function Jy({active:e,onClick:t,children:n}){return b.jsx("button",{className:Qt(nS,{"bg-accent text-accent-foreground drop-shadow-[0px_0px_12px_hsl(var(--accent))]":e}),onClick:t,children:n})}var rS={exports:{}},hp={},Ov={exports:{}},OD={};function TD(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=TD(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function eO(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=TD(e))&&(r&&(r+=" "),r+=t);return r}const bae=Object.freeze(Object.defineProperty({__proto__:null,clsx:eO,default:eO},Symbol.toStringTag,{value:"Module"})),wae=ZD(bae);var Lt={},li={};Object.defineProperty(li,"__esModule",{value:!0});li.dontSetMe=Cae;li.findInArray=Sae;li.int=_ae;li.isFunction=kae;li.isNum=Eae;function Sae(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function kae(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Eae(e){return typeof e=="number"&&!isNaN(e)}function _ae(e){return parseInt(e,10)}function Cae(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Ol={};Object.defineProperty(Ol,"__esModule",{value:!0});Ol.browserPrefixToKey=MD;Ol.browserPrefixToStyle=Oae;Ol.default=void 0;Ol.getPrefix=PD;const Qy=["Moz","Webkit","O","ms"];function PD(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Qy.length;r++)if(MD(t,Qy[r])in n)return Qy[r];return""}function MD(e,t){return t?"".concat(t).concat(Tae(e)):e}function Oae(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Tae(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Ol.default=PD();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.addClassName=$D;Lt.addEvent=Rae;Lt.addUserSelectStyles=Uae;Lt.createCSSTransform=jae;Lt.createSVGTransform=zae;Lt.getTouch=Fae;Lt.getTouchIdentifier=Bae;Lt.getTranslation=oS;Lt.innerHeight=Dae;Lt.innerWidth=Iae;Lt.matchesSelector=ND;Lt.matchesSelectorAndParentsTo=Mae;Lt.offsetXYFromParent=Lae;Lt.outerHeight=$ae;Lt.outerWidth=Aae;Lt.removeClassName=AD;Lt.removeEvent=Nae;Lt.removeUserSelectStyles=Vae;var Cr=li,tO=Pae(Ol);function RD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(RD=function(r){return r?n:t})(e)}function Pae(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=RD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let th="";function ND(e,t){return th||(th=(0,Cr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Cr.isFunction)(e[n])})),(0,Cr.isFunction)(e[th])?e[th](t):!1}function Mae(e,t,n){let r=e;do{if(ND(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Rae(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function Nae(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function $ae(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Cr.int)(n.borderTopWidth),t+=(0,Cr.int)(n.borderBottomWidth),t}function Aae(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Cr.int)(n.borderLeftWidth),t+=(0,Cr.int)(n.borderRightWidth),t}function Dae(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Cr.int)(n.paddingTop),t-=(0,Cr.int)(n.paddingBottom),t}function Iae(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Cr.int)(n.paddingLeft),t-=(0,Cr.int)(n.paddingRight),t}function Lae(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function jae(e,t){const n=oS(e,t,"px");return{[(0,tO.browserPrefixToKey)("transform",tO.default)]:n}}function zae(e,t){return oS(e,t,"")}function oS(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function Fae(e,t){return e.targetTouches&&(0,Cr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Cr.findInArray)(e.changedTouches,n=>t===n.identifier)}function Bae(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Uae(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
238
|
+
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
239
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&$D(e.body,"react-draggable-transparent-selection")}function Vae(e){if(e)try{if(e.body&&AD(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function $D(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function AD(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var ci={};Object.defineProperty(ci,"__esModule",{value:!0});ci.canDragX=Kae;ci.canDragY=qae;ci.createCoreData=Yae;ci.createDraggableData=Xae;ci.getBoundPosition=Hae;ci.getControlPosition=Gae;ci.snapToGrid=Wae;var gr=li,mc=Lt;function Hae(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:Zae(r);const o=iS(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,gr.int)(u.paddingLeft)+(0,gr.int)(c.marginLeft),top:-o.offsetTop+(0,gr.int)(u.paddingTop)+(0,gr.int)(c.marginTop),right:(0,mc.innerWidth)(l)-(0,mc.outerWidth)(o)-o.offsetLeft+(0,gr.int)(u.paddingRight)-(0,gr.int)(c.marginRight),bottom:(0,mc.innerHeight)(l)-(0,mc.outerHeight)(o)-o.offsetTop+(0,gr.int)(u.paddingBottom)-(0,gr.int)(c.marginBottom)}}return(0,gr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,gr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,gr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,gr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Wae(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function Kae(e){return e.props.axis==="both"||e.props.axis==="x"}function qae(e){return e.props.axis==="both"||e.props.axis==="y"}function Gae(e,t,n){const r=typeof t=="number"?(0,mc.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=iS(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,mc.offsetXYFromParent)(r||e,i,n.props.scale)}function Yae(e,t,n){const r=!(0,gr.isNum)(e.lastX),o=iS(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Xae(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Zae(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function iS(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Tv={},Pv={};Object.defineProperty(Pv,"__esModule",{value:!0});Pv.default=Jae;function Jae(){}Object.defineProperty(Tv,"__esModule",{value:!0});Tv.default=void 0;var e0=ele(h),tr=sS(np),Qae=sS($r),Rn=Lt,as=ci,t0=li,Uu=sS(Pv);function sS(e){return e&&e.__esModule?e:{default:e}}function DD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(DD=function(r){return r?n:t})(e)}function ele(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=DD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Bn(e,t,n){return t=tle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tle(e){var t=nle(e,"string");return typeof t=="symbol"?t:String(t)}function nle(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const po={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ls=po.mouse,Mv=class extends e0.Component{constructor(){super(...arguments),Bn(this,"dragging",!1),Bn(this,"lastX",NaN),Bn(this,"lastY",NaN),Bn(this,"touchIdentifier",null),Bn(this,"mounted",!1),Bn(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Rn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Rn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Rn.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,as.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,as.createCoreData)(this,s,a);(0,Uu.default)("DraggableCore: handleDragStart: %j",l),(0,Uu.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Rn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Rn.addEvent)(r,ls.move,this.handleDrag),(0,Rn.addEvent)(r,ls.stop,this.handleDragStop))}),Bn(this,"handleDrag",t=>{const n=(0,as.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,as.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,as.createCoreData)(this,r,o);if((0,Uu.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),Bn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,as.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,as.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,as.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Rn.removeUserSelectStyles)(a.ownerDocument),(0,Uu.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Uu.default)("DraggableCore: Removing handlers"),(0,Rn.removeEvent)(a.ownerDocument,ls.move,this.handleDrag),(0,Rn.removeEvent)(a.ownerDocument,ls.stop,this.handleDragStop))}),Bn(this,"onMouseDown",t=>(ls=po.mouse,this.handleDragStart(t))),Bn(this,"onMouseUp",t=>(ls=po.mouse,this.handleDragStop(t))),Bn(this,"onTouchStart",t=>(ls=po.touch,this.handleDragStart(t))),Bn(this,"onTouchEnd",t=>(ls=po.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Rn.addEvent)(t,po.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Rn.removeEvent)(n,po.mouse.move,this.handleDrag),(0,Rn.removeEvent)(n,po.touch.move,this.handleDrag),(0,Rn.removeEvent)(n,po.mouse.stop,this.handleDragStop),(0,Rn.removeEvent)(n,po.touch.stop,this.handleDragStop),(0,Rn.removeEvent)(t,po.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Rn.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:Qae.default.findDOMNode(this)}render(){return e0.cloneElement(e0.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Tv.default=Mv;Bn(Mv,"displayName","DraggableCore");Bn(Mv,"propTypes",{allowAnyClick:tr.default.bool,children:tr.default.node.isRequired,disabled:tr.default.bool,enableUserSelectHack:tr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:tr.default.arrayOf(tr.default.number),handle:tr.default.string,cancel:tr.default.string,nodeRef:tr.default.object,onStart:tr.default.func,onDrag:tr.default.func,onStop:tr.default.func,onMouseDown:tr.default.func,scale:tr.default.number,className:t0.dontSetMe,style:t0.dontSetMe,transform:t0.dontSetMe});Bn(Mv,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(h),n=u(np),r=u($r),o=u(wae),i=Lt,s=ci,a=li,l=u(Tv),c=u(Pv);function u(x){return x&&x.__esModule?x:{default:x}}function d(x){if(typeof WeakMap!="function")return null;var w=new WeakMap,k=new WeakMap;return(d=function(E){return E?k:w})(x)}function f(x,w){if(!w&&x&&x.__esModule)return x;if(x===null||typeof x!="object"&&typeof x!="function")return{default:x};var k=d(w);if(k&&k.has(x))return k.get(x);var E={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _ in x)if(_!=="default"&&Object.prototype.hasOwnProperty.call(x,_)){var P=S?Object.getOwnPropertyDescriptor(x,_):null;P&&(P.get||P.set)?Object.defineProperty(E,_,P):E[_]=x[_]}return E.default=x,k&&k.set(x,E),E}function p(){return p=Object.assign?Object.assign.bind():function(x){for(var w=1;w<arguments.length;w++){var k=arguments[w];for(var E in k)Object.prototype.hasOwnProperty.call(k,E)&&(x[E]=k[E])}return x},p.apply(this,arguments)}function m(x,w,k){return w=g(w),w in x?Object.defineProperty(x,w,{value:k,enumerable:!0,configurable:!0,writable:!0}):x[w]=k,x}function g(x){var w=y(x,"string");return typeof w=="symbol"?w:String(w)}function y(x,w){if(typeof x!="object"||x===null)return x;var k=x[Symbol.toPrimitive];if(k!==void 0){var E=k.call(x,w||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(x)}class v extends t.Component{static getDerivedStateFromProps(w,k){let{position:E}=w,{prevPropsPosition:S}=k;return E&&(!S||E.x!==S.x||E.y!==S.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:S}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(w){super(w),m(this,"onDragStart",(k,E)=>{if((0,c.default)("Draggable: onDragStart: %j",E),this.props.onStart(k,(0,s.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(k,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const S=(0,s.createDraggableData)(this,E),_={x:S.x,y:S.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:A}=_;_.x+=this.state.slackX,_.y+=this.state.slackY;const[I,L]=(0,s.getBoundPosition)(this,_.x,_.y);_.x=I,_.y=L,_.slackX=this.state.slackX+(M-_.x),_.slackY=this.state.slackY+(A-_.y),S.x=_.x,S.y=_.y,S.deltaX=_.x-this.state.x,S.deltaY=_.y-this.state.y}if(this.props.onDrag(k,S)===!1)return!1;this.setState(_)}),m(this,"onDragStop",(k,E)=>{if(!this.state.dragging||this.props.onStop(k,(0,s.createDraggableData)(this,E))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",E);const _={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:A}=this.props.position;_.x=M,_.y=A}this.setState(_)}),this.state={dragging:!1,dragged:!1,x:w.position?w.position.x:w.defaultPosition.x,y:w.position?w.position.y:w.defaultPosition.y,prevPropsPosition:{...w.position},slackX:0,slackY:0,isElementSVG:!1},w.position&&!(w.onDrag||w.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var w,k;return(w=(k=this.props)===null||k===void 0||(k=k.nodeRef)===null||k===void 0?void 0:k.current)!==null&&w!==void 0?w:r.default.findDOMNode(this)}render(){const{axis:w,bounds:k,children:E,defaultPosition:S,defaultClassName:_,defaultClassNameDragging:P,defaultClassNameDragged:M,position:A,positionOffset:I,scale:L,...re}=this.props;let V={},K=null;const T=!!!A||this.state.dragging,O=A||S,R={x:(0,s.canDragX)(this)&&T?this.state.x:O.x,y:(0,s.canDragY)(this)&&T?this.state.y:O.y};this.state.isElementSVG?K=(0,i.createSVGTransform)(R,I):V=(0,i.createCSSTransform)(R,I);const N=(0,o.default)(E.props.className||"",_,{[P]:this.state.dragging,[M]:this.state.dragged});return t.createElement(l.default,p({},re,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:N,style:{...E.props.style,...V},transform:K}))}}e.default=v,m(v,"displayName","Draggable"),m(v,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(v,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(OD);const{default:ID,DraggableCore:rle}=OD;Ov.exports=ID;Ov.exports.default=ID;Ov.exports.DraggableCore=rle;var ole=Ov.exports,aS={};aS.__esModule=!0;aS.cloneElement=ule;var ile=sle(h);function sle(e){return e&&e.__esModule?e:{default:e}}function nO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function rO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nO(Object(n),!0).forEach(function(r){ale(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ale(e,t,n){return t=lle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lle(e){var t=cle(e,"string");return typeof t=="symbol"?t:String(t)}function cle(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ule(e,t){return t.style&&e.props.style&&(t.style=rO(rO({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),ile.default.cloneElement(e,t)}var mp={};mp.__esModule=!0;mp.resizableProps=void 0;var Ne=dle(np);function dle(e){return e&&e.__esModule?e:{default:e}}var fle={axis:Ne.default.oneOf(["both","x","y","none"]),className:Ne.default.string,children:Ne.default.element.isRequired,draggableOpts:Ne.default.shape({allowAnyClick:Ne.default.bool,cancel:Ne.default.string,children:Ne.default.node,disabled:Ne.default.bool,enableUserSelectHack:Ne.default.bool,offsetParent:Ne.default.node,grid:Ne.default.arrayOf(Ne.default.number),handle:Ne.default.string,nodeRef:Ne.default.object,onStart:Ne.default.func,onDrag:Ne.default.func,onStop:Ne.default.func,onMouseDown:Ne.default.func,scale:Ne.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=Ne.default.number).isRequired.apply(i,n)}return Ne.default.number.apply(Ne.default,n)},handle:Ne.default.oneOfType([Ne.default.node,Ne.default.func]),handleSize:Ne.default.arrayOf(Ne.default.number),lockAspectRatio:Ne.default.bool,maxConstraints:Ne.default.arrayOf(Ne.default.number),minConstraints:Ne.default.arrayOf(Ne.default.number),onResizeStop:Ne.default.func,onResizeStart:Ne.default.func,onResize:Ne.default.func,resizeHandles:Ne.default.arrayOf(Ne.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Ne.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=Ne.default.number).isRequired.apply(i,n)}return Ne.default.number.apply(Ne.default,n)}};mp.resizableProps=fle;hp.__esModule=!0;hp.default=void 0;var Vu=vle(h),ple=ole,hle=aS,mle=mp,gle=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function LD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(LD=function(o){return o?n:t})(e)}function vle(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=LD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function yb(){return yb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yb.apply(this,arguments)}function yle(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function oO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function n0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oO(Object(n),!0).forEach(function(r){xle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xle(e,t,n){return t=ble(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ble(e){var t=wle(e,"string");return typeof t=="symbol"?t:String(t)}function wle(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sle(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,xb(e,t)}function xb(e,t){return xb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},xb(e,t)}var lS=function(e){Sle(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,f=i-this.props.height;Math.abs(d)>Math.abs(f*u)?i=o/u:o=i*u}var p=o,m=i,g=this.slack||[0,0],y=g[0],v=g[1];return o+=y,i+=v,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[y+(p-o),v+(m-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&s.resetData();var f=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!p)){var m=i[0],g=i[i.length-1],y=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(g==="w"){var v=y.left-s.lastHandleRect.left;u+=v}if(m==="n"){var x=y.top-s.lastHandleRect.top;d+=x}}s.lastHandleRect=y,g==="w"&&(u=-u),m==="n"&&(d=-d);var w=s.props.width+(f?u/s.props.transformScale:0),k=s.props.height+(p?d/s.props.transformScale:0),E=s.runConstraints(w,k);w=E[0],k=E[1];var S=w!==s.props.width||k!==s.props.height,_=typeof s.props[o]=="function"?s.props[o]:null,P=o==="onResize"&&!S;_&&!P&&(a.persist==null||a.persist(),_(a,{node:c,size:{width:w,height:k},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Vu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=n0({ref:i},a?{}:{handleAxis:o});return Vu.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=yle(i,gle);return(0,hle.cloneElement)(s,n0(n0({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var f,p=(f=o.handleRefs[d])!=null?f:o.handleRefs[d]=Vu.createRef();return Vu.createElement(ple.DraggableCore,yb({},l,{nodeRef:p,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,p))}))}))},t}(Vu.Component);hp.default=lS;lS.propTypes=mle.resizableProps;lS.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Rv={};Rv.__esModule=!0;Rv.default=void 0;var r0=Ole(h),kle=jD(np),Ele=jD(hp),_le=mp,Cle=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function jD(e){return e&&e.__esModule?e:{default:e}}function zD(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(zD=function(o){return o?n:t})(e)}function Ole(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=zD(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function bb(){return bb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bb.apply(this,arguments)}function iO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function sg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iO(Object(n),!0).forEach(function(r){Tle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tle(e,t,n){return t=Ple(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ple(e){var t=Mle(e,"string");return typeof t=="symbol"?t:String(t)}function Mle(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rle(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Nle(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,wb(e,t)}function wb(e,t){return wb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},wb(e,t)}var FD=function(e){Nle(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,f=o.lockAspectRatio,p=o.axis;o.width,o.height;var m=o.resizeHandles,g=o.style,y=o.transformScale,v=Rle(o,Cle);return r0.createElement(Ele.default,{axis:p,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:f,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:m,transformScale:y,width:this.state.width},r0.createElement("div",bb({},v,{style:sg(sg({},g),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(r0.Component);Rv.default=FD;FD.propTypes=sg(sg({},_le.resizableProps),{},{children:kle.default.element});rS.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};var $le=rS.exports.Resizable=hp.default;rS.exports.ResizableBox=Rv.default;const Ql=400,o0=250;function Ale({position:e,onClose:t,children:n}){const[r,o]=h.useState({height:window.innerHeight,width:window.innerWidth});h.useEffect(()=>{const g=()=>{window.visualViewport?o({height:window.visualViewport.height,width:window.visualViewport.width}):o({height:window.innerHeight,width:window.innerWidth})};return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),()=>{window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g)}},[]);const[i,s,a,l,c]=Dle({position:e,globalSize:r});h.useEffect(()=>{c({left:r.width-Ql-74,top:16})},[r]),h.useEffect(()=>{const g=y=>{y.key==="Escape"&&t()};return document.addEventListener("keyup",g),()=>{document.removeEventListener("keyup",g)}},[]);const{windowSize:u,setWindowSize:d}=Ng(),f=r.width<=600||r.height<=600;h.useEffect(()=>{var g,y;d({height:window.innerHeight-30,width:Ql,innerHeight:window.innerHeight-30-(64+(((y=(g=p.current)==null?void 0:g.getBoundingClientRect())==null?void 0:y.height)||0))})},[]);const p=h.useRef(null);h.useEffect(()=>{if(f){c({top:0,left:0}),d({height:window.innerHeight,width:window.innerWidth,innerHeight:window.innerHeight-64});const g=document.ownerDocument||document,y=g.body.style.overflow;return g.body.style.overflow="hidden",()=>{g.body.style.overflow=y}}},[f,r]);const m=h.useRef();return b.jsx($le,{minConstraints:f?void 0:[Ql,o0],width:(u==null?void 0:u.width)||Ql,height:(u==null?void 0:u.height)||o0,onResize:(g,{size:y})=>{var v,x;return!f&&d({...y,innerHeight:y.height-(64+(((x=(v=p.current)==null?void 0:v.getBoundingClientRect())==null?void 0:x.height)||0))})},handle:f?null:b.jsx("div",{className:"fixed bottom-0 right-0 cursor-se-resize",children:b.jsx("svg",{height:"18",viewBox:"0 0 18 18",width:"18",xmlns:"http://www.w3.org/2000/svg",children:b.jsx("path",{d:"m14.228 16.227a1 1 0 0 1 -.707-1.707l1-1a1 1 0 0 1 1.416 1.414l-1 1a1 1 0 0 1 -.707.293zm-5.638 0a1 1 0 0 1 -.707-1.707l6.638-6.638a1 1 0 0 1 1.416 1.414l-6.638 6.638a1 1 0 0 1 -.707.293zm-5.84 0a1 1 0 0 1 -.707-1.707l12.477-12.477a1 1 0 1 1 1.415 1.414l-12.478 12.477a1 1 0 0 1 -.707.293z",fill:"currentColor"})})}),className:Qt("absolute inset-0 tablet:w-auto tablet:h-auto tablet:min-h-fit max-h-svh bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg text-primary drop-shadow-2xl min-w-[320px]",{"opacity-0":!s,"opacity-100":s,"rounded-lg":!f}),children:b.jsxs("div",{style:{width:(u==null?void 0:u.width)||Ql,height:(u==null?void 0:u.height)||o0,left:i.left,top:i.top,right:i.right,bottom:i.bottom},children:[b.jsxs("div",{ref:a,className:"relative flex items-center justify-center px-2 py-2 text-primary",onTouchStart:g=>{var v;const y=(v=g.changedTouches)==null?void 0:v[0];y&&(m.current={time:Date.now(),y:y.clientY})},onTouchEnd:g=>{var v;const y=(v=g.changedTouches)==null?void 0:v[0];y&&m.current&&y.clientY-m.current.y>20&&y.clientY-m.current.y<100&&Date.now()-m.current.time<150&&(g.preventDefault(),t())},children:[f?b.jsx("div",{className:"py-6",children:b.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 h-[8px] w-[80px] top-4 bg-primary rounded-lg"})}):b.jsx(L4,{size:16,className:"block w-full cursor-grab",onMouseDown:g=>{f||(g.preventDefault(),g.stopPropagation(),l())}}),b.jsx("button",{className:"absolute top-0 right-0 px-4 py-2 focus:outline-none focus-visible:outline-accent",onClick:t,children:b.jsx(Rg,{size:f?32:16})})]}),b.jsxs("div",{children:[Array.isArray(n)&&n.slice(0,1),b.jsx(Sc,{className:"relative",style:{height:u==null?void 0:u.innerHeight},children:Array.isArray(n)?n.slice(1,-1):n}),b.jsx("div",{ref:p,className:"w-full px-4 pb-0",children:Array.isArray(n)&&n.slice(-1)})]})]})})}function Dle({position:e,globalSize:t}){var c,u;const[n,r]=h.useState({left:t.width-Ql-74,top:16});h.useEffect(()=>{e&&r(e)},[e]);const[o,i]=h.useState(!1),s=h.useRef(null);h.useEffect(()=>{const d=()=>{i(!1)},f=p=>{var m,g,y,v;if(o){p.preventDefault(),p.stopPropagation();const x=-((((g=(m=s==null?void 0:s.current)==null?void 0:m.getBoundingClientRect())==null?void 0:g.width)||0)/2)+p.clientX,w=-((((v=(y=s==null?void 0:s.current)==null?void 0:y.getBoundingClientRect())==null?void 0:v.height)||0)/2)+ +p.clientY;r({left:x<0?0:x,top:w<0?0:w})}};return document.addEventListener("mouseup",d),document.addEventListener("mousemove",f),()=>{document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",f)}},[o]);const a=()=>i(!0),l=!!((u=(c=s==null?void 0:s.current)==null?void 0:c.getBoundingClientRect())!=null&&u.width);return[n,l,s,a,r]}function Ile({defaultTheme:e,api:t,store:n,onSubmit:r}){const[o,i]=MP(e),s=FP(t),[a,l]=zle(),[c,u]=jle(a),[d,f]=h.useState(null),p=d!=null&&d.path?d.path.split(","):[],[m,g]=h.useState(Object.fromEntries(p.map(I=>[I,{status:"not-asked"}])));h.useEffect(()=>{g(Object.fromEntries(p.map(L=>[L,{status:"loading"}])));async function I(){const L=await Promise.all(p.map(async re=>{const[V,K]=ot.splitModuleIdAndModulePath(re),C=await n.getModule(V,!1);if(St.isErr(C))return[V,{status:"error",error:C.error.message}];{const{source:T,schema:O}=C.value;if(!T||!O)return[V,{status:"error",error:"Val could load this content. Please try again."}];{const R=ot.resolvePath(K,T,O);return!R.source||!R.schema?[V,{status:"error",error:"Val could not internally resolve this content. This is possibly due to a misconfiguration or a bug in Val."}]:[re,{status:"success",data:{source:R.source,schema:R.schema}}]}}}));g(Object.fromEntries(L))}I()},[p.join(";")]);const[y,v]=h.useState();h.useEffect(()=>{n.reset()},[]);const{patches:x,setPatchResetId:w}=RP(s,t),k=h.useCallback(I=>async L=>{const[re,V]=ot.splitModuleIdAndModulePath(I),K=await L(ot.createPatchPath(V));n.applyPatch(re,K),w(C=>C+1),r(!0)},[]),[E,S]=h.useState(!1),[_,P]=h.useState({globalError:null}),[M,A]=h.useState(!1);return h.useEffect(()=>{let I=!1;return Object.keys(x).length>0&&(A(!0),t.postValidate({patches:x}).then(L=>{I||(St.isErr(L)?P({globalError:{message:L.error.message}}):P({globalError:null,...L.value}))}).finally(()=>{I||A(!1)})),()=>{I=!0}},[x]),b.jsx(E1.Provider,{value:{theme:o,session:s,editMode:a,setEditMode:l,setTheme:i,windowSize:y,setWindowSize:v},children:b.jsxs("div",{"data-mode":o,className:"font-serif antialiased",style:{position:"fixed",top:0,left:0,zIndex:8999},children:[E&&b.jsx("div",{className:"fixed z-5 top-[16px] left-[16px] w-[calc(100%-32px-50px-16px)] h-[calc(100svh-32px)]",children:b.jsx(i8,{patches:x,isValidating:M,validationResponse:_,api:t,onCancel:()=>{S(!1)},onCommit:()=>{w(I=>I+1)}})}),b.jsxs(gae,{children:[b.jsx(_D,{}),b.jsx("div",{className:"fixed -translate-y-1/2 right-4 top-1/2 z-overlay",children:b.jsx(xae,{direction:"vertical",api:t,patches:x,onClickPatches:()=>S(I=>!I)})})]}),s.status==="success"&&s.data.enabled&&(a==="hover"||a==="window")&&c.path&&b.jsx(Lle,{hoverTarget:c,setHoverTarget:u,setEditMode:l,setWindowTarget:f}),a==="window"&&d&&b.jsx(Ale,{onClose:()=>{f(null),l("hover")},children:b.jsx("div",{className:"p-4",style:{maxHeight:y==null?void 0:y.innerHeight,maxWidth:y==null?void 0:y.width},children:Object.entries(m).map(([I,L])=>{if(L.status!=="success")return b.jsxs("div",{children:[b.jsxs("span",{children:[I,": ",L.status]}),L.status==="error"&&b.jsx("pre",{children:L.error})]},I);const{source:re,schema:V}=L.data;return!re||!V?b.jsxs("div",{children:["Module: ",I," is missing source or schema"]}):b.jsx(Cv,{initOnSubmit:k,path:I,schema:V,source:re,setSelectedPath:()=>{},top:!0},I)})})})]})})}function Lle({hoverTarget:e,setEditMode:t,setWindowTarget:n,setHoverTarget:r}){var i;const o=(i=e.element)==null?void 0:i.getBoundingClientRect();return h.useEffect(()=>{if(e.path){const s=a=>{a.target&&a.target instanceof HTMLElement&&a.target.id!=="val-shadow-root"&&n({...e,path:e.path,mouse:{x:a.pageX,y:a.pageY}}),t("window"),r(null),a.stopPropagation()};return document.body.addEventListener("click",s),()=>{document.body.removeEventListener("click",s)}}},[e]),b.jsx("div",{id:"val-hover",className:"fixed border-2 cursor-pointer z-overlay-hover border-accent",style:{pointerEvents:"none",top:o==null?void 0:o.top,left:o==null?void 0:o.left,width:o==null?void 0:o.width,height:o==null?void 0:o.height},children:b.jsx("div",{className:"flex items-center justify-end w-full text-xs",children:b.jsx("div",{className:"flex items-center justify-center px-3 py-1 border-b-2 border-l-2 text-accent-foreground bg-accent border-accent",style:{maxHeight:(o==null?void 0:o.height)&&o.height-4,fontSize:o!=null&&o.height&&o.height<=16?o.height-4:void 0},children:"Edit"})})})}function jle(e){const[t,n]=h.useState(),[r,o]=h.useState(),[i,s]=h.useState();function a(l){if(l){const c=[];l.dataset.valPath&&c.push(l.dataset.valPath);for(const u of Array.from(l.querySelectorAll("*")))if(u instanceof HTMLElement){const d=u.dataset.valPath;d&&c.push(d)}c.length>0&&(n(l),o(c.join(",")),s(l.getBoundingClientRect()))}}return h.useEffect(()=>{if(e==="hover"||e==="window"){const l=c=>{a(c.target)};return document.addEventListener("mouseover",l),()=>{n(void 0),o(void 0),document.removeEventListener("mouseover",l)}}},[e]),h.useEffect(()=>{const l=()=>{t&&s(t.getBoundingClientRect())},c=new ResizeObserver(()=>{t&&s(t.getBoundingClientRect())}),u=document.getElementById("val-shadow-root");return t&&u&&c.observe(u),document.addEventListener("scroll",l,{passive:!0}),()=>{document.removeEventListener("scroll",l),c.disconnect()}},[t]),[{path:r,element:t,rect:i},l=>{var c;n(l==null?void 0:l.element),o(l==null?void 0:l.path),s((c=l==null?void 0:l.element)==null?void 0:c.getBoundingClientRect())}]}const nh="val-edit-mode";function zle(){const[e,t]=h.useState("off");h.useEffect(()=>{try{const r=localStorage.getItem(nh);r==="off"||r==="hover"||r==="window"||r==="full"?t(r==="window"?"hover":r):(localStorage.removeItem(nh),t("off"))}catch{t("off")}},[]);const n=h.useCallback(r=>{typeof r=="function"?t(o=>{const i=r(o);return localStorage.setItem(nh,i),i}):(localStorage.setItem(nh,r),t(r))},[]);return[e,n]}function Fle(){const e="/api/val",t=new F2(e),n=new RM(t);return b.jsx(yD,{fallbackRender:xD,children:b.jsxs(eae,{children:[b.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),b.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),b.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",rel:"stylesheet"}),b.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",rel:"stylesheet"}),b.jsx("link",{rel:"stylesheet",href:`${e}/static${tae}`}),b.jsx(Ile,{api:t,store:n,onSubmit:()=>{const r=new CustomEvent("val-event",{detail:{type:"overlay-submit",refreshRequired:!0}});window.dispatchEvent(r)}})]})})}const sO=document.getElementById(nae),aO=document.getElementById(rae);sO?Ah.createRoot(sO).render(b.jsx(te.StrictMode,{children:b.jsx(Jse,{})})):aO?Ah.createRoot(aO).render(b.jsx(te.StrictMode,{children:b.jsx(Fle,{})})):console.error("Val: could not mount Val element. Check your configuration.");
|